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, powerpc] Improve floating point to integer conversions on powerpc


This is the second patch in terms improving floating point conversions on the
powerpc.

The changes here include:

    1)	Merge SF/DF patterns into a single combined insn;

    2)	Add missing power7 conversions;

    3)	Add combiner insns to reduce the cases where the target of the
	conversion is going to be stored in memory to prevent the compiler from
	storing the value into the stack, reloading it into a GPR, and then
	storing it to the destination.

    4)	Eliminate another case of pre-IRA register allocator constraints that
	doesn't work as well with IRA, and add extra round trips through memory
	and GPRs.

    5)	Generate code for the lrint builtin funciton (on 64-bit) and llrint (on
	both 32 and 64-bit).

As before, I bootstraped and did make check with no regressions.

I built SPE code for -mcpu=e500mc and -mcpu=e500mc64 with no differences.

I added 5 tests to test the basic functionality for different code models.

[gcc]
2010-08-24  Michael Meissner  <meissner@linux.vnet.ibm.com>

	* config/rs6000/rs6000.md (fixuns_truncsfsi2): Delete, merge into
	common pattern for both SF/DF.  Add power7 support.
	(fix_truncsfsi2): Ditto.
	(fixuns_truncdfsi2): Ditto.
	(fixuns_truncdfdi2): Ditto.
	(fix_truncdfsi2): Ditto.
	(fix_truncdfsi2_internal): Ditto.
	(fix_truncdfsi2_internal_gfxopt): Ditto.
	(fix_truncdfsi2_mfpgpr): Ditto.
	(fctiwz): Ditto.
	(btruncdf2): Ditto.
	(btruncdf2_fpr): Ditto.
	(btructsf2): Ditto.
	(ceildf2): Ditto.
	(ceildf2_fpr): Ditto.
	(ceilsf2): Ditto.
	(floordf2): Ditto.
	(floordf2_fpr): Ditto.
	(floorsf2): Ditto.
	(rounddf2): Ditto.
	(rounddf2_fpr): Ditto.
	(roundsf2): Ditto.
	(fix_trunc<mode>si2): Combine SF/DF conversion into one insn.
	(fix_trunc<mode>di2): Ditto.
	(fixuns_trunc<mode>si2): Ditto.
	(fixuns_trunc<mode>di2): Ditto.
	(fctiwz_<mode>): Ditto.
	(btrunc<mode>2): Ditto.
	(btrunc<mode>2_fpr): Ditto.
	(ceil<mode>2): Ditto.
	(ceil<mode>2_fpr): Ditto.
	(floor<mode>2): Ditto.
	(float<mode>2_fpr): Ditto.
	(round<mode>2): Ditto.
	(round<mode>2_fpr): Ditto.
	(fix_trunc<mode>si2_stfiwx): New insn for machines with STFIWX.
	(fixuns_trunc<mode>si2_stfiwx): Ditto.
	(fix_truncdfsi2_internal): Ditto.
	(fix_trunc<mode>si2_mem): Combiner pattern to eliminate storing
	converted value on stack, loaded into GPR, and then stored into
	the final destination.
	(fix_trunc<mode>di2_fctidz): New pattern for targets supporting
	FCTIDZ.
	(lrint<mode>di2): New insn, provide the lrint builtin functions.
	(ftruncdf2): Delete, unused.
	(fix_trunctfsi2_internal): Use gen_fctiwz_df, not gen_fctiwz.

	* config/rs6000/vsx.md (toplevel): Update copyright year.
	(VSr2): Use "ws" contraint for DFmode, not "!r#r".
	(VSr3): Ditto.

[gcc/testsuite]
2010-08-24  Michael Meissner  <meissner@linux.vnet.ibm.com>

	* gcc.target/powerpc/ppc-fpconv-5.c: New test for floating point
	to integer conversion code generation.
	* gcc.target/powerpc/ppc-fpconv-6.c: Ditto.
	* gcc.target/powerpc/ppc-fpconv-7.c: Ditto.
	* gcc.target/powerpc/ppc-fpconv-8.c: Ditto.
	* gcc.target/powerpc/ppc-fpconv-9.c: Ditto.

-- 
Michael Meissner, IBM
5 Technology Place Drive, M/S 2757, Westford, MA 01886-3141, USA
meissner@linux.vnet.ibm.com

Attachment: gcc-power7.patch154b
Description: Text document


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