x86 register bug?

Hrafnkell Eiriksson hkelle@rhi.hi.is
Thu Jun 3 18:34:00 GMT 1999


Hi

This function
void doit(char *a, char *b) {
   asm("movq %0,%%mm0\n"
       "\tmovq %1, %%mm1\n"
       "\tpaddb %%mm0,%%mm1\n"
       "\tmovq %%mm1,%1" : "=g" (*b):"g" (*a), "g" (*b) );
}                          

will produce the following asm code on x86
doit:
        pushl %ebp
        movl %esp,%ebp
        movl 8(%ebp),%edx
        movl 12(%ebp),%eax
        movq (%eax),%mm0
        movq (%edx), %mm1
        paddb %mm0,%mm1
        movq %mm1,(%edx)
        leave
        ret                                

Shouldn't the line 
movq %mm1,(%edx)
be
movq %mm1,(%eax)

I'm using 
gcc version egcs-2.91.66 19990314/Linux (egcs-1.1.2 release) 
on RedHat 6.0

TIA
  Hrafnkell
-- 
//-----------------------//-------------------------------------------------
//  Hrafnkell Eiriksson  //  Student of Computer- and Electrical engineering
//  hkelle@rhi.hi.is     //  at the Univeristy of Iceland
//  he@ieee.org          //  "Blessed are they who go around in circles,
//  Finger for PGP key   //   for they shall be known as Wheels"


More information about the Gcc-bugs mailing list