Below power7, it seems to be more profitable to compress the
floating-point constants and use an additional fp register move to
"extend" it.  Only at power7 and above do we keep the constants
separate and load them, getting to the expected 'fmr' count.

Regstrapped on powerpc64le-linux-gnu.  Also tested with gcc-14 on
x86_64-linux-x-powerpc-elf.  Ok to install?


for  gcc/testsuite/ChangeLog

        * gcc.target/powerpc/pr17381.c: Compile for power7.  Justify.
---
 gcc/testsuite/gcc.target/powerpc/pr17381.c |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/gcc/testsuite/gcc.target/powerpc/pr17381.c 
b/gcc/testsuite/gcc.target/powerpc/pr17381.c
index e6222c130af1f..b137c687776ec 100644
--- a/gcc/testsuite/gcc.target/powerpc/pr17381.c
+++ b/gcc/testsuite/gcc.target/powerpc/pr17381.c
@@ -1,6 +1,8 @@
 /* PR target/17381 - Unnecessary register move for float extend */
 /* { dg-do compile } */
-/* { dg-options "-O2" } */
+/* { dg-options "-mdejagnu-cpu=power7 -O2" } */
+/* Up to power6, we compress the floating-point constant 1.0 and share it with
+   1.0f, but the float_extend comes out as a second fmr.  */
 
 double d;
 float test1(float fParm)

-- 
Alexandre Oliva, happy hacker            https://blog.lx.oliva.nom.br/
Free Software Activist     FSFLA co-founder     GNU Toolchain Engineer
More tolerance and less prejudice are key for inclusion and diversity.
Excluding neuro-others for not behaving ""normal"" is *not* inclusive!

Reply via email to