[PATCH] D25264: Implement MS _BitScan intrinsics

David Majnemer via cfe-commits cfe-commits at lists.llvm.org
Wed Oct 5 11:20:56 PDT 2016


majnemer added inline comments.


> agutowski wrote in CGBuiltin.cpp:2656-2684
> MSDN doesn't specify what should be put under the "Index" address when the argument is zero; as I checked, VS2015 with optimizations puts undefined value there, and I hope that's what I'm doing here.

Intel (https://software.intel.com/en-us/node/523362) says the following:
Sets *p to the bit index of the least significant set bit of b or leaves it unchanged if b is zero. The function returns a non-zero result when b is non-zero and returns zero when b is zero.

This seems to mesh with this Mozilla bug report: https://bugzilla.mozilla.org/show_bug.cgi?id=1182370

https://reviews.llvm.org/D25264





More information about the cfe-commits mailing list