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

Arm64/SVE: Implemented ReciprocalEstimate, ReciprocalExponent, ReciprocalSqrtEstimate, ReciprocalSqrtStep, and ReciprocalStep #103673

Merged
merged 32 commits into from
Jun 21, 2024
Merged
Show file tree
Hide file tree
Changes from 27 commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
c738b77
Added ConverToInt32 and ConvertToUInt32 for float inputs.
ebepho Jun 5, 2024
35d39d9
Added flags to handle only low predicate registers.
ebepho Jun 5, 2024
7a781e1
Fixed merge conflicts.
ebepho Jun 5, 2024
1378d60
Fix whitespace
ebepho Jun 5, 2024
10c7a15
Remove special codegen flag
ebepho Jun 7, 2024
8004868
Added new test template for operations with different return types.
ebepho Jun 10, 2024
af7ccd4
Merge branch 'main' into ConvertToInt32
ebepho Jun 10, 2024
8cb76da
Add new test template.
ebepho Jun 11, 2024
abe25fc
Added api for ConvertToInt32 and ConvertToUInt 32 for double.
ebepho Jun 13, 2024
0f51f38
fix merge conflicts.
ebepho Jun 13, 2024
7fabb91
Merge branch 'dotnet:main' into main
ebepho Jun 14, 2024
d5374ca
Merge branch 'main' of github.com:ebepho/runtime
ebepho Jun 15, 2024
4aa224d
Merge branch 'main' of github.com:ebepho/runtime
ebepho Jun 15, 2024
aab2067
Finished 4/5 Round intrinsics for sve fp.
ebepho Jun 16, 2024
56601b4
Merge branch 'main' of github.com:ebepho/runtime
ebepho Jun 17, 2024
85c6284
Merge branch 'main' into reciprocal
ebepho Jun 17, 2024
4a961d6
Completed ReciprocalExponent SVE api.
ebepho Jun 17, 2024
374b217
Revert "Finished 4/5 Round intrinsics for sve fp."
ebepho Jun 17, 2024
04071a3
Merge branch 'main' of github.com:ebepho/runtime
ebepho Jun 18, 2024
79e144a
Reciprocal SVE apis - note: ReciprocalExponent still has issues.
ebepho Jun 18, 2024
7d6dd60
Merge branch 'main' into reciprocal
ebepho Jun 18, 2024
ffcd267
Merge branch 'main' of github.com:ebepho/runtime
ebepho Jun 18, 2024
14acf3c
Merge branch 'main' into reciprocal
ebepho Jun 18, 2024
c3dcabf
Completed ReciprocalExponent SVE api.
ebepho Jun 19, 2024
657e7c1
fixed naming.
ebepho Jun 19, 2024
33626b3
Merge branch 'main' of github.com:ebepho/runtime
ebepho Jun 19, 2024
e9c8325
Fixed some naming.
ebepho Jun 19, 2024
23da12f
fixed more affect function names.
ebepho Jun 19, 2024
25b156e
Fixed some more naming and retested. All stress tests pass.
ebepho Jun 21, 2024
61c3863
fixed more helper function naming.
ebepho Jun 21, 2024
da441d1
Merge branch 'main' of github.com:ebepho/runtime
ebepho Jun 21, 2024
09bd409
Merge branch 'main' into reciprocal
ebepho Jun 21, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions src/coreclr/jit/hwintrinsiclistarm64sve.h
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,11 @@ HARDWARE_INTRINSIC(Sve, PrefetchBytes,
HARDWARE_INTRINSIC(Sve, PrefetchInt16, -1, 3, false, {INS_invalid, INS_invalid, INS_invalid, INS_sve_prfh, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_MemoryLoad, HW_Flag_Scalable|HW_Flag_SpecialCodeGen|HW_Flag_ExplicitMaskedOperation|HW_Flag_LowMaskedOperation|HW_Flag_BaseTypeFromFirstArg|HW_Flag_HasImmediateOperand|HW_Flag_HasEnumOperand)
HARDWARE_INTRINSIC(Sve, PrefetchInt32, -1, 3, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_sve_prfw, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_MemoryLoad, HW_Flag_Scalable|HW_Flag_SpecialCodeGen|HW_Flag_ExplicitMaskedOperation|HW_Flag_LowMaskedOperation|HW_Flag_BaseTypeFromFirstArg|HW_Flag_HasImmediateOperand|HW_Flag_HasEnumOperand)
HARDWARE_INTRINSIC(Sve, PrefetchInt64, -1, 3, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_sve_prfd, INS_invalid, INS_invalid}, HW_Category_MemoryLoad, HW_Flag_Scalable|HW_Flag_SpecialCodeGen|HW_Flag_ExplicitMaskedOperation|HW_Flag_LowMaskedOperation|HW_Flag_BaseTypeFromFirstArg|HW_Flag_HasImmediateOperand|HW_Flag_HasEnumOperand)
HARDWARE_INTRINSIC(Sve, ReciprocalEstimate, -1, 1, true, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_sve_frecpe, INS_sve_frecpe}, HW_Category_SIMD, HW_Flag_Scalable)
HARDWARE_INTRINSIC(Sve, ReciprocalExponent, -1, -1, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_sve_frecpx, INS_sve_frecpx}, HW_Category_SIMD, HW_Flag_Scalable|HW_Flag_EmbeddedMaskedOperation|HW_Flag_LowMaskedOperation)
HARDWARE_INTRINSIC(Sve, ReciprocalSqrtEstimate, -1, 1, true, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_sve_frsqrte, INS_sve_frsqrte}, HW_Category_SIMD, HW_Flag_Scalable)
HARDWARE_INTRINSIC(Sve, ReciprocalSqrtStep, -1, 2, true, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_sve_frsqrts, INS_sve_frsqrts}, HW_Category_SIMD, HW_Flag_Scalable)
HARDWARE_INTRINSIC(Sve, ReciprocalStep, -1, 2, true, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_sve_frecps, INS_sve_frecps}, HW_Category_SIMD, HW_Flag_Scalable)
HARDWARE_INTRINSIC(Sve, ReverseElement, -1, 1, true, {INS_sve_rev, INS_sve_rev, INS_sve_rev, INS_sve_rev, INS_sve_rev, INS_sve_rev, INS_sve_rev, INS_sve_rev, INS_sve_rev, INS_sve_rev}, HW_Category_SIMD, HW_Flag_Scalable|HW_Flag_SpecialCodeGen)
HARDWARE_INTRINSIC(Sve, ReverseElement16, -1, -1, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_sve_revh, INS_sve_revh, INS_sve_revh, INS_sve_revh, INS_invalid, INS_invalid}, HW_Category_SIMD, HW_Flag_Scalable|HW_Flag_EmbeddedMaskedOperation|HW_Flag_LowMaskedOperation)
HARDWARE_INTRINSIC(Sve, ReverseElement32, -1, -1, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_sve_revw, INS_sve_revw, INS_invalid, INS_invalid}, HW_Category_SIMD, HW_Flag_Scalable|HW_Flag_EmbeddedMaskedOperation|HW_Flag_LowMaskedOperation)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4282,6 +4282,87 @@ internal Arm64() { }
public static unsafe void PrefetchInt64(Vector<ulong> mask, void* address, [ConstantExpected] SvePrefetchType prefetchType) { throw new PlatformNotSupportedException(); }


