-
Notifications
You must be signed in to change notification settings - Fork 5.3k
Implement SVE2 Xor, XorRotateRight #115891
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
Changes from 1 commit
7f11032
c5220e3
62d43dd
f1e7524
53c2201
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -552,6 +552,11 @@ void HWIntrinsicInfo::lookupImmBounds( | |
| immUpperBound = 7; | ||
| break; | ||
|
|
||
| case NI_Sve2_XorRotateRight: | ||
| immLowerBound = 1; | ||
| immUpperBound = genTypeSize(baseType) * BITS_PER_BYTE; | ||
| break; | ||
|
||
|
|
||
| default: | ||
| unreached(); | ||
| } | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -311,7 +311,9 @@ HARDWARE_INTRINSIC(Sve, ZipLow, | |
| #define FIRST_NI_Sve2 NI_Sve2_BitwiseClearXor | ||
| 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) | ||
| HARDWARE_INTRINSIC(Sve2, ShiftLeftAndInsert, -1, 3, {INS_sve_sli, INS_sve_sli, INS_sve_sli, INS_sve_sli, INS_sve_sli, INS_sve_sli, INS_sve_sli, INS_sve_sli, INS_invalid, INS_invalid}, HW_Category_ShiftLeftByImmediate, HW_Flag_Scalable|HW_Flag_HasImmediateOperand|HW_Flag_HasRMWSemantics) | ||
| #define LAST_NI_Sve2 NI_Sve2_ShiftLeftAndInsert | ||
| HARDWARE_INTRINSIC(Sve2, Xor, -1, 3, {INS_sve_eor3, INS_sve_eor3, INS_sve_eor3, INS_sve_eor3, INS_sve_eor3, INS_sve_eor3, INS_sve_eor3, INS_sve_eor3, INS_invalid, INS_invalid}, HW_Category_SIMD, HW_Flag_Scalable|HW_Flag_SpecialCodeGen|HW_Flag_HasRMWSemantics) | ||
|
Contributor
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. remind me, but why we need
Contributor
Author
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. It's because the instruction only accepts a D lane arrangement but the intrinsic attempts to pass B/H/S based on the BaseJitType. As it's bitwise it's OK to override it. Maybe this could be generalized later with more flags to deal with a fixed lane arrangement, or the emitter could just be modified to be smarter about the options passed in. We'd need more space for flags if we wanted to go down the first route. For now I've just used SpecialCodeGen. |
||
| HARDWARE_INTRINSIC(Sve2, XorRotateRight, -1, 3, {INS_sve_xar, INS_sve_xar, INS_sve_xar, INS_sve_xar, INS_sve_xar, INS_sve_xar, INS_sve_xar, INS_sve_xar, INS_invalid, INS_invalid}, HW_Category_RotateByImmediate, HW_Flag_Scalable|HW_Flag_HasRMWSemantics|HW_Flag_HasImmediateOperand) | ||
| #define LAST_NI_Sve2 NI_Sve2_XorRotateRight | ||
|
|
||
| // *************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************** | ||
| // ISA Function name SIMD size NumArg Instructions Category Flags | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -3758,7 +3758,7 @@ void Lowering::ContainCheckHWIntrinsic(GenTreeHWIntrinsic* node) | |
| const bool hasImmediateOperand = HWIntrinsicInfo::HasImmediateOperand(intrin.id); | ||
|
|
||
| if ((intrin.category == HW_Category_ShiftLeftByImmediate) || | ||
| (intrin.category == HW_Category_ShiftRightByImmediate) || | ||
| (intrin.category == HW_Category_ShiftRightByImmediate) || (intrin.category == HW_Category_RotateByImmediate) || | ||
| ((intrin.category == HW_Category_SIMDByIndexedElement) && hasImmediateOperand)) | ||
| { | ||
| switch (intrin.numOperands) | ||
|
|
@@ -3828,6 +3828,7 @@ void Lowering::ContainCheckHWIntrinsic(GenTreeHWIntrinsic* node) | |
| case NI_Sve_AddRotateComplex: | ||
| case NI_Sve_TrigonometricMultiplyAddCoefficient: | ||
| case NI_Sve2_ShiftLeftAndInsert: | ||
| case NI_Sve2_XorRotateRight: | ||
|
||
| assert(hasImmediateOperand); | ||
| assert(varTypeIsIntegral(intrin.op3)); | ||
| if (intrin.op3->IsCnsIntOrI()) | ||
|
|
||
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.
Why can't we just use
HW_Category_ShiftRightByImmediate?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 was trying to differentiate the two types of modifier from the start, just in case they do need to be handled differently in future. I'm not sure if they will though, they are very similar.
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.
let's introduce the new flag when there is a need. For now, just reuse
HW_Category_ShiftRightByImmediate