public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc(refs/vendors/redhat/heads/gcc-8-branch)] aarch64: Force TImode values into even registers
@ 2020-09-17 16:59 Jakub Jelinek
  0 siblings, 0 replies; only message in thread
From: Jakub Jelinek @ 2020-09-17 16:59 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:3515256472b691b5b0b21496ee10029cc7b3cfb9

commit 3515256472b691b5b0b21496ee10029cc7b3cfb9
Author: Andre Vieira <andre.simoesdiasvieira@arm.com>
Date:   Wed Apr 29 15:42:27 2020 +0100

    aarch64: Force TImode values into even registers
    
    The LSE CASP instruction requires values to be placed in even
    register pairs.  A solution involving two additional register
    classes was rejected in favor of the much simpler solution of
    simply requiring all TImode values to be aligned.
    
    gcc/ChangeLog:
    2020-04-29  Andre Vieira  <andre.simoesdiasvieira@arm.com>
    
            Backport from mainline.
            2018-10-31  Richard Henderson  <richard.henderson@linaro.org>
    
            * config/aarch64/aarch64.c (aarch64_hard_regno_mode_ok): Force
            16-byte modes held in GP registers to use an even regno.

Diff:
---
 gcc/ChangeLog                |  8 ++++++++
 gcc/config/aarch64/aarch64.c | 12 ++++++++----
 2 files changed, 16 insertions(+), 4 deletions(-)

diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index cc41f3685ad..d44ef73395a 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,11 @@
+2020-04-29  Andre Vieira  <andre.simoesdiasvieira@arm.com>
+
+	Backport from mainline.
+	2018-10-31  Richard Henderson  <richard.henderson@linaro.org>
+
+	* config/aarch64/aarch64.c (aarch64_hard_regno_mode_ok): Force
+	16-byte modes held in GP registers to use an even regno.
+
 2020-04-28  Andre Vieira  <andre.simoesdiasvieira@arm.com>
 
 	PR target/94814
diff --git a/gcc/config/aarch64/aarch64.c b/gcc/config/aarch64/aarch64.c
index 5eec1aae54a..525deba56ea 100644
--- a/gcc/config/aarch64/aarch64.c
+++ b/gcc/config/aarch64/aarch64.c
@@ -1369,10 +1369,14 @@ aarch64_hard_regno_mode_ok (unsigned regno, machine_mode mode)
   if (regno == FRAME_POINTER_REGNUM || regno == ARG_POINTER_REGNUM)
     return mode == Pmode;
 
-  if (GP_REGNUM_P (regno) && known_le (GET_MODE_SIZE (mode), 16))
-    return true;
-
-  if (FP_REGNUM_P (regno))
+  if (GP_REGNUM_P (regno))
+    {
+      if (known_le (GET_MODE_SIZE (mode), 8))
+	return true;
+      else if (known_le (GET_MODE_SIZE (mode), 16))
+	return (regno & 1) == 0;
+    }
+  else if (FP_REGNUM_P (regno))
     {
       if (vec_flags & VEC_STRUCT)
 	return end_hard_regno (mode, regno) - 1 <= V31_REGNUM;


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

only message in thread, other threads:[~2020-09-17 16:59 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-17 16:59 [gcc(refs/vendors/redhat/heads/gcc-8-branch)] aarch64: Force TImode values into even registers 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).