/// ReciprocalEstimate : Reciprocal estimate

/// <summary>
/// svfloat64_t svrecpe[_f64](svfloat64_t op)
/// FRECPE Zresult.D, Zop.D
/// </summary>
public static unsafe Vector<double> ReciprocalEstimate(Vector<double> value) { throw new PlatformNotSupportedException(); }

/// <summary>
/// svfloat32_t svrecpe[_f32](svfloat32_t op)
/// FRECPE Zresult.S, Zop.S
/// </summary>
public static unsafe Vector<float> ReciprocalEstimate(Vector<float> value) { throw new PlatformNotSupportedException(); }


/// ReciprocalExponent : Reciprocal exponent

/// <summary>
/// svfloat64_t svrecpx[_f64]_m(svfloat64_t inactive, svbool_t pg, svfloat64_t op)
/// FRECPX Ztied.D, Pg/M, Zop.D
/// svfloat64_t svrecpx[_f64]_x(svbool_t pg, svfloat64_t op)
/// FRECPX Ztied.D, Pg/M, Ztied.D
/// svfloat64_t svrecpx[_f64]_z(svbool_t pg, svfloat64_t op)
/// </summary>
public static unsafe Vector<double> ReciprocalExponent(Vector<double> value) { throw new PlatformNotSupportedException(); }

/// <summary>
/// svfloat32_t svrecpx[_f32]_m(svfloat32_t inactive, svbool_t pg, svfloat32_t op)
/// FRECPX Ztied.S, Pg/M, Zop.S
/// svfloat32_t svrecpx[_f32]_x(svbool_t pg, svfloat32_t op)
/// FRECPX Ztied.S, Pg/M, Ztied.S
/// svfloat32_t svrecpx[_f32]_z(svbool_t pg, svfloat32_t op)
/// </summary>
public static unsafe Vector<float> ReciprocalExponent(Vector<float> value) { throw new PlatformNotSupportedException(); }


