[LLVMbugs] [Bug 6664] New: llvm.atomic.load.nand poorly documented

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Sat Mar 20 17:01:09 PDT 2010


           Summary: llvm.atomic.load.nand poorly documented
           Product: libraries
           Version: trunk
          Platform: PC
        OS/Version: Windows NT
            Status: NEW
          Severity: normal
          Priority: P
         Component: Common Code Generator Code
        AssignedTo: unassignedbugs at nondot.org
        ReportedBy: eschew at gmail.com
                CC: dalej at apple.com, llvmbugs at cs.uiuc.edu

Most programmers would expect an operation called "nand" to perform ~(A & B),
but llvm.atomic.load.nand performs (A & ~B). According to ddunbar, this was
done for compatibility with gcc, but gcc has changed its behavior in version
4.4 to match the intended semantics:

To further confuse matters, example code given at
http://llvm.org/docs/LangRef.html#int_atomic_load_nand implies that
llvm.atomic.load.nand performs a traditional NAND operation, rather than (A &

It seems like either:
1) The behavior of llvm.atomic.load.nand should be changed to match GCC 4.4
(and its name), or
2) llvm.atomic.load.nand should be renamed to something like
llvm.atomic.load.andn, and the documentation updated to reflect its true

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.

More information about the llvm-bugs mailing list