1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 2
2 ; RUN: llc -mtriple=amdgcn-amd-amdhsa -mcpu=gfx940 -verify-machineinstrs < %s | FileCheck -enable-var-scope -check-prefixes=GFX940 %s
5 define protected amdgpu_kernel void @test(ptr addrspace(1) %in, ptr addrspace(1) %out) #0 {
7 ; GFX940: ; %bb.0: ; %entry
8 ; GFX940-NEXT: s_load_dwordx4 s[0:3], s[4:5], 0x0
9 ; GFX940-NEXT: v_mov_b32_e32 v0, 0
10 ; GFX940-NEXT: v_mov_b32_e32 v2, v0
11 ; GFX940-NEXT: v_mov_b32_e32 v3, v0
12 ; GFX940-NEXT: v_mov_b32_e32 v1, v0
13 ; GFX940-NEXT: s_waitcnt lgkmcnt(0)
14 ; GFX940-NEXT: s_load_dwordx4 s[4:7], s[0:1], 0x0
15 ; GFX940-NEXT: v_mov_b64_e32 v[10:11], v[2:3]
16 ; GFX940-NEXT: v_mov_b64_e32 v[8:9], v[0:1]
17 ; GFX940-NEXT: s_waitcnt lgkmcnt(0)
18 ; GFX940-NEXT: v_mov_b32_e32 v12, s4
19 ; GFX940-NEXT: v_mov_b32_e32 v13, s5
20 ; GFX940-NEXT: v_mov_b32_e32 v4, s6
21 ; GFX940-NEXT: v_mov_b32_e32 v5, s7
22 ; GFX940-NEXT: v_mov_b32_e32 v6, s7
23 ; GFX940-NEXT: v_mov_b32_e32 v7, s7
24 ; GFX940-NEXT: s_nop 1
25 ; GFX940-NEXT: v_smfmac_i32_16x16x64_i8 v[8:11], v[12:13], v[4:7], v13
26 ; GFX940-NEXT: s_nop 6
27 ; GFX940-NEXT: global_store_dword v0, v11, s[2:3] offset:12 sc0 sc1
28 ; GFX940-NEXT: s_endpgm
30 %arrayidx = getelementptr inbounds i32, ptr addrspace(1) %in, i64 0
31 %arrayidx1 = getelementptr inbounds i32, ptr addrspace(1) %in, i64 1
32 %arrayidx2 = getelementptr inbounds i32, ptr addrspace(1) %in, i64 2
33 %arrayidx3 = getelementptr inbounds i32, ptr addrspace(1) %in, i64 3
34 %0 = load i32, ptr addrspace(1) %arrayidx
35 %1 = load i32, ptr addrspace(1) %arrayidx1
36 %2 = load i32, ptr addrspace(1) %arrayidx2
37 %3 = load i32, ptr addrspace(1) %arrayidx3
38 %src1.0 = insertelement <2 x i32> undef, i32 %0, i64 0
39 %src1 = insertelement <2 x i32> %src1.0, i32 %1, i64 1
40 %src2.0 = insertelement <4 x i32> undef, i32 %2, i64 0
41 %src2.1 = insertelement <4 x i32> %src2.0, i32 %3, i64 1
42 %src2.2 = insertelement <4 x i32> %src2.1, i32 %3, i64 2
43 %src2 = insertelement <4 x i32> %src2.2, i32 %3, i64 3
44 %4 = tail call <4 x i32> @llvm.amdgcn.smfmac.i32.16x16x64.i8(<2 x i32> %src1, <4 x i32> %src2, <4 x i32> zeroinitializer, i32 %1, i32 0, i32 0)
45 %vecext = extractelement <4 x i32> %4, i64 0
46 %vecext.1 = extractelement <4 x i32> %4, i64 1
47 %vecext.2 = extractelement <4 x i32> %4, i64 2
48 %vecext.3 = extractelement <4 x i32> %4, i64 3
49 %arrayidx4 = getelementptr inbounds i32, ptr addrspace(1) %out, i64 3
50 store i32 %vecext.3, ptr addrspace(1) %arrayidx4
53 declare <4 x i32> @llvm.amdgcn.smfmac.i32.16x16x64.i8(<2 x i32>, <4 x i32>, <4 x i32>, i32, i32 immarg, i32 immarg)
55 attributes #0 = { "amdgpu-no-agpr" }