cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
thatwackyguy
Visitor
Visitor
2,853 Views
Registered: ‎06-29-2010

Single Precision Floating Point Operations

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?

0 Kudos
Reply
2 Replies
austin
Scholar
Scholar
2,850 Views
Registered: ‎02-27-2008

t,

Whose FPU ip core are you using? The FPU in any case, is implemented by the FPGA fabric (DFF, LUT, DSP48), so the FPU has nothing to do with the compiler, or Linux: it is 'hardware' which means it may not meet timing, it may not be optioned properly before it was 'built,' it may be a faulty design (not a Xilinx IP core) and so on....
Austin Lesea
Principal Engineer
Xilinx San Jose
0 Kudos
Reply
thatwackyguy
Visitor
Visitor
2,843 Views
Registered: ‎06-29-2010

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?

 

Update:

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.

 

0 Kudos
Reply