diff options
author | Ivan A. Kosarev <ikosarev@accesssoftek.com> | 2018-08-19 16:30:57 +0000 |
---|---|---|
committer | Ivan A. Kosarev <ikosarev@accesssoftek.com> | 2018-08-19 16:30:57 +0000 |
commit | 1b7851212bac3534f5761ca208fbc63c3d596393 (patch) | |
tree | d1bf32c33059ff5496a87709946ad4392e5df7c2 /clang/test | |
parent | 0fd72ab44fb147e59da61ead54b4b240e6435d2f (diff) | |
download | bcm5719-llvm-1b7851212bac3534f5761ca208fbc63c3d596393.tar.gz bcm5719-llvm-1b7851212bac3534f5761ca208fbc63c3d596393.zip |
[NEON] Define fp16 vld and vst intrinsics conditionally
This patch fixes definitions of vld and vst NEON intrinsics so
that we only define them if half-precision arithmetic is
supported on the target platform, as prescribed in ACLE 2.0.
Differential Revision: https://reviews.llvm.org/D49075
llvm-svn: 340140
Diffstat (limited to 'clang/test')
-rw-r--r-- | clang/test/CodeGen/arm-neon-vld.c | 4 | ||||
-rw-r--r-- | clang/test/CodeGen/arm-neon-vst.c | 4 | ||||
-rw-r--r-- | clang/test/Sema/arm-no-fp16.c | 210 |
3 files changed, 214 insertions, 4 deletions
diff --git a/clang/test/CodeGen/arm-neon-vld.c b/clang/test/CodeGen/arm-neon-vld.c index 2bf55bb1c6c..2c7af92f479 100644 --- a/clang/test/CodeGen/arm-neon-vld.c +++ b/clang/test/CodeGen/arm-neon-vld.c @@ -2,8 +2,8 @@ // RUN: -S -disable-O0-optnone -emit-llvm -o - %s | opt -S -mem2reg | \ // RUN: FileCheck -check-prefixes=CHECK,CHECK-A64 %s // RUN: %clang_cc1 -triple armv8-none-linux-gnueabi -target-feature +neon \ -// RUN: -S -disable-O0-optnone -emit-llvm -o - %s | opt -S -mem2reg | \ -// RUN: FileCheck -check-prefixes=CHECK,CHECK-A32 %s +// RUN: -target-feature +fp16 -S -disable-O0-optnone -emit-llvm -o - %s | \ +// RUN: opt -S -mem2reg | FileCheck -check-prefixes=CHECK,CHECK-A32 %s #include <arm_neon.h> diff --git a/clang/test/CodeGen/arm-neon-vst.c b/clang/test/CodeGen/arm-neon-vst.c index 404c4d9c295..dc7105a7322 100644 --- a/clang/test/CodeGen/arm-neon-vst.c +++ b/clang/test/CodeGen/arm-neon-vst.c @@ -2,8 +2,8 @@ // RUN: -S -disable-O0-optnone -emit-llvm -o - %s | opt -S -mem2reg | \ // RUN: FileCheck -check-prefixes=CHECK,CHECK-A64 %s // RUN: %clang_cc1 -triple armv8-none-linux-gnueabi -target-feature +neon \ -// RUN: -S -disable-O0-optnone -emit-llvm -o - %s | opt -S -mem2reg | \ -// RUN: FileCheck -check-prefixes=CHECK,CHECK-A32 %s +// RUN: -target-feature +fp16 -S -disable-O0-optnone -emit-llvm -o - %s | \ +// RUN: opt -S -mem2reg | FileCheck -check-prefixes=CHECK,CHECK-A32 %s #include <arm_neon.h> diff --git a/clang/test/Sema/arm-no-fp16.c b/clang/test/Sema/arm-no-fp16.c index 2a23270e92d..91c48483f29 100644 --- a/clang/test/Sema/arm-no-fp16.c +++ b/clang/test/Sema/arm-no-fp16.c @@ -83,3 +83,213 @@ float16x4_t test_vminnm_f16(float16x4_t a, float16x4_t b) { float16x8_t test_vminnmq_f16(float16x8_t a, float16x8_t b) { return vminnmq_f16(a, b); // expected-warning{{implicit declaration of function 'vminnmq_f16'}} expected-error{{returning 'int' from a function with incompatible result type 'float16x8_t'}} } + +float16x4_t test_vld1_f16(const float16_t *a) { + return vld1_f16(a); // expected-warning{{implicit declaration of function 'vld1_f16'}} expected-error{{returning 'int' from a function with incompatible result type 'float16x4_t'}} +} + +float16x8_t test_vld1q_f16(const float16_t *a) { + return vld1q_f16(a); // expected-warning{{implicit declaration of function 'vld1q_f16'}} expected-error{{returning 'int' from a function with incompatible result type 'float16x8_t'}} +} + +float16x4_t test_vld1_dup_f16(const float16_t *a) { + return vld1_dup_f16(a); // expected-warning{{implicit declaration of function 'vld1_dup_f16'}} expected-error{{returning 'int' from a function with incompatible result type 'float16x4_t'}} +} + +float16x8_t test_vld1q_dup_f16(const float16_t *a) { + return vld1q_dup_f16(a); // expected-warning{{implicit declaration of function 'vld1q_dup_f16'}} expected-error{{returning 'int' from a function with incompatible result type 'float16x8_t'}} +} + +float16x4_t test_vld1_lane_f16(const float16_t *a, float16x4_t b) { + return vld1_lane_f16(a, b, 3); // expected-warning{{implicit declaration of function 'vld1_lane_f16'}} expected-error{{returning 'int' from a function with incompatible result type 'float16x4_t'}} +} + +float16x8_t test_vld1q_lane_f16(const float16_t *a, float16x8_t b) { + return vld1q_lane_f16(a, b, 7); // expected-warning{{implicit declaration of function 'vld1q_lane_f16'}} expected-error{{returning 'int' from a function with incompatible result type 'float16x8_t'}} +} + +float16x4x2_t test_vld1_f16_x2(const float16_t *a) { + return vld1_f16_x2(a); // expected-warning{{implicit declaration of function 'vld1_f16_x2'}} expected-error{{returning 'int' from a function with incompatible result type 'float16x4x2_t'}} +} + +float16x8x2_t test_vld1q_f16_x2(const float16_t *a) { + return vld1q_f16_x2(a); // expected-warning{{implicit declaration of function 'vld1q_f16_x2'}} expected-error{{returning 'int' from a function with incompatible result type 'float16x8x2_t'}} +} + +float16x4x3_t test_vld1_f16_x3(const float16_t *a) { + return vld1_f16_x3(a); // expected-warning{{implicit declaration of function 'vld1_f16_x3'}} expected-error{{returning 'int' from a function with incompatible result type 'float16x4x3_t'}} +} + +float16x8x3_t test_vld1q_f16_x3(const float16_t *a) { + return vld1q_f16_x3(a); // expected-warning{{implicit declaration of function 'vld1q_f16_x3'}} expected-error{{returning 'int' from a function with incompatible result type 'float16x8x3_t'}} +} + +float16x4x4_t test_vld1_f16_x4(const float16_t *a) { + return vld1_f16_x4(a); // expected-warning{{implicit declaration of function 'vld1_f16_x4'}} expected-error{{returning 'int' from a function with incompatible result type 'float16x4x4_t'}} +} + +float16x8x4_t test_vld1q_f16_x4(const float16_t *a) { + return vld1q_f16_x4(a); // expected-warning{{implicit declaration of function 'vld1q_f16_x4'}} expected-error{{returning 'int' from a function with incompatible result type 'float16x8x4_t'}} +} + +float16x4x2_t test_vld2_f16(const float16_t *a) { + return vld2_f16(a); // expected-warning{{implicit declaration of function 'vld2_f16'}} expected-error{{returning 'int' from a function with incompatible result type 'float16x4x2_t'}} +} + +float16x8x2_t test_vld2q_f16(const float16_t *a) { + return vld2q_f16(a); // expected-warning{{implicit declaration of function 'vld2q_f16'}} expected-error{{returning 'int' from a function with incompatible result type 'float16x8x2_t'}} +} + +float16x4x2_t test_vld2_lane_f16(const float16_t *a, float16x4x2_t b) { + return vld2_lane_f16(a, b, 3); // expected-warning{{implicit declaration of function 'vld2_lane_f16'}} expected-error{{returning 'int' from a function with incompatible result type 'float16x4x2_t'}} +} + +float16x8x2_t test_vld2q_lane_f16(const float16_t *a, float16x8x2_t b) { + return vld2q_lane_f16(a, b, 7); // expected-warning{{implicit declaration of function 'vld2q_lane_f16'}} expected-error{{returning 'int' from a function with incompatible result type 'float16x8x2_t'}} +} + +float16x4x2_t test_vld2_dup_f16(const float16_t *src) { + return vld2_dup_f16(src); // expected-warning{{implicit declaration of function 'vld2_dup_f16'}} expected-error{{returning 'int' from a function with incompatible result type 'float16x4x2_t'}} +} + +float16x8x2_t test_vld2q_dup_f16(const float16_t *src) { + return vld2q_dup_f16(src); // expected-warning{{implicit declaration of function 'vld2q_dup_f16'}} expected-error{{returning 'int' from a function with incompatible result type 'float16x8x2_t'}} +} + +float16x4x3_t test_vld3_f16(const float16_t *a) { + return vld3_f16(a); // expected-warning{{implicit declaration of function 'vld3_f16'}} expected-error{{returning 'int' from a function with incompatible result type 'float16x4x3_t'}} +} + +float16x8x3_t test_vld3q_f16(const float16_t *a) { + return vld3q_f16(a); // expected-warning{{implicit declaration of function 'vld3q_f16'}} expected-error{{returning 'int' from a function with incompatible result type 'float16x8x3_t'}} +} + +float16x4x3_t test_vld3_lane_f16(const float16_t *a, float16x4x3_t b) { + return vld3_lane_f16(a, b, 3); // expected-warning{{implicit declaration of function 'vld3_lane_f16'}} expected-error{{returning 'int' from a function with incompatible result type 'float16x4x3_t'}} +} + +float16x8x3_t test_vld3q_lane_f16(const float16_t *a, float16x8x3_t b) { + return vld3q_lane_f16(a, b, 7); // expected-warning{{implicit declaration of function 'vld3q_lane_f16'}} expected-error{{returning 'int' from a function with incompatible result type 'float16x8x3_t'}} +} + +float16x4x3_t test_vld3_dup_f16(const float16_t *src) { + return vld3_dup_f16(src); // expected-warning{{implicit declaration of function 'vld3_dup_f16'}} expected-error{{returning 'int' from a function with incompatible result type 'float16x4x3_t'}} +} + +float16x8x3_t test_vld3q_dup_f16(const float16_t *src) { + return vld3q_dup_f16(src); // expected-warning{{implicit declaration of function 'vld3q_dup_f16'}} expected-error{{returning 'int' from a function with incompatible result type 'float16x8x3_t'}} +} + +float16x4x4_t test_vld4_f16(const float16_t *a) { + return vld4_f16(a); // expected-warning{{implicit declaration of function 'vld4_f16'}} expected-error{{returning 'int' from a function with incompatible result type 'float16x4x4_t'}} +} + +float16x8x4_t test_vld4q_f16(const float16_t *a) { + return vld4q_f16(a); // expected-warning{{implicit declaration of function 'vld4q_f16'}} expected-error{{returning 'int' from a function with incompatible result type 'float16x8x4_t'}} +} + +float16x4x4_t test_vld4_lane_f16(const float16_t *a, float16x4x4_t b) { + return vld4_lane_f16(a, b, 3); // expected-warning{{implicit declaration of function 'vld4_lane_f16'}} expected-error{{returning 'int' from a function with incompatible result type 'float16x4x4_t'}} +} + +float16x8x4_t test_vld4q_lane_f16(const float16_t *a, float16x8x4_t b) { + return vld4q_lane_f16(a, b, 7); // expected-warning{{implicit declaration of function 'vld4q_lane_f16'}} expected-error{{returning 'int' from a function with incompatible result type 'float16x8x4_t'}} +} + +float16x4x4_t test_vld4_dup_f16(const float16_t *src) { + return vld4_dup_f16(src); // expected-warning{{implicit declaration of function 'vld4_dup_f16'}} expected-error{{returning 'int' from a function with incompatible result type 'float16x4x4_t'}} +} + +float16x8x4_t test_vld4q_dup_f16(const float16_t *src) { + return vld4q_dup_f16(src); // expected-warning{{implicit declaration of function 'vld4q_dup_f16'}} expected-error{{returning 'int' from a function with incompatible result type 'float16x8x4_t'}} +} + +void test_vst1_f16(float16_t *a, float16x4_t b) { + vst1_f16(a, b); // expected-warning{{implicit declaration of function 'vst1_f16'}} +} + +// aarch64-neon-intrinsics.c:void test_vst1q_f16(float16_t *a, float16x8_t b) { +void test_vst1q_f16(float16_t *a, float16x8_t b) { + vst1q_f16(a, b); // expected-warning{{implicit declaration of function 'vst1q_f16'}} +} + +// aarch64-neon-ldst-one.c:void test_vst1_lane_f16(float16_t *a, float16x4_t b) { +void test_vst1_lane_f16(float16_t *a, float16x4_t b) { + vst1_lane_f16(a, b, 3); // expected-warning{{implicit declaration of function 'vst1_lane_f16'}} +} + +void test_vst1q_lane_f16(float16_t *a, float16x8_t b) { + vst1q_lane_f16(a, b, 7); // expected-warning{{implicit declaration of function 'vst1q_lane_f16'}} +} + +void test_vst1_f16_x2(float16_t *a, float16x4x2_t b) { + vst1_f16_x2(a, b); // expected-warning{{implicit declaration of function 'vst1_f16_x2'}} +} + +void test_vst1q_f16_x2(float16_t *a, float16x8x2_t b) { + vst1q_f16_x2(a, b); // expected-warning{{implicit declaration of function 'vst1q_f16_x2'}} +} + +void test_vst1_f16_x3(float16_t *a, float16x4x3_t b) { + vst1_f16_x3(a, b); // expected-warning{{implicit declaration of function 'vst1_f16_x3'}} +} + +void test_vst1q_f16_x3(float16_t *a, float16x8x3_t b) { + vst1q_f16_x3(a, b); // expected-warning{{implicit declaration of function 'vst1q_f16_x3'}} +} + +void test_vst1_f16_x4(float16_t *a, float16x4x4_t b) { + vst1_f16_x4(a, b); // expected-warning{{implicit declaration of function 'vst1_f16_x4'}} +} + +void test_vst1q_f16_x4(float16_t *a, float16x8x4_t b) { + vst1q_f16_x4(a, b); // expected-warning{{implicit declaration of function 'vst1q_f16_x4'}} +} + +void test_vst2_f16(float16_t *a, float16x4x2_t b) { + vst2_f16(a, b); // expected-warning{{implicit declaration of function 'vst2_f16'}} +} + +void test_vst2q_f16(float16_t *a, float16x8x2_t b) { + vst2q_f16(a, b); // expected-warning{{implicit declaration of function 'vst2q_f16'}} +} + +void test_vst2_lane_f16(float16_t *a, float16x4x2_t b) { + vst2_lane_f16(a, b, 3); // expected-warning{{implicit declaration of function 'vst2_lane_f16'}} +} + +void test_vst2q_lane_f16(float16_t *a, float16x8x2_t b) { + vst2q_lane_f16(a, b, 7); // expected-warning{{implicit declaration of function 'vst2q_lane_f16'}} +} + +void test_vst3_f16(float16_t *a, float16x4x3_t b) { + vst3_f16(a, b); // expected-warning{{implicit declaration of function 'vst3_f16'}} +} + +void test_vst3q_f16(float16_t *a, float16x8x3_t b) { + vst3q_f16(a, b); // expected-warning{{implicit declaration of function 'vst3q_f16'}} +} + +void test_vst3_lane_f16(float16_t *a, float16x4x3_t b) { + vst3_lane_f16(a, b, 3); // expected-warning{{implicit declaration of function 'vst3_lane_f16'}} +} + +void test_vst3q_lane_f16(float16_t *a, float16x8x3_t b) { + vst3q_lane_f16(a, b, 7); // expected-warning{{implicit declaration of function 'vst3q_lane_f16'}} +} + +void test_vst4_f16(float16_t *a, float16x4x4_t b) { + vst4_f16(a, b); // expected-warning{{implicit declaration of function 'vst4_f16'}} +} + +void test_vst4q_f16(float16_t *a, float16x8x4_t b) { + vst4q_f16(a, b); // expected-warning{{implicit declaration of function 'vst4q_f16'}} +} + +void test_vst4_lane_f16(float16_t *a, float16x4x4_t b) { + vst4_lane_f16(a, b, 3); // expected-warning{{implicit declaration of function 'vst4_lane_f16'}} +} + +void test_vst4q_lane_f16(float16_t *a, float16x8x4_t b) { + vst4q_lane_f16(a, b, 7); // expected-warning{{implicit declaration of function 'vst4q_lane_f16'}} +} |