Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Optimize TransformationMatrix inverse on ARM64 #10283

Merged

Conversation

cdumez
Copy link
Contributor

@cdumez cdumez commented Feb 17, 2023

@cdumez cdumez self-assigned this Feb 17, 2023
@cdumez cdumez added the WebCore Misc. For miscellaneous bugs in the WebCore framework (and not JavaScriptCore or WebKit). label Feb 17, 2023
@Ahmad-S792
Copy link
Contributor

@cdumez - we have old bug and I posted here about this - https://bugs.webkit.org/show_bug.cgi?id=24996

@cdumez cdumez force-pushed the 252487_TransformMatrix_inverse branch from 29601c2 to b88f551 Compare February 17, 2023 17:35
Copy link
Member

@Constellation Constellation left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

r=me

@@ -216,12 +213,129 @@ static bool inverse(const TransformationMatrix::Matrix4& matrix, TransformationM
if (fabs(det) < SMALL_NUMBER)
return false;

// Scale the adjoint matrix to get the inverse
#if CPU(ARM64) && defined(_LP64)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's use CPU(ARM64) && CPU(ADDRESS64)

@cdumez cdumez force-pushed the 252487_TransformMatrix_inverse branch from b88f551 to 19de229 Compare February 17, 2023 19:36
@cdumez cdumez added the merge-queue Applied to send a pull request to merge-queue label Feb 17, 2023
https://bugs.webkit.org/show_bug.cgi?id=252487

Reviewed by Yusuke Suzuki.

Optimize TransformationMatrix inverse on ARM64 by using SIMD.

This is a cherry-pick of:
https://chromium.googlesource.com/chromium/blink/+/7b03a53c2c7f24fb1dd79c0e7f4b7fad520875a5

I benchmarked this locally on M1 Pro with 100k matrices of random double values.
I saw a 20% speedup.

* Source/WebCore/platform/graphics/transforms/TransformationMatrix.cpp:
(WebCore::adjoint):
(WebCore::inverse):

Canonical link: https://commits.webkit.org/260468@main
@webkit-commit-queue
Copy link
Collaborator

Committed 260468@main (cf6d576): https://commits.webkit.org/260468@main

Reviewed commits have been landed. Closing PR #10283 and removing active labels.

@webkit-early-warning-system webkit-early-warning-system merged commit cf6d576 into WebKit:main Feb 17, 2023
@webkit-commit-queue webkit-commit-queue removed the merge-queue Applied to send a pull request to merge-queue label Feb 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
WebCore Misc. For miscellaneous bugs in the WebCore framework (and not JavaScriptCore or WebKit).
Projects
None yet
5 participants