I currently try to write a program for the VFP unit of the iPhone using ARM assembly code. The VFP can do floatingpoint calculations, but AFAIK no integer arithmetic. However, it can convert a float to a signed integer (4 bytes). Also, according to this quickreference: http://www.voti.nl/hvu/arm/ARMquickref.pdf it seems it does not support any shifting operations
what i would like to do is to convert 4 floats of which i'm sure that each is larger than -127 and smaller than 127 into 4 signed bytes.
if i'd have shifting operations available, i could convert the float to signed integer, then shift the value by 12 bytes to the left (8 and 4 bytes for the next two values respectively) and bitwise OR all four together.
however, since shifting is not available, i need to find another way to do it. Also - i cannot use integer arithmetics (so i can't multiply the already converted integer by 2^n in order to shift but i have to work on the float instead).
Anyone knows how i could achieve that?
btw for those familar with the ARM architecture - i don't want to switch to Thumb instructions, because this is done in a loop operating on many elements and i don't want to switch between thumb and arm instructions inside this loop (since that's expensive)
additional question: how can I normalize a Vector with three elements?