UPGRADE YOUR BROWSER

We have detected your current browser version is not the latest one. Xilinx.com uses the latest web technologies to bring you the best online experience possible. Please upgrade to a Xilinx.com supported browser:Chrome, Firefox, Internet Explorer 11, Safari. Thank you!

cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Newbie pbar
Newbie
1,597 Views
Registered: ‎05-07-2013

Coding for FPU on MicroBlaze

Hi all,

 

I am quite new to the microblaze and systems built with XPS, so bear with me please. I know that some other threads have similar questions but I want to get a clear answer on this one.

 

I have built a system with XPS having a microblaze processor. I have enabled the extended FPU so that i could use the square root function and the conversions (int to float and float to int). I have written some code in C where it uses arithmetic functions and square roots. I know that the FPU is single precision and therefore works with floats and not doubles.

 

My question is: will normal C code, i.e. when using the +, -, *,  /, and sqrt, use the FPU automatically?

I mean if I write for example: a = b + c (all vars are floats), will it use the FPU or just use C libraries to perform the operations? Is the math.c library required to use the FPU?

 

Another quick question, what are the instructions in C to make conversions (int to float and float to int) in order to use the FPU?

 

Thanks for your patience!

Pierre.

Tags (4)
0 Kudos