1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc < %s -mtriple=i686-unknown-unknown -mattr=+avx512bf16 --show-mc-encoding | FileCheck %s --check-prefixes=CHECK,X86
3 ; RUN: llc < %s -mtriple=x86_64-unknown-unknown -mattr=+avx512bf16 --show-mc-encoding | FileCheck %s --check-prefixes=CHECK,X64
5 declare <32 x i16> @llvm.x86.avx512bf16.cvtne2ps2bf16.512(<16 x float>, <16 x float>) #3
7 define <8 x i64> @test_mm512_cvtne2ps2bf16_512(<16 x float> %A, <16 x float> %B) local_unnamed_addr #2 {
8 ; CHECK-LABEL: test_mm512_cvtne2ps2bf16_512:
9 ; CHECK: # %bb.0: # %entry
10 ; CHECK-NEXT: vcvtne2ps2bf16 %zmm1, %zmm0, %zmm0 # encoding: [0x62,0xf2,0x7f,0x48,0x72,0xc1]
11 ; CHECK-NEXT: ret{{[l|q]}} # encoding: [0xc3]
13 %0 = tail call <32 x i16> @llvm.x86.avx512bf16.cvtne2ps2bf16.512(<16 x float> %A, <16 x float> %B) #4
14 %1 = bitcast <32 x i16> %0 to <8 x i64>
18 define <8 x i64> @test_mm512_maskz_cvtne2ps2bf16_512(<16 x float> %A, <16 x float> %B, i32 %U) local_unnamed_addr #2 {
19 ; X86-LABEL: test_mm512_maskz_cvtne2ps2bf16_512:
20 ; X86: # %bb.0: # %entry
21 ; X86-NEXT: vcvtne2ps2bf16 %zmm1, %zmm0, %zmm0 # encoding: [0x62,0xf2,0x7f,0x48,0x72,0xc1]
22 ; X86-NEXT: kmovd {{[0-9]+}}(%esp), %k1 # encoding: [0xc4,0xe1,0xf9,0x90,0x4c,0x24,0x04]
23 ; X86-NEXT: vmovdqu16 %zmm0, %zmm0 {%k1} {z} # encoding: [0x62,0xf1,0xff,0xc9,0x6f,0xc0]
24 ; X86-NEXT: retl # encoding: [0xc3]
26 ; X64-LABEL: test_mm512_maskz_cvtne2ps2bf16_512:
27 ; X64: # %bb.0: # %entry
28 ; X64-NEXT: vcvtne2ps2bf16 %zmm1, %zmm0, %zmm0 # encoding: [0x62,0xf2,0x7f,0x48,0x72,0xc1]
29 ; X64-NEXT: kmovd %edi, %k1 # encoding: [0xc5,0xfb,0x92,0xcf]
30 ; X64-NEXT: vmovdqu16 %zmm0, %zmm0 {%k1} {z} # encoding: [0x62,0xf1,0xff,0xc9,0x6f,0xc0]
31 ; X64-NEXT: retq # encoding: [0xc3]
33 %0 = tail call <32 x i16> @llvm.x86.avx512bf16.cvtne2ps2bf16.512(<16 x float> %A, <16 x float> %B) #4
34 %1 = bitcast i32 %U to <32 x i1>
35 %2 = select <32 x i1> %1, <32 x i16> %0, <32 x i16> zeroinitializer
36 %3 = bitcast <32 x i16> %2 to <8 x i64>
40 define <8 x i64> @test_mm512_mask_cvtne2ps2bf16_512(<8 x i64> %C, i32 %U, <16 x float> %A, <16 x float> %B) local_unnamed_addr #2 {
41 ; X86-LABEL: test_mm512_mask_cvtne2ps2bf16_512:
42 ; X86: # %bb.0: # %entry
43 ; X86-NEXT: vcvtne2ps2bf16 %zmm2, %zmm1, %zmm1 # encoding: [0x62,0xf2,0x77,0x48,0x72,0xca]
44 ; X86-NEXT: kmovd {{[0-9]+}}(%esp), %k1 # encoding: [0xc4,0xe1,0xf9,0x90,0x4c,0x24,0x04]
45 ; X86-NEXT: vmovdqu16 %zmm1, %zmm0 {%k1} # encoding: [0x62,0xf1,0xff,0x49,0x6f,0xc1]
46 ; X86-NEXT: retl # encoding: [0xc3]
48 ; X64-LABEL: test_mm512_mask_cvtne2ps2bf16_512:
49 ; X64: # %bb.0: # %entry
50 ; X64-NEXT: vcvtne2ps2bf16 %zmm2, %zmm1, %zmm1 # encoding: [0x62,0xf2,0x77,0x48,0x72,0xca]
51 ; X64-NEXT: kmovd %edi, %k1 # encoding: [0xc5,0xfb,0x92,0xcf]
52 ; X64-NEXT: vmovdqu16 %zmm1, %zmm0 {%k1} # encoding: [0x62,0xf1,0xff,0x49,0x6f,0xc1]
53 ; X64-NEXT: retq # encoding: [0xc3]
55 %0 = tail call <32 x i16> @llvm.x86.avx512bf16.cvtne2ps2bf16.512(<16 x float> %A, <16 x float> %B) #4
56 %1 = bitcast <8 x i64> %C to <32 x i16>
57 %2 = bitcast i32 %U to <32 x i1>
58 %3 = select <32 x i1> %2, <32 x i16> %0, <32 x i16> %1
59 %4 = bitcast <32 x i16> %3 to <8 x i64>
63 declare <16 x i16> @llvm.x86.avx512bf16.cvtneps2bf16.512(<16 x float>) #3
65 define <4 x i64> @test_mm512_cvtneps2bf16_512(<16 x float> %A) local_unnamed_addr #2 {
66 ; CHECK-LABEL: test_mm512_cvtneps2bf16_512:
67 ; CHECK: # %bb.0: # %entry
68 ; CHECK-NEXT: vcvtneps2bf16 %zmm0, %ymm0 # encoding: [0x62,0xf2,0x7e,0x48,0x72,0xc0]
69 ; CHECK-NEXT: ret{{[l|q]}} # encoding: [0xc3]
71 %0 = tail call <16 x i16> @llvm.x86.avx512bf16.cvtneps2bf16.512(<16 x float> %A) #4
72 %1 = bitcast <16 x i16> %0 to <4 x i64>
76 define <4 x i64> @test_mm512_maskz_cvtneps2bf16_512(<16 x float> %A, i16 %U) local_unnamed_addr #2 {
77 ; X86-LABEL: test_mm512_maskz_cvtneps2bf16_512:
78 ; X86: # %bb.0: # %entry
79 ; X86-NEXT: vcvtneps2bf16 %zmm0, %ymm0 # encoding: [0x62,0xf2,0x7e,0x48,0x72,0xc0]
80 ; X86-NEXT: kmovw {{[0-9]+}}(%esp), %k1 # encoding: [0xc5,0xf8,0x90,0x4c,0x24,0x04]
81 ; X86-NEXT: vmovdqu16 %zmm0, %zmm0 {%k1} {z} # encoding: [0x62,0xf1,0xff,0xc9,0x6f,0xc0]
82 ; X86-NEXT: # kill: def $ymm0 killed $ymm0 killed $zmm0
83 ; X86-NEXT: retl # encoding: [0xc3]
85 ; X64-LABEL: test_mm512_maskz_cvtneps2bf16_512:
86 ; X64: # %bb.0: # %entry
87 ; X64-NEXT: vcvtneps2bf16 %zmm0, %ymm0 # encoding: [0x62,0xf2,0x7e,0x48,0x72,0xc0]
88 ; X64-NEXT: kmovd %edi, %k1 # encoding: [0xc5,0xfb,0x92,0xcf]
89 ; X64-NEXT: vmovdqu16 %zmm0, %zmm0 {%k1} {z} # encoding: [0x62,0xf1,0xff,0xc9,0x6f,0xc0]
90 ; X64-NEXT: # kill: def $ymm0 killed $ymm0 killed $zmm0
91 ; X64-NEXT: retq # encoding: [0xc3]
93 %0 = tail call <16 x i16> @llvm.x86.avx512bf16.cvtneps2bf16.512(<16 x float> %A) #4
94 %1 = bitcast i16 %U to <16 x i1>
95 %2 = select <16 x i1> %1, <16 x i16> %0, <16 x i16> zeroinitializer
96 %3 = bitcast <16 x i16> %2 to <4 x i64>
100 define <4 x i64> @test_mm512_mask_cvtneps2bf16_512(<4 x i64> %C, i16 %U, <16 x float> %A) local_unnamed_addr #2 {
101 ; X86-LABEL: test_mm512_mask_cvtneps2bf16_512:
102 ; X86: # %bb.0: # %entry
103 ; X86-NEXT: # kill: def $ymm0 killed $ymm0 def $zmm0
104 ; X86-NEXT: vcvtneps2bf16 %zmm1, %ymm1 # encoding: [0x62,0xf2,0x7e,0x48,0x72,0xc9]
105 ; X86-NEXT: kmovw {{[0-9]+}}(%esp), %k1 # encoding: [0xc5,0xf8,0x90,0x4c,0x24,0x04]
106 ; X86-NEXT: vmovdqu16 %zmm1, %zmm0 {%k1} # encoding: [0x62,0xf1,0xff,0x49,0x6f,0xc1]
107 ; X86-NEXT: # kill: def $ymm0 killed $ymm0 killed $zmm0
108 ; X86-NEXT: retl # encoding: [0xc3]
110 ; X64-LABEL: test_mm512_mask_cvtneps2bf16_512:
111 ; X64: # %bb.0: # %entry
112 ; X64-NEXT: # kill: def $ymm0 killed $ymm0 def $zmm0
113 ; X64-NEXT: vcvtneps2bf16 %zmm1, %ymm1 # encoding: [0x62,0xf2,0x7e,0x48,0x72,0xc9]
114 ; X64-NEXT: kmovd %edi, %k1 # encoding: [0xc5,0xfb,0x92,0xcf]
115 ; X64-NEXT: vmovdqu16 %zmm1, %zmm0 {%k1} # encoding: [0x62,0xf1,0xff,0x49,0x6f,0xc1]
116 ; X64-NEXT: # kill: def $ymm0 killed $ymm0 killed $zmm0
117 ; X64-NEXT: retq # encoding: [0xc3]
119 %0 = tail call <16 x i16> @llvm.x86.avx512bf16.cvtneps2bf16.512(<16 x float> %A) #4
120 %1 = bitcast <4 x i64> %C to <16 x i16>
121 %2 = bitcast i16 %U to <16 x i1>
122 %3 = select <16 x i1> %2, <16 x i16> %0, <16 x i16> %1
123 %4 = bitcast <16 x i16> %3 to <4 x i64>
127 declare <16 x float> @llvm.x86.avx512bf16.dpbf16ps.512(<16 x float>, <16 x i32>, <16 x i32>) #3
129 define <16 x float> @test_mm512_dpbf16ps_512(<16 x float> %E, <16 x i32> %A, <16 x i32> %B) local_unnamed_addr #2 {
130 ; CHECK-LABEL: test_mm512_dpbf16ps_512:
131 ; CHECK: # %bb.0: # %entry
132 ; CHECK-NEXT: vdpbf16ps %zmm2, %zmm1, %zmm0 # encoding: [0x62,0xf2,0x76,0x48,0x52,0xc2]
133 ; CHECK-NEXT: ret{{[l|q]}} # encoding: [0xc3]
135 %0 = tail call <16 x float> @llvm.x86.avx512bf16.dpbf16ps.512(<16 x float> %E, <16 x i32> %A, <16 x i32> %B) #4
139 define <16 x float> @test_mm512_maskz_dpbf16ps_512(<16 x float> %E, <16 x i32> %A, <16 x i32> %B, i16 zeroext %U) local_unnamed_addr #2 {
140 ; X86-LABEL: test_mm512_maskz_dpbf16ps_512:
141 ; X86: # %bb.0: # %entry
142 ; X86-NEXT: kmovw {{[0-9]+}}(%esp), %k1 # encoding: [0xc5,0xf8,0x90,0x4c,0x24,0x04]
143 ; X86-NEXT: vdpbf16ps %zmm2, %zmm1, %zmm0 {%k1} {z} # encoding: [0x62,0xf2,0x76,0xc9,0x52,0xc2]
144 ; X86-NEXT: retl # encoding: [0xc3]
146 ; X64-LABEL: test_mm512_maskz_dpbf16ps_512:
147 ; X64: # %bb.0: # %entry
148 ; X64-NEXT: kmovd %edi, %k1 # encoding: [0xc5,0xfb,0x92,0xcf]
149 ; X64-NEXT: vdpbf16ps %zmm2, %zmm1, %zmm0 {%k1} {z} # encoding: [0x62,0xf2,0x76,0xc9,0x52,0xc2]
150 ; X64-NEXT: retq # encoding: [0xc3]
152 %0 = tail call <16 x float> @llvm.x86.avx512bf16.dpbf16ps.512(<16 x float> %E, <16 x i32> %A, <16 x i32> %B) #4
153 %1 = bitcast i16 %U to <16 x i1>
154 %2 = select <16 x i1> %1, <16 x float> %0, <16 x float> zeroinitializer
157 define <16 x float> @test_mm512_mask_dpbf16ps_512(i16 zeroext %U, <16 x float> %E, <16 x i32> %A, <16 x i32> %B) local_unnamed_addr #2 {
158 ; X86-LABEL: test_mm512_mask_dpbf16ps_512:
159 ; X86: # %bb.0: # %entry
160 ; X86-NEXT: kmovw {{[0-9]+}}(%esp), %k1 # encoding: [0xc5,0xf8,0x90,0x4c,0x24,0x04]
161 ; X86-NEXT: vdpbf16ps %zmm2, %zmm1, %zmm0 {%k1} # encoding: [0x62,0xf2,0x76,0x49,0x52,0xc2]
162 ; X86-NEXT: retl # encoding: [0xc3]
164 ; X64-LABEL: test_mm512_mask_dpbf16ps_512:
165 ; X64: # %bb.0: # %entry
166 ; X64-NEXT: kmovd %edi, %k1 # encoding: [0xc5,0xfb,0x92,0xcf]
167 ; X64-NEXT: vdpbf16ps %zmm2, %zmm1, %zmm0 {%k1} # encoding: [0x62,0xf2,0x76,0x49,0x52,0xc2]
168 ; X64-NEXT: retq # encoding: [0xc3]
170 %0 = tail call <16 x float> @llvm.x86.avx512bf16.dpbf16ps.512(<16 x float> %E, <16 x i32> %A, <16 x i32> %B) #4
171 %1 = bitcast i16 %U to <16 x i1>
172 %2 = select <16 x i1> %1, <16 x float> %0, <16 x float> %E