llvm.org GIT mirror llvm / 8a644f4
Add testcases for PR8411 (vget_low and vget_high implemented as shuffles). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122997 91177308-0d34-0410-b5e6-96231b3b80d8 Bob Wilson 9 years ago
1 changed file(s) with 37 addition(s) and 1 deletion(s). Raw diff Collapse all Expand all
None ; RUN: llc < %s -march=arm -mattr=+neon
0 ; RUN: llc < %s -march=arm -mattr=+neon | FileCheck %s
11
22 define <16 x i8> @vcombine8(<8 x i8>* %A, <8 x i8>* %B) nounwind {
3 ; CHECK: vcombine8
4 ; CHECK: vmov r0, r1, d16
5 ; CHECK: vmov r2, r3, d17
36 %tmp1 = load <8 x i8>* %A
47 %tmp2 = load <8 x i8>* %B
58 %tmp3 = shufflevector <8 x i8> %tmp1, <8 x i8> %tmp2, <16 x i32>
710 }
811
912 define <8 x i16> @vcombine16(<4 x i16>* %A, <4 x i16>* %B) nounwind {
13 ; CHECK: vcombine16
14 ; CHECK: vmov r0, r1, d16
15 ; CHECK: vmov r2, r3, d17
1016 %tmp1 = load <4 x i16>* %A
1117 %tmp2 = load <4 x i16>* %B
1218 %tmp3 = shufflevector <4 x i16> %tmp1, <4 x i16> %tmp2, <8 x i32>
1420 }
1521
1622 define <4 x i32> @vcombine32(<2 x i32>* %A, <2 x i32>* %B) nounwind {
23 ; CHECK: vcombine32
24 ; CHECK: vmov r0, r1, d16
25 ; CHECK: vmov r2, r3, d17
1726 %tmp1 = load <2 x i32>* %A
1827 %tmp2 = load <2 x i32>* %B
1928 %tmp3 = shufflevector <2 x i32> %tmp1, <2 x i32> %tmp2, <4 x i32>
2130 }
2231
2332 define <4 x float> @vcombinefloat(<2 x float>* %A, <2 x float>* %B) nounwind {
33 ; CHECK: vcombinefloat
34 ; CHECK: vmov r0, r1, d16
35 ; CHECK: vmov r2, r3, d17
2436 %tmp1 = load <2 x float>* %A
2537 %tmp2 = load <2 x float>* %B
2638 %tmp3 = shufflevector <2 x float> %tmp1, <2 x float> %tmp2, <4 x i32>
2840 }
2941
3042 define <2 x i64> @vcombine64(<1 x i64>* %A, <1 x i64>* %B) nounwind {
43 ; CHECK: vcombine64
44 ; CHECK: vmov r0, r1, d16
45 ; CHECK: vmov r2, r3, d17
3146 %tmp1 = load <1 x i64>* %A
3247 %tmp2 = load <1 x i64>* %B
3348 %tmp3 = shufflevector <1 x i64> %tmp1, <1 x i64> %tmp2, <2 x i32>
3449 ret <2 x i64> %tmp3
3550 }
51
52 ; Check for vget_low and vget_high implemented with shufflevector. PR8411.
53 ; They should not require storing to the stack.
54
55 define <4 x i16> @vget_low16(<8 x i16>* %A) nounwind {
56 ; CHECK: vget_low16
57 ; CHECK-NOT: vst
58 ; CHECK: vmov r0, r1, d16
59 %tmp1 = load <8 x i16>* %A
60 %tmp2 = shufflevector <8 x i16> %tmp1, <8 x i16> undef, <4 x i32>
61 ret <4 x i16> %tmp2
62 }
63
64 define <8 x i8> @vget_high8(<16 x i8>* %A) nounwind {
65 ; CHECK: vget_high8
66 ; CHECK-NOT: vst
67 ; CHECK: vmov r0, r1, d17
68 %tmp1 = load <16 x i8>* %A
69 %tmp2 = shufflevector <16 x i8> %tmp1, <16 x i8> undef, <8 x i32>
70 ret <8 x i8> %tmp2
71 }