This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Assigning registers to variables in inlines


On 09-Jan-2001, Timothy J. Wood <tjw@omnigroup.com> wrote:
> static inline unsigned int __lwbrx(register void *addr, register int 
> offset) {
>      register unsigned int word;
>      register unsigned int asm("r9") _offset = offset;
> 
>      asm("lwbrx %0,%2,%1" : "=r" (word) : "r" (addr), "r" (_offset));
>      return word;
> }
> 
> ...: parse error before `asm'

The right syntax is

	register unsigned int _offset asm("r9") = offset;

However, the solution that Jeffrey A. Law posted is a better solution.

-- 
Fergus Henderson <fjh@cs.mu.oz.au>  |  "I have always known that the pursuit
                                    |  of excellence is a lethal habit"
WWW: <http://www.cs.mu.oz.au/~fjh>  |     -- the last words of T. S. Garp.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]