Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
Optimize TransformationMatrix::multiply() for x86_64
https://bugs.webkit.org/show_bug.cgi?id=105719 Reviewed by Sam Weinig. On x86_64, we have access to 16 XMM registers. This can hold 32 double values. We can use that in two ways to optimize matrix multiplications: -Keep the source matrix completely in registers. Write the result directly in the source matrix's memory. This avoids the memcpy at the end of the multiplication and various memory operations. -Use SIMD with SSE to perform 2 operations at a time. The parameter from the second matrix are loaded one by one in XMM registers. Loading them with SSE then shuffling the values perform worse than loading one by one. This is only enabled on 64bits as x86 only has access to 8 XMM registers and the function should be written differently. On a i5, TransformationMatrix::multiply() perform about 3 times faster with the change. * platform/graphics/transforms/TransformationMatrix.cpp: (WebCore::TransformationMatrix::multiply): * platform/graphics/transforms/TransformationMatrix.h: (TransformationMatrix): Fix an incorrect comment. Unify the comment with the cpp file. Canonical link: https://commits.webkit.org/124339@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@138866 268f45cc-cd09-0410-ab3c-d52691b4dbfc
- Loading branch information
1 parent
9b88b89
commit b79026f
Showing
3 changed files
with
162 additions
and
5 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