-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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 AddSequentialAcross
#104640
Merged
Merged
Changes from 1 commit
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
9b24a75
Add AddSequentialAcross
amanasifkhalid ae18317
Skip inactive lanes
amanasifkhalid d1ad2ca
Generate mask data
amanasifkhalid c6bb59f
Tweak test validation
amanasifkhalid c3430c7
Remove CndSel scenarios
amanasifkhalid 063c142
Merge from main
amanasifkhalid File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4136,6 +4136,32 @@ public static byte AddSaturate(byte op1, byte op2) | |
return ovf ? byte.MaxValue : result; | ||
} | ||
|
||
public static double[] AddSequentialAcross(double[] op1, double[] op2) | ||
{ | ||
double[] result = new double[op1.Length]; | ||
result[0] = op1[0]; | ||
|
||
foreach (double num in op2) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This only calculates the sum for active lanes, so you need to check that as well. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Got it, fixed. |
||
{ | ||
result[0] += num; | ||
} | ||
|
||
return result; | ||
} | ||
|
||
public static float[] AddSequentialAcross(float[] op1, float[] op2) | ||
{ | ||
float[] result = new float[op1.Length]; | ||
result[0] = op1[0]; | ||
|
||
foreach (float num in op2) | ||
{ | ||
result[0] += num; | ||
} | ||
|
||
return result; | ||
} | ||
|
||
public static sbyte NegateSaturate(sbyte op1) => SubtractSaturate((sbyte)0, op1); | ||
|
||
public static sbyte SubtractSaturate(sbyte op1, sbyte op2) | ||
|
Oops, something went wrong.
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.
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.
does this test the operation with
ConditionalSelect
as well?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.
It does, using
SimpleVecOpTest_VectorValidationLogicForCndSel
andSimpleVecOpTest_VectorValidationLogicForCndSel_FalseValue
. I guess I've been getting lucky withmask[0]
being 0 for theCndSel
scenarios that skip lanes in the second op.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.
We should use
Helpers.getMask*()
to produce themask
input.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.
Got it, I tweaked the test definitions to use
getMask*
forNextValueOp1
. The only odd thing about this approach is the template forSveVecBinOpVecTest
usesNextValueOp1
for generating the mask input, and forop1
's input, so the test values forop1
are artificially constrained by this approach. I can tweak the test template to use separate template variables for these two, but lots of existing tests would need to be updated, and I don't think the value gained from doing this is all that much.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 am fine with not doing it in this PR, but can you please open an issue to update the templates to have them separate?
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 thing: #104804