blob: a50a0b964441e5ce6594f70031671ef0bd8a9e86 [file] [log] [blame]
Stephen Hinesc568f1e2014-07-21 00:47:37 -07001// REQUIRES: aarch64-registered-target
Stephen Hines6bcf27b2014-05-29 04:14:42 -07002// RUN: %clang_cc1 -triple arm64-none-linux-gnu -target-feature +neon \
Stephen Hines651f13c2014-04-23 16:59:28 -07003// RUN: -ffp-contract=fast -S -O3 -o - %s | FileCheck %s
Bill Wendlingbc5de892013-11-25 05:39:42 +00004
5
6#include <arm_neon.h>
7
Stephen Hines651f13c2014-04-23 16:59:28 -07008// CHECK-LABEL: test_vdups_lane_f32
Bill Wendlingbc5de892013-11-25 05:39:42 +00009float32_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
Stephen Hines651f13c2014-04-23 16:59:28 -070016// CHECK-LABEL: test_vdupd_lane_f64
Bill Wendlingbc5de892013-11-25 05:39:42 +000017float64_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
Stephen Hines651f13c2014-04-23 16:59:28 -070024// CHECK-LABEL: test_vdups_laneq_f32
Bill Wendlingbc5de892013-11-25 05:39:42 +000025float32_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
Stephen Hines651f13c2014-04-23 16:59:28 -070032// CHECK-LABEL: test_vdupd_laneq_f64
Bill Wendlingbc5de892013-11-25 05:39:42 +000033float64_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
Stephen Hines651f13c2014-04-23 16:59:28 -070040// CHECK-LABEL: test_vdupb_lane_s8
Bill Wendlingbc5de892013-11-25 05:39:42 +000041int8_t test_vdupb_lane_s8(int8x8_t a) {
42 return vdupb_lane_s8(a, 7);
Stephen Hines651f13c2014-04-23 16:59:28 -070043// CHECK: {{umov|smov}} {{w[0-9]+}}, {{v[0-9]+}}.b[7]
Bill Wendlingbc5de892013-11-25 05:39:42 +000044}
45
46
Stephen Hines651f13c2014-04-23 16:59:28 -070047// CHECK-LABEL: test_vduph_lane_s16
Bill Wendlingbc5de892013-11-25 05:39:42 +000048int16_t test_vduph_lane_s16(int16x4_t a) {
49 return vduph_lane_s16(a, 3);
Stephen Hines651f13c2014-04-23 16:59:28 -070050// CHECK: {{umov|smov}} {{w[0-9]+}}, {{v[0-9]+}}.h[3]
Bill Wendlingbc5de892013-11-25 05:39:42 +000051}
52
53
Stephen Hines651f13c2014-04-23 16:59:28 -070054// CHECK-LABEL: test_vdups_lane_s32
Bill Wendlingbc5de892013-11-25 05:39:42 +000055int32_t test_vdups_lane_s32(int32x2_t a) {
56 return vdups_lane_s32(a, 1);
Stephen Hines6bcf27b2014-05-29 04:14:42 -070057// CHECK: {{mov|umov}} {{w[0-9]+}}, {{v[0-9]+}}.s[1]
Bill Wendlingbc5de892013-11-25 05:39:42 +000058}
59
60
Stephen Hines651f13c2014-04-23 16:59:28 -070061// CHECK-LABEL: test_vdupd_lane_s64
Bill Wendlingbc5de892013-11-25 05:39:42 +000062int64_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
Stephen Hines651f13c2014-04-23 16:59:28 -070068// CHECK-LABEL: test_vdupb_lane_u8
Bill Wendlingbc5de892013-11-25 05:39:42 +000069uint8_t test_vdupb_lane_u8(uint8x8_t a) {
70 return vdupb_lane_u8(a, 7);
Stephen Hines6bcf27b2014-05-29 04:14:42 -070071// CHECK: {{mov|umov}} {{w[0-9]+}}, {{v[0-9]+}}.b[7]
Bill Wendlingbc5de892013-11-25 05:39:42 +000072}
73
74
Stephen Hines651f13c2014-04-23 16:59:28 -070075// CHECK-LABEL: test_vduph_lane_u16
Bill Wendlingbc5de892013-11-25 05:39:42 +000076uint16_t test_vduph_lane_u16(uint16x4_t a) {
77 return vduph_lane_u16(a, 3);
Stephen Hines6bcf27b2014-05-29 04:14:42 -070078// CHECK: {{mov|umov}} {{w[0-9]+}}, {{v[0-9]+}}.h[3]
Bill Wendlingbc5de892013-11-25 05:39:42 +000079}
80
81
Stephen Hines651f13c2014-04-23 16:59:28 -070082// CHECK-LABEL: test_vdups_lane_u32
Bill Wendlingbc5de892013-11-25 05:39:42 +000083uint32_t test_vdups_lane_u32(uint32x2_t a) {
84 return vdups_lane_u32(a, 1);
Stephen Hines6bcf27b2014-05-29 04:14:42 -070085// CHECK: {{mov|umov}} {{w[0-9]+}}, {{v[0-9]+}}.s[1]
Bill Wendlingbc5de892013-11-25 05:39:42 +000086}
87
88
Stephen Hines651f13c2014-04-23 16:59:28 -070089// CHECK-LABEL: test_vdupd_lane_u64
Bill Wendlingbc5de892013-11-25 05:39:42 +000090uint64_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
Stephen Hines651f13c2014-04-23 16:59:28 -070095// CHECK-LABEL: test_vdupb_laneq_s8
Bill Wendlingbc5de892013-11-25 05:39:42 +000096int8_t test_vdupb_laneq_s8(int8x16_t a) {
97 return vdupb_laneq_s8(a, 15);
Stephen Hines651f13c2014-04-23 16:59:28 -070098// CHECK: {{umov|smov}} {{w[0-9]+}}, {{v[0-9]+}}.b[15]
Bill Wendlingbc5de892013-11-25 05:39:42 +000099}
100
101
Stephen Hines651f13c2014-04-23 16:59:28 -0700102// CHECK-LABEL: test_vduph_laneq_s16
Bill Wendlingbc5de892013-11-25 05:39:42 +0000103int16_t test_vduph_laneq_s16(int16x8_t a) {
104 return vduph_laneq_s16(a, 7);
Stephen Hines651f13c2014-04-23 16:59:28 -0700105// CHECK: {{umov|smov}} {{w[0-9]+}}, {{v[0-9]+}}.h[7]
Bill Wendlingbc5de892013-11-25 05:39:42 +0000106}
107
108
Stephen Hines651f13c2014-04-23 16:59:28 -0700109// CHECK-LABEL: test_vdups_laneq_s32
Bill Wendlingbc5de892013-11-25 05:39:42 +0000110int32_t test_vdups_laneq_s32(int32x4_t a) {
111 return vdups_laneq_s32(a, 3);
Stephen Hines6bcf27b2014-05-29 04:14:42 -0700112// CHECK: {{mov|umov}} {{w[0-9]+}}, {{v[0-9]+}}.s[3]
Bill Wendlingbc5de892013-11-25 05:39:42 +0000113}
114
115
Stephen Hines651f13c2014-04-23 16:59:28 -0700116// CHECK-LABEL: test_vdupd_laneq_s64
Bill Wendlingbc5de892013-11-25 05:39:42 +0000117int64_t test_vdupd_laneq_s64(int64x2_t a) {
118 return vdupd_laneq_s64(a, 1);
Stephen Hines6bcf27b2014-05-29 04:14:42 -0700119// CHECK: {{mov|umov}} {{x[0-9]+}}, {{v[0-9]+}}.d[1]
Bill Wendlingbc5de892013-11-25 05:39:42 +0000120}
121
122
Stephen Hines651f13c2014-04-23 16:59:28 -0700123// CHECK-LABEL: test_vdupb_laneq_u8
Bill Wendlingbc5de892013-11-25 05:39:42 +0000124uint8_t test_vdupb_laneq_u8(uint8x16_t a) {
125 return vdupb_laneq_u8(a, 15);
Stephen Hines6bcf27b2014-05-29 04:14:42 -0700126// CHECK: {{mov|umov}} {{w[0-9]+}}, {{v[0-9]+}}.b[15]
Bill Wendlingbc5de892013-11-25 05:39:42 +0000127}
128
129
Stephen Hines651f13c2014-04-23 16:59:28 -0700130// CHECK-LABEL: test_vduph_laneq_u16
Bill Wendlingbc5de892013-11-25 05:39:42 +0000131uint16_t test_vduph_laneq_u16(uint16x8_t a) {
132 return vduph_laneq_u16(a, 7);
Stephen Hines6bcf27b2014-05-29 04:14:42 -0700133// CHECK: {{mov|umov}} {{w[0-9]+}}, {{v[0-9]+}}.h[7]
Bill Wendlingbc5de892013-11-25 05:39:42 +0000134}
135
136
Stephen Hines651f13c2014-04-23 16:59:28 -0700137// CHECK-LABEL: test_vdups_laneq_u32
Bill Wendlingbc5de892013-11-25 05:39:42 +0000138uint32_t test_vdups_laneq_u32(uint32x4_t a) {
139 return vdups_laneq_u32(a, 3);
Stephen Hines6bcf27b2014-05-29 04:14:42 -0700140// CHECK: {{mov|umov}} {{w[0-9]+}}, {{v[0-9]+}}.s[3]
Bill Wendlingbc5de892013-11-25 05:39:42 +0000141}
142
143
Stephen Hines651f13c2014-04-23 16:59:28 -0700144// CHECK-LABEL: test_vdupd_laneq_u64
Bill Wendlingbc5de892013-11-25 05:39:42 +0000145uint64_t test_vdupd_laneq_u64(uint64x2_t a) {
146 return vdupd_laneq_u64(a, 1);
Stephen Hines6bcf27b2014-05-29 04:14:42 -0700147// CHECK: {{mov|umov}} {{x[0-9]+}}, {{v[0-9]+}}.d[1]
Bill Wendlingbc5de892013-11-25 05:39:42 +0000148}
149
Stephen Hines651f13c2014-04-23 16:59:28 -0700150// CHECK-LABEL: test_vdupb_lane_p8
Bill Wendlingbc5de892013-11-25 05:39:42 +0000151poly8_t test_vdupb_lane_p8(poly8x8_t a) {
152 return vdupb_lane_p8(a, 7);
Stephen Hines6bcf27b2014-05-29 04:14:42 -0700153// CHECK: {{mov|umov}} {{w[0-9]+}}, {{v[0-9]+}}.b[7]
Bill Wendlingbc5de892013-11-25 05:39:42 +0000154}
155
Stephen Hines651f13c2014-04-23 16:59:28 -0700156// CHECK-LABEL: test_vduph_lane_p16
Bill Wendlingbc5de892013-11-25 05:39:42 +0000157poly16_t test_vduph_lane_p16(poly16x4_t a) {
158 return vduph_lane_p16(a, 3);
Stephen Hines6bcf27b2014-05-29 04:14:42 -0700159// CHECK: {{mov|umov}} {{w[0-9]+}}, {{v[0-9]+}}.h[3]
Bill Wendlingbc5de892013-11-25 05:39:42 +0000160}
161
Stephen Hines651f13c2014-04-23 16:59:28 -0700162// CHECK-LABEL: test_vdupb_laneq_p8
Bill Wendlingbc5de892013-11-25 05:39:42 +0000163poly8_t test_vdupb_laneq_p8(poly8x16_t a) {
164 return vdupb_laneq_p8(a, 15);
Stephen Hines6bcf27b2014-05-29 04:14:42 -0700165// CHECK: {{mov|umov}} {{w[0-9]+}}, {{v[0-9]+}}.b[15]
Bill Wendlingbc5de892013-11-25 05:39:42 +0000166}
167
Stephen Hines651f13c2014-04-23 16:59:28 -0700168// CHECK-LABEL: test_vduph_laneq_p16
Bill Wendlingbc5de892013-11-25 05:39:42 +0000169poly16_t test_vduph_laneq_p16(poly16x8_t a) {
170 return vduph_laneq_p16(a, 7);
Stephen Hines6bcf27b2014-05-29 04:14:42 -0700171// CHECK: {{mov|umov}} {{w[0-9]+}}, {{v[0-9]+}}.h[7]
Bill Wendlingbc5de892013-11-25 05:39:42 +0000172}
173