Skip to content

Commit d8edc29

Browse files
SwapnilGaikwadkunalspathak
authored andcommitted
Add support for Sve.UnzipEven/Odd & Sve.ZipHighLow (dotnet#101294)
* Add support for Sve.UnzipEven/Odd & Sve.ZipHighLow * Rename the test template --------- Co-authored-by: Kunal Pathak <Kunal.Pathak@microsoft.com>
1 parent e93a7dc commit d8edc29

File tree

7 files changed

+996
-34
lines changed

7 files changed

+996
-34
lines changed

src/coreclr/jit/hwintrinsiccodegenarm64.cpp

+9
Original file line numberDiff line numberDiff line change
@@ -1443,6 +1443,15 @@ void CodeGen::genHWIntrinsic(GenTreeHWIntrinsic* node)
14431443
break;
14441444
}
14451445

1446+
case NI_Sve_UnzipEven:
1447+
case NI_Sve_UnzipOdd:
1448+
case NI_Sve_ZipHigh:
1449+
case NI_Sve_ZipLow:
1450+
// Use non-predicated version explicitly
1451+
GetEmitter()->emitIns_R_R_R(ins, emitSize, targetReg, op1Reg, op2Reg, opt,
1452+
INS_SCALABLE_OPTS_UNPREDICATED);
1453+
break;
1454+
14461455
default:
14471456
unreached();
14481457
}

src/coreclr/jit/hwintrinsiclistarm64sve.h

+5
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,11 @@ HARDWARE_INTRINSIC(Sve, LoadVectorUInt16ZeroExtendToUInt64,
6464
HARDWARE_INTRINSIC(Sve, LoadVectorUInt32ZeroExtendToInt64, -1, 2, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_sve_ld1w, INS_invalid, INS_invalid, INS_invalid}, HW_Category_MemoryLoad, HW_Flag_Scalable|HW_Flag_ExplicitMaskedOperation|HW_Flag_LowMaskedOperation)
6565
HARDWARE_INTRINSIC(Sve, LoadVectorUInt32ZeroExtendToUInt64, -1, 2, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_sve_ld1w, INS_invalid, INS_invalid}, HW_Category_MemoryLoad, HW_Flag_Scalable|HW_Flag_ExplicitMaskedOperation|HW_Flag_LowMaskedOperation)
6666

67+
HARDWARE_INTRINSIC(Sve, UnzipEven, -1, 2, true, {INS_sve_uzp1, INS_sve_uzp1, INS_sve_uzp1, INS_sve_uzp1, INS_sve_uzp1, INS_sve_uzp1, INS_sve_uzp1, INS_sve_uzp1, INS_sve_uzp1, INS_sve_uzp1}, HW_Category_SIMD, HW_Flag_Scalable|HW_Flag_SpecialCodeGen)
68+
HARDWARE_INTRINSIC(Sve, UnzipOdd, -1, 2, true, {INS_sve_uzp2, INS_sve_uzp2, INS_sve_uzp2, INS_sve_uzp2, INS_sve_uzp2, INS_sve_uzp2, INS_sve_uzp2, INS_sve_uzp2, INS_sve_uzp2, INS_sve_uzp2}, HW_Category_SIMD, HW_Flag_Scalable|HW_Flag_SpecialCodeGen)
69+
HARDWARE_INTRINSIC(Sve, ZipHigh, -1, 2, true, {INS_sve_zip2, INS_sve_zip2, INS_sve_zip2, INS_sve_zip2, INS_sve_zip2, INS_sve_zip2, INS_sve_zip2, INS_sve_zip2, INS_sve_zip2, INS_sve_zip2}, HW_Category_SIMD, HW_Flag_Scalable|HW_Flag_SpecialCodeGen)
70+
HARDWARE_INTRINSIC(Sve, ZipLow, -1, 2, true, {INS_sve_zip1, INS_sve_zip1, INS_sve_zip1, INS_sve_zip1, INS_sve_zip1, INS_sve_zip1, INS_sve_zip1, INS_sve_zip1, INS_sve_zip1, INS_sve_zip1}, HW_Category_SIMD, HW_Flag_Scalable|HW_Flag_SpecialCodeGen)
71+
6772

