Stephen Hines | c568f1e | 2014-07-21 00:47:37 -0700 | [diff] [blame] | 1 | // REQUIRES: aarch64-registered-target |
Stephen Hines | 6bcf27b | 2014-05-29 04:14:42 -0700 | [diff] [blame] | 2 | // RUN: %clang_cc1 -triple arm64-none-linux-gnu -target-feature +neon \ |
Stephen Hines | 651f13c | 2014-04-23 16:59:28 -0700 | [diff] [blame] | 3 | // RUN: -ffp-contract=fast -S -O3 -o - %s | FileCheck %s |
Bill Wendling | bc5de89 | 2013-11-25 05:39:42 +0000 | [diff] [blame] | 4 | |
| 5 | |
| 6 | #include <arm_neon.h> |
| 7 | |
Stephen Hines | 651f13c | 2014-04-23 16:59:28 -0700 | [diff] [blame] | 8 | // CHECK-LABEL: test_vdups_lane_f32 |
Bill Wendling | bc5de89 | 2013-11-25 05:39:42 +0000 | [diff] [blame] | 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 | |
Stephen Hines | 651f13c | 2014-04-23 16:59:28 -0700 | [diff] [blame] | 16 | // CHECK-LABEL: test_vdupd_lane_f64 |
Bill Wendling | bc5de89 | 2013-11-25 05:39:42 +0000 | [diff] [blame] | 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 | |
Stephen Hines | 651f13c | 2014-04-23 16:59:28 -0700 | [diff] [blame] | 24 | // CHECK-LABEL: test_vdups_laneq_f32 |
Bill Wendling | bc5de89 | 2013-11-25 05:39:42 +0000 | [diff] [blame] | 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 | |
Stephen Hines | 651f13c | 2014-04-23 16:59:28 -0700 | [diff] [blame] | 32 | // CHECK-LABEL: test_vdupd_laneq_f64 |
Bill Wendling | bc5de89 | 2013-11-25 05:39:42 +0000 | [diff] [blame] | 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 | |
Stephen Hines | 651f13c | 2014-04-23 16:59:28 -0700 | [diff] [blame] | 40 | // CHECK-LABEL: test_vdupb_lane_s8 |
Bill Wendling | bc5de89 | 2013-11-25 05:39:42 +0000 | [diff] [blame] | 41 | int8_t test_vdupb_lane_s8(int8x8_t a) { |
| 42 | return vdupb_lane_s8(a, 7); |
Stephen Hines | 651f13c | 2014-04-23 16:59:28 -0700 | [diff] [blame] | 43 | // CHECK: {{umov|smov}} {{w[0-9]+}}, {{v[0-9]+}}.b[7] |
Bill Wendling | bc5de89 | 2013-11-25 05:39:42 +0000 | [diff] [blame] | 44 | } |
| 45 | |
| 46 | |
Stephen Hines | 651f13c | 2014-04-23 16:59:28 -0700 | [diff] [blame] | 47 | // CHECK-LABEL: test_vduph_lane_s16 |
Bill Wendling | bc5de89 | 2013-11-25 05:39:42 +0000 | [diff] [blame] | 48 | int16_t test_vduph_lane_s16(int16x4_t a) { |
| 49 | return vduph_lane_s16(a, 3); |
Stephen Hines | 651f13c | 2014-04-23 16:59:28 -0700 | [diff] [blame] | 50 | // CHECK: {{umov|smov}} {{w[0-9]+}}, {{v[0-9]+}}.h[3] |
Bill Wendling | bc5de89 | 2013-11-25 05:39:42 +0000 | [diff] [blame] | 51 | } |
| 52 | |
| 53 | |
Stephen Hines | 651f13c | 2014-04-23 16:59:28 -0700 | [diff] [blame] | 54 | // CHECK-LABEL: test_vdups_lane_s32 |
Bill Wendling | bc5de89 | 2013-11-25 05:39:42 +0000 | [diff] [blame] | 55 | int32_t test_vdups_lane_s32(int32x2_t a) { |
| 56 | return vdups_lane_s32(a, 1); |
Stephen Hines | 6bcf27b | 2014-05-29 04:14:42 -0700 | [diff] [blame] | 57 | // CHECK: {{mov|umov}} {{w[0-9]+}}, {{v[0-9]+}}.s[1] |
Bill Wendling | bc5de89 | 2013-11-25 05:39:42 +0000 | [diff] [blame] | 58 | } |
| 59 | |
| 60 | |
Stephen Hines | 651f13c | 2014-04-23 16:59:28 -0700 | [diff] [blame] | 61 | // CHECK-LABEL: test_vdupd_lane_s64 |
Bill Wendling | bc5de89 | 2013-11-25 05:39:42 +0000 | [diff] [blame] | 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 | |
Stephen Hines | 651f13c | 2014-04-23 16:59:28 -0700 | [diff] [blame] | 68 | // CHECK-LABEL: test_vdupb_lane_u8 |
Bill Wendling | bc5de89 | 2013-11-25 05:39:42 +0000 | [diff] [blame] | 69 | uint8_t test_vdupb_lane_u8(uint8x8_t a) { |
| 70 | return vdupb_lane_u8(a, 7); |
Stephen Hines | 6bcf27b | 2014-05-29 04:14:42 -0700 | [diff] [blame] | 71 | // CHECK: {{mov|umov}} {{w[0-9]+}}, {{v[0-9]+}}.b[7] |
Bill Wendling | bc5de89 | 2013-11-25 05:39:42 +0000 | [diff] [blame] | 72 | } |
| 73 | |
| 74 | |
Stephen Hines | 651f13c | 2014-04-23 16:59:28 -0700 | [diff] [blame] | 75 | // CHECK-LABEL: test_vduph_lane_u16 |
Bill Wendling | bc5de89 | 2013-11-25 05:39:42 +0000 | [diff] [blame] | 76 | uint16_t test_vduph_lane_u16(uint16x4_t a) { |
| 77 | return vduph_lane_u16(a, 3); |
Stephen Hines | 6bcf27b | 2014-05-29 04:14:42 -0700 | [diff] [blame] | 78 | // CHECK: {{mov|umov}} {{w[0-9]+}}, {{v[0-9]+}}.h[3] |
Bill Wendling | bc5de89 | 2013-11-25 05:39:42 +0000 | [diff] [blame] | 79 | } |
| 80 | |
| 81 | |
Stephen Hines | 651f13c | 2014-04-23 16:59:28 -0700 | [diff] [blame] | 82 | // CHECK-LABEL: test_vdups_lane_u32 |
Bill Wendling | bc5de89 | 2013-11-25 05:39:42 +0000 | [diff] [blame] | 83 | uint32_t test_vdups_lane_u32(uint32x2_t a) { |
| 84 | return vdups_lane_u32(a, 1); |
Stephen Hines | 6bcf27b | 2014-05-29 04:14:42 -0700 | [diff] [blame] | 85 | // CHECK: {{mov|umov}} {{w[0-9]+}}, {{v[0-9]+}}.s[1] |
Bill Wendling | bc5de89 | 2013-11-25 05:39:42 +0000 | [diff] [blame] | 86 | } |
| 87 | |
| 88 | |
Stephen Hines | 651f13c | 2014-04-23 16:59:28 -0700 | [diff] [blame] | 89 | // CHECK-LABEL: test_vdupd_lane_u64 |
Bill Wendling | bc5de89 | 2013-11-25 05:39:42 +0000 | [diff] [blame] | 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 | |
Stephen Hines | 651f13c | 2014-04-23 16:59:28 -0700 | [diff] [blame] | 95 | // CHECK-LABEL: test_vdupb_laneq_s8 |
Bill Wendling | bc5de89 | 2013-11-25 05:39:42 +0000 | [diff] [blame] | 96 | int8_t test_vdupb_laneq_s8(int8x16_t a) { |
| 97 | return vdupb_laneq_s8(a, 15); |
Stephen Hines | 651f13c | 2014-04-23 16:59:28 -0700 | [diff] [blame] | 98 | // CHECK: {{umov|smov}} {{w[0-9]+}}, {{v[0-9]+}}.b[15] |
Bill Wendling | bc5de89 | 2013-11-25 05:39:42 +0000 | [diff] [blame] | 99 | } |
| 100 | |
| 101 | |
Stephen Hines | 651f13c | 2014-04-23 16:59:28 -0700 | [diff] [blame] | 102 | // CHECK-LABEL: test_vduph_laneq_s16 |
Bill Wendling | bc5de89 | 2013-11-25 05:39:42 +0000 | [diff] [blame] | 103 | int16_t test_vduph_laneq_s16(int16x8_t a) { |
| 104 | return vduph_laneq_s16(a, 7); |
Stephen Hines | 651f13c | 2014-04-23 16:59:28 -0700 | [diff] [blame] | 105 | // CHECK: {{umov|smov}} {{w[0-9]+}}, {{v[0-9]+}}.h[7] |
Bill Wendling | bc5de89 | 2013-11-25 05:39:42 +0000 | [diff] [blame] | 106 | } |
| 107 | |
| 108 | |
Stephen Hines | 651f13c | 2014-04-23 16:59:28 -0700 | [diff] [blame] | 109 | // CHECK-LABEL: test_vdups_laneq_s32 |
Bill Wendling | bc5de89 | 2013-11-25 05:39:42 +0000 | [diff] [blame] | 110 | int32_t test_vdups_laneq_s32(int32x4_t a) { |
| 111 | return vdups_laneq_s32(a, 3); |
Stephen Hines | 6bcf27b | 2014-05-29 04:14:42 -0700 | [diff] [blame] | 112 | // CHECK: {{mov|umov}} {{w[0-9]+}}, {{v[0-9]+}}.s[3] |
Bill Wendling | bc5de89 | 2013-11-25 05:39:42 +0000 | [diff] [blame] | 113 | } |
| 114 | |
| 115 | |
Stephen Hines | 651f13c | 2014-04-23 16:59:28 -0700 | [diff] [blame] | 116 | // CHECK-LABEL: test_vdupd_laneq_s64 |
Bill Wendling | bc5de89 | 2013-11-25 05:39:42 +0000 | [diff] [blame] | 117 | int64_t test_vdupd_laneq_s64(int64x2_t a) { |
| 118 | return vdupd_laneq_s64(a, 1); |
Stephen Hines | 6bcf27b | 2014-05-29 04:14:42 -0700 | [diff] [blame] | 119 | // CHECK: {{mov|umov}} {{x[0-9]+}}, {{v[0-9]+}}.d[1] |
Bill Wendling | bc5de89 | 2013-11-25 05:39:42 +0000 | [diff] [blame] | 120 | } |
| 121 | |
| 122 | |
Stephen Hines | 651f13c | 2014-04-23 16:59:28 -0700 | [diff] [blame] | 123 | // CHECK-LABEL: test_vdupb_laneq_u8 |
Bill Wendling | bc5de89 | 2013-11-25 05:39:42 +0000 | [diff] [blame] | 124 | uint8_t test_vdupb_laneq_u8(uint8x16_t a) { |
| 125 | return vdupb_laneq_u8(a, 15); |
Stephen Hines | 6bcf27b | 2014-05-29 04:14:42 -0700 | [diff] [blame] | 126 | // CHECK: {{mov|umov}} {{w[0-9]+}}, {{v[0-9]+}}.b[15] |
Bill Wendling | bc5de89 | 2013-11-25 05:39:42 +0000 | [diff] [blame] | 127 | } |
| 128 | |
| 129 | |
Stephen Hines | 651f13c | 2014-04-23 16:59:28 -0700 | [diff] [blame] | 130 | // CHECK-LABEL: test_vduph_laneq_u16 |
Bill Wendling | bc5de89 | 2013-11-25 05:39:42 +0000 | [diff] [blame] | 131 | uint16_t test_vduph_laneq_u16(uint16x8_t a) { |
| 132 | return vduph_laneq_u16(a, 7); |
Stephen Hines | 6bcf27b | 2014-05-29 04:14:42 -0700 | [diff] [blame] | 133 | // CHECK: {{mov|umov}} {{w[0-9]+}}, {{v[0-9]+}}.h[7] |
Bill Wendling | bc5de89 | 2013-11-25 05:39:42 +0000 | [diff] [blame] | 134 | } |
| 135 | |
| 136 | |
Stephen Hines | 651f13c | 2014-04-23 16:59:28 -0700 | [diff] [blame] | 137 | // CHECK-LABEL: test_vdups_laneq_u32 |
Bill Wendling | bc5de89 | 2013-11-25 05:39:42 +0000 | [diff] [blame] | 138 | uint32_t test_vdups_laneq_u32(uint32x4_t a) { |
| 139 | return vdups_laneq_u32(a, 3); |
Stephen Hines | 6bcf27b | 2014-05-29 04:14:42 -0700 | [diff] [blame] | 140 | // CHECK: {{mov|umov}} {{w[0-9]+}}, {{v[0-9]+}}.s[3] |
Bill Wendling | bc5de89 | 2013-11-25 05:39:42 +0000 | [diff] [blame] | 141 | } |
| 142 | |
| 143 | |
Stephen Hines | 651f13c | 2014-04-23 16:59:28 -0700 | [diff] [blame] | 144 | // CHECK-LABEL: test_vdupd_laneq_u64 |
Bill Wendling | bc5de89 | 2013-11-25 05:39:42 +0000 | [diff] [blame] | 145 | uint64_t test_vdupd_laneq_u64(uint64x2_t a) { |
| 146 | return vdupd_laneq_u64(a, 1); |
Stephen Hines | 6bcf27b | 2014-05-29 04:14:42 -0700 | [diff] [blame] | 147 | // CHECK: {{mov|umov}} {{x[0-9]+}}, {{v[0-9]+}}.d[1] |
Bill Wendling | bc5de89 | 2013-11-25 05:39:42 +0000 | [diff] [blame] | 148 | } |
| 149 | |
Stephen Hines | 651f13c | 2014-04-23 16:59:28 -0700 | [diff] [blame] | 150 | // CHECK-LABEL: test_vdupb_lane_p8 |
Bill Wendling | bc5de89 | 2013-11-25 05:39:42 +0000 | [diff] [blame] | 151 | poly8_t test_vdupb_lane_p8(poly8x8_t a) { |
| 152 | return vdupb_lane_p8(a, 7); |
Stephen Hines | 6bcf27b | 2014-05-29 04:14:42 -0700 | [diff] [blame] | 153 | // CHECK: {{mov|umov}} {{w[0-9]+}}, {{v[0-9]+}}.b[7] |
Bill Wendling | bc5de89 | 2013-11-25 05:39:42 +0000 | [diff] [blame] | 154 | } |
| 155 | |
Stephen Hines | 651f13c | 2014-04-23 16:59:28 -0700 | [diff] [blame] | 156 | // CHECK-LABEL: test_vduph_lane_p16 |
Bill Wendling | bc5de89 | 2013-11-25 05:39:42 +0000 | [diff] [blame] | 157 | poly16_t test_vduph_lane_p16(poly16x4_t a) { |
| 158 | return vduph_lane_p16(a, 3); |
Stephen Hines | 6bcf27b | 2014-05-29 04:14:42 -0700 | [diff] [blame] | 159 | // CHECK: {{mov|umov}} {{w[0-9]+}}, {{v[0-9]+}}.h[3] |
Bill Wendling | bc5de89 | 2013-11-25 05:39:42 +0000 | [diff] [blame] | 160 | } |
| 161 | |
Stephen Hines | 651f13c | 2014-04-23 16:59:28 -0700 | [diff] [blame] | 162 | // CHECK-LABEL: test_vdupb_laneq_p8 |
Bill Wendling | bc5de89 | 2013-11-25 05:39:42 +0000 | [diff] [blame] | 163 | poly8_t test_vdupb_laneq_p8(poly8x16_t a) { |
| 164 | return vdupb_laneq_p8(a, 15); |
Stephen Hines | 6bcf27b | 2014-05-29 04:14:42 -0700 | [diff] [blame] | 165 | // CHECK: {{mov|umov}} {{w[0-9]+}}, {{v[0-9]+}}.b[15] |
Bill Wendling | bc5de89 | 2013-11-25 05:39:42 +0000 | [diff] [blame] | 166 | } |
| 167 | |
Stephen Hines | 651f13c | 2014-04-23 16:59:28 -0700 | [diff] [blame] | 168 | // CHECK-LABEL: test_vduph_laneq_p16 |
Bill Wendling | bc5de89 | 2013-11-25 05:39:42 +0000 | [diff] [blame] | 169 | poly16_t test_vduph_laneq_p16(poly16x8_t a) { |
| 170 | return vduph_laneq_p16(a, 7); |
Stephen Hines | 6bcf27b | 2014-05-29 04:14:42 -0700 | [diff] [blame] | 171 | // CHECK: {{mov|umov}} {{w[0-9]+}}, {{v[0-9]+}}.h[7] |
Bill Wendling | bc5de89 | 2013-11-25 05:39:42 +0000 | [diff] [blame] | 172 | } |
| 173 | |