Skip to content

Add VectorXx.Asin and use it to vectorize TensorPrimitives.Asin#126052

Open
stephentoub wants to merge 3 commits intodotnet:mainfrom
stephentoub:asinvector
Open

Add VectorXx.Asin and use it to vectorize TensorPrimitives.Asin#126052
stephentoub wants to merge 3 commits intodotnet:mainfrom
stephentoub:asinvector

Conversation

@stephentoub
Copy link
Member

Separated out from #123611

@dotnet-policy-service
Copy link
Contributor

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

Copy link
Contributor

Copilot AI left a comment

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 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 Asin overloads for Vector64/128/256/512 (float and double) and expose them in the System.Runtime.Intrinsics reference assembly.
  • Implement vectorized asin algorithms in VectorMath for double and float (float via widen-to-double polynomial evaluation).
  • Enable TensorPrimitives.Asin vectorization on NET11_0_OR_GREATER and 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+.

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>
stephentoub and others added 2 commits March 24, 2026 16:23
- 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>
@stephentoub
Copy link
Member Author

@tannergooding this is the Asin support you already reviewed just extracted into its own PR.

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