-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Accelerate WTF::equal using NEON intrinsics
https://bugs.webkit.org/show_bug.cgi?id=263734 rdar://117541948 Reviewed by Yusuke Suzuki. 1. Adds a hash check to WTF::equal(StringImpl*, StringImpl*) to quickly rule out matches (thanks @hyjorc1!). 2. Reworks the implementation of WTF::equal for LChar and UChar strings. Instead of checking for leftover bytes at the end, we use overlapping loads to reduce the amount of branching per string. And we now switch up-front on the string length instead of falling through to other branches, reducing branching for most small strings. 3. When CPU(ARM_NEON) is defined, use 16-byte SIMD chunks to do the comparison, whenever strings are large enough. 4. Also adds a SIMD loop to WTF::equal(const LChar*, const UChar*, unsigned), which is dramatically (~5x) faster than the current byte-by-byte pessimistic implementation. * Source/WTF/wtf/PlatformCPU.h: * Source/WTF/wtf/text/StringCommon.h: (WTF::equal): * Source/WTF/wtf/text/StringImpl.cpp: (WTF::equal): * Source/WTF/wtf/text/StringImpl.h: Canonical link: https://commits.webkit.org/269866@main
- Loading branch information
Showing
4 changed files
with
109 additions
and
53 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters