SSE testcase failure

Anders Carlsson andersca@gnome.org
Sun Jan 2 22:46:00 GMT 2005


Hello,

hoping to be a GCC contributor, I looked at why the i386-sse-7 testcase 
failed on my computer with CVS HEAD. I managed to narrow it down to the 
following test:

/* { dg-do run { target i?86-*-* x86_64-*-* } } */
/* { dg-options "-O2 -msse" } */
#include <xmmintrin.h>

typedef union {
  __m64 v;
  unsigned long long t;
}vecInWord;

vecInWord e64;
__m64 m64_64;

int main()
{
  e64.t  = 0x0123456789abcdefULL;

  m64_64 = e64.v;
}


The problem is that, when compiled to assembler I get the following code 
(I've omitted the uninteresting parts):

        movl    $-1985229329, e64
        movl    $19088743, e64+4
        movq    e64, %xmm0
        movq    %xmm0, m64_64
        leave
        ret
        .size   main, .-main
        .comm   e64,8,8
        .comm   m64_64,8,8
        .ident  "GCC: (GNU) 4.0.0 20050102 (experimental)"
        .section        .note.GNU-stack,"",@progbits

looking in the intel manuals, the xmm registers are SSE2 only which 
causes the test case to terminate with a SIGILL error on my PIII 
machine. Furthermore, the xmm registers seem to be 128-bit.

As I'm a newcomer to the gcc project I'm not sure what the correct fix 
is here, although it does seem to me that the regular mm registers 
should be used here instead, and that the xmm registers shouldn't be 
used unless -msse2 is passed to the compiler.

Any pointers and directions are very welcome :)

Regards,
Anders



More information about the Gcc mailing list