[PATCH] D75723: [X86] Enable intrinsics _BitScan*

Craig Topper via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Mar 10 10:53:07 PDT 2020


craig.topper added inline comments.


================
Comment at: clang/lib/Headers/ia32intrin.h:419
+    *(a) = (unsigned)__bsfd((int)(b));                                         \
+    (unsigned char)((b) != 0);                                                 \
+  })
----------------
this evaluates (b) twice. That's bad if b is a function call with side effects


================
Comment at: clang/lib/Headers/ia32intrin.h:428
+  __extension__({                                                              \
+    *(a) = (unsigned)__bsfq((long long)(b));                                   \
+    (unsigned char)((b) != 0);                                                 \
----------------
__bsfq/__bsrq is only defined on 64-bit targets.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D75723





More information about the cfe-commits mailing list