Project Home
Project Home
Source Code
Source Code
Documents
Documents
Wiki
Wiki
Discussion Forums
Discussions
Project Information
Project Info
Forum Topic - problem with assembly code: (3 Items)
   
problem with assembly code  
#include <stdlib.h>
#include <stdio.h>

int main(int argc, char *argv[]) {

       int fx_dWord = 0;

       asm(

             "movd %0, %%xmm7;"
             :                          //output
             : "r" (fx_dWord)    //input
             : "%xmm7"

            );

      return EXIT_SUCCESS;
}

 The above code compiles with gcc 3.4.4 but not with gcc4.2.4 and gcc2.95.7

  The code above for gcc 3.4.4 and gcc 2.95.3 was tested with QNX632 and for gcc4.2.4 was tested with QNX640.

We use binutils 2.18 on both OSes

Error
-------------------------------------------------------------------------
D:/Workspace/qnx/xmmtest1/xmmtest1.c: In function 'main':

D:/Workspace/qnx/xmmtest1/xmmtest1.c:21: error: unknown register name '%xmm7' in 'asm'

cc: D:/Perforce_QNX/qnx/qssl/nto/qnx640/Trunk/host/win32/x86/usr/lib/gcc/i386-pc-nto-qnx6.4.0/4.2.4/cc1 caught signal 1
-------------------------------------------------------------------------

Help !!



Re: problem with assembly code  
Nikhil Patil wrote:
> -------------------------------------------------------------------------
> D:/Workspace/qnx/xmmtest1/xmmtest1.c: In function 'main':
> 
> D:/Workspace/qnx/xmmtest1/xmmtest1.c:21: error: unknown register name '%xmm7' in 'asm'
> 
> cc: D:/Perforce_QNX/qnx/qssl/nto/qnx640/Trunk/host/win32/x86/usr/lib/gcc/i386-pc-nto-qnx6.4.0/4.2.4/cc1 caught signal 
1

Compile with the -msse option.

Regards,

Ryan Mansfield
Re: problem with assembly code  
Thanks. problem solved