Welcome, Guest. Please login or register.

Author Topic: GCC asm() warning suppression options?  (Read 20096 times)

Description:

0 Members and 1 Guest are viewing this topic.

Offline x303

Re: GCC asm() warning suppression options?
« on: June 28, 2009, 01:53:33 AM »
Shouldn't you do something like this ???

__inline static unsigned long SWAP32(unsigned long a )
{
   unsigned long b;

   __asm__ ("lwbrx %0,0,%1"
           :"=r"(b)
           :"r"(&a), "m"(a));

return b;

}

x303 :D :D :D
« Last Edit: June 28, 2009, 01:57:03 AM by x303 »
 

Offline x303

Re: GCC asm() warning suppression options?
« Reply #1 on: June 28, 2009, 01:57:42 AM »
Try:

__inline static unsigned long SWAP32(unsigned long a)
{

   __asm__ ("rol.w #8,%0;swap %0;rol.w #8,%0"
            :"=d"(a):"0"(a));

   return(a);
}

x303 :D :D :D