diff options
author | Dimitry Andric <dim@FreeBSD.org> | 2014-11-24 09:15:30 +0000 |
---|---|---|
committer | Dimitry Andric <dim@FreeBSD.org> | 2014-11-24 09:15:30 +0000 |
commit | 9f4dbff6669c8037f3b036bcf580d14f1a4f12a5 (patch) | |
tree | 47df2c12b57214af6c31e47404b005675b8b7ffc /test/CodeGen/arm64_vdupq_n_f64.c | |
parent | f73d5f23a889b93d89ddef61ac0995df40286bb8 (diff) |
Notes
Diffstat (limited to 'test/CodeGen/arm64_vdupq_n_f64.c')
-rw-r--r-- | test/CodeGen/arm64_vdupq_n_f64.c | 88 |
1 files changed, 88 insertions, 0 deletions
diff --git a/test/CodeGen/arm64_vdupq_n_f64.c b/test/CodeGen/arm64_vdupq_n_f64.c new file mode 100644 index 000000000000..ffba55cf8f56 --- /dev/null +++ b/test/CodeGen/arm64_vdupq_n_f64.c @@ -0,0 +1,88 @@ +// RUN: %clang_cc1 -O3 -triple arm64-apple-ios7 -target-feature +neon -ffreestanding -S -o - %s | FileCheck %s +// RUN: %clang_cc1 -O3 -triple arm64-apple-ios7 -target-feature +neon -ffreestanding -S -o - -emit-llvm %s | \ +// RUN: FileCheck -check-prefix=CHECK-IR %s +// REQUIRES: aarch64-registered-target + +/// Test vdupq_n_f64 and vmovq_nf64 ARM64 intrinsics +// <rdar://problem/11778405> ARM64: vdupq_n_f64 and vdupq_lane_f64 intrinsics +// missing + + +#include <arm_neon.h> + +// vdupq_n_f64 -> dup.2d v0, v0[0] +// +float64x2_t test_vdupq_n_f64(float64_t w) +{ + return vdupq_n_f64(w); + // CHECK-LABEL: test_vdupq_n_f64: + // CHECK: dup.2d v0, v0[0] + // CHECK-NEXT: ret +} + +// might as well test this while we're here +// vdupq_n_f32 -> dup.4s v0, v0[0] +float32x4_t test_vdupq_n_f32(float32_t w) +{ + return vdupq_n_f32(w); + // CHECK-LABEL: test_vdupq_n_f32: + // CHECK: dup.4s v0, v0[0] + // CHECK-NEXT: ret +} + +// vdupq_lane_f64 -> dup.2d v0, v0[0] +// this was in <rdar://problem/11778405>, but had already been implemented, +// test anyway +float64x2_t test_vdupq_lane_f64(float64x1_t V) +{ + return vdupq_lane_f64(V, 0); + // CHECK-LABEL: test_vdupq_lane_f64: + // CHECK: dup.2d v0, v0[0] + // CHECK-NEXT: ret +} + +// vmovq_n_f64 -> dup Vd.2d,X0 +// this wasn't in <rdar://problem/11778405>, but it was between the vdups +float64x2_t test_vmovq_n_f64(float64_t w) +{ + return vmovq_n_f64(w); + // CHECK-LABEL: test_vmovq_n_f64: + // CHECK: dup.2d v0, v0[0] + // CHECK-NEXT: ret +} + +float16x4_t test_vmov_n_f16(float16_t *a1) +{ + // CHECK-IR-LABEL: test_vmov_n_f16 + return vmov_n_f16(*a1); + // CHECK-IR: insertelement {{.*}} i32 0{{ *$}} + // CHECK-IR: insertelement {{.*}} i32 1{{ *$}} + // CHECK-IR: insertelement {{.*}} i32 2{{ *$}} + // CHECK-IR: insertelement {{.*}} i32 3{{ *$}} +} + +// Disable until scalar problem in backend is fixed. Change CHECK-IR@ to +// CHECK-IR<colon> +/* +float64x1_t test_vmov_n_f64(float64_t a1) +{ + // CHECK-IR@ test_vmov_n_f64 + return vmov_n_f64(a1); + // CHECK-IR@ insertelement {{.*}} i32 0{{ *$}} +} +*/ + +float16x8_t test_vmovq_n_f16(float16_t *a1) +{ + // CHECK-IR-LABEL: test_vmovq_n_f16 + return vmovq_n_f16(*a1); + // CHECK-IR: insertelement {{.*}} i32 0{{ *$}} + // CHECK-IR: insertelement {{.*}} i32 1{{ *$}} + // CHECK-IR: insertelement {{.*}} i32 2{{ *$}} + // CHECK-IR: insertelement {{.*}} i32 3{{ *$}} + // CHECK-IR: insertelement {{.*}} i32 4{{ *$}} + // CHECK-IR: insertelement {{.*}} i32 5{{ *$}} + // CHECK-IR: insertelement {{.*}} i32 6{{ *$}} + // CHECK-IR: insertelement {{.*}} i32 7{{ *$}} +} + |