-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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: Add FloatingPointExponentialAccelerator
#104649
Conversation
Note regarding the
|
Note regarding the
|
{ | ||
uint index = op1 & 0b111111; | ||
uint coeff = index switch | ||
{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These tables were copied from the ARM docs.
Tagging subscribers to this area: @dotnet/area-system-runtime-intrinsics |
Ah, I see we have the |
I tweaked the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Need to write an equivalent for double
.
{Op1BaseType} iterResult = (mask[i] != 0) ? {GetIterResult} : falseVal[i]; | ||
if (iterResult != result[i]) | ||
{RetBaseType} iterResult = (mask[i] != 0) ? {GetIterResult} : falseVal[i]; | ||
if ({ConvertFunc}(iterResult) != {ConvertFunc}(result[i])) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you please run the tests that uses the templates updated to make sure they pass?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure: The only template using this validation logic right now is SveSimpleVecOpDifferentRetTypeTest
, which is only used by the ConvertTo*
APIs (for now) and FloatingPointExponentialAccelerator
. Both are passing.
src/tests/Common/GenerateHWIntrinsicTests/GenerateHWIntrinsicTests_Arm.cs
Show resolved
Hide resolved
@@ -5262,6 +5338,82 @@ public static double MultiplyExtended(double op1, double op2) | |||
} | |||
} | |||
|
|||
public static double FPExponentialAccelerator(ulong op1) | |||
{ | |||
ulong index = op1 & 0b111111; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe you are using N == 16
in https://docsmirror.github.io/A64/2023-06/shared_pseudocode.html#impl-aarch64.FPExpA.1?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For N=32
and N=64
, the index is the first 6 bits instead of the first 5. For this helper, I got the table from the N=64
case.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Thanks!
Part of #99957. I added a new test template that will probably go away soon; in #104478, I can update the
fexpa
tests to use the same template as theConvertTo*
APIs, and add some extra templating to wrap the API's result with the appropriateBitConverter
method for theConditionalSelect
scenarios (I'm assuming theConditionalSelect
scenarios aren't testing anything interesting for this API, though).Test output:
@dotnet/arm64-contrib PTAL, thanks!