John Baldwin <[EMAIL PROTECTED]> wrote:
>Uh, there is no xaddl instruction in the x86 instruction set.

It was introduced in the '486.  I've been using it for some years now, so I
am confident of its existence.

A quick test using my example:

$ objdump -d jan.o

jan.o:     file format elf32-i386

Disassembly of section .text:

00000000 <atomic_decrement>:
   0:   55                      push   %ebp
   1:   89 e5                   mov    %esp,%ebp
   3:   8b 4d 08                mov    0x8(%ebp),%ecx
   6:   b8 ff ff ff ff          mov    $0xffffffff,%eax
   b:   f0 0f c1 01             lock xadd %eax,(%ecx)
   f:   48                      dec    %eax
  10:   c9                      leave
  11:   c3                      ret

There shouldn't be a need for a loop like the one you describe for a simple
atomic increment.

I'm pretty new to FreeBSD:  what is changing in -current which alters the
behaviour of your code?

Jan Mikkelsen




To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message

Reply via email to