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