Hi ,

I am using BF504F device in my application, I am trying t o implement a 5th order polynomial equation which represents my sensor output.

This polynomial will be run inside a ISR routine and the variables x and y are float type datas.. which will be called 4 times for each of my ADC channel datas thus prefer to be written as a function... the equation is as below

y = 9E-11x5 - 7E-08x4 + 2E-05x3 - 0.0021x2 + 0.1006x - 0.9639

IFor instance the function for the below equation could be

float Polynomial_equation (float x) and will be returning Y

If the code for this function is written in assembly , I assume x will be stored in R0 register.. I would like to understand how can I do a MAC operation with a float variable in R0 and at the same time round off in case of an overflow… As I couldn’t find any examples which can help me do some assembly coding using float variable…

The reason encouraging me to use .asm is that I would like to use the Hardware Loop Counter in the function.. which will not be used by the compiler if written in C.. As i remember reading in the compiler manual that float operations in a loop will not use the hardware loop counter.

I would like to get a basic understanding on how float variables will be stored in the hardware registers in this scenario.

Thanks

Hi Sijeo,

As Rai has mentioned in his reply to this post, Blackfin is a fixed point processor and does not support direct assembly instructions for floating point operations. However, there are .asm library functions available (with VDSP installation) which converts from float format to fixed point (fract16/fract32) format. The multiplication result, which would then be in fract format can be converted back to float, again using library functions. When routine for float datatype is written in C, the compiler invokes these library files, which can be verified in the disassembly window of VDSP after you build and load a simple C routine for floating point operation.

Regards,

Vineetha