Interplane page as plain text, for reading tools and agents. English is the reference text: translate it with your own tool. Text in backticks and in ``` blocks (commands, fingerprints, file names) and link targets in <...> are exact: copy them, never translate them. Page: /drakestapleton/CUDApp/blob/main/backend/amd/gfx942/fp8gemv_b128-gfx942.s # CUDApp CUDA++: AIEN’s GPU machine-code toolchain, runtime and driver client for NVIDIA GPUs without the CUDA toolkit. Hardware coverage and driver replacement limits are explicit. Brought by drakestapleton Sign in to star 0 stars 0 watching About Files History Releases Proposed changes Issues For developers branch `main` Branches Tags History `CUDApp / backend / amd / gfx942 / fp8gemv_b128-gfx942.s` 175 lines · 5026 bytes Raw Blame History 1 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 2 // LLVM is an independent encoding oracle, never the production object producer. 3 .amdgcn_target "amdgcn-amd-amdhsa--gfx942" 4 .text 5 .p2align 8 6 .globl fp8gemv_b128 7 .type fp8gemv_b128,@function 8 fp8gemv_b128: 9 s_load_dwordx4 s[4:7], s[0:1], 0 10 s_load_dwordx4 s[8:11], s[0:1], 16 11 s_load_dwordx2 s[12:13], s[0:1], 32 12 s_waitcnt lgkmcnt(0) 13 s_sub_u32 s17, s2, s12 14 s_cbranch_scc0 .L9 15 v_and_b32 v0, 0x3ff, v0 16 v_mov_b32 v1, s2 17 v_mul_lo_u32 v6, v1, s13 18 v_mul_hi_u32 v7, v1, s13 19 v_mov_b32 v5, s5 20 v_add_co_u32 v6, vcc, s4, v6 21 v_addc_co_u32 v7, vcc, v5, v7, vcc 22 v_add_co_u32 v6, vcc, v0, v6 23 v_addc_co_u32 v7, vcc, 0, v7, vcc 24 v_lshlrev_b32 v8, 2, v0 25 v_mov_b32 v9, 0 26 v_mov_b32 v5, s7 27 v_add_co_u32 v8, vcc, s6, v8 28 v_addc_co_u32 v9, vcc, v5, v9, vcc 29 v_lshlrev_b32 v10, 2, v1 30 v_lshrrev_b32 v11, 30, v1 31 v_mov_b32 v5, s11 32 v_add_co_u32 v10, vcc, s10, v10 33 v_addc_co_u32 v11, vcc, v5, v11, vcc 34 s_sub_u32 s4, s13, 1 35 s_lshr_b32 s4, s4, 7 36 s_add_u32 s4, s4, 1 37 v_lshrrev_b32 v1, 7, v1 38 v_mul_lo_u32 v12, v1, s4 39 v_mul_hi_u32 v13, v1, s4 40 v_lshrrev_b32 v5, 31, v12 41 v_lshlrev_b32 v12, 1, v12 42 v_lshlrev_b32 v13, 1, v13 43 v_add_u32 v13, v5, v13 44 v_mov_b32 v5, s9 45 v_add_co_u32 v12, vcc, s8, v12 46 v_addc_co_u32 v13, vcc, v5, v13, vcc 47 v_mov_b32 v16, 0 48 s_mov_b32 s16, s13 49 s_sub_u32 s17, s16, 1 50 s_cbranch_scc1 .L8 51 .L1: 52 v_mov_b32 v4, 0 53 v_cmp_gt_u32 vcc, s16, v0 54 s_and_saveexec_b64 s[14:15], vcc 55 global_load_ubyte v3, v[6:7], off 56 global_load_dword v5, v[8:9], off 57 s_waitcnt vmcnt(0) 58 v_and_b32 v17, 128, v3 59 v_lshlrev_b32 v17, 24, v17 60 v_and_b32 v18, 127, v3 61 v_mov_b32 v3, v18 62 v_cvt_f32_fp8 v3, v3 src0_sel:BYTE_0 63 v_mul_f32 v3, 2.0, v3 64 v_xor_b32 v3, v17, v3 65 v_mov_b32 v19, 126 66 v_cmp_gt_u32 vcc, v18, v19 67 s_and_saveexec_b64 s[4:5], vcc 68 v_mov_b32 v3, 0x7fc00000 69 s_mov_b64 exec, s[4:5] 70 v_fmac_f32 v4, v3, v5 71 s_mov_b64 exec, s[14:15] 72 v_add_u32 v15, 64, v0 73 v_cmp_gt_u32 vcc, s16, v15 74 s_and_saveexec_b64 s[14:15], vcc 75 global_load_ubyte v3, v[6:7], off offset:64 76 global_load_dword v5, v[8:9], off offset:256 77 s_waitcnt vmcnt(0) 78 v_and_b32 v17, 128, v3 79 v_lshlrev_b32 v17, 24, v17 80 v_and_b32 v18, 127, v3 81 v_mov_b32 v3, v18 82 v_cvt_f32_fp8 v3, v3 src0_sel:BYTE_0 83 v_mul_f32 v3, 2.0, v3 84 v_xor_b32 v3, v17, v3 85 v_mov_b32 v19, 126 86 v_cmp_gt_u32 vcc, v18, v19 87 s_and_saveexec_b64 s[4:5], vcc 88 v_mov_b32 v3, 0x7fc00000 89 s_mov_b64 exec, s[4:5] 90 v_fmac_f32 v4, v3, v5 91 s_mov_b64 exec, s[14:15] 92 v_lshlrev_b32 v2, 2, v0 93 v_xor_b32 v15, 128, v2 94 ds_bpermute_b32 v5, v15, v4 95 s_waitcnt lgkmcnt(0) 96 v_add_f32 v4, v4, v5 97 v_xor_b32 v15, 64, v2 98 ds_bpermute_b32 v5, v15, v4 99 s_waitcnt lgkmcnt(0) 100 v_add_f32 v4, v4, v5 101 v_xor_b32 v15, 32, v2 102 ds_bpermute_b32 v5, v15, v4 103 s_waitcnt lgkmcnt(0) 104 v_add_f32 v4, v4, v5 105 v_xor_b32 v15, 16, v2 106 ds_bpermute_b32 v5, v15, v4 107 s_waitcnt lgkmcnt(0) 108 v_add_f32 v4, v4, v5 109 v_xor_b32 v15, 8, v2 110 ds_bpermute_b32 v5, v15, v4 111 s_waitcnt lgkmcnt(0) 112 v_add_f32 v4, v4, v5 113 v_xor_b32 v15, 4, v2 114 ds_bpermute_b32 v5, v15, v4 115 s_waitcnt lgkmcnt(0) 116 v_add_f32 v4, v4, v5 117 v_mov_b32 v17, 0 118 global_load_short_d16_hi v17, v[12:13], off 119 s_waitcnt vmcnt(0) 120 v_fmac_f32 v16, v17, v4 121 s_sub_u32 s17, s16, 129 122 s_cbranch_scc1 .L8 123 s_sub_u32 s16, s16, 128 124 v_add_co_u32 v6, vcc, 128, v6 125 v_addc_co_u32 v7, vcc, 0, v7, vcc 126 v_add_co_u32 v8, vcc, 512, v8 127 v_addc_co_u32 v9, vcc, 0, v9, vcc 128 v_add_co_u32 v12, vcc, 2, v12 129 v_addc_co_u32 v13, vcc, 0, v13, vcc 130 s_cbranch_scc0 .L1 131 .L8: 132 v_cmp_gt_u32 vcc, 1, v0 133 s_and_saveexec_b64 s[14:15], vcc 134 global_store_dword v[10:11], v16, off 135 .L9: 136 s_endpgm 137 .Lend: 138 .size fp8gemv_b128, .Lend-fp8gemv_b128 139 .rodata 140 .p2align 6 141 .amdhsa_kernel fp8gemv_b128 142 .amdhsa_user_sgpr_kernarg_segment_ptr 1 143 .amdhsa_system_sgpr_workgroup_id_x 1 144 .amdhsa_system_vgpr_workitem_id 0 145 .amdhsa_kernarg_size 40 146 .amdhsa_next_free_vgpr 24 147 .amdhsa_next_free_sgpr 18 148 .amdhsa_accum_offset 24 149 .amdhsa_float_denorm_mode_32 3 150 .end_amdhsa_kernel 151 .amdgpu_metadata 152 --- 153 amdhsa.version: [ 1, 2 ] 154 amdhsa.target: amdgcn-amd-amdhsa--gfx942 155 amdhsa.kernels: 156 - .name: fp8gemv_b128 157 .symbol: fp8gemv_b128.kd 158 .kernarg_segment_size: 40 159 .kernarg_segment_align: 8 160 .group_segment_fixed_size: 0 161 .private_segment_fixed_size: 0 162 .wavefront_size: 64 163 .sgpr_count: 24 164 .vgpr_count: 24 165 .agpr_count: 0 166 .max_flat_workgroup_size: 64 167 .args: 168 - { .name: W, .offset: 0, .size: 8, .value_kind: global_buffer, .address_space: global } 169 - { .name: x, .offset: 8, .size: 8, .value_kind: global_buffer, .address_space: global } 170 - { .name: scale_inv, .offset: 16, .size: 8, .value_kind: global_buffer, .address_space: global } 171 - { .name: !str y, .offset: 24, .size: 8, .value_kind: global_buffer, .address_space: global } 172 - { .name: M, .offset: 32, .size: 4, .value_kind: by_value } 173 - { .name: K, .offset: 36, .size: 4, .value_kind: by_value } 174 ... 175 .end_amdgpu_metadata