summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorJames Molloy <james.molloy@arm.com>2014-06-27 11:53:35 +0000
committerJames Molloy <james.molloy@arm.com>2014-06-27 11:53:35 +0000
commitf19ae3247706388b82b1732fcb567f2981bda7af (patch)
treee5a2cf8aab09145c4379380f423c4765789c3ceb /test
parente1a4af78d7653289672c5f0b67faf99679c0be02 (diff)
downloadclang-f19ae3247706388b82b1732fcb567f2981bda7af.tar.gz
clang-f19ae3247706388b82b1732fcb567f2981bda7af.tar.bz2
clang-f19ae3247706388b82b1732fcb567f2981bda7af.tar.xz
[ARM-BE] Generate correct NEON intrinsics for big endian systems.
The NEON intrinsics in arm_neon.h are designed to work on vectors "as-if" loaded by (V)LDR. We load vectors "as-if" (V)LD1, so the intrinsics are currently incorrect. This patch adds big-endian versions of the intrinsics that does the "obvious but dumb" thing of reversing all vector inputs and all vector outputs. This will produce extra REVs, but we trust the optimizer to remove them. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@211893 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test')
-rw-r--r--test/CodeGen/arm64-lanes.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/test/CodeGen/arm64-lanes.c b/test/CodeGen/arm64-lanes.c
index b0d4694677..8ab2bd4c66 100644
--- a/test/CodeGen/arm64-lanes.c
+++ b/test/CodeGen/arm64-lanes.c
@@ -1,4 +1,5 @@
// RUN: %clang_cc1 -O3 -triple arm64-apple-ios7 -target-feature +neon -ffreestanding -emit-llvm -o - %s | FileCheck %s
+// RUN: %clang_cc1 -O3 -triple arm64_be-linux-gnu -target-feature +neon -ffreestanding -emit-llvm -o - %s | FileCheck %s --check-prefix CHECK-BE
#include <arm_neon.h>
@@ -6,58 +7,68 @@
int8_t test_vdupb_lane_s8(int8x8_t src) {
return vdupb_lane_s8(src, 2);
// CHECK: extractelement <8 x i8> %src, i32 2
+ // CHECK-BE: extractelement <8 x i8> %src, i32 5
}
// CHECK-LABEL: @test_vdupb_lane_u8
uint8_t test_vdupb_lane_u8(uint8x8_t src) {
return vdupb_lane_u8(src, 2);
// CHECK: extractelement <8 x i8> %src, i32 2
+ // CHECK-BE: extractelement <8 x i8> %src, i32 5
}
// CHECK-LABEL: @test_vduph_lane_s16
int16_t test_vduph_lane_s16(int16x4_t src) {
return vduph_lane_s16(src, 2);
// CHECK: extractelement <4 x i16> %src, i32 2
+ // CHECK-BE: extractelement <4 x i16> %src, i32 1
}
// CHECK-LABEL: @test_vduph_lane_u16
uint16_t test_vduph_lane_u16(uint16x4_t src) {
return vduph_lane_u16(src, 2);
// CHECK: extractelement <4 x i16> %src, i32 2
+ // CHECK-BE: extractelement <4 x i16> %src, i32 1
}
// CHECK-LABEL: @test_vdups_lane_s32
int32_t test_vdups_lane_s32(int32x2_t src) {
return vdups_lane_s32(src, 0);
// CHECK: extractelement <2 x i32> %src, i32 0
+ // CHECK-BE: extractelement <2 x i32> %src, i32 1
}
// CHECK-LABEL: @test_vdups_lane_u32
uint32_t test_vdups_lane_u32(uint32x2_t src) {
return vdups_lane_u32(src, 0);
// CHECK: extractelement <2 x i32> %src, i32 0
+ // CHECK-BE: extractelement <2 x i32> %src, i32 1
}
// CHECK-LABEL: @test_vdups_lane_f32
float32_t test_vdups_lane_f32(float32x2_t src) {
return vdups_lane_f32(src, 0);
// CHECK: extractelement <2 x float> %src, i32 0
+ // CHECK-BE: extractelement <2 x float> %src, i32 1
}
// CHECK-LABEL: @test_vdupd_lane_s64
int64_t test_vdupd_lane_s64(int64x1_t src) {
return vdupd_lane_s64(src, 0);
// CHECK: extractelement <1 x i64> %src, i32 0
+ // CHECK-BE: extractelement <1 x i64> %src, i32 0
}
// CHECK-LABEL: @test_vdupd_lane_u64
uint64_t test_vdupd_lane_u64(uint64x1_t src) {
return vdupd_lane_u64(src, 0);
// CHECK: extractelement <1 x i64> %src, i32 0
+ // CHECK-BE: extractelement <1 x i64> %src, i32 0
}
// CHECK-LABEL: @test_vdupd_lane_f64
float64_t test_vdupd_lane_f64(float64x1_t src) {
return vdupd_lane_f64(src, 0);
// CHECK: extractelement <1 x double> %src, i32 0
+ // CHECK-BE: extractelement <1 x double> %src, i32 0
}