• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
cmpxchgl on x86?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

cmpxchgl on x86?


  • Subject: cmpxchgl on x86?
  • From: Andrew Gallatin <email@hidden>
  • Date: Thu, 23 Jun 2005 13:11:30 -0400 (EDT)

I'm trying to compile a unix command-line program on Darwin 8.0 x86,
and I'm hitting this problem:

/var/tmp/cczbJSUe.s:1993:Can't relocate expression. Absolute 0 assumed.
/var/tmp/cczbJSUe.s:1993:operands given don't match any known 386 instruction

The code in it is complaining about is an inline cmpxchgl asm routine:

static inline uint32_t my__cmpswap_u32(uint32_t *ptr, uint32_t old, uint32_t new)
{
  asm volatile("lock cmpxchgl %1,%2" : "=a" (old) : "q" (new), "m" (*ptr),"0" (old) : "memory");
  return old;
}

This seems to happen with both gcc-4.0 and gcc-3.3
Can somebody tell me what I'm doing wrong, please?

I realize that cmpxchgl is not in the 386abi, but I'm using a P4.
I've passed -march=pentium to gcc, but to no avail.  I've even tried
saving the assembler to a temporary file and running:
       /usr/libexec/gcc/darwin/i386/as -arch pentium  foo.s
but it still complains.


Thanks,

Drew
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: cmpxchgl on x86?
      • From: Stan Shebs <email@hidden>
    • Re: cmpxchgl on x86?
      • From: Matt Watson <email@hidden>
  • Prev by Date: Re: ClamAV
  • Next by Date: Re: cmpxchgl on x86?
  • Previous by thread: Re: ClamAV
  • Next by thread: Re: cmpxchgl on x86?
  • Index(es):
    • Date
    • Thread