[AArch64] Implement ACLE intrinsics for FRINT[32,64][Z,X]

Programming / Compilers / GCC - ktkachov [138bc75d-0d04-0410-961f-82ee72b054a4] - 3 September 2019 08:38 EDT

This patch implements the ACLE intrinsics to access the FRINT[32,64][Z,X] scalar[1] and vector[2][3] instructions from Armv8.5-a. These are enabled when the __ARM_FEATURE_FRINT macro is defined.

They're added in a fairly standard way through builtins and unspecs at the RTL level.

- config/aarch64/aarch64.md ("unspec"): Add UNSPEC_FRINT32Z, UNSPEC_FRINT32X, UNSPEC_FRINT64Z, UNSPEC_FRINT64X. (aarch64_): New define_insn.
- config/aarch64/aarch64.h (TARGET_FRINT): Define.
- config/aarch64/aarch64-c.c (aarch64_update_cpp_builtins): Define __ARM_FEATURE_FRINT when appropriate.
- config/aarch64/aarch64-simd-builtins.def: Add builtins for frint32z, frint32x, frint64z, frint64x.
- config/aarch64/arm_acle.h (__rint32zf, __rint32z, __rint64zf, __rint64z, __rint32xf, __rint32x, __rint64xf, __rint64x): Define.
- config/aarch64/arm_neon.h (vrnd32z_f32, vrnd32zq_f32, vrnd32z_f64,
vrnd32zq_f64, vrnd32x_f32, vrnd32xq_f32, vrnd32x_f64, vrnd32xq_f64,
vrnd64z_f32, vrnd64zq_f32, vrnd64z_f64, vrnd64zq_f64, vrnd64x_f32,
vrnd64xq_f32, vrnd64x_f64, vrnd64xq_f64): Define.
- config/aarch64/iterators.md (VSFDF): Define. (FRINTNZX): Likewise. (frintnzs_op): Likewise.

- gcc.target/aarch64/acle/rintnzx_1.c: New test.
- gcc.target/aarch64/simd/vrndnzx_1.c: Likewise.

51f75907837 [AArch64] Implement ACLE intrinsics for FRINT[32,64][Z,X]
gcc/ChangeLog | 20 ++++
gcc/config/aarch64/aarch64-c.c | 1 +
gcc/config/aarch64/aarch64-simd-builtins.def | 6 +
gcc/config/aarch64/aarch64.h | 3 +
gcc/config/aarch64/aarch64.md | 14 +++
gcc/config/aarch64/arm_acle.h | 53 +++++++++
gcc/config/aarch64/arm_neon.h | 118 +++++++++++++++++++
gcc/config/aarch64/iterators.md | 9 ++
gcc/testsuite/ChangeLog | 5 +
gcc/testsuite/gcc.target/aarch64/acle/rintnzx_1.c | 73 ++++++++++++
gcc/testsuite/gcc.target/aarch64/simd/vrndnzx_1.c | 137 ++++++++++++++++++++++
11 files changed, 439 insertions(+)

Upstream: gcc.gnu.org


  • Share