This is the mail archive of the
libc-ports@sources.redhat.com
mailing list for the libc-ports project.
Re: [parisc-linux] Re: [PATCH] Fix the atomic compare and swap
- From: "John David Anglin" <dave at hiauly1 dot hia dot nrc dot ca>
- To: aurelien at aurel32 dot net (Aurelien Jarno)
- Cc: libc-ports at sourceware dot org, parisc-linux at lists dot parisc-linux dot org
- Date: Mon, 21 May 2007 12:19:19 -0400 (EDT)
- Subject: Re: [parisc-linux] Re: [PATCH] Fix the atomic compare and swap
> Then, what about this patch?
>
> --- ports/sysdeps/unix/sysv/linux/hppa/bits/atomic.h.orig 2007-05-20 23:15:37.000000000 +0200
> +++ ports/sysdeps/unix/sysv/linux/hppa/bits/atomic.h 2007-05-20 23:15:59.000000000 +0200
> @@ -71,10 +71,10 @@
> "copy %5, %%r24 \n\t" \
> "ble " LWS "(%%sr2, %%r0) \n\t" \
> "ldi " LWS_CAS ", %%r20 \n\t" \
> + "sub %%r0, %%r21, %%r21 \n\t" \
> "cmpib,=,n " ASM_EAGAIN ",%%r21,0b \n\t" \
Hmmm, I think the original code was better since it keeps the sub
instruction outside the loop. The cmpib instruction could be modified
to negate the ASM_EAGAIN.
On the otherhand, I'm now thinking that macros like LWS, LWS_CAS and
ASM_EAGAIN shouldn't be used as they are names that could be used in
user code.
Dave
--
J. David Anglin dave.anglin@nrc-cnrc.gc.ca
National Research Council of Canada (613) 990-0752 (FAX: 952-6602)