[AArch64] Add support for __jcvt intrinsic
authorKyrylo Tkachov <kyrylo.tkachov@arm.com>
Tue, 3 Sep 2019 08:40:30 +0000 (08:40 +0000)
committerKyrylo Tkachov <ktkachov@gcc.gnu.org>
Tue, 3 Sep 2019 08:40:30 +0000 (08:40 +0000)
commite1d5d19ec4f84b67ac693fef5b2add7dc9cf056d
treeda0fa9437aebefb73cdec6a95102c3e49a02f89c
parent10bd1d964ef12daa9f92ff0b8d1e5f600aa63f7b
[AArch64] Add support for __jcvt intrinsic

This patch implements the __jcvt ACLE intrinsic [1] that maps down to the FJCVTZS [2] instruction from Armv8.3-a.
No fancy mode iterators or nothing. Just a single builtin, UNSPEC and define_insn and the associate plumbing.
This patch also defines __ARM_FEATURE_JCVT to indicate when the intrinsic is available.

[1] https://developer.arm.com/docs/101028/latest/data-processing-intrinsics
[2] https://developer.arm.com/docs/ddi0596/latest/simd-and-floating-point-instructions-alphabetic-order/fjcvtzs-floating-point-javascript-convert-to-signed-fixed-point-rounding-toward-zero

* config/aarch64/aarch64.md (UNSPEC_FJCVTZS): Define.
(aarch64_fjcvtzs): New define_insn.
* config/aarch64/aarch64.h (TARGET_JSCVT): Define.
* config/aarch64/aarch64-builtins.c (aarch64_builtins):
Add AARCH64_JSCVT.
(aarch64_init_builtins): Initialize __builtin_aarch64_jcvtzs.
(aarch64_expand_builtin): Handle AARCH64_JSCVT.
* config/aarch64/aarch64-c.c (aarch64_update_cpp_builtins): Define
__ARM_FEATURE_JCVT where appropriate.
* config/aarch64/arm_acle.h (__jcvt): Define.

* gcc.target/aarch64/acle/jcvt_1.c: New test.

From-SVN: r275335
gcc/ChangeLog
gcc/config/aarch64/aarch64-builtins.c
gcc/config/aarch64/aarch64-c.c
gcc/config/aarch64/aarch64.h
gcc/config/aarch64/aarch64.md
gcc/config/aarch64/arm_acle.h
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.target/aarch64/acle/jcvt_1.c [new file with mode: 0644]