[ARM] Enable __fp16 as a function parameter and return type.
authorMatthew Wahab <matthew.wahab@arm.com>
Mon, 16 May 2016 09:31:58 +0000 (09:31 +0000)
committerMatthew Wahab <mwahab@gcc.gnu.org>
Mon, 16 May 2016 09:31:58 +0000 (09:31 +0000)
commit1b81a1c1bd5355d8b5405825b4478078e76fd906
tree9f7d00a689aac3631bce0629d716637f5c0bb11a
parent0501ae62c731ccca994a85e61d67685b829eb0be
[ARM] Enable __fp16 as a function parameter and return type.

gcc/
2016-05-16  Matthew Wahab  <matthew.wahab@arm.com>
    Ramana Radhakrishnan  <ramana.radhakrishnan@arm.com>
    Jiong Wang  <jiong.wang@arm.com>

* config/arm/arm-c.c (arm_cpu_builtins): Use def_or_undef_macro
for __ARM_FP16_FORMAT_IEEE and __ARM_FP16_FORMAT_ALTERNATIVE.
Define __ARM_FP16_ARGS when appropriate.
* config/arm/arm.c (arm_invalid_parameter_type): Remove
declaration.
(arm_invalid_return_type): Likewise.
(TARGET_INVALID_PARAMETER_TYPE): Remove.
(TARGET_INVALID_RETURN_TYPE): Remove.
(aapcs_vfp_sub_candidate): Allow HFmode.
(aapcs_vfp_allocate): Add comment.  Support HFmode.
(aapcs_vfp_allocate_return_reg): Likewise.
(struct aapcs_cp_arg_layout): Slightly reword comments for
is_return_candidate and allocate_return_reg.
(output_mov_vfp): Update assert.
(arm_hard_regno_mode_ok): Remove comment, update HF-mode
condition.
(arm_invalid_parameter_type): Remove.
(amr_invalid_return_type): Remove.
* config/arm/arm.h (TARGET_NEON_FP16): Fix definition.
* config/arm/arm.md (*arm32_movhf): Disable for TARGET_VFP.
* config/arm/vfp.md (*movhf_vfp): Enable for TARGET_VFP.

gcc/testsuite/
2016-05-16  Matthew Wahab  <matthew.wahab@arm.com>

* g++.dg/ext/arm-fp16/fp16-param-1.c: Update expected output.  Add
test for __ARM_FP16_ARGS.
* g++.dg/ext/arm-fp16/fp16-return-1.c: Update expected output.
* gcc.target/arm/aapcs/neon-vect10.c: New.
* gcc.target/arm/aapcs/neon-vect9.c: New.
* gcc.target/arm/aapcs/vfp18.c: New.
* gcc.target/arm/aapcs/vfp19.c: New.
* gcc.target/arm/aapcs/vfp20.c: New.
* gcc.target/arm/aapcs/vfp21.c: New.
* gcc.target/arm/fp16-aapcs-1.c: New.
* g++.target/arm/fp16-param-1.c: Update expected output.  Add
test for __ARM_FP16_ARGS.
* g++.target/arm/fp16-return-1.c: Update expected output.

Co-Authored-By: Jiong Wang <jiong.wang@arm.com>
Co-Authored-By: Ramana Radhakrishnan <ramana.radhakrishnan@arm.com>
From-SVN: r236269
18 files changed:
gcc/ChangeLog
gcc/config/arm/arm-c.c
gcc/config/arm/arm.c
gcc/config/arm/arm.h
gcc/config/arm/arm.md
gcc/config/arm/vfp.md
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/ext/arm-fp16/fp16-param-1.C
gcc/testsuite/g++.dg/ext/arm-fp16/fp16-return-1.C
gcc/testsuite/gcc.target/arm/aapcs/neon-vect10.c [new file with mode: 0644]
gcc/testsuite/gcc.target/arm/aapcs/neon-vect9.c [new file with mode: 0644]
gcc/testsuite/gcc.target/arm/aapcs/vfp18.c [new file with mode: 0644]
gcc/testsuite/gcc.target/arm/aapcs/vfp19.c [new file with mode: 0644]
gcc/testsuite/gcc.target/arm/aapcs/vfp20.c [new file with mode: 0644]
gcc/testsuite/gcc.target/arm/aapcs/vfp21.c [new file with mode: 0644]
gcc/testsuite/gcc.target/arm/fp16-aapcs-1.c [new file with mode: 0644]
gcc/testsuite/gcc.target/arm/fp16-param-1.c
gcc/testsuite/gcc.target/arm/fp16-return-1.c