Changeset 156792 in webkit


Ignore:
Timestamp:
Oct 2, 2013 1:34:30 PM (10 years ago)
Author:
commit-queue@webkit.org
Message:

Eliminate a branch in FastBitVector setAndCheck, make it vectorizable.
https://bugs.webkit.org/show_bug.cgi?id=122229

Patch by Nadav Rotem <nrotem@apple.com> on 2013-10-02
Reviewed by Geoffrey Garen.

The CPU is unlikely to predict the branch in setAndCheck. I changed the code to use conditional instructions.

  • wtf/FastBitVector.h:

(WTF::FastBitVector::setAndCheck):

Location:
trunk/Source/WTF
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WTF/ChangeLog

    r156775 r156792  
     12013-10-02  Nadav Rotem  <nrotem@apple.com>
     2
     3        Eliminate a branch in FastBitVector setAndCheck, make it vectorizable.
     4        https://bugs.webkit.org/show_bug.cgi?id=122229
     5
     6        Reviewed by Geoffrey Garen.
     7
     8        The CPU is unlikely to predict the branch in setAndCheck. I changed the code to use conditional instructions.
     9
     10        * wtf/FastBitVector.h:
     11        (WTF::FastBitVector::setAndCheck):
     12
    1132013-10-02  Anders Carlsson  <andersca@apple.com>
    214
  • trunk/Source/WTF/wtf/FastBitVector.h

    r156128 r156792  
    102102        ASSERT(m_numBits == other.m_numBits);
    103103        for (unsigned i = arrayLength(); i--;) {
    104             if (m_array[i] == other.m_array[i])
    105                 continue;
     104            changed |= m_array[i] != other.m_array[i];
    106105            m_array[i] = other.m_array[i];
    107             changed = true;
    108106        }
    109107        return changed;
Note: See TracChangeset for help on using the changeset viewer.