Hi!

On Wed, Feb 06, 2019 at 11:08:44PM +0100, Eric Botcazou wrote:
> as reported e.g. at https://gcc.gnu.org/ml/gcc-help/2018-11/msg00038.html, 
> the 
> 7 series of compilers started to use FP instructions for simple 64-bit 
> integer 
> loads/stores in unexpected ways.  Consider:

<snip>

> The difference between GCC 7 and GCC 8 comes from this change:
>   https://gcc.gnu.org/ml/gcc-patches/2018-06/msg00584.html
> which seems to imply that the first change was problematic but which was not 
> backported to the 7 branch.
> 
> So at a minimum I think that the second change should be backported to the 7 
> branch; it applies (almost) cleanly and gives no regressions on PowerPC/Linux.
> 
>       Backport from mainline
>       2018-06-11  Segher Boessenkool  <seg...@kernel.crashing.org>
> 
>       PR target/85755
>       * config/rs6000/rs6000.md (*movdi_internal32): Put constraint modifiers
>       on the correct operand.
>       (*movdi_internal64): Ditto.

Backporting this is okay.  (It was not done because it does not affect
correctness).  What is the "almost", btw?

> But I also think that another part of the first change is problematic, namely 
> the removal of the '*' modifier on the alternatives, which means that the 
> register preference of the instruction isn't skewed towards integer registers 
> any more.

(In https://gcc.gnu.org/ml/gcc-patches/2016-11/txt4j9hLRLCzf.txt and you
presumably mean the *movdi_internal32 hunk, and the first line of it:

-         "=Y,        r,         r,         ?m,        ?*d,        ?*d,
+         "=Y,        r,         r,         ^m,        ^d,         ^d,

where the last three are mem<-reg, reg<-mem, reg<-reg, for fp regs).

This patch was a year before we switched to LRA, and for non-LRA ports *
does not do any register preferencing.

>  That may be OK for native targets, but that is frowned upon for 
> embedded targets, where people are really unhappy when the compiler emits 
> floating-point instructions for pure integer code for no apparent reason.

For 6xx/7xx people *wanted* to use FP loads and stores whenever possible,
because you get twice the bandwidth with them.

If you do not want the FP registers used (or FP insns used), use
-msoft-float, that's what it's for.

Patches are welcome, but complicating this already very complex code by
introducing an arbitrary distinction between "embedded and other" (or
actually, "server and other") isn't the way to go.  Sorry.

Could you open a PR please?


Segher

Reply via email to