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/residual5120-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 / residual5120-gfx942.s` 134 lines · 3585 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 residual5120 6 .p2align 8 7 .type residual5120,@function 8 residual5120: 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_waitcnt lgkmcnt(0) 13 s_mov_b32 s29, 0x50 14 s_sub_u32 s28, s2, s29 15 s_cbranch_scc0 .L99 16 s_sub_u32 s28, s3, 1 17 s_cbranch_scc0 .L99 18 v_and_b32 v0, 0x3ff, v0 19 v_mov_b32 v1, s2 20 v_lshlrev_b32 v1, 6, v1 21 v_add_u32 v1, v0, v1 22 v_lshlrev_b32 v2, 2, v1 23 v_lshrrev_b32 v3, 30, v1 24 v_mov_b32 v27, s5 25 v_add_co_u32 v2, vcc, s4, v2 26 v_addc_co_u32 v3, vcc, v27, v3, vcc 27 v_lshlrev_b32 v4, 2, v1 28 v_lshrrev_b32 v5, 30, v1 29 v_mov_b32 v27, s7 30 v_add_co_u32 v4, vcc, s6, v4 31 v_addc_co_u32 v5, vcc, v27, v5, vcc 32 v_lshlrev_b32 v6, 2, v1 33 v_lshrrev_b32 v7, 30, v1 34 v_mov_b32 v27, s9 35 v_add_co_u32 v6, vcc, s8, v6 36 v_addc_co_u32 v7, vcc, v27, v7, vcc 37 global_load_dword v8, v[2:3], off 38 global_load_dword v9, v[4:5], off 39 s_waitcnt vmcnt(0) 40 // BF16_ROUND_RESIDUAL 41 v_lshrrev_b32 v28, 16, v8 42 v_and_b32 v28, 1, v28 43 v_add_u32 v28, 0x7fff, v28 44 v_add_u32 v28, v8, v28 45 v_and_b32 v28, 0xffff0000, v28 46 v_and_b32 v29, 0x7fffffff, v8 47 v_mov_b32 v30, 0x7f800000 48 v_cmp_gt_u32 vcc, v29, v30 49 s_and_saveexec_b64 s[24:25], vcc 50 v_mov_b32 v28, 0x7fc00000 51 s_mov_b64 exec, s[24:25] 52 v_mov_b32 v8, v28 53 // END_BF16_ROUND_RESIDUAL 54 // BF16_ROUND_PROJECTION 55 v_lshrrev_b32 v28, 16, v9 56 v_and_b32 v28, 1, v28 57 v_add_u32 v28, 0x7fff, v28 58 v_add_u32 v28, v9, v28 59 v_and_b32 v28, 0xffff0000, v28 60 v_and_b32 v29, 0x7fffffff, v9 61 v_mov_b32 v30, 0x7f800000 62 v_cmp_gt_u32 vcc, v29, v30 63 s_and_saveexec_b64 s[24:25], vcc 64 v_mov_b32 v28, 0x7fc00000 65 s_mov_b64 exec, s[24:25] 66 v_mov_b32 v9, v28 67 // END_BF16_ROUND_PROJECTION 68 v_add_f32 v9, v8, v9 69 // BF16_ROUND_OUTPUT 70 v_lshrrev_b32 v28, 16, v9 71 v_and_b32 v28, 1, v28 72 v_add_u32 v28, 0x7fff, v28 73 v_add_u32 v28, v9, v28 74 v_and_b32 v28, 0xffff0000, v28 75 v_and_b32 v29, 0x7fffffff, v9 76 v_mov_b32 v30, 0x7f800000 77 v_cmp_gt_u32 vcc, v29, v30 78 s_and_saveexec_b64 s[24:25], vcc 79 v_mov_b32 v28, 0x7fc00000 80 s_mov_b64 exec, s[24:25] 81 v_mov_b32 v9, v28 82 // END_BF16_ROUND_OUTPUT 83 global_store_dword v[6:7], v9, off 84 .L99: 85 s_endpgm 86 .Lresidual5120_end: 87 .size residual5120, .Lresidual5120_end-residual5120 88 .rodata 89 .p2align 6 90 .amdhsa_kernel residual5120 91 .amdhsa_user_sgpr_kernarg_segment_ptr 1 92 .amdhsa_system_sgpr_workgroup_id_x 1 93 .amdhsa_system_sgpr_workgroup_id_y 1 94 .amdhsa_system_vgpr_workitem_id 0 95 .amdhsa_kernarg_size 24 96 .amdhsa_next_free_vgpr 32 97 .amdhsa_next_free_sgpr 30 98 .amdhsa_accum_offset 32 99 .amdhsa_float_denorm_mode_32 3 100 .end_amdhsa_kernel 101 .amdgpu_metadata 102 --- 103 amdhsa.version: [ 1, 2 ] 104 amdhsa.target: amdgcn-amd-amdhsa--gfx942 105 amdhsa.kernels: 106 - .name: residual5120 107 .symbol: residual5120.kd 108 .kernarg_segment_size: 24 109 .kernarg_segment_align: 8 110 .group_segment_fixed_size: 0 111 .private_segment_fixed_size: 0 112 .wavefront_size: 64 113 .sgpr_count: 36 114 .vgpr_count: 32 115 .agpr_count: 0 116 .max_flat_workgroup_size: 64 117 .args: 118 - .name: residual 119 .offset: 0 120 .size: 8 121 .value_kind: global_buffer 122 .address_space: global 123 - .name: projection 124 .offset: 8 125 .size: 8 126 .value_kind: global_buffer 127 .address_space: global 128 - .name: output 129 .offset: 16 130 .size: 8 131 .value_kind: global_buffer 132 .address_space: global 133 ... 134 .end_amdgpu_metadata