Fast-float (FFloat) library for 56F83xx and CW

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Fast-float (FFloat) library for 56F83xx and CW

1,398 Views
dynode
Contributor I
Hi,
 
Last fall we found that the built-in software floating point library in CodeWarrior was too slow for our robot project, and that we couldn't make controller code changes fast enough with fixed point - too many bugs.
 
So we wrote our own floating-point package in assembly, kind of like the Fast-Float for the AD Blackfin. It isn't IEEE compliant, it has a 16-bit mantissa (fraction) and 8-bit exponent. Not as much resolution, but much faster. It is written mostly in assembly for the 56F83xx, and uses instructions not recognized by the 56F80x, so probably not compatible without significant rework.
 
Below is a list of the functions so far, and processor cycle counts. (Cycle counts were done using the CW 7 software simulator, with IEEE single float and int for comparison.)  Let me know if there is any interest. I don't know how it would be made available at this point, but if enough people want to use it I'll see what I can do. If you're from Freescale, is there any chance this could be integrated in some way with CodeWarrior? The main problem with it now is that all the operations have to be done as function calls, which gets cumbersome for complicated equations. And, constants have to be pre-converted and written in hex (although macros can help).
 

Function Name     Cycle Count       float cycle count     int cycle count

FFadd                              53                        254                           6

FFsub                              64                        264                           6

FFmult                            41                         230                          8

FFdiv                              87                         335                          40

FFsin                             1061

FFcos                            1050

FFatan                            808

FFgt                                 46                        157                          18

FFgte                               46                        141                          12

FFgtz                               22

FFlt                                 46                        164                            12

FFlte                               46                         148                           12

FFltz                               22

FFeqz                             21

S16int2FFloat                   22

FFloatRnd2S16int             29

FFloatTrunc2S16int           29

S32int2FFloat                    25

U32int2FFloat                   27

IEEE2FFloat                     50

FFloat2IEEE

FFneg                               35

FFabs                               35

Labels (1)
Tags (1)
0 Kudos
1 Reply

255 Views
trytohelp
NXP Employee
NXP Employee
Hi,
 
Thanks for the feedback.
If you meet a problem with our library on the DSC because it was too slow, some other users will meet the same problem.
Can I suggest you to log this issue in the Technical Support via the web interface ?
See below for details.

For Technical Support Issues please use Freescale on line support web page.
- Go to following URL:
http://www.freescale.com/TechSupport
- Click on Submit a Service Request. You will come to a login page.
- You can submit your request through the web from there.
See below for details.
 
It would be interresting for our compiler team to have your feedback.
With a Service Request, it will be more easy for you and us to investigate the problem.
 
Thanks.
Pascal
0 Kudos