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