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/attn256_merge_step-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 / attn256_merge_step-gfx942.s` 183 lines · 4767 bytes Raw Blame History 1 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 2 // LLVM18 independent encoding oracle only. 3 .amdgcn_target "amdgcn-amd-amdhsa--gfx942" 4 .text 5 .globl attn256_merge_step 6 .p2align 8 7 .type attn256_merge_step,@function 8 attn256_merge_step: 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_dwordx4 s[12:15], s[0:1], 32 12 s_waitcnt lgkmcnt(0) 13 s_load_dwordx2 s[16:17], s[0:1], 40 14 s_waitcnt lgkmcnt(0) 15 v_mov_b32 v46, s16 16 v_mov_b32 v47, s17 17 global_load_dword v45, v[46:47], off 18 s_waitcnt vmcnt(0) 19 v_readfirstlane_b32 s14, v45 20 s_nop 1 21 s_load_dword s15, s[0:1], 48 22 s_waitcnt lgkmcnt(0) 23 s_sub_u32 s28, s14, s15 24 s_cbranch_scc0 .L99 25 s_add_u32 s14, s14, 1 26 s_sub_u32 s28, s3, 24 27 s_cbranch_scc0 .L99 28 v_and_b32 v0, 0x3ff, v0 29 v_lshlrev_b32 v1, 2, v0 30 s_mov_b32 s18, 0 31 s_sub_u32 s28, s14, 1 32 s_cbranch_scc1 .L2 33 s_lshr_b32 s18, s28, 6 34 s_add_u32 s18, s18, 1 35 .L2: 36 v_mov_b32 v12, 0 37 v_mov_b32 v13, 0 38 v_mov_b32 v14, 0 39 v_mov_b32 v15, 0 40 v_mov_b32 v17, 0 41 v_mov_b32 v16, 0xff800000 42 v_mov_b32 v29, 0x3fb8aa3b 43 v_mov_b32 v30, 0x3d800000 44 v_mov_b32 v31, s3 45 v_mul_lo_u32 v31, v31, s18 46 s_mov_b32 s21, 1040 47 v_mul_lo_u32 v32, v31, s21 48 v_mul_hi_u32 v33, v31, s21 49 v_mov_b32 v27, s11 50 v_add_co_u32 v32, vcc, s10, v32 51 v_addc_co_u32 v33, vcc, v27, v33, vcc 52 v_mov_b32 v6, s3 53 v_mov_b32 v7, 0 54 v_lshrrev_b32 v27, 22, v6 55 v_lshlrev_b32 v7, 10, v7 56 v_add_u32 v7, v27, v7 57 v_lshlrev_b32 v6, 10, v6 58 v_mov_b32 v27, s13 59 v_add_co_u32 v6, vcc, s12, v6 60 v_addc_co_u32 v7, vcc, v27, v7, vcc 61 v_lshlrev_b32 v31, 4, v0 62 v_add_co_u32 v6, vcc, v31, v6 63 v_addc_co_u32 v7, vcc, 0, v7, vcc 64 v_mov_b32 v40, v32 65 v_mov_b32 v41, v33 66 v_add_co_u32 v40, vcc, v31, v40 67 v_addc_co_u32 v41, vcc, 0, v41, vcc 68 s_mov_b32 s24, 0 69 .L30: 70 s_sub_u32 s28, s24, s18 71 s_cbranch_scc0 .L40 72 global_load_dwordx2 v[22:23], v[32:33], off 73 global_load_dwordx4 v[36:39], v[40:41], off offset:16 74 s_waitcnt vmcnt(0) 75 v_max_f32 v19, v16, v22 76 v_sub_f32 v20, v16, v19 77 v_mul_f32 v20, v29, v20 78 v_exp_f32 v20, v20 79 v_sub_f32 v21, v22, v19 80 v_mul_f32 v21, v29, v21 81 v_exp_f32 v21, v21 82 v_mul_f32 v17, v20, v17 83 v_fmac_f32 v17, v21, v23 84 v_mul_f32 v12, v20, v12 85 v_fmac_f32 v12, v21, v36 86 v_mul_f32 v13, v20, v13 87 v_fmac_f32 v13, v21, v37 88 v_mul_f32 v14, v20, v14 89 v_fmac_f32 v14, v21, v38 90 v_mul_f32 v15, v20, v15 91 v_fmac_f32 v15, v21, v39 92 v_mov_b32 v16, v19 93 v_add_co_u32 v32, vcc, 0x410, v32 94 v_addc_co_u32 v33, vcc, 0, v33, vcc 95 v_add_co_u32 v40, vcc, 0x410, v40 96 v_addc_co_u32 v41, vcc, 0, v41, vcc 97 s_add_u32 s24, s24, 1 98 s_sub_u32 s28, 0, 0 99 s_cbranch_scc0 .L30 100 .L40: 101 s_sub_u32 s28, s18, 1 102 s_cbranch_scc1 .L41 103 v_rcp_f32 v20, v17 104 s_nop 0 105 v_mul_f32 v12, v20, v12 106 v_mul_f32 v13, v20, v13 107 v_mul_f32 v14, v20, v14 108 v_mul_f32 v15, v20, v15 109 .L41: 110 global_store_dword v[6:7], v12, off 111 global_store_dword v[6:7], v13, off offset:4 112 global_store_dword v[6:7], v14, off offset:8 113 global_store_dword v[6:7], v15, off offset:12 114 .L99: 115 s_endpgm 116 .Lattn256_merge_step_end: 117 .size attn256_merge_step, .Lattn256_merge_step_end-attn256_merge_step 118 .rodata 119 .p2align 6 120 .amdhsa_kernel attn256_merge_step 121 .amdhsa_user_sgpr_kernarg_segment_ptr 1 122 .amdhsa_system_sgpr_workgroup_id_x 1 123 .amdhsa_system_sgpr_workgroup_id_y 1 124 .amdhsa_system_vgpr_workitem_id 0 125 .amdhsa_kernarg_size 52 126 .amdhsa_next_free_vgpr 48 127 .amdhsa_next_free_sgpr 29 128 .amdhsa_accum_offset 48 129 .amdhsa_float_denorm_mode_32 3 130 .end_amdhsa_kernel 131 .amdgpu_metadata 132 --- 133 amdhsa.version: [ 1, 2 ] 134 amdhsa.target: amdgcn-amd-amdhsa--gfx942 135 amdhsa.kernels: 136 - .name: attn256_merge_step 137 .symbol: attn256_merge_step.kd 138 .kernarg_segment_size: 52 139 .kernarg_segment_align: 8 140 .group_segment_fixed_size: 0 141 .private_segment_fixed_size: 0 142 .wavefront_size: 64 143 .sgpr_count: 35 144 .vgpr_count: 48 145 .agpr_count: 0 146 .max_flat_workgroup_size: 64 147 .args: 148 - .name: Q 149 .offset: 0 150 .size: 8 151 .value_kind: global_buffer 152 .address_space: global 153 - .name: K 154 .offset: 8 155 .size: 8 156 .value_kind: global_buffer 157 .address_space: global 158 - .name: V 159 .offset: 16 160 .size: 8 161 .value_kind: global_buffer 162 .address_space: global 163 - .name: partials 164 .offset: 24 165 .size: 8 166 .value_kind: global_buffer 167 .address_space: global 168 - .name: out 169 .offset: 32 170 .size: 8 171 .value_kind: global_buffer 172 .address_space: global 173 - .name: position 174 .offset: 40 175 .size: 8 176 .value_kind: global_buffer 177 .address_space: global 178 - .name: capacity 179 .offset: 48 180 .size: 4 181 .value_kind: by_value 182 ... 183 .end_amdgpu_metadata