On 11/22/2016 9:07 AM, Ilya Yaroshenko wrote:
No, LDC and GDC cannot detect it. Proof - https://godbolt.org/g/bsAFU8 . Current LDC DRuntime uses intrinsics instead of software implementation.
Consider the code: import core.bitop; int foo(int v) { return core.bitop.bsf(v); } Compiling: dmd foo.d -c obj2asm foo.obj yields: _D5bug113fooFiZi comdat bsf EAX,AL ret Meaning the bsf() intrinsic is properly detected and used.