Skip to content

Update Matrix4x4 paths to use the new xplat intrinsics#130192

Open
tannergooding wants to merge 5 commits into
dotnet:mainfrom
tannergooding:numerics-improvements
Open

Update Matrix4x4 paths to use the new xplat intrinsics#130192
tannergooding wants to merge 5 commits into
dotnet:mainfrom
tannergooding:numerics-improvements

Conversation

@tannergooding

Copy link
Copy Markdown
Member

This just updates the existing code paths. I plan on updating a few other code paths to start using intrinsics in general in a separate PR, as well as a more general simplification to mitigate some of the inlining required for this code.

CC. @a74nh

@dotnet-policy-service

Copy link
Copy Markdown
Contributor

Tagging subscribers to this area: @dotnet/area-system-numerics
See info in area-owners.md if you want to be subscribed.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR refactors Matrix4x4.Impl math kernels to use the newer cross-platform Vector128 APIs (and adds a Wasm SIMD path), replacing the prior ISA-specific and scalar fallback implementations.

Changes:

  • Reworked Invert to use Vector128 xplat primitives (concat/zip/unzip/shuffle + Shuffle2) instead of the SSE-only path plus scalar fallback.
  • Simplified Transpose to use Vector128.ZipLower/ZipUpper.
  • Updated GetDeterminant to use a Vector128-based implementation and introduced a Shuffle2 helper with SSE/Arm64/Wasm SIMD support.
Show a summary per file
File Description
src/libraries/System.Private.CoreLib/src/System/Numerics/Matrix4x4.Impl.cs Migrates inversion/transpose/determinant paths to xplat Vector128 intrinsics and adds a shared Shuffle2 helper (including Wasm PackedSimd).

Copilot's findings

  • Files reviewed: 1/1 changed files
  • Comments generated: 3

Comment thread src/libraries/System.Private.CoreLib/src/System/Numerics/Matrix4x4.Impl.cs Outdated
Comment thread src/libraries/System.Private.CoreLib/src/System/Numerics/Matrix4x4.Impl.cs Outdated
Comment thread src/libraries/System.Private.CoreLib/src/System/Numerics/Matrix4x4.Impl.cs Outdated
Copilot AI review requested due to automatic review settings July 4, 2026 01:12

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot's findings

  • Files reviewed: 1/1 changed files
  • Comments generated: 1

@tannergooding

This comment was marked as outdated.

@tannergooding

This comment was marked as outdated.

Copilot AI review requested due to automatic review settings July 4, 2026 03:29
@tannergooding

Copy link
Copy Markdown
Member Author

@MihuBot

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot's findings

  • Files reviewed: 1/1 changed files
  • Comments generated: 0 new

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants