Bug 10715 – negated bit test (bt) not recognized by optimizer

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2013-07-25T16:00:00Z
Last change time
2015-06-09T05:11:35Z
Assigned to
nobody
Creator
code

Comments

Comment #0 by code — 2013-07-25T16:00:35Z
bool bt(in uint[] ary, size_t bitnum) { return !!(ary[bitnum >> 5] & 1 << (bitnum & 31)); // uses bt } bool neg_bt(in uint[] ary, size_t bitnum) { return !(ary[bitnum >> 5] & 1 << (bitnum & 31)); // does not use bt } The bit test pattern recognition was added with https://github.com/D-Programming-Language/dmd/pull/1509. It does not work for negated bit tests though.
Comment #1 by bugzilla — 2013-07-27T02:02:44Z
Comment #2 by github-bugzilla — 2013-07-27T03:14:33Z
Commits pushed to master at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/13c01c84c4814d2da03acca1f7c2074459da6fb4 fix Issue 10715 - negated bit test (bt) not recognized by optimizer https://github.com/D-Programming-Language/dmd/commit/6619191c9a7c79df69ffd03e5a43e657b3ba9fb0 Merge pull request #2389 from WalterBright/fix10715 fix Issue 10715 - negated bit test (bt) not recognized by optimizer
Comment #3 by github-bugzilla — 2013-07-27T11:51:56Z
Commit pushed to dmd-1.x at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/f2b173e4993c5552b914a59c40824d35fd1d02ff Merge pull request #2389 from WalterBright/fix10715 fix Issue 10715 - negated bit test (bt) not recognized by optimizer