/// ReciprocalSqrtEstimate : Reciprocal square root estimate

/// <summary>
/// svfloat64_t svrsqrte[_f64](svfloat64_t op)
/// FRSQRTE Zresult.D, Zop.D
/// </summary>
public static unsafe Vector<double> ReciprocalSqrtEstimate(Vector<double> value) { throw new PlatformNotSupportedException(); }

/// <summary>
/// svfloat32_t svrsqrte[_f32](svfloat32_t op)
/// FRSQRTE Zresult.S, Zop.S
/// </summary>
public static unsafe Vector<float> ReciprocalSqrtEstimate(Vector<float> value) { throw new PlatformNotSupportedException(); }


/// ReciprocalSqrtStep : Reciprocal square root step

/// <summary>
/// svfloat64_t svrsqrts[_f64](svfloat64_t op1, svfloat64_t op2)
/// FRSQRTS Zresult.D, Zop1.D, Zop2.D
/// </summary>
public static unsafe Vector<double> ReciprocalSqrtStep(Vector<double> left, Vector<double> right) { throw new PlatformNotSupportedException(); }

/// <summary>
/// svfloat32_t svrsqrts[_f32](svfloat32_t op1, svfloat32_t op2)
/// FRSQRTS Zresult.S, Zop1.S, Zop2.S
/// </summary>
public static unsafe Vector<float> ReciprocalSqrtStep(Vector<float> left, Vector<float> right) { throw new PlatformNotSupportedException(); }


/// ReciprocalStep : Reciprocal step

/// <summary>
/// svfloat64_t svrecps[_f64](svfloat64_t op1, svfloat64_t op2)
/// FRECPS Zresult.D, Zop1.D, Zop2.D
/// </summary>
public static unsafe Vector<double> ReciprocalStep(Vector<double> left, Vector<double> right) { throw new PlatformNotSupportedException(); }

/// <summary>
/// svfloat32_t svrecps[_f32](svfloat32_t op1, svfloat32_t op2)
/// FRECPS Zresult.S, Zop1.S, Zop2.S
/// </summary>
public static unsafe Vector<float> ReciprocalStep(Vector<float> left, Vector<float> right) { throw new PlatformNotSupportedException(); }


/// Reverse all elements

/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4336,6 +4336,88 @@ internal Arm64() { }
/// </summary>
public static unsafe void PrefetchInt64(Vector<ulong> mask, void* address, [ConstantExpected] SvePrefetchType prefetchType) => PrefetchInt64(mask, address, prefetchType);


/// ReciprocalEstimate : Reciprocal estimate

/// <summary>
/// svfloat64_t svrecpe[_f64](svfloat64_t op)
/// FRECPE Zresult.D, Zop.D
/// </summary>
public static unsafe Vector<double> ReciprocalEstimate(Vector<double> value) => ReciprocalEstimate(value);

/// <summary>
/// svfloat32_t svrecpe[_f32](svfloat32_t op)
/// FRECPE Zresult.S, Zop.S
/// </summary>
public static unsafe Vector<float> ReciprocalEstimate(Vector<float> value) => ReciprocalEstimate(value);


/// ReciprocalExponent : Reciprocal exponent

/// <summary>
/// svfloat64_t svrecpx[_f64]_m(svfloat64_t inactive, svbool_t pg, svfloat64_t op)
/// FRECPX Ztied.D, Pg/M, Zop.D
/// svfloat64_t svrecpx[_f64]_x(svbool_t pg, svfloat64_t op)
/// FRECPX Ztied.D, Pg/M, Ztied.D
/// svfloat64_t svrecpx[_f64]_z(svbool_t pg, svfloat64_t op)
/// </summary>
public static unsafe Vector<double> ReciprocalExponent(Vector<double> value) => ReciprocalExponent(value);

/// <summary>
/// svfloat32_t svrecpx[_f32]_m(svfloat32_t inactive, svbool_t pg, svfloat32_t op)
/// FRECPX Ztied.S, Pg/M, Zop.S
/// svfloat32_t svrecpx[_f32]_x(svbool_t pg, svfloat32_t op)
/// FRECPX Ztied.S, Pg/M, Ztied.S
/// svfloat32_t svrecpx[_f32]_z(svbool_t pg, svfloat32_t op)
/// </summary>
public static unsafe Vector<float> ReciprocalExponent(Vector<float> value) => ReciprocalExponent(value);


