Hello I'd like to recompile some projects for Tabor next coming. As described on various web sites about generating code for PowerPC SPE, I'm targeting 8540 PowerPC cpu with GCC 8.3 and present latest ADTOOLS available for OS4. Sadly I got errors from GCC using these compiling parameters: -mcpu=8640 -mtune=8540 -mspe -mabi=spe -mfloat-gprs=double
I'm compiling natively under OS4 so what's wrong? Does someone else is starting to compile for Tabor? How you did?
Support for PowerPC SPE was removed in GCC 8. From the GCC release notes:
"Support for the powerpc*-*-*spe* target ports which have been recently unmaintained and untested in GCC has been declared obsolete in GCC 8 as announced here. Unless there is activity to revive them, the next release of GCC will have their sources permanently removed."
What I do, is use an older version of GCC to compile SPE code, and then link everything with GCC 8. That way I can compile SPE optimized code, and still use GCC 8 for everything else.
Be careful with mixing C++ object files compiled with different GCC versions, as the ABI can change quite a bit between them. With C you should be fine.
This is just like television, only you can see much further.
Be careful with mixing C++ object files compiled with different GCC versions, as the ABI can change quite a bit between them. With C you should be fine.
True, that is a risk with C++.
Added to that, when mixing versions always use the newer GCC for linking. For example, if you use both GCC 7 & 8, always use GCC 8's linker.
I've been using GCC-5.5.0, which was on os4depot.net, but seems to have been overwritten recently. I think that version should be uploaded again with a different filename, as it's the last release to support SPE.
I'm not sure if any stable release of GCC 6 or 7 were ever made.
Is it really necessary to specifically target the Tabor processor for an OS4.x program to work on Tabor? If not, why bother. None of the OS4 programs I've worked on specifically target any one PPC processor.
Amiga X1000 with 2GB memory & OS 4.1FE + Radeon HD 5450
No, but any floating point heavy code will work much better when compiled for the SPE directly rather than relying on the load time emulator (LTE), or worse the exception based FPU emulation.
As the SPE ABI is not compatible with the standard SysV ABI, which passes floating point values in floating point registers (that the SPE doesn't have), it is generally recommended to separate such functions and compile only those for SPE directly.
If the code itself doesn't use floating point types but GCC is generating FPU instructions anyway (for memory copying and such) then compiling the code in question with -msoft-float might be enough (the soft-float and SPE ABIs are OTOH compatible AFAICT).
@xenic Existing programs that use floating points will be slower, from not visible to really slower, as they will require some emulation work by the OS.
With GCC 8, the support of SPE has been declared deprecated but is it possible to enable it?
Anyway, the use of SPE instructions should be restricted to the most essential and reduced part (and with much care).