* [PATCH] rs6000: Enforce quad_address_p in TImode atomic_load/store (PR80382)
@ 2017-04-12 8:35 Segher Boessenkool
0 siblings, 0 replies; only message in thread
From: Segher Boessenkool @ 2017-04-12 8:35 UTC (permalink / raw)
To: gcc-patches; +Cc: dje.gcc, bergner, Segher Boessenkool
Whatever expand expands to should be valid instructions. The defined
instructions here have a quad_memory_operand predicate, which boils
down to quad_address_p on the address, so let's test for that instead
of only disallowing indexed addresses.
Tested on powerpc64-linux, applying to trunk.
Segher
2017-04-12 Segher Boessenkool <segher@kernel.crashing.org>
* config/rs6000/sync.md (atomic_load<mode>, atomic_store<mode): Test
for quad_address_p for TImode, instead of just not indexed_address.
---
gcc/config/rs6000/sync.md | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/gcc/config/rs6000/sync.md b/gcc/config/rs6000/sync.md
index 160713a..2a1828e 100644
--- a/gcc/config/rs6000/sync.md
+++ b/gcc/config/rs6000/sync.md
@@ -157,8 +157,7 @@ (define_expand "atomic_load<mode>"
rtx op1 = operands[1];
rtx pti_reg = gen_reg_rtx (PTImode);
- // Can't have indexed address for 'lq'
- if (indexed_address (XEXP (op1, 0), TImode))
+ if (!quad_address_p (XEXP (op1, 0), TImode, false))
{
rtx old_addr = XEXP (op1, 0);
rtx new_addr = force_reg (Pmode, old_addr);
@@ -231,8 +230,7 @@ (define_expand "atomic_store<mode>"
rtx op1 = operands[1];
rtx pti_reg = gen_reg_rtx (PTImode);
- // Can't have indexed address for 'stq'
- if (indexed_address (XEXP (op0, 0), TImode))
+ if (!quad_address_p (XEXP (op0, 0), TImode, false))
{
rtx old_addr = XEXP (op0, 0);
rtx new_addr = force_reg (Pmode, old_addr);
--
1.9.3
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2017-04-12 8:35 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-04-12 8:35 [PATCH] rs6000: Enforce quad_address_p in TImode atomic_load/store (PR80382) Segher Boessenkool
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).