|
| 1 | +; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py |
| 2 | +; RUN: llc -mtriple=amdgcn-amd-amdhsa -mcpu=gfx1100 -mattr=+wavefrontsize64 -verify-machineinstrs < %s | FileCheck %s --check-prefix=GFX11-W64 |
| 3 | + |
| 4 | +; Test GFX11 WMMA with amdgpu_kernel (compute) calling convention - Wave64 mode |
| 5 | +; Wave64 uses smaller accumulator vectors compared to Wave32 |
| 6 | + |
| 7 | +declare <4 x float> @llvm.amdgcn.wmma.f32.16x16x16.f16(<16 x half>, <16 x half>, <4 x float>) |
| 8 | +declare <4 x float> @llvm.amdgcn.wmma.f32.16x16x16.bf16(<16 x i16>, <16 x i16>, <4 x float>) |
| 9 | +declare <4 x i32> @llvm.amdgcn.wmma.i32.16x16x16.iu8(i1, <4 x i32>, i1, <4 x i32>, <4 x i32>, i1) |
| 10 | +declare <4 x i32> @llvm.amdgcn.wmma.i32.16x16x16.iu4(i1, <2 x i32>, i1, <2 x i32>, <4 x i32>, i1) |
| 11 | + |
| 12 | +; GFX11-W64-LABEL: test_wmma_f32_16x16x16_f16_kernel_w64: |
| 13 | +; GFX11-W64: v_wmma_f32_16x16x16_f16 |
| 14 | +define amdgpu_kernel void @test_wmma_f32_16x16x16_f16_kernel_w64( |
| 15 | + ptr addrspace(1) %a_ptr, |
| 16 | + ptr addrspace(1) %b_ptr, |
| 17 | + ptr addrspace(1) %c_ptr, |
| 18 | + ptr addrspace(1) %out) { |
| 19 | +entry: |
| 20 | + %a = load <16 x half>, ptr addrspace(1) %a_ptr, align 32 |
| 21 | + %b = load <16 x half>, ptr addrspace(1) %b_ptr, align 32 |
| 22 | + %c = load <4 x float>, ptr addrspace(1) %c_ptr, align 16 |
| 23 | + %res = call <4 x float> @llvm.amdgcn.wmma.f32.16x16x16.f16(<16 x half> %a, <16 x half> %b, <4 x float> %c) |
| 24 | + store <4 x float> %res, ptr addrspace(1) %out, align 16 |
| 25 | + ret void |
| 26 | +} |
| 27 | + |
| 28 | +; GFX11-W64-LABEL: test_wmma_f32_16x16x16_bf16_kernel_w64: |
| 29 | +; GFX11-W64: v_wmma_f32_16x16x16_bf16 |
| 30 | +define amdgpu_kernel void @test_wmma_f32_16x16x16_bf16_kernel_w64( |
| 31 | + ptr addrspace(1) %a_ptr, |
| 32 | + ptr addrspace(1) %b_ptr, |
| 33 | + ptr addrspace(1) %c_ptr, |
| 34 | + ptr addrspace(1) %out) { |
| 35 | +entry: |
| 36 | + %a = load <16 x i16>, ptr addrspace(1) %a_ptr, align 32 |
| 37 | + %b = load <16 x i16>, ptr addrspace(1) %b_ptr, align 32 |
| 38 | + %c = load <4 x float>, ptr addrspace(1) %c_ptr, align 16 |
| 39 | + %res = call <4 x float> @llvm.amdgcn.wmma.f32.16x16x16.bf16(<16 x i16> %a, <16 x i16> %b, <4 x float> %c) |
| 40 | + store <4 x float> %res, ptr addrspace(1) %out, align 16 |
| 41 | + ret void |
| 42 | +} |
| 43 | + |
| 44 | +; GFX11-W64-LABEL: test_wmma_i32_16x16x16_iu8_kernel_w64: |
| 45 | +; GFX11-W64: v_wmma_i32_16x16x16_iu8 |
| 46 | +define amdgpu_kernel void @test_wmma_i32_16x16x16_iu8_kernel_w64( |
| 47 | + ptr addrspace(1) %a_ptr, |
| 48 | + ptr addrspace(1) %b_ptr, |
| 49 | + ptr addrspace(1) %c_ptr, |
| 50 | + ptr addrspace(1) %out) { |
| 51 | +entry: |
| 52 | + %a = load <4 x i32>, ptr addrspace(1) %a_ptr, align 16 |
| 53 | + %b = load <4 x i32>, ptr addrspace(1) %b_ptr, align 16 |
| 54 | + %c = load <4 x i32>, ptr addrspace(1) %c_ptr, align 16 |
| 55 | + %res = call <4 x i32> @llvm.amdgcn.wmma.i32.16x16x16.iu8(i1 0, <4 x i32> %a, i1 0, <4 x i32> %b, <4 x i32> %c, i1 0) |
| 56 | + store <4 x i32> %res, ptr addrspace(1) %out, align 16 |
| 57 | + ret void |
| 58 | +} |
| 59 | + |
| 60 | +; GFX11-W64-LABEL: test_wmma_i32_16x16x16_iu4_kernel_w64: |
| 61 | +; GFX11-W64: v_wmma_i32_16x16x16_iu4 |
| 62 | +define amdgpu_kernel void @test_wmma_i32_16x16x16_iu4_kernel_w64( |
| 63 | + ptr addrspace(1) %a_ptr, |
| 64 | + ptr addrspace(1) %b_ptr, |
| 65 | + ptr addrspace(1) %c_ptr, |
| 66 | + ptr addrspace(1) %out) { |
| 67 | +entry: |
| 68 | + %a = load <2 x i32>, ptr addrspace(1) %a_ptr, align 8 |
| 69 | + %b = load <2 x i32>, ptr addrspace(1) %b_ptr, align 8 |
| 70 | + %c = load <4 x i32>, ptr addrspace(1) %c_ptr, align 16 |
| 71 | + %res = call <4 x i32> @llvm.amdgcn.wmma.i32.16x16x16.iu4(i1 0, <2 x i32> %a, i1 0, <2 x i32> %b, <4 x i32> %c, i1 0) |
| 72 | + store <4 x i32> %res, ptr addrspace(1) %out, align 16 |
| 73 | + ret void |
| 74 | +} |
0 commit comments