Page 1 of 1

Floating/fixed point optimization

PostPosted: Apr 18, 2006 @ 9:34am
by russose
Hallo,

To improve the performance of Blender for PocketPC, I am thinking to convert some floating point operations in fixed point.

Of course, I cannot convert everything in Blender. So I will focus on a library making matrix/vector/scalar arithmetic. But I need to keep interfaces in floating point to be sure that there will be no problem with the Blender source code.
I can do for each function:
1) Convert input from floating to fixed point
2) Make the computation in fixed point
3) Convert output back from fixed point to floating point.

Do you think that there will be still an improvement even with these numerous conversions? Or do you think that there is a better approach way to make it?

Thanks for your help,
Salvatore

PostPosted: Apr 19, 2006 @ 4:46pm
by Dan East

PostPosted: Apr 19, 2006 @ 6:05pm
by Digby
You don't need to use a floating point operation to do the conversion to/from fixed point. It can be done with some shifts, masks, and integer subtraction.

I wrote something to do this over a year ago. If you like I can try to locate the code for you. I came up with this on my own by looking at the IEEE 754 format, but I'm sure it's on the web somewhere.

PostPosted: Apr 20, 2006 @ 5:22pm
by russose

PostPosted: Apr 20, 2006 @ 9:26pm
by StephC

PostPosted: Apr 24, 2006 @ 11:12pm
by Digby

PostPosted: Apr 27, 2006 @ 12:19pm
by russose
Thanks Digby for these precious informations.

Given my knowledge and the complexity of the Blender code, it would not be serious that I begin to convert it in Fixed Point. I will have no chance to succeed. The only chance I have is to keep the changes local to 1 or 2 math libraries keeping the interfaces as they are.

Following your tests, it seems that the operations will be 5* faster. That's quite good :=) But then, as you mentioned, I really have to be sure that the fixed point approximation will not make big problems... As soon as I will more time for that, I will just try and see! I will also try to have from the Blender Team more information about the part of the code that really should be optimized.

Thank you for your information,
Salvatore

PostPosted: May 1, 2006 @ 2:11pm
by hm

PostPosted: May 1, 2006 @ 5:58pm
by jaguard

PostPosted: May 4, 2006 @ 9:33am
by russose