Reputation:
Most people seem to want to go the other way. I'm wondering if there is a fast way to convert fixed point to floating point, ideally using SSE2. Either straight C or C++ or even asm would be fine.
Upvotes: 4
Views: 3850
Reputation: 137880
It's easy as long as you have a double-precision FPU: there are 53 bits of significant figures. SSE2 has double-precision.
float conv_fx( int32_t fx ) {
double fp = fx;
fp = fp / double(1<<16); // multiplication by a constant
return fp;
}
Upvotes: 2