Thread overview | |||||||
---|---|---|---|---|---|---|---|
|
March 05, 2011 [Issue 5703] New: std.intrinsic. and core.bitop.bsf, bsr and bswap should be CTFE-able | ||||
---|---|---|---|---|
| ||||
http://d.puremagic.com/issues/show_bug.cgi?id=5703 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 AssignedTo: nobody@puremagic.com ReportedBy: kennytm@gmail.com --- Comment #0 from kennytm@gmail.com 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: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- |
March 05, 2011 [Issue 5703] std.intrinsic. and core.bitop.bsf, bsr and bswap should be CTFE-able | ||||
---|---|---|---|---|
| ||||
Posted in reply to kennytm@gmail.com | http://d.puremagic.com/issues/show_bug.cgi?id=5703 kennytm@gmail.com changed: What |Removed |Added ---------------------------------------------------------------------------- Severity|normal |enhancement -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- |
March 05, 2011 [Issue 5703] std.intrinsic. and core.bitop.bsf, bsr and bswap should be CTFE-able | ||||
---|---|---|---|---|
| ||||
Posted in reply to kennytm@gmail.com | http://d.puremagic.com/issues/show_bug.cgi?id=5703 bearophile_hugs@eml.cc changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |bearophile_hugs@eml.cc --- Comment #1 from bearophile_hugs@eml.cc 2011-03-05 10:34:00 PST --- (In reply to comment #0) > These functions should be rewritten in D like bitswap and popcnt. I think they aren't functions. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- |
March 05, 2011 [Issue 5703] std.intrinsic. and core.bitop.bsf, bsr and bswap should be CTFE-able | ||||
---|---|---|---|---|
| ||||
Posted in reply to kennytm@gmail.com | http://d.puremagic.com/issues/show_bug.cgi?id=5703 --- Comment #2 from kennytm@gmail.com 2011-03-05 13:34:17 PST --- (In reply to comment #1) > (In reply to comment #0) > > > These functions should be rewritten in D like bitswap and popcnt. > > I think they aren't functions. They appear to be functions, and can easily implemented as functions too. If they are special-cased in the compiler, I see no reason they can't be recognized in CTFE as well. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- |
October 09, 2011 [Issue 5703] std.intrinsic. and core.bitop.bsf, bsr and bswap should be CTFE-able | ||||
---|---|---|---|---|
| ||||
Posted in reply to kennytm@gmail.com | http://d.puremagic.com/issues/show_bug.cgi?id=5703 Walter Bright <bugzilla@digitalmars.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED CC| |bugzilla@digitalmars.com Resolution| |FIXED --- Comment #3 from Walter Bright <bugzilla@digitalmars.com> 2011-10-08 17:54:33 PDT --- https://github.com/D-Programming-Language/dmd/commit/f8b88759dd1a27ec983eb9e439da2a45efce239c -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- |
Copyright © 1999-2021 by the D Language Foundation