-
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
Add support for Sve.TransposeEven/Odd() #103068
Add support for Sve.TransposeEven/Odd() #103068
Conversation
Note regarding the
|
Note regarding the
|
Tagging subscribers to this area: @dotnet/area-system-runtime-intrinsics |
@a74nh @kunalspathak @dotnet/arm64-contrib @arch-arm64-sve |
While running stress tests with Stress test results
|
Most likely. |
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. Added few questions, before I merge.
/// svuint32_t svtrn2[_u32](svuint32_t op1, svuint32_t op2) | ||
/// TRN2 Zresult.S, Zop1.S, Zop2.S | ||
/// </summary> | ||
public static unsafe Vector<uint> TransposeOdd(Vector<uint> left, Vector<uint> right) => TransposeOdd(left, right); |
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.
Not for this PR, but wonder for these type of APIs that has predicates version, e.g. TRN1 <Pd>.<T>, <Pn>.<T>, <Pm>.<T>
, what happens when we do something like TransposeOdd(CreateTrueMask(), CreateTrueMask())
?
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.
That's interesting. As the masks are treated as regular vectors, it would act as using Vectors of 1s and 0s. I wonder if that's good enough for us while writing C# code. If someone want to operate on masks, they can just use the vector version and then use the result as a mask for the next instructions 🤔 .
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.
@a74nh - any thoughts on this? There are many APIs that fall in this category.
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.
With the code as it is, it's going to be converting to vectors, using the vector version, then converting back to mask. Which isn't ideal.
should be fairly easy to add some checks. If all inputs are all masks converted to vectors, then remove the convert to vectors. Then in codegen, if inputs are masks then use the mask versions.
We probably want an issue for this to track it. Then enable one by one.
Probably best to do this after implementing all the APIs so that we get all functionality done first.
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.
src/tests/Common/GenerateHWIntrinsicTests/GenerateHWIntrinsicTests_Arm.cs
Show resolved
Hide resolved
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
Contribute towards #99957.