This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH, S390] Avoid LA with base and index on z13
- From: Robin Dapp <rdapp at linux dot ibm dot com>
- To: Ulrich Weigand <uweigand at de dot ibm dot com>
- Cc: GCC Patches <gcc-patches at gcc dot gnu dot org>, Andreas Krebbel <krebbel at linux dot ibm dot com>
- Date: Mon, 16 Jul 2018 13:02:11 +0200
- Subject: [PATCH, S390] Avoid LA with base and index on z13
- References: <20180705115111.6952ED80287@oc3748833570.ibm.com>
> But on zEC12 LA works pretty much the same as on z13/z14, it is
> indeed not cracked, but still a 2-cycle instruction when using
> an index register. So I guess the change really should apply
> to zEC12 as well, and this could be as simple as changing the
> above line to:
>
> if (addr.indx && s390_tune >= PROCESSOR_2817_Z196)
>
> (Note that "addr.base && addr.indx" is the same as just checking
> for addr.indx, since s390_decompose_address will never fill in
> *just* an index.)
Good point, I adapted the patch and changed the comment.
Regards
Robin
--
gcc/ChangeLog:
2018-07-16 Robin Dapp <rdapp@linux.ibm.com>
* config/s390/s390.c (preferred_la_operand_p): Do not use
LA with index register on z196 or later.
diff --git a/gcc/config/s390/s390.c b/gcc/config/s390/s390.c
index 23c3f3db621..d8b47c6fe67 100644
--- a/gcc/config/s390/s390.c
+++ b/gcc/config/s390/s390.c
@@ -4623,11 +4623,11 @@ preferred_la_operand_p (rtx op1, rtx op2)
if (addr.indx && !REGNO_OK_FOR_INDEX_P (REGNO (addr.indx)))
return false;
- /* Avoid LA instructions with index register on z196; it is
- preferable to use regular add instructions when possible.
- Starting with zEC12 the la with index register is "uncracked"
- again. */
- if (addr.indx && s390_tune == PROCESSOR_2817_Z196)
+ /* Avoid LA instructions with index (and base) register on z196 or
+ later; it is preferable to use regular add instructions when
+ possible. Starting with zEC12 the la with index register is
+ "uncracked" again but still slower than a regular add. */
+ if (addr.indx && s390_tune >= PROCESSOR_2817_Z196)
return false;
if (!TARGET_64BIT && !addr.pointer)