PocketMatrix forums

A read-only archive of the PocketMatrix forums (2001–2014). Posting and accounts are closed.

How do you implement fixed point data type

Hi guys

I am porting graphics code that runs on a PC over to an IPAQ. I understand there is no floating point coprocessor on the IPAQ. Therefore I need to convert my floating point stuff to fixed point stuff otherwise the performance will be poor.

Can anyone give some pointers (example code or even links) as to how this is done? Ive tried searching this forum but have had no joy yet. cheers
there is something in forum
you can check easyce functions for some functions that use it

use google to search

there's also an article on arm site about it. www.arm.com , somewhere on forum there's also a direct link to it
Here's a link to the whitepaper from ARM's website:

http://www.arm.com/armwww.nsf/img/12-Apps+Notes-Fixed+Point+Arithmetic+on+the+ARM+PDF/$File/Apps33vA.pdf?OpenElement

You might also want to investigate Intel's Graphics Performance Primitives for XScale. They have implemented fixed point math in optimized ARM assembly language:

http://www.intel.com/design/pca/applicationsprocessors/swsup/gppv1.htm
many thanks for the very helpful replies guys.
A related question.

How come when I port my code over from a PC to a PocketPC the fractional parts of floats are not recognised? ie. A float of 3.3 on my PC becomes a float of 3.0 on the PocketPC.

I was under the impression that the code should work OK on the PocketPC but would just be very slow since there is no floating point hardware.

I have a really big bit of code that uses floats and the fractional parts are very important. Is using fixed point notation the only answer? Or is there some project setting Im not aware of?
Floats should work fine - there's no CPU but the system emulates the FPU calls.

Post some code that shows the floats are broken..?
you're correct. bugs in my code