Jim Grosbach | 576f8cf | 2014-04-10 00:27:43 +0000 | [diff] [blame] | 1 | ; RUN: llc -O3 -disable-peephole -mcpu=corei7-avx -mattr=+avx < %s | FileCheck %s |
Jim Grosbach | e4fef71 | 2014-04-09 23:39:25 +0000 | [diff] [blame] | 2 | |
| 3 | target datalayout = "e-i64:64-f80:128-n8:16:32:64-S128" |
| 4 | target triple = "x86_64-apple-macosx10.9.0" |
| 5 | |
| 6 | ; Function Attrs: nounwind ssp uwtable |
| 7 | define void @test1(float* %A, float* %C) #0 { |
| 8 | %tmp1 = bitcast float* %A to <8 x float>* |
David Blaikie | a79ac14 | 2015-02-27 21:17:42 +0000 | [diff] [blame] | 9 | %tmp2 = load <8 x float>, <8 x float>* %tmp1, align 32 |
Jim Grosbach | e4fef71 | 2014-04-09 23:39:25 +0000 | [diff] [blame] | 10 | %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 |
| 21 | define void @test2(float* %A, float* %C) #0 { |
| 22 | %tmp1 = bitcast float* %A to <8 x float>* |
David Blaikie | a79ac14 | 2015-02-27 21:17:42 +0000 | [diff] [blame] | 23 | %tmp2 = load <8 x float>, <8 x float>* %tmp1, align 32 |
Jim Grosbach | e4fef71 | 2014-04-09 23:39:25 +0000 | [diff] [blame] | 24 | %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 |
| 35 | define void @test3(float* %A, float* %C) #0 { |
| 36 | %tmp1 = bitcast float* %A to <8 x float>* |
David Blaikie | a79ac14 | 2015-02-27 21:17:42 +0000 | [diff] [blame] | 37 | %tmp2 = load <8 x float>, <8 x float>* %tmp1, align 32 |
Jim Grosbach | e4fef71 | 2014-04-09 23:39:25 +0000 | [diff] [blame] | 38 | %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 | |
| 48 | define void @test4(float* %A, float* %C) #0 { |
| 49 | %tmp1 = bitcast float* %A to <8 x float>* |
David Blaikie | a79ac14 | 2015-02-27 21:17:42 +0000 | [diff] [blame] | 50 | %tmp2 = load <8 x float>, <8 x float>* %tmp1, align 32 |
Jim Grosbach | e4fef71 | 2014-04-09 23:39:25 +0000 | [diff] [blame] | 51 | %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 | } |