#include <stdint.h>
uint64_t extract_double (double x)
{
union {
double dbl;
uint64_t u;
} t;
t.dbl = x;
return t.u;
}
Compile this function with "x86_64-pc-linux-gnu-gcc -O2 -march=core2 -S a.c",
and we get the following assembly codes:
extract_double:
.LFB0:
.cfi_startproc
movd %xmm0, %rax
ret
The instruction "movd %xmm0, %rax" is nonstandard. Movd should be replaced by
movq.
(GNU assembler silently accepts it as if it were "movq %xmm0, %rax", so it
probably has caused no practical problems.)
--
Summary: x86-64: Nonstandard instruction "movd %xmm0, %rax"
Product: gcc
Version: 4.4.3
Status: UNCONFIRMED
Severity: minor
Priority: P3
Component: target
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: richardpku at gmail dot com
GCC build triplet: x86_64-linux-gnu
GCC host triplet: i686-linux-gnu
GCC target triplet: x86_64-linux-gnu
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43215