[LAD] Floating point Denormals: C++ and Waf
czhenry at gmail.com
Thu Aug 2 15:17:33 UTC 2012
On Thu, Aug 2, 2012 at 10:13 AM, Charles Henry <czhenry at gmail.com> wrote:
> On Thu, Aug 2, 2012 at 7:39 AM, Martin Homuth-Rosemann
> <linuxaudio at cryptomys.de> wrote:
>> // define an aliasing type to perform a "reinterpret cast"
>> typedef __u32 __attribute__ (( __may_alias__ )) u32bit;
>> if ( *( (u32bit*)&f ) & 0x7F000000 ) // E > 1 : normal.
> Is there a 64-bit version of the same? This appears to work with a
> 32-bit unsigned int as a pointer, meaning that it's applicable to
> 32-bits. How does a "reinterpret cast" work?
Wait... I'll answer that one myself. It's applicable to 64-bits. The
u32bit* is whatever size the address space is. So, it doesn't matter.
The reinterpret cast is making this 32-bit float into a 32-bit integer
directly without numerical conversion.
More information about the Linux-audio-dev