http://llvm.org/bugs/show_bug.cgi?id=8842

           Summary: Support for __sync_fetch_and_nand and
                    __sync_nand_and_fetch
           Product: clang
           Version: trunk
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: -New Bugs
        AssignedTo: [email protected]
        ReportedBy: [email protected]
                CC: [email protected]


Created an attachment (id=5919)
 --> (http://llvm.org/bugs/attachment.cgi?id=5919)
GCC 4.4 style __sync_fetch_and_nand and __sync_nand_and_fetch support.

Support for the atomic builtins __sync_fetch_and_nand and __sync_nand_and_fetch
was removed in commit  99522 due to inconsistencies in the GCC implementation.
Specifically, GCC versions prior to 4.4 implemented the atomic as:
    { tmp = *ptr; *ptr = ~tmp & value; return tmp; }

where as, GCC 4.4 and following implements the atomic as:
    { tmp = *ptr; *ptr = ~(tmp & value); return tmp; }

The attached patch supports __sync_fetch_and_nand through the LLVM intrinsic
function llvm.atomic.load.nand and generates GCC 4.4 style code for the atomic
__sync_nand_and_fetch.

-- 
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs

Reply via email to