[PATCH] D86510: [compiler-rt] Fix atomic support functions on 32-bit architectures

Eli Friedman via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat Sep 5 15:14:50 PDT 2020


efriedma added a comment.

> Note: the optimized functions assume that the pointer is aligned since the argument is a uint64_t

This should be fine.



================
Comment at: compiler-rt/lib/builtins/atomic.c:126
+  (__atomic_always_lock_free(size, p) ||                                       \
+   (__atomic_always_lock_free(size, NULL) && ((uintptr_t)p & size) == 0))
+#define IS_LOCK_FREE_1(p) ATOMIC_ALWAYS_LOCK_FREE_OR_ALIGNED_LOCK_FREE(1, p)
----------------
Please use 0, not NULL.

`p & size` probably doesn't do what you want; do you mean `p % size`?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D86510



More information about the llvm-commits mailing list