This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Obtaining the bit pattern of a floating point number
- From: Florian Weimer <fw at deneb dot enyo dot de>
- To: gcc-help at gcc dot gnu dot org
- Date: Sat, 23 May 2009 15:55:34 +0200
- Subject: Obtaining the bit pattern of a floating point number
It seems to me that x86_64 supports direct moves from XMM to
general-purpose registers, so that it's possible to access the
representation of a floating point value without going through memory:
long getbits(double src)
{
long result;
__asm__ ("movq %1, %0" : "=q" (result) : "x" (src));
return result;
}
Is this functionally available as some sort of built-in?