* [RS6000] PR11848 rs6000_emit_move long double split
@ 2018-11-25 12:22 Alan Modra
2018-11-28 22:12 ` Segher Boessenkool
0 siblings, 1 reply; 2+ messages in thread
From: Alan Modra @ 2018-11-25 12:22 UTC (permalink / raw)
To: gcc-patches; +Cc: Segher Boessenkool
This split is disabled for power7 and up, so we don't often see its
bad effects. However, on a powerpc-linux compiler (which defaults
to PPC750 judging from rs6000/sysv4.h) we see
long double ld1 (void) { return 1.0L; }
compiled with -msoft-float -O2 -S resulting in
ld1:
li 3,0
li 4,0
mr 6,4
mr 5,3
li 4,0
lis 3,0x3ff0
blr
Things go awry in init-regs, with the TFmode reg being initialized to
zero on seeing the subreg from the split. (And that initialization
itself is split by rs6000_emit_move!) Later passes apparently don't
clean up the rubbish.
Since the split was added for Darwin (as the comment says), let's get
rid of it on other targets.
Bootstrapped etc. powerpc64le-linux and powerpc64-linux.
* config/rs6000/rs6000.c (rs6000_emit_move): Disable long
double split for targets other than Darwin.
diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c
index 212e9facb3a..c339368be29 100644
--- a/gcc/config/rs6000/rs6000.c
+++ b/gcc/config/rs6000/rs6000.c
@@ -10010,8 +10010,8 @@ rs6000_emit_move (rtx dest, rtx source, machine_mode mode)
/* 128-bit constant floating-point values on Darwin should really be loaded
as two parts. However, this premature splitting is a problem when DFmode
values can go into Altivec registers. */
- if (FLOAT128_IBM_P (mode) && !reg_addr[DFmode].scalar_in_vmx_p
- && GET_CODE (operands[1]) == CONST_DOUBLE)
+ if (TARGET_MACHO && CONST_DOUBLE_P (operands[1]) && FLOAT128_IBM_P (mode)
+ && !reg_addr[DFmode].scalar_in_vmx_p)
{
rs6000_emit_move (simplify_gen_subreg (DFmode, operands[0], mode, 0),
simplify_gen_subreg (DFmode, operands[1], mode, 0),
--
Alan Modra
Australia Development Lab, IBM
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [RS6000] PR11848 rs6000_emit_move long double split
2018-11-25 12:22 [RS6000] PR11848 rs6000_emit_move long double split Alan Modra
@ 2018-11-28 22:12 ` Segher Boessenkool
0 siblings, 0 replies; 2+ messages in thread
From: Segher Boessenkool @ 2018-11-28 22:12 UTC (permalink / raw)
To: Alan Modra; +Cc: gcc-patches
On Sun, Nov 25, 2018 at 10:52:08PM +1030, Alan Modra wrote:
> This split is disabled for power7 and up, so we don't often see its
> bad effects. However, on a powerpc-linux compiler (which defaults
> to PPC750 judging from rs6000/sysv4.h) we see
>
> long double ld1 (void) { return 1.0L; }
>
> compiled with -msoft-float -O2 -S resulting in
>
> ld1:
> li 3,0
> li 4,0
> mr 6,4
> mr 5,3
> li 4,0
> lis 3,0x3ff0
> blr
>
> Things go awry in init-regs, with the TFmode reg being initialized to
> zero on seeing the subreg from the split. (And that initialization
> itself is split by rs6000_emit_move!) Later passes apparently don't
> clean up the rubbish.
>
> Since the split was added for Darwin (as the comment says), let's get
> rid of it on other targets.
>
> Bootstrapped etc. powerpc64le-linux and powerpc64-linux.
>
> * config/rs6000/rs6000.c (rs6000_emit_move): Disable long
> double split for targets other than Darwin.
Okay for trunk, thanks!
Segher
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2018-11-28 22:12 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-11-25 12:22 [RS6000] PR11848 rs6000_emit_move long double split Alan Modra
2018-11-28 22:12 ` 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).