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
5 // Test new aarch64 intrinsics and types
10 float32_t test_vmuls_lane_f32(float32_t a, float32x2_t b) {
11 // CHECK: test_vmuls_lane_f32
12 return vmuls_lane_f32(a, b, 1);
13 // CHECK: fmul {{s[0-9]+}}, {{s[0-9]+}}, {{v[0-9]+}}.s[1]
16 float64_t test_vmuld_lane_f64(float64_t a, float64x1_t b) {
17 // CHECK: test_vmuld_lane_f64
18 return vmuld_lane_f64(a, b, 0);
19 // CHECK: fmul {{d[0-9]+}}, {{d[0-9]+}}, {{v[0-9]+}}.d[0]
22 float32_t test_vmuls_laneq_f32(float32_t a, float32x4_t b) {
23 // CHECK: test_vmuls_laneq_f32
24 return vmuls_laneq_f32(a, b, 3);
25 // CHECK: fmul {{s[0-9]+}}, {{s[0-9]+}}, {{v[0-9]+}}.s[3]
28 float64_t test_vmuld_laneq_f64(float64_t a, float64x2_t b) {
29 // CHECK: test_vmuld_laneq_f64
30 return vmuld_laneq_f64(a, b, 1);
31 // CHECK: fmul {{d[0-9]+}}, {{d[0-9]+}}, {{v[0-9]+}}.d[1]
34 float64x1_t test_vmul_n_f64(float64x1_t a, float64_t b) {
35 // CHECK: test_vmul_n_f64
36 return vmul_n_f64(a, b);
37 // CHECK: fmul {{d[0-9]+}}, {{d[0-9]+}}, {{v[0-9]+}}.d[0]
40 float32_t test_vmulxs_lane_f32(float32_t a, float32x2_t b) {
41 // CHECK: test_vmulxs_lane_f32
42 return vmulxs_lane_f32(a, b, 1);
43 // CHECK: fmulx {{s[0-9]+}}, {{s[0-9]+}}, {{v[0-9]+}}.s[1]
46 float32_t test_vmulxs_laneq_f32(float32_t a, float32x4_t b) {
47 // CHECK: test_vmulxs_laneq_f32
48 return vmulxs_laneq_f32(a, b, 3);
49 // CHECK: fmulx {{s[0-9]+}}, {{s[0-9]+}}, {{v[0-9]+}}.s[3]
52 float64_t test_vmulxd_lane_f64(float64_t a, float64x1_t b) {
53 // CHECK: test_vmulxd_lane_f64
54 return vmulxd_lane_f64(a, b, 0);
55 // CHECK: fmulx {{d[0-9]+}}, {{d[0-9]+}}, {{v[0-9]+}}.d[0]
58 float64_t test_vmulxd_laneq_f64(float64_t a, float64x2_t b) {
59 // CHECK: test_vmulxd_laneq_f64
60 return vmulxd_laneq_f64(a, b, 1);
61 // CHECK: fmulx {{d[0-9]+}}, {{d[0-9]+}}, {{v[0-9]+}}.d[1]
64 // CHECK: test_vmulx_lane_f64
65 float64x1_t test_vmulx_lane_f64(float64x1_t a, float64x1_t b) {
66 return vmulx_lane_f64(a, b, 0);
67 // CHECK: fmulx {{d[0-9]+}}, {{d[0-9]+}}, {{v[0-9]+}}.d[0]
71 // CHECK: test_vmulx_laneq_f64_0
72 float64x1_t test_vmulx_laneq_f64_0(float64x1_t a, float64x2_t b) {
73 return vmulx_laneq_f64(a, b, 0);
74 // CHECK: fmulx {{d[0-9]+}}, {{d[0-9]+}}, {{v[0-9]+}}.d[0]
77 // CHECK: test_vmulx_laneq_f64_1
78 float64x1_t test_vmulx_laneq_f64_1(float64x1_t a, float64x2_t b) {
79 return vmulx_laneq_f64(a, b, 1);
80 // CHECK: fmulx {{d[0-9]+}}, {{d[0-9]+}}, {{v[0-9]+}}.d[1]
84 // CHECK: test_vfmas_lane_f32
85 float32_t test_vfmas_lane_f32(float32_t a, float32_t b, float32x2_t c) {
86 return vfmas_lane_f32(a, b, c, 1);
87 // CHECK: fmla {{s[0-9]+}}, {{s[0-9]+}}, {{v[0-9]+}}.s[1]
90 // CHECK: test_vfmad_lane_f64
91 float64_t test_vfmad_lane_f64(float64_t a, float64_t b, float64x1_t c) {
92 return vfmad_lane_f64(a, b, c, 0);
93 // CHECK: fmla {{d[0-9]+}}, {{d[0-9]+}}, {{v[0-9]+}}.d[0]
96 // CHECK: test_vfmad_laneq_f64
97 float64_t test_vfmad_laneq_f64(float64_t a, float64_t b, float64x2_t c) {
98 return vfmad_laneq_f64(a, b, c, 1);
99 // CHECK: fmla {{d[0-9]+}}, {{d[0-9]+}}, {{v[0-9]+}}.d[1]
102 // CHECK: test_vfmss_lane_f32
103 float32_t test_vfmss_lane_f32(float32_t a, float32_t b, float32x2_t c) {
104 return vfmss_lane_f32(a, b, c, 1);
105 // CHECK: fmls {{s[0-9]+}}, {{s[0-9]+}}, {{v[0-9]+}}.s[1]
108 // CHECK: test_vfma_lane_f64
109 float64x1_t test_vfma_lane_f64(float64x1_t a, float64x1_t b, float64x1_t v) {
110 return vfma_lane_f64(a, b, v, 0);
111 // CHECK: fmla {{d[0-9]+}}, {{d[0-9]+}}, {{v[0-9]+}}.d[0]
114 // CHECK: test_vfms_lane_f64
115 float64x1_t test_vfms_lane_f64(float64x1_t a, float64x1_t b, float64x1_t v) {
116 return vfms_lane_f64(a, b, v, 0);
117 // CHECK: fmls {{d[0-9]+}}, {{d[0-9]+}}, {{v[0-9]+}}.d[0]
120 // CHECK: test_vfma_laneq_f64
121 float64x1_t test_vfma_laneq_f64(float64x1_t a, float64x1_t b, float64x2_t v) {
122 return vfma_laneq_f64(a, b, v, 0);
123 // CHECK: fmla {{d[0-9]+}}, {{d[0-9]+}}, {{v[0-9]+}}.d[0]
126 // CHECK: test_vfms_laneq_f64
127 float64x1_t test_vfms_laneq_f64(float64x1_t a, float64x1_t b, float64x2_t v) {
128 return vfms_laneq_f64(a, b, v, 0);
129 // CHECK: fmls {{d[0-9]+}}, {{d[0-9]+}}, {{v[0-9]+}}.d[0]
132 // CHECK: test_vqdmullh_lane_s16
133 int32_t test_vqdmullh_lane_s16(int16_t a, int16x4_t b) {
134 return vqdmullh_lane_s16(a, b, 3);
135 // CHECK: sqdmull {{s[0-9]+}}, {{h[0-9]+}}, {{v[0-9]+}}.h[3]
138 // CHECK: test_vqdmulls_lane_s32
139 int64_t test_vqdmulls_lane_s32(int32_t a, int32x2_t b) {
140 return vqdmulls_lane_s32(a, b, 1);
141 // CHECK: sqdmull {{d[0-9]+}}, {{s[0-9]+}}, {{v[0-9]+}}.s[1]
144 // CHECK: test_vqdmullh_laneq_s16
145 int32_t test_vqdmullh_laneq_s16(int16_t a, int16x8_t b) {
146 return vqdmullh_laneq_s16(a, b, 7);
147 // CHECK: sqdmull {{s[0-9]+}}, {{h[0-9]+}}, {{v[0-9]+}}.h[7]
150 // CHECK: test_vqdmulls_laneq_s32
151 int64_t test_vqdmulls_laneq_s32(int32_t a, int32x4_t b) {
152 return vqdmulls_laneq_s32(a, b, 3);
153 // CHECK: sqdmull {{d[0-9]+}}, {{s[0-9]+}}, {{v[0-9]+}}.s[3]
156 // CHECK: test_vqdmulhh_lane_s16
157 int16_t test_vqdmulhh_lane_s16(int16_t a, int16x4_t b) {
158 return vqdmulhh_lane_s16(a, b, 3);
159 // CHECK: sqdmulh {{h[0-9]+}}, {{h[0-9]+}}, {{v[0-9]+}}.h[3]
162 // CHECK: test_vqdmulhs_lane_s32
163 int32_t test_vqdmulhs_lane_s32(int32_t a, int32x2_t b) {
164 return vqdmulhs_lane_s32(a, b, 1);
165 // CHECK: sqdmulh {{s[0-9]+}}, {{s[0-9]+}}, {{v[0-9]+}}.s[1]
169 // CHECK: test_vqdmulhh_laneq_s16
170 int16_t test_vqdmulhh_laneq_s16(int16_t a, int16x8_t b) {
171 return vqdmulhh_laneq_s16(a, b, 7);
172 // CHECK: sqdmulh {{h[0-9]+}}, {{h[0-9]+}}, {{v[0-9]+}}.h[7]
176 // CHECK: test_vqdmulhs_laneq_s32
177 int32_t test_vqdmulhs_laneq_s32(int32_t a, int32x4_t b) {
178 return vqdmulhs_laneq_s32(a, b, 3);
179 // CHECK: sqdmulh {{s[0-9]+}}, {{s[0-9]+}}, {{v[0-9]+}}.s[3]
182 // CHECK: test_vqrdmulhh_lane_s16
183 int16_t test_vqrdmulhh_lane_s16(int16_t a, int16x4_t b) {
184 return vqrdmulhh_lane_s16(a, b, 3);
185 // CHECK: sqrdmulh {{h[0-9]+}}, {{h[0-9]+}}, {{v[0-9]+}}.h[3]
188 // CHECK: test_vqrdmulhs_lane_s32
189 int32_t test_vqrdmulhs_lane_s32(int32_t a, int32x2_t b) {
190 return vqrdmulhs_lane_s32(a, b, 1);
191 // CHECK: sqrdmulh {{s[0-9]+}}, {{s[0-9]+}}, {{v[0-9]+}}.s[1]
195 // CHECK: test_vqrdmulhh_laneq_s16
196 int16_t test_vqrdmulhh_laneq_s16(int16_t a, int16x8_t b) {
197 return vqrdmulhh_laneq_s16(a, b, 7);
198 // CHECK: sqrdmulh {{h[0-9]+}}, {{h[0-9]+}}, {{v[0-9]+}}.h[7]
202 // CHECK: test_vqrdmulhs_laneq_s32
203 int32_t test_vqrdmulhs_laneq_s32(int32_t a, int32x4_t b) {
204 return vqrdmulhs_laneq_s32(a, b, 3);
205 // CHECK: sqrdmulh {{s[0-9]+}}, {{s[0-9]+}}, {{v[0-9]+}}.s[3]
208 // CHECK: test_vqdmlalh_lane_s16
209 int32_t test_vqdmlalh_lane_s16(int32_t a, int16_t b, int16x4_t c) {
210 return vqdmlalh_lane_s16(a, b, c, 3);
211 // CHECK: sqdmlal {{s[0-9]+}}, {{h[0-9]+}}, {{v[0-9]+}}.h[3]
214 // CHECK: test_vqdmlals_lane_s32
215 int64_t test_vqdmlals_lane_s32(int64_t a, int32_t b, int32x2_t c) {
216 return vqdmlals_lane_s32(a, b, c, 1);
217 // CHECK: sqdmlal {{d[0-9]+}}, {{s[0-9]+}}, {{v[0-9]+}}.s[1]
220 // CHECK: test_vqdmlalh_laneq_s16
221 int32_t test_vqdmlalh_laneq_s16(int32_t a, int16_t b, int16x8_t c) {
222 return vqdmlalh_laneq_s16(a, b, c, 7);
223 // CHECK: sqdmlal {{s[0-9]+}}, {{h[0-9]+}}, {{v[0-9]+}}.h[7]
226 // CHECK: test_vqdmlals_laneq_s32
227 int64_t test_vqdmlals_laneq_s32(int64_t a, int32_t b, int32x4_t c) {
228 return vqdmlals_laneq_s32(a, b, c, 3);
229 // CHECK: sqdmlal {{d[0-9]+}}, {{s[0-9]+}}, {{v[0-9]+}}.s[3]
232 // CHECK: test_vqdmlslh_lane_s16
233 int32_t test_vqdmlslh_lane_s16(int32_t a, int16_t b, int16x4_t c) {
234 return vqdmlslh_lane_s16(a, b, c, 3);
235 // CHECK: sqdmlsl {{s[0-9]+}}, {{h[0-9]+}}, {{v[0-9]+}}.h[3]
238 // CHECK: test_vqdmlsls_lane_s32
239 int64_t test_vqdmlsls_lane_s32(int64_t a, int32_t b, int32x2_t c) {
240 return vqdmlsls_lane_s32(a, b, c, 1);
241 // CHECK: sqdmlsl {{d[0-9]+}}, {{s[0-9]+}}, {{v[0-9]+}}.s[1]
244 // CHECK: test_vqdmlslh_laneq_s16
245 int32_t test_vqdmlslh_laneq_s16(int32_t a, int16_t b, int16x8_t c) {
246 return vqdmlslh_laneq_s16(a, b, c, 7);
247 // CHECK: sqdmlsl {{s[0-9]+}}, {{h[0-9]+}}, {{v[0-9]+}}.h[7]
250 // CHECK: test_vqdmlsls_laneq_s32
251 int64_t test_vqdmlsls_laneq_s32(int64_t a, int32_t b, int32x4_t c) {
252 return vqdmlsls_laneq_s32(a, b, c, 3);
253 // CHECK: sqdmlsl {{d[0-9]+}}, {{s[0-9]+}}, {{v[0-9]+}}.s[3]