Jiangning Liu | 9f2b0f8 | 2013-11-06 02:26:12 +0000 | [diff] [blame] | 1 | // REQUIRES: aarch64-registered-target |
Stephen Hines | 651f13c | 2014-04-23 16:59:28 -0700 | [diff] [blame^] | 2 | // REQUIRES: arm64-registered-target |
Jiangning Liu | 9f2b0f8 | 2013-11-06 02:26:12 +0000 | [diff] [blame] | 3 | // RUN: %clang_cc1 -triple aarch64-none-linux-gnu -target-feature +neon \ |
| 4 | // RUN: -ffp-contract=fast -S -O3 -o - %s | FileCheck %s |
Stephen Hines | 651f13c | 2014-04-23 16:59:28 -0700 | [diff] [blame^] | 5 | // RUN: %clang_cc1 -triple arm64-none-linux-gnu \ |
| 6 | // RUN: -ffp-contract=fast -S -O3 -o - %s | FileCheck %s |
Jiangning Liu | 9f2b0f8 | 2013-11-06 02:26:12 +0000 | [diff] [blame] | 7 | |
| 8 | // Test new aarch64 intrinsics and types |
| 9 | |
| 10 | #include <arm_neon.h> |
| 11 | |
| 12 | int8x8_t test_vext_s8(int8x8_t a, int8x8_t b) { |
Stephen Hines | 651f13c | 2014-04-23 16:59:28 -0700 | [diff] [blame^] | 13 | // CHECK-LABEL: test_vext_s8 |
Jiangning Liu | 9f2b0f8 | 2013-11-06 02:26:12 +0000 | [diff] [blame] | 14 | return vext_s8(a, b, 2); |
Stephen Hines | 651f13c | 2014-04-23 16:59:28 -0700 | [diff] [blame^] | 15 | // CHECK: ext {{v[0-9]+}}.8b, {{v[0-9]+}}.8b, {{v[0-9]+}}.8b, #{{(0x)?2}} |
Jiangning Liu | 9f2b0f8 | 2013-11-06 02:26:12 +0000 | [diff] [blame] | 16 | } |
| 17 | |
| 18 | int16x4_t test_vext_s16(int16x4_t a, int16x4_t b) { |
Stephen Hines | 651f13c | 2014-04-23 16:59:28 -0700 | [diff] [blame^] | 19 | // CHECK-LABEL: test_vext_s16 |
Jiangning Liu | 9f2b0f8 | 2013-11-06 02:26:12 +0000 | [diff] [blame] | 20 | return vext_s16(a, b, 3); |
Stephen Hines | 651f13c | 2014-04-23 16:59:28 -0700 | [diff] [blame^] | 21 | // CHECK: ext {{v[0-9]+}}.8b, {{v[0-9]+}}.8b, {{v[0-9]+}}.8b, #{{(0x)?6}} |
Jiangning Liu | 9f2b0f8 | 2013-11-06 02:26:12 +0000 | [diff] [blame] | 22 | } |
| 23 | |
| 24 | int32x2_t test_vext_s32(int32x2_t a, int32x2_t b) { |
Stephen Hines | 651f13c | 2014-04-23 16:59:28 -0700 | [diff] [blame^] | 25 | // CHECK-LABEL: test_vext_s32 |
Jiangning Liu | 9f2b0f8 | 2013-11-06 02:26:12 +0000 | [diff] [blame] | 26 | return vext_s32(a, b, 1); |
Stephen Hines | 651f13c | 2014-04-23 16:59:28 -0700 | [diff] [blame^] | 27 | // CHECK: ext {{v[0-9]+}}.8b, {{v[0-9]+}}.8b, {{v[0-9]+}}.8b, #{{(0x)?4}} |
Jiangning Liu | 9f2b0f8 | 2013-11-06 02:26:12 +0000 | [diff] [blame] | 28 | } |
| 29 | |
| 30 | int64x1_t test_vext_s64(int64x1_t a, int64x1_t b) { |
Stephen Hines | 651f13c | 2014-04-23 16:59:28 -0700 | [diff] [blame^] | 31 | // CHECK-LABEL: test_vext_s64 |
Jiangning Liu | 9f2b0f8 | 2013-11-06 02:26:12 +0000 | [diff] [blame] | 32 | return vext_s64(a, b, 0); |
| 33 | } |
| 34 | |
| 35 | int8x16_t test_vextq_s8(int8x16_t a, int8x16_t b) { |
Stephen Hines | 651f13c | 2014-04-23 16:59:28 -0700 | [diff] [blame^] | 36 | // CHECK-LABEL: test_vextq_s8 |
Jiangning Liu | 9f2b0f8 | 2013-11-06 02:26:12 +0000 | [diff] [blame] | 37 | return vextq_s8(a, b, 2); |
Stephen Hines | 651f13c | 2014-04-23 16:59:28 -0700 | [diff] [blame^] | 38 | // CHECK: ext {{v[0-9]+}}.16b, {{v[0-9]+}}.16b, {{v[0-9]+}}.16b, #{{(0x)?2}} |
Jiangning Liu | 9f2b0f8 | 2013-11-06 02:26:12 +0000 | [diff] [blame] | 39 | } |
| 40 | |
| 41 | int16x8_t test_vextq_s16(int16x8_t a, int16x8_t b) { |
Stephen Hines | 651f13c | 2014-04-23 16:59:28 -0700 | [diff] [blame^] | 42 | // CHECK-LABEL: test_vextq_s16 |
Jiangning Liu | 9f2b0f8 | 2013-11-06 02:26:12 +0000 | [diff] [blame] | 43 | return vextq_s16(a, b, 3); |
Stephen Hines | 651f13c | 2014-04-23 16:59:28 -0700 | [diff] [blame^] | 44 | // CHECK: ext {{v[0-9]+}}.16b, {{v[0-9]+}}.16b, {{v[0-9]+}}.16b, #{{(0x)?6}} |
Jiangning Liu | 9f2b0f8 | 2013-11-06 02:26:12 +0000 | [diff] [blame] | 45 | } |
| 46 | |
| 47 | int32x4_t test_vextq_s32(int32x4_t a, int32x4_t b) { |
Stephen Hines | 651f13c | 2014-04-23 16:59:28 -0700 | [diff] [blame^] | 48 | // CHECK-LABEL: test_vextq_s32 |
Jiangning Liu | 9f2b0f8 | 2013-11-06 02:26:12 +0000 | [diff] [blame] | 49 | return vextq_s32(a, b, 1); |
Stephen Hines | 651f13c | 2014-04-23 16:59:28 -0700 | [diff] [blame^] | 50 | // CHECK: ext {{v[0-9]+}}.16b, {{v[0-9]+}}.16b, {{v[0-9]+}}.16b, #{{(0x)?4}} |
Jiangning Liu | 9f2b0f8 | 2013-11-06 02:26:12 +0000 | [diff] [blame] | 51 | } |
| 52 | |
| 53 | int64x2_t test_vextq_s64(int64x2_t a, int64x2_t b) { |
Stephen Hines | 651f13c | 2014-04-23 16:59:28 -0700 | [diff] [blame^] | 54 | // CHECK-LABEL: test_vextq_s64 |
Jiangning Liu | 9f2b0f8 | 2013-11-06 02:26:12 +0000 | [diff] [blame] | 55 | return vextq_s64(a, b, 1); |
Stephen Hines | 651f13c | 2014-04-23 16:59:28 -0700 | [diff] [blame^] | 56 | // CHECK: ext {{v[0-9]+}}.16b, {{v[0-9]+}}.16b, {{v[0-9]+}}.16b, #{{(0x)?8}} |
Jiangning Liu | 9f2b0f8 | 2013-11-06 02:26:12 +0000 | [diff] [blame] | 57 | } |
| 58 | |
| 59 | uint8x8_t test_vext_u8(uint8x8_t a, uint8x8_t b) { |
Stephen Hines | 651f13c | 2014-04-23 16:59:28 -0700 | [diff] [blame^] | 60 | // CHECK-LABEL: test_vext_u8 |
Jiangning Liu | 9f2b0f8 | 2013-11-06 02:26:12 +0000 | [diff] [blame] | 61 | return vext_u8(a, b, 2); |
Stephen Hines | 651f13c | 2014-04-23 16:59:28 -0700 | [diff] [blame^] | 62 | // CHECK: ext {{v[0-9]+}}.8b, {{v[0-9]+}}.8b, {{v[0-9]+}}.8b, #{{(0x)?2}} |
Jiangning Liu | 9f2b0f8 | 2013-11-06 02:26:12 +0000 | [diff] [blame] | 63 | } |
| 64 | |
| 65 | uint16x4_t test_vext_u16(uint16x4_t a, uint16x4_t b) { |
Stephen Hines | 651f13c | 2014-04-23 16:59:28 -0700 | [diff] [blame^] | 66 | // CHECK-LABEL: test_vext_u16 |
Jiangning Liu | 9f2b0f8 | 2013-11-06 02:26:12 +0000 | [diff] [blame] | 67 | return vext_u16(a, b, 3); |
Stephen Hines | 651f13c | 2014-04-23 16:59:28 -0700 | [diff] [blame^] | 68 | // CHECK: ext {{v[0-9]+}}.8b, {{v[0-9]+}}.8b, {{v[0-9]+}}.8b, #{{(0x)?6}} |
Jiangning Liu | 9f2b0f8 | 2013-11-06 02:26:12 +0000 | [diff] [blame] | 69 | } |
| 70 | |
| 71 | uint32x2_t test_vext_u32(uint32x2_t a, uint32x2_t b) { |
Stephen Hines | 651f13c | 2014-04-23 16:59:28 -0700 | [diff] [blame^] | 72 | // CHECK-LABEL: test_vext_u32 |
Jiangning Liu | 9f2b0f8 | 2013-11-06 02:26:12 +0000 | [diff] [blame] | 73 | return vext_u32(a, b, 1); |
Stephen Hines | 651f13c | 2014-04-23 16:59:28 -0700 | [diff] [blame^] | 74 | // CHECK: ext {{v[0-9]+}}.8b, {{v[0-9]+}}.8b, {{v[0-9]+}}.8b, #{{(0x)?4}} |
Jiangning Liu | 9f2b0f8 | 2013-11-06 02:26:12 +0000 | [diff] [blame] | 75 | } |
| 76 | |
| 77 | uint64x1_t test_vext_u64(uint64x1_t a, uint64x1_t b) { |
Stephen Hines | 651f13c | 2014-04-23 16:59:28 -0700 | [diff] [blame^] | 78 | // CHECK-LABEL: test_vext_u64 |
Jiangning Liu | 9f2b0f8 | 2013-11-06 02:26:12 +0000 | [diff] [blame] | 79 | return vext_u64(a, b, 0); |
| 80 | } |
| 81 | |
| 82 | uint8x16_t test_vextq_u8(uint8x16_t a, uint8x16_t b) { |
Stephen Hines | 651f13c | 2014-04-23 16:59:28 -0700 | [diff] [blame^] | 83 | // CHECK-LABEL: test_vextq_u8 |
Jiangning Liu | 9f2b0f8 | 2013-11-06 02:26:12 +0000 | [diff] [blame] | 84 | return vextq_u8(a, b, 2); |
Stephen Hines | 651f13c | 2014-04-23 16:59:28 -0700 | [diff] [blame^] | 85 | // CHECK: ext {{v[0-9]+}}.16b, {{v[0-9]+}}.16b, {{v[0-9]+}}.16b, #{{(0x)?2}} |
Jiangning Liu | 9f2b0f8 | 2013-11-06 02:26:12 +0000 | [diff] [blame] | 86 | } |
| 87 | |
| 88 | uint16x8_t test_vextq_u16(uint16x8_t a, uint16x8_t b) { |
Stephen Hines | 651f13c | 2014-04-23 16:59:28 -0700 | [diff] [blame^] | 89 | // CHECK-LABEL: test_vextq_u16 |
Jiangning Liu | 9f2b0f8 | 2013-11-06 02:26:12 +0000 | [diff] [blame] | 90 | return vextq_u16(a, b, 3); |
Stephen Hines | 651f13c | 2014-04-23 16:59:28 -0700 | [diff] [blame^] | 91 | // CHECK: ext {{v[0-9]+}}.16b, {{v[0-9]+}}.16b, {{v[0-9]+}}.16b, #{{(0x)?6}} |
Jiangning Liu | 9f2b0f8 | 2013-11-06 02:26:12 +0000 | [diff] [blame] | 92 | } |
| 93 | |
| 94 | uint32x4_t test_vextq_u32(uint32x4_t a, uint32x4_t b) { |
Stephen Hines | 651f13c | 2014-04-23 16:59:28 -0700 | [diff] [blame^] | 95 | // CHECK-LABEL: test_vextq_u32 |
Jiangning Liu | 9f2b0f8 | 2013-11-06 02:26:12 +0000 | [diff] [blame] | 96 | return vextq_u32(a, b, 1); |
Stephen Hines | 651f13c | 2014-04-23 16:59:28 -0700 | [diff] [blame^] | 97 | // CHECK: ext {{v[0-9]+}}.16b, {{v[0-9]+}}.16b, {{v[0-9]+}}.16b, #{{(0x)?4}} |
Jiangning Liu | 9f2b0f8 | 2013-11-06 02:26:12 +0000 | [diff] [blame] | 98 | } |
| 99 | |
| 100 | uint64x2_t test_vextq_u64(uint64x2_t a, uint64x2_t b) { |
Stephen Hines | 651f13c | 2014-04-23 16:59:28 -0700 | [diff] [blame^] | 101 | // CHECK-LABEL: test_vextq_u64 |
Jiangning Liu | 9f2b0f8 | 2013-11-06 02:26:12 +0000 | [diff] [blame] | 102 | return vextq_u64(a, b, 1); |
Stephen Hines | 651f13c | 2014-04-23 16:59:28 -0700 | [diff] [blame^] | 103 | // CHECK: ext {{v[0-9]+}}.16b, {{v[0-9]+}}.16b, {{v[0-9]+}}.16b, #{{(0x)?8}} |
Jiangning Liu | 9f2b0f8 | 2013-11-06 02:26:12 +0000 | [diff] [blame] | 104 | } |
| 105 | |
| 106 | float32x2_t test_vext_f32(float32x2_t a, float32x2_t b) { |
Stephen Hines | 651f13c | 2014-04-23 16:59:28 -0700 | [diff] [blame^] | 107 | // CHECK-LABEL: test_vext_f32 |
Jiangning Liu | 9f2b0f8 | 2013-11-06 02:26:12 +0000 | [diff] [blame] | 108 | return vext_f32(a, b, 1); |
Stephen Hines | 651f13c | 2014-04-23 16:59:28 -0700 | [diff] [blame^] | 109 | // CHECK: ext {{v[0-9]+}}.8b, {{v[0-9]+}}.8b, {{v[0-9]+}}.8b, #{{(0x)?4}} |
Jiangning Liu | 9f2b0f8 | 2013-11-06 02:26:12 +0000 | [diff] [blame] | 110 | } |
| 111 | |
| 112 | float64x1_t test_vext_f64(float64x1_t a, float64x1_t b) { |
Stephen Hines | 651f13c | 2014-04-23 16:59:28 -0700 | [diff] [blame^] | 113 | // CHECK-LABEL: test_vext_f64 |
Jiangning Liu | 9f2b0f8 | 2013-11-06 02:26:12 +0000 | [diff] [blame] | 114 | return vext_f64(a, b, 0); |
| 115 | } |
| 116 | |
| 117 | float32x4_t test_vextq_f32(float32x4_t a, float32x4_t b) { |
Stephen Hines | 651f13c | 2014-04-23 16:59:28 -0700 | [diff] [blame^] | 118 | // CHECK-LABEL: test_vextq_f32 |
Jiangning Liu | 9f2b0f8 | 2013-11-06 02:26:12 +0000 | [diff] [blame] | 119 | return vextq_f32(a, b, 1); |
Stephen Hines | 651f13c | 2014-04-23 16:59:28 -0700 | [diff] [blame^] | 120 | // CHECK: ext {{v[0-9]+}}.16b, {{v[0-9]+}}.16b, {{v[0-9]+}}.16b, #{{(0x)?4}} |
Jiangning Liu | 9f2b0f8 | 2013-11-06 02:26:12 +0000 | [diff] [blame] | 121 | } |
| 122 | |
| 123 | float64x2_t test_vextq_f64(float64x2_t a, float64x2_t b) { |
Stephen Hines | 651f13c | 2014-04-23 16:59:28 -0700 | [diff] [blame^] | 124 | // CHECK-LABEL: test_vextq_f64 |
Jiangning Liu | 9f2b0f8 | 2013-11-06 02:26:12 +0000 | [diff] [blame] | 125 | return vextq_f64(a, b, 1); |
Stephen Hines | 651f13c | 2014-04-23 16:59:28 -0700 | [diff] [blame^] | 126 | // CHECK: ext {{v[0-9]+}}.16b, {{v[0-9]+}}.16b, {{v[0-9]+}}.16b, #{{(0x)?8}} |
Jiangning Liu | 9f2b0f8 | 2013-11-06 02:26:12 +0000 | [diff] [blame] | 127 | } |
| 128 | |
| 129 | poly8x8_t test_vext_p8(poly8x8_t a, poly8x8_t b) { |
Stephen Hines | 651f13c | 2014-04-23 16:59:28 -0700 | [diff] [blame^] | 130 | // CHECK-LABEL: test_vext_p8 |
Jiangning Liu | 9f2b0f8 | 2013-11-06 02:26:12 +0000 | [diff] [blame] | 131 | return vext_p8(a, b, 2); |
Stephen Hines | 651f13c | 2014-04-23 16:59:28 -0700 | [diff] [blame^] | 132 | // CHECK: ext {{v[0-9]+}}.8b, {{v[0-9]+}}.8b, {{v[0-9]+}}.8b, #{{(0x)?2}} |
Jiangning Liu | 9f2b0f8 | 2013-11-06 02:26:12 +0000 | [diff] [blame] | 133 | } |
| 134 | |
| 135 | poly16x4_t test_vext_p16(poly16x4_t a, poly16x4_t b) { |
Stephen Hines | 651f13c | 2014-04-23 16:59:28 -0700 | [diff] [blame^] | 136 | // CHECK-LABEL: test_vext_p16 |
Jiangning Liu | 9f2b0f8 | 2013-11-06 02:26:12 +0000 | [diff] [blame] | 137 | return vext_p16(a, b, 3); |
Stephen Hines | 651f13c | 2014-04-23 16:59:28 -0700 | [diff] [blame^] | 138 | // CHECK: ext {{v[0-9]+}}.8b, {{v[0-9]+}}.8b, {{v[0-9]+}}.8b, #{{(0x)?6}} |
Jiangning Liu | 9f2b0f8 | 2013-11-06 02:26:12 +0000 | [diff] [blame] | 139 | } |
| 140 | |
| 141 | poly8x16_t test_vextq_p8(poly8x16_t a, poly8x16_t b) { |
Stephen Hines | 651f13c | 2014-04-23 16:59:28 -0700 | [diff] [blame^] | 142 | // CHECK-LABEL: test_vextq_p8 |
Jiangning Liu | 9f2b0f8 | 2013-11-06 02:26:12 +0000 | [diff] [blame] | 143 | return vextq_p8(a, b, 2); |
Stephen Hines | 651f13c | 2014-04-23 16:59:28 -0700 | [diff] [blame^] | 144 | // CHECK: ext {{v[0-9]+}}.16b, {{v[0-9]+}}.16b, {{v[0-9]+}}.16b, #{{(0x)?2}} |
Jiangning Liu | 9f2b0f8 | 2013-11-06 02:26:12 +0000 | [diff] [blame] | 145 | } |
| 146 | |
| 147 | poly16x8_t test_vextq_p16(poly16x8_t a, poly16x8_t b) { |
Stephen Hines | 651f13c | 2014-04-23 16:59:28 -0700 | [diff] [blame^] | 148 | // CHECK-LABEL: test_vextq_p16 |
Jiangning Liu | 9f2b0f8 | 2013-11-06 02:26:12 +0000 | [diff] [blame] | 149 | return vextq_p16(a, b, 3); |
Stephen Hines | 651f13c | 2014-04-23 16:59:28 -0700 | [diff] [blame^] | 150 | // CHECK: ext {{v[0-9]+}}.16b, {{v[0-9]+}}.16b, {{v[0-9]+}}.16b, #{{(0x)?6}} |
Jiangning Liu | 9f2b0f8 | 2013-11-06 02:26:12 +0000 | [diff] [blame] | 151 | } |