From: Richard Henderson <rth@twiddle.net>
To: axp-list@redhat.com
Subject: Re: GCC inline ASM is 'evil'
Date: Wed, 13 Nov 2002 22:51:50 -0800 [thread overview]
Message-ID: <20021113225150.D19573@twiddle.net> (raw)
In-Reply-To: <871y5qpawp.fsf@student.uni-tuebingen.de>; from falk.hueffner@student.uni-tuebingen.de on Wed, Nov 13, 2002 at 01:32:06AM +0100
On Wed, Nov 13, 2002 at 01:32:06AM +0100, Falk Hueffner wrote:
> You probably want something like (untested):
>
> long tmp;
> asm volatile(
> "ldl_l %2,%1\n"
> "addl %2,1,%0\n"
> "stl_c %0,%1\n"
> : "=r"(ret), "=m"(dest)
> : "r"(tmp));
tmp needs to be an output as well, since it is modified.
dest needs to be an input, since its old value isn't dead.
asm volatile (
"ldl_l %2,%1\n"
"addl %2,1,%0\n"
"stl_c %0,%1\n"
: "=r"(ret), "=m"(dest), "=r"(tmp)
: "m"(dest));
r~
next prev parent reply other threads:[~2002-11-14 6:51 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-11-13 0:04 GCC inline ASM is 'evil' Peter Petrakis
2002-11-13 0:32 ` Falk Hueffner
2002-11-14 6:51 ` Richard Henderson [this message]
2002-11-14 6:50 ` Richard Henderson
read-only archive
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox