This is the mail archive of the gcc-help@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]
Other format: [Raw text]

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


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