Summary: std.intrinsic. and core.bitop.bsf, bsr and bswap
                    should be CTFE-able
           Product: D
           Version: D2
          Platform: Other
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: druntime

--- Comment #0 from 2011-03-05 06:20:20 PST ---
import core.bitop;
enum x = bsf(0b111100);
enum y = bsr(0b111100);
enum z = bswap(0b111100);
static assert(x == 2);
static assert(y == 5);
static assert(z == 0x3C000000);

The three functions bsr, bsf and bswap are pure nothrow, but cannot be used in
CTFE because there is no source code.

These functions should be rewritten in D like bitswap and popcnt.

Configure issuemail:
------- You are receiving this mail because: -------

Reply via email to