PowerPC multilib for "-mfloat-gprs=single -mspe"

Peter Dufault dufault at hda.com
Tue Apr 13 11:22:31 UTC 2010

I think I want to create a multilib variant for a "-mfloat=gprs-single -mspe" target.

I'm using the MPC5554 with the e200z6, which has single-precision floating point in the low half of the general purpose registers (GPRS), (-mfloat-gprs=single) and the signal processing extension including both integer and floating point vector units using the full 64-bits of the GPRS (-mspe).

I'd like to formalize my use of this.  I've written and been using the context save/restore for the SPE and think I've got it correct.

Are these statements correct:

1. There currently isn't anything to support even -mfloat=gprs-single cleanly.
2. This sort of variant is appropriate for a multilib.
3. If all code is compiled with "-mfloat=gprs-single -mspe", all code written in C/C++, including using vector pragmas, should properly allocate the GPRS subject to the defined ABI.  That is, the compiler will properly allocate the registers for any mixture of integer, single precision float, integer vector, and floating vector code using the GPRS in the compilation units.
4. To add a multilib, I need to bootstrap the development tools myself, look at how the PowerPC multilib variants are defined, and add my own optional multilib variant that builds everything with "-mfloat=gprs-single -mspe".  Once I rebuild everything, and assuming my context switching code is OK, I'll be good to go.
5. There is some way to detect mixtures of floating point variants (I've managed to generate warnings myself when I accidentally mixed different types of code) at link time and I should be able to figure out how to do this in my new multilib.

Questions? Comments? Criticisms?  Any pointers?

Peter Dufault
HD Associates, Inc.      Software and System Engineering

More information about the users mailing list