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