]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - test/CodeGen/X86/ssse3-intrinsics-x86.ll
Vendor import of llvm trunk r291274:
[FreeBSD/FreeBSD.git] / test / CodeGen / X86 / ssse3-intrinsics-x86.ll
1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc < %s -mtriple=i386-apple-darwin -mattr=-avx,+ssse3 -show-mc-encoding | FileCheck %s --check-prefix=SSE
3 ; RUN: llc < %s -mtriple=i386-apple-darwin -mattr=+avx2 -show-mc-encoding | FileCheck %s --check-prefix=VCHECK --check-prefix=AVX2
4 ; RUN: llc < %s -mtriple=i386-apple-darwin -mcpu=skx -show-mc-encoding | FileCheck %s --check-prefix=VCHECK --check-prefix=SKX
5
6 define <16 x i8> @test_x86_ssse3_pabs_b_128(<16 x i8> %a0) {
7 ; SSE-LABEL: test_x86_ssse3_pabs_b_128:
8 ; SSE:       ## BB#0:
9 ; SSE-NEXT:    pabsb %xmm0, %xmm0 ## encoding: [0x66,0x0f,0x38,0x1c,0xc0]
10 ; SSE-NEXT:    retl ## encoding: [0xc3]
11 ;
12 ; AVX2-LABEL: test_x86_ssse3_pabs_b_128:
13 ; AVX2:       ## BB#0:
14 ; AVX2-NEXT:    vpabsb %xmm0, %xmm0 ## encoding: [0xc4,0xe2,0x79,0x1c,0xc0]
15 ; AVX2-NEXT:    retl ## encoding: [0xc3]
16 ;
17 ; SKX-LABEL: test_x86_ssse3_pabs_b_128:
18 ; SKX:       ## BB#0:
19 ; SKX-NEXT:    vpabsb %xmm0, %xmm0 ## EVEX TO VEX Compression encoding: [0xc4,0xe2,0x79,0x1c,0xc0]
20 ; SKX-NEXT:    retl ## encoding: [0xc3]
21   %res = call <16 x i8> @llvm.x86.ssse3.pabs.b.128(<16 x i8> %a0) ; <<16 x i8>> [#uses=1]
22   ret <16 x i8> %res
23 }
24 declare <16 x i8> @llvm.x86.ssse3.pabs.b.128(<16 x i8>) nounwind readnone
25
26
27 define <4 x i32> @test_x86_ssse3_pabs_d_128(<4 x i32> %a0) {
28 ; SSE-LABEL: test_x86_ssse3_pabs_d_128:
29 ; SSE:       ## BB#0:
30 ; SSE-NEXT:    pabsd %xmm0, %xmm0 ## encoding: [0x66,0x0f,0x38,0x1e,0xc0]
31 ; SSE-NEXT:    retl ## encoding: [0xc3]
32 ;
33 ; AVX2-LABEL: test_x86_ssse3_pabs_d_128:
34 ; AVX2:       ## BB#0:
35 ; AVX2-NEXT:    vpabsd %xmm0, %xmm0 ## encoding: [0xc4,0xe2,0x79,0x1e,0xc0]
36 ; AVX2-NEXT:    retl ## encoding: [0xc3]
37 ;
38 ; SKX-LABEL: test_x86_ssse3_pabs_d_128:
39 ; SKX:       ## BB#0:
40 ; SKX-NEXT:    vpabsd %xmm0, %xmm0 ## EVEX TO VEX Compression encoding: [0xc4,0xe2,0x79,0x1e,0xc0]
41 ; SKX-NEXT:    retl ## encoding: [0xc3]
42   %res = call <4 x i32> @llvm.x86.ssse3.pabs.d.128(<4 x i32> %a0) ; <<4 x i32>> [#uses=1]
43   ret <4 x i32> %res
44 }
45 declare <4 x i32> @llvm.x86.ssse3.pabs.d.128(<4 x i32>) nounwind readnone
46
47
48 define <8 x i16> @test_x86_ssse3_pabs_w_128(<8 x i16> %a0) {
49 ; SSE-LABEL: test_x86_ssse3_pabs_w_128:
50 ; SSE:       ## BB#0:
51 ; SSE-NEXT:    pabsw %xmm0, %xmm0 ## encoding: [0x66,0x0f,0x38,0x1d,0xc0]
52 ; SSE-NEXT:    retl ## encoding: [0xc3]
53 ;
54 ; AVX2-LABEL: test_x86_ssse3_pabs_w_128:
55 ; AVX2:       ## BB#0:
56 ; AVX2-NEXT:    vpabsw %xmm0, %xmm0 ## encoding: [0xc4,0xe2,0x79,0x1d,0xc0]
57 ; AVX2-NEXT:    retl ## encoding: [0xc3]
58 ;
59 ; SKX-LABEL: test_x86_ssse3_pabs_w_128:
60 ; SKX:       ## BB#0:
61 ; SKX-NEXT:    vpabsw %xmm0, %xmm0 ## EVEX TO VEX Compression encoding: [0xc4,0xe2,0x79,0x1d,0xc0]
62 ; SKX-NEXT:    retl ## encoding: [0xc3]
63   %res = call <8 x i16> @llvm.x86.ssse3.pabs.w.128(<8 x i16> %a0) ; <<8 x i16>> [#uses=1]
64   ret <8 x i16> %res
65 }
66 declare <8 x i16> @llvm.x86.ssse3.pabs.w.128(<8 x i16>) nounwind readnone
67
68
69 define <4 x i32> @test_x86_ssse3_phadd_d_128(<4 x i32> %a0, <4 x i32> %a1) {
70 ; SSE-LABEL: test_x86_ssse3_phadd_d_128:
71 ; SSE:       ## BB#0:
72 ; SSE-NEXT:    phaddd %xmm1, %xmm0 ## encoding: [0x66,0x0f,0x38,0x02,0xc1]
73 ; SSE-NEXT:    retl ## encoding: [0xc3]
74 ;
75 ; VCHECK-LABEL: test_x86_ssse3_phadd_d_128:
76 ; VCHECK:       ## BB#0:
77 ; VCHECK-NEXT:    vphaddd %xmm1, %xmm0, %xmm0 ## encoding: [0xc4,0xe2,0x79,0x02,0xc1]
78 ; VCHECK-NEXT:    retl ## encoding: [0xc3]
79   %res = call <4 x i32> @llvm.x86.ssse3.phadd.d.128(<4 x i32> %a0, <4 x i32> %a1) ; <<4 x i32>> [#uses=1]
80   ret <4 x i32> %res
81 }
82 declare <4 x i32> @llvm.x86.ssse3.phadd.d.128(<4 x i32>, <4 x i32>) nounwind readnone
83
84
85 define <8 x i16> @test_x86_ssse3_phadd_sw_128(<8 x i16> %a0, <8 x i16> %a1) {
86 ; SSE-LABEL: test_x86_ssse3_phadd_sw_128:
87 ; SSE:       ## BB#0:
88 ; SSE-NEXT:    phaddsw %xmm1, %xmm0 ## encoding: [0x66,0x0f,0x38,0x03,0xc1]
89 ; SSE-NEXT:    retl ## encoding: [0xc3]
90 ;
91 ; VCHECK-LABEL: test_x86_ssse3_phadd_sw_128:
92 ; VCHECK:       ## BB#0:
93 ; VCHECK-NEXT:    vphaddsw %xmm1, %xmm0, %xmm0 ## encoding: [0xc4,0xe2,0x79,0x03,0xc1]
94 ; VCHECK-NEXT:    retl ## encoding: [0xc3]
95   %res = call <8 x i16> @llvm.x86.ssse3.phadd.sw.128(<8 x i16> %a0, <8 x i16> %a1) ; <<8 x i16>> [#uses=1]
96   ret <8 x i16> %res
97 }
98 declare <8 x i16> @llvm.x86.ssse3.phadd.sw.128(<8 x i16>, <8 x i16>) nounwind readnone
99
100
101 define <8 x i16> @test_x86_ssse3_phadd_w_128(<8 x i16> %a0, <8 x i16> %a1) {
102 ; SSE-LABEL: test_x86_ssse3_phadd_w_128:
103 ; SSE:       ## BB#0:
104 ; SSE-NEXT:    phaddw %xmm1, %xmm0 ## encoding: [0x66,0x0f,0x38,0x01,0xc1]
105 ; SSE-NEXT:    retl ## encoding: [0xc3]
106 ;
107 ; VCHECK-LABEL: test_x86_ssse3_phadd_w_128:
108 ; VCHECK:       ## BB#0:
109 ; VCHECK-NEXT:    vphaddw %xmm1, %xmm0, %xmm0 ## encoding: [0xc4,0xe2,0x79,0x01,0xc1]
110 ; VCHECK-NEXT:    retl ## encoding: [0xc3]
111   %res = call <8 x i16> @llvm.x86.ssse3.phadd.w.128(<8 x i16> %a0, <8 x i16> %a1) ; <<8 x i16>> [#uses=1]
112   ret <8 x i16> %res
113 }
114 declare <8 x i16> @llvm.x86.ssse3.phadd.w.128(<8 x i16>, <8 x i16>) nounwind readnone
115
116
117 define <4 x i32> @test_x86_ssse3_phsub_d_128(<4 x i32> %a0, <4 x i32> %a1) {
118 ; SSE-LABEL: test_x86_ssse3_phsub_d_128:
119 ; SSE:       ## BB#0:
120 ; SSE-NEXT:    phsubd %xmm1, %xmm0 ## encoding: [0x66,0x0f,0x38,0x06,0xc1]
121 ; SSE-NEXT:    retl ## encoding: [0xc3]
122 ;
123 ; VCHECK-LABEL: test_x86_ssse3_phsub_d_128:
124 ; VCHECK:       ## BB#0:
125 ; VCHECK-NEXT:    vphsubd %xmm1, %xmm0, %xmm0 ## encoding: [0xc4,0xe2,0x79,0x06,0xc1]
126 ; VCHECK-NEXT:    retl ## encoding: [0xc3]
127   %res = call <4 x i32> @llvm.x86.ssse3.phsub.d.128(<4 x i32> %a0, <4 x i32> %a1) ; <<4 x i32>> [#uses=1]
128   ret <4 x i32> %res
129 }
130 declare <4 x i32> @llvm.x86.ssse3.phsub.d.128(<4 x i32>, <4 x i32>) nounwind readnone
131
132
133 define <8 x i16> @test_x86_ssse3_phsub_sw_128(<8 x i16> %a0, <8 x i16> %a1) {
134 ; SSE-LABEL: test_x86_ssse3_phsub_sw_128:
135 ; SSE:       ## BB#0:
136 ; SSE-NEXT:    phsubsw %xmm1, %xmm0 ## encoding: [0x66,0x0f,0x38,0x07,0xc1]
137 ; SSE-NEXT:    retl ## encoding: [0xc3]
138 ;
139 ; VCHECK-LABEL: test_x86_ssse3_phsub_sw_128:
140 ; VCHECK:       ## BB#0:
141 ; VCHECK-NEXT:    vphsubsw %xmm1, %xmm0, %xmm0 ## encoding: [0xc4,0xe2,0x79,0x07,0xc1]
142 ; VCHECK-NEXT:    retl ## encoding: [0xc3]
143   %res = call <8 x i16> @llvm.x86.ssse3.phsub.sw.128(<8 x i16> %a0, <8 x i16> %a1) ; <<8 x i16>> [#uses=1]
144   ret <8 x i16> %res
145 }
146 declare <8 x i16> @llvm.x86.ssse3.phsub.sw.128(<8 x i16>, <8 x i16>) nounwind readnone
147
148
149 define <8 x i16> @test_x86_ssse3_phsub_w_128(<8 x i16> %a0, <8 x i16> %a1) {
150 ; SSE-LABEL: test_x86_ssse3_phsub_w_128:
151 ; SSE:       ## BB#0:
152 ; SSE-NEXT:    phsubw %xmm1, %xmm0 ## encoding: [0x66,0x0f,0x38,0x05,0xc1]
153 ; SSE-NEXT:    retl ## encoding: [0xc3]
154 ;
155 ; VCHECK-LABEL: test_x86_ssse3_phsub_w_128:
156 ; VCHECK:       ## BB#0:
157 ; VCHECK-NEXT:    vphsubw %xmm1, %xmm0, %xmm0 ## encoding: [0xc4,0xe2,0x79,0x05,0xc1]
158 ; VCHECK-NEXT:    retl ## encoding: [0xc3]
159   %res = call <8 x i16> @llvm.x86.ssse3.phsub.w.128(<8 x i16> %a0, <8 x i16> %a1) ; <<8 x i16>> [#uses=1]
160   ret <8 x i16> %res
161 }
162 declare <8 x i16> @llvm.x86.ssse3.phsub.w.128(<8 x i16>, <8 x i16>) nounwind readnone
163
164
165 define <8 x i16> @test_x86_ssse3_pmadd_ub_sw_128(<16 x i8> %a0, <16 x i8> %a1) {
166 ; SSE-LABEL: test_x86_ssse3_pmadd_ub_sw_128:
167 ; SSE:       ## BB#0:
168 ; SSE-NEXT:    pmaddubsw %xmm1, %xmm0 ## encoding: [0x66,0x0f,0x38,0x04,0xc1]
169 ; SSE-NEXT:    retl ## encoding: [0xc3]
170 ;
171 ; AVX2-LABEL: test_x86_ssse3_pmadd_ub_sw_128:
172 ; AVX2:       ## BB#0:
173 ; AVX2-NEXT:    vpmaddubsw %xmm1, %xmm0, %xmm0 ## encoding: [0xc4,0xe2,0x79,0x04,0xc1]
174 ; AVX2-NEXT:    retl ## encoding: [0xc3]
175 ;
176 ; SKX-LABEL: test_x86_ssse3_pmadd_ub_sw_128:
177 ; SKX:       ## BB#0:
178 ; SKX-NEXT:    vpmaddubsw %xmm1, %xmm0, %xmm0 ## EVEX TO VEX Compression encoding: [0xc4,0xe2,0x79,0x04,0xc1]
179 ; SKX-NEXT:    retl ## encoding: [0xc3]
180   %res = call <8 x i16> @llvm.x86.ssse3.pmadd.ub.sw.128(<16 x i8> %a0, <16 x i8> %a1) ; <<8 x i16>> [#uses=1]
181   ret <8 x i16> %res
182 }
183 declare <8 x i16> @llvm.x86.ssse3.pmadd.ub.sw.128(<16 x i8>, <16 x i8>) nounwind readnone
184
185
186 define <8 x i16> @test_x86_ssse3_pmul_hr_sw_128(<8 x i16> %a0, <8 x i16> %a1) {
187 ; SSE-LABEL: test_x86_ssse3_pmul_hr_sw_128:
188 ; SSE:       ## BB#0:
189 ; SSE-NEXT:    pmulhrsw %xmm1, %xmm0 ## encoding: [0x66,0x0f,0x38,0x0b,0xc1]
190 ; SSE-NEXT:    retl ## encoding: [0xc3]
191 ;
192 ; AVX2-LABEL: test_x86_ssse3_pmul_hr_sw_128:
193 ; AVX2:       ## BB#0:
194 ; AVX2-NEXT:    vpmulhrsw %xmm1, %xmm0, %xmm0 ## encoding: [0xc4,0xe2,0x79,0x0b,0xc1]
195 ; AVX2-NEXT:    retl ## encoding: [0xc3]
196 ;
197 ; SKX-LABEL: test_x86_ssse3_pmul_hr_sw_128:
198 ; SKX:       ## BB#0:
199 ; SKX-NEXT:    vpmulhrsw %xmm1, %xmm0, %xmm0 ## EVEX TO VEX Compression encoding: [0xc4,0xe2,0x79,0x0b,0xc1]
200 ; SKX-NEXT:    retl ## encoding: [0xc3]
201   %res = call <8 x i16> @llvm.x86.ssse3.pmul.hr.sw.128(<8 x i16> %a0, <8 x i16> %a1) ; <<8 x i16>> [#uses=1]
202   ret <8 x i16> %res
203 }
204 declare <8 x i16> @llvm.x86.ssse3.pmul.hr.sw.128(<8 x i16>, <8 x i16>) nounwind readnone
205
206
207 define <16 x i8> @test_x86_ssse3_pshuf_b_128(<16 x i8> %a0, <16 x i8> %a1) {
208 ; SSE-LABEL: test_x86_ssse3_pshuf_b_128:
209 ; SSE:       ## BB#0:
210 ; SSE-NEXT:    pshufb %xmm1, %xmm0 ## encoding: [0x66,0x0f,0x38,0x00,0xc1]
211 ; SSE-NEXT:    retl ## encoding: [0xc3]
212 ;
213 ; AVX2-LABEL: test_x86_ssse3_pshuf_b_128:
214 ; AVX2:       ## BB#0:
215 ; AVX2-NEXT:    vpshufb %xmm1, %xmm0, %xmm0 ## encoding: [0xc4,0xe2,0x79,0x00,0xc1]
216 ; AVX2-NEXT:    retl ## encoding: [0xc3]
217 ;
218 ; SKX-LABEL: test_x86_ssse3_pshuf_b_128:
219 ; SKX:       ## BB#0:
220 ; SKX-NEXT:    vpshufb %xmm1, %xmm0, %xmm0 ## EVEX TO VEX Compression encoding: [0xc4,0xe2,0x79,0x00,0xc1]
221 ; SKX-NEXT:    retl ## encoding: [0xc3]
222   %res = call <16 x i8> @llvm.x86.ssse3.pshuf.b.128(<16 x i8> %a0, <16 x i8> %a1) ; <<16 x i8>> [#uses=1]
223   ret <16 x i8> %res
224 }
225 declare <16 x i8> @llvm.x86.ssse3.pshuf.b.128(<16 x i8>, <16 x i8>) nounwind readnone
226
227
228 define <16 x i8> @test_x86_ssse3_psign_b_128(<16 x i8> %a0, <16 x i8> %a1) {
229 ; SSE-LABEL: test_x86_ssse3_psign_b_128:
230 ; SSE:       ## BB#0:
231 ; SSE-NEXT:    psignb %xmm1, %xmm0 ## encoding: [0x66,0x0f,0x38,0x08,0xc1]
232 ; SSE-NEXT:    retl ## encoding: [0xc3]
233 ;
234 ; VCHECK-LABEL: test_x86_ssse3_psign_b_128:
235 ; VCHECK:       ## BB#0:
236 ; VCHECK-NEXT:    vpsignb %xmm1, %xmm0, %xmm0 ## encoding: [0xc4,0xe2,0x79,0x08,0xc1]
237 ; VCHECK-NEXT:    retl ## encoding: [0xc3]
238   %res = call <16 x i8> @llvm.x86.ssse3.psign.b.128(<16 x i8> %a0, <16 x i8> %a1) ; <<16 x i8>> [#uses=1]
239   ret <16 x i8> %res
240 }
241 declare <16 x i8> @llvm.x86.ssse3.psign.b.128(<16 x i8>, <16 x i8>) nounwind readnone
242
243
244 define <4 x i32> @test_x86_ssse3_psign_d_128(<4 x i32> %a0, <4 x i32> %a1) {
245 ; SSE-LABEL: test_x86_ssse3_psign_d_128:
246 ; SSE:       ## BB#0:
247 ; SSE-NEXT:    psignd %xmm1, %xmm0 ## encoding: [0x66,0x0f,0x38,0x0a,0xc1]
248 ; SSE-NEXT:    retl ## encoding: [0xc3]
249 ;
250 ; VCHECK-LABEL: test_x86_ssse3_psign_d_128:
251 ; VCHECK:       ## BB#0:
252 ; VCHECK-NEXT:    vpsignd %xmm1, %xmm0, %xmm0 ## encoding: [0xc4,0xe2,0x79,0x0a,0xc1]
253 ; VCHECK-NEXT:    retl ## encoding: [0xc3]
254   %res = call <4 x i32> @llvm.x86.ssse3.psign.d.128(<4 x i32> %a0, <4 x i32> %a1) ; <<4 x i32>> [#uses=1]
255   ret <4 x i32> %res
256 }
257 declare <4 x i32> @llvm.x86.ssse3.psign.d.128(<4 x i32>, <4 x i32>) nounwind readnone
258
259
260 define <8 x i16> @test_x86_ssse3_psign_w_128(<8 x i16> %a0, <8 x i16> %a1) {
261 ; SSE-LABEL: test_x86_ssse3_psign_w_128:
262 ; SSE:       ## BB#0:
263 ; SSE-NEXT:    psignw %xmm1, %xmm0 ## encoding: [0x66,0x0f,0x38,0x09,0xc1]
264 ; SSE-NEXT:    retl ## encoding: [0xc3]
265 ;
266 ; VCHECK-LABEL: test_x86_ssse3_psign_w_128:
267 ; VCHECK:       ## BB#0:
268 ; VCHECK-NEXT:    vpsignw %xmm1, %xmm0, %xmm0 ## encoding: [0xc4,0xe2,0x79,0x09,0xc1]
269 ; VCHECK-NEXT:    retl ## encoding: [0xc3]
270   %res = call <8 x i16> @llvm.x86.ssse3.psign.w.128(<8 x i16> %a0, <8 x i16> %a1) ; <<8 x i16>> [#uses=1]
271   ret <8 x i16> %res
272 }
273 declare <8 x i16> @llvm.x86.ssse3.psign.w.128(<8 x i16>, <8 x i16>) nounwind readnone