]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - test/CodeGen/aarch64-neon-scalar-copy.c
Vendor import of clang release_34 branch r197841 (effectively, 3.4 RC3):
[FreeBSD/FreeBSD.git] / test / CodeGen / aarch64-neon-scalar-copy.c
1 // REQUIRES: aarch64-registered-target
2 // RUN: %clang_cc1 -triple aarch64-none-linux-gnu -target-feature +neon \
3 // RUN:   -ffp-contract=fast -S -O3 -o - %s | FileCheck %s
4
5
6 #include <arm_neon.h>
7
8 // CHECK: test_vdups_lane_f32
9 float32_t test_vdups_lane_f32(float32x2_t a) {
10   return vdups_lane_f32(a, 1);
11 // CHECK: ret
12 // CHECK-NOT: dup {{s[0-9]+}}, {{v[0-9]+}}.s[1]
13 }
14
15
16 // CHECK: test_vdupd_lane_f64
17 float64_t test_vdupd_lane_f64(float64x1_t a) {
18   return vdupd_lane_f64(a, 0);
19 // CHECK: ret
20 // CHECK-NOT: dup {{d[0-9]+}}, {{v[0-9]+}}.d[0]
21 }
22
23
24 // CHECK: test_vdups_laneq_f32
25 float32_t test_vdups_laneq_f32(float32x4_t a) {
26   return vdups_laneq_f32(a, 3);
27 // CHECK: ret
28 // CHECK-NOT: dup {{s[0-9]+}}, {{v[0-9]+}}.s[3]
29 }
30
31
32 // CHECK: test_vdupd_laneq_f64
33 float64_t test_vdupd_laneq_f64(float64x2_t a) {
34   return vdupd_laneq_f64(a, 1);
35 // CHECK: ret
36 // CHECK-NOT: dup {{d[0-9]+}}, {{v[0-9]+}}.d[1]
37 }
38
39
40 // CHECK: test_vdupb_lane_s8
41 int8_t test_vdupb_lane_s8(int8x8_t a) {
42   return vdupb_lane_s8(a, 7);
43 // CHECK: umov {{w[0-9]+}}, {{v[0-9]+}}.b[7]
44 }
45
46
47 // CHECK: test_vduph_lane_s16
48 int16_t test_vduph_lane_s16(int16x4_t a) {
49   return vduph_lane_s16(a, 3);
50 // CHECK: umov {{w[0-9]+}}, {{v[0-9]+}}.h[3]
51 }
52
53
54 // CHECK: test_vdups_lane_s32
55 int32_t test_vdups_lane_s32(int32x2_t a) {
56   return vdups_lane_s32(a, 1);
57 // CHECK: umov {{w[0-9]+}}, {{v[0-9]+}}.s[1]
58 }
59
60
61 // CHECK: test_vdupd_lane_s64
62 int64_t test_vdupd_lane_s64(int64x1_t a) {
63   return vdupd_lane_s64(a, 0);
64 // CHECK: fmov {{x[0-9]+}}, {{d[0-9]+}}
65 }
66
67
68 // CHECK: test_vdupb_lane_u8
69 uint8_t test_vdupb_lane_u8(uint8x8_t a) {
70   return vdupb_lane_u8(a, 7);
71 // CHECK: umov {{w[0-9]+}}, {{v[0-9]+}}.b[7]
72 }
73
74
75 // CHECK: test_vduph_lane_u16
76 uint16_t test_vduph_lane_u16(uint16x4_t a) {
77   return vduph_lane_u16(a, 3);
78 // CHECK: umov {{w[0-9]+}}, {{v[0-9]+}}.h[3]
79 }
80
81
82 // CHECK: test_vdups_lane_u32
83 uint32_t test_vdups_lane_u32(uint32x2_t a) {
84   return vdups_lane_u32(a, 1);
85 // CHECK: umov {{w[0-9]+}}, {{v[0-9]+}}.s[1]
86 }
87
88
89 // CHECK: test_vdupd_lane_u64
90 uint64_t test_vdupd_lane_u64(uint64x1_t a) {
91   return vdupd_lane_u64(a, 0);
92 // CHECK: fmov {{x[0-9]+}}, {{d[0-9]+}}
93 }
94
95 // CHECK: test_vdupb_laneq_s8
96 int8_t test_vdupb_laneq_s8(int8x16_t a) {
97   return vdupb_laneq_s8(a, 15);
98 // CHECK: umov {{w[0-9]+}}, {{v[0-9]+}}.b[15]
99 }
100
101
102 // CHECK: test_vduph_laneq_s16
103 int16_t test_vduph_laneq_s16(int16x8_t a) {
104   return vduph_laneq_s16(a, 7);
105 // CHECK: umov {{w[0-9]+}}, {{v[0-9]+}}.h[7]
106 }
107
108
109 // CHECK: test_vdups_laneq_s32
110 int32_t test_vdups_laneq_s32(int32x4_t a) {
111   return vdups_laneq_s32(a, 3);
112 // CHECK: umov {{w[0-9]+}}, {{v[0-9]+}}.s[3]
113 }
114
115
116 // CHECK: test_vdupd_laneq_s64
117 int64_t test_vdupd_laneq_s64(int64x2_t a) {
118   return vdupd_laneq_s64(a, 1);
119 // CHECK: umov {{x[0-9]+}}, {{v[0-9]+}}.d[1]
120 }
121
122
123 // CHECK: test_vdupb_laneq_u8
124 uint8_t test_vdupb_laneq_u8(uint8x16_t a) {
125   return vdupb_laneq_u8(a, 15);
126 // CHECK: umov {{w[0-9]+}}, {{v[0-9]+}}.b[15]
127 }
128
129
130 // CHECK: test_vduph_laneq_u16
131 uint16_t test_vduph_laneq_u16(uint16x8_t a) {
132   return vduph_laneq_u16(a, 7);
133 // CHECK: umov {{w[0-9]+}}, {{v[0-9]+}}.h[7]
134 }
135
136
137 // CHECK: test_vdups_laneq_u32
138 uint32_t test_vdups_laneq_u32(uint32x4_t a) {
139   return vdups_laneq_u32(a, 3);
140 // CHECK: umov {{w[0-9]+}}, {{v[0-9]+}}.s[3]
141 }
142
143
144 // CHECK: test_vdupd_laneq_u64
145 uint64_t test_vdupd_laneq_u64(uint64x2_t a) {
146   return vdupd_laneq_u64(a, 1);
147 // CHECK: umov {{x[0-9]+}}, {{v[0-9]+}}.d[1]
148 }
149
150 // CHECK: test_vdupb_lane_p8
151 poly8_t test_vdupb_lane_p8(poly8x8_t a) {
152   return vdupb_lane_p8(a, 7);
153 // CHECK: umov {{w[0-9]+}}, {{v[0-9]+}}.b[7]
154 }
155
156 // CHECK: test_vduph_lane_p16
157 poly16_t test_vduph_lane_p16(poly16x4_t a) {
158   return vduph_lane_p16(a, 3);
159 // CHECK: umov {{w[0-9]+}}, {{v[0-9]+}}.h[3]
160 }
161
162 // CHECK: test_vdupb_laneq_p8
163 poly8_t test_vdupb_laneq_p8(poly8x16_t a) {
164   return vdupb_laneq_p8(a, 15);
165 // CHECK: umov {{w[0-9]+}}, {{v[0-9]+}}.b[15]
166 }
167
168 // CHECK: test_vduph_laneq_p16
169 poly16_t test_vduph_laneq_p16(poly16x8_t a) {
170   return vduph_laneq_p16(a, 7);
171 // CHECK: umov {{w[0-9]+}}, {{v[0-9]+}}.h[7]
172 }
173