1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc < %s -mtriple=i686-unknown -mattr=+sse4.2 | FileCheck %s --check-prefix=X86
3 ; RUN: llc < %s -mtriple=x86_64-unknown -mattr=+sse4.2 | FileCheck %s --check-prefix=X64
6 ; AND/XOR/OR i32 as v4i8
9 define i32 @and_i32_as_v4i8(i32 %a, i32 %b) nounwind {
10 ; X86-LABEL: and_i32_as_v4i8:
12 ; X86-NEXT: movl {{[0-9]+}}(%esp), %eax
13 ; X86-NEXT: andl {{[0-9]+}}(%esp), %eax
16 ; X64-LABEL: and_i32_as_v4i8:
18 ; X64-NEXT: movl %edi, %eax
19 ; X64-NEXT: andl %esi, %eax
21 %1 = bitcast i32 %a to <4 x i8>
22 %2 = bitcast i32 %b to <4 x i8>
23 %3 = and <4 x i8> %1, %2
24 %4 = bitcast <4 x i8> %3 to i32
28 define i32 @xor_i32_as_v4i8(i32 %a, i32 %b) nounwind {
29 ; X86-LABEL: xor_i32_as_v4i8:
31 ; X86-NEXT: movl {{[0-9]+}}(%esp), %eax
32 ; X86-NEXT: xorl {{[0-9]+}}(%esp), %eax
35 ; X64-LABEL: xor_i32_as_v4i8:
37 ; X64-NEXT: movl %edi, %eax
38 ; X64-NEXT: xorl %esi, %eax
40 %1 = bitcast i32 %a to <4 x i8>
41 %2 = bitcast i32 %b to <4 x i8>
42 %3 = xor <4 x i8> %1, %2
43 %4 = bitcast <4 x i8> %3 to i32
47 define i32 @or_i32_as_v4i8(i32 %a, i32 %b) nounwind {
48 ; X86-LABEL: or_i32_as_v4i8:
50 ; X86-NEXT: movl {{[0-9]+}}(%esp), %eax
51 ; X86-NEXT: orl {{[0-9]+}}(%esp), %eax
54 ; X64-LABEL: or_i32_as_v4i8:
56 ; X64-NEXT: movl %edi, %eax
57 ; X64-NEXT: orl %esi, %eax
59 %1 = bitcast i32 %a to <4 x i8>
60 %2 = bitcast i32 %b to <4 x i8>
61 %3 = or <4 x i8> %1, %2
62 %4 = bitcast <4 x i8> %3 to i32
67 ; AND/XOR/OR i32 as v8i4
70 define i32 @and_i32_as_v8i4(i32 %a, i32 %b) nounwind {
71 ; X86-LABEL: and_i32_as_v8i4:
73 ; X86-NEXT: movl {{[0-9]+}}(%esp), %eax
74 ; X86-NEXT: andl {{[0-9]+}}(%esp), %eax
77 ; X64-LABEL: and_i32_as_v8i4:
79 ; X64-NEXT: movl %edi, %eax
80 ; X64-NEXT: andl %esi, %eax
82 %1 = bitcast i32 %a to <8 x i4>
83 %2 = bitcast i32 %b to <8 x i4>
84 %3 = and <8 x i4> %1, %2
85 %4 = bitcast <8 x i4> %3 to i32
89 define i32 @xor_i32_as_v8i4(i32 %a, i32 %b) nounwind {
90 ; X86-LABEL: xor_i32_as_v8i4:
92 ; X86-NEXT: movl {{[0-9]+}}(%esp), %eax
93 ; X86-NEXT: xorl {{[0-9]+}}(%esp), %eax
96 ; X64-LABEL: xor_i32_as_v8i4:
98 ; X64-NEXT: movl %edi, %eax
99 ; X64-NEXT: xorl %esi, %eax
101 %1 = bitcast i32 %a to <8 x i4>
102 %2 = bitcast i32 %b to <8 x i4>
103 %3 = xor <8 x i4> %1, %2
104 %4 = bitcast <8 x i4> %3 to i32
108 define i32 @or_i32_as_v8i4(i32 %a, i32 %b) nounwind {
109 ; X86-LABEL: or_i32_as_v8i4:
111 ; X86-NEXT: movl {{[0-9]+}}(%esp), %eax
112 ; X86-NEXT: orl {{[0-9]+}}(%esp), %eax
115 ; X64-LABEL: or_i32_as_v8i4:
117 ; X64-NEXT: movl %edi, %eax
118 ; X64-NEXT: orl %esi, %eax
120 %1 = bitcast i32 %a to <8 x i4>
121 %2 = bitcast i32 %b to <8 x i4>
122 %3 = or <8 x i4> %1, %2
123 %4 = bitcast <8 x i4> %3 to i32
128 ; AND/XOR/OR v4i8 as i32
131 define <4 x i8> @and_v4i8_as_i32(<4 x i8> %a, <4 x i8> %b) nounwind {
132 ; X86-LABEL: and_v4i8_as_i32:
134 ; X86-NEXT: andps %xmm1, %xmm0
137 ; X64-LABEL: and_v4i8_as_i32:
139 ; X64-NEXT: andps %xmm1, %xmm0
141 %1 = bitcast <4 x i8> %a to i32
142 %2 = bitcast <4 x i8> %b to i32
144 %4 = bitcast i32 %3 to <4 x i8>
148 define <4 x i8> @xor_v4i8_as_i32(<4 x i8> %a, <4 x i8> %b) nounwind {
149 ; X86-LABEL: xor_v4i8_as_i32:
151 ; X86-NEXT: xorps %xmm1, %xmm0
154 ; X64-LABEL: xor_v4i8_as_i32:
156 ; X64-NEXT: xorps %xmm1, %xmm0
158 %1 = bitcast <4 x i8> %a to i32
159 %2 = bitcast <4 x i8> %b to i32
161 %4 = bitcast i32 %3 to <4 x i8>
165 define <4 x i8> @or_v4i8_as_i32(<4 x i8> %a, <4 x i8> %b) nounwind {
166 ; X86-LABEL: or_v4i8_as_i32:
168 ; X86-NEXT: orps %xmm1, %xmm0
171 ; X64-LABEL: or_v4i8_as_i32:
173 ; X64-NEXT: orps %xmm1, %xmm0
175 %1 = bitcast <4 x i8> %a to i32
176 %2 = bitcast <4 x i8> %b to i32
178 %4 = bitcast i32 %3 to <4 x i8>
183 ; AND/XOR/OR v8i4 as i32
186 define <8 x i4> @and_v8i4_as_i32(<8 x i4> %a, <8 x i4> %b) nounwind {
187 ; X86-LABEL: and_v8i4_as_i32:
189 ; X86-NEXT: andps %xmm1, %xmm0
192 ; X64-LABEL: and_v8i4_as_i32:
194 ; X64-NEXT: andps %xmm1, %xmm0
196 %1 = bitcast <8 x i4> %a to i32
197 %2 = bitcast <8 x i4> %b to i32
199 %4 = bitcast i32 %3 to <8 x i4>
203 define <8 x i4> @xor_v8i4_as_i32(<8 x i4> %a, <8 x i4> %b) nounwind {
204 ; X86-LABEL: xor_v8i4_as_i32:
206 ; X86-NEXT: xorps %xmm1, %xmm0
209 ; X64-LABEL: xor_v8i4_as_i32:
211 ; X64-NEXT: xorps %xmm1, %xmm0
213 %1 = bitcast <8 x i4> %a to i32
214 %2 = bitcast <8 x i4> %b to i32
216 %4 = bitcast i32 %3 to <8 x i4>
220 define <8 x i4> @or_v8i4_as_i32(<8 x i4> %a, <8 x i4> %b) nounwind {
221 ; X86-LABEL: or_v8i4_as_i32:
223 ; X86-NEXT: orps %xmm1, %xmm0
226 ; X64-LABEL: or_v8i4_as_i32:
228 ; X64-NEXT: orps %xmm1, %xmm0
230 %1 = bitcast <8 x i4> %a to i32
231 %2 = bitcast <8 x i4> %b to i32
233 %4 = bitcast i32 %3 to <8 x i4>