Using the Intel's MMX Instruction Set in gcc3.2

Ulrich Prakash
Wed Mar 5 14:49:00 GMT 2003


I tried this piece of code.

#include <mmintrin.h>

int main()
    __m64 m1 = 12;
    __m64 m2 = 24;
  __m64 m3;

   asm ("pmaddwd m1,m2\n\t");

    m3 = m1;


and tried compiling using> gcc -mmmx testmac.c
I get the foll ERROR:
/tmp/cc0rnlnq.s: Assembler messages:
/tmp/cc0rnlnq.s:18: Error: too many memory references for `pmaddwd'

though i could find nothing wrong in usage of asm ("pmaddwd m1,m2\n\t");

Please help me if I am missing something.


At 02:06 PM 3/5/03 +0100, Andrea 'fwyzard' Bocci wrote:
>At 16.32 05/03/2003 +0530, Ulrich Prakash wrote:
>>I am using gcc version3.2,which supports the MMX Instruction Set.
>>Can anyone tell me how to use this Instruction Set in my C program?
>>Is there a particular way that GCC provides to use the MMX Instruction 
>>Set directly?(If so,how?)
>>Is it through an assembly function(.s file) in which I would have to use 
>>these Instruction Sets,and  which I would have to call in my C program?
>I don't recall now, I think there should be some intrinsics for that, or 
>whatever. Have a look into the GCC manual, looking for MMX.

More information about the Gcc-help mailing list