This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Inline ASM Function
- From: "Jim Gifford" <jim at jg555 dot com>
- To: gcc-help at gcc dot gnu dot org
- Date: Tue, 7 Oct 2003 23:27:10 -0700
- Subject: Inline ASM Function
Any suggestions out there.
errors as constraint error in 'asm'
inline jlong atomic::compare_and_exchange_long(jlong exchange_value, jlong*
dest, jlong compare_value) {
jlong old_value;
__asm__ volatile ( "pushl %%ebx;mov 4+%1,%%ecx;mov
%1,%%ebx;lock;cmpxchg8b (%3);popl %%ebx"
: "=A" (old_value)
: "o" (exchange_value), "A" (compare_value), "r" (dest)
: "%ebx", "%ecx", "memory");
return old_value;
}
----
Jim Gifford
jim@jg555.com
giffordj@linkline.com