PowerPC compilation flags

Felipe GM lipee36@gmail.com
Sun Nov 25 19:42:00 GMT 2018


Hi there,

Currently I am developing for a MPC5777 board, with e200z7 cores. Most 
of the things are going well, but I am stuck with a problem that is 
really annoying me already. I am trying to use floating point operations 
on portions of my code, using the embedded hardware support. My 
toolchain is GCC 6.3 (powerpc-gcc, although I have tried with 7.3 and 
8.2 too), for which I am using the following flags:

|ASFLAGS_BASE =-g -a32 -mbooke -me500 --fatal-warnings ARCH_FLAGS 
=-mpowerpc-gpopt -mfprnd -misel -m32 -mhard-float-mabi=spe -mmfpgpr 
-mfloat-gprs=single|

Please notice the|-mfloat-gprs=single|flag. That is the one that is 
giving problems.

When I use|-mfloat-gprs=single|, I am not able to compile things 
properly, as some functions are not implemented:

|undefined reference to `__extendsfdf2`,undefined reference to 
`__adddf3`,undefined reference to `__divdf3`,|

- among others.

Now, if I compile using|-mfloat-gprs=double|, it goes till the end and 
generate all my execution files. BUT, using this flag also generates 
extra functions, not implemented by the e200z7. I can't tell for sure 
all of them, as the code is getting bigger and it is mostly impossible 
to track all generated assembly. For instance, at the moment my 
execution gets stuck when it reaches the|efscfd|instruction, which is 
implemented by the e500 core, that has double precision floating point 
support, but not for the e200, that has single precision support only.

So, any piece of advice here would be amazingly welcome!

Thanks in advance,

PS: regarding the documentation saying the floag-gprs flag being valid 
only for 8540, I have two "architectures": the board I am working on and 
qemu. QeMU emulates an e500 core and the board has two e200z7 cores. I 
have to set the flags individually for each one of them, and the 
-mfloat-gprs affects directly the outcome for both. In my opinion, the 
comments regarding this flag are legacy, and do not reflect newer GCC 
versions.

-- 



More information about the Gcc-help mailing list