1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc < %s -mtriple=x86_64-unknown-unknown -mattr=+amx-tile,+avx512f \
3 ; RUN: -mattr=+amx-fp8 -verify-machineinstrs | FileCheck %s
5 define void @test_amx(i8* %pointer, i8* %base, i64 %stride) {
6 ; CHECK-LABEL: test_amx:
8 ; CHECK-NEXT: pushq %rbp
9 ; CHECK-NEXT: .cfi_def_cfa_offset 16
10 ; CHECK-NEXT: subq $3952, %rsp # imm = 0xF70
11 ; CHECK-NEXT: .cfi_def_cfa_offset 3968
12 ; CHECK-NEXT: .cfi_offset %rbp, -16
13 ; CHECK-NEXT: vxorps %xmm0, %xmm0, %xmm0
14 ; CHECK-NEXT: vmovups %zmm0, {{[0-9]+}}(%rsp)
15 ; CHECK-NEXT: movb $1, {{[0-9]+}}(%rsp)
16 ; CHECK-NEXT: movb $8, {{[0-9]+}}(%rsp)
17 ; CHECK-NEXT: movw $8, {{[0-9]+}}(%rsp)
18 ; CHECK-NEXT: movb $8, {{[0-9]+}}(%rsp)
19 ; CHECK-NEXT: movw $8, {{[0-9]+}}(%rsp)
20 ; CHECK-NEXT: movb $8, {{[0-9]+}}(%rsp)
21 ; CHECK-NEXT: movw $8, {{[0-9]+}}(%rsp)
22 ; CHECK-NEXT: movb $8, {{[0-9]+}}(%rsp)
23 ; CHECK-NEXT: movw $8, {{[0-9]+}}(%rsp)
24 ; CHECK-NEXT: movb $8, {{[0-9]+}}(%rsp)
25 ; CHECK-NEXT: movw $8, {{[0-9]+}}(%rsp)
26 ; CHECK-NEXT: ldtilecfg {{[0-9]+}}(%rsp)
27 ; CHECK-NEXT: movw $8, %ax
28 ; CHECK-NEXT: tileloadd (%rsi,%rdx), %tmm0
29 ; CHECK-NEXT: tilezero %tmm1
30 ; CHECK-NEXT: tilezero %tmm2
31 ; CHECK-NEXT: movabsq $64, %rbp
32 ; CHECK-NEXT: tilestored %tmm2, 896(%rsp,%rbp) # 1024-byte Folded Spill
33 ; CHECK-NEXT: tileloadd 896(%rsp,%rbp), %tmm3 # 1024-byte Folded Reload
34 ; CHECK-NEXT: tdpbf8ps %tmm1, %tmm0, %tmm3
35 ; CHECK-NEXT: tdpbhf8ps %tmm1, %tmm0, %tmm3
36 ; CHECK-NEXT: tilestored %tmm2, 1920(%rsp,%rbp) # 1024-byte Folded Spill
37 ; CHECK-NEXT: tileloadd 1920(%rsp,%rbp), %tmm4 # 1024-byte Folded Reload
38 ; CHECK-NEXT: tdphbf8ps %tmm1, %tmm0, %tmm4
39 ; CHECK-NEXT: tdphf8ps %tmm1, %tmm0, %tmm2
40 ; CHECK-NEXT: tilestored %tmm3, (%rdi,%rdx)
41 ; CHECK-NEXT: addq $3952, %rsp # imm = 0xF70
42 ; CHECK-NEXT: .cfi_def_cfa_offset 16
43 ; CHECK-NEXT: popq %rbp
44 ; CHECK-NEXT: .cfi_def_cfa_offset 8
45 ; CHECK-NEXT: tilerelease
46 ; CHECK-NEXT: vzeroupper
49 %a = call x86_amx @llvm.x86.tileloadd64.internal(i16 8, i16 8, i8* %base, i64 %stride)
50 %b = call x86_amx @llvm.x86.tilezero.internal(i16 8, i16 8)
51 %c = call x86_amx @llvm.x86.tilezero.internal(i16 8, i16 8)
53 %c1 = call x86_amx @llvm.x86.tdpbf8ps.internal(i16 8, i16 8, i16 8, x86_amx %c, x86_amx %a, x86_amx %b)
54 %c2 = call x86_amx @llvm.x86.tdpbhf8ps.internal(i16 8, i16 8, i16 8, x86_amx %c1, x86_amx %a, x86_amx %b)
55 %c3 = call x86_amx @llvm.x86.tdphbf8ps.internal(i16 8, i16 8, i16 8, x86_amx %c, x86_amx %a, x86_amx %b)
56 %c4 = call x86_amx @llvm.x86.tdphf8ps.internal(i16 8, i16 8, i16 8, x86_amx %c, x86_amx %a, x86_amx %b)
58 call void @llvm.x86.tilestored64.internal(i16 8, i16 8, i8* %pointer, i64 %stride, x86_amx %c2)
62 declare x86_amx @llvm.x86.tilezero.internal(i16, i16)
63 declare x86_amx @llvm.x86.tileloadd64.internal(i16, i16, i8*, i64)
64 declare void @llvm.x86.tilestored64.internal(i16, i16, i8*, i64, x86_amx)
66 declare x86_amx @llvm.x86.tdpbf8ps.internal(i16, i16, i16, x86_amx, x86_amx, x86_amx)
67 declare x86_amx @llvm.x86.tdpbhf8ps.internal(i16, i16, i16, x86_amx, x86_amx, x86_amx)
68 declare x86_amx @llvm.x86.tdphbf8ps.internal(i16, i16, i16, x86_amx, x86_amx, x86_amx)
69 declare x86_amx @llvm.x86.tdphf8ps.internal(i16, i16, i16, x86_amx, x86_amx, x86_amx)