6873
// ***************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************
6974
// ISA Function name SIMD size NumArg EncodesExtraTypeArg Instructions Category Flags

src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Arm/Sve.PlatformNotSupported.cs

+255
Original file line numberDiff line numberDiff line change
@@ -806,5 +806,260 @@ internal Arm64() { }
806806
public static unsafe Vector<ulong> LoadVectorUInt32ZeroExtendToUInt64(Vector<ulong> mask, uint* address) { throw new PlatformNotSupportedException(); }
807807

808808

809+
/// UnzipEven : Concatenate even elements from two inputs
810+
811+
/// <summary>
812+
/// svint8_t svuzp1[_s8](svint8_t op1, svint8_t op2)
813+
/// </summary>
814+
public static unsafe Vector<sbyte> UnzipEven(Vector<sbyte> left, Vector<sbyte> right) { throw new PlatformNotSupportedException(); }
815+
816+
/// <summary>
817+
/// svint16_t svuzp1[_s16](svint16_t op1, svint16_t op2)
818+
/// </summary>
819+
public static unsafe Vector<short> UnzipEven(Vector<short> left, Vector<short> right) { throw new PlatformNotSupportedException(); }
820+
821+
/// <summary>
822+
/// svint32_t svuzp1[_s32](svint32_t op1, svint32_t op2)
823+
/// </summary>
824+
public static unsafe Vector<int> UnzipEven(Vector<int> left, Vector<int> right) { throw new PlatformNotSupportedException(); }
825+
826+
/// <summary>
827+
/// svint64_t svuzp1[_s64](svint64_t op1, svint64_t op2)
828+
/// </summary>
829+
public static unsafe Vector<long> UnzipEven(Vector<long> left, Vector<long> right) { throw new PlatformNotSupportedException(); }
830+
831+
/// <summary>
832+
/// svuint8_t svuzp1[_u8](svuint8_t op1, svuint8_t op2)
833+
/// svbool_t svuzp1_b8(svbool_t op1, svbool_t op2)
834+
/// </summary>
835+
public static unsafe Vector<byte> UnzipEven(Vector<byte> left, Vector<byte> right) { throw new PlatformNotSupportedException(); }
836+
837+
/// <summary>
838+
/// svuint16_t svuzp1[_u16](svuint16_t op1, svuint16_t op2)
839+
/// svbool_t svuzp1_b16(svbool_t op1, svbool_t op2)
840+
/// </summary>
841+
public static unsafe Vector<ushort> UnzipEven(Vector<ushort> left, Vector<ushort> right) { throw new PlatformNotSupportedException(); }
842+
843+
/// <summary>
844+
/// svuint32_t svuzp1[_u32](svuint32_t op1, svuint32_t op2)
845+
/// svbool_t svuzp1_b32(svbool_t op1, svbool_t op2)
846+
/// </summary>
847+
public static unsafe Vector<uint> UnzipEven(Vector<uint> left, Vector<uint> right) { throw new PlatformNotSupportedException(); }
848+
849+
/// <summary>
850+
/// svuint64_t svuzp1[_u64](svuint64_t op1, svuint64_t op2)
851+
/// svbool_t svuzp1_b64(svbool_t op1, svbool_t op2)
852+
/// </summary>
853+
public static unsafe Vector<ulong> UnzipEven(Vector<ulong> left, Vector<ulong> right) { throw new PlatformNotSupportedException(); }
854+
855+
/// <summary>
856+
/// svfloat32_t svuzp1[_f32](svfloat32_t op1, svfloat32_t op2)
857+
/// </summary>
858+
public static unsafe Vector<float> UnzipEven(Vector<float> left, Vector<float> right) { throw new PlatformNotSupportedException(); }
859+
860+
/// <summary>
861+
/// svfloat64_t svuzp1[_f64](svfloat64_t op1, svfloat64_t op2)
862+
/// </summary>
863+
public static unsafe Vector<double> UnzipEven(Vector<double> left, Vector<double> right) { throw new PlatformNotSupportedException(); }
864+
865+
866+
/// UnzipOdd : Concatenate odd elements from two inputs
867+
868+
/// <summary>
869+
/// svuint8_t svuzp2[_u8](svuint8_t op1, svuint8_t op2)
870+
/// svbool_t svuzp2_b8(svbool_t op1, svbool_t op2)
871+
/// </summary>
872+
public static unsafe Vector<byte> UnzipOdd(Vector<byte> left, Vector<byte> right) { throw new PlatformNotSupportedException(); }
873+
874+
/// <summary>
875+
/// svfloat64_t svuzp2[_f64](svfloat64_t op1, svfloat64_t op2)
876+
/// </summary>
877+
public static unsafe Vector<double> UnzipOdd(Vector<double> left, Vector<double> right) { throw new PlatformNotSupportedException(); }
878+
879+
/// <summary>
880+
/// svint16_t svuzp2[_s16](svint16_t op1, svint16_t op2)
881+
/// UZP2 Zresult.H, Zop1.H, Zop2.H
882+
/// </summary>
883+
public static unsafe Vector<short> UnzipOdd(Vector<short> left, Vector<short> right) { throw new PlatformNotSupportedException(); }
884+
885+
/// <summary>
886+
/// svint32_t svuzp2[_s32](svint32_t op1, svint32_t op2)
887+
/// </summary>
888+
public static unsafe Vector<int> UnzipOdd(Vector<int> left, Vector<int> right) { throw new PlatformNotSupportedException(); }
889+
890+
/// <summary>
891+
/// svint64_t svuzp2[_s64](svint64_t op1, svint64_t op2)
892+
/// </summary>
893+
public static unsafe Vector<long> UnzipOdd(Vector<long> left, Vector<long> right) { throw new PlatformNotSupportedException(); }
894+
895+
/// <summary>
896+
/// svint8_t svuzp2[_s8](svint8_t op1, svint8_t op2)
897+
/// </summary>
898+
public static unsafe Vector<sbyte> UnzipOdd(Vector<sbyte> left, Vector<sbyte> right) { throw new PlatformNotSupportedException(); }
899+
900+
/// <summary>
901+
/// svfloat32_t svuzp2[_f32](svfloat32_t op1, svfloat32_t op2)
902+
/// </summary>
903+
public static unsafe Vector<float> UnzipOdd(Vector<float> left, Vector<float> right) { throw new PlatformNotSupportedException(); }
904+
905+
/// <summary>
906+
/// svuint16_t svuzp2[_u16](svuint16_t op1, svuint16_t op2)
907+
/// svbool_t svuzp2_b16(svbool_t op1, svbool_t op2)
908+
/// </summary>
909+
public static unsafe Vector<ushort> UnzipOdd(Vector<ushort> left, Vector<ushort> right) { throw new PlatformNotSupportedException(); }
910+
911+
/// <summary>
912+
/// svuint32_t svuzp2[_u32](svuint32_t op1, svuint32_t op2)
913+
/// svbool_t svuzp2_b32(svbool_t op1, svbool_t op2)
914+
/// </summary>
915+
public static unsafe Vector<uint> UnzipOdd(Vector<uint> left, Vector<uint> right) { throw new PlatformNotSupportedException(); }
916+
917+
/// <summary>
918+
/// svuint64_t svuzp2[_u64](svuint64_t op1, svuint64_t op2)
919+
/// svbool_t svuzp2_b64(svbool_t op1, svbool_t op2)
920+
/// </summary>
921+
public static unsafe Vector<ulong> UnzipOdd(Vector<ulong> left, Vector<ulong> right) { throw new PlatformNotSupportedException(); }
922+
923+
924+
/// ZipHigh : Interleave elements from high halves of two inputs
925+
926+
/// <summary>
927+
/// svuint8_t svzip2[_u8](svuint8_t op1, svuint8_t op2)
928+
/// ZIP2 Zresult.B, Zop1.B, Zop2.B
929+
/// svbool_t svzip2_b8(svbool_t op1, svbool_t op2)
930+
/// ZIP2 Presult.B, Pop1.B, Pop2.B
931+
/// </summary>
932+
public static unsafe Vector<byte> ZipHigh(Vector<byte> left, Vector<byte> right) { throw new PlatformNotSupportedException(); }
933+
934+
/// <summary>
935+
/// svfloat64_t svzip2[_f64](svfloat64_t op1, svfloat64_t op2)
936+
/// ZIP2 Zresult.D, Zop1.D, Zop2.D
937+
/// </summary>
938+
public static unsafe Vector<double> ZipHigh(Vector<double> left, Vector<double> right) { throw new PlatformNotSupportedException(); }
939+
940+
/// <summary>
941+
/// svint16_t svzip2[_s16](svint16_t op1, svint16_t op2)
942+
/// ZIP2 Zresult.H, Zop1.H, Zop2.H
943+
/// </summary>
944+
public static unsafe Vector<short> ZipHigh(Vector<short> left, Vector<short> right) { throw new PlatformNotSupportedException(); }
945+
946+
/// <summary>
947+
/// svint32_t svzip2[_s32](svint32_t op1, svint32_t op2)
948+
/// ZIP2 Zresult.S, Zop1.S, Zop2.S
949+
/// </summary>
950+
public static unsafe Vector<int> ZipHigh(Vector<int> left, Vector<int> right) { throw new PlatformNotSupportedException(); }
951+
952+
/// <summary>
953+
/// svint64_t svzip2[_s64](svint64_t op1, svint64_t op2)
954+
/// ZIP2 Zresult.D, Zop1.D, Zop2.D
955+
/// </summary>
956+
public static unsafe Vector<long> ZipHigh(Vector<long> left, Vector<long> right) { throw new PlatformNotSupportedException(); }
957+
958+
/// <summary>
959+
/// svint8_t svzip2[_s8](svint8_t op1, svint8_t op2)
960+
/// ZIP2 Zresult.B, Zop1.B, Zop2.B
961+
/// </summary>
962+
public static unsafe Vector<sbyte> ZipHigh(Vector<sbyte> left, Vector<sbyte> right) { throw new PlatformNotSupportedException(); }
963+
964+
/// <summary>
965+
/// svfloat32_t svzip2[_f32](svfloat32_t op1, svfloat32_t op2)
966+
/// ZIP2 Zresult.S, Zop1.S, Zop2.S
967+
/// </summary>
968+
public static unsafe Vector<float> ZipHigh(Vector<float> left, Vector<float> right) { throw new PlatformNotSupportedException(); }
969+
970+
/// <summary>
971+
/// svuint16_t svzip2[_u16](svuint16_t op1, svuint16_t op2)
972+
/// ZIP2 Zresult.H, Zop1.H, Zop2.H
973+
/// svbool_t svzip2_b16(svbool_t op1, svbool_t op2)
974+
/// ZIP2 Presult.H, Pop1.H, Pop2.H
975+
/// </summary>
976+
public static unsafe Vector<ushort> ZipHigh(Vector<ushort> left, Vector<ushort> right) { throw new PlatformNotSupportedException(); }
977+
978+
/// <summary>
979+
/// svuint32_t svzip2[_u32](svuint32_t op1, svuint32_t op2)
980+
/// ZIP2 Zresult.S, Zop1.S, Zop2.S
981+
/// svbool_t svzip2_b32(svbool_t op1, svbool_t op2)
982+
/// ZIP2 Presult.S, Pop1.S, Pop2.S
983+
/// </summary>
984+
public static unsafe Vector<uint> ZipHigh(Vector<uint> left, Vector<uint> right) { throw new PlatformNotSupportedException(); }
985+
986+
/// <summary>
987+
/// svuint64_t svzip2[_u64](svuint64_t op1, svuint64_t op2)
988+
/// ZIP2 Zresult.D, Zop1.D, Zop2.D
989+
/// svbool_t svzip2_b64(svbool_t op1, svbool_t op2)
990+
/// ZIP2 Presult.D, Pop1.D, Pop2.D
991+
/// </summary>
992+
public static unsafe Vector<ulong> ZipHigh(Vector<ulong> left, Vector<ulong> right) { throw new PlatformNotSupportedException(); }
993+
994+
995+
/// ZipLow : Interleave elements from low halves of two inputs
996+
997+
/// <summary>
998+
/// svuint8_t svzip1[_u8](svuint8_t op1, svuint8_t op2)
999+
/// ZIP1 Zresult.B, Zop1.B, Zop2.B
1000+
/// svbool_t svzip1_b8(svbool_t op1, svbool_t op2)
1001+
/// ZIP1 Presult.B, Pop1.B, Pop2.B
1002+
/// </summary>
1003+
public static unsafe Vector<byte> ZipLow(Vector<byte> left, Vector<byte> right) { throw new PlatformNotSupportedException(); }
1004+
1005+
/// <summary>
1006+
/// svfloat64_t svzip1[_f64](svfloat64_t op1, svfloat64_t op2)
1007+
/// ZIP1 Zresult.D, Zop1.D, Zop2.D
1008+
/// </summary>
1009+
public static unsafe Vector<double> ZipLow(Vector<double> left, Vector<double> right) { throw new PlatformNotSupportedException(); }
1010+
1011+
/// <summary>
1012+
/// svint16_t svzip1[_s16](svint16_t op1, svint16_t op2)
1013+
/// ZIP1 Zresult.H, Zop1.H, Zop2.H
1014+
/// </summary>
1015+
public static unsafe Vector<short> ZipLow(Vector<short> left, Vector<short> right) { throw new PlatformNotSupportedException(); }
1016+
1017+
/// <summary>
1018+
/// svint32_t svzip1[_s32](svint32_t op1, svint32_t op2)
1019+
/// ZIP1 Zresult.S, Zop1.S, Zop2.S
1020+
/// </summary>
1021+
public static unsafe Vector<int> ZipLow(Vector<int> left, Vector<int> right) { throw new PlatformNotSupportedException(); }
1022+
1023+
/// <summary>
1024+
/// svint64_t svzip1[_s64](svint64_t op1, svint64_t op2)
1025+
/// ZIP1 Zresult.D, Zop1.D, Zop2.D
1026+
/// </summary>
1027+
public static unsafe Vector<long> ZipLow(Vector<long> left, Vector<long> right) { throw new PlatformNotSupportedException(); }
1028+
1029+
/// <summary>
1030+
/// svint8_t svzip1[_s8](svint8_t op1, svint8_t op2)
1031+
/// ZIP1 Zresult.B, Zop1.B, Zop2.B
1032+
/// </summary>
1033+
public static unsafe Vector<sbyte> ZipLow(Vector<sbyte> left, Vector<sbyte> right) { throw new PlatformNotSupportedException(); }
1034+
1035+
/// <summary>
1036+
/// svfloat32_t svzip1[_f32](svfloat32_t op1, svfloat32_t op2)
1037+
/// ZIP1 Zresult.S, Zop1.S, Zop2.S
1038+
/// </summary>
1039+
public static unsafe Vector<float> ZipLow(Vector<float> left, Vector<float> right) { throw new PlatformNotSupportedException(); }
1040+
1041+
/// <summary>
1042+
/// svuint16_t svzip1[_u16](svuint16_t op1, svuint16_t op2)
1043+
/// ZIP1 Zresult.H, Zop1.H, Zop2.H
1044+
/// svbool_t svzip1_b16(svbool_t op1, svbool_t op2)
1045+
/// ZIP1 Presult.H, Pop1.H, Pop2.H
1046+
/// </summary>
1047+
public static unsafe Vector<ushort> ZipLow(Vector<ushort> left, Vector<ushort> right) { throw new PlatformNotSupportedException(); }
1048+
1049+
/// <summary>
1050+
/// svuint32_t svzip1[_u32](svuint32_t op1, svuint32_t op2)
1051+
/// ZIP1 Zresult.S, Zop1.S, Zop2.S
1052+
/// svbool_t svzip1_b32(svbool_t op1, svbool_t op2)
1053+
/// ZIP1 Presult.S, Pop1.S, Pop2.S
1054+
/// </summary>
1055+
public static unsafe Vector<uint> ZipLow(Vector<uint> left, Vector<uint> right) { throw new PlatformNotSupportedException(); }
1056+
1057+
/// <summary>
1058+
/// svuint64_t svzip1[_u64](svuint64_t op1, svuint64_t op2)
1059+
/// ZIP1 Zresult.D, Zop1.D, Zop2.D
1060+
/// svbool_t svzip1_b64(svbool_t op1, svbool_t op2)
1061+
/// ZIP1 Presult.D, Pop1.D, Pop2.D
1062+
/// </summary>
1063+
public static unsafe Vector<ulong> ZipLow(Vector<ulong> left, Vector<ulong> right) { throw new PlatformNotSupportedException(); }
8091064
}
8101065
}

0 commit comments

Comments
 (0)