[webkit-changes] [WebKit/WebKit] 316ccf: Optimize WTF::Bitmap::forEachSetBit to use hardwar...

Commit Queue noreply at github.com
Tue Apr 4 17:46:25 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 316ccf97986993bd82c93f81585788d38faf7958
      https://github.com/WebKit/WebKit/commit/316ccf97986993bd82c93f81585788d38faf7958
  Author: David Degazio <d_degazio at apple.com>
  Date:   2023-04-04 (Tue, 04 Apr 2023)

  Changed paths:
    M Source/WTF/wtf/Bitmap.h

  Log Message:
  -----------
  Optimize WTF::Bitmap::forEachSetBit to use hardware intrinsics when available
https://bugs.webkit.org/show_bug.cgi?id=254959
rdar://107584830

Reviewed by Justin Michaud.

Changes WTF::Bitmap::forEachSetBit to use the ctz() intrinsic when it's available
and implemented in hardware. This allows the method to skip up to a word at a time
of zero bits, instead of having to visit each one, improving iteration times
especially for sparse bitmaps.

* Source/WTF/wtf/Bitmap.h:
(WTF::WordType>::forEachSetBit const):

Canonical link: https://commits.webkit.org/262602@main




More information about the webkit-changes mailing list