06-22-2011 07:59 AM
I am running on a V4FX with an FPU and have applied the patches from Grant Likely for the FPU support on PPC405. The kernel boots and runs fine, but I'm having trouble running apps with floating point arithmetic. I realize this isn't a well supported configuration so I'm just trying to get ideas of where to look or things to try.
I use the ELDK tools and use ppc_4xx-gcc and ppc_4xxFP-gcc to compile. When using the non-floating point compiler I get the right answers, but of course the FPU isn't used. When I use the floating point compiler I get the wrong answers and if I print out the values used in the computation they are shown as though they are doubles not floats.
I am missing a compiler option to have single precision used? Even if it promotes my floats to double I should still get correct answers in the end shouldn't I? Or is that the FPU is being used and it isn't working?
How can I test if the problem is in the compiler, vs the Linux code?
06-22-2011 08:47 AM
06-24-2011 07:01 AM - edited 06-24-2011 11:33 AM
The FPU is the Xilinx IP block. I haven't tested it yet with a different OS or standalone, but that's on my todo list. I have used it before in a different design standalone and verified it was working there so I had some confidence it should be working here. I'll check that off and get back on whether it's working in this design.
The reason why I think Linux or the compiler might have something to do with it was due to seening the floats being represented as doubles. I don' t know how printf interacts to decide that the float I'm trying to print should be shown as a double. Through some library on the ramdisk? That doesn't happen through the FPU does it?
I have tested the design with the standalone BSP and the app works fine. I checked the disassembly and it used the FP function calls so I'm fairly sure the FPU is working OK.