diff options
author | Oliver Stannard <oliver.stannard@arm.com> | 2014-08-27 16:31:57 +0000 |
---|---|---|
committer | Oliver Stannard <oliver.stannard@arm.com> | 2014-08-27 16:31:57 +0000 |
commit | ed8ecc8429e53dc638763fb8f48c620b6dbae174 (patch) | |
tree | e141e1da5d0632038e1b6c04a30997cfd87489a6 /clang/test/CodeGen/arm64-aapcs-arguments.c | |
parent | 6107a8f4db4fe74a3884c2b49b6ded009063335e (diff) | |
download | bcm5719-llvm-ed8ecc8429e53dc638763fb8f48c620b6dbae174.tar.gz bcm5719-llvm-ed8ecc8429e53dc638763fb8f48c620b6dbae174.zip |
Allow __fp16 as a function arg or return type for AArch64
ACLE 2.0 allows __fp16 to be used as a function argument or return
type. This enables this for AArch64.
This also fixes an existing bug that causes clang to not allow
homogeneous floating-point aggregates with a base type of __fp16. This
is valid for AAPCS64, but not for AAPCS-VFP.
llvm-svn: 216558
Diffstat (limited to 'clang/test/CodeGen/arm64-aapcs-arguments.c')
-rw-r--r-- | clang/test/CodeGen/arm64-aapcs-arguments.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/clang/test/CodeGen/arm64-aapcs-arguments.c b/clang/test/CodeGen/arm64-aapcs-arguments.c index b430630b071..38ac522de5d 100644 --- a/clang/test/CodeGen/arm64-aapcs-arguments.c +++ b/clang/test/CodeGen/arm64-aapcs-arguments.c @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -triple arm64-linux-gnu -target-feature +neon -target-abi aapcs -ffreestanding -emit-llvm -w -o - %s | FileCheck %s +// RUN: %clang_cc1 -triple aarch64-linux-gnu -target-feature +neon -target-abi aapcs -ffreestanding -fallow-half-arguments-and-returns -emit-llvm -w -o - %s | FileCheck %s // AAPCS clause C.8 says: If the argument has an alignment of 16 then the NGRN // is rounded up to the next even number. @@ -40,3 +40,12 @@ void test4(BigHFA v0_v2, BigHFA v3_v5, BigHFA sp, double sp48, BigHFA sp64) { // CHECK: define i8 @test5(i8 %a, i16 %b) unsigned char test5(unsigned char a, signed short b) { } + +// __fp16 can be used as a function argument or return type (ACLE 2.0) +// CHECK: define half @test_half(half %{{.*}}) +__fp16 test_half(__fp16 A) { } + +// __fp16 is a base type for homogeneous floating-point aggregates for AArch64 (but not 32-bit ARM). +// CHECK: define %struct.HFA_half @test_half_hfa(half %{{.*}}, half %{{.*}}, half %{{.*}}, half %{{.*}}) +struct HFA_half { __fp16 a[4]; }; +struct HFA_half test_half_hfa(struct HFA_half A) { } |