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

Wesley Peck peckw at wesleypeck.com
Tue Dec 21 14:18:14 PST 2010


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) 

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>
> 

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


More information about the cfe-dev mailing list