[S390] Avoid LA with base and index on z13

Message ID 940c78e4-aa96-97af-ac25-50aa3e15ca90@linux.ibm.com
State New
Headers show
Series
  • [S390] Avoid LA with base and index on z13
Related show

Commit Message

Robin Dapp July 5, 2018, 11:09 a.m.
Hi,

this patch avoids emitting LA on z13 and later when the address has both
an index and a base since a regular add is faster in that case.

Regtested on s390x.

Regards
 Robin

--

gcc/ChangeLog:

2018-07-05  Robin Dapp  <rdapp@linux.ibm.com>

        * config/s390/s390.c (preferred_la_operand_p): Do not use
	LA with base and index on z13 or later.

Patch

diff --git a/gcc/config/s390/s390.c b/gcc/config/s390/s390.c
index 5add5985866..df9357fa9e5 100644
--- a/gcc/config/s390/s390.c
+++ b/gcc/config/s390/s390.c
@@ -4630,6 +4630,11 @@  preferred_la_operand_p (rtx op1, rtx op2)
   if (addr.indx && s390_tune == PROCESSOR_2817_Z196)
     return false;
 
+  /* Avoid LA when the address has index as well as base registers,
+     a regular add is still faster then. */
+  if (addr.base && addr.indx && s390_tune >= PROCESSOR_2964_Z13)
+    return false;
+
   if (!TARGET_64BIT && !addr.pointer)
     return false;