/// ReciprocalSqrtEstimate : Reciprocal square root estimate

/// <summary>
/// svfloat64_t svrsqrte[_f64](svfloat64_t op)
/// FRSQRTE Zresult.D, Zop.D
/// </summary>
public static unsafe Vector<double> ReciprocalSqrtEstimate(Vector<double> value) => ReciprocalSqrtEstimate(value);

/// <summary>
/// svfloat32_t svrsqrte[_f32](svfloat32_t op)
/// FRSQRTE Zresult.S, Zop.S
/// </summary>
public static unsafe Vector<float> ReciprocalSqrtEstimate(Vector<float> value) => ReciprocalSqrtEstimate(value);


/// ReciprocalSqrtStep : Reciprocal square root step

/// <summary>
/// svfloat64_t svrsqrts[_f64](svfloat64_t op1, svfloat64_t op2)
/// FRSQRTS Zresult.D, Zop1.D, Zop2.D
/// </summary>
public static unsafe Vector<double> ReciprocalSqrtStep(Vector<double> left, Vector<double> right) => ReciprocalSqrtStep(left, right);

/// <summary>
/// svfloat32_t svrsqrts[_f32](svfloat32_t op1, svfloat32_t op2)
/// FRSQRTS Zresult.S, Zop1.S, Zop2.S
/// </summary>
public static unsafe Vector<float> ReciprocalSqrtStep(Vector<float> left, Vector<float> right) => ReciprocalSqrtStep(left, right);


/// ReciprocalStep : Reciprocal step

/// <summary>
/// svfloat64_t svrecps[_f64](svfloat64_t op1, svfloat64_t op2)
/// FRECPS Zresult.D, Zop1.D, Zop2.D
/// </summary>
public static unsafe Vector<double> ReciprocalStep(Vector<double> left, Vector<double> right) => ReciprocalStep(left, right);

/// <summary>
/// svfloat32_t svrecps[_f32](svfloat32_t op1, svfloat32_t op2)
/// FRECPS Zresult.S, Zop1.S, Zop2.S
/// </summary>
public static unsafe Vector<float> ReciprocalStep(Vector<float> left, Vector<float> right) => ReciprocalStep(left, right);


/// Reverse all elements

/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4806,6 +4806,17 @@ internal Arm64() { }
public static unsafe void PrefetchInt32(System.Numerics.Vector<uint> mask, void* address, [ConstantExpected] SvePrefetchType prefetchType) { throw null; }
public static unsafe void PrefetchInt64(System.Numerics.Vector<ulong> mask, void* address, [ConstantExpected] SvePrefetchType prefetchType) { throw null; }

public static System.Numerics.Vector<double> ReciprocalEstimate(System.Numerics.Vector<double> value) { throw null; }
public static System.Numerics.Vector<float> ReciprocalEstimate(System.Numerics.Vector<float> value) { throw null; }
public static System.Numerics.Vector<double> ReciprocalExponent(System.Numerics.Vector<double> value) { throw null; }
public static System.Numerics.Vector<float> ReciprocalExponent(System.Numerics.Vector<float> value) { throw null; }
public static System.Numerics.Vector<double> ReciprocalSqrtEstimate(System.Numerics.Vector<double> value) { throw null; }
public static System.Numerics.Vector<float> ReciprocalSqrtEstimate(System.Numerics.Vector<float> value) { throw null; }
public static System.Numerics.Vector<double> ReciprocalSqrtStep(System.Numerics.Vector<double> left, System.Numerics.Vector<double> right) { throw null; }
public static System.Numerics.Vector<float> ReciprocalSqrtStep(System.Numerics.Vector<float> left, System.Numerics.Vector<float> right) { throw null; }
public static System.Numerics.Vector<double> ReciprocalStep(System.Numerics.Vector<double> left, System.Numerics.Vector<double> right) { throw null; }
public static System.Numerics.Vector<float> ReciprocalStep(System.Numerics.Vector<float> left, System.Numerics.Vector<float> right) { throw null; }

public static System.Numerics.Vector<byte> ReverseElement(System.Numerics.Vector<byte> value) { throw null; }
public static System.Numerics.Vector<double> ReverseElement(System.Numerics.Vector<double> value) { throw null; }
public static System.Numerics.Vector<short> ReverseElement(System.Numerics.Vector<short> value) { throw null; }
Expand Down
Loading
Loading