[PATCH, i386]: Rewrite x87 sqrt patterns, take 2a (macroized)

Uros Bizjak ubizjak@gmail.com
Fri Nov 24 12:06:00 GMT 2006


On 11/23/06, Uros Bizjak <ubizjak@gmail.com> wrote:

> > The asm code, generated for the fsqrt testcase in my previous post is
> > now the same as without patch. In addition, fmod patterns were changed
> > to use no-op truncation, to be consistent with sqrt expanders.

This (hopefully last) revision puts back inherent float extension to
XFmode for SFMode and DFmode fsqrt. This is IMO the correct thing to
do, as it also models the  behavior of fsqrt in all details.

Attached patch was bootstrapped on i686-pc-linux-gnu for c, c++ and fortran.

This patch removes another 200 bytes from povray binary. Looking a bit
into this effect, it looks that 80 fst and 30 fld instructions were
removed. Further experimenting didn't produce any better results.

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

	config/i386/i386.md (UNSPEC_TRUNC_NOOP): New unspec definition.
	(X87MODEF): New mode macro.
	(ssemodefsuffix): New mode attribute.
	(truncxf<mode>2_i387_noop_unspec): New insn pattern.
	(sqrt_extend<mode>xf2_i387): New insn pattern.
	(sqrt<mode>2): For non-SSE sqrt, emit sqrt_extend<mode>xf2_i387
	insn and truncate result back to original mode using
	UNSPEC_TRUNC_NOOP truncation.
	(*sqrt<mode>2_sse): Implement using SSEMODEF mode macro and
	ssemodefsuffix mode attribute.
	(*sqrtsf2_mixed, *sqrtsf2_i387, *sqrtdf2_mixed, *sqrtdf2_i387)
	(*sqrtextendsfdf2_i387, *sqrtextendsfxf2_i387)
	(*sqrtextenddfxf2_i387): Remove insn patterns.

	(fmodsf3, fmoddf3, remaindersf3, remainderdf3): Use noop
	truncation patterns.

	reg-stack.c (get_true_reg): Handle UNSPEC_TRUNC_NOOP.

:ADDPATCH target, i387:

OK for mainline?

Uros.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: i386-sqrt-4.diff
Type: application/octet-stream
Size: 8465 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20061124/3de15171/attachment.obj>


More information about the Gcc-patches mailing list