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
6 define <16 x i8> @test_x86_ssse3_pabs_b_128(<16 x i8> %a0) {
7 ; SSE-LABEL: test_x86_ssse3_pabs_b_128:
9 ; SSE-NEXT: pabsb %xmm0, %xmm0 ## encoding: [0x66,0x0f,0x38,0x1c,0xc0]
10 ; SSE-NEXT: retl ## encoding: [0xc3]
12 ; AVX2-LABEL: test_x86_ssse3_pabs_b_128:
14 ; AVX2-NEXT: vpabsb %xmm0, %xmm0 ## encoding: [0xc4,0xe2,0x79,0x1c,0xc0]
15 ; AVX2-NEXT: retl ## encoding: [0xc3]
17 ; SKX-LABEL: test_x86_ssse3_pabs_b_128:
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]
24 declare <16 x i8> @llvm.x86.ssse3.pabs.b.128(<16 x i8>) nounwind readnone
27 define <4 x i32> @test_x86_ssse3_pabs_d_128(<4 x i32> %a0) {
28 ; SSE-LABEL: test_x86_ssse3_pabs_d_128:
30 ; SSE-NEXT: pabsd %xmm0, %xmm0 ## encoding: [0x66,0x0f,0x38,0x1e,0xc0]
31 ; SSE-NEXT: retl ## encoding: [0xc3]
33 ; AVX2-LABEL: test_x86_ssse3_pabs_d_128:
35 ; AVX2-NEXT: vpabsd %xmm0, %xmm0 ## encoding: [0xc4,0xe2,0x79,0x1e,0xc0]
36 ; AVX2-NEXT: retl ## encoding: [0xc3]
38 ; SKX-LABEL: test_x86_ssse3_pabs_d_128:
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]
45 declare <4 x i32> @llvm.x86.ssse3.pabs.d.128(<4 x i32>) nounwind readnone
48 define <8 x i16> @test_x86_ssse3_pabs_w_128(<8 x i16> %a0) {
49 ; SSE-LABEL: test_x86_ssse3_pabs_w_128:
51 ; SSE-NEXT: pabsw %xmm0, %xmm0 ## encoding: [0x66,0x0f,0x38,0x1d,0xc0]
52 ; SSE-NEXT: retl ## encoding: [0xc3]
54 ; AVX2-LABEL: test_x86_ssse3_pabs_w_128:
56 ; AVX2-NEXT: vpabsw %xmm0, %xmm0 ## encoding: [0xc4,0xe2,0x79,0x1d,0xc0]
57 ; AVX2-NEXT: retl ## encoding: [0xc3]
59 ; SKX-LABEL: test_x86_ssse3_pabs_w_128:
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]
66 declare <8 x i16> @llvm.x86.ssse3.pabs.w.128(<8 x i16>) nounwind readnone
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:
72 ; SSE-NEXT: phaddd %xmm1, %xmm0 ## encoding: [0x66,0x0f,0x38,0x02,0xc1]
73 ; SSE-NEXT: retl ## encoding: [0xc3]
75 ; VCHECK-LABEL: test_x86_ssse3_phadd_d_128:
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]
82 declare <4 x i32> @llvm.x86.ssse3.phadd.d.128(<4 x i32>, <4 x i32>) nounwind readnone
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:
88 ; SSE-NEXT: phaddsw %xmm1, %xmm0 ## encoding: [0x66,0x0f,0x38,0x03,0xc1]
89 ; SSE-NEXT: retl ## encoding: [0xc3]
91 ; VCHECK-LABEL: test_x86_ssse3_phadd_sw_128:
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]
98 declare <8 x i16> @llvm.x86.ssse3.phadd.sw.128(<8 x i16>, <8 x i16>) nounwind readnone
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:
104 ; SSE-NEXT: phaddw %xmm1, %xmm0 ## encoding: [0x66,0x0f,0x38,0x01,0xc1]
105 ; SSE-NEXT: retl ## encoding: [0xc3]
107 ; VCHECK-LABEL: test_x86_ssse3_phadd_w_128:
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]
114 declare <8 x i16> @llvm.x86.ssse3.phadd.w.128(<8 x i16>, <8 x i16>) nounwind readnone
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:
120 ; SSE-NEXT: phsubd %xmm1, %xmm0 ## encoding: [0x66,0x0f,0x38,0x06,0xc1]
121 ; SSE-NEXT: retl ## encoding: [0xc3]
123 ; VCHECK-LABEL: test_x86_ssse3_phsub_d_128:
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]
130 declare <4 x i32> @llvm.x86.ssse3.phsub.d.128(<4 x i32>, <4 x i32>) nounwind readnone
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:
136 ; SSE-NEXT: phsubsw %xmm1, %xmm0 ## encoding: [0x66,0x0f,0x38,0x07,0xc1]
137 ; SSE-NEXT: retl ## encoding: [0xc3]
139 ; VCHECK-LABEL: test_x86_ssse3_phsub_sw_128:
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]
146 declare <8 x i16> @llvm.x86.ssse3.phsub.sw.128(<8 x i16>, <8 x i16>) nounwind readnone
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:
152 ; SSE-NEXT: phsubw %xmm1, %xmm0 ## encoding: [0x66,0x0f,0x38,0x05,0xc1]
153 ; SSE-NEXT: retl ## encoding: [0xc3]
155 ; VCHECK-LABEL: test_x86_ssse3_phsub_w_128:
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]
162 declare <8 x i16> @llvm.x86.ssse3.phsub.w.128(<8 x i16>, <8 x i16>) nounwind readnone
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:
168 ; SSE-NEXT: pmaddubsw %xmm1, %xmm0 ## encoding: [0x66,0x0f,0x38,0x04,0xc1]
169 ; SSE-NEXT: retl ## encoding: [0xc3]
171 ; AVX2-LABEL: test_x86_ssse3_pmadd_ub_sw_128:
173 ; AVX2-NEXT: vpmaddubsw %xmm1, %xmm0, %xmm0 ## encoding: [0xc4,0xe2,0x79,0x04,0xc1]
174 ; AVX2-NEXT: retl ## encoding: [0xc3]
176 ; SKX-LABEL: test_x86_ssse3_pmadd_ub_sw_128:
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]
183 declare <8 x i16> @llvm.x86.ssse3.pmadd.ub.sw.128(<16 x i8>, <16 x i8>) nounwind readnone
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:
189 ; SSE-NEXT: pmulhrsw %xmm1, %xmm0 ## encoding: [0x66,0x0f,0x38,0x0b,0xc1]
190 ; SSE-NEXT: retl ## encoding: [0xc3]
192 ; AVX2-LABEL: test_x86_ssse3_pmul_hr_sw_128:
194 ; AVX2-NEXT: vpmulhrsw %xmm1, %xmm0, %xmm0 ## encoding: [0xc4,0xe2,0x79,0x0b,0xc1]
195 ; AVX2-NEXT: retl ## encoding: [0xc3]
197 ; SKX-LABEL: test_x86_ssse3_pmul_hr_sw_128:
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]
204 declare <8 x i16> @llvm.x86.ssse3.pmul.hr.sw.128(<8 x i16>, <8 x i16>) nounwind readnone
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:
210 ; SSE-NEXT: pshufb %xmm1, %xmm0 ## encoding: [0x66,0x0f,0x38,0x00,0xc1]
211 ; SSE-NEXT: retl ## encoding: [0xc3]
213 ; AVX2-LABEL: test_x86_ssse3_pshuf_b_128:
215 ; AVX2-NEXT: vpshufb %xmm1, %xmm0, %xmm0 ## encoding: [0xc4,0xe2,0x79,0x00,0xc1]
216 ; AVX2-NEXT: retl ## encoding: [0xc3]
218 ; SKX-LABEL: test_x86_ssse3_pshuf_b_128:
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]
225 declare <16 x i8> @llvm.x86.ssse3.pshuf.b.128(<16 x i8>, <16 x i8>) nounwind readnone
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:
231 ; SSE-NEXT: psignb %xmm1, %xmm0 ## encoding: [0x66,0x0f,0x38,0x08,0xc1]
232 ; SSE-NEXT: retl ## encoding: [0xc3]
234 ; VCHECK-LABEL: test_x86_ssse3_psign_b_128:
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]
241 declare <16 x i8> @llvm.x86.ssse3.psign.b.128(<16 x i8>, <16 x i8>) nounwind readnone
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:
247 ; SSE-NEXT: psignd %xmm1, %xmm0 ## encoding: [0x66,0x0f,0x38,0x0a,0xc1]
248 ; SSE-NEXT: retl ## encoding: [0xc3]
250 ; VCHECK-LABEL: test_x86_ssse3_psign_d_128:
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]
257 declare <4 x i32> @llvm.x86.ssse3.psign.d.128(<4 x i32>, <4 x i32>) nounwind readnone
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:
263 ; SSE-NEXT: psignw %xmm1, %xmm0 ## encoding: [0x66,0x0f,0x38,0x09,0xc1]
264 ; SSE-NEXT: retl ## encoding: [0xc3]
266 ; VCHECK-LABEL: test_x86_ssse3_psign_w_128:
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]
273 declare <8 x i16> @llvm.x86.ssse3.psign.w.128(<8 x i16>, <8 x i16>) nounwind readnone