]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - test/CodeGen/AArch64/neon-scalar-copy.ll
Vendor import of llvm release_34 branch r197841 (effectively, 3.4 RC3):
[FreeBSD/FreeBSD.git] / test / CodeGen / AArch64 / neon-scalar-copy.ll
1 ; RUN: llc -mtriple=aarch64-none-linux-gnu -mattr=+neon < %s | FileCheck %s
2
3 define float @test_dup_sv2S(<2 x float> %v) {
4  ;CHECK: test_dup_sv2S
5  ;CHECK: dup {{s[0-31]+}}, {{v[0-31]+}}.s[1]
6  %tmp1 = extractelement <2 x float> %v, i32 1
7  ret float  %tmp1
8 }
9
10 define float @test_dup_sv4S(<4 x float> %v) {
11  ;CHECK: test_dup_sv4S
12  ;CHECK: dup {{s[0-31]+}}, {{v[0-31]+}}.s[0]
13  %tmp1 = extractelement <4 x float> %v, i32 0
14  ret float  %tmp1
15 }
16
17 define double @test_dup_dvD(<1 x double> %v) {
18  ;CHECK: test_dup_dvD
19  ;CHECK-NOT: dup {{d[0-31]+}}, {{v[0-31]+}}.d[0]
20  ;CHECK: ret
21  %tmp1 = extractelement <1 x double> %v, i32 0
22  ret double  %tmp1
23 }
24
25 define double @test_dup_dv2D(<2 x double> %v) {
26  ;CHECK: test_dup_dv2D
27  ;CHECK: dup {{d[0-31]+}}, {{v[0-31]+}}.d[1]
28  %tmp1 = extractelement <2 x double> %v, i32 1
29  ret double  %tmp1
30 }
31
32 define <1 x i8> @test_vector_dup_bv16B(<16 x i8> %v1) {
33  ;CHECK: test_vector_dup_bv16B
34  ;CHECK: dup {{b[0-31]+}}, {{v[0-31]+}}.b[14]
35  %shuffle.i = shufflevector <16 x i8> %v1, <16 x i8> undef, <1 x i32> <i32 14> 
36  ret <1 x i8> %shuffle.i
37 }
38
39 define <1 x i8> @test_vector_dup_bv8B(<8 x i8> %v1) {
40  ;CHECK: test_vector_dup_bv8B
41  ;CHECK: dup {{b[0-31]+}}, {{v[0-31]+}}.b[7]
42  %shuffle.i = shufflevector <8 x i8> %v1, <8 x i8> undef, <1 x i32> <i32 7> 
43  ret <1 x i8> %shuffle.i
44 }
45
46 define <1 x i16> @test_vector_dup_hv8H(<8 x i16> %v1) {
47  ;CHECK: test_vector_dup_hv8H
48  ;CHECK: dup {{h[0-31]+}}, {{v[0-31]+}}.h[7]
49  %shuffle.i = shufflevector <8 x i16> %v1, <8 x i16> undef, <1 x i32> <i32 7> 
50  ret <1 x i16> %shuffle.i
51 }
52
53 define <1 x i16> @test_vector_dup_hv4H(<4 x i16> %v1) {
54  ;CHECK: test_vector_dup_hv4H
55  ;CHECK: dup {{h[0-31]+}}, {{v[0-31]+}}.h[3]
56  %shuffle.i = shufflevector <4 x i16> %v1, <4 x i16> undef, <1 x i32> <i32 3> 
57  ret <1 x i16> %shuffle.i
58 }
59
60 define <1 x i32> @test_vector_dup_sv4S(<4 x i32> %v1) {
61  ;CHECK: test_vector_dup_sv4S
62  ;CHECK: dup {{s[0-31]+}}, {{v[0-31]+}}.s[3]
63  %shuffle = shufflevector <4 x i32> %v1, <4 x i32> undef, <1 x i32> <i32 3> 
64  ret <1 x i32> %shuffle
65 }
66
67 define <1 x i32> @test_vector_dup_sv2S(<2 x i32> %v1) {
68  ;CHECK: test_vector_dup_sv2S
69  ;CHECK: dup {{s[0-31]+}}, {{v[0-31]+}}.s[1]
70  %shuffle = shufflevector <2 x i32> %v1, <2 x i32> undef, <1 x i32> <i32 1> 
71  ret <1 x i32> %shuffle
72 }
73
74 define <1 x i64> @test_vector_dup_dv2D(<2 x i64> %v1) {
75  ;CHECK: test_vector_dup_dv2D
76  ;CHECK: dup {{d[0-31]+}}, {{v[0-31]+}}.d[1]
77  %shuffle.i = shufflevector <2 x i64> %v1, <2 x i64> undef, <1 x i32> <i32 1> 
78  ret <1 x i64> %shuffle.i
79 }
80
81 define <1 x i64> @test_vector_copy_dup_dv2D(<1 x i64> %a, <2 x i64> %c) {
82   ;CHECK: test_vector_copy_dup_dv2D
83   ;CHECK: dup {{d[0-31]+}}, {{v[0-31]+}}.d[1]
84   %vget_lane = extractelement <2 x i64> %c, i32 1
85   %vset_lane = insertelement <1 x i64> undef, i64 %vget_lane, i32 0
86   ret <1 x i64> %vset_lane
87 }
88