public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/43215]  New: x86-64: Nonstandard instruction "movd %xmm0, %rax"
@ 2010-03-01  2:22 richardpku at gmail dot com
  2010-03-01  9:56 ` [Bug target/43215] " ubizjak at gmail dot com
                   ` (8 more replies)
  0 siblings, 9 replies; 10+ messages in thread
From: richardpku at gmail dot com @ 2010-03-01  2:22 UTC (permalink / raw)
  To: gcc-bugs

#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


^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2010-05-03  9:01 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-03-01  2:22 [Bug target/43215] New: x86-64: Nonstandard instruction "movd %xmm0, %rax" richardpku at gmail dot com
2010-03-01  9:56 ` [Bug target/43215] " ubizjak at gmail dot com
2010-03-01 13:31 ` hjl dot tools at gmail dot com
2010-03-01 14:56 ` rguenth at gcc dot gnu dot org
2010-03-01 15:42 ` hjl dot tools at gmail dot com
2010-03-01 20:30 ` ubizjak at gmail dot com
2010-03-01 20:36 ` ubizjak at gmail dot com
2010-03-01 23:16 ` hjl dot tools at gmail dot com
2010-03-01 23:18 ` hjl dot tools at gmail dot com
2010-05-03  9:01 ` ubizjak at gmail dot com

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).