On 11/22/2016 10:57 AM, tsbockman wrote:
Your test fails because you aren't actually using `core.bitop`. Intrinsics are
detected based on fully qualified names. As soon as you copy `bsf()` and `bsr()`
outside of `core.bitop`, the FQN changes and they're not intrinsics anymore.
That is correct. From toir.d, this is what is detected:
"_D4core5bitop3bsfFNaNbNiNfkZi"
i.e. the fully mangled name.
Detecting any function called "bsf" would be problematic because it would
essentially add an arbitrary number of reserved words to the core language.
An alternative would be to name them with a prefix like:
__intrinsic_bsf
but I see little advantage to that over core.bitop.bsf