-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Arm64: Add S.P.CoreLib instrinsics for AddAcross #27663
Arm64: Add S.P.CoreLib instrinsics for AddAcross #27663
Conversation
There are some merge conflicts that need to be resolved here. |
ed00c5a
to
1bec747
Compare
Rebased :) |
src/System.Private.CoreLib/shared/System/Runtime/Intrinsics/Arm/AdvSimd.PlatformNotSupported.cs
Show resolved
Hide resolved
src/System.Private.CoreLib/shared/System/Runtime/Intrinsics/Arm/AdvSimd.PlatformNotSupported.cs
Show resolved
Hide resolved
src/System.Private.CoreLib/shared/System/Runtime/Intrinsics/Arm/AdvSimd.cs
Outdated
Show resolved
Hide resolved
src/System.Private.CoreLib/shared/System/Runtime/Intrinsics/Arm/AdvSimd.cs
Outdated
Show resolved
Hide resolved
6a6c1c8
to
d9056bb
Compare
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.
@TamarChristinaArm Is there a floating-point version of the intrinsic?
src/System.Private.CoreLib/shared/System/Runtime/Intrinsics/Arm/AdvSimd.PlatformNotSupported.cs
Outdated
Show resolved
Hide resolved
Thank you for your contribution. As announced in dotnet/coreclr#27549 this repository will be moving to dotnet/runtime on November 13. If you would like to continue working on this PR after this date, the easiest way to move the change to dotnet/runtime is:
|
d9056bb
to
a639bd6
Compare
Not for |
@TamarChristinaArm, this does a sum of all elements where-as |
/// int32_t vaddvq_s32(int32x4_t a) | ||
/// A64: ADDV Sd, Vn.4S | ||
/// </summary> | ||
public static int AddAcross(Vector128<int> value) { throw new PlatformNotSupportedException(); } |
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.
There is no Vector64<int>
overload because it is equivalent to a AddPairwise
, correct?
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.
(so the manual marks size = 10, Q = 0
and size = 11, Q = 1
as reserved; with size = 11, Q = 0
as reserved because it would be a nop).
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.
Yeah, vector64<int>
would be an ADDP
, but I couldn't see anyway to encode that in the intrinsics table in hwintrinsiclistarm64.h
as it assumes you have the same instruction for all sizes of the same type unless I'm mistaken? It doesn't seem to allow overloading on the maximum vector size if the name stays the same.
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 doesn't seem to allow overloading on the maximum vector size if the name stays the same.
Right, you would need to have special-handling in codegen to ensure the right instruction was selected.
Given that the underlying instruction encoding on ADDV
is blocked and users have the same functionality via the explicit AddPairwise
, I think not exposing it is the right decision.
/// uint32_t vaddvq_u32(uint32x4_t a) | ||
/// A64: ADDV Sd, Vn.4S | ||
/// </summary> | ||
public static uint AddAcross(Vector128<uint> value) => AddAcross(value); |
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.
What is the behavior for overflow, if any?
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.
There is none, in this case you wouldn't know about it, and this instruction doesn't have a saturated version either.
Yup that's correct. |
This can be merged after @echesakovMSFT or @CarolEidt also sign-off. |
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. Thank you!
Signed-off-by: dotnet-bot <[email protected]>
Signed-off-by: dotnet-bot <[email protected]>
Signed-off-by: dotnet-bot <[email protected]>
Signed-off-by: dotnet-bot <[email protected]>
Signed-off-by: dotnet-bot <[email protected]>
Signed-off-by: dotnet-bot <[email protected]>
This implements the AddAcross intrinsics for Arm64.
AddAcross
is a sum reduction operation.See dotnet/corefx#26581 and is split of #26769
CoreFX reference assembly update at dotnet/corefx#42359
/CC @tannergooding @CarolEidt @echesakovMSFT
Thanks,
Tamar