1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc < %s -mtriple=i386-unknown -mattr=+sse2 | FileCheck %s --check-prefix=SSE
3 ; RUN: llc < %s -mtriple=i386-unknown -mattr=+avx | FileCheck %s --check-prefix=AVX
5 define void @t(<4 x float> %A) {
8 ; SSE-NEXT: xorps {{\.LCPI.*}}, %xmm0
9 ; SSE-NEXT: movaps %xmm0, 0
14 ; AVX-NEXT: vxorps {{\.LCPI.*}}, %xmm0, %xmm0
15 ; AVX-NEXT: vmovaps %xmm0, 0
17 %tmp1277 = fsub <4 x float> < float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00 >, %A
18 store <4 x float> %tmp1277, <4 x float>* null
22 define <4 x float> @t1(<4 x float> %a, <4 x float> %b) {
24 ; SSE: # %bb.0: # %entry
25 ; SSE-NEXT: xorps %xmm1, %xmm0
29 ; AVX: # %bb.0: # %entry
30 ; AVX-NEXT: vxorps %xmm1, %xmm0, %xmm0
33 %tmp9 = bitcast <4 x float> %a to <4 x i32>
34 %tmp10 = bitcast <4 x float> %b to <4 x i32>
35 %tmp11 = xor <4 x i32> %tmp9, %tmp10
36 %tmp13 = bitcast <4 x i32> %tmp11 to <4 x float>
37 ret <4 x float> %tmp13
40 define <2 x double> @t2(<2 x double> %a, <2 x double> %b) {
42 ; SSE: # %bb.0: # %entry
43 ; SSE-NEXT: andps %xmm1, %xmm0
47 ; AVX: # %bb.0: # %entry
48 ; AVX-NEXT: vandps %xmm1, %xmm0, %xmm0
51 %tmp9 = bitcast <2 x double> %a to <2 x i64>
52 %tmp10 = bitcast <2 x double> %b to <2 x i64>
53 %tmp11 = and <2 x i64> %tmp9, %tmp10
54 %tmp13 = bitcast <2 x i64> %tmp11 to <2 x double>
55 ret <2 x double> %tmp13
58 define void @t3(<4 x float> %a, <4 x float> %b, <4 x float>* %c, <4 x float>* %d) {
60 ; SSE: # %bb.0: # %entry
61 ; SSE-NEXT: movl {{[0-9]+}}(%esp), %eax
62 ; SSE-NEXT: movl {{[0-9]+}}(%esp), %ecx
63 ; SSE-NEXT: andnps %xmm1, %xmm0
64 ; SSE-NEXT: orps (%ecx), %xmm0
65 ; SSE-NEXT: movaps %xmm0, (%eax)
69 ; AVX: # %bb.0: # %entry
70 ; AVX-NEXT: movl {{[0-9]+}}(%esp), %eax
71 ; AVX-NEXT: movl {{[0-9]+}}(%esp), %ecx
72 ; AVX-NEXT: vandnps %xmm1, %xmm0, %xmm0
73 ; AVX-NEXT: vorps (%ecx), %xmm0, %xmm0
74 ; AVX-NEXT: vmovaps %xmm0, (%eax)
77 %tmp3 = load <4 x float>, <4 x float>* %c
78 %tmp11 = bitcast <4 x float> %a to <4 x i32>
79 %tmp12 = bitcast <4 x float> %b to <4 x i32>
80 %tmp13 = xor <4 x i32> %tmp11, < i32 -1, i32 -1, i32 -1, i32 -1 >
81 %tmp14 = and <4 x i32> %tmp12, %tmp13
82 %tmp27 = bitcast <4 x float> %tmp3 to <4 x i32>
83 %tmp28 = or <4 x i32> %tmp14, %tmp27
84 %tmp30 = bitcast <4 x i32> %tmp28 to <4 x float>
85 store <4 x float> %tmp30, <4 x float>* %d
89 define <2 x i64> @andn_double_xor(<2 x i64> %a, <2 x i64> %b, <2 x i64> %c) {
90 ; SSE-LABEL: andn_double_xor:
92 ; SSE-NEXT: xorps %xmm2, %xmm1
93 ; SSE-NEXT: andnps %xmm1, %xmm0
96 ; AVX-LABEL: andn_double_xor:
98 ; AVX-NEXT: vxorps %xmm2, %xmm1, %xmm1
99 ; AVX-NEXT: vandnps %xmm1, %xmm0, %xmm0
101 %1 = xor <2 x i64> %a, <i64 -1, i64 -1>
102 %2 = xor <2 x i64> %b, %c
103 %3 = and <2 x i64> %1, %2