[PATCH] D24609: [ARM] Add missing Interlocked intrinsics

Saleem Abdulrasool via cfe-commits cfe-commits at lists.llvm.org
Thu Sep 15 20:49:08 PDT 2016


compnerd added inline comments.

================
Comment at: lib/Headers/intrin.h:504
@@ +503,3 @@
+_interlockedbittestandset_acq(long volatile *_BitBase, long _BitPos) {
+  long _PrevVal = __atomic_fetch_or(_BitBase, 1l << _BitPos, __ATOMIC_ACQUIRE);
+  return (_PrevVal >> _BitPos) & 1;
----------------
Perhaps we should add static asserts that _BitPos is within limits for the signed shift.

================
Comment at: lib/Headers/intrin.h:517
@@ -501,1 +516,3 @@
+}
+#endif
 #ifdef __x86_64__
----------------
Are the names supposed to be all lower case?


https://reviews.llvm.org/D24609





More information about the cfe-commits mailing list