www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 10715] New: negated bit test (bt) not recognized by optimizer

reply d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=10715

           Summary: negated bit test (bt) not recognized by optimizer
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody puremagic.com
        ReportedBy: code dawg.eu


--- Comment #0 from Martin Nowak <code dawg.eu> 2013-07-25 16:00:35 PDT ---
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.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Jul 25 2013
next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=10715



--- Comment #1 from Walter Bright <bugzilla digitalmars.com> 2013-07-27
02:02:44 PDT ---
https://github.com/D-Programming-Language/dmd/pull/2389

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Jul 27 2013
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=10715



--- Comment #2 from github-bugzilla puremagic.com 2013-07-27 03:14:33 PDT ---
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

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Jul 27 2013
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=10715


yebblies <yebblies gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |yebblies gmail.com
         Resolution|                            |FIXED


-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Jul 27 2013
prev sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=10715



--- Comment #3 from github-bugzilla puremagic.com 2013-07-27 11:51:56 PDT ---
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

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Jul 27 2013