blob: 8419828b38d2c902177975d0dc1b33761d47f639 [file] [log] [blame]
Stephen Hines6bcf27b2014-05-29 04:14:42 -07001// RUN: %clang_cc1 -triple arm64-apple-ios7 -target-feature +neon -ffreestanding -S -o - -emit-llvm %s | FileCheck %s
Stephen Hines651f13c2014-04-23 16:59:28 -07002// Test ARM64 SIMD duplicate lane and n intrinsics
3
4#include <arm_neon.h>
5
6void 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
12void 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/*
21float64x1_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
29float16x8_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}