This is the mail archive of the 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 integer to floating point conversions on powerpc

(Something has futzed with my work email configuration, so I'm routing this
through my home email account).

This patch is the first of 3 patches that I wrote to improve floating point
conversions on modern powerpc's.  This patch improves the conversion of integer
types to binary floating point.  The second patch will improve the conversion
of binary floating point to integer types.  The third patch will add support
for patterns to optimize rounding conversions like (double)(int)x.  A few
defines and unspec constants are defined in this patch that won't be used until
the other patches are submitted.

The main changes in this patch are:

    1)	On newer machines, generate the FCFID instruction in 32-bit mode.  In
	older machines, the FCFID was only available in 64-bit mode.

    2)	Add support for ISA 2.05 (LFIWAX) and ISA 2.06 (LFIWZX, FCFIDS, FCFIDU,
	FCFIDUS) instructions.

    3)	Tweak the previous changes I had made to automatically set various
	options if one of the newer ISA switches is used.  Split embedded from
	server options.  If -mcpu=power7 -mno-altivec, note -mvsx is an
	explicit option.

    4)	Fix up the constraints in a mode attribute that previously was unused.

    5)	Add combiners for converting items from memory to optimize not loading
	the value into a GPR, then spilling it on the stack, and reloading it
	into a FPR for conversion.

    6)	Use "d" or "f" constraints, instead of !d#r, to reduce the spills
	generated by the compiler.

I did a bootstrap and make check.  There were no regressions with this patch.
In addition, the test is now fixed.

I built an powerpc-eabispe compiler, and verified that the compiler with the
patches generates exactly the same code as the compiler without the patches for
-mcpu=e500mc and -mcpu=e500mc64.

I tested the code for -mcpu=750 in 32-bit, and verified that the code was the
same (i.e. no FCFID was generated in 32-bit mode).

I added 4 tests to test the code for various machines.

Are these patches ok to apply?

Michael Meissner, IBM
5 Technology Place Drive, M/S 2757, Westford, MA 01886-3141, USA

Attachment: gcc-power7.patch153b
Description: Text document

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