Skip to content

SVE2 API for AbsoluteDifferenceAdd #115513

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

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

jacob-crawley
Copy link

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

@a74nh @kunalspathak

Dependant on #115428 being merged first

@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
Copy link
Contributor

Tagging subscribers to this area: @dotnet/area-system-runtime-intrinsics
See info in area-owners.md if you want to be subscribed.

/// 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

@kunalspathak kunalspathak added the arm-sve Work related to arm64 SVE/SVE2 support label May 13, 2025
@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_

Change-Id: Icd70d0f51c902c54c8f10aa45ea8e6e0ca4f011c
Change-Id: I1ecc680afa0d15dc701395cd83b383b1282fcdc2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
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