Skip to content

Conversation

jacob-crawley
Copy link
Contributor

@jacob-crawley jacob-crawley commented May 13, 2025

Implements the SVE2 API for AbsoluteDifferenceAdd, along with the upper and lower widening variants.

@a74nh @kunalspathak

Dependant on #115428 being merged first

Contributes to #115479

@dotnet-policy-service dotnet-policy-service bot added the community-contribution Indicates that the PR has been added by a community member label May 13, 2025
/// svuint8_t svaba[_u8](svuint8_t op1, svuint8_t op2, svuint8_t op3)
/// UABA Ztied1.B, Zop2.B, Zop3.B
/// </summary>
public static unsafe Vector<byte> AbsoluteDifferenceAdd(Vector<byte> addend, Vector<byte> left, Vector<byte> right) { throw new PlatformNotSupportedException(); }
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

None of these are using pointers, so none need the unsafe keyword

@a74nh
Copy link
Contributor

a74nh commented May 16, 2025

Jacob, looks like this has build failures....

2025-05-14T11:17:23.8847435Z   /__w/1/s/src/coreclr/jit/hwintrinsiclistarm64sve.h:342:1: error: redefinition of enumerator 'VNF_HWI_Sve2_BitwiseClearXor'
2025-05-14T11:17:23.8851331Z     342 | HARDWARE_INTRINSIC(Sve2,          BitwiseClearXor,                                                  -1,      3,     {INS_sve_bcax,       INS_sve_bcax,       INS_sve_bcax,       INS_sve_bcax,       INS_sve_bcax,       INS_sve_bcax,       INS_sve_bcax,       INS_sve_bcax,       INS_invalid,        INS_invalid},     HW_Category_SIMD,                  HW_Flag_Scalable|HW_Flag_SpecialCodeGen|HW_Flag_HasRMWSemantics)
2025-05-14T11:17:23.8861001Z         | ^
2025-05-14T11:17:23.8861366Z   /__w/1/s/src/coreclr/jit/valuenumfuncs.h:196:112: note: expanded from macro 'HARDWARE_INTRINSIC'
2025-05-14T11:17:23.8861743Z     196 | #define HARDWARE_INTRINSIC(isa, name, size, argCount, t1, t2, t3, t4, t5, t6, t7, t8, t9, t10, category, flag) \
2025-05-14T11:17:23.8862223Z         |                                                                                                                ^
2025-05-14T11:17:23.8862479Z   /__w/1/s/src/coreclr/jit/valuenum.h:172:73: note: expanded from macro '\
2025-05-14T11:17:23.8862776Z   ValueNumFuncDef'
2025-05-14T11:17:23.8864280Z     172 | #define ValueNumFuncDef(nm, arity, commute, knownNonNull, sharedStatic) VNF_##nm,
2025-05-14T11:17:23.8876120Z         |                                                                         ^
2025-05-14T11:17:23.8877620Z   <scratch space>:143:1: note: expanded from here
2025-05-14T11:17:23.8878806Z     143 | VNF_HWI_Sve2_BitwiseClearXor
2025-05-14T11:17:23.8879445Z         | ^
2025-05-14T11:17:23.8879830Z   /__w/1/s/src/coreclr/jit/hwintrinsiclistarm64sve.h:312:1: note: previous definition is here
2025-05-14T11:17:23.8889611Z     312 | HARDWARE_INTRINSIC(Sve2,          BitwiseClearXor,                                                  -1,      3,     {INS_sve_bcax,       INS_sve_bcax,       INS_sve_bcax,       INS_sve_bcax,       INS_sve_bcax,       INS_sve_bcax,       INS_sve_bcax,       INS_sve_bcax,       INS_invalid,        INS_invalid},     HW_Category_SIMD,                  HW_Flag_Scalable|HW_Flag_SpecialCodeGen|HW_Flag_HasRMWSemantics)
2025-05-14T11:17:23.8894273Z         | ^
2025-05-14T11:17:23.8895037Z   /__w/1/s/src/coreclr/jit/valuenumfuncs.h:196:112: note: expanded from macro 'HARDWARE_INTRINSIC'
2025-05-14T11:17:23.8905671Z     196 | #define HARDWARE_INTRINSIC(isa, name, size, argCount, t1, t2, t3, t4, t5, t6, t7, t8, t9, t10, category, flag) \
2025-05-14T11:17:23.8926180Z         |                                                                                                                ^
2025-05-14T11:17:23.8926959Z   /__w/1/s/src/coreclr/jit/valuenum.h:172:73: note: expanded from macro '\
2025-05-14T11:17:23.8927814Z   ValueNumFuncDef'
2025-05-14T11:17:23.8928641Z     172 | #define ValueNumFuncDef(nm, arity, commute, knownNonNull, sharedStatic) VNF_##nm,
2025-05-14T11:17:23.8928962Z         |                                                                         ^
2025-05-14T11:17:23.8929229Z   <scratch space>:71:1: note: expanded from here
2025-05-14T11:17:23.8929861Z      71 | VNF_HWI_Sve2_BitwiseClearXor
2025-05-14T11:17:23.8930141Z         | ^
2025-05-14T11:17:24.4676298Z   2 errors generated.
2025-05-14T11:17:24.4760641Z   make[3]: *** [jit/CMakeFiles/clrjit_universal_

@kunalspathak kunalspathak added the needs-author-action An issue or pull request that requires more info or actions from the author. label Jun 2, 2025
@dotnet-policy-service dotnet-policy-service bot removed the needs-author-action An issue or pull request that requires more info or actions from the author. label Jun 3, 2025
Copy link
Contributor

@kunalspathak kunalspathak left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@kunalspathak kunalspathak enabled auto-merge (squash) June 3, 2025 14:13
@kunalspathak kunalspathak disabled auto-merge June 3, 2025 14:13
@kunalspathak
Copy link
Contributor

/ba-g failures unrelated

@kunalspathak kunalspathak merged commit 6ab0311 into dotnet:main Jun 3, 2025
146 of 157 checks passed
@github-actions github-actions bot locked and limited conversation to collaborators Jul 4, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-System.Runtime.Intrinsics arm-sve Work related to arm64 SVE/SVE2 support community-contribution Indicates that the PR has been added by a community member
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants