Skip to content

Update Matrix4x4 paths to use the new xplat intrinsics - #130192

Merged
tannergooding merged 5 commits into
dotnet:mainfrom
tannergooding:numerics-improvements
Jul 6, 2026
Merged

Update Matrix4x4 paths to use the new xplat intrinsics#130192
tannergooding merged 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.

CopilotAI 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
FileDescription
src/libraries/System.Private.CoreLib/src/System/Numerics/Matrix4x4.Impl.csMigrates 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 threadsrc/libraries/System.Private.CoreLib/src/System/Numerics/Matrix4x4.Impl.cs Outdated
Comment threadsrc/libraries/System.Private.CoreLib/src/System/Numerics/Matrix4x4.Impl.cs Outdated
Comment threadsrc/libraries/System.Private.CoreLib/src/System/Numerics/Matrix4x4.Impl.cs Outdated
CopilotAI review requested due to automatic review settings July 4, 2026 01:12

CopilotAI 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.

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

Copy link
Copy Markdown
MemberAuthor

@MihuBot

CopilotAI 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

@tannergooding
tannergooding merged commit c473d80 into dotnet:mainJul 6, 2026
141 of 144 checks passed
@tannergooding
tannergooding deleted the numerics-improvements branch July 6, 2026 12:45
@dotnet-milestone-botdotnet-milestone-botBot added this to the 11.0-preview7 milestone Jul 7, 2026
eiriktsarpalis pushed a commit that referenced this pull request Jul 15, 2026
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
@github-actionsgithub-actionsBot locked and limited conversation to collaborators Aug 7, 2026
Sign up for freeto subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

@tannergooding@eiriktsarpalis