[PATCH, i386]: Fix PR target/26915: -1 should be loaded as fld1;fchs

Uros Bizjak ubizjak@gmail.com
Sat Nov 4 11:55:00 GMT 2006


Hello!

This patch implements optimization, suggested in PR target/26915. A 
sequence of fld1;fchs is always shorter than load of constant from 
memory. In addition to data space, code size decreases by 2 bytes for 
every load of -1, so IMO is this valid optimization for -Os.

Patch was bootstrapped and regression tested on x86_64-pc-linux-gnu.

2006-11-04  Uros Bizjak  <ubizjak@gmail.com>

        PR target/26915
        * config/i386/i386.c (standard_80387_constant_p): When 
optimizing for
        size, treat -1 as a valid 80387 constant.
        (standard_80387_constant_opcode): Return "#" for constant -1.
        * config/i386/i386.md (unnamed splitter): When optimizing for size,
        split load of constant -1 into load of 1 and negation sequence.

testsuite/ChangeLog:

2006-11-04  Uros Bizjak  <ubizjak@gmail.com>

        PR target/26915
        * gcc.target/i386/387-12.c: New test.

OK for mainline?

Uros.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: i386-fldm1.diff
Type: text/x-patch
Size: 1872 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20061104/445e9859/attachment.bin>


More information about the Gcc-patches mailing list