Hello newcomer here (be gentle),
I am attempting to write a program which has floating point code in it. However this program needs to run on 2 different processors. Which have roughly identical ISAs except for their floating point model. They use completely different instructions and registers to do floating point calculations. What would be an elegant way to get gcc to compile one section of code for 1 processor's model, and another section for the other processor's model? I already have in place a method for determining which processor the code is currently running on, so I can have it link to the corresponding code in memory.
Everything is done in C only. For the curious, I'm using powerpc e500v2 and e300 cores.
This is not a homework question, no teachers will be upset at the internet over this.