This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: How to implement atomic swap with asm on PowerPC
- From: Andrew Haley <aph at redhat dot com>
- To: Chaoran Yang <chaoran at rice dot edu>, gcc-help <gcc-help at gcc dot gnu dot org>
- Date: Thu, 23 Apr 2015 18:06:55 +0100
- Subject: Re: How to implement atomic swap with asm on PowerPC
- Authentication-results: sourceware.org; auth=none
- References: <B50248DD-7243-4264-8281-5552DDDA4789 at rice dot edu>
On 04/23/2015 05:58 PM, Chaoran Yang wrote:
> Since I specified ptr as an input, I assume GCC should not try to reuse the register. Am I missing a constraint here? What should I do to tell GCC to not to use the same register for ldarx instruction?
Your output needs an earlyclobber. : "=&r" (old)
Andrew.