[PATCH] D112400: [clang][compiler-rt][atomics] Add `__c11_atomic_fetch_nand` builtin and support `__atomic_fetch_nand` libcall

Kai Luo via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Oct 27 06:38:45 PDT 2021


lkail added inline comments.


================
Comment at: compiler-rt/lib/builtins/atomic.c:339
 
+#define ATOMIC_RMW_NAND(n, lockfree, type)                                     \
+  type __atomic_fetch_nand_##n(type *ptr, type val, int model) {               \
----------------
jyknight wrote:
> Same as ATOMIC_RMW now, isn't it?
Not totally. The `ATOMIC_RMW` macro also accept binary op sign as its argument, i.e., in the form `a op b`. However, nand is `~(a & b)`.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D112400/new/

https://reviews.llvm.org/D112400



More information about the cfe-commits mailing list