Stephen Hines | 6bcf27b | 2014-05-29 04:14:42 -0700 | [diff] [blame] | 1 | // RUN: %clang_cc1 -triple arm64-apple-ios7 -target-feature +neon -ffreestanding -S -o - -emit-llvm %s | FileCheck %s |
Stephen Hines | 651f13c | 2014-04-23 16:59:28 -0700 | [diff] [blame] | 2 | // Test ARM64 SIMD duplicate lane and n intrinsics |
| 3 | |
| 4 | #include <arm_neon.h> |
| 5 | |
| 6 | void test_vdup_lane_s64(int64x1_t a1) { |
| 7 | // CHECK-LABEL: test_vdup_lane_s64 |
| 8 | vdup_lane_s64(a1, 0); |
| 9 | // CHECK: shufflevector |
| 10 | } |
| 11 | |
| 12 | void test_vdup_lane_u64(uint64x1_t a1) { |
| 13 | // CHECK-LABEL: test_vdup_lane_u64 |
| 14 | vdup_lane_u64(a1, 0); |
| 15 | // CHECK: shufflevector |
| 16 | } |
| 17 | |
| 18 | // uncomment out the following code once scalar_to_vector in the backend |
| 19 | // works (for 64 bit?). Change the "CHECK@" to "CHECK<colon>" |
| 20 | /* |
| 21 | float64x1_t test_vdup_n_f64(float64_t a1) { |
| 22 | // CHECK-LABEL@ test_vdup_n_f64 |
| 23 | return vdup_n_f64(a1); |
| 24 | // match that an element is inserted into part 0 |
| 25 | // CHECK@ insertelement {{.*, i32 0 *$}} |
| 26 | } |
| 27 | */ |
| 28 | |
| 29 | float16x8_t test_vdupq_n_f16(float16_t *a1) { |
| 30 | // CHECK-LABEL: test_vdupq_n_f16 |
| 31 | return vdupq_n_f16(*a1); |
| 32 | // match that an element is inserted into parts 0-7. The backend better |
| 33 | // turn that into a single dup intruction |
| 34 | // CHECK: insertelement {{.*, i32 0 *$}} |
| 35 | // CHECK: insertelement {{.*, i32 1 *$}} |
| 36 | // CHECK: insertelement {{.*, i32 2 *$}} |
| 37 | // CHECK: insertelement {{.*, i32 3 *$}} |
| 38 | // CHECK: insertelement {{.*, i32 4 *$}} |
| 39 | // CHECK: insertelement {{.*, i32 5 *$}} |
| 40 | // CHECK: insertelement {{.*, i32 6 *$}} |
| 41 | // CHECK: insertelement {{.*, i32 7 *$}} |
| 42 | } |