Patch to improve mov?f patterns
Jan Hubicka
hubicka@atrey.karlin.mff.cuni.cz
Fri Apr 30 22:47:00 GMT 1999
> On Thu, Apr 15, 1999 at 10:43:55AM +0200, Jan Hubicka wrote:
> > This is simple patch to improve mov?f patterns. They now use new constraint
> > that refuse all constants (even 0 and 1). This allows combine to be more
> > smart and in operations like a+1 read 1 from memory as add operand.
>
> Do you consider this an improvement simply because isolated
> code produces one insn instead of two? What about cases like
>
> for (i = 0; i < n; ++i)
> flt[i] += 1.0f;
>
> which will now do
>
> flds .LC0
> loop:
> flds (mem)
> fadd %st(1)
> fstsp (mem)
> ...
>
> instead of using `fld1' to begin. Also, fld1 is theoritically
> faster due to memory load latencies. This is probably hard to
> measure in practice though.
I believe, that fld1 will be still used in case combine fails to put
constant to some other operation. (at least it was used in my test)
thats why I allow immediate constants in reload.
(I my tests reload was replacing memory references to standard constant
by const doubles nicely)
I will do some more testing.
Honza
More information about the Gcc-patches
mailing list