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