45 lines · c
1// RUN: %clang_cc1 -triple arm64-apple-ios7 -target-feature +neon -ffreestanding -o - -emit-llvm %s | FileCheck %s2// Test ARM64 SIMD duplicate lane and n intrinsics3 4// REQUIRES: aarch64-registered-target || arm-registered-target5 6#include <arm_neon.h>7 8void test_vdup_lane_s64(int64x1_t a1) {9 // CHECK-LABEL: test_vdup_lane_s6410 vdup_lane_s64(a1, 0);11 // CHECK: shufflevector12}13 14void test_vdup_lane_u64(uint64x1_t a1) {15 // CHECK-LABEL: test_vdup_lane_u6416 vdup_lane_u64(a1, 0);17 // CHECK: shufflevector18}19 20// uncomment out the following code once scalar_to_vector in the backend21// works (for 64 bit?). Change the "CHECK@" to "CHECK<colon>"22/*23float64x1_t test_vdup_n_f64(float64_t a1) {24 // CHECK-LABEL@ test_vdup_n_f6425 return vdup_n_f64(a1);26 // match that an element is inserted into part 027 // CHECK@ insertelement {{.*, i32 0 *$}}28}29*/30 31float16x8_t test_vdupq_n_f16(float16_t *a1) {32 // CHECK-LABEL: test_vdupq_n_f1633 return vdupq_n_f16(*a1);34 // match that an element is inserted into parts 0-7. The backend better35 // turn that into a single dup instruction36 // CHECK: insertelement {{.*, i32 0 *$}}37 // CHECK: insertelement {{.*, i32 1 *$}}38 // CHECK: insertelement {{.*, i32 2 *$}}39 // CHECK: insertelement {{.*, i32 3 *$}}40 // CHECK: insertelement {{.*, i32 4 *$}}41 // CHECK: insertelement {{.*, i32 5 *$}}42 // CHECK: insertelement {{.*, i32 6 *$}}43 // CHECK: insertelement {{.*, i32 7 *$}}44}45