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_gate-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_gate-gfx942.s` 116 lines · 2991 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_gate 6 .p2align 8 7 .type attn256_gate,@function 8 attn256_gate: 9 s_load_dwordx4 s[4:7], s[0:1], 0 10 s_load_dwordx2 s[8:9], s[0:1], 16 11 s_waitcnt lgkmcnt(0) 12 s_sub_u32 s28, s2, 96 13 s_cbranch_scc0 .L99 14 s_sub_u32 s28, s3, 1 15 s_cbranch_scc0 .L99 16 v_and_b32 v0, 0x3ff, v0 17 v_mov_b32 v1, s2 18 v_lshlrev_b32 v1, 6, v1 19 v_add_u32 v1, v0, v1 20 v_lshrrev_b32 v2, 8, v1 21 v_lshlrev_b32 v2, 11, v2 22 v_and_b32 v30, 0xff, v1 23 v_lshlrev_b32 v30, 2, v30 24 v_add_u32 v2, v30, v2 25 v_add_u32 v2, 0x400, v2 26 v_mov_b32 v3, 0 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 v_mov_b32 v4, v1 31 v_mov_b32 v5, 0 32 v_lshrrev_b32 v27, 30, v4 33 v_lshlrev_b32 v5, 2, v5 34 v_add_u32 v5, v27, v5 35 v_lshlrev_b32 v4, 2, v4 36 v_mov_b32 v27, s7 37 v_add_co_u32 v4, vcc, s6, v4 38 v_addc_co_u32 v5, vcc, v27, v5, vcc 39 v_mov_b32 v6, v1 40 v_mov_b32 v7, 0 41 v_lshrrev_b32 v27, 30, v6 42 v_lshlrev_b32 v7, 2, v7 43 v_add_u32 v7, v27, v7 44 v_lshlrev_b32 v6, 2, v6 45 v_mov_b32 v27, s9 46 v_add_co_u32 v6, vcc, s8, v6 47 v_addc_co_u32 v7, vcc, v27, v7, vcc 48 global_load_dword v8, v[2:3], off 49 global_load_dword v9, v[4:5], off 50 s_waitcnt vmcnt(0) 51 v_and_b32 v10, 0x7fffffff, v8 52 v_xor_b32 v10, 0x80000000, v10 53 v_mul_f32 v10, 0x3fb8aa3b, v10 54 v_exp_f32 v10, v10 55 s_nop 0 56 v_add_f32 v11, 0x3f800000, v10 57 v_rcp_f32 v11, v11 58 v_lshrrev_b32 v12, 31, v8 59 v_mov_b32 v13, 0 60 v_cmp_gt_u32 vcc, v12, v13 61 s_and_saveexec_b64 s[26:27], vcc 62 v_mul_f32 v11, v10, v11 63 s_mov_b64 exec, s[26:27] 64 v_mul_f32 v9, v11, v9 65 global_store_dword v[6:7], v9, off 66 .L99: 67 s_endpgm 68 .Lattn256_gate_end: 69 .size attn256_gate, .Lattn256_gate_end-attn256_gate 70 .rodata 71 .p2align 6 72 .amdhsa_kernel attn256_gate 73 .amdhsa_user_sgpr_kernarg_segment_ptr 1 74 .amdhsa_system_sgpr_workgroup_id_x 1 75 .amdhsa_system_sgpr_workgroup_id_y 1 76 .amdhsa_system_vgpr_workitem_id 0 77 .amdhsa_kernarg_size 24 78 .amdhsa_next_free_vgpr 32 79 .amdhsa_next_free_sgpr 29 80 .amdhsa_accum_offset 32 81 .amdhsa_float_denorm_mode_32 3 82 .end_amdhsa_kernel 83 .amdgpu_metadata 84 --- 85 amdhsa.version: [ 1, 2 ] 86 amdhsa.target: amdgcn-amd-amdhsa--gfx942 87 amdhsa.kernels: 88 - .name: attn256_gate 89 .symbol: attn256_gate.kd 90 .kernarg_segment_size: 24 91 .kernarg_segment_align: 8 92 .group_segment_fixed_size: 0 93 .private_segment_fixed_size: 0 94 .wavefront_size: 64 95 .sgpr_count: 35 96 .vgpr_count: 32 97 .agpr_count: 0 98 .max_flat_workgroup_size: 64 99 .args: 100 - .name: Q_gate 101 .offset: 0 102 .size: 8 103 .value_kind: global_buffer 104 .address_space: global 105 - .name: attention 106 .offset: 8 107 .size: 8 108 .value_kind: global_buffer 109 .address_space: global 110 - .name: out 111 .offset: 16 112 .size: 8 113 .value_kind: global_buffer 114 .address_space: global 115 ... 116 .end_amdgpu_metadata