Patch to improve mov?f patterns

Richard Henderson rth@cygnus.com
Thu Apr 15 18:53: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'm just trying to understand what brought you to the conclusion
that is is an improvement.


r~


More information about the Gcc-patches mailing list