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/gdnstate_w-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 / gdnstate_w-gfx942.s` 213 lines · 5635 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 gdnstate_w 6 .p2align 8 7 .type gdnstate_w,@function 8 gdnstate_w: 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_load_dwordx2 s[16:17], s[0:1], 48 13 s_waitcnt lgkmcnt(0) 14 s_sub_u32 s28, s2, 48 15 s_cbranch_scc0 .L99 16 s_sub_u32 s28, s3, 16 17 s_cbranch_scc0 .L99 18 s_lshr_b32 s19, s2, 4 19 s_mul_i32 s28, s3, 3 20 s_add_u32 s28, s28, s19 21 v_and_b32 v0, 0x3ff, v0 22 v_cmp_gt_u32 vcc, 8, v0 23 s_and_saveexec_b64 s[22:23], vcc 24 v_mov_b32 v1, s2 25 v_and_b32 v1, 15, v1 26 v_lshlrev_b32 v1, 3, v1 27 v_add_u32 v1, v0, v1 28 v_lshlrev_b32 v1, 2, v1 29 s_lshl_b32 s29, s28, 16 30 v_add_u32 v2, s29, v1 31 v_mov_b32 v3, 0 32 v_mov_b32 v4, v2 33 v_mov_b32 v5, 0 34 v_mov_b32 v27, s9 35 v_add_co_u32 v2, vcc, s8, v2 36 v_addc_co_u32 v3, vcc, v27, v3, vcc 37 v_mov_b32 v27, s11 38 v_add_co_u32 v4, vcc, s10, v4 39 v_addc_co_u32 v5, vcc, v27, v5, vcc 40 v_mov_b32 v30, v4 41 v_mov_b32 v31, v5 42 s_lshl_b32 s29, s3, 9 43 v_mov_b32 v6, s29 44 v_mov_b32 v7, 0 45 v_mov_b32 v8, v6 46 v_mov_b32 v9, 0 47 v_mov_b32 v27, s5 48 v_add_co_u32 v6, vcc, s4, v6 49 v_addc_co_u32 v7, vcc, v27, v7, vcc 50 v_add_co_u32 v6, vcc, 0x2000, v6 51 v_addc_co_u32 v7, vcc, 0, v7, vcc 52 v_mov_b32 v27, s5 53 v_add_co_u32 v8, vcc, s4, v8 54 v_addc_co_u32 v9, vcc, v27, v9, vcc 55 s_lshl_b32 s29, s28, 9 56 v_add_u32 v10, s29, v1 57 v_mov_b32 v11, 0 58 v_mov_b32 v12, v10 59 v_mov_b32 v13, 0 60 v_mov_b32 v27, s7 61 v_add_co_u32 v10, vcc, s6, v10 62 v_addc_co_u32 v11, vcc, v27, v11, vcc 63 v_mov_b32 v27, s13 64 v_add_co_u32 v12, vcc, s12, v12 65 v_addc_co_u32 v13, vcc, v27, v13, vcc 66 s_lshl_b32 s29, s28, 2 67 v_mov_b32 v14, s29 68 v_mov_b32 v15, 0 69 v_mov_b32 v27, s15 70 v_add_co_u32 v14, vcc, s14, v14 71 v_addc_co_u32 v15, vcc, v27, v15, vcc 72 global_load_dword v20, v[14:15], off 73 v_mov_b32 v14, s29 74 v_mov_b32 v15, 0 75 v_mov_b32 v27, s17 76 v_add_co_u32 v14, vcc, s16, v14 77 v_addc_co_u32 v15, vcc, v27, v15, vcc 78 global_load_dword v21, v[14:15], off 79 global_load_dword v18, v[10:11], off 80 s_waitcnt vmcnt(0) 81 v_mov_b32 v22, 0 82 s_mov_b32 s18, 127 83 .L10: 84 global_load_dword v16, v[2:3], off 85 global_load_dword v24, v[6:7], off 86 s_waitcnt vmcnt(0) 87 v_mul_f32 v16, v20, v16 88 v_mul_f32 v26, v24, v16 89 v_add_f32 v22, v26, v22 90 global_store_dword v[4:5], v16, off 91 v_add_co_u32 v2, vcc, 0x200, v2 92 v_addc_co_u32 v3, vcc, 0, v3, vcc 93 v_add_co_u32 v4, vcc, 0x200, v4 94 v_addc_co_u32 v5, vcc, 0, v5, vcc 95 v_add_co_u32 v6, vcc, 4, v6 96 v_addc_co_u32 v7, vcc, 0, v7, vcc 97 s_sub_u32 s18, s18, 1 98 s_cbranch_scc0 .L10 99 s_waitcnt vmcnt(0) 100 v_sub_f32 v18, v18, v22 101 v_mul_f32 v18, v21, v18 102 v_mov_b32 v4, v30 103 v_mov_b32 v5, v31 104 v_mov_b32 v6, v8 105 v_mov_b32 v7, v9 106 v_add_co_u32 v6, vcc, 0x2000, v6 107 v_addc_co_u32 v7, vcc, 0, v7, vcc 108 v_mov_b32 v22, 0 109 s_mov_b32 s18, 127 110 .L20: 111 global_load_dword v16, v[4:5], off 112 global_load_dword v24, v[6:7], off 113 global_load_dword v25, v[8:9], off 114 s_waitcnt vmcnt(0) 115 v_mul_f32 v26, v24, v18 116 v_add_f32 v16, v26, v16 117 v_mul_f32 v26, v25, v16 118 v_add_f32 v22, v26, v22 119 global_store_dword v[4:5], v16, off 120 v_add_co_u32 v4, vcc, 0x200, v4 121 v_addc_co_u32 v5, vcc, 0, v5, vcc 122 v_add_co_u32 v6, vcc, 4, v6 123 v_addc_co_u32 v7, vcc, 0, v7, vcc 124 v_add_co_u32 v8, vcc, 4, v8 125 v_addc_co_u32 v9, vcc, 0, v9, vcc 126 s_sub_u32 s18, s18, 1 127 s_cbranch_scc0 .L20 128 // BF16_ROUND_CORE0 129 v_lshrrev_b32 v28, 16, v22 130 v_and_b32 v28, 1, v28 131 v_add_u32 v28, 0x7fff, v28 132 v_add_u32 v28, v22, v28 133 v_and_b32 v28, 0xffff0000, v28 134 v_and_b32 v29, 0x7fffffff, v22 135 v_mov_b32 v30, 0x7f800000 136 v_cmp_gt_u32 vcc, v29, v30 137 s_and_saveexec_b64 s[24:25], vcc 138 v_mov_b32 v28, 0x7fc00000 139 s_mov_b64 exec, s[24:25] 140 v_mov_b32 v22, v28 141 // END_BF16_ROUND_CORE0 142 global_store_dword v[12:13], v22, off 143 .L99: 144 s_endpgm 145 .Lgdnstate_w_end: 146 .size gdnstate_w, .Lgdnstate_w_end-gdnstate_w 147 .rodata 148 .p2align 6 149 .amdhsa_kernel gdnstate_w 150 .amdhsa_user_sgpr_kernarg_segment_ptr 1 151 .amdhsa_system_sgpr_workgroup_id_x 1 152 .amdhsa_system_sgpr_workgroup_id_y 1 153 .amdhsa_system_vgpr_workitem_id 0 154 .amdhsa_kernarg_size 56 155 .amdhsa_next_free_vgpr 32 156 .amdhsa_next_free_sgpr 30 157 .amdhsa_accum_offset 32 158 .amdhsa_float_denorm_mode_32 3 159 .end_amdhsa_kernel 160 .amdgpu_metadata 161 --- 162 amdhsa.version: [ 1, 2 ] 163 amdhsa.target: amdgcn-amd-amdhsa--gfx942 164 amdhsa.kernels: 165 - .name: gdnstate_w 166 .symbol: gdnstate_w.kd 167 .kernarg_segment_size: 56 168 .kernarg_segment_align: 8 169 .group_segment_fixed_size: 0 170 .private_segment_fixed_size: 0 171 .wavefront_size: 64 172 .sgpr_count: 36 173 .vgpr_count: 32 174 .agpr_count: 0 175 .max_flat_workgroup_size: 64 176 .args: 177 - .name: qk 178 .offset: 0 179 .size: 8 180 .value_kind: global_buffer 181 .address_space: global 182 - .name: value 183 .offset: 8 184 .size: 8 185 .value_kind: global_buffer 186 .address_space: global 187 - .name: oldstate 188 .offset: 16 189 .size: 8 190 .value_kind: global_buffer 191 .address_space: global 192 - .name: newstate 193 .offset: 24 194 .size: 8 195 .value_kind: global_buffer 196 .address_space: global 197 - .name: output 198 .offset: 32 199 .size: 8 200 .value_kind: global_buffer 201 .address_space: global 202 - .name: decay 203 .offset: 40 204 .size: 8 205 .value_kind: global_buffer 206 .address_space: global 207 - .name: beta 208 .offset: 48 209 .size: 8 210 .value_kind: global_buffer 211 .address_space: global 212 ... 213 .end_amdgpu_metadata