56b41b0f895582954846d2a3a75be6b71325adfd
[oota-llvm.git] / test / CodeGen / PowerPC / vec_constants.ll
1 ; RUN: llc < %s -march=ppc32 -mcpu=g5 | FileCheck %s
2
3 define void @test1(<4 x i32>* %P1, <4 x i32>* %P2, <4 x float>* %P3) nounwind {
4         %tmp = load <4 x i32>* %P1              ; <<4 x i32>> [#uses=1]
5         %tmp4 = and <4 x i32> %tmp, < i32 -2147483648, i32 -2147483648, i32 -2147483648, i32 -2147483648 >              ; <<4 x i32>> [#uses=1]
6         store <4 x i32> %tmp4, <4 x i32>* %P1
7         %tmp7 = load <4 x i32>* %P2             ; <<4 x i32>> [#uses=1]
8         %tmp9 = and <4 x i32> %tmp7, < i32 2147483647, i32 2147483647, i32 2147483647, i32 2147483647 >         ; <<4 x i32>> [#uses=1]
9         store <4 x i32> %tmp9, <4 x i32>* %P2
10         %tmp.upgrd.1 = load <4 x float>* %P3            ; <<4 x float>> [#uses=1]
11         %tmp11 = bitcast <4 x float> %tmp.upgrd.1 to <4 x i32>          ; <<4 x i32>> [#uses=1]
12         %tmp12 = and <4 x i32> %tmp11, < i32 2147483647, i32 2147483647, i32 2147483647, i32 2147483647 >               ; <<4 x i32>> [#uses=1]
13         %tmp13 = bitcast <4 x i32> %tmp12 to <4 x float>                ; <<4 x float>> [#uses=1]
14         store <4 x float> %tmp13, <4 x float>* %P3
15         ret void
16
17 ; CHECK: test1:
18 ; CHECK-NOT: CPI
19 }
20
21 define <4 x i32> @test_30() nounwind {
22         ret <4 x i32> < i32 30, i32 30, i32 30, i32 30 >
23
24 ; CHECK: test_30:
25 ; CHECK: vspltisw
26 ; CHECK-NEXT: vadduwm
27 ; CHECK-NEXT: blr
28 }
29
30 define <4 x i32> @test_29() nounwind {
31         ret <4 x i32> < i32 29, i32 29, i32 29, i32 29 >
32
33 ; CHECK: test_29:
34 ; CHECK: vspltisw
35 ; CHECK-NEXT: vspltisw
36 ; CHECK-NEXT: vsubuwm
37 ; CHECK-NEXT: blr
38 }
39
40 define <8 x i16> @test_n30() nounwind {
41         ret <8 x i16> < i16 -30, i16 -30, i16 -30, i16 -30, i16 -30, i16 -30, i16 -30, i16 -30 >
42
43 ; CHECK: test_n30:
44 ; CHECK: vspltish
45 ; CHECK-NEXT: vadduhm
46 ; CHECK-NEXT: blr
47 }
48
49 define <16 x i8> @test_n104() nounwind {
50         ret <16 x i8> < i8 -104, i8 -104, i8 -104, i8 -104, i8 -104, i8 -104, i8 -104, i8 -104, i8 -104, i8 -104, i8 -104, i8 -104, i8 -104, i8 -104, i8 -104, i8 -104 >
51
52 ; CHECK: test_n104:
53 ; CHECK: vspltisb
54 ; CHECK-NEXT: vslb
55 ; CHECK-NEXT: blr
56 }
57
58 define <4 x i32> @test_vsldoi() nounwind {
59         ret <4 x i32> < i32 512, i32 512, i32 512, i32 512 >
60
61 ; CHECK: test_vsldoi:
62 ; CHECK: vspltisw
63 ; CHECK-NEXT: vsldoi
64 ; CHECK-NEXT: blr
65 }
66
67 define <8 x i16> @test_vsldoi_65023() nounwind {
68         ret <8 x i16> < i16 65023, i16 65023,i16 65023,i16 65023,i16 65023,i16 65023,i16 65023,i16 65023 >
69
70 ; CHECK: test_vsldoi_65023:
71 ; CHECK: vspltish
72 ; CHECK-NEXT: vsldoi
73 ; CHECK-NEXT: blr
74 }
75
76 define <4 x i32> @test_rol() nounwind {
77         ret <4 x i32> < i32 -11534337, i32 -11534337, i32 -11534337, i32 -11534337 >
78
79 ; CHECK: test_rol:
80 ; CHECK: vspltisw
81 ; CHECK-NEXT: vrlw
82 ; CHECK-NEXT: blr
83 }