[LLVMdev] clan -x assembler fails on vcvttsd2siq instruction

片山 伸彦 nobu.katayama at ipmu.jp
Sun Jul 15 16:33:57 PDT 2012


Dear llvm developers,

I am trying to run clang assembler to use avx instructions on Mac.

I use gcc 4.7.1 to generate  .s files from .c files. I can assemble foo.s by

clang -c -x assembler foo.s

to get foo.o but

clang -c -x assembler foo_long.s

fails with

$clang -x assembler foo_long.s 
foo_long.s:27:2: error: invalid instruction mnemonic 'vcvttsd2siq'
        vcvttsd2siq     %xmm0, %rax
        ^~~~~~~~~~~

clang can assemble many other .s files with avx instructions.  I tried the default clang, clang+llvm 3.1 binary and svn checked out llvm/clang. All same.

Have you any idea?


Thank you so much!

Nobu

Nobu Katayama
nobu.katayama at ipmu.jp

foo.c

void foo(int *a, double *b, int n){
   int i;
   for (i=0; i<8*n; i++){
      a[i] = b[i];
   }
}

foo_long.c

void foo(long *a, double *b, int n){
   int i;
   for (i=0; i<8*n; i++){
      a[i] = b[i];
   }
}

diff foo.s foo_long.s
17c17
< 	leaq	0(,%rax,4), %rdx
---
> 	leaq	0(,%rax,8), %rdx
27,28c27,28
< 	vcvttsd2si	%xmm0, %eax
< 	movl	%eax, (%rdx)
---
> 	vcvttsd2siq	%xmm0, %rax
> 	movq	%rax, (%rdx)






More information about the llvm-dev mailing list