public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc(refs/vendors/redhat/heads/gcc-8-branch)] AArch64: Implement missing vrndns_f32 intrinsic
@ 2021-04-23 10:14 Jakub Jelinek
0 siblings, 0 replies; only message in thread
From: Jakub Jelinek @ 2021-04-23 10:14 UTC (permalink / raw)
To: gcc-cvs
https://gcc.gnu.org/g:7adf81eb646b25f38269f3a0fee54f5e659e9f77
commit 7adf81eb646b25f38269f3a0fee54f5e659e9f77
Author: Kyrylo Tkachov <kyrylo.tkachov@arm.com>
Date: Wed Sep 23 12:02:29 2020 +0100
AArch64: Implement missing vrndns_f32 intrinsic
This patch implements the missing vrndns_f32 intrinsic. This operates on a scalar float32_t value.
It can be mapped down to a __builtin_aarch64_frintnsf builtin.
This patch does that.
Bootstrapped and tested on aarch64-none-linux-gnu.
gcc/
PR target/71233
* config/aarch64/aarch64-simd-builtins.def (frintn): Use BUILTIN_VHSDF_HSDF
for modes. Remove explicit hf instantiation.
* config/aarch64/arm_neon.h (vrndns_f32): Define.
gcc/testsuite/
PR target/71233
* gcc.target/aarch64/simd/vrndns_f32_1.c: New test.
(cherry picked from commit 02b5377b3766804059b7824330d33d0e1cef2e5b)
Diff:
---
gcc/config/aarch64/aarch64-simd-builtins.def | 3 +--
gcc/config/aarch64/arm_neon.h | 7 +++++++
gcc/testsuite/gcc.target/aarch64/simd/vrndns_f32_1.c | 13 +++++++++++++
3 files changed, 21 insertions(+), 2 deletions(-)
diff --git a/gcc/config/aarch64/aarch64-simd-builtins.def b/gcc/config/aarch64/aarch64-simd-builtins.def
index 9566dc44d0b..8acfc083ce1 100644
--- a/gcc/config/aarch64/aarch64-simd-builtins.def
+++ b/gcc/config/aarch64/aarch64-simd-builtins.def
@@ -314,12 +314,11 @@
BUILTIN_VHSDF (UNOP, nearbyint, 2)
BUILTIN_VHSDF (UNOP, rint, 2)
BUILTIN_VHSDF (UNOP, round, 2)
- BUILTIN_VHSDF_DF (UNOP, frintn, 2)
+ BUILTIN_VHSDF_HSDF (UNOP, frintn, 2)
VAR1 (UNOP, btrunc, 2, hf)
VAR1 (UNOP, ceil, 2, hf)
VAR1 (UNOP, floor, 2, hf)
- VAR1 (UNOP, frintn, 2, hf)
VAR1 (UNOP, nearbyint, 2, hf)
VAR1 (UNOP, rint, 2, hf)
VAR1 (UNOP, round, 2, hf)
diff --git a/gcc/config/aarch64/arm_neon.h b/gcc/config/aarch64/arm_neon.h
index a0080b73cf1..33a3457b4c3 100644
--- a/gcc/config/aarch64/arm_neon.h
+++ b/gcc/config/aarch64/arm_neon.h
@@ -26204,6 +26204,13 @@ vrndmq_f64 (float64x2_t __a)
/* vrndn */
+__extension__ extern __inline float32_t
+__attribute__ ((__always_inline__, __gnu_inline__, __artificial__))
+vrndns_f32 (float32_t __a)
+{
+ return __builtin_aarch64_frintnsf (__a);
+}
+
__extension__ extern __inline float32x2_t
__attribute__ ((__always_inline__, __gnu_inline__, __artificial__))
vrndn_f32 (float32x2_t __a)
diff --git a/gcc/testsuite/gcc.target/aarch64/simd/vrndns_f32_1.c b/gcc/testsuite/gcc.target/aarch64/simd/vrndns_f32_1.c
new file mode 100644
index 00000000000..960e4f6f768
--- /dev/null
+++ b/gcc/testsuite/gcc.target/aarch64/simd/vrndns_f32_1.c
@@ -0,0 +1,13 @@
+/* { dg-do compile } */
+/* { dg-options "-O" } */
+
+#include <arm_neon.h>
+
+float32_t
+test (float32_t a)
+{
+ return vrndns_f32 (a);
+}
+
+/* { dg-final { scan-assembler-times "frintn\\ts\[0-9\]+, s\[0-9\]+" 1 } } */
+
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2021-04-23 10:14 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-23 10:14 [gcc(refs/vendors/redhat/heads/gcc-8-branch)] AArch64: Implement missing vrndns_f32 intrinsic Jakub Jelinek
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).