1 ; RUN: llc < %s -march=x86-64 -mcpu=corei7 -mtriple=x86_64-unknown-linux-gnu | FileCheck %s -check-prefix=CHECK -check-prefix=SSE41
2 ; RUN: llc < %s -march=x86-64 -mcpu=corei7-avx -mtriple=x86_64-unknown-linux-gnu | FileCheck %s -check-prefix=CHECK -check-prefix=AVX
5 define double @test1_add(double %A, double %B) {
6 %1 = bitcast double %A to <2 x i32>
7 %2 = bitcast double %B to <2 x i32>
8 %add = add <2 x i32> %1, %2
9 %3 = bitcast <2 x i32> %add to double
12 ; CHECK-LABEL: test1_add
18 define double @test2_add(double %A, double %B) {
19 %1 = bitcast double %A to <4 x i16>
20 %2 = bitcast double %B to <4 x i16>
21 %add = add <4 x i16> %1, %2
22 %3 = bitcast <4 x i16> %add to double
25 ; CHECK-LABEL: test2_add
30 define double @test3_add(double %A, double %B) {
31 %1 = bitcast double %A to <8 x i8>
32 %2 = bitcast double %B to <8 x i8>
33 %add = add <8 x i8> %1, %2
34 %3 = bitcast <8 x i8> %add to double
37 ; CHECK-LABEL: test3_add
43 define double @test1_sub(double %A, double %B) {
44 %1 = bitcast double %A to <2 x i32>
45 %2 = bitcast double %B to <2 x i32>
46 %sub = sub <2 x i32> %1, %2
47 %3 = bitcast <2 x i32> %sub to double
50 ; CHECK-LABEL: test1_sub
56 define double @test2_sub(double %A, double %B) {
57 %1 = bitcast double %A to <4 x i16>
58 %2 = bitcast double %B to <4 x i16>
59 %sub = sub <4 x i16> %1, %2
60 %3 = bitcast <4 x i16> %sub to double
63 ; CHECK-LABEL: test2_sub
69 define double @test3_sub(double %A, double %B) {
70 %1 = bitcast double %A to <8 x i8>
71 %2 = bitcast double %B to <8 x i8>
72 %sub = sub <8 x i8> %1, %2
73 %3 = bitcast <8 x i8> %sub to double
76 ; CHECK-LABEL: test3_sub
82 define double @test1_mul(double %A, double %B) {
83 %1 = bitcast double %A to <2 x i32>
84 %2 = bitcast double %B to <2 x i32>
85 %mul = mul <2 x i32> %1, %2
86 %3 = bitcast <2 x i32> %mul to double
89 ; CHECK-LABEL: test1_mul
95 define double @test2_mul(double %A, double %B) {
96 %1 = bitcast double %A to <4 x i16>
97 %2 = bitcast double %B to <4 x i16>
98 %mul = mul <4 x i16> %1, %2
99 %3 = bitcast <4 x i16> %mul to double
102 ; CHECK-LABEL: test2_mul
107 ; There is no legal ISD::MUL with type MVT::v8i16.
108 define double @test3_mul(double %A, double %B) {
109 %1 = bitcast double %A to <8 x i8>
110 %2 = bitcast double %B to <8 x i8>
111 %mul = mul <8 x i8> %1, %2
112 %3 = bitcast <8 x i8> %mul to double
115 ; CHECK-LABEL: test3_mul
121 define double @test1_and(double %A, double %B) {
122 %1 = bitcast double %A to <2 x i32>
123 %2 = bitcast double %B to <2 x i32>
124 %and = and <2 x i32> %1, %2
125 %3 = bitcast <2 x i32> %and to double
128 ; CHECK-LABEL: test1_and
134 define double @test2_and(double %A, double %B) {
135 %1 = bitcast double %A to <4 x i16>
136 %2 = bitcast double %B to <4 x i16>
137 %and = and <4 x i16> %1, %2
138 %3 = bitcast <4 x i16> %and to double
141 ; CHECK-LABEL: test2_and
147 define double @test3_and(double %A, double %B) {
148 %1 = bitcast double %A to <8 x i8>
149 %2 = bitcast double %B to <8 x i8>
150 %and = and <8 x i8> %1, %2
151 %3 = bitcast <8 x i8> %and to double
154 ; CHECK-LABEL: test3_and
160 define double @test1_or(double %A, double %B) {
161 %1 = bitcast double %A to <2 x i32>
162 %2 = bitcast double %B to <2 x i32>
163 %or = or <2 x i32> %1, %2
164 %3 = bitcast <2 x i32> %or to double
167 ; CHECK-LABEL: test1_or
173 define double @test2_or(double %A, double %B) {
174 %1 = bitcast double %A to <4 x i16>
175 %2 = bitcast double %B to <4 x i16>
176 %or = or <4 x i16> %1, %2
177 %3 = bitcast <4 x i16> %or to double
180 ; CHECK-LABEL: test2_or
186 define double @test3_or(double %A, double %B) {
187 %1 = bitcast double %A to <8 x i8>
188 %2 = bitcast double %B to <8 x i8>
189 %or = or <8 x i8> %1, %2
190 %3 = bitcast <8 x i8> %or to double
193 ; CHECK-LABEL: test3_or
199 define double @test1_xor(double %A, double %B) {
200 %1 = bitcast double %A to <2 x i32>
201 %2 = bitcast double %B to <2 x i32>
202 %xor = xor <2 x i32> %1, %2
203 %3 = bitcast <2 x i32> %xor to double
206 ; CHECK-LABEL: test1_xor
212 define double @test2_xor(double %A, double %B) {
213 %1 = bitcast double %A to <4 x i16>
214 %2 = bitcast double %B to <4 x i16>
215 %xor = xor <4 x i16> %1, %2
216 %3 = bitcast <4 x i16> %xor to double
219 ; CHECK-LABEL: test2_xor
225 define double @test3_xor(double %A, double %B) {
226 %1 = bitcast double %A to <8 x i8>
227 %2 = bitcast double %B to <8 x i8>
228 %xor = xor <8 x i8> %1, %2
229 %3 = bitcast <8 x i8> %xor to double
232 ; CHECK-LABEL: test3_xor
238 define double @test_fadd(double %A, double %B) {
239 %1 = bitcast double %A to <2 x float>
240 %2 = bitcast double %B to <2 x float>
241 %add = fadd <2 x float> %1, %2
242 %3 = bitcast <2 x float> %add to double
245 ; CHECK-LABEL: test_fadd
250 define double @test_fsub(double %A, double %B) {
251 %1 = bitcast double %A to <2 x float>
252 %2 = bitcast double %B to <2 x float>
253 %sub = fsub <2 x float> %1, %2
254 %3 = bitcast <2 x float> %sub to double
257 ; CHECK-LABEL: test_fsub
262 define double @test_fmul(double %A, double %B) {
263 %1 = bitcast double %A to <2 x float>
264 %2 = bitcast double %B to <2 x float>
265 %mul = fmul <2 x float> %1, %2
266 %3 = bitcast <2 x float> %mul to double
269 ; CHECK-LABEL: test_fmul