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/bf16gemv-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 / bf16gemv-gfx942.s` 88 lines · 2611 bytes Raw Blame History 1 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 2 // Test oracle only; never producer/executor input. Exact BF16 expansion; ascending-k FP32 FMA. 3 .amdgcn_target "amdgcn-amd-amdhsa--gfx942" 4 .text 5 .globl bf16gemv 6 .p2align 8 7 .type bf16gemv,@function 8 bf16gemv: 9 s_load_dwordx4 s[4:7], s[0:1], 0 10 s_load_dwordx4 s[8:11], s[0:1], 16 11 v_and_b32 v0, 0x3ff, v0 12 s_waitcnt lgkmcnt(0) 13 s_lshl_b32 s12, s2, 6 14 v_add_u32 v1, s12, v0 15 v_cmp_gt_u32 vcc, s10, v1 16 s_and_saveexec_b64 s[14:15], vcc 17 s_cbranch_execz .Lend 18 v_lshlrev_b32 v2, 2, v1 19 v_lshrrev_b32 v3, 30, v1 20 v_mul_lo_u32 v8, v1, s11 21 v_mul_hi_u32 v9, v1, s11 22 v_add_co_u32 v8, vcc, v8, v8 23 v_addc_co_u32 v9, vcc, v9, v9, vcc 24 v_mov_b32 v5, s5 25 v_add_co_u32 v8, vcc, s4, v8 26 v_addc_co_u32 v9, vcc, v5, v9, vcc 27 v_mov_b32 v10, s6 28 v_mov_b32 v11, s7 29 v_mov_b32 v5, s9 30 v_add_co_u32 v12, vcc, s8, v2 31 v_addc_co_u32 v13, vcc, v5, v3, vcc 32 v_mov_b32 v4, 0 33 v_mov_b32 v7, 0 34 s_sub_u32 s13, s11, 1 35 s_cbranch_scc1 .Lstore 36 .Lloop: 37 global_load_short_d16_hi v7, v[8:9], off 38 global_load_dword v6, v[10:11], off 39 s_waitcnt vmcnt(0) 40 v_fmac_f32 v4, v7, v6 41 v_add_co_u32 v8, vcc, 2, v8 42 v_addc_co_u32 v9, vcc, 0, v9, vcc 43 v_add_co_u32 v10, vcc, 4, v10 44 v_addc_co_u32 v11, vcc, 0, v11, vcc 45 s_sub_u32 s13, s13, 1 46 s_cbranch_scc0 .Lloop 47 .Lstore: 48 global_store_dword v[12:13], v4, off 49 .Lend: 50 s_endpgm 51 .Lbf16gemv_end: 52 .size bf16gemv, .Lbf16gemv_end-bf16gemv 53 .rodata 54 .p2align 6 55 .amdhsa_kernel bf16gemv 56 .amdhsa_user_sgpr_kernarg_segment_ptr 1 57 .amdhsa_system_sgpr_workgroup_id_x 1 58 .amdhsa_system_vgpr_workitem_id 0 59 .amdhsa_kernarg_size 32 60 .amdhsa_next_free_vgpr 14 61 .amdhsa_next_free_sgpr 16 62 .amdhsa_accum_offset 16 63 .amdhsa_float_denorm_mode_32 3 64 .end_amdhsa_kernel 65 .amdgpu_metadata 66 --- 67 amdhsa.version: [ 1, 2 ] 68 amdhsa.target: amdgcn-amd-amdhsa--gfx942 69 amdhsa.kernels: 70 - .name: bf16gemv 71 .symbol: bf16gemv.kd 72 .kernarg_segment_size: 32 73 .kernarg_segment_align: 8 74 .group_segment_fixed_size: 0 75 .private_segment_fixed_size: 0 76 .wavefront_size: 64 77 .sgpr_count: 24 78 .vgpr_count: 16 79 .agpr_count: 0 80 .max_flat_workgroup_size: 64 81 .args: 82 - { .name: W, .offset: 0, .size: 8, .value_kind: global_buffer, .address_space: global } 83 - { .name: x, .offset: 8, .size: 8, .value_kind: global_buffer, .address_space: global } 84 - { .name: !str y, .offset: 16, .size: 8, .value_kind: global_buffer, .address_space: global } 85 - { .name: M, .offset: 24, .size: 4, .value_kind: by_value } 86 - { .name: K, .offset: 28, .size: 4, .value_kind: by_value } 87 ... 88 .end_amdgpu_metadata