1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc < %s -O3 -disable-peephole -mtriple=i686-apple-macosx10.9.0 -mcpu=corei7-avx -mattr=+avx | FileCheck %s --check-prefix=X86
3 ; RUN: llc < %s -O3 -disable-peephole -mtriple=x86_64-apple-macosx10.9.0 -mcpu=corei7-avx -mattr=+avx | FileCheck %s --check-prefix=X64
5 ; Function Attrs: nounwind ssp uwtable
6 define void @test1(float* %A, float* %C) #0 {
9 ; X86-NEXT: movl {{[0-9]+}}(%esp), %eax
10 ; X86-NEXT: movl {{[0-9]+}}(%esp), %ecx
11 ; X86-NEXT: vmovss {{.*#+}} xmm0 = mem[0],zero,zero,zero
12 ; X86-NEXT: vandps LCPI0_0, %xmm0, %xmm0
13 ; X86-NEXT: vmovss %xmm0, (%eax)
18 ; X64-NEXT: vmovss {{.*#+}} xmm0 = mem[0],zero,zero,zero
19 ; X64-NEXT: vandps {{.*}}(%rip), %xmm0, %xmm0
20 ; X64-NEXT: vmovss %xmm0, (%rsi)
22 %tmp1 = bitcast float* %A to <8 x float>*
23 %tmp2 = load <8 x float>, <8 x float>* %tmp1, align 32
24 %tmp3 = bitcast <8 x float> %tmp2 to <8 x i32>
25 %tmp4 = and <8 x i32> %tmp3, <i32 2147483647, i32 2147483647, i32 2147483647, i32 2147483647, i32 2147483647, i32 2147483647, i32 2147483647, i32 2147483647>
26 %tmp5 = bitcast <8 x i32> %tmp4 to <8 x float>
27 %tmp6 = extractelement <8 x float> %tmp5, i32 0
28 store float %tmp6, float* %C
32 ; Function Attrs: nounwind ssp uwtable
33 define void @test2(float* %A, float* %C) #0 {
36 ; X86-NEXT: movl {{[0-9]+}}(%esp), %eax
37 ; X86-NEXT: movl {{[0-9]+}}(%esp), %ecx
38 ; X86-NEXT: vmovaps (%ecx), %xmm0
39 ; X86-NEXT: vorps LCPI1_0, %xmm0, %xmm0
40 ; X86-NEXT: vmovss %xmm0, (%eax)
45 ; X64-NEXT: vmovaps (%rdi), %xmm0
46 ; X64-NEXT: vorps {{.*}}(%rip), %xmm0, %xmm0
47 ; X64-NEXT: vmovss %xmm0, (%rsi)
49 %tmp1 = bitcast float* %A to <8 x float>*
50 %tmp2 = load <8 x float>, <8 x float>* %tmp1, align 32
51 %tmp3 = bitcast <8 x float> %tmp2 to <8 x i32>
52 %tmp4 = or <8 x i32> %tmp3, <i32 2147483647, i32 2147483647, i32 2147483647, i32 2147483647, i32 2147483647, i32 2147483647, i32 2147483647, i32 2147483647>
53 %tmp5 = bitcast <8 x i32> %tmp4 to <8 x float>
54 %tmp6 = extractelement <8 x float> %tmp5, i32 0
55 store float %tmp6, float* %C
59 ; Function Attrs: nounwind ssp uwtable
60 define void @test3(float* %A, float* %C) #0 {
63 ; X86-NEXT: movl {{[0-9]+}}(%esp), %eax
64 ; X86-NEXT: movl {{[0-9]+}}(%esp), %ecx
65 ; X86-NEXT: vmovaps (%ecx), %xmm0
66 ; X86-NEXT: vxorps LCPI2_0, %xmm0, %xmm0
67 ; X86-NEXT: vmovss %xmm0, (%eax)
72 ; X64-NEXT: vmovaps (%rdi), %xmm0
73 ; X64-NEXT: vxorps {{.*}}(%rip), %xmm0, %xmm0
74 ; X64-NEXT: vmovss %xmm0, (%rsi)
76 %tmp1 = bitcast float* %A to <8 x float>*
77 %tmp2 = load <8 x float>, <8 x float>* %tmp1, align 32
78 %tmp3 = bitcast <8 x float> %tmp2 to <8 x i32>
79 %tmp4 = xor <8 x i32> %tmp3, <i32 2147483647, i32 2147483647, i32 2147483647, i32 2147483647, i32 2147483647, i32 2147483647, i32 2147483647, i32 2147483647>
80 %tmp5 = bitcast <8 x i32> %tmp4 to <8 x float>
81 %tmp6 = extractelement <8 x float> %tmp5, i32 0
82 store float %tmp6, float* %C
86 define void @test4(float* %A, float* %C) #0 {
89 ; X86-NEXT: movl {{[0-9]+}}(%esp), %eax
90 ; X86-NEXT: movl {{[0-9]+}}(%esp), %ecx
91 ; X86-NEXT: vmovaps (%ecx), %xmm0
92 ; X86-NEXT: vandnps LCPI3_0, %xmm0, %xmm0
93 ; X86-NEXT: vmovss %xmm0, (%eax)
98 ; X64-NEXT: vmovaps (%rdi), %xmm0
99 ; X64-NEXT: vandnps {{.*}}(%rip), %xmm0, %xmm0
100 ; X64-NEXT: vmovss %xmm0, (%rsi)
102 %tmp1 = bitcast float* %A to <8 x float>*
103 %tmp2 = load <8 x float>, <8 x float>* %tmp1, align 32
104 %tmp3 = bitcast <8 x float> %tmp2 to <8 x i32>
105 %tmp4 = xor <8 x i32> %tmp3, <i32 -1, i32 -1, i32 -1, i32 -1, i32 -1, i32 -1, i32 -1, i32 -1>
106 %tmp5 = and <8 x i32> %tmp4, <i32 2147483647, i32 2147483647, i32 2147483647, i32 2147483647, i32 2147483647, i32 2147483647, i32 2147483647, i32 2147483647>
107 %tmp6 = bitcast <8 x i32> %tmp5 to <8 x float>
108 %tmp7 = extractelement <8 x float> %tmp6, i32 0
109 store float %tmp7, float * %C