Patch: fix compress_float_constant heuristics

Richard Henderson rth@redhat.com
Mon Jul 11 17:46:00 GMT 2005


On Sun, Jul 10, 2005 at 06:57:18PM -0700, Dale Johannesen wrote:
>         * gcc.dg/compress-float-i386-sse.c:  New.
>         * gcc.dg/compress-float-i386-sse-pic.c:  New.
>         * gcc.dg/compress-float-i386-387.c:  New.
>         * gcc.dg/compress-float-i386-387-pic.c:  New.
>         * gcc.dg/compress-float-ppc.c:  New.
>         * gcc.dg/compress-float-ppc-pic.c:  New.

Please put the i386 tests in gcc.target/i386/.

> +    oldcost = rtx_cost (validize_mem (force_const_mem (dstmode, y)), SET);

You definitely do not want to validize_mem here.  That emits code,
which also means that you're not computing its cost.

Not that any of the affected targets are going to look at the address
of the MEM, since that doesn't affect the latency of the load.  But
you definitely don't want to be scattering random code to be cleaned up.

> double foo (double x) {
>   return x + 1.75;
> }
> /* { dg-final { scan-assembler "movsd" } } */

This isn't the best thing to be looking for, since there should be a
movsd for the load of x regardless.  You probably want to scan for not
flds and movss and cvtss2sd.



r~



More information about the Gcc-patches mailing list