blob: 90e00c965391e146399c1733ed0450b18a9d153a [file] [log] [blame]
Jim Grosbach576f8cf2014-04-10 00:27:43 +00001; RUN: llc -O3 -disable-peephole -mcpu=corei7-avx -mattr=+avx < %s | FileCheck %s
Jim Grosbache4fef712014-04-09 23:39:25 +00002
3target datalayout = "e-i64:64-f80:128-n8:16:32:64-S128"
4target triple = "x86_64-apple-macosx10.9.0"
5
6; Function Attrs: nounwind ssp uwtable
7define void @test1(float* %A, float* %C) #0 {
8 %tmp1 = bitcast float* %A to <8 x float>*
David Blaikiea79ac142015-02-27 21:17:42 +00009 %tmp2 = load <8 x float>, <8 x float>* %tmp1, align 32
Jim Grosbache4fef712014-04-09 23:39:25 +000010 %tmp3 = bitcast <8 x float> %tmp2 to <8 x i32>
11 %tmp4 = and <8 x i32> %tmp3, <i32 2147483647, i32 2147483647, i32 2147483647, i32 2147483647, i32 2147483647, i32 2147483647, i32 2147483647, i32 2147483647>
12 %tmp5 = bitcast <8 x i32> %tmp4 to <8 x float>
13 %tmp6 = extractelement <8 x float> %tmp5, i32 0
14 store float %tmp6, float* %C
15 ret void
16
17 ; CHECK: vandps LCPI0_0(%rip), %ymm0, %ymm0
18}
19
20; Function Attrs: nounwind ssp uwtable
21define void @test2(float* %A, float* %C) #0 {
22 %tmp1 = bitcast float* %A to <8 x float>*
David Blaikiea79ac142015-02-27 21:17:42 +000023 %tmp2 = load <8 x float>, <8 x float>* %tmp1, align 32
Jim Grosbache4fef712014-04-09 23:39:25 +000024 %tmp3 = bitcast <8 x float> %tmp2 to <8 x i32>
25 %tmp4 = or <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
29 ret void
30
31 ; CHECK: vorps LCPI1_0(%rip), %ymm0, %ymm0
32}
33
34; Function Attrs: nounwind ssp uwtable
35define void @test3(float* %A, float* %C) #0 {
36 %tmp1 = bitcast float* %A to <8 x float>*
David Blaikiea79ac142015-02-27 21:17:42 +000037 %tmp2 = load <8 x float>, <8 x float>* %tmp1, align 32
Jim Grosbache4fef712014-04-09 23:39:25 +000038 %tmp3 = bitcast <8 x float> %tmp2 to <8 x i32>
39 %tmp4 = xor <8 x i32> %tmp3, <i32 2147483647, i32 2147483647, i32 2147483647, i32 2147483647, i32 2147483647, i32 2147483647, i32 2147483647, i32 2147483647>
40 %tmp5 = bitcast <8 x i32> %tmp4 to <8 x float>
41 %tmp6 = extractelement <8 x float> %tmp5, i32 0
42 store float %tmp6, float* %C
43 ret void
44
45 ; CHECK: vxorps LCPI2_0(%rip), %ymm0, %ymm0
46}
47
48define void @test4(float* %A, float* %C) #0 {
49 %tmp1 = bitcast float* %A to <8 x float>*
David Blaikiea79ac142015-02-27 21:17:42 +000050 %tmp2 = load <8 x float>, <8 x float>* %tmp1, align 32
Jim Grosbache4fef712014-04-09 23:39:25 +000051 %tmp3 = bitcast <8 x float> %tmp2 to <8 x i32>
52 %tmp4 = xor <8 x i32> %tmp3, <i32 -1, i32 -1, i32 -1, i32 -1, i32 -1, i32 -1, i32 -1, i32 -1>
53 %tmp5 = and <8 x i32> %tmp4, <i32 2147483647, i32 2147483647, i32 2147483647, i32 2147483647, i32 2147483647, i32 2147483647, i32 2147483647, i32 2147483647>
54 %tmp6 = bitcast <8 x i32> %tmp5 to <8 x float>
55 %tmp7 = extractelement <8 x float> %tmp6, i32 0
56 store float %tmp7, float * %C
57 ret void
58
59 ;CHECK: vandnps LCPI3_0(%rip), %ymm0, %ymm0
60}