[cfe-dev] [PATCH] Support for builtins __sync_fetch_and_nand and __sync_nand_and_fetch

dalej dalej at apple.com
Tue Dec 21 14:30:20 PST 2010


On Dec 21, 2010, at 2:18 PM, Wesley Peck wrote:

> As a note, I just now noticed commit 99522 which removed these operations because they are inconsistently implemented in GCC. I believe the problem is GCC before 4.4 implemented:
> 
> 	res = ~(*mem) & val
> 
> where as GCC 4.4 and after implement:
> 
> 	res = ~(*mem & val) 

Yes.  IIRC I was the one who decided to follow 4.2 in llvm even though it was, IMO, wrong; I wasn't comfortable with that choice, but incompatibility is bad too.  Since this has been disabled for 9 months without anyone complaining it should be safe to go ahead and do it right at this point.   Just MO.

> Is this still an issue? The patch that I attached implements the form used by GCC 4.4 and later for __sync_nand_and_fetch and simply lowers to the LLVM intrinsic function for __sync_fetch_and_nand.
> 
> --
> Wesley Peck
> University of Kansas
> SLDG Laboratory
> 
> On Dec 21, 2010, at 4:06 PM, Wesley Peck wrote:
> 
>> Attached is a patch that adds support for the builtin functions __sync_fetch_and_nand and __sync_nand_and_fetch. It lowers the builtins to the associated LLVM intrinsic function.
>> 
>> --
>> Wesley Peck
>> University of Kansas
>> SLDG Laboratory
>> 
>> <clang_sync_nand.patch>
>> 
> 
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20101221/50a3f055/attachment.html>


More information about the cfe-dev mailing list