This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH, x86_64]: Implement TFmode builtins required by libgcc2 c99 complex math


Hello!

Attached patch implements __builtin_infq, __builtin_fabsq and
__builtin_copysingq built-in functions. These are required by TCmode
c99 complex division and multiplication routines in libgcc2.

The patch reuses existing infrastructure to expand __builtin_fabsq and
__builtin_copysignq by enhancing support routines to except TFmode
operands and by adding a couple of bitwise TFmode operations.
Actually, "pand", "pxor" and "por" SSE2 insns are just enough to
create all required sign-manipulating  functions.

Additionally, patch macroizes copysign patterns in i386.md and adds a
testcase to test all sign-manipulating operations.

Patch was bootstrapped and regression tested on i686-pc-linux-gnu,
x86_64-pc-linux-gnu regression tests are in progress.

2007-06-06 Uros Bizjak <ubizjak@gmail.com>

	* config/i386/i386.md (standard sse constant splitter): Handle TFmode.
	(negtf2, abstf2, *absnegtf2_sse): New insn patterns.
	(CSGNMODE): New mode macro.
	(CSGNVMODE): New mode attribute.
	(copysign<mode>3): Rename from copysingsf3 and copysigndf3.  Macroize
	expander using CSGNMODE mode macro.  Handle TFmode.
	(copysign<mode>3_const): Rename from copysignsf3_const and
	copysigndf3_const.  Macroize pattern using CSGNMODE mode macro.
	Handle TFmode.
	(copysign<mode>3_var): Rename from copysignsf3_var and
	copysigndf3_var.  Macroize pattern using CSGNMODE mode macro.
	Handle TFmode.
	(copysign<mode>3_var splitter): Macroize pattern using CSGNMODE
	mode macro.  Handle TFmode.
	* config/i386/sse.md (andtf3, *andtf3): New insn patterns.
	(iortf3, *iortf3): Ditto.
	(xortf3, *xortf3): Ditto.
	* config/i386/i386.c (ix86_build_signbit_mask): Create scalar
	TFmode and TImode masks.
	(ix86_expand_copysign): Expand TFmode copysign insn.
	(IX86_BUILTIN_INFQ): New.
	(IX86_BUILTIN_FABSQ): Ditto.
	(IX86_BUILTIN_COPYSIGNQ): Ditto.
	(ix86_init_mmx_sse_builtins) [__builtin_infq]: New builtin definition.
	[__builtin_fabsq]: Ditto.
	[__builtin_copysignq]: Ditto.
	(ix86_expand_builtin) [IX86_BUILTIN_INFQ]: Expand builtin.
	[IX86_BUILTIN_FABSQ]: Expand builtin using ix86_expand_unop_builtin().
	[IX86_BUILTIN_COPYSIGNQ]: Expand builtin using
	ix86_expand_unop_builtin().

testsuite/ChangeLog:
	
2007-06-07  Uros Bizjak  <ubizjak@gmail.com>

* gcc.target/i386/builtin-copysign.c: New test.

Uros.

Attachment: i386-copysignq.diff.txt
Description: Text document


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]