trailZeros# should probably use an intrinsic

Issue #9 new
David Feuer
created an issue

trailZeros# does a lot of its own bit fiddling. The bits-extras package (odd and provisional as it is) uses a gcc intrinsic instead to take advantage of hardware support in its implementation of trailingZeros.

Comments (1)

  1. dafis repo owner

    Wouldn't that reduce portability? One needs a chip supporting the ctzl(l) instruction. Okay, that is probably no issue on real computers, and I don't know if I care about the possibility of running on mobile phones. But one also needs a C compiler supporting that as a builtin. Sufficiently new gcc and clang do, as far as I'm aware, but what's the situation on Windows? Do you happen to know that?

  2. Log in to comment