Re: matching constraints in asm operands question

2005-03-08 Thread Michael Matz
Hi, On Sat, 5 Mar 2005 [EMAIL PROTECTED] wrote: > > Well, I assumed the same thing when I started poking at that code, but > > then someone pointed out that it didn't actually work that way, and as > > I recall the code does in fact assume a register. I certainly would > > not object to making '

Re: matching constraints in asm operands question

2005-03-05 Thread amylaar
Quoting Jason Merrill <[EMAIL PROTECTED]>: > Well, I assumed the same thing when I started poking at that code, but then > someone pointed out that it didn't actually work that way, and as I recall > the code does in fact assume a register. I certainly would not object to > making '+' work proper

Re: matching constraints in asm operands question

2005-03-05 Thread Jason Merrill
On Sat, 5 Mar 2005 00:24:10 -0500, [EMAIL PROTECTED] wrote: >> static __inline__ void atomic_add(atomic_t *v, int i) >> { >> __asm__ __volatile__("addl %1,%0" : "+m" (*v) : "d" (i)); >> } >> >> Then the compiler complains with: >> >> /asm/atomic.h:33: warning: read-write constraint does not

Re: matching constraints in asm operands question

2005-03-04 Thread Andrew Pinski
On Mar 5, 2005, at 12:24 AM, [EMAIL PROTECTED] wrote: static __inline__ void atomic_add(atomic_t *v, int i) { __asm__ __volatile__("addl %1,%0" : "+m" (*v) : "d" (i)); } Then the compiler complains with: /asm/atomic.h:33: warning: read-write constraint does not allow a register So is the

Re: matching constraints in asm operands question

2005-03-04 Thread amylaar
> static __inline__ void atomic_add(atomic_t *v, int i) > { > __asm__ __volatile__("addl %1,%0" : "+m" (*v) : "d" (i)); > } > > Then the compiler complains with: > > /asm/atomic.h:33: warning: read-write constraint does not allow a register > > So is the warning wrong? Yes, the warning is wr

Re: matching constraints in asm operands question

2005-03-04 Thread Peter Barada
>> Ugh, in the hopes of simplifying the example, I made it somewhat trivial... >> >> static __inline__ void atomic_add(atomic_t *v, int i) >> { >> __asm__ __volatile__("addl %2,%0" : "=m" (*v) : "m" (*v), "d" (i)); >> } >> >> Is that correct? And if so, then isn't the documentation wrong?

Re: matching constraints in asm operands question

2005-03-04 Thread Richard Henderson
On Tue, Mar 01, 2005 at 11:50:04PM -0500, Peter Barada wrote: > > >> which seems to work, but I'm really concerned about the manuals > >> warning of the input and output operads being in seperate places. > >> > >> Which form is correct? > > > >static __inline__ void atomic_inc(atomic_t *v) > >{ >

Re: matching constraints in asm operands question

2005-03-02 Thread Thorsten Glaser
Andrew Pinski dixit: >> which seems to work, but I'm really concerned about the manuals >> warning of the input and output operads being in seperate places. > static __inline__ void atomic_inc(atomic_t *v) > { > __asm__ __volatile__("addql #1,%0" : "+m" (*v)); > } Hi, I have got the same p

Re: matching constraints in asm operands question

2005-03-01 Thread Peter Barada
>> which seems to work, but I'm really concerned about the manuals >> warning of the input and output operads being in seperate places. >> >> Which form is correct? > >static __inline__ void atomic_inc(atomic_t *v) >{ > __asm__ __volatile__("addql #1,%0" : "+m" (*v)); >} > >Works just fine,

Re: matching constraints in asm operands question

2005-03-01 Thread Hans-Peter Nilsson
On Tue, 1 Mar 2005, Peter Barada wrote: > > I'm trying to improve atomic operations for ColdFir ein a 2.4 kernel, and > I tried the following following the current online manual at: > http://gcc.gnu.org/onlinedocs/gcc-3.4.3/gcc/Extended-Asm.html#Extended-Asm > > static __inline__ void atomic_inc(at

Re: matching constraints in asm operands question

2005-03-01 Thread Andrew Pinski
On Mar 1, 2005, at 7:54 PM, Peter Barada wrote: which seems to work, but I'm really concerned about the manuals warning of the input and output operads being in seperate places. Which form is correct? static __inline__ void atomic_inc(atomic_t *v) { __asm__ __volatile__("addql #1,%0" : "+m"

matching constraints in asm operands question

2005-03-01 Thread Peter Barada
I'm trying to improve atomic operations for ColdFir ein a 2.4 kernel, and I tried the following following the current online manual at: http://gcc.gnu.org/onlinedocs/gcc-3.4.3/gcc/Extended-Asm.html#Extended-Asm static __inline__ void atomic_inc(atomic_t *v) { __asm__ __volatile__("addql #