public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc(refs/users/meissner/heads/work008)] AArch64: Use FLOAT_MODE_P macro and add FLAG_AUTO_FP [PR94442]
@ 2020-08-06 17:53 Michael Meissner
  0 siblings, 0 replies; only message in thread
From: Michael Meissner @ 2020-08-06 17:53 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:35ffd4d16d7e3dbba297da788414a673530b7817

commit 35ffd4d16d7e3dbba297da788414a673530b7817
Author: xiezhiheng <xiezhiheng@huawei.com>
Date:   Tue Aug 4 17:25:29 2020 +0100

    AArch64: Use FLOAT_MODE_P macro and add FLAG_AUTO_FP [PR94442]
    
    Since all FP intrinsics are set by FLAG_FP by default, but not all FP intrinsics
    raise FP exceptions or read FPCR register.  So we add a global flag FLAG_AUTO_FP
    to suppress the flag FLAG_FP.
    
    2020-08-04  Zhiheng Xie  <xiezhiheng@huawei.com>
    
    gcc/ChangeLog:
    
            * config/aarch64/aarch64-builtins.c (aarch64_call_properties):
            Use FLOAT_MODE_P macro instead of enumerating all floating-point
            modes and add global flag FLAG_AUTO_FP.

Diff:
---
 gcc/config/aarch64/aarch64-builtins.c | 26 ++++++--------------------
 1 file changed, 6 insertions(+), 20 deletions(-)

diff --git a/gcc/config/aarch64/aarch64-builtins.c b/gcc/config/aarch64/aarch64-builtins.c
index 892ef9495e1..4f33dd936c7 100644
--- a/gcc/config/aarch64/aarch64-builtins.c
+++ b/gcc/config/aarch64/aarch64-builtins.c
@@ -125,6 +125,10 @@ const unsigned int FLAG_READ_MEMORY = 1U << 2;
 const unsigned int FLAG_PREFETCH_MEMORY = 1U << 3;
 const unsigned int FLAG_WRITE_MEMORY = 1U << 4;
 
+/* Not all FP intrinsics raise FP exceptions or read FPCR register,
+   use this flag to suppress it.  */
+const unsigned int FLAG_AUTO_FP = 1U << 5;
+
 const unsigned int FLAG_FP = FLAG_READ_FPCR | FLAG_RAISE_FP_EXCEPTIONS;
 const unsigned int FLAG_ALL = FLAG_READ_FPCR | FLAG_RAISE_FP_EXCEPTIONS
   | FLAG_READ_MEMORY | FLAG_PREFETCH_MEMORY | FLAG_WRITE_MEMORY;
@@ -900,27 +904,9 @@ static unsigned int
 aarch64_call_properties (aarch64_simd_builtin_datum *d)
 {
   unsigned int flags = d->flags;
-  switch (d->mode)
-    {
-    /* Floating-point.  */
-    case E_BFmode:
-    case E_V4BFmode:
-    case E_V8BFmode:
-    case E_HFmode:
-    case E_V4HFmode:
-    case E_V8HFmode:
-    case E_SFmode:
-    case E_V2SFmode:
-    case E_V4SFmode:
-    case E_DFmode:
-    case E_V1DFmode:
-    case E_V2DFmode:
-      flags |= FLAG_FP;
-      break;
 
-    default:
-      break;
-    }
+  if (!(flags & FLAG_AUTO_FP) && FLOAT_MODE_P (d->mode))
+    flags |= FLAG_FP;
 
   /* -fno-trapping-math means that we can assume any FP exceptions
      are not user-visible.  */


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2020-08-06 17:53 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-08-06 17:53 [gcc(refs/users/meissner/heads/work008)] AArch64: Use FLOAT_MODE_P macro and add FLAG_AUTO_FP [PR94442] Michael Meissner

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).