Add VectorXx.Asin and use it to vectorize TensorPrimitives.Asin#126052
Open
stephentoub wants to merge 3 commits intodotnet:mainfrom
Open
Add VectorXx.Asin and use it to vectorize TensorPrimitives.Asin#126052stephentoub wants to merge 3 commits intodotnet:mainfrom
stephentoub wants to merge 3 commits intodotnet:mainfrom
Conversation
Contributor
|
Tagging subscribers to this area: @dotnet/area-system-runtime-intrinsics |
Contributor
There was a problem hiding this comment.
Pull request overview
This PR introduces new Vector64/128/256/512.Asin APIs and uses them to enable SIMD vectorization for TensorPrimitives.Asin, improving performance for float and double tensor workloads.
Changes:
- Add public
Asinoverloads forVector64/128/256/512(floatanddouble) and expose them in theSystem.Runtime.Intrinsicsreference assembly. - Implement vectorized
asinalgorithms inVectorMathfordoubleandfloat(float via widen-to-double polynomial evaluation). - Enable
TensorPrimitives.Asinvectorization onNET11_0_OR_GREATERand adjust test tolerance accordingly.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| src/libraries/System.Runtime.Intrinsics/ref/System.Runtime.Intrinsics.cs | Adds the new VectorXX.Asin API surface to the ref assembly. |
| src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/VectorMath.cs | Adds the core vectorized AsinDouble and AsinSingle implementations. |
| src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Vector64.cs | Implements Vector64.Asin(float/double) and scalar fallback helper. |
| src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Vector128.cs | Implements Vector128.Asin(float/double) and fallback composition. |
| src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Vector256.cs | Implements Vector256.Asin(float/double) and fallback composition. |
| src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Vector512.cs | Implements Vector512.Asin(float/double) and fallback composition. |
| src/libraries/System.Numerics.Tensors/tests/TensorPrimitives.Generic.cs | Adjusts Asin test tolerance to match other trig functions under varying FMA support. |
| src/libraries/System.Numerics.Tensors/src/System/Numerics/Tensors/netcore/TensorPrimitives.Asin.cs | Enables vectorized TensorPrimitives.Asin via VectorXX.Asin on .NET 11+. |
src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/VectorMath.cs
Show resolved
Hide resolved
src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Vector128.cs
Show resolved
Hide resolved
...braries/System.Numerics.Tensors/src/System/Numerics/Tensors/netcore/TensorPrimitives.Asin.cs
Show resolved
Hide resolved
src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/VectorMath.cs
Outdated
Show resolved
Hide resolved
src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/VectorMath.cs
Outdated
Show resolved
Hide resolved
stephentoub
added a commit
that referenced
this pull request
Mar 24, 2026
…an2, Atanh) Port AMD AOCL-LibM implementations for inverse trigonometric and hyperbolic functions to vectorized TensorPrimitives operations. Adds Vector64/128/256/512 APIs for Asinh, Acos, Acosh, Atan, Atan2, and Atanh with corresponding VectorMath implementations. Asin is handled separately in #126052. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Rename snake_case locals (poly_num, poly_deno, v_transform, v_normal) to camelCase (polyNum, polyDen, vTransform, vNormal) in AsinDouble - Reuse existing 'ax' variable instead of redundant TVectorDouble.Abs(x) calls for the ±1 and >1 boundary checks - Add AsinDouble/AsinSingle test data to GenericMathTestMemberData - Add AsinDoubleTest/AsinSingleTest to Vector64/128/256/512 test files Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Member
Author
|
@tannergooding this is the Asin support you already reviewed just extracted into its own PR. |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Separated out from #123611