* [PATCH, powerpc] Fix speculation barrier and group nop to emit target register names.
@ 2019-01-12 13:28 Iain Sandoe
2019-01-18 23:09 ` Segher Boessenkool
0 siblings, 1 reply; 2+ messages in thread
From: Iain Sandoe @ 2019-01-12 13:28 UTC (permalink / raw)
To: gcc-patches; +Cc: Segher Boessenkool
Hi,
The current implementation of “speculation_barrier” and “group_end_nop” insns emit hard-wired register names which causes tests using them to fail on Darwin, at least, which uses “rNN” instead of “NN”.
The patch makes the register names for these insns use the operand output mechanism to substitute the appropriate variant when needed.
tested on powerpc-darwin9 and powerpc64-linux.
OK for trunk?
Iain
gcc/
* config/rs6000/rs6000.md (group_end_nop): Emit
insn register names using operand format, rather than
hard-wired. (speculation_barrier): Likewise.
diff --git a/gcc/config/rs6000/rs6000.md b/gcc/config/rs6000/rs6000.md
index 56364e0..86badc2 100644
--- a/gcc/config/rs6000/rs6000.md
+++ b/gcc/config/rs6000/rs6000.md
@@ -12494,15 +12494,18 @@
[(unspec [(const_int 0)] UNSPEC_GRP_END_NOP)]
""
{
- if (rs6000_tune == PROCESSOR_POWER6)
- return "ori 1,1,0";
- return "ori 2,2,0";
+ operands[0] = gen_rtx_REG (Pmode,
+ rs6000_tune == PROCESSOR_POWER6 ? 1 : 2);
+ return "ori %0,%0,0";
})
(define_insn "speculation_barrier"
[(unspec_volatile:BLK [(const_int 0)] UNSPECV_SPEC_BARRIER)]
""
- "ori 31,31,0")
+{
+ operands[0] = gen_rtx_REG (Pmode, 31);
+ return "ori %0,%0,0";
+})
\f
;; Define the subtract-one-and-jump insns, starting with the template
;; so loop.c knows what to generate.
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH, powerpc] Fix speculation barrier and group nop to emit target register names.
2019-01-12 13:28 [PATCH, powerpc] Fix speculation barrier and group nop to emit target register names Iain Sandoe
@ 2019-01-18 23:09 ` Segher Boessenkool
0 siblings, 0 replies; 2+ messages in thread
From: Segher Boessenkool @ 2019-01-18 23:09 UTC (permalink / raw)
To: Iain Sandoe; +Cc: gcc-patches
Hi Iain,
On Sat, Jan 12, 2019 at 01:28:05PM +0000, Iain Sandoe wrote:
> The current implementation of âspeculation_barrierâ and âgroup_end_nopâ insns emit hard-wired register names which causes tests using them to fail on Darwin, at least, which uses ârNNâ instead of âNNâ.
>
> The patch makes the register names for these insns use the operand output mechanism to substitute the appropriate variant when needed.
This is fine for trunk and all backports you may need/want.
Thanks,
Segher
> * config/rs6000/rs6000.md (group_end_nop): Emit
> insn register names using operand format, rather than
> hard-wired. (speculation_barrier): Likewise.
[ Get your mail client not to mess up changelogs? ;-) ]
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2019-01-18 23:09 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-01-12 13:28 [PATCH, powerpc] Fix speculation barrier and group nop to emit target register names Iain Sandoe
2019-01-18 23:09 ` 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).