From 603dc39e0af37d7effae2dabf018aa8c8ef821a0 Mon Sep 17 00:00:00 2001 From: Tanner Gooding Date: Wed, 15 May 2024 21:45:43 -0700 Subject: [PATCH 1/9] Change Vector4 to be implemented entirely in managed --- src/coreclr/jit/fgbasic.cpp | 7 - src/coreclr/jit/hwintrinsicarm64.cpp | 1 - src/coreclr/jit/hwintrinsiclistarm64.h | 1 - src/coreclr/jit/hwintrinsiclistxarch.h | 1 - src/coreclr/jit/hwintrinsicxarch.cpp | 1 - src/coreclr/jit/simdashwintrinsic.cpp | 70 ------ src/coreclr/jit/simdashwintrinsiclistarm64.h | 43 ---- src/coreclr/jit/simdashwintrinsiclistxarch.h | 43 ---- .../src/System/Numerics/Vector4.Extensions.cs | 19 +- .../src/System/Numerics/Vector4.cs | 203 +++--------------- .../System/Runtime/Intrinsics/Vector128.cs | 6 +- 11 files changed, 39 insertions(+), 356 deletions(-) diff --git a/src/coreclr/jit/fgbasic.cpp b/src/coreclr/jit/fgbasic.cpp index 18666aba5630a3..bdf3770094d812 100644 --- a/src/coreclr/jit/fgbasic.cpp +++ b/src/coreclr/jit/fgbasic.cpp @@ -1400,10 +1400,6 @@ void Compiler::fgFindJumpTargets(const BYTE* codeAddr, IL_OFFSET codeSize, Fixed case NI_Vector3_Create: case NI_Vector3_CreateBroadcast: case NI_Vector3_CreateFromVector2: - case NI_Vector4_Create: - case NI_Vector4_CreateBroadcast: - case NI_Vector4_CreateFromVector2: - case NI_Vector4_CreateFromVector3: case NI_Vector128_Create: case NI_Vector128_CreateScalar: case NI_Vector128_CreateScalarUnsafe: @@ -1660,7 +1656,6 @@ void Compiler::fgFindJumpTargets(const BYTE* codeAddr, IL_OFFSET codeSize, Fixed case NI_Vector128_AsUInt16: case NI_Vector128_AsUInt32: case NI_Vector128_AsUInt64: - case NI_Vector128_AsVector4: case NI_Vector128_op_UnaryPlus: case NI_VectorT_As: case NI_VectorT_AsVectorByte: @@ -1730,8 +1725,6 @@ void Compiler::fgFindJumpTargets(const BYTE* codeAddr, IL_OFFSET codeSize, Fixed case NI_Vector2_get_Zero: case NI_Vector3_get_One: case NI_Vector3_get_Zero: - case NI_Vector4_get_One: - case NI_Vector4_get_Zero: case NI_Vector128_get_AllBitsSet: case NI_Vector128_get_One: case NI_Vector128_get_Zero: diff --git a/src/coreclr/jit/hwintrinsicarm64.cpp b/src/coreclr/jit/hwintrinsicarm64.cpp index 4fb3716d9cdf6b..7091882f8d6318 100644 --- a/src/coreclr/jit/hwintrinsicarm64.cpp +++ b/src/coreclr/jit/hwintrinsicarm64.cpp @@ -590,7 +590,6 @@ GenTree* Compiler::impSpecialIntrinsic(NamedIntrinsic intrinsic, case NI_Vector128_AsUInt32: case NI_Vector128_AsUInt64: case NI_Vector128_AsVector: - case NI_Vector128_AsVector4: { assert(!sig->hasThis()); assert(numArgs == 1); diff --git a/src/coreclr/jit/hwintrinsiclistarm64.h b/src/coreclr/jit/hwintrinsiclistarm64.h index 057b2cf0c8023c..48cda1aad4f78e 100644 --- a/src/coreclr/jit/hwintrinsiclistarm64.h +++ b/src/coreclr/jit/hwintrinsiclistarm64.h @@ -142,7 +142,6 @@ HARDWARE_INTRINSIC(Vector128, AsUInt64, HARDWARE_INTRINSIC(Vector128, AsVector, 16, 1, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId|HW_Flag_BaseTypeFromFirstArg) HARDWARE_INTRINSIC(Vector128, AsVector2, 16, 1, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId|HW_Flag_BaseTypeFromFirstArg) HARDWARE_INTRINSIC(Vector128, AsVector3, 16, 1, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_mov, INS_invalid}, HW_Category_SIMD, HW_Flag_BaseTypeFromFirstArg|HW_Flag_SpecialCodeGen|HW_Flag_SpecialImport) -HARDWARE_INTRINSIC(Vector128, AsVector4, 16, 1, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId|HW_Flag_BaseTypeFromFirstArg) HARDWARE_INTRINSIC(Vector128, AsVector128, -1, 1, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId|HW_Flag_BaseTypeFromFirstArg) HARDWARE_INTRINSIC(Vector128, BitwiseAnd, 16, 2, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId) HARDWARE_INTRINSIC(Vector128, BitwiseOr, 16, 2, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId) diff --git a/src/coreclr/jit/hwintrinsiclistxarch.h b/src/coreclr/jit/hwintrinsiclistxarch.h index a726cd624dcfd5..acbb4f51781cc4 100644 --- a/src/coreclr/jit/hwintrinsiclistxarch.h +++ b/src/coreclr/jit/hwintrinsiclistxarch.h @@ -48,7 +48,6 @@ HARDWARE_INTRINSIC(Vector128, AsUInt64, HARDWARE_INTRINSIC(Vector128, AsVector, 16, 1, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId|HW_Flag_BaseTypeFromFirstArg) HARDWARE_INTRINSIC(Vector128, AsVector2, 16, 1, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_movsd_simd, INS_invalid}, HW_Category_SimpleSIMD, HW_Flag_SpecialImport|HW_Flag_BaseTypeFromFirstArg|HW_Flag_SpecialCodeGen) HARDWARE_INTRINSIC(Vector128, AsVector3, 16, 1, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_movups, INS_invalid}, HW_Category_SimpleSIMD, HW_Flag_SpecialImport|HW_Flag_BaseTypeFromFirstArg|HW_Flag_SpecialCodeGen) -HARDWARE_INTRINSIC(Vector128, AsVector4, 16, 1, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId|HW_Flag_BaseTypeFromFirstArg) HARDWARE_INTRINSIC(Vector128, AsVector128, -1, 1, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId|HW_Flag_BaseTypeFromFirstArg) HARDWARE_INTRINSIC(Vector128, BitwiseAnd, 16, 2, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId) HARDWARE_INTRINSIC(Vector128, BitwiseOr, 16, 2, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId) diff --git a/src/coreclr/jit/hwintrinsicxarch.cpp b/src/coreclr/jit/hwintrinsicxarch.cpp index 603d98cef20ecf..e8eb9c4b2d6cda 100644 --- a/src/coreclr/jit/hwintrinsicxarch.cpp +++ b/src/coreclr/jit/hwintrinsicxarch.cpp @@ -1052,7 +1052,6 @@ GenTree* Compiler::impSpecialIntrinsic(NamedIntrinsic intrinsic, case NI_Vector128_AsUInt16: case NI_Vector128_AsUInt32: case NI_Vector128_AsUInt64: - case NI_Vector128_AsVector4: case NI_Vector256_As: case NI_Vector256_AsByte: case NI_Vector256_AsDouble: diff --git a/src/coreclr/jit/simdashwintrinsic.cpp b/src/coreclr/jit/simdashwintrinsic.cpp index eadb82af79effd..ceaa9675446b69 100644 --- a/src/coreclr/jit/simdashwintrinsic.cpp +++ b/src/coreclr/jit/simdashwintrinsic.cpp @@ -717,7 +717,6 @@ GenTree* Compiler::impSimdAsHWIntrinsicSpecial(NamedIntrinsic intrinsic, case NI_Quaternion_WithElement: case NI_Vector2_WithElement: case NI_Vector3_WithElement: - case NI_Vector4_WithElement: case NI_VectorT_WithElement: { assert(sig->numArgs == 3); @@ -801,7 +800,6 @@ GenTree* Compiler::impSimdAsHWIntrinsicSpecial(NamedIntrinsic intrinsic, case NI_Quaternion_WithElement: case NI_Vector2_WithElement: case NI_Vector3_WithElement: - case NI_Vector4_WithElement: case NI_VectorT_WithElement: { assert(numArgs == 3); @@ -907,7 +905,6 @@ GenTree* Compiler::impSimdAsHWIntrinsicSpecial(NamedIntrinsic intrinsic, case NI_Vector2_get_One: case NI_Vector3_get_One: - case NI_Vector4_get_One: case NI_VectorT_get_One: { return gtNewOneConNode(retType, simdBaseType); @@ -915,7 +912,6 @@ GenTree* Compiler::impSimdAsHWIntrinsicSpecial(NamedIntrinsic intrinsic, case NI_Vector2_get_UnitX: case NI_Vector3_get_UnitX: - case NI_Vector4_get_UnitX: { GenTreeVecCon* vecCon = gtNewVconNode(retType); @@ -929,7 +925,6 @@ GenTree* Compiler::impSimdAsHWIntrinsicSpecial(NamedIntrinsic intrinsic, case NI_Vector2_get_UnitY: case NI_Vector3_get_UnitY: - case NI_Vector4_get_UnitY: { GenTreeVecCon* vecCon = gtNewVconNode(retType); @@ -942,7 +937,6 @@ GenTree* Compiler::impSimdAsHWIntrinsicSpecial(NamedIntrinsic intrinsic, } case NI_Vector3_get_UnitZ: - case NI_Vector4_get_UnitZ: { GenTreeVecCon* vecCon = gtNewVconNode(retType); @@ -955,7 +949,6 @@ GenTree* Compiler::impSimdAsHWIntrinsicSpecial(NamedIntrinsic intrinsic, } case NI_Quaternion_get_Identity: - case NI_Vector4_get_UnitW: { GenTreeVecCon* vecCon = gtNewVconNode(retType); @@ -970,7 +963,6 @@ GenTree* Compiler::impSimdAsHWIntrinsicSpecial(NamedIntrinsic intrinsic, case NI_Quaternion_get_Zero: case NI_Vector2_get_Zero: case NI_Vector3_get_Zero: - case NI_Vector4_get_Zero: case NI_VectorT_get_Zero: { return gtNewZeroConNode(retType); @@ -1012,7 +1004,6 @@ GenTree* Compiler::impSimdAsHWIntrinsicSpecial(NamedIntrinsic intrinsic, { case NI_Vector2_Abs: case NI_Vector3_Abs: - case NI_Vector4_Abs: case NI_VectorT_Abs: { return gtNewSimdAbsNode(retType, op1, simdBaseJitType, simdSize); @@ -1066,7 +1057,6 @@ GenTree* Compiler::impSimdAsHWIntrinsicSpecial(NamedIntrinsic intrinsic, case NI_Quaternion_Length: case NI_Vector2_Length: case NI_Vector3_Length: - case NI_Vector4_Length: { GenTree* clonedOp1; op1 = @@ -1081,7 +1071,6 @@ GenTree* Compiler::impSimdAsHWIntrinsicSpecial(NamedIntrinsic intrinsic, case NI_Quaternion_LengthSquared: case NI_Vector2_LengthSquared: case NI_Vector3_LengthSquared: - case NI_Vector4_LengthSquared: { GenTree* clonedOp1; op1 = impCloneExpr(op1, &clonedOp1, CHECK_SPILL_ALL, @@ -1131,8 +1120,6 @@ GenTree* Compiler::impSimdAsHWIntrinsicSpecial(NamedIntrinsic intrinsic, case NI_Vector2_op_UnaryNegation: case NI_Vector3_Negate: case NI_Vector3_op_UnaryNegation: - case NI_Vector4_Negate: - case NI_Vector4_op_UnaryNegation: case NI_VectorT_Negate: case NI_VectorT_op_UnaryNegation: { @@ -1142,7 +1129,6 @@ GenTree* Compiler::impSimdAsHWIntrinsicSpecial(NamedIntrinsic intrinsic, case NI_Quaternion_Normalize: case NI_Vector2_Normalize: case NI_Vector3_Normalize: - case NI_Vector4_Normalize: { GenTree* clonedOp1; op1 = impCloneExpr(op1, &clonedOp1, CHECK_SPILL_ALL, @@ -1166,7 +1152,6 @@ GenTree* Compiler::impSimdAsHWIntrinsicSpecial(NamedIntrinsic intrinsic, case NI_Vector2_Sqrt: case NI_Vector3_Sqrt: - case NI_Vector4_Sqrt: case NI_VectorT_Sqrt: { return gtNewSimdSqrtNode(retType, op1, simdBaseJitType, simdSize); @@ -1390,8 +1375,6 @@ GenTree* Compiler::impSimdAsHWIntrinsicSpecial(NamedIntrinsic intrinsic, case NI_Vector2_op_Addition: case NI_Vector3_Add: case NI_Vector3_op_Addition: - case NI_Vector4_Add: - case NI_Vector4_op_Addition: case NI_VectorT_Add: case NI_VectorT_op_Addition: { @@ -1417,7 +1400,6 @@ GenTree* Compiler::impSimdAsHWIntrinsicSpecial(NamedIntrinsic intrinsic, case NI_Vector2_CreateBroadcast: case NI_Vector3_CreateBroadcast: - case NI_Vector4_CreateBroadcast: case NI_VectorT_CreateBroadcast: { assert(retType == TYP_VOID); @@ -1444,7 +1426,6 @@ GenTree* Compiler::impSimdAsHWIntrinsicSpecial(NamedIntrinsic intrinsic, case NI_Vector2_Distance: case NI_Vector3_Distance: - case NI_Vector4_Distance: { op1 = gtNewSimdBinOpNode(GT_SUB, simdType, op1, op2, simdBaseJitType, simdSize); @@ -1460,7 +1441,6 @@ GenTree* Compiler::impSimdAsHWIntrinsicSpecial(NamedIntrinsic intrinsic, case NI_Vector2_DistanceSquared: case NI_Vector3_DistanceSquared: - case NI_Vector4_DistanceSquared: { op1 = gtNewSimdBinOpNode(GT_SUB, simdType, op1, op2, simdBaseJitType, simdSize); @@ -1477,8 +1457,6 @@ GenTree* Compiler::impSimdAsHWIntrinsicSpecial(NamedIntrinsic intrinsic, case NI_Vector2_op_Division: case NI_Vector3_Divide: case NI_Vector3_op_Division: - case NI_Vector4_Divide: - case NI_Vector4_op_Division: case NI_VectorT_Divide: case NI_VectorT_op_Division: { @@ -1489,7 +1467,6 @@ GenTree* Compiler::impSimdAsHWIntrinsicSpecial(NamedIntrinsic intrinsic, case NI_Quaternion_Dot: case NI_Vector2_Dot: case NI_Vector3_Dot: - case NI_Vector4_Dot: case NI_VectorT_Dot: { op1 = gtNewSimdDotProdNode(simdType, op1, op2, simdBaseJitType, simdSize); @@ -1505,7 +1482,6 @@ GenTree* Compiler::impSimdAsHWIntrinsicSpecial(NamedIntrinsic intrinsic, case NI_Quaternion_op_Equality: case NI_Vector2_op_Equality: case NI_Vector3_op_Equality: - case NI_Vector4_op_Equality: case NI_VectorT_EqualsAll: case NI_VectorT_op_Equality: { @@ -1529,8 +1505,6 @@ GenTree* Compiler::impSimdAsHWIntrinsicSpecial(NamedIntrinsic intrinsic, case NI_Vector2_GetElement: case NI_Vector3_get_Item: case NI_Vector3_GetElement: - case NI_Vector4_get_Item: - case NI_Vector4_GetElement: case NI_VectorT_get_Item: case NI_VectorT_GetElement: { @@ -1571,7 +1545,6 @@ GenTree* Compiler::impSimdAsHWIntrinsicSpecial(NamedIntrinsic intrinsic, case NI_Quaternion_op_Inequality: case NI_Vector2_op_Inequality: case NI_Vector3_op_Inequality: - case NI_Vector4_op_Inequality: case NI_VectorT_op_Inequality: { return gtNewSimdCmpOpAnyNode(GT_NE, retType, op1, op2, simdBaseJitType, simdSize); @@ -1626,7 +1599,6 @@ GenTree* Compiler::impSimdAsHWIntrinsicSpecial(NamedIntrinsic intrinsic, case NI_Vector2_Max: case NI_Vector3_Max: - case NI_Vector4_Max: case NI_VectorT_Max: { return gtNewSimdMaxNode(retType, op1, op2, simdBaseJitType, simdSize); @@ -1634,7 +1606,6 @@ GenTree* Compiler::impSimdAsHWIntrinsicSpecial(NamedIntrinsic intrinsic, case NI_Vector2_Min: case NI_Vector3_Min: - case NI_Vector4_Min: case NI_VectorT_Min: { return gtNewSimdMinNode(retType, op1, op2, simdBaseJitType, simdSize); @@ -1646,8 +1617,6 @@ GenTree* Compiler::impSimdAsHWIntrinsicSpecial(NamedIntrinsic intrinsic, case NI_Vector2_op_Multiply: case NI_Vector3_Multiply: case NI_Vector3_op_Multiply: - case NI_Vector4_Multiply: - case NI_Vector4_op_Multiply: case NI_VectorT_Multiply: case NI_VectorT_op_Multiply: { @@ -1724,8 +1693,6 @@ GenTree* Compiler::impSimdAsHWIntrinsicSpecial(NamedIntrinsic intrinsic, case NI_Vector2_op_Subtraction: case NI_Vector3_Subtract: case NI_Vector3_op_Subtraction: - case NI_Vector4_Subtract: - case NI_Vector4_op_Subtraction: case NI_VectorT_Subtract: case NI_VectorT_op_Subtraction: { @@ -1785,7 +1752,6 @@ GenTree* Compiler::impSimdAsHWIntrinsicSpecial(NamedIntrinsic intrinsic, { case NI_Vector2_Clamp: case NI_Vector3_Clamp: - case NI_Vector4_Clamp: { GenTree* maxNode = gtNewSimdMaxNode(retType, op1, op2, simdBaseJitType, simdSize); return gtNewSimdMinNode(retType, maxNode, op3, simdBaseJitType, simdSize); @@ -1798,7 +1764,6 @@ GenTree* Compiler::impSimdAsHWIntrinsicSpecial(NamedIntrinsic intrinsic, case NI_Vector2_Lerp: case NI_Vector3_Lerp: - case NI_Vector4_Lerp: { // We generate nodes equivalent to `(op1 * (1.0f - op3)) + (op2 * op3)` // optimizing for xarch by doing a single broadcast and for arm64 by @@ -1904,7 +1869,6 @@ GenTree* Compiler::impSimdAsHWIntrinsicSpecial(NamedIntrinsic intrinsic, case NI_Plane_CreateFromVector3: case NI_Quaternion_CreateFromVector3: case NI_Vector3_CreateFromVector2: - case NI_Vector4_CreateFromVector3: { assert(retType == TYP_VOID); assert(simdBaseType == TYP_FLOAT); @@ -1942,7 +1906,6 @@ GenTree* Compiler::impSimdAsHWIntrinsicSpecial(NamedIntrinsic intrinsic, case NI_Quaternion_WithElement: case NI_Vector2_WithElement: case NI_Vector3_WithElement: - case NI_Vector4_WithElement: case NI_VectorT_WithElement: { return gtNewSimdWithElementNode(retType, op1, op2, op3, simdBaseJitType, simdSize); @@ -2035,38 +1998,6 @@ GenTree* Compiler::impSimdAsHWIntrinsicSpecial(NamedIntrinsic intrinsic, break; } - case NI_Vector4_CreateFromVector2: - { - assert(retType == TYP_VOID); - assert(simdBaseType == TYP_FLOAT); - assert(simdSize == 16); - - // TODO-CQ: We should be able to check for contiguous args here after - // the relevant methods are updated to support more than just float - - if (op2->IsCnsVec() && op3->IsCnsFltOrDbl() && op4->IsCnsFltOrDbl()) - { - GenTreeVecCon* vecCon = op2->AsVecCon(); - vecCon->gtType = simdType; - - vecCon->gtSimdVal.f32[2] = static_cast(op3->AsDblCon()->DconValue()); - vecCon->gtSimdVal.f32[3] = static_cast(op4->AsDblCon()->DconValue()); - - copyBlkSrc = vecCon; - } - else - { - GenTree* idx = gtNewIconNode(2, TYP_INT); - op2 = gtNewSimdWithElementNode(simdType, op2, idx, op3, simdBaseJitType, simdSize); - - idx = gtNewIconNode(3, TYP_INT); - copyBlkSrc = gtNewSimdWithElementNode(simdType, op2, idx, op4, simdBaseJitType, simdSize); - } - - copyBlkDst = op1; - break; - } - default: { // Some platforms warn about unhandled switch cases @@ -2120,7 +2051,6 @@ GenTree* Compiler::impSimdAsHWIntrinsicSpecial(NamedIntrinsic intrinsic, { case NI_Plane_Create: case NI_Quaternion_Create: - case NI_Vector4_Create: { assert(retType == TYP_VOID); assert(simdBaseType == TYP_FLOAT); diff --git a/src/coreclr/jit/simdashwintrinsiclistarm64.h b/src/coreclr/jit/simdashwintrinsiclistarm64.h index 911306e712409c..ed5f01b962980f 100644 --- a/src/coreclr/jit/simdashwintrinsiclistarm64.h +++ b/src/coreclr/jit/simdashwintrinsiclistarm64.h @@ -154,49 +154,6 @@ SIMD_AS_HWINTRINSIC_NM(Vector3, Sqrt, "SquareRoot", SIMD_AS_HWINTRINSIC_ID(Vector3, Subtract, 2, {NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Vector3_Subtract, NI_Illegal}, SimdAsHWIntrinsicFlag::None) SIMD_AS_HWINTRINSIC_ID(Vector3, WithElement, 3, {NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Vector3_WithElement, NI_Illegal}, SimdAsHWIntrinsicFlag::None) -// ************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************* -// ISA ID Name NumArg Instructions Flags -// {TYP_BYTE, TYP_UBYTE, TYP_SHORT, TYP_USHORT, TYP_INT, TYP_UINT, TYP_LONG, TYP_ULONG, TYP_FLOAT, TYP_DOUBLE} -// ************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************* -// Vector4 Intrinsics -SIMD_AS_HWINTRINSIC_ID(Vector4, Abs, 1, {NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Vector4_Abs, NI_Illegal}, SimdAsHWIntrinsicFlag::None) -SIMD_AS_HWINTRINSIC_ID(Vector4, Add, 2, {NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Vector4_Add, NI_Illegal}, SimdAsHWIntrinsicFlag::None) -SIMD_AS_HWINTRINSIC_ID(Vector4, Clamp, 3, {NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Vector4_Clamp, NI_Illegal}, SimdAsHWIntrinsicFlag::None) -SIMD_AS_HWINTRINSIC_NM(Vector4, Create, ".ctor", 5, {NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Vector4_Create, NI_Illegal}, SimdAsHWIntrinsicFlag::InstanceMethod | SimdAsHWIntrinsicFlag::SpillSideEffectsOp1) -SIMD_AS_HWINTRINSIC_NM(Vector4, CreateBroadcast, ".ctor", 2, {NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Vector4_CreateBroadcast, NI_Illegal}, SimdAsHWIntrinsicFlag::InstanceMethod | SimdAsHWIntrinsicFlag::SpillSideEffectsOp1) -SIMD_AS_HWINTRINSIC_NM(Vector4, CreateFromVector2, ".ctor", 4, {NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Vector4_CreateFromVector2, NI_Illegal}, SimdAsHWIntrinsicFlag::InstanceMethod | SimdAsHWIntrinsicFlag::SpillSideEffectsOp1 | SimdAsHWIntrinsicFlag::BaseTypeFromThisArg) -SIMD_AS_HWINTRINSIC_NM(Vector4, CreateFromVector3, ".ctor", 3, {NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Vector4_CreateFromVector3, NI_Illegal}, SimdAsHWIntrinsicFlag::InstanceMethod | SimdAsHWIntrinsicFlag::SpillSideEffectsOp1 | SimdAsHWIntrinsicFlag::BaseTypeFromThisArg) -SIMD_AS_HWINTRINSIC_ID(Vector4, Distance, 2, {NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Vector4_Distance, NI_Illegal}, SimdAsHWIntrinsicFlag::None) -SIMD_AS_HWINTRINSIC_ID(Vector4, DistanceSquared, 2, {NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Vector4_DistanceSquared, NI_Illegal}, SimdAsHWIntrinsicFlag::None) -SIMD_AS_HWINTRINSIC_ID(Vector4, Divide, 2, {NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Vector4_Divide, NI_Illegal}, SimdAsHWIntrinsicFlag::None) -SIMD_AS_HWINTRINSIC_ID(Vector4, Dot, 2, {NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Vector4_Dot, NI_Illegal}, SimdAsHWIntrinsicFlag::None) -SIMD_AS_HWINTRINSIC_ID(Vector4, get_Item, 0, {NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Vector4_get_Item, NI_Illegal}, SimdAsHWIntrinsicFlag::InstanceMethod | SimdAsHWIntrinsicFlag::BaseTypeFromThisArg) -SIMD_AS_HWINTRINSIC_ID(Vector4, get_One, 0, {NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Vector4_get_One, NI_Illegal}, SimdAsHWIntrinsicFlag::None) -SIMD_AS_HWINTRINSIC_ID(Vector4, get_UnitX, 0, {NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Vector4_get_UnitX, NI_Illegal}, SimdAsHWIntrinsicFlag::None) -SIMD_AS_HWINTRINSIC_ID(Vector4, get_UnitY, 0, {NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Vector4_get_UnitY, NI_Illegal}, SimdAsHWIntrinsicFlag::None) -SIMD_AS_HWINTRINSIC_ID(Vector4, get_UnitZ, 0, {NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Vector4_get_UnitZ, NI_Illegal}, SimdAsHWIntrinsicFlag::None) -SIMD_AS_HWINTRINSIC_ID(Vector4, get_UnitW, 0, {NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Vector4_get_UnitW, NI_Illegal}, SimdAsHWIntrinsicFlag::None) -SIMD_AS_HWINTRINSIC_ID(Vector4, get_Zero, 0, {NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Vector4_get_Zero, NI_Illegal}, SimdAsHWIntrinsicFlag::None) -SIMD_AS_HWINTRINSIC_ID(Vector4, GetElement, 2, {NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Vector4_GetElement, NI_Illegal}, SimdAsHWIntrinsicFlag::None) -SIMD_AS_HWINTRINSIC_ID(Vector4, Length, 1, {NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Vector4_Length, NI_Illegal}, SimdAsHWIntrinsicFlag::InstanceMethod) -SIMD_AS_HWINTRINSIC_ID(Vector4, LengthSquared, 1, {NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Vector4_LengthSquared, NI_Illegal}, SimdAsHWIntrinsicFlag::InstanceMethod) -SIMD_AS_HWINTRINSIC_ID(Vector4, Lerp, 3, {NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Vector4_Lerp, NI_Illegal}, SimdAsHWIntrinsicFlag::SpillSideEffectsOp1 | SimdAsHWIntrinsicFlag::SpillSideEffectsOp2) -SIMD_AS_HWINTRINSIC_ID(Vector4, Max, 2, {NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Vector4_Max, NI_Illegal}, SimdAsHWIntrinsicFlag::None) -SIMD_AS_HWINTRINSIC_ID(Vector4, Min, 2, {NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Vector4_Min, NI_Illegal}, SimdAsHWIntrinsicFlag::None) -SIMD_AS_HWINTRINSIC_ID(Vector4, Multiply, 2, {NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Vector4_Multiply, NI_Illegal}, SimdAsHWIntrinsicFlag::None) -SIMD_AS_HWINTRINSIC_ID(Vector4, Negate, 1, {NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Vector4_Negate, NI_Illegal}, SimdAsHWIntrinsicFlag::None) -SIMD_AS_HWINTRINSIC_ID(Vector4, Normalize, 1, {NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Vector4_Normalize, NI_Illegal}, SimdAsHWIntrinsicFlag::None) -SIMD_AS_HWINTRINSIC_ID(Vector4, op_Addition, 2, {NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Vector4_op_Addition, NI_Illegal}, SimdAsHWIntrinsicFlag::None) -SIMD_AS_HWINTRINSIC_ID(Vector4, op_Division, 2, {NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Vector4_op_Division, NI_Illegal}, SimdAsHWIntrinsicFlag::None) -SIMD_AS_HWINTRINSIC_ID(Vector4, op_Equality, 2, {NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Vector4_op_Equality, NI_Illegal}, SimdAsHWIntrinsicFlag::None) -SIMD_AS_HWINTRINSIC_ID(Vector4, op_Inequality, 2, {NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Vector4_op_Inequality, NI_Illegal}, SimdAsHWIntrinsicFlag::None) -SIMD_AS_HWINTRINSIC_ID(Vector4, op_Multiply, 2, {NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Vector4_op_Multiply, NI_Illegal}, SimdAsHWIntrinsicFlag::None) -SIMD_AS_HWINTRINSIC_ID(Vector4, op_Subtraction, 2, {NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Vector4_op_Subtraction, NI_Illegal}, SimdAsHWIntrinsicFlag::None) -SIMD_AS_HWINTRINSIC_ID(Vector4, op_UnaryNegation, 1, {NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Vector4_op_UnaryNegation, NI_Illegal}, SimdAsHWIntrinsicFlag::None) -SIMD_AS_HWINTRINSIC_NM(Vector4, Sqrt, "SquareRoot", 1, {NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Vector4_Sqrt, NI_Illegal}, SimdAsHWIntrinsicFlag::None) -SIMD_AS_HWINTRINSIC_ID(Vector4, Subtract, 2, {NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Vector4_Subtract, NI_Illegal}, SimdAsHWIntrinsicFlag::None) -SIMD_AS_HWINTRINSIC_ID(Vector4, WithElement, 3, {NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Vector4_WithElement, NI_Illegal}, SimdAsHWIntrinsicFlag::None) - // ************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************* // ISA ID Name NumArg Instructions Flags // {TYP_BYTE, TYP_UBYTE, TYP_SHORT, TYP_USHORT, TYP_INT, TYP_UINT, TYP_LONG, TYP_ULONG, TYP_FLOAT, TYP_DOUBLE} diff --git a/src/coreclr/jit/simdashwintrinsiclistxarch.h b/src/coreclr/jit/simdashwintrinsiclistxarch.h index dd1d6374bc248f..ae46c87c867801 100644 --- a/src/coreclr/jit/simdashwintrinsiclistxarch.h +++ b/src/coreclr/jit/simdashwintrinsiclistxarch.h @@ -154,49 +154,6 @@ SIMD_AS_HWINTRINSIC_NM(Vector3, Sqrt, "SquareRoot", SIMD_AS_HWINTRINSIC_ID(Vector3, Subtract, 2, {NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Vector3_Subtract, NI_Illegal}, SimdAsHWIntrinsicFlag::None) SIMD_AS_HWINTRINSIC_ID(Vector3, WithElement, 3, {NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Vector3_WithElement, NI_Illegal}, SimdAsHWIntrinsicFlag::None) -// ************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************* -// ISA ID Name NumArg Instructions Flags -// {TYP_BYTE, TYP_UBYTE, TYP_SHORT, TYP_USHORT, TYP_INT, TYP_UINT, TYP_LONG, TYP_ULONG, TYP_FLOAT, TYP_DOUBLE} -// ************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************* -// Vector4 Intrinsics -SIMD_AS_HWINTRINSIC_ID(Vector4, Abs, 1, {NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Vector4_Abs, NI_Illegal}, SimdAsHWIntrinsicFlag::None) -SIMD_AS_HWINTRINSIC_ID(Vector4, Add, 2, {NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Vector4_Add, NI_Illegal}, SimdAsHWIntrinsicFlag::None) -SIMD_AS_HWINTRINSIC_ID(Vector4, Clamp, 3, {NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Vector4_Clamp, NI_Illegal}, SimdAsHWIntrinsicFlag::None) -SIMD_AS_HWINTRINSIC_NM(Vector4, Create, ".ctor", 5, {NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Vector4_Create, NI_Illegal}, SimdAsHWIntrinsicFlag::InstanceMethod | SimdAsHWIntrinsicFlag::SpillSideEffectsOp1) -SIMD_AS_HWINTRINSIC_NM(Vector4, CreateBroadcast, ".ctor", 2, {NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Vector4_CreateBroadcast, NI_Illegal}, SimdAsHWIntrinsicFlag::InstanceMethod | SimdAsHWIntrinsicFlag::SpillSideEffectsOp1) -SIMD_AS_HWINTRINSIC_NM(Vector4, CreateFromVector2, ".ctor", 4, {NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Vector4_CreateFromVector2, NI_Illegal}, SimdAsHWIntrinsicFlag::InstanceMethod | SimdAsHWIntrinsicFlag::SpillSideEffectsOp1 | SimdAsHWIntrinsicFlag::BaseTypeFromThisArg) -SIMD_AS_HWINTRINSIC_NM(Vector4, CreateFromVector3, ".ctor", 3, {NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Vector4_CreateFromVector3, NI_Illegal}, SimdAsHWIntrinsicFlag::InstanceMethod | SimdAsHWIntrinsicFlag::SpillSideEffectsOp1 | SimdAsHWIntrinsicFlag::BaseTypeFromThisArg) -SIMD_AS_HWINTRINSIC_ID(Vector4, Distance, 2, {NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Vector4_Distance, NI_Illegal}, SimdAsHWIntrinsicFlag::None) -SIMD_AS_HWINTRINSIC_ID(Vector4, DistanceSquared, 2, {NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Vector4_DistanceSquared, NI_Illegal}, SimdAsHWIntrinsicFlag::None) -SIMD_AS_HWINTRINSIC_ID(Vector4, Divide, 2, {NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Vector4_Divide, NI_Illegal}, SimdAsHWIntrinsicFlag::None) -SIMD_AS_HWINTRINSIC_ID(Vector4, Dot, 2, {NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Vector4_Dot, NI_Illegal}, SimdAsHWIntrinsicFlag::None) -SIMD_AS_HWINTRINSIC_ID(Vector4, get_Item, 2, {NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Vector4_get_Item, NI_Illegal}, SimdAsHWIntrinsicFlag::InstanceMethod | SimdAsHWIntrinsicFlag::BaseTypeFromThisArg) -SIMD_AS_HWINTRINSIC_ID(Vector4, get_One, 0, {NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Vector4_get_One, NI_Illegal}, SimdAsHWIntrinsicFlag::None) -SIMD_AS_HWINTRINSIC_ID(Vector4, get_UnitX, 0, {NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Vector4_get_UnitX, NI_Illegal}, SimdAsHWIntrinsicFlag::None) -SIMD_AS_HWINTRINSIC_ID(Vector4, get_UnitY, 0, {NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Vector4_get_UnitY, NI_Illegal}, SimdAsHWIntrinsicFlag::None) -SIMD_AS_HWINTRINSIC_ID(Vector4, get_UnitZ, 0, {NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Vector4_get_UnitZ, NI_Illegal}, SimdAsHWIntrinsicFlag::None) -SIMD_AS_HWINTRINSIC_ID(Vector4, get_UnitW, 0, {NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Vector4_get_UnitW, NI_Illegal}, SimdAsHWIntrinsicFlag::None) -SIMD_AS_HWINTRINSIC_ID(Vector4, get_Zero, 0, {NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Vector4_get_Zero, NI_Illegal}, SimdAsHWIntrinsicFlag::None) -SIMD_AS_HWINTRINSIC_ID(Vector4, GetElement, 2, {NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Vector4_GetElement, NI_Illegal}, SimdAsHWIntrinsicFlag::None) -SIMD_AS_HWINTRINSIC_ID(Vector4, Length, 1, {NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Vector4_Length, NI_Illegal}, SimdAsHWIntrinsicFlag::InstanceMethod) -SIMD_AS_HWINTRINSIC_ID(Vector4, LengthSquared, 1, {NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Vector4_LengthSquared, NI_Illegal}, SimdAsHWIntrinsicFlag::InstanceMethod) -SIMD_AS_HWINTRINSIC_ID(Vector4, Lerp, 3, {NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Vector4_Lerp, NI_Illegal}, SimdAsHWIntrinsicFlag::SpillSideEffectsOp1 | SimdAsHWIntrinsicFlag::SpillSideEffectsOp2) -SIMD_AS_HWINTRINSIC_ID(Vector4, Max, 2, {NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Vector4_Max, NI_Illegal}, SimdAsHWIntrinsicFlag::None) -SIMD_AS_HWINTRINSIC_ID(Vector4, Min, 2, {NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Vector4_Min, NI_Illegal}, SimdAsHWIntrinsicFlag::None) -SIMD_AS_HWINTRINSIC_ID(Vector4, Multiply, 2, {NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Vector4_Multiply, NI_Illegal}, SimdAsHWIntrinsicFlag::None) -SIMD_AS_HWINTRINSIC_ID(Vector4, Negate, 1, {NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Vector4_Negate, NI_Illegal}, SimdAsHWIntrinsicFlag::None) -SIMD_AS_HWINTRINSIC_ID(Vector4, Normalize, 1, {NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Vector4_Normalize, NI_Illegal}, SimdAsHWIntrinsicFlag::None) -SIMD_AS_HWINTRINSIC_ID(Vector4, op_Addition, 2, {NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Vector4_op_Addition, NI_Illegal}, SimdAsHWIntrinsicFlag::None) -SIMD_AS_HWINTRINSIC_ID(Vector4, op_Division, 2, {NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Vector4_op_Division, NI_Illegal}, SimdAsHWIntrinsicFlag::None) -SIMD_AS_HWINTRINSIC_ID(Vector4, op_Equality, 2, {NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Vector4_op_Equality, NI_Illegal}, SimdAsHWIntrinsicFlag::None) -SIMD_AS_HWINTRINSIC_ID(Vector4, op_Inequality, 2, {NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Vector4_op_Inequality, NI_Illegal}, SimdAsHWIntrinsicFlag::None) -SIMD_AS_HWINTRINSIC_ID(Vector4, op_Multiply, 2, {NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Vector4_op_Multiply, NI_Illegal}, SimdAsHWIntrinsicFlag::None) -SIMD_AS_HWINTRINSIC_ID(Vector4, op_Subtraction, 2, {NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Vector4_op_Subtraction, NI_Illegal}, SimdAsHWIntrinsicFlag::None) -SIMD_AS_HWINTRINSIC_ID(Vector4, op_UnaryNegation, 1, {NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Vector4_op_UnaryNegation, NI_Illegal}, SimdAsHWIntrinsicFlag::None) -SIMD_AS_HWINTRINSIC_NM(Vector4, Sqrt, "SquareRoot", 1, {NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Vector4_Sqrt, NI_Illegal}, SimdAsHWIntrinsicFlag::None) -SIMD_AS_HWINTRINSIC_ID(Vector4, Subtract, 2, {NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Vector4_Subtract, NI_Illegal}, SimdAsHWIntrinsicFlag::None) -SIMD_AS_HWINTRINSIC_ID(Vector4, WithElement, 3, {NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Vector4_WithElement, NI_Illegal}, SimdAsHWIntrinsicFlag::None) - // ************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************* // ISA ID Name NumArg Instructions Flags // {TYP_BYTE, TYP_UBYTE, TYP_SHORT, TYP_USHORT, TYP_INT, TYP_UINT, TYP_LONG, TYP_ULONG, TYP_FLOAT, TYP_DOUBLE} diff --git a/src/libraries/System.Private.CoreLib/src/System/Numerics/Vector4.Extensions.cs b/src/libraries/System.Private.CoreLib/src/System/Numerics/Vector4.Extensions.cs index 143d003b960223..7a9442b7d12560 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Numerics/Vector4.Extensions.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Numerics/Vector4.Extensions.cs @@ -3,6 +3,7 @@ using System.Diagnostics; using System.Runtime.CompilerServices; +using System.Runtime.Intrinsics; namespace System.Numerics { @@ -13,16 +14,10 @@ public static unsafe partial class Vector /// The index of the element to get. /// The value of the element at . /// was less than zero or greater than the number of elements. - [Intrinsic] [MethodImpl(MethodImplOptions.AggressiveInlining)] internal static float GetElement(this Vector4 vector, int index) { - if ((uint)(index) >= (uint)(Vector4.Count)) - { - ThrowHelper.ThrowArgumentOutOfRangeException(ExceptionArgument.index); - } - - return vector.GetElementUnsafe(index); + return vector.AsVector128().GetElement(index); } /// Creates a new with the element at the specified index set to the specified value and the remaining elements set to the same value as that in the given vector. @@ -31,17 +26,9 @@ internal static float GetElement(this Vector4 vector, int index) /// The value to set the element to. /// A with the value of the element at set to and the remaining elements set to the same value as that in . /// was less than zero or greater than the number of elements. - [Intrinsic] internal static Vector4 WithElement(this Vector4 vector, int index, float value) { - if ((uint)(index) >= (uint)(Vector4.Count)) - { - ThrowHelper.ThrowArgumentOutOfRangeException(ExceptionArgument.index); - } - - Vector4 result = vector; - result.SetElementUnsafe(index, value); - return result; + return vector.AsVector128().WithElement(index, value).AsVector4(); } [MethodImpl(MethodImplOptions.AggressiveInlining)] diff --git a/src/libraries/System.Private.CoreLib/src/System/Numerics/Vector4.cs b/src/libraries/System.Private.CoreLib/src/System/Numerics/Vector4.cs index 831b4f50d2556f..1f0b78c37257d8 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Numerics/Vector4.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Numerics/Vector4.cs @@ -3,6 +3,7 @@ using System.Diagnostics.CodeAnalysis; using System.Globalization; +using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Runtime.Intrinsics; @@ -33,26 +34,31 @@ public partial struct Vector4 : IEquatable, IFormattable /// Creates a new object whose four elements have the same value. /// The value to assign to all four elements. - [Intrinsic] - public Vector4(float value) : this(value, value, value, value) + public Vector4(float value) { + this = Vector128.Create(value).AsVector4(); } /// Creates a new object from the specified object and a Z and a W component. /// The vector to use for the X and Y components. /// The Z component. /// The W component. - [Intrinsic] - public Vector4(Vector2 value, float z, float w) : this(value.X, value.Y, z, w) + public Vector4(Vector2 value, float z, float w) { + this = value.AsVector128() + .WithElement(2, z) + .WithElement(3, w) + .AsVector4(); } /// Constructs a new object from the specified object and a W component. /// The vector to use for the X, Y, and Z components. /// The W component. - [Intrinsic] - public Vector4(Vector3 value, float w) : this(value.X, value.Y, value.Z, w) + public Vector4(Vector3 value, float w) { + this = value.AsVector128() + .WithElement(3, w) + .AsVector4(); } /// Creates a vector whose elements have the specified values. @@ -60,32 +66,22 @@ public Vector4(Vector3 value, float w) : this(value.X, value.Y, value.Z, w) /// The value to assign to the field. /// The value to assign to the field. /// The value to assign to the field. - [Intrinsic] public Vector4(float x, float y, float z, float w) { - X = x; - Y = y; - Z = z; - W = w; + this = Vector128.Create(x, y, z, w).AsVector4(); } /// Constructs a vector from the given . The span must contain at least 4 elements. /// The span of elements to assign to the vector. public Vector4(ReadOnlySpan values) { - if (values.Length < 4) - { - ThrowHelper.ThrowArgumentOutOfRangeException(ExceptionArgument.values); - } - - this = Unsafe.ReadUnaligned(ref Unsafe.As(ref MemoryMarshal.GetReference(values))); + this = Vector128.Create(values).AsVector4(); } /// Gets a vector whose 4 elements are equal to zero. /// A vector whose four elements are equal to zero (that is, it returns the vector (0,0,0,0). public static Vector4 Zero { - [Intrinsic] get => default; } @@ -94,15 +90,13 @@ public static Vector4 Zero /// A vector whose four elements are equal to one (that is, it returns the vector (1,1,1,1). public static Vector4 One { - [Intrinsic] - get => new Vector4(1.0f); + get => new Vector4(1); } /// Gets the vector (1,0,0,0). /// The vector (1,0,0,0). public static Vector4 UnitX { - [Intrinsic] get => new Vector4(1.0f, 0.0f, 0.0f, 0.0f); } @@ -110,7 +104,6 @@ public static Vector4 UnitX /// The vector (0,1,0,0). public static Vector4 UnitY { - [Intrinsic] get => new Vector4(0.0f, 1.0f, 0.0f, 0.0f); } @@ -118,7 +111,6 @@ public static Vector4 UnitY /// The vector (0,0,1,0). public static Vector4 UnitZ { - [Intrinsic] get => new Vector4(0.0f, 0.0f, 1.0f, 0.0f); } @@ -126,7 +118,6 @@ public static Vector4 UnitZ /// The vector (0,0,0,1). public static Vector4 UnitW { - [Intrinsic] get => new Vector4(0.0f, 0.0f, 0.0f, 1.0f); } @@ -136,7 +127,6 @@ public static Vector4 UnitW /// was less than zero or greater than the number of elements. public float this[int index] { - [Intrinsic] [MethodImpl(MethodImplOptions.AggressiveInlining)] readonly get => this.GetElement(index); @@ -149,16 +139,10 @@ public float this[int index] /// The second vector to add. /// The summed vector. /// The method defines the addition operation for objects. - [Intrinsic] [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector4 operator +(Vector4 left, Vector4 right) { - return new Vector4( - left.X + right.X, - left.Y + right.Y, - left.Z + right.Z, - left.W + right.W - ); + return (left.AsVector128() + right.AsVector128()).AsVector4(); } /// Divides the first vector by the second. @@ -166,16 +150,10 @@ public float this[int index] /// The second vector. /// The vector that results from dividing by . /// The method defines the division operation for objects. - [Intrinsic] [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector4 operator /(Vector4 left, Vector4 right) { - return new Vector4( - left.X / right.X, - left.Y / right.Y, - left.Z / right.Z, - left.W / right.W - ); + return (left.AsVector128() / right.AsVector128()).AsVector4(); } /// Divides the specified vector by a specified scalar value. @@ -183,7 +161,6 @@ public float this[int index] /// The scalar value. /// The result of the division. /// The method defines the division operation for objects. - [Intrinsic] [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector4 operator /(Vector4 value1, float value2) { @@ -195,21 +172,16 @@ public float this[int index] /// The second vector to compare. /// if and are equal; otherwise, . /// Two objects are equal if each element in is equal to the corresponding element in . - [Intrinsic] [MethodImpl(MethodImplOptions.AggressiveInlining)] public static bool operator ==(Vector4 left, Vector4 right) { - return (left.X == right.X) - && (left.Y == right.Y) - && (left.Z == right.Z) - && (left.W == right.W); + return left.AsVector128() == right.AsVector128(); } /// Returns a value that indicates whether two specified vectors are not equal. /// The first vector to compare. /// The second vector to compare. /// if and are not equal; otherwise, . - [Intrinsic] [MethodImpl(MethodImplOptions.AggressiveInlining)] public static bool operator !=(Vector4 left, Vector4 right) { @@ -221,16 +193,10 @@ public float this[int index] /// The second vector. /// The element-wise product vector. /// The method defines the multiplication operation for objects. - [Intrinsic] [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector4 operator *(Vector4 left, Vector4 right) { - return new Vector4( - left.X * right.X, - left.Y * right.Y, - left.Z * right.Z, - left.W * right.W - ); + return (left.AsVector128() * right.AsVector128()).AsVector4(); } /// Multiplies the specified vector by the specified scalar value. @@ -238,7 +204,6 @@ public float this[int index] /// The scalar value. /// The scaled vector. /// The method defines the multiplication operation for objects. - [Intrinsic] [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector4 operator *(Vector4 left, float right) { @@ -250,7 +215,6 @@ public float this[int index] /// The scalar value. /// The scaled vector. /// The method defines the multiplication operation for objects. - [Intrinsic] [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector4 operator *(float left, Vector4 right) { @@ -262,49 +226,35 @@ public float this[int index] /// The second vector. /// The vector that results from subtracting from . /// The method defines the subtraction operation for objects. - [Intrinsic] [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector4 operator -(Vector4 left, Vector4 right) { - return new Vector4( - left.X - right.X, - left.Y - right.Y, - left.Z - right.Z, - left.W - right.W - ); + return (left.AsVector128() - right.AsVector128()).AsVector4(); } /// Negates the specified vector. /// The vector to negate. /// The negated vector. /// The method defines the unary negation operation for objects. - [Intrinsic] [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector4 operator -(Vector4 value) { - return Zero - value; + return (-value.AsVector128()).AsVector4(); } /// Returns a vector whose elements are the absolute values of each of the specified vector's elements. /// A vector. /// The absolute value vector. - [Intrinsic] [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector4 Abs(Vector4 value) { - return new Vector4( - MathF.Abs(value.X), - MathF.Abs(value.Y), - MathF.Abs(value.Z), - MathF.Abs(value.W) - ); + return Vector128.Abs(value.AsVector128()).AsVector4(); } /// Adds two vectors together. /// The first vector to add. /// The second vector to add. /// The summed vector. - [Intrinsic] [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector4 Add(Vector4 left, Vector4 right) { @@ -316,7 +266,6 @@ public static Vector4 Add(Vector4 left, Vector4 right) /// The minimum value. /// The maximum value. /// The restricted vector. - [Intrinsic] [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector4 Clamp(Vector4 value1, Vector4 min, Vector4 max) { @@ -328,31 +277,26 @@ public static Vector4 Clamp(Vector4 value1, Vector4 min, Vector4 max) /// The first point. /// The second point. /// The distance. - [Intrinsic] [MethodImpl(MethodImplOptions.AggressiveInlining)] public static float Distance(Vector4 value1, Vector4 value2) { - float distanceSquared = DistanceSquared(value1, value2); - return MathF.Sqrt(distanceSquared); + return MathF.Sqrt(DistanceSquared(value1, value2)); } /// Returns the Euclidean distance squared between two specified points. /// The first point. /// The second point. /// The distance squared. - [Intrinsic] [MethodImpl(MethodImplOptions.AggressiveInlining)] public static float DistanceSquared(Vector4 value1, Vector4 value2) { - Vector4 difference = value1 - value2; - return Dot(difference, difference); + return (value1 - value2).LengthSquared(); } /// Divides the first vector by the second. /// The first vector. /// The second vector. /// The vector resulting from the division. - [Intrinsic] [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector4 Divide(Vector4 left, Vector4 right) { @@ -363,7 +307,6 @@ public static Vector4 Divide(Vector4 left, Vector4 right) /// The vector. /// The scalar value. /// The vector that results from the division. - [Intrinsic] [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector4 Divide(Vector4 left, float divisor) { @@ -374,14 +317,10 @@ public static Vector4 Divide(Vector4 left, float divisor) /// The first vector. /// The second vector. /// The dot product. - [Intrinsic] [MethodImpl(MethodImplOptions.AggressiveInlining)] public static float Dot(Vector4 vector1, Vector4 vector2) { - return (vector1.X * vector2.X) - + (vector1.Y * vector2.Y) - + (vector1.Z * vector2.Z) - + (vector1.W * vector2.W); + return Vector128.Dot(vector1.AsVector128(), vector2.AsVector128()); } /// Performs a linear interpolation between two vectors based on the given weighting. @@ -392,7 +331,6 @@ public static float Dot(Vector4 vector1, Vector4 vector2) /// - [Intrinsic] [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector4 Lerp(Vector4 value1, Vector4 value2, float amount) { @@ -403,39 +341,26 @@ public static Vector4 Lerp(Vector4 value1, Vector4 value2, float amount) /// The first vector. /// The second vector. /// The maximized vector. - [Intrinsic] [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector4 Max(Vector4 value1, Vector4 value2) { - return new Vector4( - (value1.X > value2.X) ? value1.X : value2.X, - (value1.Y > value2.Y) ? value1.Y : value2.Y, - (value1.Z > value2.Z) ? value1.Z : value2.Z, - (value1.W > value2.W) ? value1.W : value2.W - ); + return Vector128.Max(value1.AsVector128(), value2.AsVector128()).AsVector4(); } /// Returns a vector whose elements are the minimum of each of the pairs of elements in two specified vectors. /// The first vector. /// The second vector. /// The minimized vector. - [Intrinsic] [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector4 Min(Vector4 value1, Vector4 value2) { - return new Vector4( - (value1.X < value2.X) ? value1.X : value2.X, - (value1.Y < value2.Y) ? value1.Y : value2.Y, - (value1.Z < value2.Z) ? value1.Z : value2.Z, - (value1.W < value2.W) ? value1.W : value2.W - ); + return Vector128.Min(value1.AsVector128(), value2.AsVector128()).AsVector4(); } /// Returns a new vector whose values are the product of each pair of elements in two specified vectors. /// The first vector. /// The second vector. /// The element-wise product vector. - [Intrinsic] [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector4 Multiply(Vector4 left, Vector4 right) { @@ -446,7 +371,6 @@ public static Vector4 Multiply(Vector4 left, Vector4 right) /// The vector to multiply. /// The scalar value. /// The scaled vector. - [Intrinsic] [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector4 Multiply(Vector4 left, float right) { @@ -457,7 +381,6 @@ public static Vector4 Multiply(Vector4 left, float right) /// The scaled value. /// The vector. /// The scaled vector. - [Intrinsic] [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector4 Multiply(float left, Vector4 right) { @@ -467,7 +390,6 @@ public static Vector4 Multiply(float left, Vector4 right) /// Negates a specified vector. /// The vector to negate. /// The negated vector. - [Intrinsic] [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector4 Negate(Vector4 value) { @@ -477,7 +399,6 @@ public static Vector4 Negate(Vector4 value) /// Returns a vector with the same direction as the specified vector, but with a length of one. /// The vector to normalize. /// The normalized vector. - [Intrinsic] [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector4 Normalize(Vector4 vector) { @@ -487,23 +408,16 @@ public static Vector4 Normalize(Vector4 vector) /// Returns a vector whose elements are the square root of each of a specified vector's elements. /// A vector. /// The square root vector. - [Intrinsic] [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector4 SquareRoot(Vector4 value) { - return new Vector4( - MathF.Sqrt(value.X), - MathF.Sqrt(value.Y), - MathF.Sqrt(value.Z), - MathF.Sqrt(value.W) - ); + return Vector128.Sqrt(value.AsVector128()).AsVector4(); } /// Subtracts the second vector from the first. /// The first vector. /// The second vector. /// The difference vector. - [Intrinsic] [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector4 Subtract(Vector4 left, Vector4 right) { @@ -664,14 +578,7 @@ public static Vector4 Transform(Vector4 value, Quaternion rotation) [MethodImpl(MethodImplOptions.AggressiveInlining)] public readonly void CopyTo(float[] array) { - // We explicitly don't check for `null` because historically this has thrown `NullReferenceException` for perf reasons - - if (array.Length < Count) - { - ThrowHelper.ThrowArgumentException_DestinationTooShort(); - } - - Unsafe.WriteUnaligned(ref Unsafe.As(ref array[0]), this); + this.AsVector128().CopyTo(array); } /// Copies the elements of the vector to a specified array starting at a specified index position. @@ -687,19 +594,7 @@ public readonly void CopyTo(float[] array) [MethodImpl(MethodImplOptions.AggressiveInlining)] public readonly void CopyTo(float[] array, int index) { - // We explicitly don't check for `null` because historically this has thrown `NullReferenceException` for perf reasons - - if ((uint)index >= (uint)array.Length) - { - ThrowHelper.ThrowStartIndexArgumentOutOfRange_ArgumentOutOfRange_IndexMustBeLess(); - } - - if ((array.Length - index) < Count) - { - ThrowHelper.ThrowArgumentException_DestinationTooShort(); - } - - Unsafe.WriteUnaligned(ref Unsafe.As(ref array[index]), this); + this.AsVector128().CopyTo(array, index); } /// Copies the vector to the given . The length of the destination span must be at least 4. @@ -708,12 +603,7 @@ public readonly void CopyTo(float[] array, int index) [MethodImpl(MethodImplOptions.AggressiveInlining)] public readonly void CopyTo(Span destination) { - if (destination.Length < Count) - { - ThrowHelper.ThrowArgumentException_DestinationTooShort(); - } - - Unsafe.WriteUnaligned(ref Unsafe.As(ref MemoryMarshal.GetReference(destination)), this); + this.AsVector128().CopyTo(destination); } /// Attempts to copy the vector to the given . The length of the destination span must be at least 4. @@ -722,13 +612,7 @@ public readonly void CopyTo(Span destination) [MethodImpl(MethodImplOptions.AggressiveInlining)] public readonly bool TryCopyTo(Span destination) { - if (destination.Length < Count) - { - return false; - } - - Unsafe.WriteUnaligned(ref Unsafe.As(ref MemoryMarshal.GetReference(destination)), this); - return true; + return this.AsVector128().TryCopyTo(destination); } /// Returns a value that indicates whether this instance and another vector are equal. @@ -738,23 +622,7 @@ public readonly bool TryCopyTo(Span destination) [MethodImpl(MethodImplOptions.AggressiveInlining)] public readonly bool Equals(Vector4 other) { - // This function needs to account for floating-point equality around NaN - // and so must behave equivalently to the underlying float/double.Equals - - if (Vector128.IsHardwareAccelerated) - { - return this.AsVector128().Equals(other.AsVector128()); - } - - return SoftwareFallback(in this, other); - - static bool SoftwareFallback(in Vector4 self, Vector4 other) - { - return self.X.Equals(other.X) - && self.Y.Equals(other.Y) - && self.Z.Equals(other.Z) - && self.W.Equals(other.W); - } + return this.AsVector128().Equals(other.AsVector128()); } /// Returns a value that indicates whether this instance and a specified object are equal. @@ -777,19 +645,16 @@ public override readonly int GetHashCode() /// Returns the length of this vector object. /// The vector's length. /// - [Intrinsic] [MethodImpl(MethodImplOptions.AggressiveInlining)] public readonly float Length() { - float lengthSquared = LengthSquared(); - return MathF.Sqrt(lengthSquared); + return MathF.Sqrt(LengthSquared()); } /// Returns the length of the vector squared. /// The vector's length squared. /// This operation offers better performance than a call to the method. /// - [Intrinsic] [MethodImpl(MethodImplOptions.AggressiveInlining)] public readonly float LengthSquared() { diff --git a/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Vector128.cs b/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Vector128.cs index 4080b06c92b77b..9c44a3ceafa396 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Vector128.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Vector128.cs @@ -253,10 +253,9 @@ public static Vector128 AsVector128(this Vector3 value) /// Reinterprets a as a new . /// The vector to reinterpret. /// reinterpreted as a new . - [Intrinsic] [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector128 AsVector128(this Vector4 value) - => Unsafe.As>(ref value); + => Unsafe.BitCast>(value); /// Reinterprets a as a new . /// The type of the elements in the vector. @@ -299,10 +298,9 @@ public static Vector3 AsVector3(this Vector128 value) /// Reinterprets a as a new . /// The vector to reinterpret. /// reinterpreted as a new . - [Intrinsic] [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector4 AsVector4(this Vector128 value) - => Unsafe.As, Vector4>(ref value); + => Unsafe.BitCast, Vector4>(value); /// Reinterprets a as a new . /// The type of the elements in the vector. From c4bef1f3727e20190e17f018a7deb055431b22a1 Mon Sep 17 00:00:00 2001 From: Tanner Gooding Date: Wed, 15 May 2024 21:50:03 -0700 Subject: [PATCH 2/9] Change Plane to be implemented entirely in managed --- src/coreclr/jit/simdashwintrinsic.cpp | 15 ------------ src/coreclr/jit/simdashwintrinsiclistarm64.h | 12 ---------- src/coreclr/jit/simdashwintrinsiclistxarch.h | 12 ---------- .../src/System/Numerics/Plane.cs | 23 ++++--------------- .../src/System/Numerics/Vector4.Extensions.cs | 7 ++++++ .../System/Runtime/Intrinsics/Vector128.cs | 10 ++++++-- 6 files changed, 20 insertions(+), 59 deletions(-) diff --git a/src/coreclr/jit/simdashwintrinsic.cpp b/src/coreclr/jit/simdashwintrinsic.cpp index ceaa9675446b69..202d4ef0d07645 100644 --- a/src/coreclr/jit/simdashwintrinsic.cpp +++ b/src/coreclr/jit/simdashwintrinsic.cpp @@ -1414,16 +1414,6 @@ GenTree* Compiler::impSimdAsHWIntrinsicSpecial(NamedIntrinsic intrinsic, return gtNewSimdCreateSequenceNode(simdType, op1, op2, simdBaseJitType, simdSize); } - case NI_Plane_CreateFromVector4: - { - assert(retType == TYP_VOID); - - copyBlkDst = op1; - copyBlkSrc = op2; - - break; - } - case NI_Vector2_Distance: case NI_Vector3_Distance: { @@ -1463,7 +1453,6 @@ GenTree* Compiler::impSimdAsHWIntrinsicSpecial(NamedIntrinsic intrinsic, return gtNewSimdBinOpNode(GT_DIV, retType, op1, op2, simdBaseJitType, simdSize); } - case NI_Plane_Dot: case NI_Quaternion_Dot: case NI_Vector2_Dot: case NI_Vector3_Dot: @@ -1478,7 +1467,6 @@ GenTree* Compiler::impSimdAsHWIntrinsicSpecial(NamedIntrinsic intrinsic, return gtNewSimdCmpOpNode(GT_EQ, retType, op1, op2, simdBaseJitType, simdSize); } - case NI_Plane_op_Equality: case NI_Quaternion_op_Equality: case NI_Vector2_op_Equality: case NI_Vector3_op_Equality: @@ -1541,7 +1529,6 @@ GenTree* Compiler::impSimdAsHWIntrinsicSpecial(NamedIntrinsic intrinsic, return gtNewSimdCmpOpAnyNode(GT_GE, retType, op1, op2, simdBaseJitType, simdSize); } - case NI_Plane_op_Inequality: case NI_Quaternion_op_Inequality: case NI_Vector2_op_Inequality: case NI_Vector3_op_Inequality: @@ -1866,7 +1853,6 @@ GenTree* Compiler::impSimdAsHWIntrinsicSpecial(NamedIntrinsic intrinsic, break; } - case NI_Plane_CreateFromVector3: case NI_Quaternion_CreateFromVector3: case NI_Vector3_CreateFromVector2: { @@ -2049,7 +2035,6 @@ GenTree* Compiler::impSimdAsHWIntrinsicSpecial(NamedIntrinsic intrinsic, switch (intrinsic) { - case NI_Plane_Create: case NI_Quaternion_Create: { assert(retType == TYP_VOID); diff --git a/src/coreclr/jit/simdashwintrinsiclistarm64.h b/src/coreclr/jit/simdashwintrinsiclistarm64.h index ed5f01b962980f..09ef146fd83d6b 100644 --- a/src/coreclr/jit/simdashwintrinsiclistarm64.h +++ b/src/coreclr/jit/simdashwintrinsiclistarm64.h @@ -32,18 +32,6 @@ * Each intrinsic has one or more flags with type of `enum SimdAsHWIntrinsicFlag` */ -// ************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************* -// ISA ID Name NumArg Instructions Flags -// {TYP_BYTE, TYP_UBYTE, TYP_SHORT, TYP_USHORT, TYP_INT, TYP_UINT, TYP_LONG, TYP_ULONG, TYP_FLOAT, TYP_DOUBLE} -// ************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************* -// Plane Intrinsics -SIMD_AS_HWINTRINSIC_NM(Plane, Create, ".ctor", 5, {NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Plane_Create, NI_Illegal}, SimdAsHWIntrinsicFlag::InstanceMethod | SimdAsHWIntrinsicFlag::SpillSideEffectsOp1) -SIMD_AS_HWINTRINSIC_NM(Plane, CreateFromVector3, ".ctor", 3, {NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Plane_CreateFromVector3, NI_Illegal}, SimdAsHWIntrinsicFlag::InstanceMethod | SimdAsHWIntrinsicFlag::SpillSideEffectsOp1 | SimdAsHWIntrinsicFlag::BaseTypeFromThisArg) -SIMD_AS_HWINTRINSIC_NM(Plane, CreateFromVector4, ".ctor", 2, {NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Plane_CreateFromVector4, NI_Illegal}, SimdAsHWIntrinsicFlag::InstanceMethod | SimdAsHWIntrinsicFlag::SpillSideEffectsOp1 | SimdAsHWIntrinsicFlag::BaseTypeFromThisArg) -SIMD_AS_HWINTRINSIC_ID(Plane, Dot, 2, {NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Plane_Dot, NI_Illegal}, SimdAsHWIntrinsicFlag::None) -SIMD_AS_HWINTRINSIC_ID(Plane, op_Equality, 2, {NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Plane_op_Equality, NI_Illegal}, SimdAsHWIntrinsicFlag::None) -SIMD_AS_HWINTRINSIC_ID(Plane, op_Inequality, 2, {NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Plane_op_Inequality, NI_Illegal}, SimdAsHWIntrinsicFlag::None) - // ************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************* // ISA ID Name NumArg Instructions Flags // {TYP_BYTE, TYP_UBYTE, TYP_SHORT, TYP_USHORT, TYP_INT, TYP_UINT, TYP_LONG, TYP_ULONG, TYP_FLOAT, TYP_DOUBLE} diff --git a/src/coreclr/jit/simdashwintrinsiclistxarch.h b/src/coreclr/jit/simdashwintrinsiclistxarch.h index ae46c87c867801..2c89735892881f 100644 --- a/src/coreclr/jit/simdashwintrinsiclistxarch.h +++ b/src/coreclr/jit/simdashwintrinsiclistxarch.h @@ -32,18 +32,6 @@ * Each intrinsic has one or more flags with type of `enum SimdAsHWIntrinsicFlag` */ -// ************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************* -// ISA ID Name NumArg Instructions Flags -// {TYP_BYTE, TYP_UBYTE, TYP_SHORT, TYP_USHORT, TYP_INT, TYP_UINT, TYP_LONG, TYP_ULONG, TYP_FLOAT, TYP_DOUBLE} -// ************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************* -// Plane Intrinsics -SIMD_AS_HWINTRINSIC_NM(Plane, Create, ".ctor", 5, {NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Plane_Create, NI_Illegal}, SimdAsHWIntrinsicFlag::InstanceMethod | SimdAsHWIntrinsicFlag::SpillSideEffectsOp1) -SIMD_AS_HWINTRINSIC_NM(Plane, CreateFromVector3, ".ctor", 3, {NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Plane_CreateFromVector3, NI_Illegal}, SimdAsHWIntrinsicFlag::InstanceMethod | SimdAsHWIntrinsicFlag::SpillSideEffectsOp1 | SimdAsHWIntrinsicFlag::BaseTypeFromThisArg) -SIMD_AS_HWINTRINSIC_NM(Plane, CreateFromVector4, ".ctor", 2, {NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Plane_CreateFromVector4, NI_Illegal}, SimdAsHWIntrinsicFlag::InstanceMethod | SimdAsHWIntrinsicFlag::BaseTypeFromThisArg) -SIMD_AS_HWINTRINSIC_ID(Plane, Dot, 2, {NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Plane_Dot, NI_Illegal}, SimdAsHWIntrinsicFlag::None) -SIMD_AS_HWINTRINSIC_ID(Plane, op_Equality, 2, {NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Plane_op_Equality, NI_Illegal}, SimdAsHWIntrinsicFlag::None) -SIMD_AS_HWINTRINSIC_ID(Plane, op_Inequality, 2, {NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Plane_op_Inequality, NI_Illegal}, SimdAsHWIntrinsicFlag::None) - // ************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************* // ISA ID Name NumArg Instructions Flags // {TYP_BYTE, TYP_UBYTE, TYP_SHORT, TYP_USHORT, TYP_INT, TYP_UINT, TYP_LONG, TYP_ULONG, TYP_FLOAT, TYP_DOUBLE} diff --git a/src/libraries/System.Private.CoreLib/src/System/Numerics/Plane.cs b/src/libraries/System.Private.CoreLib/src/System/Numerics/Plane.cs index a4636a6e76a15f..367fcce66314af 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Numerics/Plane.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Numerics/Plane.cs @@ -27,30 +27,24 @@ public struct Plane : IEquatable /// The Y component of the normal. /// The Z component of the normal. /// The distance of the plane along its normal from the origin. - [Intrinsic] public Plane(float x, float y, float z, float d) { - Normal = new Vector3(x, y, z); - D = d; + this = Vector128.Create(x, y, z, d).AsPlane(); } /// Creates a object from a specified normal and the distance along the normal from the origin. /// The plane's normal vector. /// The plane's distance from the origin along its normal vector. - [Intrinsic] public Plane(Vector3 normal, float d) { - Normal = normal; - D = d; + this = new Vector4(normal, d).AsPlane(); } /// Creates a object from a specified four-dimensional vector. /// A vector whose first three elements describe the normal vector, and whose defines the distance along that normal from the origin. - [Intrinsic] public Plane(Vector4 value) { - Normal = new Vector3(value.X, value.Y, value.Z); - D = value.W; + this = value.AsPlane(); } /// Creates a object that contains three specified points. @@ -109,14 +103,10 @@ public static Plane CreateFromVertices(Vector3 point1, Vector3 point2, Vector3 p /// The plane. /// The four-dimensional vector. /// The dot product. - [Intrinsic] [MethodImpl(MethodImplOptions.AggressiveInlining)] public static float Dot(Plane plane, Vector4 value) { - return (plane.Normal.X * value.X) - + (plane.Normal.Y * value.Y) - + (plane.Normal.Z * value.Z) - + (plane.D * value.W); + return Vector128.Dot(plane.AsVector128(), value.AsVector128()); } /// Returns the dot product of a specified three-dimensional vector and the normal vector of this plane plus the distance () value of the plane. @@ -265,12 +255,10 @@ public static Plane Transform(Plane plane, Quaternion rotation) /// if and are equal; otherwise, . /// Two objects are equal if their and fields are equal. /// The method defines the operation of the equality operator for objects. - [Intrinsic] [MethodImpl(MethodImplOptions.AggressiveInlining)] public static bool operator ==(Plane value1, Plane value2) { - return (value1.Normal == value2.Normal) - && (value1.D == value2.D); + return value1.AsVector128() == value2.AsVector128(); } /// Returns a value that indicates whether two planes are not equal. @@ -278,7 +266,6 @@ public static Plane Transform(Plane plane, Quaternion rotation) /// The second plane to compare. /// if and are not equal; otherwise, . /// The method defines the operation of the inequality operator for objects. - [Intrinsic] [MethodImpl(MethodImplOptions.AggressiveInlining)] public static bool operator !=(Plane value1, Plane value2) { diff --git a/src/libraries/System.Private.CoreLib/src/System/Numerics/Vector4.Extensions.cs b/src/libraries/System.Private.CoreLib/src/System/Numerics/Vector4.Extensions.cs index 7a9442b7d12560..78aeb44cb2e8ee 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Numerics/Vector4.Extensions.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Numerics/Vector4.Extensions.cs @@ -9,6 +9,13 @@ namespace System.Numerics { public static unsafe partial class Vector { + /// Reinterprets a as a new . + /// The vector to reinterpret. + /// reinterpreted as a new . + [MethodImpl(MethodImplOptions.AggressiveInlining)] + internal static Plane AsPlane(this Vector4 value) + => Unsafe.BitCast(value); + /// Gets the element at the specified index. /// The vector to get the element from. /// The index of the element to get. diff --git a/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Vector128.cs b/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Vector128.cs index 9c44a3ceafa396..2226ecd767544c 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Vector128.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Vector128.cs @@ -169,6 +169,13 @@ public static Vector128 As(this Vector128 vector) [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector128 AsNUInt(this Vector128 vector) => vector.As(); + /// Reinterprets a as a new . + /// The vector to reinterpret. + /// reinterpreted as a new . + [MethodImpl(MethodImplOptions.AggressiveInlining)] + internal static Plane AsPlane(this Vector128 value) + => Unsafe.BitCast, Plane>(value); + /// Reinterprets a as a new . /// The type of the elements in the vector. /// The vector to reinterpret. @@ -221,10 +228,9 @@ public static Vector128 As(this Vector128 vector) /// Reinterprets a as a new . /// The plane to reinterpret. /// reinterpreted as a new . - [Intrinsic] [MethodImpl(MethodImplOptions.AggressiveInlining)] internal static Vector128 AsVector128(this Plane value) - => Unsafe.As>(ref value); + => Unsafe.BitCast>(value); /// Reinterprets a as a new . /// The quaternion to reinterpret. From 10c5dfdd4da28e26744a7e719ef1b1f0f1ebcc14 Mon Sep 17 00:00:00 2001 From: Tanner Gooding Date: Wed, 15 May 2024 22:14:43 -0700 Subject: [PATCH 3/9] Change Quaternion to be implemented entirely in managed --- src/coreclr/jit/simdashwintrinsic.cpp | 162 ------------------ src/coreclr/jit/simdashwintrinsiclistarm64.h | 30 ---- src/coreclr/jit/simdashwintrinsiclistxarch.h | 30 ---- .../System/Numerics/Quaternion.Extensions.cs | 19 +- .../src/System/Numerics/Quaternion.cs | 123 ++----------- .../src/System/Numerics/Vector4.Extensions.cs | 7 + .../System/Runtime/Intrinsics/Vector128.cs | 10 +- 7 files changed, 31 insertions(+), 350 deletions(-) diff --git a/src/coreclr/jit/simdashwintrinsic.cpp b/src/coreclr/jit/simdashwintrinsic.cpp index 202d4ef0d07645..cfe0c105e8ba33 100644 --- a/src/coreclr/jit/simdashwintrinsic.cpp +++ b/src/coreclr/jit/simdashwintrinsic.cpp @@ -714,7 +714,6 @@ GenTree* Compiler::impSimdAsHWIntrinsicSpecial(NamedIntrinsic intrinsic, break; } - case NI_Quaternion_WithElement: case NI_Vector2_WithElement: case NI_Vector3_WithElement: case NI_VectorT_WithElement: @@ -797,7 +796,6 @@ GenTree* Compiler::impSimdAsHWIntrinsicSpecial(NamedIntrinsic intrinsic, break; } - case NI_Quaternion_WithElement: case NI_Vector2_WithElement: case NI_Vector3_WithElement: case NI_VectorT_WithElement: @@ -948,19 +946,6 @@ GenTree* Compiler::impSimdAsHWIntrinsicSpecial(NamedIntrinsic intrinsic, return vecCon; } - case NI_Quaternion_get_Identity: - { - GenTreeVecCon* vecCon = gtNewVconNode(retType); - - vecCon->gtSimdVal.f32[0] = 0.0f; - vecCon->gtSimdVal.f32[1] = 0.0f; - vecCon->gtSimdVal.f32[2] = 0.0f; - vecCon->gtSimdVal.f32[3] = 1.0f; - - return vecCon; - } - - case NI_Quaternion_get_Zero: case NI_Vector2_get_Zero: case NI_Vector3_get_Zero: case NI_VectorT_get_Zero: @@ -1014,47 +999,11 @@ GenTree* Compiler::impSimdAsHWIntrinsicSpecial(NamedIntrinsic intrinsic, return gtNewSimdCeilNode(retType, op1, simdBaseJitType, simdSize); } - case NI_Quaternion_Conjugate: - { - GenTreeVecCon* vecCon = gtNewVconNode(retType); - - vecCon->gtSimdVal.f32[0] = -1.0f; - vecCon->gtSimdVal.f32[1] = -1.0f; - vecCon->gtSimdVal.f32[2] = -1.0f; - vecCon->gtSimdVal.f32[3] = +1.0f; - - return gtNewSimdBinOpNode(GT_MUL, retType, op1, vecCon, simdBaseJitType, simdSize); - } - case NI_VectorT_Floor: { return gtNewSimdFloorNode(retType, op1, simdBaseJitType, simdSize); } - case NI_Quaternion_Inverse: - { - GenTree* clonedOp1; - op1 = impCloneExpr(op1, &clonedOp1, CHECK_SPILL_ALL, - nullptr DEBUGARG("Clone op1 for quaternion inverse (1)")); - - GenTree* clonedOp2; - clonedOp1 = impCloneExpr(clonedOp1, &clonedOp2, CHECK_SPILL_ALL, - nullptr DEBUGARG("Clone op1 for quaternion inverse (2)")); - - GenTreeVecCon* vecCon = gtNewVconNode(retType); - - vecCon->gtSimdVal.f32[0] = -1.0f; - vecCon->gtSimdVal.f32[1] = -1.0f; - vecCon->gtSimdVal.f32[2] = -1.0f; - vecCon->gtSimdVal.f32[3] = +1.0f; - - GenTree* conjugate = gtNewSimdBinOpNode(GT_MUL, retType, op1, vecCon, simdBaseJitType, simdSize); - op1 = gtNewSimdDotProdNode(retType, clonedOp1, clonedOp2, simdBaseJitType, simdSize); - - return gtNewSimdBinOpNode(GT_DIV, retType, conjugate, op1, simdBaseJitType, simdSize); - } - - case NI_Quaternion_Length: case NI_Vector2_Length: case NI_Vector3_Length: { @@ -1068,7 +1017,6 @@ GenTree* Compiler::impSimdAsHWIntrinsicSpecial(NamedIntrinsic intrinsic, return gtNewSimdGetElementNode(retType, op1, gtNewIconNode(0), simdBaseJitType, simdSize); } - case NI_Quaternion_LengthSquared: case NI_Vector2_LengthSquared: case NI_Vector3_LengthSquared: { @@ -1114,8 +1062,6 @@ GenTree* Compiler::impSimdAsHWIntrinsicSpecial(NamedIntrinsic intrinsic, return gtNewSimdLoadNonTemporalNode(retType, op1, simdBaseJitType, simdSize); } - case NI_Quaternion_Negate: - case NI_Quaternion_op_UnaryNegation: case NI_Vector2_Negate: case NI_Vector2_op_UnaryNegation: case NI_Vector3_Negate: @@ -1126,7 +1072,6 @@ GenTree* Compiler::impSimdAsHWIntrinsicSpecial(NamedIntrinsic intrinsic, return gtNewSimdUnOpNode(GT_NEG, retType, op1, simdBaseJitType, simdSize); } - case NI_Quaternion_Normalize: case NI_Vector2_Normalize: case NI_Vector3_Normalize: { @@ -1369,8 +1314,6 @@ GenTree* Compiler::impSimdAsHWIntrinsicSpecial(NamedIntrinsic intrinsic, switch (intrinsic) { - case NI_Quaternion_Add: - case NI_Quaternion_op_Addition: case NI_Vector2_Add: case NI_Vector2_op_Addition: case NI_Vector3_Add: @@ -1442,7 +1385,6 @@ GenTree* Compiler::impSimdAsHWIntrinsicSpecial(NamedIntrinsic intrinsic, return gtNewSimdGetElementNode(retType, op1, gtNewIconNode(0), simdBaseJitType, simdSize); } - case NI_Quaternion_Divide: case NI_Vector2_Divide: case NI_Vector2_op_Division: case NI_Vector3_Divide: @@ -1453,7 +1395,6 @@ GenTree* Compiler::impSimdAsHWIntrinsicSpecial(NamedIntrinsic intrinsic, return gtNewSimdBinOpNode(GT_DIV, retType, op1, op2, simdBaseJitType, simdSize); } - case NI_Quaternion_Dot: case NI_Vector2_Dot: case NI_Vector3_Dot: case NI_VectorT_Dot: @@ -1467,7 +1408,6 @@ GenTree* Compiler::impSimdAsHWIntrinsicSpecial(NamedIntrinsic intrinsic, return gtNewSimdCmpOpNode(GT_EQ, retType, op1, op2, simdBaseJitType, simdSize); } - case NI_Quaternion_op_Equality: case NI_Vector2_op_Equality: case NI_Vector3_op_Equality: case NI_VectorT_EqualsAll: @@ -1487,8 +1427,6 @@ GenTree* Compiler::impSimdAsHWIntrinsicSpecial(NamedIntrinsic intrinsic, return gtNewSimdBinOpNode(GT_XOR, retType, op1, op2, simdBaseJitType, simdSize); } - case NI_Quaternion_get_Item: - case NI_Quaternion_GetElement: case NI_Vector2_get_Item: case NI_Vector2_GetElement: case NI_Vector3_get_Item: @@ -1529,7 +1467,6 @@ GenTree* Compiler::impSimdAsHWIntrinsicSpecial(NamedIntrinsic intrinsic, return gtNewSimdCmpOpAnyNode(GT_GE, retType, op1, op2, simdBaseJitType, simdSize); } - case NI_Quaternion_op_Inequality: case NI_Vector2_op_Inequality: case NI_Vector3_op_Inequality: case NI_VectorT_op_Inequality: @@ -1598,8 +1535,6 @@ GenTree* Compiler::impSimdAsHWIntrinsicSpecial(NamedIntrinsic intrinsic, return gtNewSimdMinNode(retType, op1, op2, simdBaseJitType, simdSize); } - case NI_Quaternion_Multiply: - case NI_Quaternion_op_Multiply: case NI_Vector2_Multiply: case NI_Vector2_op_Multiply: case NI_Vector3_Multiply: @@ -1674,8 +1609,6 @@ GenTree* Compiler::impSimdAsHWIntrinsicSpecial(NamedIntrinsic intrinsic, return gtNewSimdStoreNonTemporalNode(op2, op1, simdBaseJitType, simdSize); } - case NI_Quaternion_Subtract: - case NI_Quaternion_op_Subtraction: case NI_Vector2_Subtract: case NI_Vector2_op_Subtraction: case NI_Vector3_Subtract: @@ -1853,7 +1786,6 @@ GenTree* Compiler::impSimdAsHWIntrinsicSpecial(NamedIntrinsic intrinsic, break; } - case NI_Quaternion_CreateFromVector3: case NI_Vector3_CreateFromVector2: { assert(retType == TYP_VOID); @@ -1889,7 +1821,6 @@ GenTree* Compiler::impSimdAsHWIntrinsicSpecial(NamedIntrinsic intrinsic, break; } - case NI_Quaternion_WithElement: case NI_Vector2_WithElement: case NI_Vector3_WithElement: case NI_VectorT_WithElement: @@ -1993,99 +1924,6 @@ GenTree* Compiler::impSimdAsHWIntrinsicSpecial(NamedIntrinsic intrinsic, } break; } - - case 5: - { - assert(isInstanceMethod); - assert(SimdAsHWIntrinsicInfo::SpillSideEffectsOp1(intrinsic)); - assert(!SimdAsHWIntrinsicInfo::SpillSideEffectsOp2(intrinsic)); - - if (newobjThis == nullptr) - { - impSpillSideEffect(true, verCurrentState.esStackDepth - - 5 DEBUGARG("Spilling op1 side effects for SimdAsHWIntrinsic")); - } - - CORINFO_ARG_LIST_HANDLE arg2 = argList; - CORINFO_ARG_LIST_HANDLE arg3 = info.compCompHnd->getArgNext(arg2); - CORINFO_ARG_LIST_HANDLE arg4 = info.compCompHnd->getArgNext(arg3); - CORINFO_ARG_LIST_HANDLE arg5 = info.compCompHnd->getArgNext(arg4); - - argType = JITtype2varType(strip(info.compCompHnd->getArgType(sig, arg5, &argClass))); - op5 = getArgForHWIntrinsic(argType, argClass); - - argType = JITtype2varType(strip(info.compCompHnd->getArgType(sig, arg4, &argClass))); - op4 = getArgForHWIntrinsic(argType, argClass); - - argType = JITtype2varType(strip(info.compCompHnd->getArgType(sig, arg3, &argClass))); - op3 = getArgForHWIntrinsic(argType, argClass); - - argType = JITtype2varType(strip(info.compCompHnd->getArgType(sig, arg2, &argClass))); - op2 = getArgForHWIntrinsic(argType, argClass); - - if ((newobjThis == nullptr) && (retType == TYP_VOID)) - { - op1 = getArgForHWIntrinsic(TYP_BYREF, argClass, isInstanceMethod, newobjThis); - } - else - { - op1 = getArgForHWIntrinsic(simdType, (newobjThis != nullptr) ? clsHnd : argClass, isInstanceMethod, - newobjThis); - } - - switch (intrinsic) - { - case NI_Quaternion_Create: - { - assert(retType == TYP_VOID); - assert(simdBaseType == TYP_FLOAT); - assert(simdSize == 16); - - if (op2->IsCnsFltOrDbl() && op3->IsCnsFltOrDbl() && op4->IsCnsFltOrDbl() && op5->IsCnsFltOrDbl()) - { - GenTreeVecCon* vecCon = gtNewVconNode(TYP_SIMD16); - - float cnsVal = 0; - - vecCon->gtSimdVal.f32[0] = static_cast(op2->AsDblCon()->DconValue()); - vecCon->gtSimdVal.f32[1] = static_cast(op3->AsDblCon()->DconValue()); - vecCon->gtSimdVal.f32[2] = static_cast(op4->AsDblCon()->DconValue()); - vecCon->gtSimdVal.f32[3] = static_cast(op5->AsDblCon()->DconValue()); - - copyBlkSrc = vecCon; - } - else if (areArgumentsContiguous(op2, op3) && areArgumentsContiguous(op3, op4) && - areArgumentsContiguous(op4, op5)) - { - GenTree* op2Address = CreateAddressNodeForSimdHWIntrinsicCreate(op2, simdBaseType, 16); - copyBlkSrc = gtNewIndir(TYP_SIMD16, op2Address); - } - else - { - IntrinsicNodeBuilder nodeBuilder(getAllocator(CMK_ASTNode), 4); - - nodeBuilder.AddOperand(0, op2); - nodeBuilder.AddOperand(1, op3); - nodeBuilder.AddOperand(2, op4); - nodeBuilder.AddOperand(3, op5); - - copyBlkSrc = gtNewSimdHWIntrinsicNode(TYP_SIMD16, std::move(nodeBuilder), NI_Vector128_Create, - simdBaseJitType, 16); - } - - copyBlkDst = op1; - break; - } - - default: - { - // Some platforms warn about unhandled switch cases - // We handle it more generally via the assert and nullptr return below. - break; - } - } - break; - } } if (copyBlkDst != nullptr) diff --git a/src/coreclr/jit/simdashwintrinsiclistarm64.h b/src/coreclr/jit/simdashwintrinsiclistarm64.h index 09ef146fd83d6b..4e6cda928a2782 100644 --- a/src/coreclr/jit/simdashwintrinsiclistarm64.h +++ b/src/coreclr/jit/simdashwintrinsiclistarm64.h @@ -32,36 +32,6 @@ * Each intrinsic has one or more flags with type of `enum SimdAsHWIntrinsicFlag` */ -// ************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************* -// ISA ID Name NumArg Instructions Flags -// {TYP_BYTE, TYP_UBYTE, TYP_SHORT, TYP_USHORT, TYP_INT, TYP_UINT, TYP_LONG, TYP_ULONG, TYP_FLOAT, TYP_DOUBLE} -// ************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************* -// Quaternion Intrinsics -SIMD_AS_HWINTRINSIC_ID(Quaternion, Add, 2, {NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Quaternion_Add, NI_Illegal}, SimdAsHWIntrinsicFlag::None) -SIMD_AS_HWINTRINSIC_ID(Quaternion, Conjugate, 1, {NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Quaternion_Conjugate, NI_Illegal}, SimdAsHWIntrinsicFlag::None) -SIMD_AS_HWINTRINSIC_NM(Quaternion, Create, ".ctor", 5, {NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Quaternion_Create, NI_Illegal}, SimdAsHWIntrinsicFlag::InstanceMethod | SimdAsHWIntrinsicFlag::SpillSideEffectsOp1) -SIMD_AS_HWINTRINSIC_NM(Quaternion, CreateFromVector3, ".ctor", 3, {NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Quaternion_CreateFromVector3, NI_Illegal}, SimdAsHWIntrinsicFlag::InstanceMethod | SimdAsHWIntrinsicFlag::SpillSideEffectsOp1 | SimdAsHWIntrinsicFlag::BaseTypeFromThisArg) -SIMD_AS_HWINTRINSIC_ID(Quaternion, Divide, 2, {NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Quaternion_Divide, NI_Illegal}, SimdAsHWIntrinsicFlag::None) -SIMD_AS_HWINTRINSIC_ID(Quaternion, Dot, 2, {NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Quaternion_Dot, NI_Illegal}, SimdAsHWIntrinsicFlag::None) -SIMD_AS_HWINTRINSIC_ID(Quaternion, get_Identity, 0, {NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Quaternion_get_Identity, NI_Illegal}, SimdAsHWIntrinsicFlag::None) -SIMD_AS_HWINTRINSIC_ID(Quaternion, get_Item, 0, {NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Quaternion_get_Item, NI_Illegal}, SimdAsHWIntrinsicFlag::InstanceMethod | SimdAsHWIntrinsicFlag::BaseTypeFromThisArg) -SIMD_AS_HWINTRINSIC_ID(Quaternion, get_Zero, 0, {NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Quaternion_get_Zero, NI_Illegal}, SimdAsHWIntrinsicFlag::None) -SIMD_AS_HWINTRINSIC_ID(Quaternion, GetElement, 2, {NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Quaternion_GetElement, NI_Illegal}, SimdAsHWIntrinsicFlag::None) -SIMD_AS_HWINTRINSIC_ID(Quaternion, Inverse, 1, {NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Quaternion_Inverse, NI_Illegal}, SimdAsHWIntrinsicFlag::None) -SIMD_AS_HWINTRINSIC_ID(Quaternion, Length, 1, {NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Quaternion_Length, NI_Illegal}, SimdAsHWIntrinsicFlag::InstanceMethod) -SIMD_AS_HWINTRINSIC_ID(Quaternion, LengthSquared, 1, {NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Quaternion_LengthSquared, NI_Illegal}, SimdAsHWIntrinsicFlag::InstanceMethod) -SIMD_AS_HWINTRINSIC_ID(Quaternion, Multiply, 2, {NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Quaternion_Multiply, NI_Illegal}, SimdAsHWIntrinsicFlag::None) -SIMD_AS_HWINTRINSIC_ID(Quaternion, Negate, 1, {NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Quaternion_Negate, NI_Illegal}, SimdAsHWIntrinsicFlag::None) -SIMD_AS_HWINTRINSIC_ID(Quaternion, Normalize, 1, {NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Quaternion_Normalize, NI_Illegal}, SimdAsHWIntrinsicFlag::None) -SIMD_AS_HWINTRINSIC_ID(Quaternion, op_Addition, 2, {NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Quaternion_op_Addition, NI_Illegal}, SimdAsHWIntrinsicFlag::None) -SIMD_AS_HWINTRINSIC_ID(Quaternion, op_Equality, 2, {NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Quaternion_op_Equality, NI_Illegal}, SimdAsHWIntrinsicFlag::None) -SIMD_AS_HWINTRINSIC_ID(Quaternion, op_Inequality, 2, {NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Quaternion_op_Inequality, NI_Illegal}, SimdAsHWIntrinsicFlag::None) -SIMD_AS_HWINTRINSIC_ID(Quaternion, op_Multiply, 2, {NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Quaternion_op_Multiply, NI_Illegal}, SimdAsHWIntrinsicFlag::None) -SIMD_AS_HWINTRINSIC_ID(Quaternion, op_Subtraction, 2, {NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Quaternion_op_Subtraction, NI_Illegal}, SimdAsHWIntrinsicFlag::None) -SIMD_AS_HWINTRINSIC_ID(Quaternion, op_UnaryNegation, 1, {NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Quaternion_op_UnaryNegation, NI_Illegal}, SimdAsHWIntrinsicFlag::None) -SIMD_AS_HWINTRINSIC_ID(Quaternion, Subtract, 2, {NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Quaternion_Subtract, NI_Illegal}, SimdAsHWIntrinsicFlag::None) -SIMD_AS_HWINTRINSIC_ID(Quaternion, WithElement, 3, {NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Quaternion_WithElement, NI_Illegal}, SimdAsHWIntrinsicFlag::None) - // ************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************* // ISA ID Name NumArg Instructions Flags // {TYP_BYTE, TYP_UBYTE, TYP_SHORT, TYP_USHORT, TYP_INT, TYP_UINT, TYP_LONG, TYP_ULONG, TYP_FLOAT, TYP_DOUBLE} diff --git a/src/coreclr/jit/simdashwintrinsiclistxarch.h b/src/coreclr/jit/simdashwintrinsiclistxarch.h index 2c89735892881f..26e58219a7814d 100644 --- a/src/coreclr/jit/simdashwintrinsiclistxarch.h +++ b/src/coreclr/jit/simdashwintrinsiclistxarch.h @@ -32,36 +32,6 @@ * Each intrinsic has one or more flags with type of `enum SimdAsHWIntrinsicFlag` */ -// ************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************* -// ISA ID Name NumArg Instructions Flags -// {TYP_BYTE, TYP_UBYTE, TYP_SHORT, TYP_USHORT, TYP_INT, TYP_UINT, TYP_LONG, TYP_ULONG, TYP_FLOAT, TYP_DOUBLE} -// ************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************* -// Quaternion Intrinsics -SIMD_AS_HWINTRINSIC_ID(Quaternion, Add, 2, {NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Quaternion_Add, NI_Illegal}, SimdAsHWIntrinsicFlag::None) -SIMD_AS_HWINTRINSIC_ID(Quaternion, Conjugate, 1, {NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Quaternion_Conjugate, NI_Illegal}, SimdAsHWIntrinsicFlag::None) -SIMD_AS_HWINTRINSIC_NM(Quaternion, Create, ".ctor", 5, {NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Quaternion_Create, NI_Illegal}, SimdAsHWIntrinsicFlag::InstanceMethod | SimdAsHWIntrinsicFlag::SpillSideEffectsOp1) -SIMD_AS_HWINTRINSIC_NM(Quaternion, CreateFromVector3, ".ctor", 3, {NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Quaternion_CreateFromVector3, NI_Illegal}, SimdAsHWIntrinsicFlag::InstanceMethod | SimdAsHWIntrinsicFlag::SpillSideEffectsOp1 | SimdAsHWIntrinsicFlag::BaseTypeFromThisArg) -SIMD_AS_HWINTRINSIC_ID(Quaternion, Divide, 2, {NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Quaternion_Divide, NI_Illegal}, SimdAsHWIntrinsicFlag::None) -SIMD_AS_HWINTRINSIC_ID(Quaternion, Dot, 2, {NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Quaternion_Dot, NI_Illegal}, SimdAsHWIntrinsicFlag::None) -SIMD_AS_HWINTRINSIC_ID(Quaternion, get_Identity, 0, {NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Quaternion_get_Identity, NI_Illegal}, SimdAsHWIntrinsicFlag::None) -SIMD_AS_HWINTRINSIC_ID(Quaternion, get_Item, 2, {NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Quaternion_get_Item, NI_Illegal}, SimdAsHWIntrinsicFlag::InstanceMethod | SimdAsHWIntrinsicFlag::BaseTypeFromThisArg) -SIMD_AS_HWINTRINSIC_ID(Quaternion, get_Zero, 0, {NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Quaternion_get_Zero, NI_Illegal}, SimdAsHWIntrinsicFlag::None) -SIMD_AS_HWINTRINSIC_ID(Quaternion, GetElement, 2, {NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Quaternion_GetElement, NI_Illegal}, SimdAsHWIntrinsicFlag::None) -SIMD_AS_HWINTRINSIC_ID(Quaternion, Inverse, 1, {NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Quaternion_Inverse, NI_Illegal}, SimdAsHWIntrinsicFlag::None) -SIMD_AS_HWINTRINSIC_ID(Quaternion, Length, 1, {NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Quaternion_Length, NI_Illegal}, SimdAsHWIntrinsicFlag::InstanceMethod) -SIMD_AS_HWINTRINSIC_ID(Quaternion, LengthSquared, 1, {NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Quaternion_LengthSquared, NI_Illegal}, SimdAsHWIntrinsicFlag::InstanceMethod) -SIMD_AS_HWINTRINSIC_ID(Quaternion, Multiply, 2, {NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Quaternion_Multiply, NI_Illegal}, SimdAsHWIntrinsicFlag::None) -SIMD_AS_HWINTRINSIC_ID(Quaternion, Negate, 1, {NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Quaternion_Negate, NI_Illegal}, SimdAsHWIntrinsicFlag::None) -SIMD_AS_HWINTRINSIC_ID(Quaternion, Normalize, 1, {NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Quaternion_Normalize, NI_Illegal}, SimdAsHWIntrinsicFlag::None) -SIMD_AS_HWINTRINSIC_ID(Quaternion, op_Addition, 2, {NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Quaternion_op_Addition, NI_Illegal}, SimdAsHWIntrinsicFlag::None) -SIMD_AS_HWINTRINSIC_ID(Quaternion, op_Equality, 2, {NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Quaternion_op_Equality, NI_Illegal}, SimdAsHWIntrinsicFlag::None) -SIMD_AS_HWINTRINSIC_ID(Quaternion, op_Inequality, 2, {NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Quaternion_op_Inequality, NI_Illegal}, SimdAsHWIntrinsicFlag::None) -SIMD_AS_HWINTRINSIC_ID(Quaternion, op_Multiply, 2, {NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Quaternion_op_Multiply, NI_Illegal}, SimdAsHWIntrinsicFlag::None) -SIMD_AS_HWINTRINSIC_ID(Quaternion, op_Subtraction, 2, {NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Quaternion_op_Subtraction, NI_Illegal}, SimdAsHWIntrinsicFlag::None) -SIMD_AS_HWINTRINSIC_ID(Quaternion, op_UnaryNegation, 1, {NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Quaternion_op_UnaryNegation, NI_Illegal}, SimdAsHWIntrinsicFlag::None) -SIMD_AS_HWINTRINSIC_ID(Quaternion, Subtract, 2, {NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Quaternion_Subtract, NI_Illegal}, SimdAsHWIntrinsicFlag::None) -SIMD_AS_HWINTRINSIC_ID(Quaternion, WithElement, 3, {NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Quaternion_WithElement, NI_Illegal}, SimdAsHWIntrinsicFlag::None) - // ************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************* // ISA ID Name NumArg Instructions Flags // {TYP_BYTE, TYP_UBYTE, TYP_SHORT, TYP_USHORT, TYP_INT, TYP_UINT, TYP_LONG, TYP_ULONG, TYP_FLOAT, TYP_DOUBLE} diff --git a/src/libraries/System.Private.CoreLib/src/System/Numerics/Quaternion.Extensions.cs b/src/libraries/System.Private.CoreLib/src/System/Numerics/Quaternion.Extensions.cs index 7c0e561c2edec1..8c9f6cb0c99368 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Numerics/Quaternion.Extensions.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Numerics/Quaternion.Extensions.cs @@ -3,6 +3,7 @@ using System.Diagnostics; using System.Runtime.CompilerServices; +using System.Runtime.Intrinsics; namespace System.Numerics { @@ -13,16 +14,10 @@ public static unsafe partial class Vector /// The index of the element to get. /// The value of the element at . /// was less than zero or greater than the number of elements. - [Intrinsic] [MethodImpl(MethodImplOptions.AggressiveInlining)] internal static float GetElement(this Quaternion quaternion, int index) { - if ((uint)(index) >= (uint)(Quaternion.Count)) - { - ThrowHelper.ThrowArgumentOutOfRangeException(ExceptionArgument.index); - } - - return quaternion.GetElementUnsafe(index); + return quaternion.AsVector128().GetElement(index); } /// Creates a new with the element at the specified index set to the specified value and the remaining elements set to the same value as that in the given quaternion. @@ -31,17 +26,9 @@ internal static float GetElement(this Quaternion quaternion, int index) /// The value to set the element to. /// A with the value of the element at set to and the remaining elements set to the same value as that in . /// was less than zero or greater than the number of elements. - [Intrinsic] internal static Quaternion WithElement(this Quaternion quaternion, int index, float value) { - if ((uint)(index) >= (uint)(Quaternion.Count)) - { - ThrowHelper.ThrowArgumentOutOfRangeException(ExceptionArgument.index); - } - - Quaternion result = quaternion; - result.SetElementUnsafe(index, value); - return result; + return quaternion.AsVector128().WithElement(index, value).AsQuaternion(); } [MethodImpl(MethodImplOptions.AggressiveInlining)] diff --git a/src/libraries/System.Private.CoreLib/src/System/Numerics/Quaternion.cs b/src/libraries/System.Private.CoreLib/src/System/Numerics/Quaternion.cs index ecebdb1b3d42f6..d4bea111c1ba41 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Numerics/Quaternion.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Numerics/Quaternion.cs @@ -35,32 +35,23 @@ public struct Quaternion : IEquatable /// The value to assign to the Y component of the quaternion. /// The value to assign to the Z component of the quaternion. /// The value to assign to the W component of the quaternion. - [Intrinsic] public Quaternion(float x, float y, float z, float w) { - X = x; - Y = y; - Z = z; - W = w; + this = Vector128.Create(x, y, z, w).AsQuaternion(); } /// Creates a quaternion from the specified vector and rotation parts. /// The vector part of the quaternion. /// The rotation part of the quaternion. - [Intrinsic] public Quaternion(Vector3 vectorPart, float scalarPart) { - X = vectorPart.X; - Y = vectorPart.Y; - Z = vectorPart.Z; - W = scalarPart; + this = new Vector4(vectorPart, scalarPart).AsQuaternion(); } /// Gets a quaternion that represents a zero. /// A quaternion whose values are (0, 0, 0, 0). public static Quaternion Zero { - [Intrinsic] get => default; } @@ -68,7 +59,6 @@ public static Quaternion Zero /// A quaternion whose values are (0, 0, 0, 1). public static Quaternion Identity { - [Intrinsic] get => new Quaternion(0.0f, 0.0f, 0.0f, 1.0f); } @@ -78,7 +68,6 @@ public static Quaternion Identity /// was less than zero or greater than the number of elements. public float this[int index] { - [Intrinsic] [MethodImpl(MethodImplOptions.AggressiveInlining)] readonly get => this.GetElement(index); @@ -99,16 +88,10 @@ public readonly bool IsIdentity /// The second quaternion. /// The quaternion that contains the summed values of and . /// The method defines the operation of the addition operator for objects. - [Intrinsic] [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Quaternion operator +(Quaternion value1, Quaternion value2) { - return new Quaternion( - value1.X + value2.X, - value1.Y + value2.Y, - value1.Z + value2.Z, - value1.W + value2.W - ); + return (value1.AsVector128() + value2.AsVector128()).AsQuaternion(); } /// Divides one quaternion by a second quaternion. @@ -160,21 +143,16 @@ public readonly bool IsIdentity /// if the two quaternions are equal; otherwise, . /// Two quaternions are equal if each of their corresponding components is equal. /// The method defines the operation of the equality operator for objects. - [Intrinsic] [MethodImpl(MethodImplOptions.AggressiveInlining)] public static bool operator ==(Quaternion value1, Quaternion value2) { - return (value1.X == value2.X) - && (value1.Y == value2.Y) - && (value1.Z == value2.Z) - && (value1.W == value2.W); + return value1.AsVector128() == value2.AsVector128(); } /// Returns a value that indicates whether two quaternions are not equal. /// The first quaternion to compare. /// The second quaternion to compare. /// if and are not equal; otherwise, . - [Intrinsic] [MethodImpl(MethodImplOptions.AggressiveInlining)] public static bool operator !=(Quaternion value1, Quaternion value2) { @@ -234,16 +212,10 @@ public readonly bool IsIdentity /// The scalar value. /// The scaled quaternion. /// The method defines the operation of the multiplication operator for objects. - [Intrinsic] [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Quaternion operator *(Quaternion value1, float value2) { - return new Quaternion( - value1.X * value2, - value1.Y * value2, - value1.Z * value2, - value1.W * value2 - ); + return (value1.AsVector128() * value2).AsQuaternion(); } /// Subtracts each element in a second quaternion from its corresponding element in a first quaternion. @@ -251,34 +223,26 @@ public readonly bool IsIdentity /// The second quaternion. /// The quaternion containing the values that result from subtracting each element in from its corresponding element in . /// The method defines the operation of the subtraction operator for objects. - [Intrinsic] [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Quaternion operator -(Quaternion value1, Quaternion value2) { - return new Quaternion( - value1.X - value2.X, - value1.Y - value2.Y, - value1.Z - value2.Z, - value1.W - value2.W - ); + return (value1.AsVector128() - value2.AsVector128()).AsQuaternion(); } /// Reverses the sign of each component of the quaternion. /// The quaternion to negate. /// The negated quaternion. /// The method defines the operation of the unary negation operator for objects. - [Intrinsic] [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Quaternion operator -(Quaternion value) { - return Zero - value; + return (-value.AsVector128()).AsQuaternion(); } /// Adds each element in one quaternion with its corresponding element in a second quaternion. /// The first quaternion. /// The second quaternion. /// The quaternion that contains the summed values of and . - [Intrinsic] [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Quaternion Add(Quaternion value1, Quaternion value2) { @@ -323,11 +287,10 @@ public static Quaternion Concatenate(Quaternion value1, Quaternion value2) /// Returns the conjugate of a specified quaternion. /// The quaternion. /// A new quaternion that is the conjugate of . - [Intrinsic] [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Quaternion Conjugate(Quaternion value) { - return Multiply(value, new Vector4(-1.0f, -1.0f, -1.0f, 1.0f)); + return (value.AsVector128() * Vector128.Create(-1.0f, -1.0f, -1.0f, 1.0f)).AsQuaternion(); } /// Creates a quaternion from a unit vector and an angle to rotate around the vector. @@ -446,40 +409,19 @@ public static Quaternion Divide(Quaternion value1, Quaternion value2) return value1 / value2; } - /// Divides the specified quaternion by a specified scalar value. - /// The quaternion. - /// The scalar value. - /// The quaternion that results from the division. - [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] - internal static Quaternion Divide(Quaternion left, float divisor) - { - return new Quaternion( - left.X / divisor, - left.Y / divisor, - left.Z / divisor, - left.W / divisor - ); - } - /// Calculates the dot product of two quaternions. /// The first quaternion. /// The second quaternion. /// The dot product. - [Intrinsic] [MethodImpl(MethodImplOptions.AggressiveInlining)] public static float Dot(Quaternion quaternion1, Quaternion quaternion2) { - return (quaternion1.X * quaternion2.X) - + (quaternion1.Y * quaternion2.Y) - + (quaternion1.Z * quaternion2.Z) - + (quaternion1.W * quaternion2.W); + return Vector128.Dot(quaternion1.AsVector128(), quaternion2.AsVector128()); } /// Returns the inverse of a quaternion. /// The quaternion. /// The inverted quaternion. - [Intrinsic] [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Quaternion Inverse(Quaternion value) { @@ -487,7 +429,7 @@ public static Quaternion Inverse(Quaternion value) // q = ( ------------- ------------- ) // ( a^2 + |v|^2 , a^2 + |v|^2 ) - return Divide(Conjugate(value), value.LengthSquared()); + return (Conjugate(value).AsVector128() / value.LengthSquared()).AsQuaternion(); } /// Performs a linear interpolation between two quaternions based on a value that specifies the weighting of the second quaternion. @@ -542,27 +484,10 @@ public static Quaternion Multiply(Quaternion value1, Quaternion value2) return value1 * value2; } - /// Returns a new quaternion whose values are the product of each pair of elements in specified quaternion and vector. - /// The quaternion. - /// The vector. - /// The element-wise product vector. - [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] - internal static Quaternion Multiply(Quaternion value1, Vector4 value2) - { - return new Quaternion( - value1.X * value2.X, - value1.Y * value2.Y, - value1.Z * value2.Z, - value1.W * value2.W - ); - } - /// Returns the quaternion that results from scaling all the components of a specified quaternion by a scalar factor. /// The source quaternion. /// The scalar value. /// The scaled quaternion. - [Intrinsic] [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Quaternion Multiply(Quaternion value1, float value2) { @@ -572,7 +497,6 @@ public static Quaternion Multiply(Quaternion value1, float value2) /// Reverses the sign of each component of the quaternion. /// The quaternion to negate. /// The negated quaternion. - [Intrinsic] [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Quaternion Negate(Quaternion value) { @@ -582,11 +506,10 @@ public static Quaternion Negate(Quaternion value) /// Divides each component of a specified by its length. /// The quaternion to normalize. /// The normalized quaternion. - [Intrinsic] [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Quaternion Normalize(Quaternion value) { - return Divide(value, value.Length()); + return (value.AsVector128() / value.Length()).AsQuaternion(); } /// Interpolates between two quaternions, using spherical linear interpolation. @@ -642,7 +565,6 @@ public static Quaternion Slerp(Quaternion quaternion1, Quaternion quaternion2, f /// The first quaternion. /// The second quaternion. /// The quaternion containing the values that result from subtracting each element in from its corresponding element in . - [Intrinsic] [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Quaternion Subtract(Quaternion value1, Quaternion value2) { @@ -665,23 +587,7 @@ public override readonly bool Equals([NotNullWhen(true)] object? obj) [MethodImpl(MethodImplOptions.AggressiveInlining)] public readonly bool Equals(Quaternion other) { - // This function needs to account for floating-point equality around NaN - // and so must behave equivalently to the underlying float/double.Equals - - if (Vector128.IsHardwareAccelerated) - { - return this.AsVector128().Equals(other.AsVector128()); - } - - return SoftwareFallback(in this, other); - - static bool SoftwareFallback(in Quaternion self, Quaternion other) - { - return self.X.Equals(other.X) - && self.Y.Equals(other.Y) - && self.Z.Equals(other.Z) - && self.W.Equals(other.W); - } + return this.AsVector128().Equals(other.AsVector128()); } /// Returns the hash code for this instance. @@ -693,17 +599,14 @@ public override readonly int GetHashCode() /// Calculates the length of the quaternion. /// The computed length of the quaternion. - [Intrinsic] [MethodImpl(MethodImplOptions.AggressiveInlining)] public readonly float Length() { - float lengthSquared = LengthSquared(); - return MathF.Sqrt(lengthSquared); + return MathF.Sqrt(LengthSquared()); } /// Calculates the squared length of the quaternion. /// The length squared of the quaternion. - [Intrinsic] [MethodImpl(MethodImplOptions.AggressiveInlining)] public readonly float LengthSquared() { diff --git a/src/libraries/System.Private.CoreLib/src/System/Numerics/Vector4.Extensions.cs b/src/libraries/System.Private.CoreLib/src/System/Numerics/Vector4.Extensions.cs index 78aeb44cb2e8ee..0fbedb72c7d3f1 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Numerics/Vector4.Extensions.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Numerics/Vector4.Extensions.cs @@ -16,6 +16,13 @@ public static unsafe partial class Vector internal static Plane AsPlane(this Vector4 value) => Unsafe.BitCast(value); + /// Reinterprets a as a new . + /// The vector to reinterpret. + /// reinterpreted as a new . + [MethodImpl(MethodImplOptions.AggressiveInlining)] + internal static Quaternion AsQuaternion(this Vector4 value) + => Unsafe.BitCast(value); + /// Gets the element at the specified index. /// The vector to get the element from. /// The index of the element to get. diff --git a/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Vector128.cs b/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Vector128.cs index 2226ecd767544c..9b0875068e88d3 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Vector128.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Vector128.cs @@ -176,6 +176,13 @@ public static Vector128 As(this Vector128 vector) internal static Plane AsPlane(this Vector128 value) => Unsafe.BitCast, Plane>(value); + /// Reinterprets a as a new . + /// The vector to reinterpret. + /// reinterpreted as a new . + [MethodImpl(MethodImplOptions.AggressiveInlining)] + internal static Quaternion AsQuaternion(this Vector128 value) + => Unsafe.BitCast, Quaternion>(value); + /// Reinterprets a as a new . /// The type of the elements in the vector. /// The vector to reinterpret. @@ -235,10 +242,9 @@ internal static Vector128 AsVector128(this Plane value) /// Reinterprets a as a new . /// The quaternion to reinterpret. /// reinterpreted as a new . - [Intrinsic] [MethodImpl(MethodImplOptions.AggressiveInlining)] internal static Vector128 AsVector128(this Quaternion value) - => Unsafe.As>(ref value); + => Unsafe.BitCast>(value); /// Reinterprets a as a new . /// The vector to reinterpret. From bcd8926975d83bd11960759e456d74ccd0327e48 Mon Sep 17 00:00:00 2001 From: Tanner Gooding Date: Thu, 16 May 2024 09:11:53 -0700 Subject: [PATCH 4/9] Avoid accidental recursion on Mono --- .../src/System/Runtime/Intrinsics/Vector128.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Vector128.cs b/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Vector128.cs index 9b0875068e88d3..bc702b76a0bd4a 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Vector128.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Vector128.cs @@ -252,7 +252,7 @@ internal static Vector128 AsVector128(this Quaternion value) [Intrinsic] [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector128 AsVector128(this Vector2 value) - => new Vector4(value, 0.0f, 0.0f).AsVector128(); + => new Vector4(value.X, value.Y, 0.0f, 0.0f).AsVector128(); /// Reinterprets a as a new . /// The vector to reinterpret. @@ -260,7 +260,7 @@ public static Vector128 AsVector128(this Vector2 value) [Intrinsic] [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector128 AsVector128(this Vector3 value) - => new Vector4(value, 0.0f).AsVector128(); + => new Vector4(value.X, value.Y, value.Z, 0.0f).AsVector128(); /// Reinterprets a as a new . /// The vector to reinterpret. From 69b9d0878a0aae90db6b9516a3ddaeadcb09a4ab Mon Sep 17 00:00:00 2001 From: Tanner Gooding Date: Thu, 16 May 2024 11:18:38 -0700 Subject: [PATCH 5/9] Change Vector2/3, Vector, and Vector64/128/256/512 to be implemented in managed where trivially possible --- src/coreclr/jit/fgbasic.cpp | 84 ------ src/coreclr/jit/hwintrinsicarm64.cpp | 72 ----- src/coreclr/jit/hwintrinsiclistarm64.h | 60 ---- src/coreclr/jit/hwintrinsiclistxarch.h | 90 ------ src/coreclr/jit/hwintrinsicxarch.cpp | 115 -------- src/coreclr/jit/importercalls.cpp | 8 +- src/coreclr/jit/simdashwintrinsic.cpp | 203 -------------- src/coreclr/jit/simdashwintrinsiclistarm64.h | 65 ----- src/coreclr/jit/simdashwintrinsiclistxarch.h | 65 ----- .../src/System/Numerics/Plane.cs | 110 +------- .../src/System/Numerics/Quaternion.cs | 129 ++------- .../src/System/Numerics/Vector.cs | 155 +---------- .../src/System/Numerics/Vector2.cs | 208 +++----------- .../src/System/Numerics/Vector3.cs | 200 +++----------- .../src/System/Numerics/Vector4.Extensions.cs | 20 +- .../src/System/Numerics/Vector4.cs | 257 ++++-------------- .../src/System/Numerics/Vector_1.cs | 93 +------ .../System/Runtime/Intrinsics/Vector128.cs | 234 +--------------- .../System/Runtime/Intrinsics/Vector128_1.cs | 50 +--- .../System/Runtime/Intrinsics/Vector256.cs | 204 +------------- .../System/Runtime/Intrinsics/Vector256_1.cs | 49 +--- .../System/Runtime/Intrinsics/Vector512.cs | 216 ++------------- .../System/Runtime/Intrinsics/Vector512_1.cs | 49 +--- .../src/System/Runtime/Intrinsics/Vector64.cs | 206 +------------- .../System/Runtime/Intrinsics/Vector64_1.cs | 56 +--- 25 files changed, 236 insertions(+), 2762 deletions(-) diff --git a/src/coreclr/jit/fgbasic.cpp b/src/coreclr/jit/fgbasic.cpp index bdf3770094d812..a8b0178676bde6 100644 --- a/src/coreclr/jit/fgbasic.cpp +++ b/src/coreclr/jit/fgbasic.cpp @@ -1626,81 +1626,6 @@ void Compiler::fgFindJumpTargets(const BYTE* codeAddr, IL_OFFSET codeSize, Fixed break; } -#if defined(FEATURE_HW_INTRINSICS) -#if defined(TARGET_ARM64) - case NI_Vector64_As: - case NI_Vector64_AsByte: - case NI_Vector64_AsDouble: - case NI_Vector64_AsInt16: - case NI_Vector64_AsInt32: - case NI_Vector64_AsInt64: - case NI_Vector64_AsNInt: - case NI_Vector64_AsNUInt: - case NI_Vector64_AsSByte: - case NI_Vector64_AsSingle: - case NI_Vector64_AsUInt16: - case NI_Vector64_AsUInt32: - case NI_Vector64_AsUInt64: - case NI_Vector64_op_UnaryPlus: -#endif // TARGET_XARCH - case NI_Vector128_As: - case NI_Vector128_AsByte: - case NI_Vector128_AsDouble: - case NI_Vector128_AsInt16: - case NI_Vector128_AsInt32: - case NI_Vector128_AsInt64: - case NI_Vector128_AsNInt: - case NI_Vector128_AsNUInt: - case NI_Vector128_AsSByte: - case NI_Vector128_AsSingle: - case NI_Vector128_AsUInt16: - case NI_Vector128_AsUInt32: - case NI_Vector128_AsUInt64: - case NI_Vector128_op_UnaryPlus: - case NI_VectorT_As: - case NI_VectorT_AsVectorByte: - case NI_VectorT_AsVectorDouble: - case NI_VectorT_AsVectorInt16: - case NI_VectorT_AsVectorInt32: - case NI_VectorT_AsVectorInt64: - case NI_VectorT_AsVectorNInt: - case NI_VectorT_AsVectorNUInt: - case NI_VectorT_AsVectorSByte: - case NI_VectorT_AsVectorSingle: - case NI_VectorT_AsVectorUInt16: - case NI_VectorT_AsVectorUInt32: - case NI_VectorT_AsVectorUInt64: - case NI_VectorT_op_UnaryPlus: -#if defined(TARGET_XARCH) - case NI_Vector256_As: - case NI_Vector256_AsByte: - case NI_Vector256_AsDouble: - case NI_Vector256_AsInt16: - case NI_Vector256_AsInt32: - case NI_Vector256_AsInt64: - case NI_Vector256_AsNInt: - case NI_Vector256_AsNUInt: - case NI_Vector256_AsSByte: - case NI_Vector256_AsSingle: - case NI_Vector256_AsUInt16: - case NI_Vector256_AsUInt32: - case NI_Vector256_AsUInt64: - case NI_Vector256_op_UnaryPlus: - case NI_Vector512_As: - case NI_Vector512_AsByte: - case NI_Vector512_AsDouble: - case NI_Vector512_AsInt16: - case NI_Vector512_AsInt32: - case NI_Vector512_AsInt64: - case NI_Vector512_AsNInt: - case NI_Vector512_AsNUInt: - case NI_Vector512_AsSByte: - case NI_Vector512_AsSingle: - case NI_Vector512_AsUInt16: - case NI_Vector512_AsUInt32: - case NI_Vector512_AsUInt64: -#endif // TARGET_XARCH -#endif // FEATURE_HW_INTRINSICS case NI_SRCS_UNSAFE_As: case NI_SRCS_UNSAFE_AsRef: case NI_SRCS_UNSAFE_BitCast: @@ -1719,25 +1644,16 @@ void Compiler::fgFindJumpTargets(const BYTE* codeAddr, IL_OFFSET codeSize, Fixed #if defined(TARGET_ARM64) case NI_Vector64_get_AllBitsSet: case NI_Vector64_get_One: - case NI_Vector64_get_Zero: #endif // TARGET_ARM64 - case NI_Vector2_get_One: - case NI_Vector2_get_Zero: - case NI_Vector3_get_One: - case NI_Vector3_get_Zero: case NI_Vector128_get_AllBitsSet: case NI_Vector128_get_One: - case NI_Vector128_get_Zero: case NI_VectorT_get_AllBitsSet: case NI_VectorT_get_One: - case NI_VectorT_get_Zero: #if defined(TARGET_XARCH) case NI_Vector256_get_AllBitsSet: case NI_Vector256_get_One: - case NI_Vector256_get_Zero: case NI_Vector512_get_AllBitsSet: case NI_Vector512_get_One: - case NI_Vector512_get_Zero: #endif // TARGET_XARCH #endif // FEATURE_HW_INTRINSICS { diff --git a/src/coreclr/jit/hwintrinsicarm64.cpp b/src/coreclr/jit/hwintrinsicarm64.cpp index 7091882f8d6318..837bfe54777856 100644 --- a/src/coreclr/jit/hwintrinsicarm64.cpp +++ b/src/coreclr/jit/hwintrinsicarm64.cpp @@ -537,8 +537,6 @@ GenTree* Compiler::impSpecialIntrinsic(NamedIntrinsic intrinsic, break; } - case NI_Vector64_Add: - case NI_Vector128_Add: case NI_Vector64_op_Addition: case NI_Vector128_op_Addition: { @@ -563,32 +561,6 @@ GenTree* Compiler::impSpecialIntrinsic(NamedIntrinsic intrinsic, break; } - case NI_Vector64_As: - case NI_Vector64_AsByte: - case NI_Vector64_AsDouble: - case NI_Vector64_AsInt16: - case NI_Vector64_AsInt32: - case NI_Vector64_AsInt64: - case NI_Vector64_AsNInt: - case NI_Vector64_AsNUInt: - case NI_Vector64_AsSByte: - case NI_Vector64_AsSingle: - case NI_Vector64_AsUInt16: - case NI_Vector64_AsUInt32: - case NI_Vector64_AsUInt64: - case NI_Vector128_As: - case NI_Vector128_AsByte: - case NI_Vector128_AsDouble: - case NI_Vector128_AsInt16: - case NI_Vector128_AsInt32: - case NI_Vector128_AsInt64: - case NI_Vector128_AsNInt: - case NI_Vector128_AsNUInt: - case NI_Vector128_AsSByte: - case NI_Vector128_AsSingle: - case NI_Vector128_AsUInt16: - case NI_Vector128_AsUInt32: - case NI_Vector128_AsUInt64: case NI_Vector128_AsVector: { assert(!sig->hasThis()); @@ -704,8 +676,6 @@ GenTree* Compiler::impSpecialIntrinsic(NamedIntrinsic intrinsic, break; } - case NI_Vector64_BitwiseAnd: - case NI_Vector128_BitwiseAnd: case NI_Vector64_op_BitwiseAnd: case NI_Vector128_op_BitwiseAnd: { @@ -718,8 +688,6 @@ GenTree* Compiler::impSpecialIntrinsic(NamedIntrinsic intrinsic, break; } - case NI_Vector64_BitwiseOr: - case NI_Vector128_BitwiseOr: case NI_Vector64_op_BitwiseOr: case NI_Vector128_op_BitwiseOr: { @@ -1088,8 +1056,6 @@ GenTree* Compiler::impSpecialIntrinsic(NamedIntrinsic intrinsic, break; } - case NI_Vector64_Divide: - case NI_Vector128_Divide: case NI_Vector64_op_Division: case NI_Vector128_op_Division: { @@ -1146,8 +1112,6 @@ GenTree* Compiler::impSpecialIntrinsic(NamedIntrinsic intrinsic, break; } - case NI_Vector64_EqualsAll: - case NI_Vector128_EqualsAll: case NI_Vector64_op_Equality: case NI_Vector128_op_Equality: { @@ -1373,14 +1337,6 @@ GenTree* Compiler::impSpecialIntrinsic(NamedIntrinsic intrinsic, break; } - case NI_Vector64_get_Zero: - case NI_Vector128_get_Zero: - { - assert(sig->numArgs == 0); - retNode = gtNewZeroConNode(retType); - break; - } - case NI_Vector64_GetElement: case NI_Vector128_GetElement: { @@ -1566,8 +1522,6 @@ GenTree* Compiler::impSpecialIntrinsic(NamedIntrinsic intrinsic, case NI_AdvSimd_LoadVector64: case NI_AdvSimd_LoadVector128: - case NI_Vector64_Load: - case NI_Vector128_Load: case NI_Vector64_LoadUnsafe: case NI_Vector128_LoadUnsafe: { @@ -1673,8 +1627,6 @@ GenTree* Compiler::impSpecialIntrinsic(NamedIntrinsic intrinsic, break; } - case NI_Vector64_Multiply: - case NI_Vector128_Multiply: case NI_Vector64_op_Multiply: case NI_Vector128_op_Multiply: { @@ -1713,8 +1665,6 @@ GenTree* Compiler::impSpecialIntrinsic(NamedIntrinsic intrinsic, break; } - case NI_Vector64_Negate: - case NI_Vector128_Negate: case NI_Vector64_op_UnaryNegation: case NI_Vector128_op_UnaryNegation: { @@ -1724,8 +1674,6 @@ GenTree* Compiler::impSpecialIntrinsic(NamedIntrinsic intrinsic, break; } - case NI_Vector64_OnesComplement: - case NI_Vector128_OnesComplement: case NI_Vector64_op_OnesComplement: case NI_Vector128_op_OnesComplement: { @@ -1748,16 +1696,6 @@ GenTree* Compiler::impSpecialIntrinsic(NamedIntrinsic intrinsic, break; } - case NI_Vector64_op_UnaryPlus: - case NI_Vector128_op_UnaryPlus: - { - assert(sig->numArgs == 1); - retNode = impSIMDPopStack(); - break; - } - - case NI_Vector64_Subtract: - case NI_Vector128_Subtract: case NI_Vector64_op_Subtraction: case NI_Vector128_op_Subtraction: { @@ -1770,8 +1708,6 @@ GenTree* Compiler::impSpecialIntrinsic(NamedIntrinsic intrinsic, break; } - case NI_Vector64_ShiftLeft: - case NI_Vector128_ShiftLeft: case NI_Vector64_op_LeftShift: case NI_Vector128_op_LeftShift: { @@ -1784,8 +1720,6 @@ GenTree* Compiler::impSpecialIntrinsic(NamedIntrinsic intrinsic, break; } - case NI_Vector64_ShiftRightArithmetic: - case NI_Vector128_ShiftRightArithmetic: case NI_Vector64_op_RightShift: case NI_Vector128_op_RightShift: { @@ -1799,8 +1733,6 @@ GenTree* Compiler::impSpecialIntrinsic(NamedIntrinsic intrinsic, break; } - case NI_Vector64_ShiftRightLogical: - case NI_Vector128_ShiftRightLogical: case NI_Vector64_op_UnsignedRightShift: case NI_Vector128_op_UnsignedRightShift: { @@ -1870,9 +1802,7 @@ GenTree* Compiler::impSpecialIntrinsic(NamedIntrinsic intrinsic, break; } - case NI_Vector64_Store: case NI_Vector64_StoreUnsafe: - case NI_Vector128_Store: case NI_Vector128_StoreUnsafe: { assert(retType == TYP_VOID); @@ -2191,8 +2121,6 @@ GenTree* Compiler::impSpecialIntrinsic(NamedIntrinsic intrinsic, break; } - case NI_Vector64_Xor: - case NI_Vector128_Xor: case NI_Vector64_op_ExclusiveOr: case NI_Vector128_op_ExclusiveOr: { diff --git a/src/coreclr/jit/hwintrinsiclistarm64.h b/src/coreclr/jit/hwintrinsiclistarm64.h index 48cda1aad4f78e..56d052b20a8451 100644 --- a/src/coreclr/jit/hwintrinsiclistarm64.h +++ b/src/coreclr/jit/hwintrinsiclistarm64.h @@ -16,23 +16,7 @@ // *************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************** // Vector64 Intrinsics HARDWARE_INTRINSIC(Vector64, Abs, 8, 1, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId) -HARDWARE_INTRINSIC(Vector64, Add, 8, 2, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId) HARDWARE_INTRINSIC(Vector64, AndNot, 8, 2, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId) -HARDWARE_INTRINSIC(Vector64, As, 8, 1, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId|HW_Flag_BaseTypeFromFirstArg) -HARDWARE_INTRINSIC(Vector64, AsByte, 8, 1, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId|HW_Flag_BaseTypeFromFirstArg) -HARDWARE_INTRINSIC(Vector64, AsDouble, 8, 1, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId|HW_Flag_BaseTypeFromFirstArg) -HARDWARE_INTRINSIC(Vector64, AsInt16, 8, 1, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId|HW_Flag_BaseTypeFromFirstArg) -HARDWARE_INTRINSIC(Vector64, AsInt32, 8, 1, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId|HW_Flag_BaseTypeFromFirstArg) -HARDWARE_INTRINSIC(Vector64, AsInt64, 8, 1, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId|HW_Flag_BaseTypeFromFirstArg) -HARDWARE_INTRINSIC(Vector64, AsNInt, 8, 1, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId|HW_Flag_BaseTypeFromFirstArg) -HARDWARE_INTRINSIC(Vector64, AsNUInt, 8, 1, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId|HW_Flag_BaseTypeFromFirstArg) -HARDWARE_INTRINSIC(Vector64, AsSByte, 8, 1, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId|HW_Flag_BaseTypeFromFirstArg) -HARDWARE_INTRINSIC(Vector64, AsSingle, 8, 1, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId|HW_Flag_BaseTypeFromFirstArg) -HARDWARE_INTRINSIC(Vector64, AsUInt16, 8, 1, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId|HW_Flag_BaseTypeFromFirstArg) -HARDWARE_INTRINSIC(Vector64, AsUInt32, 8, 1, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId|HW_Flag_BaseTypeFromFirstArg) -HARDWARE_INTRINSIC(Vector64, AsUInt64, 8, 1, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId|HW_Flag_BaseTypeFromFirstArg) -HARDWARE_INTRINSIC(Vector64, BitwiseAnd, 8, 2, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId) -HARDWARE_INTRINSIC(Vector64, BitwiseOr, 8, 2, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId) HARDWARE_INTRINSIC(Vector64, Ceiling, 8, 1, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId) HARDWARE_INTRINSIC(Vector64, ConditionalSelect, 8, 3, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId) HARDWARE_INTRINSIC(Vector64, ConvertToDouble, 8, 1, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId|HW_Flag_BaseTypeFromFirstArg) @@ -49,17 +33,14 @@ HARDWARE_INTRINSIC(Vector64, Create, HARDWARE_INTRINSIC(Vector64, CreateScalar, 8, -1, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_SpecialImport|HW_Flag_NoCodeGen) HARDWARE_INTRINSIC(Vector64, CreateScalarUnsafe, 8, 1, true, {INS_ins, INS_ins, INS_ins, INS_ins, INS_ins, INS_ins, INS_invalid, INS_invalid, INS_fmov, INS_invalid}, HW_Category_SIMD, HW_Flag_SpecialImport|HW_Flag_SpecialCodeGen|HW_Flag_SupportsContainment) HARDWARE_INTRINSIC(Vector64, CreateSequence, 8, 2, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId) -HARDWARE_INTRINSIC(Vector64, Divide, 8, 2, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId) HARDWARE_INTRINSIC(Vector64, Dot, 8, 2, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_SpecialImport|HW_Flag_NoCodeGen|HW_Flag_BaseTypeFromFirstArg) HARDWARE_INTRINSIC(Vector64, Equals, 8, 2, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId) -HARDWARE_INTRINSIC(Vector64, EqualsAll, 8, 2, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId|HW_Flag_BaseTypeFromFirstArg) HARDWARE_INTRINSIC(Vector64, EqualsAny, 8, 2, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId|HW_Flag_BaseTypeFromFirstArg) HARDWARE_INTRINSIC(Vector64, ExtractMostSignificantBits, 8, 1, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId|HW_Flag_BaseTypeFromFirstArg) HARDWARE_INTRINSIC(Vector64, Floor, 8, 1, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId) HARDWARE_INTRINSIC(Vector64, get_AllBitsSet, 8, 0, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId) HARDWARE_INTRINSIC(Vector64, get_Indices, 8, 0, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId) HARDWARE_INTRINSIC(Vector64, get_One, 8, 0, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId) -HARDWARE_INTRINSIC(Vector64, get_Zero, 8, 0, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId) HARDWARE_INTRINSIC(Vector64, GetElement, 8, 2, true, {INS_smov, INS_umov, INS_smov, INS_umov, INS_smov, INS_umov, INS_umov, INS_umov, INS_dup, INS_dup}, HW_Category_Helper, HW_Flag_SpecialImport|HW_Flag_SpecialCodeGen|HW_Flag_BaseTypeFromFirstArg) HARDWARE_INTRINSIC(Vector64, GreaterThan, 8, 2, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId) HARDWARE_INTRINSIC(Vector64, GreaterThanAll, 8, 2, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId|HW_Flag_BaseTypeFromFirstArg) @@ -73,16 +54,12 @@ HARDWARE_INTRINSIC(Vector64, LessThanAny, HARDWARE_INTRINSIC(Vector64, LessThanOrEqual, 8, 2, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId) HARDWARE_INTRINSIC(Vector64, LessThanOrEqualAll, 8, 2, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId|HW_Flag_BaseTypeFromFirstArg) HARDWARE_INTRINSIC(Vector64, LessThanOrEqualAny, 8, 2, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId|HW_Flag_BaseTypeFromFirstArg) -HARDWARE_INTRINSIC(Vector64, Load, 8, 1, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId) HARDWARE_INTRINSIC(Vector64, LoadAligned, 8, 1, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId) HARDWARE_INTRINSIC(Vector64, LoadAlignedNonTemporal, 8, 1, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId) HARDWARE_INTRINSIC(Vector64, LoadUnsafe, 8, -1, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId) HARDWARE_INTRINSIC(Vector64, Max, 8, 2, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId) HARDWARE_INTRINSIC(Vector64, Min, 8, 2, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId) -HARDWARE_INTRINSIC(Vector64, Multiply, 8, 2, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId) HARDWARE_INTRINSIC(Vector64, Narrow, 8, 2, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId) -HARDWARE_INTRINSIC(Vector64, Negate, 8, 1, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId) -HARDWARE_INTRINSIC(Vector64, OnesComplement, 8, 1, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId) HARDWARE_INTRINSIC(Vector64, op_Addition, 8, 2, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId) HARDWARE_INTRINSIC(Vector64, op_BitwiseAnd, 8, 2, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId|HW_Flag_Commutative) HARDWARE_INTRINSIC(Vector64, op_BitwiseOr, 8, 2, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId|HW_Flag_Commutative) @@ -96,18 +73,12 @@ HARDWARE_INTRINSIC(Vector64, op_OnesComplement, HARDWARE_INTRINSIC(Vector64, op_RightShift, 8, 2, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId) HARDWARE_INTRINSIC(Vector64, op_Subtraction, 8, 2, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId) HARDWARE_INTRINSIC(Vector64, op_UnaryNegation, 8, 1, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId) -HARDWARE_INTRINSIC(Vector64, op_UnaryPlus, 8, 1, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId) HARDWARE_INTRINSIC(Vector64, op_UnsignedRightShift, 8, 2, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId) -HARDWARE_INTRINSIC(Vector64, ShiftLeft, 8, 2, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId) -HARDWARE_INTRINSIC(Vector64, ShiftRightArithmetic, 8, 2, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId) -HARDWARE_INTRINSIC(Vector64, ShiftRightLogical, 8, 2, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId) HARDWARE_INTRINSIC(Vector64, Shuffle, 8, -1, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId) HARDWARE_INTRINSIC(Vector64, Sqrt, 8, 1, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId) -HARDWARE_INTRINSIC(Vector64, Store, 8, 2, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId|HW_Flag_BaseTypeFromFirstArg) HARDWARE_INTRINSIC(Vector64, StoreAligned, 8, 2, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId|HW_Flag_BaseTypeFromFirstArg) HARDWARE_INTRINSIC(Vector64, StoreAlignedNonTemporal, 8, 2, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId|HW_Flag_BaseTypeFromFirstArg) HARDWARE_INTRINSIC(Vector64, StoreUnsafe, 8, -1, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId|HW_Flag_BaseTypeFromFirstArg) -HARDWARE_INTRINSIC(Vector64, Subtract, 8, 2, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId) HARDWARE_INTRINSIC(Vector64, Sum, 8, 1, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId|HW_Flag_BaseTypeFromFirstArg) HARDWARE_INTRINSIC(Vector64, ToScalar, 8, 1, true, {INS_smov, INS_umov, INS_smov, INS_umov, INS_smov, INS_umov, INS_umov, INS_umov, INS_dup, INS_dup}, HW_Category_SIMD, HW_Flag_BaseTypeFromFirstArg|HW_Flag_SIMDScalar|HW_Flag_SpecialCodeGen) HARDWARE_INTRINSIC(Vector64, ToVector128, 8, 1, true, {INS_mov, INS_mov, INS_mov, INS_mov, INS_mov, INS_mov, INS_mov, INS_mov, INS_mov, INS_mov}, HW_Category_SIMD, HW_Flag_SpecialCodeGen) @@ -115,7 +86,6 @@ HARDWARE_INTRINSIC(Vector64, ToVector128Unsafe, HARDWARE_INTRINSIC(Vector64, WidenLower, 8, 1, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId|HW_Flag_BaseTypeFromFirstArg) HARDWARE_INTRINSIC(Vector64, WidenUpper, 8, 1, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId|HW_Flag_BaseTypeFromFirstArg) HARDWARE_INTRINSIC(Vector64, WithElement, 8, 3, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_BaseTypeFromFirstArg|HW_Flag_SpecialImport) -HARDWARE_INTRINSIC(Vector64, Xor, 8, 2, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId) // *************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************** // ISA Function name SIMD size NumArg EncodesExtraTypeArg Instructions Category Flags @@ -124,27 +94,11 @@ HARDWARE_INTRINSIC(Vector64, Xor, // Vector128 Intrinsics HARDWARE_INTRINSIC(Vector128, Abs, 16, 1, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId) -HARDWARE_INTRINSIC(Vector128, Add, 16, 2, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId) HARDWARE_INTRINSIC(Vector128, AndNot, 16, 2, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId) -HARDWARE_INTRINSIC(Vector128, As, 16, 1, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId|HW_Flag_BaseTypeFromFirstArg) -HARDWARE_INTRINSIC(Vector128, AsByte, 16, 1, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId|HW_Flag_BaseTypeFromFirstArg) -HARDWARE_INTRINSIC(Vector128, AsDouble, 16, 1, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId|HW_Flag_BaseTypeFromFirstArg) -HARDWARE_INTRINSIC(Vector128, AsInt16, 16, 1, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId|HW_Flag_BaseTypeFromFirstArg) -HARDWARE_INTRINSIC(Vector128, AsInt32, 16, 1, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId|HW_Flag_BaseTypeFromFirstArg) -HARDWARE_INTRINSIC(Vector128, AsInt64, 16, 1, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId|HW_Flag_BaseTypeFromFirstArg) -HARDWARE_INTRINSIC(Vector128, AsNInt, 16, 1, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId|HW_Flag_BaseTypeFromFirstArg) -HARDWARE_INTRINSIC(Vector128, AsNUInt, 16, 1, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId|HW_Flag_BaseTypeFromFirstArg) -HARDWARE_INTRINSIC(Vector128, AsSByte, 16, 1, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId|HW_Flag_BaseTypeFromFirstArg) -HARDWARE_INTRINSIC(Vector128, AsSingle, 16, 1, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId|HW_Flag_BaseTypeFromFirstArg) -HARDWARE_INTRINSIC(Vector128, AsUInt16, 16, 1, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId|HW_Flag_BaseTypeFromFirstArg) -HARDWARE_INTRINSIC(Vector128, AsUInt32, 16, 1, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId|HW_Flag_BaseTypeFromFirstArg) -HARDWARE_INTRINSIC(Vector128, AsUInt64, 16, 1, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId|HW_Flag_BaseTypeFromFirstArg) HARDWARE_INTRINSIC(Vector128, AsVector, 16, 1, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId|HW_Flag_BaseTypeFromFirstArg) HARDWARE_INTRINSIC(Vector128, AsVector2, 16, 1, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId|HW_Flag_BaseTypeFromFirstArg) HARDWARE_INTRINSIC(Vector128, AsVector3, 16, 1, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_mov, INS_invalid}, HW_Category_SIMD, HW_Flag_BaseTypeFromFirstArg|HW_Flag_SpecialCodeGen|HW_Flag_SpecialImport) HARDWARE_INTRINSIC(Vector128, AsVector128, -1, 1, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId|HW_Flag_BaseTypeFromFirstArg) -HARDWARE_INTRINSIC(Vector128, BitwiseAnd, 16, 2, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId) -HARDWARE_INTRINSIC(Vector128, BitwiseOr, 16, 2, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId) HARDWARE_INTRINSIC(Vector128, Ceiling, 16, 1, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId) HARDWARE_INTRINSIC(Vector128, ConditionalSelect, 16, 3, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId) HARDWARE_INTRINSIC(Vector128, ConvertToDouble, 16, 1, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId|HW_Flag_BaseTypeFromFirstArg) @@ -161,17 +115,14 @@ HARDWARE_INTRINSIC(Vector128, Create, HARDWARE_INTRINSIC(Vector128, CreateScalar, 16, -1, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_SpecialImport|HW_Flag_NoCodeGen) HARDWARE_INTRINSIC(Vector128, CreateScalarUnsafe, 16, 1, true, {INS_ins, INS_ins, INS_ins, INS_ins, INS_ins, INS_ins, INS_ins, INS_ins, INS_fmov, INS_fmov}, HW_Category_SIMD, HW_Flag_SpecialImport|HW_Flag_SpecialCodeGen|HW_Flag_SupportsContainment) HARDWARE_INTRINSIC(Vector128, CreateSequence, 16, 2, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId) -HARDWARE_INTRINSIC(Vector128, Divide, 16, 2, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId) HARDWARE_INTRINSIC(Vector128, Dot, 16, 2, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_SpecialImport|HW_Flag_NoCodeGen|HW_Flag_BaseTypeFromFirstArg) HARDWARE_INTRINSIC(Vector128, Equals, 16, 2, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId) -HARDWARE_INTRINSIC(Vector128, EqualsAll, 16, 2, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId|HW_Flag_BaseTypeFromFirstArg) HARDWARE_INTRINSIC(Vector128, EqualsAny, 16, 2, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId|HW_Flag_BaseTypeFromFirstArg) HARDWARE_INTRINSIC(Vector128, ExtractMostSignificantBits, 16, 1, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId|HW_Flag_BaseTypeFromFirstArg) HARDWARE_INTRINSIC(Vector128, Floor, 16, 1, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId) HARDWARE_INTRINSIC(Vector128, get_AllBitsSet, 16, 0, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId) HARDWARE_INTRINSIC(Vector128, get_Indices, 16, 0, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId) HARDWARE_INTRINSIC(Vector128, get_One, 16, 0, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId) -HARDWARE_INTRINSIC(Vector128, get_Zero, 16, 0, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId) HARDWARE_INTRINSIC(Vector128, GetElement, 16, 2, true, {INS_smov, INS_umov, INS_smov, INS_umov, INS_smov, INS_umov, INS_umov, INS_umov, INS_dup, INS_dup}, HW_Category_Helper, HW_Flag_SpecialImport|HW_Flag_SpecialCodeGen|HW_Flag_BaseTypeFromFirstArg) HARDWARE_INTRINSIC(Vector128, GetLower, 16, 1, true, {INS_mov, INS_mov, INS_mov, INS_mov, INS_mov, INS_mov, INS_mov, INS_mov, INS_mov, INS_mov}, HW_Category_SIMD, HW_Flag_SpecialImport|HW_Flag_SpecialCodeGen) HARDWARE_INTRINSIC(Vector128, GetUpper, 16, 1, true, {INS_ext, INS_ext, INS_ext, INS_ext, INS_ext, INS_ext, INS_ext, INS_ext, INS_ext, INS_ext}, HW_Category_SIMD, HW_Flag_SpecialImport|HW_Flag_SpecialCodeGen) @@ -187,16 +138,12 @@ HARDWARE_INTRINSIC(Vector128, LessThanAny, HARDWARE_INTRINSIC(Vector128, LessThanOrEqual, 16, 2, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId) HARDWARE_INTRINSIC(Vector128, LessThanOrEqualAll, 16, 2, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId|HW_Flag_BaseTypeFromFirstArg) HARDWARE_INTRINSIC(Vector128, LessThanOrEqualAny, 16, 2, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId|HW_Flag_BaseTypeFromFirstArg) -HARDWARE_INTRINSIC(Vector128, Load, 16, 1, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId) HARDWARE_INTRINSIC(Vector128, LoadAligned, 16, 1, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId) HARDWARE_INTRINSIC(Vector128, LoadAlignedNonTemporal, 16, 1, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId) HARDWARE_INTRINSIC(Vector128, LoadUnsafe, 16, -1, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId) HARDWARE_INTRINSIC(Vector128, Max, 16, 2, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId) HARDWARE_INTRINSIC(Vector128, Min, 16, 2, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId) -HARDWARE_INTRINSIC(Vector128, Multiply, 16, 2, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId) HARDWARE_INTRINSIC(Vector128, Narrow, 16, 2, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId) -HARDWARE_INTRINSIC(Vector128, Negate, 16, 1, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId) -HARDWARE_INTRINSIC(Vector128, OnesComplement, 16, 1, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId) HARDWARE_INTRINSIC(Vector128, op_Addition, 16, 2, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId) HARDWARE_INTRINSIC(Vector128, op_BitwiseAnd, 16, 2, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId|HW_Flag_Commutative) HARDWARE_INTRINSIC(Vector128, op_BitwiseOr, 16, 2, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId|HW_Flag_Commutative) @@ -211,17 +158,11 @@ HARDWARE_INTRINSIC(Vector128, op_Multiply, HARDWARE_INTRINSIC(Vector128, op_OnesComplement, 16, 1, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId) HARDWARE_INTRINSIC(Vector128, op_Subtraction, 16, 2, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId) HARDWARE_INTRINSIC(Vector128, op_UnaryNegation, 16, 1, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId) -HARDWARE_INTRINSIC(Vector128, op_UnaryPlus, 16, 1, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId) -HARDWARE_INTRINSIC(Vector128, ShiftLeft, 16, 2, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId) -HARDWARE_INTRINSIC(Vector128, ShiftRightArithmetic, 16, 2, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId) -HARDWARE_INTRINSIC(Vector128, ShiftRightLogical, 16, 2, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId) HARDWARE_INTRINSIC(Vector128, Shuffle, 16, -1, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId) HARDWARE_INTRINSIC(Vector128, Sqrt, 16, 1, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId) -HARDWARE_INTRINSIC(Vector128, Store, 16, 2, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId|HW_Flag_BaseTypeFromFirstArg) HARDWARE_INTRINSIC(Vector128, StoreAligned, 16, 2, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId|HW_Flag_BaseTypeFromFirstArg) HARDWARE_INTRINSIC(Vector128, StoreAlignedNonTemporal, 16, 2, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId|HW_Flag_BaseTypeFromFirstArg) HARDWARE_INTRINSIC(Vector128, StoreUnsafe, 16, -1, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId|HW_Flag_BaseTypeFromFirstArg) -HARDWARE_INTRINSIC(Vector128, Subtract, 16, 2, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId) HARDWARE_INTRINSIC(Vector128, Sum, 16, 1, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId|HW_Flag_BaseTypeFromFirstArg) HARDWARE_INTRINSIC(Vector128, ToScalar, 16, 1, true, {INS_smov, INS_umov, INS_smov, INS_umov, INS_smov, INS_umov, INS_umov, INS_umov, INS_dup, INS_dup}, HW_Category_SIMD, HW_Flag_BaseTypeFromFirstArg|HW_Flag_SIMDScalar|HW_Flag_SpecialCodeGen) HARDWARE_INTRINSIC(Vector128, WidenLower, 16, 1, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId|HW_Flag_BaseTypeFromFirstArg) @@ -229,7 +170,6 @@ HARDWARE_INTRINSIC(Vector128, WidenUpper, HARDWARE_INTRINSIC(Vector128, WithElement, 16, 3, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_BaseTypeFromFirstArg|HW_Flag_SpecialImport) HARDWARE_INTRINSIC(Vector128, WithLower, 16, 2, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_SpecialImport|HW_Flag_NoCodeGen) HARDWARE_INTRINSIC(Vector128, WithUpper, 16, 2, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_SpecialImport|HW_Flag_NoCodeGen) -HARDWARE_INTRINSIC(Vector128, Xor, 16, 2, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId) // *************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************** // ISA Function name SIMD size NumArg EncodesExtraTypeArg Instructions Category Flags diff --git a/src/coreclr/jit/hwintrinsiclistxarch.h b/src/coreclr/jit/hwintrinsiclistxarch.h index acbb4f51781cc4..c07a6a646a6344 100644 --- a/src/coreclr/jit/hwintrinsiclistxarch.h +++ b/src/coreclr/jit/hwintrinsiclistxarch.h @@ -30,27 +30,11 @@ // *************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************** // Vector128 Intrinsics HARDWARE_INTRINSIC(Vector128, Abs, 16, 1, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId) -HARDWARE_INTRINSIC(Vector128, Add, 16, 2, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId) HARDWARE_INTRINSIC(Vector128, AndNot, 16, 2, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId) -HARDWARE_INTRINSIC(Vector128, As, 16, 1, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId|HW_Flag_BaseTypeFromFirstArg) -HARDWARE_INTRINSIC(Vector128, AsByte, 16, 1, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId|HW_Flag_BaseTypeFromFirstArg) -HARDWARE_INTRINSIC(Vector128, AsDouble, 16, 1, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId|HW_Flag_BaseTypeFromFirstArg) -HARDWARE_INTRINSIC(Vector128, AsInt16, 16, 1, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId|HW_Flag_BaseTypeFromFirstArg) -HARDWARE_INTRINSIC(Vector128, AsInt32, 16, 1, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId|HW_Flag_BaseTypeFromFirstArg) -HARDWARE_INTRINSIC(Vector128, AsInt64, 16, 1, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId|HW_Flag_BaseTypeFromFirstArg) -HARDWARE_INTRINSIC(Vector128, AsNInt, 16, 1, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId|HW_Flag_BaseTypeFromFirstArg) -HARDWARE_INTRINSIC(Vector128, AsNUInt, 16, 1, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId|HW_Flag_BaseTypeFromFirstArg) -HARDWARE_INTRINSIC(Vector128, AsSByte, 16, 1, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId|HW_Flag_BaseTypeFromFirstArg) -HARDWARE_INTRINSIC(Vector128, AsSingle, 16, 1, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId|HW_Flag_BaseTypeFromFirstArg) -HARDWARE_INTRINSIC(Vector128, AsUInt16, 16, 1, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId|HW_Flag_BaseTypeFromFirstArg) -HARDWARE_INTRINSIC(Vector128, AsUInt32, 16, 1, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId|HW_Flag_BaseTypeFromFirstArg) -HARDWARE_INTRINSIC(Vector128, AsUInt64, 16, 1, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId|HW_Flag_BaseTypeFromFirstArg) HARDWARE_INTRINSIC(Vector128, AsVector, 16, 1, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId|HW_Flag_BaseTypeFromFirstArg) HARDWARE_INTRINSIC(Vector128, AsVector2, 16, 1, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_movsd_simd, INS_invalid}, HW_Category_SimpleSIMD, HW_Flag_SpecialImport|HW_Flag_BaseTypeFromFirstArg|HW_Flag_SpecialCodeGen) HARDWARE_INTRINSIC(Vector128, AsVector3, 16, 1, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_movups, INS_invalid}, HW_Category_SimpleSIMD, HW_Flag_SpecialImport|HW_Flag_BaseTypeFromFirstArg|HW_Flag_SpecialCodeGen) HARDWARE_INTRINSIC(Vector128, AsVector128, -1, 1, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId|HW_Flag_BaseTypeFromFirstArg) -HARDWARE_INTRINSIC(Vector128, BitwiseAnd, 16, 2, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId) -HARDWARE_INTRINSIC(Vector128, BitwiseOr, 16, 2, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId) HARDWARE_INTRINSIC(Vector128, Ceiling, 16, 1, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId) HARDWARE_INTRINSIC(Vector128, ConditionalSelect, 16, 3, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_SpecialImport|HW_Flag_NoCodeGen) HARDWARE_INTRINSIC(Vector128, ConvertToDouble, 16, 1, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId|HW_Flag_BaseTypeFromFirstArg) @@ -67,17 +51,14 @@ HARDWARE_INTRINSIC(Vector128, Create, HARDWARE_INTRINSIC(Vector128, CreateScalar, 16, 1, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_SpecialImport|HW_Flag_NoCodeGen) HARDWARE_INTRINSIC(Vector128, CreateScalarUnsafe, 16, 1, true, {INS_movd, INS_movd, INS_movd, INS_movd, INS_movd, INS_movd, INS_movd, INS_movd, INS_movss, INS_movsd_simd}, HW_Category_SIMDScalar, HW_Flag_SpecialImport|HW_Flag_SpecialCodeGen|HW_Flag_NoRMWSemantics) HARDWARE_INTRINSIC(Vector128, CreateSequence, 16, 2, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId) -HARDWARE_INTRINSIC(Vector128, Divide, 16, 2, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId) HARDWARE_INTRINSIC(Vector128, Dot, 16, 2, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_SpecialImport|HW_Flag_NoCodeGen|HW_Flag_BaseTypeFromFirstArg) HARDWARE_INTRINSIC(Vector128, Equals, 16, 2, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId) -HARDWARE_INTRINSIC(Vector128, EqualsAll, 16, 2, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId|HW_Flag_BaseTypeFromFirstArg) HARDWARE_INTRINSIC(Vector128, EqualsAny, 16, 2, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId|HW_Flag_BaseTypeFromFirstArg) HARDWARE_INTRINSIC(Vector128, ExtractMostSignificantBits, 16, 1, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId|HW_Flag_BaseTypeFromFirstArg) HARDWARE_INTRINSIC(Vector128, Floor, 16, 1, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId) HARDWARE_INTRINSIC(Vector128, get_AllBitsSet, 16, 0, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId) HARDWARE_INTRINSIC(Vector128, get_Indices, 16, 0, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId) HARDWARE_INTRINSIC(Vector128, get_One, 16, 0, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId) -HARDWARE_INTRINSIC(Vector128, get_Zero, 16, 0, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId) HARDWARE_INTRINSIC(Vector128, GetElement, 16, 2, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_extractps, INS_invalid}, HW_Category_Helper, HW_Flag_SpecialImport|HW_Flag_SpecialCodeGen|HW_Flag_BaseTypeFromFirstArg) HARDWARE_INTRINSIC(Vector128, GreaterThan, 16, 2, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId) HARDWARE_INTRINSIC(Vector128, GreaterThanAll, 16, 2, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId|HW_Flag_BaseTypeFromFirstArg) @@ -91,16 +72,12 @@ HARDWARE_INTRINSIC(Vector128, LessThanAny, HARDWARE_INTRINSIC(Vector128, LessThanOrEqual, 16, 2, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId) HARDWARE_INTRINSIC(Vector128, LessThanOrEqualAll, 16, 2, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId|HW_Flag_BaseTypeFromFirstArg) HARDWARE_INTRINSIC(Vector128, LessThanOrEqualAny, 16, 2, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId|HW_Flag_BaseTypeFromFirstArg) -HARDWARE_INTRINSIC(Vector128, Load, 16, 1, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId) HARDWARE_INTRINSIC(Vector128, LoadAligned, 16, 1, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId) HARDWARE_INTRINSIC(Vector128, LoadAlignedNonTemporal, 16, 1, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId) HARDWARE_INTRINSIC(Vector128, LoadUnsafe, 16, -1, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId) HARDWARE_INTRINSIC(Vector128, Max, 16, 2, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId) HARDWARE_INTRINSIC(Vector128, Min, 16, 2, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId) -HARDWARE_INTRINSIC(Vector128, Multiply, 16, 2, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId) HARDWARE_INTRINSIC(Vector128, Narrow, 16, 2, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId) -HARDWARE_INTRINSIC(Vector128, Negate, 16, 1, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId) -HARDWARE_INTRINSIC(Vector128, OnesComplement, 16, 1, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId) HARDWARE_INTRINSIC(Vector128, op_Addition, 16, 2, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId) HARDWARE_INTRINSIC(Vector128, op_BitwiseAnd, 16, 2, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId) HARDWARE_INTRINSIC(Vector128, op_BitwiseOr, 16, 2, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId) @@ -114,18 +91,12 @@ HARDWARE_INTRINSIC(Vector128, op_OnesComplement, HARDWARE_INTRINSIC(Vector128, op_RightShift, 16, 2, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId) HARDWARE_INTRINSIC(Vector128, op_Subtraction, 16, 2, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId) HARDWARE_INTRINSIC(Vector128, op_UnaryNegation, 16, 1, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId) -HARDWARE_INTRINSIC(Vector128, op_UnaryPlus, 16, 1, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId) HARDWARE_INTRINSIC(Vector128, op_UnsignedRightShift, 16, 2, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId) -HARDWARE_INTRINSIC(Vector128, ShiftLeft, 16, 2, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId) -HARDWARE_INTRINSIC(Vector128, ShiftRightArithmetic, 16, 2, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId) -HARDWARE_INTRINSIC(Vector128, ShiftRightLogical, 16, 2, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId) HARDWARE_INTRINSIC(Vector128, Shuffle, 16, -1, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId) HARDWARE_INTRINSIC(Vector128, Sqrt, 16, 1, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId) -HARDWARE_INTRINSIC(Vector128, Store, 16, 2, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId|HW_Flag_BaseTypeFromFirstArg) HARDWARE_INTRINSIC(Vector128, StoreAligned, 16, 2, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId|HW_Flag_BaseTypeFromFirstArg) HARDWARE_INTRINSIC(Vector128, StoreAlignedNonTemporal, 16, 2, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId|HW_Flag_BaseTypeFromFirstArg) HARDWARE_INTRINSIC(Vector128, StoreUnsafe, 16, -1, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId|HW_Flag_BaseTypeFromFirstArg) -HARDWARE_INTRINSIC(Vector128, Subtract, 16, 2, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId) HARDWARE_INTRINSIC(Vector128, Sum, 16, 1, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId|HW_Flag_BaseTypeFromFirstArg) HARDWARE_INTRINSIC(Vector128, ToScalar, 16, 1, true, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_movss, INS_movsd_simd}, HW_Category_SIMDScalar, HW_Flag_SpecialImport|HW_Flag_SpecialCodeGen|HW_Flag_BaseTypeFromFirstArg|HW_Flag_NoRMWSemantics) HARDWARE_INTRINSIC(Vector128, ToVector256, 16, 1, true, {INS_movdqu, INS_movdqu, INS_movdqu, INS_movdqu, INS_movdqu, INS_movdqu, INS_movdqu, INS_movdqu, INS_movups, INS_movupd}, HW_Category_SimpleSIMD, HW_Flag_SpecialImport|HW_Flag_SpecialCodeGen|HW_Flag_BaseTypeFromFirstArg|HW_Flag_NoRMWSemantics) @@ -134,7 +105,6 @@ HARDWARE_INTRINSIC(Vector128, ToVector512, HARDWARE_INTRINSIC(Vector128, WidenLower, 16, 1, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId|HW_Flag_BaseTypeFromFirstArg) HARDWARE_INTRINSIC(Vector128, WidenUpper, 16, 1, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId|HW_Flag_BaseTypeFromFirstArg) HARDWARE_INTRINSIC(Vector128, WithElement, 16, 3, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_SpecialImport|HW_Flag_NoContainment|HW_Flag_BaseTypeFromFirstArg) -HARDWARE_INTRINSIC(Vector128, Xor, 16, 2, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId) // *************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************** // ISA Function name SIMD size NumArg EncodesExtraTypeArg Instructions Category Flags @@ -142,25 +112,9 @@ HARDWARE_INTRINSIC(Vector128, Xor, // *************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************** // Vector256 Intrinsics HARDWARE_INTRINSIC(Vector256, Abs, 32, 1, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId) -HARDWARE_INTRINSIC(Vector256, Add, 32, 2, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId) HARDWARE_INTRINSIC(Vector256, AndNot, 32, 2, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId|HW_Flag_AvxOnlyCompatible) -HARDWARE_INTRINSIC(Vector256, As, 32, 1, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId|HW_Flag_BaseTypeFromFirstArg|HW_Flag_AvxOnlyCompatible) -HARDWARE_INTRINSIC(Vector256, AsByte, 32, 1, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId|HW_Flag_BaseTypeFromFirstArg|HW_Flag_AvxOnlyCompatible) -HARDWARE_INTRINSIC(Vector256, AsDouble, 32, 1, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId|HW_Flag_BaseTypeFromFirstArg|HW_Flag_AvxOnlyCompatible) -HARDWARE_INTRINSIC(Vector256, AsInt16, 32, 1, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId|HW_Flag_BaseTypeFromFirstArg|HW_Flag_AvxOnlyCompatible) -HARDWARE_INTRINSIC(Vector256, AsInt32, 32, 1, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId|HW_Flag_BaseTypeFromFirstArg|HW_Flag_AvxOnlyCompatible) -HARDWARE_INTRINSIC(Vector256, AsInt64, 32, 1, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId|HW_Flag_BaseTypeFromFirstArg|HW_Flag_AvxOnlyCompatible) -HARDWARE_INTRINSIC(Vector256, AsNInt, 32, 1, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId|HW_Flag_BaseTypeFromFirstArg|HW_Flag_AvxOnlyCompatible) -HARDWARE_INTRINSIC(Vector256, AsNUInt, 32, 1, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId|HW_Flag_BaseTypeFromFirstArg|HW_Flag_AvxOnlyCompatible) -HARDWARE_INTRINSIC(Vector256, AsSByte, 32, 1, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId|HW_Flag_BaseTypeFromFirstArg|HW_Flag_AvxOnlyCompatible) -HARDWARE_INTRINSIC(Vector256, AsSingle, 32, 1, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId|HW_Flag_BaseTypeFromFirstArg|HW_Flag_AvxOnlyCompatible) -HARDWARE_INTRINSIC(Vector256, AsUInt16, 32, 1, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId|HW_Flag_BaseTypeFromFirstArg|HW_Flag_AvxOnlyCompatible) -HARDWARE_INTRINSIC(Vector256, AsUInt32, 32, 1, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId|HW_Flag_BaseTypeFromFirstArg|HW_Flag_AvxOnlyCompatible) -HARDWARE_INTRINSIC(Vector256, AsUInt64, 32, 1, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId|HW_Flag_BaseTypeFromFirstArg|HW_Flag_AvxOnlyCompatible) HARDWARE_INTRINSIC(Vector256, AsVector, 32, 1, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId|HW_Flag_BaseTypeFromFirstArg|HW_Flag_AvxOnlyCompatible) HARDWARE_INTRINSIC(Vector256, AsVector256, 32, 1, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId|HW_Flag_BaseTypeFromFirstArg|HW_Flag_AvxOnlyCompatible) -HARDWARE_INTRINSIC(Vector256, BitwiseAnd, 32, 2, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId|HW_Flag_AvxOnlyCompatible) -HARDWARE_INTRINSIC(Vector256, BitwiseOr, 32, 2, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId|HW_Flag_AvxOnlyCompatible) HARDWARE_INTRINSIC(Vector256, Ceiling, 32, 1, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId|HW_Flag_AvxOnlyCompatible) HARDWARE_INTRINSIC(Vector256, ConditionalSelect, 32, 3, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_SpecialImport|HW_Flag_NoCodeGen|HW_Flag_AvxOnlyCompatible) HARDWARE_INTRINSIC(Vector256, ConvertToDouble, 32, 1, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId|HW_Flag_BaseTypeFromFirstArg) @@ -177,17 +131,14 @@ HARDWARE_INTRINSIC(Vector256, Create, HARDWARE_INTRINSIC(Vector256, CreateScalar, 32, -1, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_SpecialImport|HW_Flag_NoCodeGen|HW_Flag_AvxOnlyCompatible) HARDWARE_INTRINSIC(Vector256, CreateScalarUnsafe, 32, 1, true, {INS_movd, INS_movd, INS_movd, INS_movd, INS_movd, INS_movd, INS_movd, INS_movd, INS_movss, INS_movsd_simd}, HW_Category_SIMDScalar, HW_Flag_SpecialImport|HW_Flag_SpecialCodeGen|HW_Flag_AvxOnlyCompatible) HARDWARE_INTRINSIC(Vector256, CreateSequence, 32, 2, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId|HW_Flag_AvxOnlyCompatible) -HARDWARE_INTRINSIC(Vector256, Divide, 32, 2, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId) HARDWARE_INTRINSIC(Vector256, Dot, 32, 2, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_SpecialImport|HW_Flag_NoCodeGen|HW_Flag_BaseTypeFromFirstArg) HARDWARE_INTRINSIC(Vector256, Equals, 32, 2, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId) -HARDWARE_INTRINSIC(Vector256, EqualsAll, 32, 2, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId|HW_Flag_BaseTypeFromFirstArg) HARDWARE_INTRINSIC(Vector256, EqualsAny, 32, 2, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId|HW_Flag_BaseTypeFromFirstArg) HARDWARE_INTRINSIC(Vector256, ExtractMostSignificantBits, 32, 1, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId|HW_Flag_BaseTypeFromFirstArg) HARDWARE_INTRINSIC(Vector256, Floor, 32, 1, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId|HW_Flag_AvxOnlyCompatible) HARDWARE_INTRINSIC(Vector256, get_AllBitsSet, 32, 0, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId|HW_Flag_AvxOnlyCompatible) HARDWARE_INTRINSIC(Vector256, get_Indices, 32, 0, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId) HARDWARE_INTRINSIC(Vector256, get_One, 32, 0, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId) -HARDWARE_INTRINSIC(Vector256, get_Zero, 32, 0, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId|HW_Flag_AvxOnlyCompatible) HARDWARE_INTRINSIC(Vector256, GetElement, 32, 2, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_SpecialImport|HW_Flag_BaseTypeFromFirstArg|HW_Flag_AvxOnlyCompatible) HARDWARE_INTRINSIC(Vector256, GetLower, 32, 1, true, {INS_movdqu, INS_movdqu, INS_movdqu, INS_movdqu, INS_movdqu, INS_movdqu, INS_movdqu, INS_movdqu, INS_movups, INS_movupd}, HW_Category_SimpleSIMD, HW_Flag_SpecialImport|HW_Flag_SpecialCodeGen|HW_Flag_AvxOnlyCompatible) HARDWARE_INTRINSIC(Vector256, GetUpper, 32, 1, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_SpecialImport|HW_Flag_NoCodeGen|HW_Flag_AvxOnlyCompatible) @@ -203,16 +154,12 @@ HARDWARE_INTRINSIC(Vector256, LessThanAny, HARDWARE_INTRINSIC(Vector256, LessThanOrEqual, 32, 2, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId) HARDWARE_INTRINSIC(Vector256, LessThanOrEqualAny, 32, 2, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId|HW_Flag_BaseTypeFromFirstArg) HARDWARE_INTRINSIC(Vector256, LessThanOrEqualAll, 32, 2, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId|HW_Flag_BaseTypeFromFirstArg) -HARDWARE_INTRINSIC(Vector256, Load, 32, 1, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId|HW_Flag_AvxOnlyCompatible) HARDWARE_INTRINSIC(Vector256, LoadAligned, 32, 1, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId|HW_Flag_AvxOnlyCompatible) HARDWARE_INTRINSIC(Vector256, LoadAlignedNonTemporal, 32, 1, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId|HW_Flag_AvxOnlyCompatible) HARDWARE_INTRINSIC(Vector256, LoadUnsafe, 32, -1, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId|HW_Flag_AvxOnlyCompatible) HARDWARE_INTRINSIC(Vector256, Max, 32, 2, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId) HARDWARE_INTRINSIC(Vector256, Min, 32, 2, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId) -HARDWARE_INTRINSIC(Vector256, Multiply, 32, 2, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId) HARDWARE_INTRINSIC(Vector256, Narrow, 32, 2, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId) -HARDWARE_INTRINSIC(Vector256, Negate, 32, 1, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId) -HARDWARE_INTRINSIC(Vector256, OnesComplement, 32, 1, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId|HW_Flag_AvxOnlyCompatible) HARDWARE_INTRINSIC(Vector256, op_Addition, 32, 2, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId) HARDWARE_INTRINSIC(Vector256, op_BitwiseAnd, 32, 2, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId|HW_Flag_AvxOnlyCompatible) HARDWARE_INTRINSIC(Vector256, op_BitwiseOr, 32, 2, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId|HW_Flag_AvxOnlyCompatible) @@ -226,18 +173,12 @@ HARDWARE_INTRINSIC(Vector256, op_OnesComplement, HARDWARE_INTRINSIC(Vector256, op_RightShift, 32, 2, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId) HARDWARE_INTRINSIC(Vector256, op_Subtraction, 32, 2, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId) HARDWARE_INTRINSIC(Vector256, op_UnaryNegation, 32, 1, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId) -HARDWARE_INTRINSIC(Vector256, op_UnaryPlus, 32, 1, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId|HW_Flag_AvxOnlyCompatible) HARDWARE_INTRINSIC(Vector256, op_UnsignedRightShift, 32, 2, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId) -HARDWARE_INTRINSIC(Vector256, ShiftLeft, 32, 2, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId) -HARDWARE_INTRINSIC(Vector256, ShiftRightArithmetic, 32, 2, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId) -HARDWARE_INTRINSIC(Vector256, ShiftRightLogical, 32, 2, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId) HARDWARE_INTRINSIC(Vector256, Shuffle, 32, -1, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId) HARDWARE_INTRINSIC(Vector256, Sqrt, 32, 1, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId|HW_Flag_AvxOnlyCompatible) -HARDWARE_INTRINSIC(Vector256, Store, 32, 2, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId|HW_Flag_BaseTypeFromFirstArg|HW_Flag_AvxOnlyCompatible) HARDWARE_INTRINSIC(Vector256, StoreAligned, 32, 2, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId|HW_Flag_BaseTypeFromFirstArg|HW_Flag_AvxOnlyCompatible) HARDWARE_INTRINSIC(Vector256, StoreAlignedNonTemporal, 32, 2, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId|HW_Flag_BaseTypeFromFirstArg|HW_Flag_AvxOnlyCompatible) HARDWARE_INTRINSIC(Vector256, StoreUnsafe, 32, -1, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId|HW_Flag_BaseTypeFromFirstArg|HW_Flag_AvxOnlyCompatible) -HARDWARE_INTRINSIC(Vector256, Subtract, 32, 2, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId) HARDWARE_INTRINSIC(Vector256, Sum, 32, 1, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId|HW_Flag_BaseTypeFromFirstArg) HARDWARE_INTRINSIC(Vector256, ToScalar, 32, 1, true, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_movss, INS_movsd_simd}, HW_Category_SIMDScalar, HW_Flag_SpecialImport|HW_Flag_SpecialCodeGen|HW_Flag_BaseTypeFromFirstArg|HW_Flag_AvxOnlyCompatible) HARDWARE_INTRINSIC(Vector256, ToVector512, 32, 1, true, {INS_movdqu, INS_movdqu, INS_movdqu, INS_movdqu, INS_movdqu, INS_movdqu, INS_vmovdqu64, INS_vmovdqu64, INS_movups, INS_movupd}, HW_Category_SimpleSIMD, HW_Flag_SpecialImport|HW_Flag_SpecialCodeGen|HW_Flag_BaseTypeFromFirstArg) @@ -247,7 +188,6 @@ HARDWARE_INTRINSIC(Vector256, WidenUpper, HARDWARE_INTRINSIC(Vector256, WithElement, 32, 3, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_SpecialImport|HW_Flag_NoContainment|HW_Flag_BaseTypeFromFirstArg|HW_Flag_AvxOnlyCompatible) HARDWARE_INTRINSIC(Vector256, WithLower, 32, 2, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_SpecialImport|HW_Flag_NoCodeGen|HW_Flag_AvxOnlyCompatible) HARDWARE_INTRINSIC(Vector256, WithUpper, 32, 2, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_SpecialImport|HW_Flag_NoCodeGen|HW_Flag_AvxOnlyCompatible) -HARDWARE_INTRINSIC(Vector256, Xor, 32, 2, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId|HW_Flag_AvxOnlyCompatible) // *************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************** // ISA Function name SIMD size NumArg EncodesExtraTypeArg Instructions Category Flags @@ -255,26 +195,10 @@ HARDWARE_INTRINSIC(Vector256, Xor, // *************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************** // Vector512 Intrinsics HARDWARE_INTRINSIC(Vector512, Abs, 64, 1, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId) -HARDWARE_INTRINSIC(Vector512, Add, 64, 2, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId) HARDWARE_INTRINSIC(Vector512, AndNot, 64, 2, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId) -HARDWARE_INTRINSIC(Vector512, As, 64, 1, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId|HW_Flag_BaseTypeFromFirstArg) -HARDWARE_INTRINSIC(Vector512, AsByte, 64, 1, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId|HW_Flag_BaseTypeFromFirstArg) -HARDWARE_INTRINSIC(Vector512, AsDouble, 64, 1, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId|HW_Flag_BaseTypeFromFirstArg) -HARDWARE_INTRINSIC(Vector512, AsInt16, 64, 1, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId|HW_Flag_BaseTypeFromFirstArg) -HARDWARE_INTRINSIC(Vector512, AsInt32, 64, 1, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId|HW_Flag_BaseTypeFromFirstArg) -HARDWARE_INTRINSIC(Vector512, AsInt64, 64, 1, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId|HW_Flag_BaseTypeFromFirstArg) -HARDWARE_INTRINSIC(Vector512, AsNInt, 64, 1, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId|HW_Flag_BaseTypeFromFirstArg) -HARDWARE_INTRINSIC(Vector512, AsNUInt, 64, 1, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId|HW_Flag_BaseTypeFromFirstArg) -HARDWARE_INTRINSIC(Vector512, AsSByte, 64, 1, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId|HW_Flag_BaseTypeFromFirstArg) -HARDWARE_INTRINSIC(Vector512, AsSingle, 64, 1, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId|HW_Flag_BaseTypeFromFirstArg) -HARDWARE_INTRINSIC(Vector512, AsUInt16, 64, 1, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId|HW_Flag_BaseTypeFromFirstArg) -HARDWARE_INTRINSIC(Vector512, AsUInt32, 64, 1, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId|HW_Flag_BaseTypeFromFirstArg) -HARDWARE_INTRINSIC(Vector512, AsUInt64, 64, 1, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId|HW_Flag_BaseTypeFromFirstArg) HARDWARE_INTRINSIC(Vector512, AsVector, 64, 1, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId|HW_Flag_BaseTypeFromFirstArg) HARDWARE_INTRINSIC(Vector512, AsVector512, 64, 1, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId|HW_Flag_BaseTypeFromFirstArg) -HARDWARE_INTRINSIC(Vector512, BitwiseAnd, 64, 2, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId) HARDWARE_INTRINSIC(Vector512, ConditionalSelect, 64, 3, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_SpecialImport|HW_Flag_NoCodeGen) -HARDWARE_INTRINSIC(Vector512, BitwiseOr, 64, 2, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId) HARDWARE_INTRINSIC(Vector512, Ceiling, 64, 1, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId) HARDWARE_INTRINSIC(Vector512, Create, 64, -1, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_SpecialImport|HW_Flag_NoCodeGen) HARDWARE_INTRINSIC(Vector512, CreateScalar, 64, -1, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_SpecialImport|HW_Flag_NoCodeGen) @@ -290,16 +214,13 @@ HARDWARE_INTRINSIC(Vector512, ConvertToUInt32, HARDWARE_INTRINSIC(Vector512, ConvertToUInt32Native, 64, 1, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId|HW_Flag_BaseTypeFromFirstArg) HARDWARE_INTRINSIC(Vector512, ConvertToUInt64, 64, 1, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId|HW_Flag_BaseTypeFromFirstArg) HARDWARE_INTRINSIC(Vector512, ConvertToUInt64Native, 64, 1, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId|HW_Flag_BaseTypeFromFirstArg) -HARDWARE_INTRINSIC(Vector512, Divide, 64, 2, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId) HARDWARE_INTRINSIC(Vector512, Equals, 64, 2, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId|HW_Flag_BaseTypeFromFirstArg) -HARDWARE_INTRINSIC(Vector512, EqualsAll, 64, 2, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId|HW_Flag_BaseTypeFromFirstArg) HARDWARE_INTRINSIC(Vector512, EqualsAny, 64, 2, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId|HW_Flag_BaseTypeFromFirstArg) HARDWARE_INTRINSIC(Vector512, ExtractMostSignificantBits, 64, 1, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId|HW_Flag_BaseTypeFromFirstArg) HARDWARE_INTRINSIC(Vector512, Floor, 64, 1, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId) HARDWARE_INTRINSIC(Vector512, get_AllBitsSet, 64, 0, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId) HARDWARE_INTRINSIC(Vector512, get_Indices, 64, 0, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId) HARDWARE_INTRINSIC(Vector512, get_One, 64, 0, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId) -HARDWARE_INTRINSIC(Vector512, get_Zero, 64, 0, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId) HARDWARE_INTRINSIC(Vector512, GetElement, 64, 2, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_SpecialImport|HW_Flag_BaseTypeFromFirstArg) HARDWARE_INTRINSIC(Vector512, GetLower, 64, 1, true, {INS_movdqu, INS_movdqu, INS_movdqu, INS_movdqu, INS_movdqu, INS_movdqu, INS_vmovdqu64, INS_vmovdqu64, INS_movups, INS_movupd}, HW_Category_SimpleSIMD, HW_Flag_SpecialImport|HW_Flag_SpecialCodeGen) HARDWARE_INTRINSIC(Vector512, GetLower128, 64, 1, true, {INS_movdqu, INS_movdqu, INS_movdqu, INS_movdqu, INS_movdqu, INS_movdqu, INS_vmovdqu64, INS_vmovdqu64, INS_movups, INS_movupd}, HW_Category_SimpleSIMD, HW_Flag_SpecialImport|HW_Flag_SpecialCodeGen|HW_Flag_BaseTypeFromFirstArg) @@ -316,16 +237,12 @@ HARDWARE_INTRINSIC(Vector512, LessThanAny, HARDWARE_INTRINSIC(Vector512, LessThanOrEqual, 64, 2, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId) HARDWARE_INTRINSIC(Vector512, LessThanOrEqualAll, 64, 2, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId|HW_Flag_BaseTypeFromFirstArg) HARDWARE_INTRINSIC(Vector512, LessThanOrEqualAny, 64, 2, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId|HW_Flag_BaseTypeFromFirstArg) -HARDWARE_INTRINSIC(Vector512, Load, 64, 1, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId) HARDWARE_INTRINSIC(Vector512, LoadAligned, 64, 1, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId) HARDWARE_INTRINSIC(Vector512, LoadAlignedNonTemporal, 64, 1, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId) HARDWARE_INTRINSIC(Vector512, LoadUnsafe, 64, -1, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId) HARDWARE_INTRINSIC(Vector512, Max, 64, 2, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId) HARDWARE_INTRINSIC(Vector512, Min, 64, 2, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId) -HARDWARE_INTRINSIC(Vector512, Multiply, 64, 2, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId) HARDWARE_INTRINSIC(Vector512, Narrow, 64, 2, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId) -HARDWARE_INTRINSIC(Vector512, Negate, 64, 1, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId) -HARDWARE_INTRINSIC(Vector512, OnesComplement, 64, 1, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId) HARDWARE_INTRINSIC(Vector512, op_Addition, 64, 2, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId) HARDWARE_INTRINSIC(Vector512, op_BitwiseAnd, 64, 2, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId) HARDWARE_INTRINSIC(Vector512, op_BitwiseOr, 64, 2, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId) @@ -339,18 +256,12 @@ HARDWARE_INTRINSIC(Vector512, op_OnesComplement, HARDWARE_INTRINSIC(Vector512, op_RightShift, 64, 2, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId) HARDWARE_INTRINSIC(Vector512, op_Subtraction, 64, 2, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId) HARDWARE_INTRINSIC(Vector512, op_UnaryNegation, 64, 1, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId) -HARDWARE_INTRINSIC(Vector512, op_UnaryPlus, 64, 1, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId) HARDWARE_INTRINSIC(Vector512, op_UnsignedRightShift, 64, 2, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId) -HARDWARE_INTRINSIC(Vector512, ShiftLeft, 64, 2, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId) -HARDWARE_INTRINSIC(Vector512, ShiftRightArithmetic, 64, 2, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId) -HARDWARE_INTRINSIC(Vector512, ShiftRightLogical, 64, 2, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId) HARDWARE_INTRINSIC(Vector512, Shuffle, 64, -1, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId) HARDWARE_INTRINSIC(Vector512, Sqrt, 64, 1, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId) -HARDWARE_INTRINSIC(Vector512, Store, 64, 2, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId|HW_Flag_BaseTypeFromFirstArg) HARDWARE_INTRINSIC(Vector512, StoreAligned, 64, 2, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId|HW_Flag_BaseTypeFromFirstArg) HARDWARE_INTRINSIC(Vector512, StoreAlignedNonTemporal, 64, 2, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId|HW_Flag_BaseTypeFromFirstArg) HARDWARE_INTRINSIC(Vector512, StoreUnsafe, 64, -1, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId|HW_Flag_BaseTypeFromFirstArg) -HARDWARE_INTRINSIC(Vector512, Subtract, 64, 2, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId) HARDWARE_INTRINSIC(Vector512, Sum, 64, 1, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId|HW_Flag_BaseTypeFromFirstArg) HARDWARE_INTRINSIC(Vector512, ToScalar, 64, 1, true, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_movss, INS_movsd_simd}, HW_Category_SIMDScalar, HW_Flag_SpecialImport|HW_Flag_SpecialCodeGen|HW_Flag_BaseTypeFromFirstArg) HARDWARE_INTRINSIC(Vector512, WidenLower, 64, 1, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId|HW_Flag_BaseTypeFromFirstArg) @@ -358,7 +269,6 @@ HARDWARE_INTRINSIC(Vector512, WidenUpper, HARDWARE_INTRINSIC(Vector512, WithElement, 64, 3, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_SpecialImport|HW_Flag_NoContainment|HW_Flag_BaseTypeFromFirstArg) HARDWARE_INTRINSIC(Vector512, WithLower, 64, 2, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_SpecialImport|HW_Flag_NoCodeGen) HARDWARE_INTRINSIC(Vector512, WithUpper, 64, 2, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_SpecialImport|HW_Flag_NoCodeGen) -HARDWARE_INTRINSIC(Vector512, Xor, 64, 2, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId) // *************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************** // ISA Function name SIMD size NumArg EncodesExtraTypeArg Instructions Category Flags diff --git a/src/coreclr/jit/hwintrinsicxarch.cpp b/src/coreclr/jit/hwintrinsicxarch.cpp index e8eb9c4b2d6cda..12b6b9a052b1d8 100644 --- a/src/coreclr/jit/hwintrinsicxarch.cpp +++ b/src/coreclr/jit/hwintrinsicxarch.cpp @@ -1003,9 +1003,6 @@ GenTree* Compiler::impSpecialIntrinsic(NamedIntrinsic intrinsic, break; } - case NI_Vector128_Add: - case NI_Vector256_Add: - case NI_Vector512_Add: case NI_Vector128_op_Addition: case NI_Vector256_op_Addition: case NI_Vector512_op_Addition: @@ -1039,58 +1036,6 @@ GenTree* Compiler::impSpecialIntrinsic(NamedIntrinsic intrinsic, break; } - case NI_Vector128_As: - case NI_Vector128_AsByte: - case NI_Vector128_AsDouble: - case NI_Vector128_AsInt16: - case NI_Vector128_AsInt32: - case NI_Vector128_AsInt64: - case NI_Vector128_AsNInt: - case NI_Vector128_AsNUInt: - case NI_Vector128_AsSByte: - case NI_Vector128_AsSingle: - case NI_Vector128_AsUInt16: - case NI_Vector128_AsUInt32: - case NI_Vector128_AsUInt64: - case NI_Vector256_As: - case NI_Vector256_AsByte: - case NI_Vector256_AsDouble: - case NI_Vector256_AsInt16: - case NI_Vector256_AsInt32: - case NI_Vector256_AsInt64: - case NI_Vector256_AsNInt: - case NI_Vector256_AsNUInt: - case NI_Vector256_AsSByte: - case NI_Vector256_AsSingle: - case NI_Vector256_AsUInt16: - case NI_Vector256_AsUInt32: - case NI_Vector256_AsUInt64: - case NI_Vector512_As: - case NI_Vector512_AsByte: - case NI_Vector512_AsDouble: - case NI_Vector512_AsInt16: - case NI_Vector512_AsInt32: - case NI_Vector512_AsInt64: - case NI_Vector512_AsNInt: - case NI_Vector512_AsNUInt: - case NI_Vector512_AsSByte: - case NI_Vector512_AsSingle: - case NI_Vector512_AsUInt16: - case NI_Vector512_AsUInt32: - case NI_Vector512_AsUInt64: - { - // We fold away the cast here, as it only exists to satisfy - // the type system. It is safe to do this here since the retNode type - // and the signature return type are both the same TYP_SIMD. - - assert(sig->numArgs == 1); - - retNode = impSIMDPopStack(); - SetOpLclRelatedToSIMDIntrinsic(retNode); - assert(retNode->gtType == getSIMDTypeForSize(getSIMDTypeSizeInBytes(sig->retTypeSigClass))); - break; - } - case NI_Vector128_AsVector: { assert(sig->numArgs == 1); @@ -1320,9 +1265,6 @@ GenTree* Compiler::impSpecialIntrinsic(NamedIntrinsic intrinsic, break; } - case NI_Vector128_BitwiseAnd: - case NI_Vector256_BitwiseAnd: - case NI_Vector512_BitwiseAnd: case NI_Vector128_op_BitwiseAnd: case NI_Vector256_op_BitwiseAnd: case NI_Vector512_op_BitwiseAnd: @@ -1336,9 +1278,6 @@ GenTree* Compiler::impSpecialIntrinsic(NamedIntrinsic intrinsic, break; } - case NI_Vector128_BitwiseOr: - case NI_Vector256_BitwiseOr: - case NI_Vector512_BitwiseOr: case NI_Vector128_op_BitwiseOr: case NI_Vector256_op_BitwiseOr: case NI_Vector512_op_BitwiseOr: @@ -1892,9 +1831,6 @@ GenTree* Compiler::impSpecialIntrinsic(NamedIntrinsic intrinsic, break; } - case NI_Vector128_Divide: - case NI_Vector256_Divide: - case NI_Vector512_Divide: case NI_Vector128_op_Division: case NI_Vector256_op_Division: case NI_Vector512_op_Division: @@ -1978,9 +1914,6 @@ GenTree* Compiler::impSpecialIntrinsic(NamedIntrinsic intrinsic, break; } - case NI_Vector128_EqualsAll: - case NI_Vector256_EqualsAll: - case NI_Vector512_EqualsAll: case NI_Vector128_op_Equality: case NI_Vector256_op_Equality: case NI_Vector512_op_Equality: @@ -2206,15 +2139,6 @@ GenTree* Compiler::impSpecialIntrinsic(NamedIntrinsic intrinsic, break; } - case NI_Vector128_get_Zero: - case NI_Vector256_get_Zero: - case NI_Vector512_get_Zero: - { - assert(sig->numArgs == 0); - retNode = gtNewZeroConNode(retType); - break; - } - case NI_Vector128_GetElement: case NI_Vector256_GetElement: case NI_Vector512_GetElement: @@ -2485,9 +2409,6 @@ GenTree* Compiler::impSpecialIntrinsic(NamedIntrinsic intrinsic, case NI_AVX_LoadVector256: case NI_AVX512F_LoadVector512: case NI_AVX512BW_LoadVector512: - case NI_Vector128_Load: - case NI_Vector256_Load: - case NI_Vector512_Load: case NI_Vector128_LoadUnsafe: case NI_Vector256_LoadUnsafe: case NI_Vector512_LoadUnsafe: @@ -2590,9 +2511,6 @@ GenTree* Compiler::impSpecialIntrinsic(NamedIntrinsic intrinsic, break; } - case NI_Vector128_Multiply: - case NI_Vector256_Multiply: - case NI_Vector512_Multiply: case NI_Vector128_op_Multiply: case NI_Vector256_op_Multiply: case NI_Vector512_op_Multiply: @@ -2657,9 +2575,6 @@ GenTree* Compiler::impSpecialIntrinsic(NamedIntrinsic intrinsic, break; } - case NI_Vector128_Negate: - case NI_Vector256_Negate: - case NI_Vector512_Negate: case NI_Vector128_op_UnaryNegation: case NI_Vector256_op_UnaryNegation: case NI_Vector512_op_UnaryNegation: @@ -2675,9 +2590,6 @@ GenTree* Compiler::impSpecialIntrinsic(NamedIntrinsic intrinsic, break; } - case NI_Vector128_OnesComplement: - case NI_Vector256_OnesComplement: - case NI_Vector512_OnesComplement: case NI_Vector128_op_OnesComplement: case NI_Vector256_op_OnesComplement: case NI_Vector512_op_OnesComplement: @@ -2723,18 +2635,6 @@ GenTree* Compiler::impSpecialIntrinsic(NamedIntrinsic intrinsic, break; } - case NI_Vector128_op_UnaryPlus: - case NI_Vector256_op_UnaryPlus: - case NI_Vector512_op_UnaryPlus: - { - assert(sig->numArgs == 1); - retNode = impSIMDPopStack(); - break; - } - - case NI_Vector128_Subtract: - case NI_Vector256_Subtract: - case NI_Vector512_Subtract: case NI_Vector128_op_Subtraction: case NI_Vector256_op_Subtraction: case NI_Vector512_op_Subtraction: @@ -2752,9 +2652,6 @@ GenTree* Compiler::impSpecialIntrinsic(NamedIntrinsic intrinsic, break; } - case NI_Vector128_ShiftLeft: - case NI_Vector256_ShiftLeft: - case NI_Vector512_ShiftLeft: case NI_Vector128_op_LeftShift: case NI_Vector256_op_LeftShift: case NI_Vector512_op_LeftShift: @@ -2777,9 +2674,6 @@ GenTree* Compiler::impSpecialIntrinsic(NamedIntrinsic intrinsic, break; } - case NI_Vector128_ShiftRightArithmetic: - case NI_Vector256_ShiftRightArithmetic: - case NI_Vector512_ShiftRightArithmetic: case NI_Vector128_op_RightShift: case NI_Vector256_op_RightShift: case NI_Vector512_op_RightShift: @@ -2813,9 +2707,6 @@ GenTree* Compiler::impSpecialIntrinsic(NamedIntrinsic intrinsic, break; } - case NI_Vector128_ShiftRightLogical: - case NI_Vector256_ShiftRightLogical: - case NI_Vector512_ShiftRightLogical: case NI_Vector128_op_UnsignedRightShift: case NI_Vector256_op_UnsignedRightShift: case NI_Vector512_op_UnsignedRightShift: @@ -2962,9 +2853,6 @@ GenTree* Compiler::impSpecialIntrinsic(NamedIntrinsic intrinsic, break; } - case NI_Vector128_Store: - case NI_Vector256_Store: - case NI_Vector512_Store: case NI_Vector128_StoreUnsafe: case NI_Vector256_StoreUnsafe: case NI_Vector512_StoreUnsafe: @@ -3315,9 +3203,6 @@ GenTree* Compiler::impSpecialIntrinsic(NamedIntrinsic intrinsic, break; } - case NI_Vector128_Xor: - case NI_Vector256_Xor: - case NI_Vector512_Xor: case NI_Vector128_op_ExclusiveOr: case NI_Vector256_op_ExclusiveOr: case NI_Vector512_op_ExclusiveOr: diff --git a/src/coreclr/jit/importercalls.cpp b/src/coreclr/jit/importercalls.cpp index c3ba433be4d3f2..46a54d35457e9a 100644 --- a/src/coreclr/jit/importercalls.cpp +++ b/src/coreclr/jit/importercalls.cpp @@ -3045,15 +3045,15 @@ GenTree* Compiler::impIntrinsic(GenTree* newobjThis, #if defined(TARGET_XARCH) // We can't guarantee that all overloads for the xplat intrinsics can be // handled by the AltJit, so limit only the platform specific intrinsics - assert((NI_Vector512_Xor + 1) == NI_X86Base_BitScanForward); + assert((NI_Vector512_WithUpper + 1) == NI_X86Base_BitScanForward); - if (ni < NI_Vector512_Xor) + if (ni < NI_Vector512_WithUpper) #elif defined(TARGET_ARM64) // We can't guarantee that all overloads for the xplat intrinsics can be // handled by the AltJit, so limit only the platform specific intrinsics - assert((NI_Vector128_Xor + 1) == NI_AdvSimd_Abs); + assert((NI_Vector128_WithUpper + 1) == NI_AdvSimd_Abs); - if (ni < NI_Vector128_Xor) + if (ni < NI_Vector128_WithUpper) #else #error Unsupported platform #endif diff --git a/src/coreclr/jit/simdashwintrinsic.cpp b/src/coreclr/jit/simdashwintrinsic.cpp index cfe0c105e8ba33..09694f24f65a2b 100644 --- a/src/coreclr/jit/simdashwintrinsic.cpp +++ b/src/coreclr/jit/simdashwintrinsic.cpp @@ -512,8 +512,6 @@ GenTree* Compiler::impSimdAsHWIntrinsicSpecial(NamedIntrinsic intrinsic, #error Unsupported platform #endif // !TARGET_XARCH && !TARGET_ARM64 - bool isOpExplicit = false; - switch (intrinsic) { case NI_VectorT_ConvertToInt32Native: @@ -620,36 +618,7 @@ GenTree* Compiler::impSimdAsHWIntrinsicSpecial(NamedIntrinsic intrinsic, break; } - case NI_VectorT_As: - case NI_VectorT_AsVectorByte: - case NI_VectorT_AsVectorDouble: - case NI_VectorT_AsVectorInt16: - case NI_VectorT_AsVectorInt32: - case NI_VectorT_AsVectorInt64: - case NI_VectorT_AsVectorNInt: - case NI_VectorT_AsVectorNUInt: - case NI_VectorT_AsVectorSByte: - case NI_VectorT_AsVectorSingle: - case NI_VectorT_AsVectorUInt16: - case NI_VectorT_AsVectorUInt32: - case NI_VectorT_AsVectorUInt64: - { - unsigned retSimdSize; - CorInfoType retBaseJitType = getBaseJitTypeAndSizeOfSIMDType(sig->retTypeSigClass, &retSimdSize); - - if ((retBaseJitType == CORINFO_TYPE_UNDEF) || - !varTypeIsArithmetic(JitType2PreciseVarType(retBaseJitType)) || (retSimdSize == 0)) - { - // We get here if the return type is an unsupported type - return nullptr; - } - - isOpExplicit = true; - break; - } - #if defined(TARGET_XARCH) - case NI_VectorT_get_Item: case NI_VectorT_GetElement: { op2 = impStackTop(0).val; @@ -836,7 +805,6 @@ GenTree* Compiler::impSimdAsHWIntrinsicSpecial(NamedIntrinsic intrinsic, #endif // TARGET_XARCH #if defined(TARGET_XARCH) - case NI_VectorT_Multiply: case NI_VectorT_op_Multiply: { if (varTypeIsLong(simdBaseType)) @@ -857,7 +825,6 @@ GenTree* Compiler::impSimdAsHWIntrinsicSpecial(NamedIntrinsic intrinsic, #endif // TARGET_XARCH #if defined(TARGET_XARCH) - case NI_VectorT_ShiftRightArithmetic: case NI_VectorT_op_RightShift: { if (varTypeIsLong(simdBaseType) || (simdBaseType == TYP_DOUBLE)) @@ -901,58 +868,11 @@ GenTree* Compiler::impSimdAsHWIntrinsicSpecial(NamedIntrinsic intrinsic, return gtNewSimdGetIndicesNode(retType, simdBaseJitType, simdSize); } - case NI_Vector2_get_One: - case NI_Vector3_get_One: case NI_VectorT_get_One: { return gtNewOneConNode(retType, simdBaseType); } - case NI_Vector2_get_UnitX: - case NI_Vector3_get_UnitX: - { - GenTreeVecCon* vecCon = gtNewVconNode(retType); - - vecCon->gtSimdVal.f32[0] = 1.0f; - vecCon->gtSimdVal.f32[1] = 0.0f; - vecCon->gtSimdVal.f32[2] = 0.0f; - vecCon->gtSimdVal.f32[3] = 0.0f; - - return vecCon; - } - - case NI_Vector2_get_UnitY: - case NI_Vector3_get_UnitY: - { - GenTreeVecCon* vecCon = gtNewVconNode(retType); - - vecCon->gtSimdVal.f32[0] = 0.0f; - vecCon->gtSimdVal.f32[1] = 1.0f; - vecCon->gtSimdVal.f32[2] = 0.0f; - vecCon->gtSimdVal.f32[3] = 0.0f; - - return vecCon; - } - - case NI_Vector3_get_UnitZ: - { - GenTreeVecCon* vecCon = gtNewVconNode(retType); - - vecCon->gtSimdVal.f32[0] = 0.0f; - vecCon->gtSimdVal.f32[1] = 0.0f; - vecCon->gtSimdVal.f32[2] = 1.0f; - vecCon->gtSimdVal.f32[3] = 0.0f; - - return vecCon; - } - - case NI_Vector2_get_Zero: - case NI_Vector3_get_Zero: - case NI_VectorT_get_Zero: - { - return gtNewZeroConNode(retType); - } - default: { // Some platforms warn about unhandled switch cases @@ -967,20 +887,6 @@ GenTree* Compiler::impSimdAsHWIntrinsicSpecial(NamedIntrinsic intrinsic, { assert(newobjThis == nullptr); - isOpExplicit |= (intrinsic == NI_VectorT_op_Explicit); - - if (isOpExplicit) - { - // We fold away the cast here, as it only exists to satisfy the - // type system. It is safe to do this here since the op1 type - // and the signature return type are both the same TYP_SIMD. - op1 = impSIMDPopStack(); - SetOpLclRelatedToSIMDIntrinsic(op1); - assert(op1->gtType == getSIMDTypeForSize(getSIMDTypeSizeInBytes(sig->retTypeSigClass))); - - return op1; - } - argType = isInstanceMethod ? simdType : JITtype2varType(strip(info.compCompHnd->getArgType(sig, argList, &argClass))); op1 = getArgForHWIntrinsic(argType, argClass, isInstanceMethod); @@ -1004,31 +910,6 @@ GenTree* Compiler::impSimdAsHWIntrinsicSpecial(NamedIntrinsic intrinsic, return gtNewSimdFloorNode(retType, op1, simdBaseJitType, simdSize); } - case NI_Vector2_Length: - case NI_Vector3_Length: - { - GenTree* clonedOp1; - op1 = - impCloneExpr(op1, &clonedOp1, CHECK_SPILL_ALL, nullptr DEBUGARG("Clone op1 for vector length")); - - op1 = gtNewSimdDotProdNode(simdType, op1, clonedOp1, simdBaseJitType, simdSize); - op1 = gtNewSimdSqrtNode(simdType, op1, simdBaseJitType, simdSize); - - return gtNewSimdGetElementNode(retType, op1, gtNewIconNode(0), simdBaseJitType, simdSize); - } - - case NI_Vector2_LengthSquared: - case NI_Vector3_LengthSquared: - { - GenTree* clonedOp1; - op1 = impCloneExpr(op1, &clonedOp1, CHECK_SPILL_ALL, - nullptr DEBUGARG("Clone op1 for vector length squared")); - - op1 = gtNewSimdDotProdNode(simdType, op1, clonedOp1, simdBaseJitType, simdSize); - return gtNewSimdGetElementNode(retType, op1, gtNewIconNode(0), simdBaseJitType, simdSize); - } - - case NI_VectorT_Load: case NI_VectorT_LoadUnsafe: { if (op1->OperIs(GT_CAST) && op1->gtGetOp1()->TypeIs(TYP_BYREF)) @@ -1062,34 +943,13 @@ GenTree* Compiler::impSimdAsHWIntrinsicSpecial(NamedIntrinsic intrinsic, return gtNewSimdLoadNonTemporalNode(retType, op1, simdBaseJitType, simdSize); } - case NI_Vector2_Negate: case NI_Vector2_op_UnaryNegation: - case NI_Vector3_Negate: case NI_Vector3_op_UnaryNegation: - case NI_VectorT_Negate: case NI_VectorT_op_UnaryNegation: { return gtNewSimdUnOpNode(GT_NEG, retType, op1, simdBaseJitType, simdSize); } - case NI_Vector2_Normalize: - case NI_Vector3_Normalize: - { - GenTree* clonedOp1; - op1 = impCloneExpr(op1, &clonedOp1, CHECK_SPILL_ALL, - nullptr DEBUGARG("Clone op1 for vector normalize (1)")); - - GenTree* clonedOp2; - clonedOp1 = impCloneExpr(clonedOp1, &clonedOp2, CHECK_SPILL_ALL, - nullptr DEBUGARG("Clone op1 for vector normalize (2)")); - - op1 = gtNewSimdDotProdNode(retType, op1, clonedOp1, simdBaseJitType, simdSize); - op1 = gtNewSimdSqrtNode(retType, op1, simdBaseJitType, simdSize); - - return gtNewSimdBinOpNode(GT_DIV, retType, clonedOp2, op1, simdBaseJitType, simdSize); - } - - case NI_VectorT_OnesComplement: case NI_VectorT_op_OnesComplement: { return gtNewSimdUnOpNode(GT_NOT, retType, op1, simdBaseJitType, simdSize); @@ -1120,11 +980,6 @@ GenTree* Compiler::impSimdAsHWIntrinsicSpecial(NamedIntrinsic intrinsic, return gtNewSimdToScalarNode(retType, op1, simdBaseJitType, simdSize); } - case NI_VectorT_op_UnaryPlus: - { - return op1; - } - case NI_VectorT_WidenLower: { return gtNewSimdWidenLowerNode(retType, op1, simdBaseJitType, simdSize); @@ -1314,11 +1169,8 @@ GenTree* Compiler::impSimdAsHWIntrinsicSpecial(NamedIntrinsic intrinsic, switch (intrinsic) { - case NI_Vector2_Add: case NI_Vector2_op_Addition: - case NI_Vector3_Add: case NI_Vector3_op_Addition: - case NI_VectorT_Add: case NI_VectorT_op_Addition: { return gtNewSimdBinOpNode(GT_ADD, retType, op1, op2, simdBaseJitType, simdSize); @@ -1329,13 +1181,11 @@ GenTree* Compiler::impSimdAsHWIntrinsicSpecial(NamedIntrinsic intrinsic, return gtNewSimdBinOpNode(GT_AND_NOT, retType, op1, op2, simdBaseJitType, simdSize); } - case NI_VectorT_BitwiseAnd: case NI_VectorT_op_BitwiseAnd: { return gtNewSimdBinOpNode(GT_AND, retType, op1, op2, simdBaseJitType, simdSize); } - case NI_VectorT_BitwiseOr: case NI_VectorT_op_BitwiseOr: { return gtNewSimdBinOpNode(GT_OR, retType, op1, op2, simdBaseJitType, simdSize); @@ -1357,39 +1207,8 @@ GenTree* Compiler::impSimdAsHWIntrinsicSpecial(NamedIntrinsic intrinsic, return gtNewSimdCreateSequenceNode(simdType, op1, op2, simdBaseJitType, simdSize); } - case NI_Vector2_Distance: - case NI_Vector3_Distance: - { - op1 = gtNewSimdBinOpNode(GT_SUB, simdType, op1, op2, simdBaseJitType, simdSize); - - GenTree* clonedOp1; - op1 = impCloneExpr(op1, &clonedOp1, CHECK_SPILL_ALL, - nullptr DEBUGARG("Clone diff for vector distance")); - - op1 = gtNewSimdDotProdNode(simdType, op1, clonedOp1, simdBaseJitType, simdSize); - op1 = gtNewSimdSqrtNode(simdType, op1, simdBaseJitType, simdSize); - - return gtNewSimdGetElementNode(retType, op1, gtNewIconNode(0), simdBaseJitType, simdSize); - } - - case NI_Vector2_DistanceSquared: - case NI_Vector3_DistanceSquared: - { - op1 = gtNewSimdBinOpNode(GT_SUB, simdType, op1, op2, simdBaseJitType, simdSize); - - GenTree* clonedOp1; - op1 = impCloneExpr(op1, &clonedOp1, CHECK_SPILL_ALL, - nullptr DEBUGARG("Clone diff for vector distance squared")); - - op1 = gtNewSimdDotProdNode(simdType, op1, clonedOp1, simdBaseJitType, simdSize); - return gtNewSimdGetElementNode(retType, op1, gtNewIconNode(0), simdBaseJitType, simdSize); - } - - case NI_Vector2_Divide: case NI_Vector2_op_Division: - case NI_Vector3_Divide: case NI_Vector3_op_Division: - case NI_VectorT_Divide: case NI_VectorT_op_Division: { return gtNewSimdBinOpNode(GT_DIV, retType, op1, op2, simdBaseJitType, simdSize); @@ -1410,7 +1229,6 @@ GenTree* Compiler::impSimdAsHWIntrinsicSpecial(NamedIntrinsic intrinsic, case NI_Vector2_op_Equality: case NI_Vector3_op_Equality: - case NI_VectorT_EqualsAll: case NI_VectorT_op_Equality: { return gtNewSimdCmpOpAllNode(GT_EQ, retType, op1, op2, simdBaseJitType, simdSize); @@ -1421,17 +1239,13 @@ GenTree* Compiler::impSimdAsHWIntrinsicSpecial(NamedIntrinsic intrinsic, return gtNewSimdCmpOpAnyNode(GT_EQ, retType, op1, op2, simdBaseJitType, simdSize); } - case NI_VectorT_Xor: case NI_VectorT_op_ExclusiveOr: { return gtNewSimdBinOpNode(GT_XOR, retType, op1, op2, simdBaseJitType, simdSize); } - case NI_Vector2_get_Item: case NI_Vector2_GetElement: - case NI_Vector3_get_Item: case NI_Vector3_GetElement: - case NI_VectorT_get_Item: case NI_VectorT_GetElement: { return gtNewSimdGetElementNode(retType, op1, op2, simdBaseJitType, simdSize); @@ -1535,11 +1349,8 @@ GenTree* Compiler::impSimdAsHWIntrinsicSpecial(NamedIntrinsic intrinsic, return gtNewSimdMinNode(retType, op1, op2, simdBaseJitType, simdSize); } - case NI_Vector2_Multiply: case NI_Vector2_op_Multiply: - case NI_Vector3_Multiply: case NI_Vector3_op_Multiply: - case NI_VectorT_Multiply: case NI_VectorT_op_Multiply: { return gtNewSimdBinOpNode(GT_MUL, retType, op1, op2, simdBaseJitType, simdSize); @@ -1550,26 +1361,22 @@ GenTree* Compiler::impSimdAsHWIntrinsicSpecial(NamedIntrinsic intrinsic, return gtNewSimdNarrowNode(retType, op1, op2, simdBaseJitType, simdSize); } - case NI_VectorT_ShiftLeft: case NI_VectorT_op_LeftShift: { return gtNewSimdBinOpNode(GT_LSH, retType, op1, op2, simdBaseJitType, simdSize); } - case NI_VectorT_ShiftRightArithmetic: case NI_VectorT_op_RightShift: { genTreeOps op = varTypeIsUnsigned(simdBaseType) ? GT_RSZ : GT_RSH; return gtNewSimdBinOpNode(op, retType, op1, op2, simdBaseJitType, simdSize); } - case NI_VectorT_ShiftRightLogical: case NI_VectorT_op_UnsignedRightShift: { return gtNewSimdBinOpNode(GT_RSZ, retType, op1, op2, simdBaseJitType, simdSize); } - case NI_VectorT_Store: case NI_VectorT_StoreUnsafe: { assert(retType == TYP_VOID); @@ -1609,11 +1416,8 @@ GenTree* Compiler::impSimdAsHWIntrinsicSpecial(NamedIntrinsic intrinsic, return gtNewSimdStoreNonTemporalNode(op2, op1, simdBaseJitType, simdSize); } - case NI_Vector2_Subtract: case NI_Vector2_op_Subtraction: - case NI_Vector3_Subtract: case NI_Vector3_op_Subtraction: - case NI_VectorT_Subtract: case NI_VectorT_op_Subtraction: { return gtNewSimdBinOpNode(GT_SUB, retType, op1, op2, simdBaseJitType, simdSize); @@ -1670,13 +1474,6 @@ GenTree* Compiler::impSimdAsHWIntrinsicSpecial(NamedIntrinsic intrinsic, switch (intrinsic) { - case NI_Vector2_Clamp: - case NI_Vector3_Clamp: - { - GenTree* maxNode = gtNewSimdMaxNode(retType, op1, op2, simdBaseJitType, simdSize); - return gtNewSimdMinNode(retType, maxNode, op3, simdBaseJitType, simdSize); - } - case NI_VectorT_ConditionalSelect: { return gtNewSimdCndSelNode(retType, op1, op2, op3, simdBaseJitType, simdSize); diff --git a/src/coreclr/jit/simdashwintrinsiclistarm64.h b/src/coreclr/jit/simdashwintrinsiclistarm64.h index 4e6cda928a2782..6dce5bb9b16bae 100644 --- a/src/coreclr/jit/simdashwintrinsiclistarm64.h +++ b/src/coreclr/jit/simdashwintrinsiclistarm64.h @@ -38,28 +38,13 @@ // ************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************* // Vector2 Intrinsics SIMD_AS_HWINTRINSIC_ID(Vector2, Abs, 1, {NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Vector2_Abs, NI_Illegal}, SimdAsHWIntrinsicFlag::None) -SIMD_AS_HWINTRINSIC_ID(Vector2, Add, 2, {NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Vector2_Add, NI_Illegal}, SimdAsHWIntrinsicFlag::None) -SIMD_AS_HWINTRINSIC_ID(Vector2, Clamp, 3, {NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Vector2_Clamp, NI_Illegal}, SimdAsHWIntrinsicFlag::None) SIMD_AS_HWINTRINSIC_NM(Vector2, Create, ".ctor", 3, {NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Vector2_Create, NI_Illegal}, SimdAsHWIntrinsicFlag::InstanceMethod | SimdAsHWIntrinsicFlag::SpillSideEffectsOp1) SIMD_AS_HWINTRINSIC_NM(Vector2, CreateBroadcast, ".ctor", 2, {NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Vector2_CreateBroadcast, NI_Illegal}, SimdAsHWIntrinsicFlag::InstanceMethod | SimdAsHWIntrinsicFlag::SpillSideEffectsOp1) -SIMD_AS_HWINTRINSIC_ID(Vector2, Distance, 2, {NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Vector2_Distance, NI_Illegal}, SimdAsHWIntrinsicFlag::None) -SIMD_AS_HWINTRINSIC_ID(Vector2, DistanceSquared, 2, {NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Vector2_DistanceSquared, NI_Illegal}, SimdAsHWIntrinsicFlag::None) -SIMD_AS_HWINTRINSIC_ID(Vector2, Divide, 2, {NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Vector2_Divide, NI_Illegal}, SimdAsHWIntrinsicFlag::None) SIMD_AS_HWINTRINSIC_ID(Vector2, Dot, 2, {NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Vector2_Dot, NI_Illegal}, SimdAsHWIntrinsicFlag::None) -SIMD_AS_HWINTRINSIC_ID(Vector2, get_Item, 0, {NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Vector2_get_Item, NI_Illegal}, SimdAsHWIntrinsicFlag::InstanceMethod | SimdAsHWIntrinsicFlag::BaseTypeFromThisArg) -SIMD_AS_HWINTRINSIC_ID(Vector2, get_One, 0, {NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Vector2_get_One, NI_Illegal}, SimdAsHWIntrinsicFlag::None) -SIMD_AS_HWINTRINSIC_ID(Vector2, get_UnitX, 0, {NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Vector2_get_UnitX, NI_Illegal}, SimdAsHWIntrinsicFlag::None) -SIMD_AS_HWINTRINSIC_ID(Vector2, get_UnitY, 0, {NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Vector2_get_UnitY, NI_Illegal}, SimdAsHWIntrinsicFlag::None) -SIMD_AS_HWINTRINSIC_ID(Vector2, get_Zero, 0, {NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Vector2_get_Zero, NI_Illegal}, SimdAsHWIntrinsicFlag::None) SIMD_AS_HWINTRINSIC_ID(Vector2, GetElement, 2, {NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Vector2_GetElement, NI_Illegal}, SimdAsHWIntrinsicFlag::None) -SIMD_AS_HWINTRINSIC_ID(Vector2, Length, 1, {NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Vector2_Length, NI_Illegal}, SimdAsHWIntrinsicFlag::InstanceMethod) -SIMD_AS_HWINTRINSIC_ID(Vector2, LengthSquared, 1, {NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Vector2_LengthSquared, NI_Illegal}, SimdAsHWIntrinsicFlag::InstanceMethod) SIMD_AS_HWINTRINSIC_ID(Vector2, Lerp, 3, {NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Vector2_Lerp, NI_Illegal}, SimdAsHWIntrinsicFlag::SpillSideEffectsOp1 | SimdAsHWIntrinsicFlag::SpillSideEffectsOp2) SIMD_AS_HWINTRINSIC_ID(Vector2, Max, 2, {NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Vector2_Max, NI_Illegal}, SimdAsHWIntrinsicFlag::None) SIMD_AS_HWINTRINSIC_ID(Vector2, Min, 2, {NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Vector2_Min, NI_Illegal}, SimdAsHWIntrinsicFlag::None) -SIMD_AS_HWINTRINSIC_ID(Vector2, Multiply, 2, {NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Vector2_Multiply, NI_Illegal}, SimdAsHWIntrinsicFlag::None) -SIMD_AS_HWINTRINSIC_ID(Vector2, Negate, 1, {NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Vector2_Negate, NI_Illegal}, SimdAsHWIntrinsicFlag::None) -SIMD_AS_HWINTRINSIC_ID(Vector2, Normalize, 1, {NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Vector2_Normalize, NI_Illegal}, SimdAsHWIntrinsicFlag::None) SIMD_AS_HWINTRINSIC_ID(Vector2, op_Addition, 2, {NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Vector2_op_Addition, NI_Illegal}, SimdAsHWIntrinsicFlag::None) SIMD_AS_HWINTRINSIC_ID(Vector2, op_Division, 2, {NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Vector2_op_Division, NI_Illegal}, SimdAsHWIntrinsicFlag::None) SIMD_AS_HWINTRINSIC_ID(Vector2, op_Equality, 2, {NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Vector2_op_Equality, NI_Illegal}, SimdAsHWIntrinsicFlag::None) @@ -68,7 +53,6 @@ SIMD_AS_HWINTRINSIC_ID(Vector2, op_Multiply, SIMD_AS_HWINTRINSIC_ID(Vector2, op_Subtraction, 2, {NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Vector2_op_Subtraction, NI_Illegal}, SimdAsHWIntrinsicFlag::None) SIMD_AS_HWINTRINSIC_ID(Vector2, op_UnaryNegation, 1, {NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Vector2_op_UnaryNegation, NI_Illegal}, SimdAsHWIntrinsicFlag::None) SIMD_AS_HWINTRINSIC_NM(Vector2, Sqrt, "SquareRoot", 1, {NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Vector2_Sqrt, NI_Illegal}, SimdAsHWIntrinsicFlag::None) -SIMD_AS_HWINTRINSIC_ID(Vector2, Subtract, 2, {NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Vector2_Subtract, NI_Illegal}, SimdAsHWIntrinsicFlag::None) SIMD_AS_HWINTRINSIC_ID(Vector2, WithElement, 3, {NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Vector2_WithElement, NI_Illegal}, SimdAsHWIntrinsicFlag::None) // ************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************* @@ -77,30 +61,14 @@ SIMD_AS_HWINTRINSIC_ID(Vector2, WithElement, // ************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************* // Vector3 Intrinsics SIMD_AS_HWINTRINSIC_ID(Vector3, Abs, 1, {NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Vector3_Abs, NI_Illegal}, SimdAsHWIntrinsicFlag::None) -SIMD_AS_HWINTRINSIC_ID(Vector3, Add, 2, {NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Vector3_Add, NI_Illegal}, SimdAsHWIntrinsicFlag::None) -SIMD_AS_HWINTRINSIC_ID(Vector3, Clamp, 3, {NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Vector3_Clamp, NI_Illegal}, SimdAsHWIntrinsicFlag::None) SIMD_AS_HWINTRINSIC_NM(Vector3, Create, ".ctor", 4, {NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Vector3_Create, NI_Illegal}, SimdAsHWIntrinsicFlag::InstanceMethod | SimdAsHWIntrinsicFlag::SpillSideEffectsOp1) SIMD_AS_HWINTRINSIC_NM(Vector3, CreateBroadcast, ".ctor", 2, {NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Vector3_CreateBroadcast, NI_Illegal}, SimdAsHWIntrinsicFlag::InstanceMethod | SimdAsHWIntrinsicFlag::SpillSideEffectsOp1) SIMD_AS_HWINTRINSIC_NM(Vector3, CreateFromVector2, ".ctor", 3, {NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Vector3_CreateFromVector2, NI_Illegal}, SimdAsHWIntrinsicFlag::InstanceMethod | SimdAsHWIntrinsicFlag::SpillSideEffectsOp1 | SimdAsHWIntrinsicFlag::BaseTypeFromThisArg) -SIMD_AS_HWINTRINSIC_ID(Vector3, Distance, 2, {NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Vector3_Distance, NI_Illegal}, SimdAsHWIntrinsicFlag::None) -SIMD_AS_HWINTRINSIC_ID(Vector3, DistanceSquared, 2, {NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Vector3_DistanceSquared, NI_Illegal}, SimdAsHWIntrinsicFlag::None) -SIMD_AS_HWINTRINSIC_ID(Vector3, Divide, 2, {NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Vector3_Divide, NI_Illegal}, SimdAsHWIntrinsicFlag::None) SIMD_AS_HWINTRINSIC_ID(Vector3, Dot, 2, {NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Vector3_Dot, NI_Illegal}, SimdAsHWIntrinsicFlag::None) -SIMD_AS_HWINTRINSIC_ID(Vector3, get_Item, 0, {NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Vector3_get_Item, NI_Illegal}, SimdAsHWIntrinsicFlag::InstanceMethod | SimdAsHWIntrinsicFlag::BaseTypeFromThisArg) -SIMD_AS_HWINTRINSIC_ID(Vector3, get_One, 0, {NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Vector3_get_One, NI_Illegal}, SimdAsHWIntrinsicFlag::None) -SIMD_AS_HWINTRINSIC_ID(Vector3, get_UnitX, 0, {NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Vector3_get_UnitX, NI_Illegal}, SimdAsHWIntrinsicFlag::None) -SIMD_AS_HWINTRINSIC_ID(Vector3, get_UnitY, 0, {NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Vector3_get_UnitY, NI_Illegal}, SimdAsHWIntrinsicFlag::None) -SIMD_AS_HWINTRINSIC_ID(Vector3, get_UnitZ, 0, {NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Vector3_get_UnitZ, NI_Illegal}, SimdAsHWIntrinsicFlag::None) -SIMD_AS_HWINTRINSIC_ID(Vector3, get_Zero, 0, {NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Vector3_get_Zero, NI_Illegal}, SimdAsHWIntrinsicFlag::None) SIMD_AS_HWINTRINSIC_ID(Vector3, GetElement, 2, {NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Vector3_GetElement, NI_Illegal}, SimdAsHWIntrinsicFlag::None) -SIMD_AS_HWINTRINSIC_ID(Vector3, Length, 1, {NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Vector3_Length, NI_Illegal}, SimdAsHWIntrinsicFlag::InstanceMethod) -SIMD_AS_HWINTRINSIC_ID(Vector3, LengthSquared, 1, {NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Vector3_LengthSquared, NI_Illegal}, SimdAsHWIntrinsicFlag::InstanceMethod) SIMD_AS_HWINTRINSIC_ID(Vector3, Lerp, 3, {NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Vector3_Lerp, NI_Illegal}, SimdAsHWIntrinsicFlag::SpillSideEffectsOp1 | SimdAsHWIntrinsicFlag::SpillSideEffectsOp2) SIMD_AS_HWINTRINSIC_ID(Vector3, Max, 2, {NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Vector3_Max, NI_Illegal}, SimdAsHWIntrinsicFlag::None) SIMD_AS_HWINTRINSIC_ID(Vector3, Min, 2, {NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Vector3_Min, NI_Illegal}, SimdAsHWIntrinsicFlag::None) -SIMD_AS_HWINTRINSIC_ID(Vector3, Multiply, 2, {NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Vector3_Multiply, NI_Illegal}, SimdAsHWIntrinsicFlag::None) -SIMD_AS_HWINTRINSIC_ID(Vector3, Negate, 1, {NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Vector3_Negate, NI_Illegal}, SimdAsHWIntrinsicFlag::None) -SIMD_AS_HWINTRINSIC_ID(Vector3, Normalize, 1, {NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Vector3_Normalize, NI_Illegal}, SimdAsHWIntrinsicFlag::None) SIMD_AS_HWINTRINSIC_ID(Vector3, op_Addition, 2, {NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Vector3_op_Addition, NI_Illegal}, SimdAsHWIntrinsicFlag::None) SIMD_AS_HWINTRINSIC_ID(Vector3, op_Division, 2, {NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Vector3_op_Division, NI_Illegal}, SimdAsHWIntrinsicFlag::None) SIMD_AS_HWINTRINSIC_ID(Vector3, op_Equality, 2, {NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Vector3_op_Equality, NI_Illegal}, SimdAsHWIntrinsicFlag::None) @@ -109,7 +77,6 @@ SIMD_AS_HWINTRINSIC_ID(Vector3, op_Multiply, SIMD_AS_HWINTRINSIC_ID(Vector3, op_Subtraction, 2, {NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Vector3_op_Subtraction, NI_Illegal}, SimdAsHWIntrinsicFlag::None) SIMD_AS_HWINTRINSIC_ID(Vector3, op_UnaryNegation, 1, {NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Vector3_op_UnaryNegation, NI_Illegal}, SimdAsHWIntrinsicFlag::None) SIMD_AS_HWINTRINSIC_NM(Vector3, Sqrt, "SquareRoot", 1, {NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Vector3_Sqrt, NI_Illegal}, SimdAsHWIntrinsicFlag::None) -SIMD_AS_HWINTRINSIC_ID(Vector3, Subtract, 2, {NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Vector3_Subtract, NI_Illegal}, SimdAsHWIntrinsicFlag::None) SIMD_AS_HWINTRINSIC_ID(Vector3, WithElement, 3, {NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Vector3_WithElement, NI_Illegal}, SimdAsHWIntrinsicFlag::None) // ************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************* @@ -118,23 +85,7 @@ SIMD_AS_HWINTRINSIC_ID(Vector3, WithElement, // ************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************* // Vector Intrinsics SIMD_AS_HWINTRINSIC_ID(VectorT, Abs, 1, {NI_VectorT_Abs, NI_VectorT_Abs, NI_VectorT_Abs, NI_VectorT_Abs, NI_VectorT_Abs, NI_VectorT_Abs, NI_VectorT_Abs, NI_VectorT_Abs, NI_VectorT_Abs, NI_VectorT_Abs}, SimdAsHWIntrinsicFlag::None) -SIMD_AS_HWINTRINSIC_ID(VectorT, Add, 2, {NI_VectorT_Add, NI_VectorT_Add, NI_VectorT_Add, NI_VectorT_Add, NI_VectorT_Add, NI_VectorT_Add, NI_VectorT_Add, NI_VectorT_Add, NI_VectorT_Add, NI_VectorT_Add}, SimdAsHWIntrinsicFlag::None) SIMD_AS_HWINTRINSIC_ID(VectorT, AndNot, 2, {NI_VectorT_AndNot, NI_VectorT_AndNot, NI_VectorT_AndNot, NI_VectorT_AndNot, NI_VectorT_AndNot, NI_VectorT_AndNot, NI_VectorT_AndNot, NI_VectorT_AndNot, NI_VectorT_AndNot, NI_VectorT_AndNot}, SimdAsHWIntrinsicFlag::None) -SIMD_AS_HWINTRINSIC_ID(VectorT, As, 1, {NI_VectorT_As, NI_VectorT_As, NI_VectorT_As, NI_VectorT_As, NI_VectorT_As, NI_VectorT_As, NI_VectorT_As, NI_VectorT_As, NI_VectorT_As, NI_VectorT_As}, SimdAsHWIntrinsicFlag::None) -SIMD_AS_HWINTRINSIC_ID(VectorT, AsVectorByte, 1, {NI_VectorT_AsVectorByte, NI_VectorT_AsVectorByte, NI_VectorT_AsVectorByte, NI_VectorT_AsVectorByte, NI_VectorT_AsVectorByte, NI_VectorT_AsVectorByte, NI_VectorT_AsVectorByte, NI_VectorT_AsVectorByte, NI_VectorT_AsVectorByte, NI_VectorT_AsVectorByte}, SimdAsHWIntrinsicFlag::None) -SIMD_AS_HWINTRINSIC_ID(VectorT, AsVectorDouble, 1, {NI_VectorT_AsVectorDouble, NI_VectorT_AsVectorDouble, NI_VectorT_AsVectorDouble, NI_VectorT_AsVectorDouble, NI_VectorT_AsVectorDouble, NI_VectorT_AsVectorDouble, NI_VectorT_AsVectorDouble, NI_VectorT_AsVectorDouble, NI_VectorT_AsVectorDouble, NI_VectorT_AsVectorDouble}, SimdAsHWIntrinsicFlag::None) -SIMD_AS_HWINTRINSIC_ID(VectorT, AsVectorInt16, 1, {NI_VectorT_AsVectorInt16, NI_VectorT_AsVectorInt16, NI_VectorT_AsVectorInt16, NI_VectorT_AsVectorInt16, NI_VectorT_AsVectorInt16, NI_VectorT_AsVectorInt16, NI_VectorT_AsVectorInt16, NI_VectorT_AsVectorInt16, NI_VectorT_AsVectorInt16, NI_VectorT_AsVectorInt16}, SimdAsHWIntrinsicFlag::None) -SIMD_AS_HWINTRINSIC_ID(VectorT, AsVectorInt32, 1, {NI_VectorT_AsVectorInt32, NI_VectorT_AsVectorInt32, NI_VectorT_AsVectorInt32, NI_VectorT_AsVectorInt32, NI_VectorT_AsVectorInt32, NI_VectorT_AsVectorInt32, NI_VectorT_AsVectorInt32, NI_VectorT_AsVectorInt32, NI_VectorT_AsVectorInt32, NI_VectorT_AsVectorInt32}, SimdAsHWIntrinsicFlag::None) -SIMD_AS_HWINTRINSIC_ID(VectorT, AsVectorInt64, 1, {NI_VectorT_AsVectorInt64, NI_VectorT_AsVectorInt64, NI_VectorT_AsVectorInt64, NI_VectorT_AsVectorInt64, NI_VectorT_AsVectorInt64, NI_VectorT_AsVectorInt64, NI_VectorT_AsVectorInt64, NI_VectorT_AsVectorInt64, NI_VectorT_AsVectorInt64, NI_VectorT_AsVectorInt64}, SimdAsHWIntrinsicFlag::None) -SIMD_AS_HWINTRINSIC_ID(VectorT, AsVectorNInt, 1, {NI_VectorT_AsVectorNInt, NI_VectorT_AsVectorNInt, NI_VectorT_AsVectorNInt, NI_VectorT_AsVectorNInt, NI_VectorT_AsVectorNInt, NI_VectorT_AsVectorNInt, NI_VectorT_AsVectorNInt, NI_VectorT_AsVectorNInt, NI_VectorT_AsVectorNInt, NI_VectorT_AsVectorNInt}, SimdAsHWIntrinsicFlag::None) -SIMD_AS_HWINTRINSIC_ID(VectorT, AsVectorNUInt, 1, {NI_VectorT_AsVectorNUInt, NI_VectorT_AsVectorNUInt, NI_VectorT_AsVectorNUInt, NI_VectorT_AsVectorNUInt, NI_VectorT_AsVectorNUInt, NI_VectorT_AsVectorNUInt, NI_VectorT_AsVectorNUInt, NI_VectorT_AsVectorNUInt, NI_VectorT_AsVectorNUInt, NI_VectorT_AsVectorNUInt}, SimdAsHWIntrinsicFlag::None) -SIMD_AS_HWINTRINSIC_ID(VectorT, AsVectorSByte, 1, {NI_VectorT_AsVectorSByte, NI_VectorT_AsVectorSByte, NI_VectorT_AsVectorSByte, NI_VectorT_AsVectorSByte, NI_VectorT_AsVectorSByte, NI_VectorT_AsVectorSByte, NI_VectorT_AsVectorSByte, NI_VectorT_AsVectorSByte, NI_VectorT_AsVectorSByte, NI_VectorT_AsVectorSByte}, SimdAsHWIntrinsicFlag::None) -SIMD_AS_HWINTRINSIC_ID(VectorT, AsVectorSingle, 1, {NI_VectorT_AsVectorSingle, NI_VectorT_AsVectorSingle, NI_VectorT_AsVectorSingle, NI_VectorT_AsVectorSingle, NI_VectorT_AsVectorSingle, NI_VectorT_AsVectorSingle, NI_VectorT_AsVectorSingle, NI_VectorT_AsVectorSingle, NI_VectorT_AsVectorSingle, NI_VectorT_AsVectorSingle}, SimdAsHWIntrinsicFlag::None) -SIMD_AS_HWINTRINSIC_ID(VectorT, AsVectorUInt16, 1, {NI_VectorT_AsVectorUInt16, NI_VectorT_AsVectorUInt16, NI_VectorT_AsVectorUInt16, NI_VectorT_AsVectorUInt16, NI_VectorT_AsVectorUInt16, NI_VectorT_AsVectorUInt16, NI_VectorT_AsVectorUInt16, NI_VectorT_AsVectorUInt16, NI_VectorT_AsVectorUInt16, NI_VectorT_AsVectorUInt16}, SimdAsHWIntrinsicFlag::None) -SIMD_AS_HWINTRINSIC_ID(VectorT, AsVectorUInt32, 1, {NI_VectorT_AsVectorUInt32, NI_VectorT_AsVectorUInt32, NI_VectorT_AsVectorUInt32, NI_VectorT_AsVectorUInt32, NI_VectorT_AsVectorUInt32, NI_VectorT_AsVectorUInt32, NI_VectorT_AsVectorUInt32, NI_VectorT_AsVectorUInt32, NI_VectorT_AsVectorUInt32, NI_VectorT_AsVectorUInt32}, SimdAsHWIntrinsicFlag::None) -SIMD_AS_HWINTRINSIC_ID(VectorT, AsVectorUInt64, 1, {NI_VectorT_AsVectorUInt64, NI_VectorT_AsVectorUInt64, NI_VectorT_AsVectorUInt64, NI_VectorT_AsVectorUInt64, NI_VectorT_AsVectorUInt64, NI_VectorT_AsVectorUInt64, NI_VectorT_AsVectorUInt64, NI_VectorT_AsVectorUInt64, NI_VectorT_AsVectorUInt64, NI_VectorT_AsVectorUInt64}, SimdAsHWIntrinsicFlag::None) -SIMD_AS_HWINTRINSIC_ID(VectorT, BitwiseAnd, 2, {NI_VectorT_BitwiseAnd, NI_VectorT_BitwiseAnd, NI_VectorT_BitwiseAnd, NI_VectorT_BitwiseAnd, NI_VectorT_BitwiseAnd, NI_VectorT_BitwiseAnd, NI_VectorT_BitwiseAnd, NI_VectorT_BitwiseAnd, NI_VectorT_BitwiseAnd, NI_VectorT_BitwiseAnd}, SimdAsHWIntrinsicFlag::None) -SIMD_AS_HWINTRINSIC_ID(VectorT, BitwiseOr, 2, {NI_VectorT_BitwiseOr, NI_VectorT_BitwiseOr, NI_VectorT_BitwiseOr, NI_VectorT_BitwiseOr, NI_VectorT_BitwiseOr, NI_VectorT_BitwiseOr, NI_VectorT_BitwiseOr, NI_VectorT_BitwiseOr, NI_VectorT_BitwiseOr, NI_VectorT_BitwiseOr}, SimdAsHWIntrinsicFlag::None) SIMD_AS_HWINTRINSIC_ID(VectorT, Ceiling, 1, {NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_VectorT_Ceiling, NI_VectorT_Ceiling}, SimdAsHWIntrinsicFlag::None) SIMD_AS_HWINTRINSIC_ID(VectorT, ConditionalSelect, 3, {NI_VectorT_ConditionalSelect, NI_VectorT_ConditionalSelect, NI_VectorT_ConditionalSelect, NI_VectorT_ConditionalSelect, NI_VectorT_ConditionalSelect, NI_VectorT_ConditionalSelect, NI_VectorT_ConditionalSelect, NI_VectorT_ConditionalSelect, NI_VectorT_ConditionalSelect, NI_VectorT_ConditionalSelect}, SimdAsHWIntrinsicFlag::None) SIMD_AS_HWINTRINSIC_ID(VectorT, ConvertToDouble, 1, {NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_VectorT_ConvertToDouble, NI_VectorT_ConvertToDouble, NI_Illegal, NI_Illegal}, SimdAsHWIntrinsicFlag::None) @@ -149,17 +100,13 @@ SIMD_AS_HWINTRINSIC_ID(VectorT, ConvertToUInt64, SIMD_AS_HWINTRINSIC_ID(VectorT, ConvertToUInt64Native, 1, {NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_VectorT_ConvertToUInt64Native}, SimdAsHWIntrinsicFlag::None) SIMD_AS_HWINTRINSIC_NM(VectorT, CreateBroadcast, ".ctor", 2, {NI_VectorT_CreateBroadcast, NI_VectorT_CreateBroadcast, NI_VectorT_CreateBroadcast, NI_VectorT_CreateBroadcast, NI_VectorT_CreateBroadcast, NI_VectorT_CreateBroadcast, NI_VectorT_CreateBroadcast, NI_VectorT_CreateBroadcast, NI_VectorT_CreateBroadcast, NI_VectorT_CreateBroadcast}, SimdAsHWIntrinsicFlag::InstanceMethod | SimdAsHWIntrinsicFlag::SpillSideEffectsOp1) SIMD_AS_HWINTRINSIC_ID(VectorT, CreateSequence, 2, {NI_VectorT_CreateSequence, NI_VectorT_CreateSequence, NI_VectorT_CreateSequence, NI_VectorT_CreateSequence, NI_VectorT_CreateSequence, NI_VectorT_CreateSequence, NI_VectorT_CreateSequence, NI_VectorT_CreateSequence, NI_VectorT_CreateSequence, NI_VectorT_CreateSequence}, SimdAsHWIntrinsicFlag::SpillSideEffectsOp1) -SIMD_AS_HWINTRINSIC_ID(VectorT, Divide, 2, {NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_VectorT_Divide, NI_VectorT_Divide}, SimdAsHWIntrinsicFlag::None) SIMD_AS_HWINTRINSIC_ID(VectorT, Dot, 2, {NI_VectorT_Dot, NI_VectorT_Dot, NI_VectorT_Dot, NI_VectorT_Dot, NI_VectorT_Dot, NI_VectorT_Dot, NI_Illegal, NI_Illegal, NI_VectorT_Dot, NI_VectorT_Dot}, SimdAsHWIntrinsicFlag::None) SIMD_AS_HWINTRINSIC_ID(VectorT, Equals, 2, {NI_VectorT_Equals, NI_VectorT_Equals, NI_VectorT_Equals, NI_VectorT_Equals, NI_VectorT_Equals, NI_VectorT_Equals, NI_VectorT_Equals, NI_VectorT_Equals, NI_VectorT_Equals, NI_VectorT_Equals}, SimdAsHWIntrinsicFlag::None) -SIMD_AS_HWINTRINSIC_ID(VectorT, EqualsAll, 2, {NI_VectorT_EqualsAll, NI_VectorT_EqualsAll, NI_VectorT_EqualsAll, NI_VectorT_EqualsAll, NI_VectorT_EqualsAll, NI_VectorT_EqualsAll, NI_VectorT_EqualsAll, NI_VectorT_EqualsAll, NI_VectorT_EqualsAll, NI_VectorT_EqualsAll}, SimdAsHWIntrinsicFlag::None) SIMD_AS_HWINTRINSIC_ID(VectorT, EqualsAny, 2, {NI_VectorT_EqualsAny, NI_VectorT_EqualsAny, NI_VectorT_EqualsAny, NI_VectorT_EqualsAny, NI_VectorT_EqualsAny, NI_VectorT_EqualsAny, NI_VectorT_EqualsAny, NI_VectorT_EqualsAny, NI_VectorT_EqualsAny, NI_VectorT_EqualsAny}, SimdAsHWIntrinsicFlag::None) SIMD_AS_HWINTRINSIC_ID(VectorT, Floor, 1, {NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_VectorT_Floor, NI_VectorT_Floor}, SimdAsHWIntrinsicFlag::None) SIMD_AS_HWINTRINSIC_ID(VectorT, get_AllBitsSet, 0, {NI_VectorT_get_AllBitsSet, NI_VectorT_get_AllBitsSet, NI_VectorT_get_AllBitsSet, NI_VectorT_get_AllBitsSet, NI_VectorT_get_AllBitsSet, NI_VectorT_get_AllBitsSet, NI_VectorT_get_AllBitsSet, NI_VectorT_get_AllBitsSet, NI_VectorT_get_AllBitsSet, NI_VectorT_get_AllBitsSet}, SimdAsHWIntrinsicFlag::None) SIMD_AS_HWINTRINSIC_ID(VectorT, get_Indices, 0, {NI_VectorT_get_Indices, NI_VectorT_get_Indices, NI_VectorT_get_Indices, NI_VectorT_get_Indices, NI_VectorT_get_Indices, NI_VectorT_get_Indices, NI_VectorT_get_Indices, NI_VectorT_get_Indices, NI_VectorT_get_Indices, NI_VectorT_get_Indices}, SimdAsHWIntrinsicFlag::None) -SIMD_AS_HWINTRINSIC_ID(VectorT, get_Item, 2, {NI_VectorT_get_Item, NI_VectorT_get_Item, NI_VectorT_get_Item, NI_VectorT_get_Item, NI_VectorT_get_Item, NI_VectorT_get_Item, NI_VectorT_get_Item, NI_VectorT_get_Item, NI_VectorT_get_Item, NI_VectorT_get_Item}, SimdAsHWIntrinsicFlag::InstanceMethod | SimdAsHWIntrinsicFlag::BaseTypeFromThisArg) SIMD_AS_HWINTRINSIC_ID(VectorT, get_One, 0, {NI_VectorT_get_One, NI_VectorT_get_One, NI_VectorT_get_One, NI_VectorT_get_One, NI_VectorT_get_One, NI_VectorT_get_One, NI_VectorT_get_One, NI_VectorT_get_One, NI_VectorT_get_One, NI_VectorT_get_One}, SimdAsHWIntrinsicFlag::None) -SIMD_AS_HWINTRINSIC_ID(VectorT, get_Zero, 0, {NI_VectorT_get_Zero, NI_VectorT_get_Zero, NI_VectorT_get_Zero, NI_VectorT_get_Zero, NI_VectorT_get_Zero, NI_VectorT_get_Zero, NI_VectorT_get_Zero, NI_VectorT_get_Zero, NI_VectorT_get_Zero, NI_VectorT_get_Zero}, SimdAsHWIntrinsicFlag::None) SIMD_AS_HWINTRINSIC_ID(VectorT, GetElement, 2, {NI_VectorT_GetElement, NI_VectorT_GetElement, NI_VectorT_GetElement, NI_VectorT_GetElement, NI_VectorT_GetElement, NI_VectorT_GetElement, NI_VectorT_GetElement, NI_VectorT_GetElement, NI_VectorT_GetElement, NI_VectorT_GetElement}, SimdAsHWIntrinsicFlag::None) SIMD_AS_HWINTRINSIC_ID(VectorT, GreaterThan, 2, {NI_VectorT_GreaterThan, NI_VectorT_GreaterThan, NI_VectorT_GreaterThan, NI_VectorT_GreaterThan, NI_VectorT_GreaterThan, NI_VectorT_GreaterThan, NI_VectorT_GreaterThan, NI_VectorT_GreaterThan, NI_VectorT_GreaterThan, NI_VectorT_GreaterThan}, SimdAsHWIntrinsicFlag::None) SIMD_AS_HWINTRINSIC_ID(VectorT, GreaterThanAll, 2, {NI_VectorT_GreaterThanAll, NI_VectorT_GreaterThanAll, NI_VectorT_GreaterThanAll, NI_VectorT_GreaterThanAll, NI_VectorT_GreaterThanAll, NI_VectorT_GreaterThanAll, NI_VectorT_GreaterThanAll, NI_VectorT_GreaterThanAll, NI_VectorT_GreaterThanAll, NI_VectorT_GreaterThanAll}, SimdAsHWIntrinsicFlag::None) @@ -173,24 +120,19 @@ SIMD_AS_HWINTRINSIC_ID(VectorT, LessThanAny, SIMD_AS_HWINTRINSIC_ID(VectorT, LessThanOrEqual, 2, {NI_VectorT_LessThanOrEqual, NI_VectorT_LessThanOrEqual, NI_VectorT_LessThanOrEqual, NI_VectorT_LessThanOrEqual, NI_VectorT_LessThanOrEqual, NI_VectorT_LessThanOrEqual, NI_VectorT_LessThanOrEqual, NI_VectorT_LessThanOrEqual, NI_VectorT_LessThanOrEqual, NI_VectorT_LessThanOrEqual}, SimdAsHWIntrinsicFlag::None) SIMD_AS_HWINTRINSIC_ID(VectorT, LessThanOrEqualAll, 2, {NI_VectorT_LessThanOrEqualAll, NI_VectorT_LessThanOrEqualAll, NI_VectorT_LessThanOrEqualAll, NI_VectorT_LessThanOrEqualAll, NI_VectorT_LessThanOrEqualAll, NI_VectorT_LessThanOrEqualAll, NI_VectorT_LessThanOrEqualAll, NI_VectorT_LessThanOrEqualAll, NI_VectorT_LessThanOrEqualAll, NI_VectorT_LessThanOrEqualAll}, SimdAsHWIntrinsicFlag::None) SIMD_AS_HWINTRINSIC_ID(VectorT, LessThanOrEqualAny, 2, {NI_VectorT_LessThanOrEqualAny, NI_VectorT_LessThanOrEqualAny, NI_VectorT_LessThanOrEqualAny, NI_VectorT_LessThanOrEqualAny, NI_VectorT_LessThanOrEqualAny, NI_VectorT_LessThanOrEqualAny, NI_VectorT_LessThanOrEqualAny, NI_VectorT_LessThanOrEqualAny, NI_VectorT_LessThanOrEqualAny, NI_VectorT_LessThanOrEqualAny}, SimdAsHWIntrinsicFlag::None) -SIMD_AS_HWINTRINSIC_ID(VectorT, Load, 1, {NI_VectorT_Load, NI_VectorT_Load, NI_VectorT_Load, NI_VectorT_Load, NI_VectorT_Load, NI_VectorT_Load, NI_VectorT_Load, NI_VectorT_Load, NI_VectorT_Load, NI_VectorT_Load}, SimdAsHWIntrinsicFlag::KeepBaseTypeFromRet) SIMD_AS_HWINTRINSIC_ID(VectorT, LoadAligned, 1, {NI_VectorT_LoadAligned, NI_VectorT_LoadAligned, NI_VectorT_LoadAligned, NI_VectorT_LoadAligned, NI_VectorT_LoadAligned, NI_VectorT_LoadAligned, NI_VectorT_LoadAligned, NI_VectorT_LoadAligned, NI_VectorT_LoadAligned, NI_VectorT_LoadAligned}, SimdAsHWIntrinsicFlag::KeepBaseTypeFromRet) SIMD_AS_HWINTRINSIC_ID(VectorT, LoadAlignedNonTemporal, 1, {NI_VectorT_LoadAlignedNonTemporal, NI_VectorT_LoadAlignedNonTemporal, NI_VectorT_LoadAlignedNonTemporal, NI_VectorT_LoadAlignedNonTemporal, NI_VectorT_LoadAlignedNonTemporal, NI_VectorT_LoadAlignedNonTemporal, NI_VectorT_LoadAlignedNonTemporal, NI_VectorT_LoadAlignedNonTemporal, NI_VectorT_LoadAlignedNonTemporal, NI_VectorT_LoadAlignedNonTemporal}, SimdAsHWIntrinsicFlag::KeepBaseTypeFromRet) SIMD_AS_HWINTRINSIC_ID(VectorT, LoadUnsafe, 1, {NI_VectorT_LoadUnsafe, NI_VectorT_LoadUnsafe, NI_VectorT_LoadUnsafe, NI_VectorT_LoadUnsafe, NI_VectorT_LoadUnsafe, NI_VectorT_LoadUnsafe, NI_VectorT_LoadUnsafe, NI_VectorT_LoadUnsafe, NI_VectorT_LoadUnsafe, NI_VectorT_LoadUnsafe}, SimdAsHWIntrinsicFlag::KeepBaseTypeFromRet) SIMD_AS_HWINTRINSIC_NM(VectorT, LoadUnsafeIndex, "LoadUnsafe", 2, {NI_VectorT_LoadUnsafeIndex, NI_VectorT_LoadUnsafeIndex, NI_VectorT_LoadUnsafeIndex, NI_VectorT_LoadUnsafeIndex, NI_VectorT_LoadUnsafeIndex, NI_VectorT_LoadUnsafeIndex, NI_VectorT_LoadUnsafeIndex, NI_VectorT_LoadUnsafeIndex, NI_VectorT_LoadUnsafeIndex, NI_VectorT_LoadUnsafeIndex}, SimdAsHWIntrinsicFlag::KeepBaseTypeFromRet) SIMD_AS_HWINTRINSIC_ID(VectorT, Max, 2, {NI_VectorT_Max, NI_VectorT_Max, NI_VectorT_Max, NI_VectorT_Max, NI_VectorT_Max, NI_VectorT_Max, NI_VectorT_Max, NI_VectorT_Max, NI_VectorT_Max, NI_VectorT_Max}, SimdAsHWIntrinsicFlag::None) SIMD_AS_HWINTRINSIC_ID(VectorT, Min, 2, {NI_VectorT_Min, NI_VectorT_Min, NI_VectorT_Min, NI_VectorT_Min, NI_VectorT_Min, NI_VectorT_Min, NI_VectorT_Min, NI_VectorT_Min, NI_VectorT_Min, NI_VectorT_Min}, SimdAsHWIntrinsicFlag::None) -SIMD_AS_HWINTRINSIC_ID(VectorT, Multiply, 2, {NI_VectorT_Multiply, NI_VectorT_Multiply, NI_VectorT_Multiply, NI_VectorT_Multiply, NI_VectorT_Multiply, NI_VectorT_Multiply, NI_Illegal, NI_Illegal, NI_VectorT_Multiply, NI_VectorT_Multiply}, SimdAsHWIntrinsicFlag::None) SIMD_AS_HWINTRINSIC_ID(VectorT, Narrow, 2, {NI_VectorT_Narrow, NI_VectorT_Narrow, NI_VectorT_Narrow, NI_VectorT_Narrow, NI_VectorT_Narrow, NI_VectorT_Narrow, NI_VectorT_Narrow, NI_VectorT_Narrow, NI_VectorT_Narrow, NI_VectorT_Narrow}, SimdAsHWIntrinsicFlag::KeepBaseTypeFromRet) -SIMD_AS_HWINTRINSIC_ID(VectorT, Negate, 1, {NI_VectorT_Negate, NI_VectorT_Negate, NI_VectorT_Negate, NI_VectorT_Negate, NI_VectorT_Negate, NI_VectorT_Negate, NI_VectorT_Negate, NI_VectorT_Negate, NI_VectorT_Negate, NI_VectorT_Negate}, SimdAsHWIntrinsicFlag::None) -SIMD_AS_HWINTRINSIC_ID(VectorT, OnesComplement, 2, {NI_VectorT_OnesComplement, NI_VectorT_OnesComplement, NI_VectorT_OnesComplement, NI_VectorT_OnesComplement, NI_VectorT_OnesComplement, NI_VectorT_OnesComplement, NI_VectorT_OnesComplement, NI_VectorT_OnesComplement, NI_VectorT_OnesComplement, NI_VectorT_OnesComplement}, SimdAsHWIntrinsicFlag::None) SIMD_AS_HWINTRINSIC_ID(VectorT, op_Addition, 2, {NI_VectorT_op_Addition, NI_VectorT_op_Addition, NI_VectorT_op_Addition, NI_VectorT_op_Addition, NI_VectorT_op_Addition, NI_VectorT_op_Addition, NI_VectorT_op_Addition, NI_VectorT_op_Addition, NI_VectorT_op_Addition, NI_VectorT_op_Addition}, SimdAsHWIntrinsicFlag::None) SIMD_AS_HWINTRINSIC_ID(VectorT, op_BitwiseAnd, 2, {NI_VectorT_op_BitwiseAnd, NI_VectorT_op_BitwiseAnd, NI_VectorT_op_BitwiseAnd, NI_VectorT_op_BitwiseAnd, NI_VectorT_op_BitwiseAnd, NI_VectorT_op_BitwiseAnd, NI_VectorT_op_BitwiseAnd, NI_VectorT_op_BitwiseAnd, NI_VectorT_op_BitwiseAnd, NI_VectorT_op_BitwiseAnd}, SimdAsHWIntrinsicFlag::None) SIMD_AS_HWINTRINSIC_ID(VectorT, op_BitwiseOr, 2, {NI_VectorT_op_BitwiseOr, NI_VectorT_op_BitwiseOr, NI_VectorT_op_BitwiseOr, NI_VectorT_op_BitwiseOr, NI_VectorT_op_BitwiseOr, NI_VectorT_op_BitwiseOr, NI_VectorT_op_BitwiseOr, NI_VectorT_op_BitwiseOr, NI_VectorT_op_BitwiseOr, NI_VectorT_op_BitwiseOr}, SimdAsHWIntrinsicFlag::None) SIMD_AS_HWINTRINSIC_ID(VectorT, op_Division, 2, {NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_VectorT_op_Division, NI_VectorT_op_Division}, SimdAsHWIntrinsicFlag::None) SIMD_AS_HWINTRINSIC_ID(VectorT, op_Equality, 2, {NI_VectorT_op_Equality, NI_VectorT_op_Equality, NI_VectorT_op_Equality, NI_VectorT_op_Equality, NI_VectorT_op_Equality, NI_VectorT_op_Equality, NI_VectorT_op_Equality, NI_VectorT_op_Equality, NI_VectorT_op_Equality, NI_VectorT_op_Equality}, SimdAsHWIntrinsicFlag::None) SIMD_AS_HWINTRINSIC_ID(VectorT, op_ExclusiveOr, 2, {NI_VectorT_op_ExclusiveOr, NI_VectorT_op_ExclusiveOr, NI_VectorT_op_ExclusiveOr, NI_VectorT_op_ExclusiveOr, NI_VectorT_op_ExclusiveOr, NI_VectorT_op_ExclusiveOr, NI_VectorT_op_ExclusiveOr, NI_VectorT_op_ExclusiveOr, NI_VectorT_op_ExclusiveOr, NI_VectorT_op_ExclusiveOr}, SimdAsHWIntrinsicFlag::None) -SIMD_AS_HWINTRINSIC_ID(VectorT, op_Explicit, 1, {NI_VectorT_op_Explicit, NI_VectorT_op_Explicit, NI_VectorT_op_Explicit, NI_VectorT_op_Explicit, NI_VectorT_op_Explicit, NI_VectorT_op_Explicit, NI_VectorT_op_Explicit, NI_VectorT_op_Explicit, NI_VectorT_op_Explicit, NI_VectorT_op_Explicit}, SimdAsHWIntrinsicFlag::None) SIMD_AS_HWINTRINSIC_ID(VectorT, op_Inequality, 2, {NI_VectorT_op_Inequality, NI_VectorT_op_Inequality, NI_VectorT_op_Inequality, NI_VectorT_op_Inequality, NI_VectorT_op_Inequality, NI_VectorT_op_Inequality, NI_VectorT_op_Inequality, NI_VectorT_op_Inequality, NI_VectorT_op_Inequality, NI_VectorT_op_Inequality}, SimdAsHWIntrinsicFlag::None) SIMD_AS_HWINTRINSIC_ID(VectorT, op_LeftShift, 2, {NI_VectorT_op_LeftShift, NI_VectorT_op_LeftShift, NI_VectorT_op_LeftShift, NI_VectorT_op_LeftShift, NI_VectorT_op_LeftShift, NI_VectorT_op_LeftShift, NI_VectorT_op_LeftShift, NI_VectorT_op_LeftShift, NI_VectorT_op_LeftShift, NI_VectorT_op_LeftShift}, SimdAsHWIntrinsicFlag::None) SIMD_AS_HWINTRINSIC_ID(VectorT, op_Multiply, 2, {NI_VectorT_op_Multiply, NI_VectorT_op_Multiply, NI_VectorT_op_Multiply, NI_VectorT_op_Multiply, NI_VectorT_op_Multiply, NI_VectorT_op_Multiply, NI_Illegal, NI_Illegal, NI_VectorT_op_Multiply, NI_VectorT_op_Multiply}, SimdAsHWIntrinsicFlag::None) @@ -198,24 +140,17 @@ SIMD_AS_HWINTRINSIC_ID(VectorT, op_OnesComplement, SIMD_AS_HWINTRINSIC_ID(VectorT, op_RightShift, 2, {NI_VectorT_op_RightShift, NI_VectorT_op_RightShift, NI_VectorT_op_RightShift, NI_VectorT_op_RightShift, NI_VectorT_op_RightShift, NI_VectorT_op_RightShift, NI_VectorT_op_RightShift, NI_VectorT_op_RightShift, NI_VectorT_op_RightShift, NI_VectorT_op_RightShift}, SimdAsHWIntrinsicFlag::None) SIMD_AS_HWINTRINSIC_ID(VectorT, op_Subtraction, 2, {NI_VectorT_op_Subtraction, NI_VectorT_op_Subtraction, NI_VectorT_op_Subtraction, NI_VectorT_op_Subtraction, NI_VectorT_op_Subtraction, NI_VectorT_op_Subtraction, NI_VectorT_op_Subtraction, NI_VectorT_op_Subtraction, NI_VectorT_op_Subtraction, NI_VectorT_op_Subtraction}, SimdAsHWIntrinsicFlag::None) SIMD_AS_HWINTRINSIC_ID(VectorT, op_UnaryNegation, 1, {NI_VectorT_op_UnaryNegation, NI_VectorT_op_UnaryNegation, NI_VectorT_op_UnaryNegation, NI_VectorT_op_UnaryNegation, NI_VectorT_op_UnaryNegation, NI_VectorT_op_UnaryNegation, NI_VectorT_op_UnaryNegation, NI_VectorT_op_UnaryNegation, NI_VectorT_op_UnaryNegation, NI_VectorT_op_UnaryNegation}, SimdAsHWIntrinsicFlag::None) -SIMD_AS_HWINTRINSIC_ID(VectorT, op_UnaryPlus, 1, {NI_VectorT_op_UnaryPlus, NI_VectorT_op_UnaryPlus, NI_VectorT_op_UnaryPlus, NI_VectorT_op_UnaryPlus, NI_VectorT_op_UnaryPlus, NI_VectorT_op_UnaryPlus, NI_VectorT_op_UnaryPlus, NI_VectorT_op_UnaryPlus, NI_VectorT_op_UnaryPlus, NI_VectorT_op_UnaryPlus}, SimdAsHWIntrinsicFlag::None) SIMD_AS_HWINTRINSIC_ID(VectorT, op_UnsignedRightShift, 2, {NI_VectorT_op_UnsignedRightShift, NI_VectorT_op_UnsignedRightShift, NI_VectorT_op_UnsignedRightShift, NI_VectorT_op_UnsignedRightShift, NI_VectorT_op_UnsignedRightShift, NI_VectorT_op_UnsignedRightShift, NI_VectorT_op_UnsignedRightShift, NI_VectorT_op_UnsignedRightShift, NI_VectorT_op_UnsignedRightShift, NI_VectorT_op_UnsignedRightShift}, SimdAsHWIntrinsicFlag::None) -SIMD_AS_HWINTRINSIC_ID(VectorT, ShiftLeft, 2, {NI_VectorT_ShiftLeft, NI_VectorT_ShiftLeft, NI_VectorT_ShiftLeft, NI_VectorT_ShiftLeft, NI_VectorT_ShiftLeft, NI_VectorT_ShiftLeft, NI_VectorT_ShiftLeft, NI_VectorT_ShiftLeft, NI_Illegal, NI_Illegal}, SimdAsHWIntrinsicFlag::None) -SIMD_AS_HWINTRINSIC_ID(VectorT, ShiftRightArithmetic, 2, {NI_VectorT_ShiftRightArithmetic, NI_Illegal, NI_VectorT_ShiftRightArithmetic, NI_Illegal, NI_VectorT_ShiftRightArithmetic, NI_Illegal, NI_VectorT_ShiftRightArithmetic, NI_Illegal, NI_Illegal, NI_Illegal}, SimdAsHWIntrinsicFlag::None) -SIMD_AS_HWINTRINSIC_ID(VectorT, ShiftRightLogical, 2, {NI_VectorT_ShiftRightLogical, NI_VectorT_ShiftRightLogical, NI_VectorT_ShiftRightLogical, NI_VectorT_ShiftRightLogical, NI_VectorT_ShiftRightLogical, NI_VectorT_ShiftRightLogical, NI_VectorT_ShiftRightLogical, NI_VectorT_ShiftRightLogical, NI_Illegal, NI_Illegal}, SimdAsHWIntrinsicFlag::None) SIMD_AS_HWINTRINSIC_NM(VectorT, Sqrt, "SquareRoot", 1, {NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_VectorT_Sqrt, NI_VectorT_Sqrt}, SimdAsHWIntrinsicFlag::None) -SIMD_AS_HWINTRINSIC_ID(VectorT, Store, 2, {NI_VectorT_Store, NI_VectorT_Store, NI_VectorT_Store, NI_VectorT_Store, NI_VectorT_Store, NI_VectorT_Store, NI_VectorT_Store, NI_VectorT_Store, NI_VectorT_Store, NI_VectorT_Store}, SimdAsHWIntrinsicFlag::SpillSideEffectsOp1) SIMD_AS_HWINTRINSIC_ID(VectorT, StoreAligned, 2, {NI_VectorT_StoreAligned, NI_VectorT_StoreAligned, NI_VectorT_StoreAligned, NI_VectorT_StoreAligned, NI_VectorT_StoreAligned, NI_VectorT_StoreAligned, NI_VectorT_StoreAligned, NI_VectorT_StoreAligned, NI_VectorT_StoreAligned, NI_VectorT_StoreAligned}, SimdAsHWIntrinsicFlag::SpillSideEffectsOp1) SIMD_AS_HWINTRINSIC_ID(VectorT, StoreAlignedNonTemporal, 2, {NI_VectorT_StoreAlignedNonTemporal, NI_VectorT_StoreAlignedNonTemporal, NI_VectorT_StoreAlignedNonTemporal, NI_VectorT_StoreAlignedNonTemporal, NI_VectorT_StoreAlignedNonTemporal, NI_VectorT_StoreAlignedNonTemporal, NI_VectorT_StoreAlignedNonTemporal, NI_VectorT_StoreAlignedNonTemporal, NI_VectorT_StoreAlignedNonTemporal, NI_VectorT_StoreAlignedNonTemporal}, SimdAsHWIntrinsicFlag::SpillSideEffectsOp1) SIMD_AS_HWINTRINSIC_ID(VectorT, StoreUnsafe, 2, {NI_VectorT_StoreUnsafe, NI_VectorT_StoreUnsafe, NI_VectorT_StoreUnsafe, NI_VectorT_StoreUnsafe, NI_VectorT_StoreUnsafe, NI_VectorT_StoreUnsafe, NI_VectorT_StoreUnsafe, NI_VectorT_StoreUnsafe, NI_VectorT_StoreUnsafe, NI_VectorT_StoreUnsafe}, SimdAsHWIntrinsicFlag::SpillSideEffectsOp1) SIMD_AS_HWINTRINSIC_NM(VectorT, StoreUnsafeIndex, "StoreUnsafe", 3, {NI_VectorT_StoreUnsafeIndex, NI_VectorT_StoreUnsafeIndex, NI_VectorT_StoreUnsafeIndex, NI_VectorT_StoreUnsafeIndex, NI_VectorT_StoreUnsafeIndex, NI_VectorT_StoreUnsafeIndex, NI_VectorT_StoreUnsafeIndex, NI_VectorT_StoreUnsafeIndex, NI_VectorT_StoreUnsafeIndex, NI_VectorT_StoreUnsafeIndex}, SimdAsHWIntrinsicFlag::SpillSideEffectsOp1) -SIMD_AS_HWINTRINSIC_ID(VectorT, Subtract, 2, {NI_VectorT_Subtract, NI_VectorT_Subtract, NI_VectorT_Subtract, NI_VectorT_Subtract, NI_VectorT_Subtract, NI_VectorT_Subtract, NI_VectorT_Subtract, NI_VectorT_Subtract, NI_VectorT_Subtract, NI_VectorT_Subtract}, SimdAsHWIntrinsicFlag::None) SIMD_AS_HWINTRINSIC_ID(VectorT, Sum, 1, {NI_VectorT_Sum, NI_VectorT_Sum, NI_VectorT_Sum, NI_VectorT_Sum, NI_VectorT_Sum, NI_VectorT_Sum, NI_VectorT_Sum, NI_VectorT_Sum, NI_VectorT_Sum, NI_VectorT_Sum}, SimdAsHWIntrinsicFlag::None) SIMD_AS_HWINTRINSIC_ID(VectorT, ToScalar, 1, {NI_VectorT_ToScalar, NI_VectorT_ToScalar, NI_VectorT_ToScalar, NI_VectorT_ToScalar, NI_VectorT_ToScalar, NI_VectorT_ToScalar, NI_VectorT_ToScalar, NI_VectorT_ToScalar, NI_VectorT_ToScalar, NI_VectorT_ToScalar}, SimdAsHWIntrinsicFlag::None) SIMD_AS_HWINTRINSIC_ID(VectorT, WidenLower, 1, {NI_VectorT_WidenLower, NI_VectorT_WidenLower, NI_VectorT_WidenLower, NI_VectorT_WidenLower, NI_VectorT_WidenLower, NI_VectorT_WidenLower, NI_VectorT_WidenLower, NI_VectorT_WidenLower, NI_VectorT_WidenLower, NI_VectorT_WidenLower}, SimdAsHWIntrinsicFlag::None) SIMD_AS_HWINTRINSIC_ID(VectorT, WidenUpper, 1, {NI_VectorT_WidenUpper, NI_VectorT_WidenUpper, NI_VectorT_WidenUpper, NI_VectorT_WidenUpper, NI_VectorT_WidenUpper, NI_VectorT_WidenUpper, NI_VectorT_WidenUpper, NI_VectorT_WidenUpper, NI_VectorT_WidenUpper, NI_VectorT_WidenUpper}, SimdAsHWIntrinsicFlag::None) SIMD_AS_HWINTRINSIC_ID(VectorT, WithElement, 3, {NI_VectorT_WithElement, NI_VectorT_WithElement, NI_VectorT_WithElement, NI_VectorT_WithElement, NI_VectorT_WithElement, NI_VectorT_WithElement, NI_VectorT_WithElement, NI_VectorT_WithElement, NI_VectorT_WithElement, NI_VectorT_WithElement}, SimdAsHWIntrinsicFlag::None) -SIMD_AS_HWINTRINSIC_ID(VectorT, Xor, 2, {NI_VectorT_Xor, NI_VectorT_Xor, NI_VectorT_Xor, NI_VectorT_Xor, NI_VectorT_Xor, NI_VectorT_Xor, NI_VectorT_Xor, NI_VectorT_Xor, NI_VectorT_Xor, NI_VectorT_Xor}, SimdAsHWIntrinsicFlag::None) #undef SIMD_AS_HWINTRINSIC_NM #undef SIMD_AS_HWINTRINSIC_ID diff --git a/src/coreclr/jit/simdashwintrinsiclistxarch.h b/src/coreclr/jit/simdashwintrinsiclistxarch.h index 26e58219a7814d..19931853d2f6f0 100644 --- a/src/coreclr/jit/simdashwintrinsiclistxarch.h +++ b/src/coreclr/jit/simdashwintrinsiclistxarch.h @@ -38,28 +38,13 @@ // ************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************* // Vector2 Intrinsics SIMD_AS_HWINTRINSIC_ID(Vector2, Abs, 1, {NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Vector2_Abs, NI_Illegal}, SimdAsHWIntrinsicFlag::None) -SIMD_AS_HWINTRINSIC_ID(Vector2, Add, 2, {NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Vector2_Add, NI_Illegal}, SimdAsHWIntrinsicFlag::None) -SIMD_AS_HWINTRINSIC_ID(Vector2, Clamp, 3, {NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Vector2_Clamp, NI_Illegal}, SimdAsHWIntrinsicFlag::None) SIMD_AS_HWINTRINSIC_NM(Vector2, Create, ".ctor", 3, {NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Vector2_Create, NI_Illegal}, SimdAsHWIntrinsicFlag::InstanceMethod | SimdAsHWIntrinsicFlag::SpillSideEffectsOp1) SIMD_AS_HWINTRINSIC_NM(Vector2, CreateBroadcast, ".ctor", 2, {NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Vector2_CreateBroadcast, NI_Illegal}, SimdAsHWIntrinsicFlag::InstanceMethod | SimdAsHWIntrinsicFlag::SpillSideEffectsOp1) -SIMD_AS_HWINTRINSIC_ID(Vector2, Distance, 2, {NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Vector2_Distance, NI_Illegal}, SimdAsHWIntrinsicFlag::None) -SIMD_AS_HWINTRINSIC_ID(Vector2, DistanceSquared, 2, {NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Vector2_DistanceSquared, NI_Illegal}, SimdAsHWIntrinsicFlag::None) -SIMD_AS_HWINTRINSIC_ID(Vector2, Divide, 2, {NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Vector2_Divide, NI_Illegal}, SimdAsHWIntrinsicFlag::None) SIMD_AS_HWINTRINSIC_ID(Vector2, Dot, 2, {NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Vector2_Dot, NI_Illegal}, SimdAsHWIntrinsicFlag::None) -SIMD_AS_HWINTRINSIC_ID(Vector2, get_Item, 2, {NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Vector2_get_Item, NI_Illegal}, SimdAsHWIntrinsicFlag::InstanceMethod | SimdAsHWIntrinsicFlag::BaseTypeFromThisArg) -SIMD_AS_HWINTRINSIC_ID(Vector2, get_One, 0, {NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Vector2_get_One, NI_Illegal}, SimdAsHWIntrinsicFlag::None) -SIMD_AS_HWINTRINSIC_ID(Vector2, get_UnitX, 0, {NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Vector2_get_UnitX, NI_Illegal}, SimdAsHWIntrinsicFlag::None) -SIMD_AS_HWINTRINSIC_ID(Vector2, get_UnitY, 0, {NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Vector2_get_UnitY, NI_Illegal}, SimdAsHWIntrinsicFlag::None) -SIMD_AS_HWINTRINSIC_ID(Vector2, get_Zero, 0, {NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Vector2_get_Zero, NI_Illegal}, SimdAsHWIntrinsicFlag::None) SIMD_AS_HWINTRINSIC_ID(Vector2, GetElement, 2, {NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Vector2_GetElement, NI_Illegal}, SimdAsHWIntrinsicFlag::None) -SIMD_AS_HWINTRINSIC_ID(Vector2, Length, 1, {NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Vector2_Length, NI_Illegal}, SimdAsHWIntrinsicFlag::InstanceMethod) -SIMD_AS_HWINTRINSIC_ID(Vector2, LengthSquared, 1, {NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Vector2_LengthSquared, NI_Illegal}, SimdAsHWIntrinsicFlag::InstanceMethod) SIMD_AS_HWINTRINSIC_ID(Vector2, Lerp, 3, {NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Vector2_Lerp, NI_Illegal}, SimdAsHWIntrinsicFlag::SpillSideEffectsOp1 | SimdAsHWIntrinsicFlag::SpillSideEffectsOp2) SIMD_AS_HWINTRINSIC_ID(Vector2, Max, 2, {NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Vector2_Max, NI_Illegal}, SimdAsHWIntrinsicFlag::None) SIMD_AS_HWINTRINSIC_ID(Vector2, Min, 2, {NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Vector2_Min, NI_Illegal}, SimdAsHWIntrinsicFlag::None) -SIMD_AS_HWINTRINSIC_ID(Vector2, Multiply, 2, {NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Vector2_Multiply, NI_Illegal}, SimdAsHWIntrinsicFlag::None) -SIMD_AS_HWINTRINSIC_ID(Vector2, Negate, 1, {NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Vector2_Negate, NI_Illegal}, SimdAsHWIntrinsicFlag::None) -SIMD_AS_HWINTRINSIC_ID(Vector2, Normalize, 1, {NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Vector2_Normalize, NI_Illegal}, SimdAsHWIntrinsicFlag::None) SIMD_AS_HWINTRINSIC_ID(Vector2, op_Addition, 2, {NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Vector2_op_Addition, NI_Illegal}, SimdAsHWIntrinsicFlag::None) SIMD_AS_HWINTRINSIC_ID(Vector2, op_Division, 2, {NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Vector2_op_Division, NI_Illegal}, SimdAsHWIntrinsicFlag::None) SIMD_AS_HWINTRINSIC_ID(Vector2, op_Equality, 2, {NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Vector2_op_Equality, NI_Illegal}, SimdAsHWIntrinsicFlag::None) @@ -68,7 +53,6 @@ SIMD_AS_HWINTRINSIC_ID(Vector2, op_Multiply, SIMD_AS_HWINTRINSIC_ID(Vector2, op_Subtraction, 2, {NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Vector2_op_Subtraction, NI_Illegal}, SimdAsHWIntrinsicFlag::None) SIMD_AS_HWINTRINSIC_ID(Vector2, op_UnaryNegation, 1, {NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Vector2_op_UnaryNegation, NI_Illegal}, SimdAsHWIntrinsicFlag::None) SIMD_AS_HWINTRINSIC_NM(Vector2, Sqrt, "SquareRoot", 1, {NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Vector2_Sqrt, NI_Illegal}, SimdAsHWIntrinsicFlag::None) -SIMD_AS_HWINTRINSIC_ID(Vector2, Subtract, 2, {NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Vector2_Subtract, NI_Illegal}, SimdAsHWIntrinsicFlag::None) SIMD_AS_HWINTRINSIC_ID(Vector2, WithElement, 3, {NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Vector2_WithElement, NI_Illegal}, SimdAsHWIntrinsicFlag::None) // ************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************* @@ -77,30 +61,14 @@ SIMD_AS_HWINTRINSIC_ID(Vector2, WithElement, // ************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************* // Vector3 Intrinsics SIMD_AS_HWINTRINSIC_ID(Vector3, Abs, 1, {NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Vector3_Abs, NI_Illegal}, SimdAsHWIntrinsicFlag::None) -SIMD_AS_HWINTRINSIC_ID(Vector3, Add, 2, {NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Vector3_Add, NI_Illegal}, SimdAsHWIntrinsicFlag::None) -SIMD_AS_HWINTRINSIC_ID(Vector3, Clamp, 3, {NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Vector3_Clamp, NI_Illegal}, SimdAsHWIntrinsicFlag::None) SIMD_AS_HWINTRINSIC_NM(Vector3, Create, ".ctor", 4, {NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Vector3_Create, NI_Illegal}, SimdAsHWIntrinsicFlag::InstanceMethod | SimdAsHWIntrinsicFlag::SpillSideEffectsOp1) SIMD_AS_HWINTRINSIC_NM(Vector3, CreateBroadcast, ".ctor", 2, {NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Vector3_CreateBroadcast, NI_Illegal}, SimdAsHWIntrinsicFlag::InstanceMethod | SimdAsHWIntrinsicFlag::SpillSideEffectsOp1) SIMD_AS_HWINTRINSIC_NM(Vector3, CreateFromVector2, ".ctor", 3, {NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Vector3_CreateFromVector2, NI_Illegal}, SimdAsHWIntrinsicFlag::InstanceMethod | SimdAsHWIntrinsicFlag::SpillSideEffectsOp1 | SimdAsHWIntrinsicFlag::BaseTypeFromThisArg) -SIMD_AS_HWINTRINSIC_ID(Vector3, Distance, 2, {NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Vector3_Distance, NI_Illegal}, SimdAsHWIntrinsicFlag::None) -SIMD_AS_HWINTRINSIC_ID(Vector3, DistanceSquared, 2, {NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Vector3_DistanceSquared, NI_Illegal}, SimdAsHWIntrinsicFlag::None) -SIMD_AS_HWINTRINSIC_ID(Vector3, Divide, 2, {NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Vector3_Divide, NI_Illegal}, SimdAsHWIntrinsicFlag::None) SIMD_AS_HWINTRINSIC_ID(Vector3, Dot, 2, {NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Vector3_Dot, NI_Illegal}, SimdAsHWIntrinsicFlag::None) -SIMD_AS_HWINTRINSIC_ID(Vector3, get_Item, 2, {NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Vector3_get_Item, NI_Illegal}, SimdAsHWIntrinsicFlag::InstanceMethod | SimdAsHWIntrinsicFlag::BaseTypeFromThisArg) -SIMD_AS_HWINTRINSIC_ID(Vector3, get_One, 0, {NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Vector3_get_One, NI_Illegal}, SimdAsHWIntrinsicFlag::None) -SIMD_AS_HWINTRINSIC_ID(Vector3, get_UnitX, 0, {NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Vector3_get_UnitX, NI_Illegal}, SimdAsHWIntrinsicFlag::None) -SIMD_AS_HWINTRINSIC_ID(Vector3, get_UnitY, 0, {NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Vector3_get_UnitY, NI_Illegal}, SimdAsHWIntrinsicFlag::None) -SIMD_AS_HWINTRINSIC_ID(Vector3, get_UnitZ, 0, {NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Vector3_get_UnitZ, NI_Illegal}, SimdAsHWIntrinsicFlag::None) -SIMD_AS_HWINTRINSIC_ID(Vector3, get_Zero, 0, {NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Vector3_get_Zero, NI_Illegal}, SimdAsHWIntrinsicFlag::None) SIMD_AS_HWINTRINSIC_ID(Vector3, GetElement, 2, {NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Vector3_GetElement, NI_Illegal}, SimdAsHWIntrinsicFlag::None) -SIMD_AS_HWINTRINSIC_ID(Vector3, Length, 1, {NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Vector3_Length, NI_Illegal}, SimdAsHWIntrinsicFlag::InstanceMethod) -SIMD_AS_HWINTRINSIC_ID(Vector3, LengthSquared, 1, {NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Vector3_LengthSquared, NI_Illegal}, SimdAsHWIntrinsicFlag::InstanceMethod) SIMD_AS_HWINTRINSIC_ID(Vector3, Lerp, 3, {NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Vector3_Lerp, NI_Illegal}, SimdAsHWIntrinsicFlag::SpillSideEffectsOp1 | SimdAsHWIntrinsicFlag::SpillSideEffectsOp2) SIMD_AS_HWINTRINSIC_ID(Vector3, Max, 2, {NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Vector3_Max, NI_Illegal}, SimdAsHWIntrinsicFlag::None) SIMD_AS_HWINTRINSIC_ID(Vector3, Min, 2, {NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Vector3_Min, NI_Illegal}, SimdAsHWIntrinsicFlag::None) -SIMD_AS_HWINTRINSIC_ID(Vector3, Multiply, 2, {NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Vector3_Multiply, NI_Illegal}, SimdAsHWIntrinsicFlag::None) -SIMD_AS_HWINTRINSIC_ID(Vector3, Negate, 1, {NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Vector3_Negate, NI_Illegal}, SimdAsHWIntrinsicFlag::None) -SIMD_AS_HWINTRINSIC_ID(Vector3, Normalize, 1, {NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Vector3_Normalize, NI_Illegal}, SimdAsHWIntrinsicFlag::None) SIMD_AS_HWINTRINSIC_ID(Vector3, op_Addition, 2, {NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Vector3_op_Addition, NI_Illegal}, SimdAsHWIntrinsicFlag::None) SIMD_AS_HWINTRINSIC_ID(Vector3, op_Division, 2, {NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Vector3_op_Division, NI_Illegal}, SimdAsHWIntrinsicFlag::None) SIMD_AS_HWINTRINSIC_ID(Vector3, op_Equality, 2, {NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Vector3_op_Equality, NI_Illegal}, SimdAsHWIntrinsicFlag::None) @@ -109,7 +77,6 @@ SIMD_AS_HWINTRINSIC_ID(Vector3, op_Multiply, SIMD_AS_HWINTRINSIC_ID(Vector3, op_Subtraction, 2, {NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Vector3_op_Subtraction, NI_Illegal}, SimdAsHWIntrinsicFlag::None) SIMD_AS_HWINTRINSIC_ID(Vector3, op_UnaryNegation, 1, {NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Vector3_op_UnaryNegation, NI_Illegal}, SimdAsHWIntrinsicFlag::None) SIMD_AS_HWINTRINSIC_NM(Vector3, Sqrt, "SquareRoot", 1, {NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Vector3_Sqrt, NI_Illegal}, SimdAsHWIntrinsicFlag::None) -SIMD_AS_HWINTRINSIC_ID(Vector3, Subtract, 2, {NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Vector3_Subtract, NI_Illegal}, SimdAsHWIntrinsicFlag::None) SIMD_AS_HWINTRINSIC_ID(Vector3, WithElement, 3, {NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Vector3_WithElement, NI_Illegal}, SimdAsHWIntrinsicFlag::None) // ************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************* @@ -118,23 +85,7 @@ SIMD_AS_HWINTRINSIC_ID(Vector3, WithElement, // ************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************* // Vector Intrinsics SIMD_AS_HWINTRINSIC_ID(VectorT, Abs, 1, {NI_VectorT_Abs, NI_VectorT_Abs, NI_VectorT_Abs, NI_VectorT_Abs, NI_VectorT_Abs, NI_VectorT_Abs, NI_VectorT_Abs, NI_VectorT_Abs, NI_VectorT_Abs, NI_VectorT_Abs}, SimdAsHWIntrinsicFlag::None) -SIMD_AS_HWINTRINSIC_ID(VectorT, Add, 2, {NI_VectorT_Add, NI_VectorT_Add, NI_VectorT_Add, NI_VectorT_Add, NI_VectorT_Add, NI_VectorT_Add, NI_VectorT_Add, NI_VectorT_Add, NI_VectorT_Add, NI_VectorT_Add}, SimdAsHWIntrinsicFlag::None) SIMD_AS_HWINTRINSIC_ID(VectorT, AndNot, 2, {NI_VectorT_AndNot, NI_VectorT_AndNot, NI_VectorT_AndNot, NI_VectorT_AndNot, NI_VectorT_AndNot, NI_VectorT_AndNot, NI_VectorT_AndNot, NI_VectorT_AndNot, NI_VectorT_AndNot, NI_VectorT_AndNot}, SimdAsHWIntrinsicFlag::SpillSideEffectsOp1) -SIMD_AS_HWINTRINSIC_ID(VectorT, As, 1, {NI_VectorT_As, NI_VectorT_As, NI_VectorT_As, NI_VectorT_As, NI_VectorT_As, NI_VectorT_As, NI_VectorT_As, NI_VectorT_As, NI_VectorT_As, NI_VectorT_As}, SimdAsHWIntrinsicFlag::None) -SIMD_AS_HWINTRINSIC_ID(VectorT, AsVectorByte, 1, {NI_VectorT_AsVectorByte, NI_VectorT_AsVectorByte, NI_VectorT_AsVectorByte, NI_VectorT_AsVectorByte, NI_VectorT_AsVectorByte, NI_VectorT_AsVectorByte, NI_VectorT_AsVectorByte, NI_VectorT_AsVectorByte, NI_VectorT_AsVectorByte, NI_VectorT_AsVectorByte}, SimdAsHWIntrinsicFlag::None) -SIMD_AS_HWINTRINSIC_ID(VectorT, AsVectorDouble, 1, {NI_VectorT_AsVectorDouble, NI_VectorT_AsVectorDouble, NI_VectorT_AsVectorDouble, NI_VectorT_AsVectorDouble, NI_VectorT_AsVectorDouble, NI_VectorT_AsVectorDouble, NI_VectorT_AsVectorDouble, NI_VectorT_AsVectorDouble, NI_VectorT_AsVectorDouble, NI_VectorT_AsVectorDouble}, SimdAsHWIntrinsicFlag::None) -SIMD_AS_HWINTRINSIC_ID(VectorT, AsVectorInt16, 1, {NI_VectorT_AsVectorInt16, NI_VectorT_AsVectorInt16, NI_VectorT_AsVectorInt16, NI_VectorT_AsVectorInt16, NI_VectorT_AsVectorInt16, NI_VectorT_AsVectorInt16, NI_VectorT_AsVectorInt16, NI_VectorT_AsVectorInt16, NI_VectorT_AsVectorInt16, NI_VectorT_AsVectorInt16}, SimdAsHWIntrinsicFlag::None) -SIMD_AS_HWINTRINSIC_ID(VectorT, AsVectorInt32, 1, {NI_VectorT_AsVectorInt32, NI_VectorT_AsVectorInt32, NI_VectorT_AsVectorInt32, NI_VectorT_AsVectorInt32, NI_VectorT_AsVectorInt32, NI_VectorT_AsVectorInt32, NI_VectorT_AsVectorInt32, NI_VectorT_AsVectorInt32, NI_VectorT_AsVectorInt32, NI_VectorT_AsVectorInt32}, SimdAsHWIntrinsicFlag::None) -SIMD_AS_HWINTRINSIC_ID(VectorT, AsVectorInt64, 1, {NI_VectorT_AsVectorInt64, NI_VectorT_AsVectorInt64, NI_VectorT_AsVectorInt64, NI_VectorT_AsVectorInt64, NI_VectorT_AsVectorInt64, NI_VectorT_AsVectorInt64, NI_VectorT_AsVectorInt64, NI_VectorT_AsVectorInt64, NI_VectorT_AsVectorInt64, NI_VectorT_AsVectorInt64}, SimdAsHWIntrinsicFlag::None) -SIMD_AS_HWINTRINSIC_ID(VectorT, AsVectorNInt, 1, {NI_VectorT_AsVectorNInt, NI_VectorT_AsVectorNInt, NI_VectorT_AsVectorNInt, NI_VectorT_AsVectorNInt, NI_VectorT_AsVectorNInt, NI_VectorT_AsVectorNInt, NI_VectorT_AsVectorNInt, NI_VectorT_AsVectorNInt, NI_VectorT_AsVectorNInt, NI_VectorT_AsVectorNInt}, SimdAsHWIntrinsicFlag::None) -SIMD_AS_HWINTRINSIC_ID(VectorT, AsVectorNUInt, 1, {NI_VectorT_AsVectorNUInt, NI_VectorT_AsVectorNUInt, NI_VectorT_AsVectorNUInt, NI_VectorT_AsVectorNUInt, NI_VectorT_AsVectorNUInt, NI_VectorT_AsVectorNUInt, NI_VectorT_AsVectorNUInt, NI_VectorT_AsVectorNUInt, NI_VectorT_AsVectorNUInt, NI_VectorT_AsVectorNUInt}, SimdAsHWIntrinsicFlag::None) -SIMD_AS_HWINTRINSIC_ID(VectorT, AsVectorSByte, 1, {NI_VectorT_AsVectorSByte, NI_VectorT_AsVectorSByte, NI_VectorT_AsVectorSByte, NI_VectorT_AsVectorSByte, NI_VectorT_AsVectorSByte, NI_VectorT_AsVectorSByte, NI_VectorT_AsVectorSByte, NI_VectorT_AsVectorSByte, NI_VectorT_AsVectorSByte, NI_VectorT_AsVectorSByte}, SimdAsHWIntrinsicFlag::None) -SIMD_AS_HWINTRINSIC_ID(VectorT, AsVectorSingle, 1, {NI_VectorT_AsVectorSingle, NI_VectorT_AsVectorSingle, NI_VectorT_AsVectorSingle, NI_VectorT_AsVectorSingle, NI_VectorT_AsVectorSingle, NI_VectorT_AsVectorSingle, NI_VectorT_AsVectorSingle, NI_VectorT_AsVectorSingle, NI_VectorT_AsVectorSingle, NI_VectorT_AsVectorSingle}, SimdAsHWIntrinsicFlag::None) -SIMD_AS_HWINTRINSIC_ID(VectorT, AsVectorUInt16, 1, {NI_VectorT_AsVectorUInt16, NI_VectorT_AsVectorUInt16, NI_VectorT_AsVectorUInt16, NI_VectorT_AsVectorUInt16, NI_VectorT_AsVectorUInt16, NI_VectorT_AsVectorUInt16, NI_VectorT_AsVectorUInt16, NI_VectorT_AsVectorUInt16, NI_VectorT_AsVectorUInt16, NI_VectorT_AsVectorUInt16}, SimdAsHWIntrinsicFlag::None) -SIMD_AS_HWINTRINSIC_ID(VectorT, AsVectorUInt32, 1, {NI_VectorT_AsVectorUInt32, NI_VectorT_AsVectorUInt32, NI_VectorT_AsVectorUInt32, NI_VectorT_AsVectorUInt32, NI_VectorT_AsVectorUInt32, NI_VectorT_AsVectorUInt32, NI_VectorT_AsVectorUInt32, NI_VectorT_AsVectorUInt32, NI_VectorT_AsVectorUInt32, NI_VectorT_AsVectorUInt32}, SimdAsHWIntrinsicFlag::None) -SIMD_AS_HWINTRINSIC_ID(VectorT, AsVectorUInt64, 1, {NI_VectorT_AsVectorUInt64, NI_VectorT_AsVectorUInt64, NI_VectorT_AsVectorUInt64, NI_VectorT_AsVectorUInt64, NI_VectorT_AsVectorUInt64, NI_VectorT_AsVectorUInt64, NI_VectorT_AsVectorUInt64, NI_VectorT_AsVectorUInt64, NI_VectorT_AsVectorUInt64, NI_VectorT_AsVectorUInt64}, SimdAsHWIntrinsicFlag::None) -SIMD_AS_HWINTRINSIC_ID(VectorT, BitwiseAnd, 2, {NI_VectorT_BitwiseAnd, NI_VectorT_BitwiseAnd, NI_VectorT_BitwiseAnd, NI_VectorT_BitwiseAnd, NI_VectorT_BitwiseAnd, NI_VectorT_BitwiseAnd, NI_VectorT_BitwiseAnd, NI_VectorT_BitwiseAnd, NI_VectorT_BitwiseAnd, NI_VectorT_BitwiseAnd}, SimdAsHWIntrinsicFlag::None) -SIMD_AS_HWINTRINSIC_ID(VectorT, BitwiseOr, 2, {NI_VectorT_BitwiseOr, NI_VectorT_BitwiseOr, NI_VectorT_BitwiseOr, NI_VectorT_BitwiseOr, NI_VectorT_BitwiseOr, NI_VectorT_BitwiseOr, NI_VectorT_BitwiseOr, NI_VectorT_BitwiseOr, NI_VectorT_BitwiseOr, NI_VectorT_BitwiseOr}, SimdAsHWIntrinsicFlag::None) SIMD_AS_HWINTRINSIC_ID(VectorT, Ceiling, 1, {NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_VectorT_Ceiling, NI_VectorT_Ceiling}, SimdAsHWIntrinsicFlag::None) SIMD_AS_HWINTRINSIC_ID(VectorT, ConditionalSelect, 3, {NI_VectorT_ConditionalSelect, NI_VectorT_ConditionalSelect, NI_VectorT_ConditionalSelect, NI_VectorT_ConditionalSelect, NI_VectorT_ConditionalSelect, NI_VectorT_ConditionalSelect, NI_VectorT_ConditionalSelect, NI_VectorT_ConditionalSelect, NI_VectorT_ConditionalSelect, NI_VectorT_ConditionalSelect}, SimdAsHWIntrinsicFlag::None) SIMD_AS_HWINTRINSIC_ID(VectorT, ConvertToDouble, 1, {NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_VectorT_ConvertToDouble, NI_VectorT_ConvertToDouble, NI_Illegal, NI_Illegal}, SimdAsHWIntrinsicFlag::None) @@ -149,17 +100,13 @@ SIMD_AS_HWINTRINSIC_ID(VectorT, ConvertToUInt64, SIMD_AS_HWINTRINSIC_ID(VectorT, ConvertToUInt64Native, 1, {NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_VectorT_ConvertToUInt64Native}, SimdAsHWIntrinsicFlag::None) SIMD_AS_HWINTRINSIC_NM(VectorT, CreateBroadcast, ".ctor", 2, {NI_VectorT_CreateBroadcast, NI_VectorT_CreateBroadcast, NI_VectorT_CreateBroadcast, NI_VectorT_CreateBroadcast, NI_VectorT_CreateBroadcast, NI_VectorT_CreateBroadcast, NI_VectorT_CreateBroadcast, NI_VectorT_CreateBroadcast, NI_VectorT_CreateBroadcast, NI_VectorT_CreateBroadcast}, SimdAsHWIntrinsicFlag::InstanceMethod | SimdAsHWIntrinsicFlag::SpillSideEffectsOp1) SIMD_AS_HWINTRINSIC_ID(VectorT, CreateSequence, 2, {NI_VectorT_CreateSequence, NI_VectorT_CreateSequence, NI_VectorT_CreateSequence, NI_VectorT_CreateSequence, NI_VectorT_CreateSequence, NI_VectorT_CreateSequence, NI_VectorT_CreateSequence, NI_VectorT_CreateSequence, NI_VectorT_CreateSequence, NI_VectorT_CreateSequence}, SimdAsHWIntrinsicFlag::SpillSideEffectsOp1) -SIMD_AS_HWINTRINSIC_ID(VectorT, Divide, 2, {NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_VectorT_Divide, NI_VectorT_Divide}, SimdAsHWIntrinsicFlag::None) SIMD_AS_HWINTRINSIC_ID(VectorT, Dot, 2, {NI_Illegal, NI_Illegal, NI_VectorT_Dot, NI_VectorT_Dot, NI_VectorT_Dot, NI_VectorT_Dot, NI_Illegal, NI_Illegal, NI_VectorT_Dot, NI_VectorT_Dot}, SimdAsHWIntrinsicFlag::None) SIMD_AS_HWINTRINSIC_ID(VectorT, Equals, 2, {NI_VectorT_Equals, NI_VectorT_Equals, NI_VectorT_Equals, NI_VectorT_Equals, NI_VectorT_Equals, NI_VectorT_Equals, NI_VectorT_Equals, NI_VectorT_Equals, NI_VectorT_Equals, NI_VectorT_Equals}, SimdAsHWIntrinsicFlag::None) -SIMD_AS_HWINTRINSIC_ID(VectorT, EqualsAll, 2, {NI_VectorT_EqualsAll, NI_VectorT_EqualsAll, NI_VectorT_EqualsAll, NI_VectorT_EqualsAll, NI_VectorT_EqualsAll, NI_VectorT_EqualsAll, NI_VectorT_EqualsAll, NI_VectorT_EqualsAll, NI_VectorT_EqualsAll, NI_VectorT_EqualsAll}, SimdAsHWIntrinsicFlag::None) SIMD_AS_HWINTRINSIC_ID(VectorT, EqualsAny, 2, {NI_VectorT_EqualsAny, NI_VectorT_EqualsAny, NI_VectorT_EqualsAny, NI_VectorT_EqualsAny, NI_VectorT_EqualsAny, NI_VectorT_EqualsAny, NI_VectorT_EqualsAny, NI_VectorT_EqualsAny, NI_VectorT_EqualsAny, NI_VectorT_EqualsAny}, SimdAsHWIntrinsicFlag::None) SIMD_AS_HWINTRINSIC_ID(VectorT, Floor, 1, {NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_VectorT_Floor, NI_VectorT_Floor}, SimdAsHWIntrinsicFlag::None) SIMD_AS_HWINTRINSIC_ID(VectorT, get_AllBitsSet, 0, {NI_VectorT_get_AllBitsSet, NI_VectorT_get_AllBitsSet, NI_VectorT_get_AllBitsSet, NI_VectorT_get_AllBitsSet, NI_VectorT_get_AllBitsSet, NI_VectorT_get_AllBitsSet, NI_VectorT_get_AllBitsSet, NI_VectorT_get_AllBitsSet, NI_VectorT_get_AllBitsSet, NI_VectorT_get_AllBitsSet}, SimdAsHWIntrinsicFlag::None) SIMD_AS_HWINTRINSIC_ID(VectorT, get_Indices, 0, {NI_VectorT_get_Indices, NI_VectorT_get_Indices, NI_VectorT_get_Indices, NI_VectorT_get_Indices, NI_VectorT_get_Indices, NI_VectorT_get_Indices, NI_VectorT_get_Indices, NI_VectorT_get_Indices, NI_VectorT_get_Indices, NI_VectorT_get_Indices}, SimdAsHWIntrinsicFlag::None) -SIMD_AS_HWINTRINSIC_ID(VectorT, get_Item, 2, {NI_VectorT_get_Item, NI_VectorT_get_Item, NI_VectorT_get_Item, NI_VectorT_get_Item, NI_VectorT_get_Item, NI_VectorT_get_Item, NI_VectorT_get_Item, NI_VectorT_get_Item, NI_VectorT_get_Item, NI_VectorT_get_Item}, SimdAsHWIntrinsicFlag::InstanceMethod | SimdAsHWIntrinsicFlag::BaseTypeFromThisArg) SIMD_AS_HWINTRINSIC_ID(VectorT, get_One, 0, {NI_VectorT_get_One, NI_VectorT_get_One, NI_VectorT_get_One, NI_VectorT_get_One, NI_VectorT_get_One, NI_VectorT_get_One, NI_VectorT_get_One, NI_VectorT_get_One, NI_VectorT_get_One, NI_VectorT_get_One}, SimdAsHWIntrinsicFlag::None) -SIMD_AS_HWINTRINSIC_ID(VectorT, get_Zero, 0, {NI_VectorT_get_Zero, NI_VectorT_get_Zero, NI_VectorT_get_Zero, NI_VectorT_get_Zero, NI_VectorT_get_Zero, NI_VectorT_get_Zero, NI_VectorT_get_Zero, NI_VectorT_get_Zero, NI_VectorT_get_Zero, NI_VectorT_get_Zero}, SimdAsHWIntrinsicFlag::None) SIMD_AS_HWINTRINSIC_ID(VectorT, GetElement, 2, {NI_VectorT_GetElement, NI_VectorT_GetElement, NI_VectorT_GetElement, NI_VectorT_GetElement, NI_VectorT_GetElement, NI_VectorT_GetElement, NI_VectorT_GetElement, NI_VectorT_GetElement, NI_VectorT_GetElement, NI_VectorT_GetElement}, SimdAsHWIntrinsicFlag::None) SIMD_AS_HWINTRINSIC_ID(VectorT, GreaterThan, 2, {NI_VectorT_GreaterThan, NI_VectorT_GreaterThan, NI_VectorT_GreaterThan, NI_VectorT_GreaterThan, NI_VectorT_GreaterThan, NI_VectorT_GreaterThan, NI_VectorT_GreaterThan, NI_VectorT_GreaterThan, NI_VectorT_GreaterThan, NI_VectorT_GreaterThan}, SimdAsHWIntrinsicFlag::None) SIMD_AS_HWINTRINSIC_ID(VectorT, GreaterThanAll, 2, {NI_VectorT_GreaterThanAll, NI_VectorT_GreaterThanAll, NI_VectorT_GreaterThanAll, NI_VectorT_GreaterThanAll, NI_VectorT_GreaterThanAll, NI_VectorT_GreaterThanAll, NI_VectorT_GreaterThanAll, NI_VectorT_GreaterThanAll, NI_VectorT_GreaterThanAll, NI_VectorT_GreaterThanAll}, SimdAsHWIntrinsicFlag::None) @@ -173,24 +120,19 @@ SIMD_AS_HWINTRINSIC_ID(VectorT, LessThanAny, SIMD_AS_HWINTRINSIC_ID(VectorT, LessThanOrEqual, 2, {NI_VectorT_LessThanOrEqual, NI_VectorT_LessThanOrEqual, NI_VectorT_LessThanOrEqual, NI_VectorT_LessThanOrEqual, NI_VectorT_LessThanOrEqual, NI_VectorT_LessThanOrEqual, NI_VectorT_LessThanOrEqual, NI_VectorT_LessThanOrEqual, NI_VectorT_LessThanOrEqual, NI_VectorT_LessThanOrEqual}, SimdAsHWIntrinsicFlag::None) SIMD_AS_HWINTRINSIC_ID(VectorT, LessThanOrEqualAll, 2, {NI_VectorT_LessThanOrEqualAll, NI_VectorT_LessThanOrEqualAll, NI_VectorT_LessThanOrEqualAll, NI_VectorT_LessThanOrEqualAll, NI_VectorT_LessThanOrEqualAll, NI_VectorT_LessThanOrEqualAll, NI_VectorT_LessThanOrEqualAll, NI_VectorT_LessThanOrEqualAll, NI_VectorT_LessThanOrEqualAll, NI_VectorT_LessThanOrEqualAll}, SimdAsHWIntrinsicFlag::None) SIMD_AS_HWINTRINSIC_ID(VectorT, LessThanOrEqualAny, 2, {NI_VectorT_LessThanOrEqualAny, NI_VectorT_LessThanOrEqualAny, NI_VectorT_LessThanOrEqualAny, NI_VectorT_LessThanOrEqualAny, NI_VectorT_LessThanOrEqualAny, NI_VectorT_LessThanOrEqualAny, NI_VectorT_LessThanOrEqualAny, NI_VectorT_LessThanOrEqualAny, NI_VectorT_LessThanOrEqualAny, NI_VectorT_LessThanOrEqualAny}, SimdAsHWIntrinsicFlag::None) -SIMD_AS_HWINTRINSIC_ID(VectorT, Load, 1, {NI_VectorT_Load, NI_VectorT_Load, NI_VectorT_Load, NI_VectorT_Load, NI_VectorT_Load, NI_VectorT_Load, NI_VectorT_Load, NI_VectorT_Load, NI_VectorT_Load, NI_VectorT_Load}, SimdAsHWIntrinsicFlag::KeepBaseTypeFromRet) SIMD_AS_HWINTRINSIC_ID(VectorT, LoadAligned, 1, {NI_VectorT_LoadAligned, NI_VectorT_LoadAligned, NI_VectorT_LoadAligned, NI_VectorT_LoadAligned, NI_VectorT_LoadAligned, NI_VectorT_LoadAligned, NI_VectorT_LoadAligned, NI_VectorT_LoadAligned, NI_VectorT_LoadAligned, NI_VectorT_LoadAligned}, SimdAsHWIntrinsicFlag::KeepBaseTypeFromRet) SIMD_AS_HWINTRINSIC_ID(VectorT, LoadAlignedNonTemporal, 1, {NI_VectorT_LoadAlignedNonTemporal, NI_VectorT_LoadAlignedNonTemporal, NI_VectorT_LoadAlignedNonTemporal, NI_VectorT_LoadAlignedNonTemporal, NI_VectorT_LoadAlignedNonTemporal, NI_VectorT_LoadAlignedNonTemporal, NI_VectorT_LoadAlignedNonTemporal, NI_VectorT_LoadAlignedNonTemporal, NI_VectorT_LoadAlignedNonTemporal, NI_VectorT_LoadAlignedNonTemporal}, SimdAsHWIntrinsicFlag::KeepBaseTypeFromRet) SIMD_AS_HWINTRINSIC_ID(VectorT, LoadUnsafe, 1, {NI_VectorT_LoadUnsafe, NI_VectorT_LoadUnsafe, NI_VectorT_LoadUnsafe, NI_VectorT_LoadUnsafe, NI_VectorT_LoadUnsafe, NI_VectorT_LoadUnsafe, NI_VectorT_LoadUnsafe, NI_VectorT_LoadUnsafe, NI_VectorT_LoadUnsafe, NI_VectorT_LoadUnsafe}, SimdAsHWIntrinsicFlag::KeepBaseTypeFromRet) SIMD_AS_HWINTRINSIC_NM(VectorT, LoadUnsafeIndex, "LoadUnsafe", 2, {NI_VectorT_LoadUnsafeIndex, NI_VectorT_LoadUnsafeIndex, NI_VectorT_LoadUnsafeIndex, NI_VectorT_LoadUnsafeIndex, NI_VectorT_LoadUnsafeIndex, NI_VectorT_LoadUnsafeIndex, NI_VectorT_LoadUnsafeIndex, NI_VectorT_LoadUnsafeIndex, NI_VectorT_LoadUnsafeIndex, NI_VectorT_LoadUnsafeIndex}, SimdAsHWIntrinsicFlag::KeepBaseTypeFromRet) SIMD_AS_HWINTRINSIC_ID(VectorT, Max, 2, {NI_VectorT_Max, NI_VectorT_Max, NI_VectorT_Max, NI_VectorT_Max, NI_VectorT_Max, NI_VectorT_Max, NI_VectorT_Max, NI_VectorT_Max, NI_VectorT_Max, NI_VectorT_Max}, SimdAsHWIntrinsicFlag::None) SIMD_AS_HWINTRINSIC_ID(VectorT, Min, 2, {NI_VectorT_Min, NI_VectorT_Min, NI_VectorT_Min, NI_VectorT_Min, NI_VectorT_Min, NI_VectorT_Min, NI_VectorT_Min, NI_VectorT_Min, NI_VectorT_Min, NI_VectorT_Min}, SimdAsHWIntrinsicFlag::None) -SIMD_AS_HWINTRINSIC_ID(VectorT, Multiply, 2, {NI_Illegal, NI_Illegal, NI_VectorT_Multiply, NI_VectorT_Multiply, NI_VectorT_Multiply, NI_VectorT_Multiply, NI_VectorT_Multiply, NI_VectorT_Multiply, NI_VectorT_Multiply, NI_VectorT_Multiply}, SimdAsHWIntrinsicFlag::None) SIMD_AS_HWINTRINSIC_ID(VectorT, Narrow, 2, {NI_VectorT_Narrow, NI_VectorT_Narrow, NI_VectorT_Narrow, NI_VectorT_Narrow, NI_VectorT_Narrow, NI_VectorT_Narrow, NI_VectorT_Narrow, NI_VectorT_Narrow, NI_VectorT_Narrow, NI_VectorT_Narrow}, SimdAsHWIntrinsicFlag::KeepBaseTypeFromRet) -SIMD_AS_HWINTRINSIC_ID(VectorT, Negate, 1, {NI_VectorT_Negate, NI_VectorT_Negate, NI_VectorT_Negate, NI_VectorT_Negate, NI_VectorT_Negate, NI_VectorT_Negate, NI_VectorT_Negate, NI_VectorT_Negate, NI_VectorT_Negate, NI_VectorT_Negate}, SimdAsHWIntrinsicFlag::None) -SIMD_AS_HWINTRINSIC_ID(VectorT, OnesComplement, 1, {NI_VectorT_OnesComplement, NI_VectorT_OnesComplement, NI_VectorT_OnesComplement, NI_VectorT_OnesComplement, NI_VectorT_OnesComplement, NI_VectorT_OnesComplement, NI_VectorT_OnesComplement, NI_VectorT_OnesComplement, NI_VectorT_OnesComplement, NI_VectorT_OnesComplement}, SimdAsHWIntrinsicFlag::None) SIMD_AS_HWINTRINSIC_ID(VectorT, op_Addition, 2, {NI_VectorT_op_Addition, NI_VectorT_op_Addition, NI_VectorT_op_Addition, NI_VectorT_op_Addition, NI_VectorT_op_Addition, NI_VectorT_op_Addition, NI_VectorT_op_Addition, NI_VectorT_op_Addition, NI_VectorT_op_Addition, NI_VectorT_op_Addition}, SimdAsHWIntrinsicFlag::None) SIMD_AS_HWINTRINSIC_ID(VectorT, op_BitwiseAnd, 2, {NI_VectorT_op_BitwiseAnd, NI_VectorT_op_BitwiseAnd, NI_VectorT_op_BitwiseAnd, NI_VectorT_op_BitwiseAnd, NI_VectorT_op_BitwiseAnd, NI_VectorT_op_BitwiseAnd, NI_VectorT_op_BitwiseAnd, NI_VectorT_op_BitwiseAnd, NI_VectorT_op_BitwiseAnd, NI_VectorT_op_BitwiseAnd}, SimdAsHWIntrinsicFlag::None) SIMD_AS_HWINTRINSIC_ID(VectorT, op_BitwiseOr, 2, {NI_VectorT_op_BitwiseOr, NI_VectorT_op_BitwiseOr, NI_VectorT_op_BitwiseOr, NI_VectorT_op_BitwiseOr, NI_VectorT_op_BitwiseOr, NI_VectorT_op_BitwiseOr, NI_VectorT_op_BitwiseOr, NI_VectorT_op_BitwiseOr, NI_VectorT_op_BitwiseOr, NI_VectorT_op_BitwiseOr}, SimdAsHWIntrinsicFlag::None) SIMD_AS_HWINTRINSIC_ID(VectorT, op_Division, 2, {NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_VectorT_op_Division, NI_VectorT_op_Division}, SimdAsHWIntrinsicFlag::None) SIMD_AS_HWINTRINSIC_ID(VectorT, op_Equality, 2, {NI_VectorT_op_Equality, NI_VectorT_op_Equality, NI_VectorT_op_Equality, NI_VectorT_op_Equality, NI_VectorT_op_Equality, NI_VectorT_op_Equality, NI_VectorT_op_Equality, NI_VectorT_op_Equality, NI_VectorT_op_Equality, NI_VectorT_op_Equality}, SimdAsHWIntrinsicFlag::None) SIMD_AS_HWINTRINSIC_ID(VectorT, op_ExclusiveOr, 2, {NI_VectorT_op_ExclusiveOr, NI_VectorT_op_ExclusiveOr, NI_VectorT_op_ExclusiveOr, NI_VectorT_op_ExclusiveOr, NI_VectorT_op_ExclusiveOr, NI_VectorT_op_ExclusiveOr, NI_VectorT_op_ExclusiveOr, NI_VectorT_op_ExclusiveOr, NI_VectorT_op_ExclusiveOr, NI_VectorT_op_ExclusiveOr}, SimdAsHWIntrinsicFlag::None) -SIMD_AS_HWINTRINSIC_ID(VectorT, op_Explicit, 1, {NI_VectorT_op_Explicit, NI_VectorT_op_Explicit, NI_VectorT_op_Explicit, NI_VectorT_op_Explicit, NI_VectorT_op_Explicit, NI_VectorT_op_Explicit, NI_VectorT_op_Explicit, NI_VectorT_op_Explicit, NI_VectorT_op_Explicit, NI_VectorT_op_Explicit}, SimdAsHWIntrinsicFlag::None) SIMD_AS_HWINTRINSIC_ID(VectorT, op_Inequality, 2, {NI_VectorT_op_Inequality, NI_VectorT_op_Inequality, NI_VectorT_op_Inequality, NI_VectorT_op_Inequality, NI_VectorT_op_Inequality, NI_VectorT_op_Inequality, NI_VectorT_op_Inequality, NI_VectorT_op_Inequality, NI_VectorT_op_Inequality, NI_VectorT_op_Inequality}, SimdAsHWIntrinsicFlag::None) SIMD_AS_HWINTRINSIC_ID(VectorT, op_LeftShift, 2, {NI_Illegal, NI_Illegal, NI_VectorT_op_LeftShift, NI_VectorT_op_LeftShift, NI_VectorT_op_LeftShift, NI_VectorT_op_LeftShift, NI_VectorT_op_LeftShift, NI_VectorT_op_LeftShift, NI_VectorT_op_LeftShift, NI_VectorT_op_LeftShift}, SimdAsHWIntrinsicFlag::None) SIMD_AS_HWINTRINSIC_ID(VectorT, op_Multiply, 2, {NI_Illegal, NI_Illegal, NI_VectorT_op_Multiply, NI_VectorT_op_Multiply, NI_VectorT_op_Multiply, NI_VectorT_op_Multiply, NI_Illegal, NI_Illegal, NI_VectorT_op_Multiply, NI_VectorT_op_Multiply}, SimdAsHWIntrinsicFlag::None) @@ -198,24 +140,17 @@ SIMD_AS_HWINTRINSIC_ID(VectorT, op_OnesComplement, SIMD_AS_HWINTRINSIC_ID(VectorT, op_RightShift, 2, {NI_Illegal, NI_Illegal, NI_VectorT_op_RightShift, NI_VectorT_op_RightShift, NI_VectorT_op_RightShift, NI_VectorT_op_RightShift, NI_VectorT_op_RightShift, NI_VectorT_op_RightShift, NI_VectorT_op_RightShift, NI_VectorT_op_RightShift}, SimdAsHWIntrinsicFlag::None) SIMD_AS_HWINTRINSIC_ID(VectorT, op_Subtraction, 2, {NI_VectorT_op_Subtraction, NI_VectorT_op_Subtraction, NI_VectorT_op_Subtraction, NI_VectorT_op_Subtraction, NI_VectorT_op_Subtraction, NI_VectorT_op_Subtraction, NI_VectorT_op_Subtraction, NI_VectorT_op_Subtraction, NI_VectorT_op_Subtraction, NI_VectorT_op_Subtraction}, SimdAsHWIntrinsicFlag::None) SIMD_AS_HWINTRINSIC_ID(VectorT, op_UnaryNegation, 1, {NI_VectorT_op_UnaryNegation, NI_VectorT_op_UnaryNegation, NI_VectorT_op_UnaryNegation, NI_VectorT_op_UnaryNegation, NI_VectorT_op_UnaryNegation, NI_VectorT_op_UnaryNegation, NI_VectorT_op_UnaryNegation, NI_VectorT_op_UnaryNegation, NI_VectorT_op_UnaryNegation, NI_VectorT_op_UnaryNegation}, SimdAsHWIntrinsicFlag::None) -SIMD_AS_HWINTRINSIC_ID(VectorT, op_UnaryPlus, 1, {NI_VectorT_op_UnaryPlus, NI_VectorT_op_UnaryPlus, NI_VectorT_op_UnaryPlus, NI_VectorT_op_UnaryPlus, NI_VectorT_op_UnaryPlus, NI_VectorT_op_UnaryPlus, NI_VectorT_op_UnaryPlus, NI_VectorT_op_UnaryPlus, NI_VectorT_op_UnaryPlus, NI_VectorT_op_UnaryPlus}, SimdAsHWIntrinsicFlag::None) SIMD_AS_HWINTRINSIC_ID(VectorT, op_UnsignedRightShift, 2, {NI_Illegal, NI_Illegal, NI_VectorT_op_UnsignedRightShift, NI_VectorT_op_UnsignedRightShift, NI_VectorT_op_UnsignedRightShift, NI_VectorT_op_UnsignedRightShift, NI_VectorT_op_UnsignedRightShift, NI_VectorT_op_UnsignedRightShift, NI_VectorT_op_UnsignedRightShift, NI_VectorT_op_UnsignedRightShift}, SimdAsHWIntrinsicFlag::None) -SIMD_AS_HWINTRINSIC_ID(VectorT, ShiftLeft, 2, {NI_Illegal, NI_Illegal, NI_VectorT_ShiftLeft, NI_VectorT_ShiftLeft, NI_VectorT_ShiftLeft, NI_VectorT_ShiftLeft, NI_VectorT_ShiftLeft, NI_VectorT_ShiftLeft, NI_Illegal, NI_Illegal}, SimdAsHWIntrinsicFlag::None) -SIMD_AS_HWINTRINSIC_ID(VectorT, ShiftRightArithmetic, 2, {NI_Illegal, NI_Illegal, NI_VectorT_ShiftRightArithmetic, NI_Illegal, NI_VectorT_ShiftRightArithmetic, NI_Illegal, NI_VectorT_ShiftRightArithmetic, NI_Illegal, NI_Illegal, NI_Illegal}, SimdAsHWIntrinsicFlag::None) -SIMD_AS_HWINTRINSIC_ID(VectorT, ShiftRightLogical, 2, {NI_Illegal, NI_Illegal, NI_VectorT_ShiftRightLogical, NI_VectorT_ShiftRightLogical, NI_VectorT_ShiftRightLogical, NI_VectorT_ShiftRightLogical, NI_VectorT_ShiftRightLogical, NI_VectorT_ShiftRightLogical, NI_Illegal, NI_Illegal}, SimdAsHWIntrinsicFlag::None) SIMD_AS_HWINTRINSIC_NM(VectorT, Sqrt, "SquareRoot", 1, {NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_VectorT_Sqrt, NI_VectorT_Sqrt}, SimdAsHWIntrinsicFlag::None) -SIMD_AS_HWINTRINSIC_ID(VectorT, Store, 2, {NI_VectorT_Store, NI_VectorT_Store, NI_VectorT_Store, NI_VectorT_Store, NI_VectorT_Store, NI_VectorT_Store, NI_VectorT_Store, NI_VectorT_Store, NI_VectorT_Store, NI_VectorT_Store}, SimdAsHWIntrinsicFlag::SpillSideEffectsOp1) SIMD_AS_HWINTRINSIC_ID(VectorT, StoreAligned, 2, {NI_VectorT_StoreAligned, NI_VectorT_StoreAligned, NI_VectorT_StoreAligned, NI_VectorT_StoreAligned, NI_VectorT_StoreAligned, NI_VectorT_StoreAligned, NI_VectorT_StoreAligned, NI_VectorT_StoreAligned, NI_VectorT_StoreAligned, NI_VectorT_StoreAligned}, SimdAsHWIntrinsicFlag::SpillSideEffectsOp1) SIMD_AS_HWINTRINSIC_ID(VectorT, StoreAlignedNonTemporal, 2, {NI_VectorT_StoreAlignedNonTemporal, NI_VectorT_StoreAlignedNonTemporal, NI_VectorT_StoreAlignedNonTemporal, NI_VectorT_StoreAlignedNonTemporal, NI_VectorT_StoreAlignedNonTemporal, NI_VectorT_StoreAlignedNonTemporal, NI_VectorT_StoreAlignedNonTemporal, NI_VectorT_StoreAlignedNonTemporal, NI_VectorT_StoreAlignedNonTemporal, NI_VectorT_StoreAlignedNonTemporal}, SimdAsHWIntrinsicFlag::SpillSideEffectsOp1) SIMD_AS_HWINTRINSIC_ID(VectorT, StoreUnsafe, -1, {NI_VectorT_StoreUnsafe, NI_VectorT_StoreUnsafe, NI_VectorT_StoreUnsafe, NI_VectorT_StoreUnsafe, NI_VectorT_StoreUnsafe, NI_VectorT_StoreUnsafe, NI_VectorT_StoreUnsafe, NI_VectorT_StoreUnsafe, NI_VectorT_StoreUnsafe, NI_VectorT_StoreUnsafe}, SimdAsHWIntrinsicFlag::SpillSideEffectsOp1) SIMD_AS_HWINTRINSIC_NM(VectorT, StoreUnsafeIndex, "StoreUnsafe", 3, {NI_VectorT_StoreUnsafeIndex, NI_VectorT_StoreUnsafeIndex, NI_VectorT_StoreUnsafeIndex, NI_VectorT_StoreUnsafeIndex, NI_VectorT_StoreUnsafeIndex, NI_VectorT_StoreUnsafeIndex, NI_VectorT_StoreUnsafeIndex, NI_VectorT_StoreUnsafeIndex, NI_VectorT_StoreUnsafeIndex, NI_VectorT_StoreUnsafeIndex}, SimdAsHWIntrinsicFlag::SpillSideEffectsOp1) -SIMD_AS_HWINTRINSIC_ID(VectorT, Subtract, 2, {NI_VectorT_Subtract, NI_VectorT_Subtract, NI_VectorT_Subtract, NI_VectorT_Subtract, NI_VectorT_Subtract, NI_VectorT_Subtract, NI_VectorT_Subtract, NI_VectorT_Subtract, NI_VectorT_Subtract, NI_VectorT_Subtract}, SimdAsHWIntrinsicFlag::None) SIMD_AS_HWINTRINSIC_ID(VectorT, Sum, 1, {NI_Illegal, NI_Illegal, NI_VectorT_Sum, NI_VectorT_Sum, NI_VectorT_Sum, NI_VectorT_Sum, NI_Illegal, NI_Illegal, NI_VectorT_Sum, NI_VectorT_Sum}, SimdAsHWIntrinsicFlag::None) SIMD_AS_HWINTRINSIC_ID(VectorT, ToScalar, 1, {NI_VectorT_ToScalar, NI_VectorT_ToScalar, NI_VectorT_ToScalar, NI_VectorT_ToScalar, NI_VectorT_ToScalar, NI_VectorT_ToScalar, NI_VectorT_ToScalar, NI_VectorT_ToScalar, NI_VectorT_ToScalar, NI_VectorT_ToScalar}, SimdAsHWIntrinsicFlag::None) SIMD_AS_HWINTRINSIC_ID(VectorT, WidenLower, 1, {NI_VectorT_WidenLower, NI_VectorT_WidenLower, NI_VectorT_WidenLower, NI_VectorT_WidenLower, NI_VectorT_WidenLower, NI_VectorT_WidenLower, NI_VectorT_WidenLower, NI_VectorT_WidenLower, NI_VectorT_WidenLower, NI_VectorT_WidenLower}, SimdAsHWIntrinsicFlag::None) SIMD_AS_HWINTRINSIC_ID(VectorT, WidenUpper, 1, {NI_VectorT_WidenUpper, NI_VectorT_WidenUpper, NI_VectorT_WidenUpper, NI_VectorT_WidenUpper, NI_VectorT_WidenUpper, NI_VectorT_WidenUpper, NI_VectorT_WidenUpper, NI_VectorT_WidenUpper, NI_VectorT_WidenUpper, NI_VectorT_WidenUpper}, SimdAsHWIntrinsicFlag::None) SIMD_AS_HWINTRINSIC_ID(VectorT, WithElement, 3, {NI_VectorT_WithElement, NI_VectorT_WithElement, NI_VectorT_WithElement, NI_VectorT_WithElement, NI_VectorT_WithElement, NI_VectorT_WithElement, NI_VectorT_WithElement, NI_VectorT_WithElement, NI_VectorT_WithElement, NI_VectorT_WithElement}, SimdAsHWIntrinsicFlag::None) -SIMD_AS_HWINTRINSIC_ID(VectorT, Xor, 2, {NI_VectorT_Xor, NI_VectorT_Xor, NI_VectorT_Xor, NI_VectorT_Xor, NI_VectorT_Xor, NI_VectorT_Xor, NI_VectorT_Xor, NI_VectorT_Xor, NI_VectorT_Xor, NI_VectorT_Xor}, SimdAsHWIntrinsicFlag::None) #undef SIMD_AS_HWINTRINSIC_NM #undef SIMD_AS_HWINTRINSIC_ID diff --git a/src/libraries/System.Private.CoreLib/src/System/Numerics/Plane.cs b/src/libraries/System.Private.CoreLib/src/System/Numerics/Plane.cs index 367fcce66314af..5df3be211aa2f4 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Numerics/Plane.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Numerics/Plane.cs @@ -104,49 +104,19 @@ public static Plane CreateFromVertices(Vector3 point1, Vector3 point2, Vector3 p /// The four-dimensional vector. /// The dot product. [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static float Dot(Plane plane, Vector4 value) - { - return Vector128.Dot(plane.AsVector128(), value.AsVector128()); - } + public static float Dot(Plane plane, Vector4 value) => Vector128.Dot(plane.AsVector128(), value.AsVector128()); /// Returns the dot product of a specified three-dimensional vector and the normal vector of this plane plus the distance () value of the plane. /// The plane. /// The 3-dimensional vector. /// The dot product. - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static float DotCoordinate(Plane plane, Vector3 value) - { - if (Vector128.IsHardwareAccelerated) - { - return Vector3.Dot(plane.Normal, value) + plane.D; - } - else - { - return plane.Normal.X * value.X + - plane.Normal.Y * value.Y + - plane.Normal.Z * value.Z + - plane.D; - } - } + public static float DotCoordinate(Plane plane, Vector3 value) => Vector3.Dot(plane.Normal, value) + plane.D; /// Returns the dot product of a specified three-dimensional vector and the vector of this plane. /// The plane. /// The three-dimensional vector. /// The dot product. - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static float DotNormal(Plane plane, Vector3 value) - { - if (Vector128.IsHardwareAccelerated) - { - return Vector3.Dot(plane.Normal, value); - } - else - { - return plane.Normal.X * value.X + - plane.Normal.Y * value.Y + - plane.Normal.Z * value.Z; - } - } + public static float DotNormal(Plane plane, Vector3 value) => Vector3.Dot(plane.Normal, value); /// Creates a new object whose normal vector is the source plane's normal vector normalized. /// The source plane. @@ -154,36 +124,15 @@ public static float DotNormal(Plane plane, Vector3 value) [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Plane Normalize(Plane value) { - if (Vector128.IsHardwareAccelerated) + float normalLengthSquared = value.Normal.LengthSquared(); + + if (MathF.Abs(normalLengthSquared - 1.0f) < NormalizeEpsilon) { - float normalLengthSquared = value.Normal.LengthSquared(); - if (MathF.Abs(normalLengthSquared - 1.0f) < NormalizeEpsilon) - { - // It already normalized, so we don't need to farther process. - return value; - } - float normalLength = MathF.Sqrt(normalLengthSquared); - return new Plane( - value.Normal / normalLength, - value.D / normalLength); + // It already normalized, so we don't need to farther process. + return value; } - else - { - float f = value.Normal.X * value.Normal.X + value.Normal.Y * value.Normal.Y + value.Normal.Z * value.Normal.Z; - if (MathF.Abs(f - 1.0f) < NormalizeEpsilon) - { - return value; // It already normalized, so we don't need to further process. - } - - float fInv = 1.0f / MathF.Sqrt(f); - - return new Plane( - value.Normal.X * fInv, - value.Normal.Y * fInv, - value.Normal.Z * fInv, - value.D * fInv); - } + return (value.AsVector128() / MathF.Sqrt(normalLengthSquared)).AsPlane(); } /// Transforms a normalized plane by a 4x4 matrix. @@ -256,62 +205,31 @@ public static Plane Transform(Plane plane, Quaternion rotation) /// Two objects are equal if their and fields are equal. /// The method defines the operation of the equality operator for objects. [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static bool operator ==(Plane value1, Plane value2) - { - return value1.AsVector128() == value2.AsVector128(); - } + public static bool operator ==(Plane value1, Plane value2) => value1.AsVector128() == value2.AsVector128(); /// Returns a value that indicates whether two planes are not equal. /// The first plane to compare. /// The second plane to compare. /// if and are not equal; otherwise, . /// The method defines the operation of the inequality operator for objects. - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static bool operator !=(Plane value1, Plane value2) - { - return !(value1 == value2); - } + public static bool operator !=(Plane value1, Plane value2) => !(value1 == value2); /// Returns a value that indicates whether this instance and a specified object are equal. /// The object to compare with the current instance. /// if the current instance and are equal; otherwise, . If is , the method returns . /// The current instance and are equal if is a object and their and fields are equal. - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public override readonly bool Equals([NotNullWhen(true)] object? obj) - { - return (obj is Plane other) && Equals(other); - } + public override readonly bool Equals([NotNullWhen(true)] object? obj) => (obj is Plane other) && Equals(other); /// Returns a value that indicates whether this instance and another plane object are equal. /// The other plane. /// if the two planes are equal; otherwise, . /// Two objects are equal if their and fields are equal. [MethodImpl(MethodImplOptions.AggressiveInlining)] - public readonly bool Equals(Plane other) - { - // This function needs to account for floating-point equality around NaN - // and so must behave equivalently to the underlying float/double.Equals - - if (Vector128.IsHardwareAccelerated) - { - return this.AsVector128().Equals(other.AsVector128()); - } - - return SoftwareFallback(in this, other); - - static bool SoftwareFallback(in Plane self, Plane other) - { - return self.Normal.Equals(other.Normal) - && self.D.Equals(other.D); - } - } + public readonly bool Equals(Plane other) => this.AsVector128().Equals(other.AsVector128()); /// Returns the hash code for this instance. /// The hash code. - public override readonly int GetHashCode() - { - return HashCode.Combine(Normal, D); - } + public override readonly int GetHashCode() => HashCode.Combine(Normal, D); /// Returns the string representation of this plane object. /// A string that represents this object. diff --git a/src/libraries/System.Private.CoreLib/src/System/Numerics/Quaternion.cs b/src/libraries/System.Private.CoreLib/src/System/Numerics/Quaternion.cs index d4bea111c1ba41..c575c800db18ff 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Numerics/Quaternion.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Numerics/Quaternion.cs @@ -50,17 +50,11 @@ public Quaternion(Vector3 vectorPart, float scalarPart) /// Gets a quaternion that represents a zero. /// A quaternion whose values are (0, 0, 0, 0). - public static Quaternion Zero - { - get => default; - } + public static Quaternion Zero => default; /// Gets a quaternion that represents no rotation. /// A quaternion whose values are (0, 0, 0, 1). - public static Quaternion Identity - { - get => new Quaternion(0.0f, 0.0f, 0.0f, 1.0f); - } + public static Quaternion Identity => new Quaternion(0.0f, 0.0f, 0.0f, 1.0f); /// Gets or sets the element at the specified index. /// The index of the element to get or set. @@ -68,20 +62,15 @@ public static Quaternion Identity /// was less than zero or greater than the number of elements. public float this[int index] { - [MethodImpl(MethodImplOptions.AggressiveInlining)] readonly get => this.GetElement(index); - [MethodImpl(MethodImplOptions.AggressiveInlining)] set => this = this.WithElement(index, value); } /// Gets a value that indicates whether the current instance is the identity quaternion. /// if the current instance is the identity quaternion; otherwise, . /// - public readonly bool IsIdentity - { - get => this == Identity; - } + public readonly bool IsIdentity => this == Identity; /// Adds each element in one quaternion with its corresponding element in a second quaternion. /// The first quaternion. @@ -89,10 +78,7 @@ public readonly bool IsIdentity /// The quaternion that contains the summed values of and . /// The method defines the operation of the addition operator for objects. [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static Quaternion operator +(Quaternion value1, Quaternion value2) - { - return (value1.AsVector128() + value2.AsVector128()).AsQuaternion(); - } + public static Quaternion operator +(Quaternion value1, Quaternion value2) => (value1.AsVector128() + value2.AsVector128()).AsQuaternion(); /// Divides one quaternion by a second quaternion. /// The dividend. @@ -144,20 +130,13 @@ public readonly bool IsIdentity /// Two quaternions are equal if each of their corresponding components is equal. /// The method defines the operation of the equality operator for objects. [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static bool operator ==(Quaternion value1, Quaternion value2) - { - return value1.AsVector128() == value2.AsVector128(); - } + public static bool operator ==(Quaternion value1, Quaternion value2) => value1.AsVector128() == value2.AsVector128(); /// Returns a value that indicates whether two quaternions are not equal. /// The first quaternion to compare. /// The second quaternion to compare. /// if and are not equal; otherwise, . - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static bool operator !=(Quaternion value1, Quaternion value2) - { - return !(value1 == value2); - } + public static bool operator !=(Quaternion value1, Quaternion value2) => !(value1 == value2); /// Returns the quaternion that results from multiplying two quaternions together. /// The first quaternion. @@ -213,10 +192,7 @@ public readonly bool IsIdentity /// The scaled quaternion. /// The method defines the operation of the multiplication operator for objects. [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static Quaternion operator *(Quaternion value1, float value2) - { - return (value1.AsVector128() * value2).AsQuaternion(); - } + public static Quaternion operator *(Quaternion value1, float value2) => (value1.AsVector128() * value2).AsQuaternion(); /// Subtracts each element in a second quaternion from its corresponding element in a first quaternion. /// The first quaternion. @@ -224,30 +200,20 @@ public readonly bool IsIdentity /// The quaternion containing the values that result from subtracting each element in from its corresponding element in . /// The method defines the operation of the subtraction operator for objects. [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static Quaternion operator -(Quaternion value1, Quaternion value2) - { - return (value1.AsVector128() - value2.AsVector128()).AsQuaternion(); - } + public static Quaternion operator -(Quaternion value1, Quaternion value2) => (value1.AsVector128() - value2.AsVector128()).AsQuaternion(); /// Reverses the sign of each component of the quaternion. /// The quaternion to negate. /// The negated quaternion. /// The method defines the operation of the unary negation operator for objects. [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static Quaternion operator -(Quaternion value) - { - return (-value.AsVector128()).AsQuaternion(); - } + public static Quaternion operator -(Quaternion value) => (-value.AsVector128()).AsQuaternion(); /// Adds each element in one quaternion with its corresponding element in a second quaternion. /// The first quaternion. /// The second quaternion. /// The quaternion that contains the summed values of and . - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static Quaternion Add(Quaternion value1, Quaternion value2) - { - return value1 + value2; - } + public static Quaternion Add(Quaternion value1, Quaternion value2) => value1 + value2; /// Concatenates two quaternions. /// The first quaternion rotation in the series. @@ -288,10 +254,7 @@ public static Quaternion Concatenate(Quaternion value1, Quaternion value2) /// The quaternion. /// A new quaternion that is the conjugate of . [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static Quaternion Conjugate(Quaternion value) - { - return (value.AsVector128() * Vector128.Create(-1.0f, -1.0f, -1.0f, 1.0f)).AsQuaternion(); - } + public static Quaternion Conjugate(Quaternion value) => (value.AsVector128() * Vector128.Create(-1.0f, -1.0f, -1.0f, 1.0f)).AsQuaternion(); /// Creates a quaternion from a unit vector and an angle to rotate around the vector. /// The unit vector to rotate around. @@ -403,21 +366,14 @@ public static Quaternion CreateFromYawPitchRoll(float yaw, float pitch, float ro /// The dividend. /// The divisor. /// The quaternion that results from dividing by . - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static Quaternion Divide(Quaternion value1, Quaternion value2) - { - return value1 / value2; - } + public static Quaternion Divide(Quaternion value1, Quaternion value2) => value1 / value2; /// Calculates the dot product of two quaternions. /// The first quaternion. /// The second quaternion. /// The dot product. [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static float Dot(Quaternion quaternion1, Quaternion quaternion2) - { - return Vector128.Dot(quaternion1.AsVector128(), quaternion2.AsVector128()); - } + public static float Dot(Quaternion quaternion1, Quaternion quaternion2) => Vector128.Dot(quaternion1.AsVector128(), quaternion2.AsVector128()); /// Returns the inverse of a quaternion. /// The quaternion. @@ -478,39 +434,24 @@ public static Quaternion Lerp(Quaternion quaternion1, Quaternion quaternion2, fl /// The first quaternion. /// The second quaternion. /// The product quaternion. - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static Quaternion Multiply(Quaternion value1, Quaternion value2) - { - return value1 * value2; - } + public static Quaternion Multiply(Quaternion value1, Quaternion value2) => value1 * value2; /// Returns the quaternion that results from scaling all the components of a specified quaternion by a scalar factor. /// The source quaternion. /// The scalar value. /// The scaled quaternion. - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static Quaternion Multiply(Quaternion value1, float value2) - { - return value1 * value2; - } + public static Quaternion Multiply(Quaternion value1, float value2) => value1 * value2; /// Reverses the sign of each component of the quaternion. /// The quaternion to negate. /// The negated quaternion. - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static Quaternion Negate(Quaternion value) - { - return -value; - } + public static Quaternion Negate(Quaternion value) => -value; /// Divides each component of a specified by its length. /// The quaternion to normalize. /// The normalized quaternion. [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static Quaternion Normalize(Quaternion value) - { - return (value.AsVector128() / value.Length()).AsQuaternion(); - } + public static Quaternion Normalize(Quaternion value) => (value.AsVector128() / value.Length()).AsQuaternion(); /// Interpolates between two quaternions, using spherical linear interpolation. /// The first quaternion. @@ -565,58 +506,36 @@ public static Quaternion Slerp(Quaternion quaternion1, Quaternion quaternion2, f /// The first quaternion. /// The second quaternion. /// The quaternion containing the values that result from subtracting each element in from its corresponding element in . - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static Quaternion Subtract(Quaternion value1, Quaternion value2) - { - return value1 - value2; - } + public static Quaternion Subtract(Quaternion value1, Quaternion value2) => value1 - value2; /// Returns a value that indicates whether this instance and a specified object are equal. /// The object to compare with the current instance. /// if the current instance and are equal; otherwise, . If is , the method returns . /// The current instance and are equal if is a object and the corresponding components of each matrix are equal. - public override readonly bool Equals([NotNullWhen(true)] object? obj) - { - return (obj is Quaternion other) && Equals(other); - } + public override readonly bool Equals([NotNullWhen(true)] object? obj) => (obj is Quaternion other) && Equals(other); /// Returns a value that indicates whether this instance and another quaternion are equal. /// The other quaternion. /// if the two quaternions are equal; otherwise, . /// Two quaternions are equal if each of their corresponding components is equal. [MethodImpl(MethodImplOptions.AggressiveInlining)] - public readonly bool Equals(Quaternion other) - { - return this.AsVector128().Equals(other.AsVector128()); - } + public readonly bool Equals(Quaternion other) => this.AsVector128().Equals(other.AsVector128()); /// Returns the hash code for this instance. /// The hash code. - public override readonly int GetHashCode() - { - return HashCode.Combine(X, Y, Z, W); - } + public override readonly int GetHashCode() => HashCode.Combine(X, Y, Z, W); /// Calculates the length of the quaternion. /// The computed length of the quaternion. - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public readonly float Length() - { - return MathF.Sqrt(LengthSquared()); - } + public readonly float Length() => MathF.Sqrt(LengthSquared()); /// Calculates the squared length of the quaternion. /// The length squared of the quaternion. - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public readonly float LengthSquared() - { - return Dot(this, this); - } + public readonly float LengthSquared() => Dot(this, this); /// Returns a string that represents this quaternion. /// The string representation of this quaternion. /// The numeric values in the returned string are formatted by using the conventions of the current culture. For example, for the en-US culture, the returned string might appear as {X:1.1 Y:2.2 Z:3.3 W:4.4}. - public override readonly string ToString() => - $"{{X:{X} Y:{Y} Z:{Z} W:{W}}}"; + public override readonly string ToString() => $"{{X:{X} Y:{Y} Z:{Z} W:{W}}}"; } } diff --git a/src/libraries/System.Private.CoreLib/src/System/Numerics/Vector.cs b/src/libraries/System.Private.CoreLib/src/System/Numerics/Vector.cs index 8a5961bb314b0f..7a47929fa623c4 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Numerics/Vector.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Numerics/Vector.cs @@ -5,6 +5,7 @@ using System.Runtime.CompilerServices; using System.Runtime.Intrinsics; using System.Runtime.Intrinsics.X86; +using static Interop; namespace System.Numerics { @@ -58,8 +59,6 @@ public static Vector Abs(Vector value) /// The vector to add with . /// The type of the elements in the vector. /// The sum of and . - [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector Add(Vector left, Vector right) => left + right; /// Computes the bitwise-and of a given vector and the ones complement of another vector. @@ -68,7 +67,6 @@ public static Vector Abs(Vector value) /// The type of the elements in the vector. /// The bitwise-and of and the ones-complement of . [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector AndNot(Vector left, Vector right) => left & ~right; /// Reinterprets a as a new . @@ -77,14 +75,13 @@ public static Vector Abs(Vector value) /// The vector to reinterpret. /// reinterpreted as a new . /// The type of () or the type of the target () is not supported. - [Intrinsic] [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector As(this Vector vector) { ThrowHelper.ThrowForUnsupportedNumericsVectorBaseType(); ThrowHelper.ThrowForUnsupportedNumericsVectorBaseType(); - return Unsafe.As, Vector>(ref vector); + return Unsafe.BitCast, Vector>(vector); } /// Reinterprets a as a new . @@ -92,8 +89,6 @@ public static Vector As(this Vector vector) /// The vector to reinterpret. /// reinterpreted as a new . /// The type of () is not supported. - [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector AsVectorByte(Vector value) => value.As(); /// Reinterprets a as a new . @@ -101,8 +96,6 @@ public static Vector As(this Vector vector) /// The vector to reinterpret. /// reinterpreted as a new . /// The type of () is not supported. - [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector AsVectorDouble(Vector value) => value.As(); /// Reinterprets a as a new . @@ -110,8 +103,6 @@ public static Vector As(this Vector vector) /// The vector to reinterpret. /// reinterpreted as a new . /// The type of () is not supported. - [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector AsVectorInt16(Vector value) => value.As(); /// Reinterprets a as a new . @@ -119,8 +110,6 @@ public static Vector As(this Vector vector) /// The vector to reinterpret. /// reinterpreted as a new . /// The type of () is not supported. - [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector AsVectorInt32(Vector value) => value.As(); /// Reinterprets a as a new . @@ -128,8 +117,6 @@ public static Vector As(this Vector vector) /// The vector to reinterpret. /// reinterpreted as a new . /// The type of () is not supported. - [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector AsVectorInt64(Vector value) => value.As(); /// Reinterprets a as a new . @@ -137,8 +124,6 @@ public static Vector As(this Vector vector) /// The vector to reinterpret. /// reinterpreted as a new . /// The type of () is not supported. - [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector AsVectorNInt(Vector value) => value.As(); /// Reinterprets a as a new . @@ -146,9 +131,7 @@ public static Vector As(this Vector vector) /// The vector to reinterpret. /// reinterpreted as a new . /// The type of () is not supported. - [Intrinsic] [CLSCompliant(false)] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector AsVectorNUInt(Vector value) => value.As(); /// Reinterprets a as a new . @@ -156,9 +139,7 @@ public static Vector As(this Vector vector) /// The vector to reinterpret. /// reinterpreted as a new . /// The type of () is not supported. - [Intrinsic] [CLSCompliant(false)] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector AsVectorSByte(Vector value) => value.As(); /// Reinterprets a as a new . @@ -166,8 +147,6 @@ public static Vector As(this Vector vector) /// The vector to reinterpret. /// reinterpreted as a new . /// The type of () is not supported. - [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector AsVectorSingle(Vector value) => value.As(); /// Reinterprets a as a new . @@ -175,9 +154,7 @@ public static Vector As(this Vector vector) /// The vector to reinterpret. /// reinterpreted as a new . /// The type of () is not supported. - [Intrinsic] [CLSCompliant(false)] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector AsVectorUInt16(Vector value) => value.As(); /// Reinterprets a as a new . @@ -185,9 +162,7 @@ public static Vector As(this Vector vector) /// The vector to reinterpret. /// reinterpreted as a new . /// The type of () is not supported. - [Intrinsic] [CLSCompliant(false)] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector AsVectorUInt32(Vector value) => value.As(); /// Reinterprets a as a new . @@ -195,9 +170,7 @@ public static Vector As(this Vector vector) /// The vector to reinterpret. /// reinterpreted as a new . /// The type of () is not supported. - [Intrinsic] [CLSCompliant(false)] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector AsVectorUInt64(Vector value) => value.As(); /// Computes the bitwise-and of two vectors. @@ -205,8 +178,6 @@ public static Vector As(this Vector vector) /// The vector to bitwise-and with . /// The type of the elements in the vector. /// The bitwise-and of and . - [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector BitwiseAnd(Vector left, Vector right) => left & right; /// Computes the bitwise-or of two vectors. @@ -214,8 +185,6 @@ public static Vector As(this Vector vector) /// The vector to bitwise-or with . /// The type of the elements in the vector. /// The bitwise-or of and . - [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector BitwiseOr(Vector left, Vector right) => left | right; /// Computes the ceiling of each element in a vector. @@ -272,9 +241,7 @@ public static Vector Ceiling(Vector value) /// The vector that is selected when the corresponding bit in is zero. /// A vector whose bits come from or based on the value of . [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static Vector ConditionalSelect(Vector condition, Vector left, Vector right) - => ConditionalSelect(condition.As(), left, right); + public static Vector ConditionalSelect(Vector condition, Vector left, Vector right) => ConditionalSelect(condition.As(), left, right); /// Conditionally selects a value from two vectors on a bitwise basis. /// The mask that is used to select a value from or . @@ -282,9 +249,7 @@ public static Vector ConditionalSelect(Vector condition, VectorThe vector that is selected when the corresponding bit in is zero. /// A vector whose bits come from or based on the value of . [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static Vector ConditionalSelect(Vector condition, Vector left, Vector right) - => ConditionalSelect(condition.As(), left, right); + public static Vector ConditionalSelect(Vector condition, Vector left, Vector right) => ConditionalSelect(condition.As(), left, right); /// Converts a to a . /// The vector to convert. @@ -516,8 +481,6 @@ public static Vector ConvertToUInt64Native(Vector value) /// The vector that will divide . /// The type of the elements in the vector. /// The quotient of divided by . - [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector Divide(Vector left, Vector right) => left / right; /// Divides a vector by a scalar to compute the per-element quotient. @@ -525,8 +488,6 @@ public static Vector ConvertToUInt64Native(Vector value) /// The scalar that will divide . /// The type of the elements in the vector. /// The quotient of divided by . - [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector Divide(Vector left, T right) => left / right; /// Computes the dot product of two vectors. @@ -534,20 +495,7 @@ public static Vector ConvertToUInt64Native(Vector value) /// The vector that will be dotted with . /// The type of the elements in the vector. /// The dot product of and . - [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static T Dot(Vector left, Vector right) - { - T result = default!; - - for (int index = 0; index < Vector.Count; index++) - { - T value = Scalar.Multiply(left.GetElementUnsafe(index), right.GetElementUnsafe(index)); - result = Scalar.Add(result, value); - } - - return result; - } + public static T Dot(Vector left, Vector right) => Sum(left * right); /// Compares two vectors to determine if they are equal on a per-element basis. /// The vector to compare with . @@ -574,7 +522,6 @@ public static Vector Equals(Vector left, Vector right) /// The vector to compare with . /// A vector whose elements are all-bits-set or zero, depending on if the corresponding elements in and were equal. [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector Equals(Vector left, Vector right) => Equals(left, right).As(); /// Compares two vectors to determine if they are equal on a per-element basis. @@ -582,7 +529,6 @@ public static Vector Equals(Vector left, Vector right) /// The vector to compare with . /// A vector whose elements are all-bits-set or zero, depending on if the corresponding elements in and were equal. [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector Equals(Vector left, Vector right) => Equals(left, right); /// Compares two vectors to determine if they are equal on a per-element basis. @@ -590,7 +536,6 @@ public static Vector Equals(Vector left, Vector right) /// The vector to compare with . /// A vector whose elements are all-bits-set or zero, depending on if the corresponding elements in and were equal. [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector Equals(Vector left, Vector right) => Equals(left, right); /// Compares two vectors to determine if they are equal on a per-element basis. @@ -598,7 +543,6 @@ public static Vector Equals(Vector left, Vector right) /// The vector to compare with . /// A vector whose elements are all-bits-set or zero, depending on if the corresponding elements in and were equal. [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector Equals(Vector left, Vector right) => Equals(left, right).As(); /// Compares two vectors to determine if all elements are equal. @@ -606,8 +550,6 @@ public static Vector Equals(Vector left, Vector right) /// The vector to compare with . /// The type of the elements in the vector. /// true if all elements in were equal to the corresponding element in . - [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static bool EqualsAll(Vector left, Vector right) => left == right; /// Compares two vectors to determine if any elements are equal. @@ -712,7 +654,6 @@ public static Vector GreaterThan(Vector left, Vector right) /// The vector to compare with . /// A vector whose elements are all-bits-set or zero, depending on if which of the corresponding elements in and were greater. [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector GreaterThan(Vector left, Vector right) => GreaterThan(left, right).As(); /// Compares two vectors to determine which is greater on a per-element basis. @@ -720,14 +661,12 @@ public static Vector GreaterThan(Vector left, Vector right) /// The vector to compare with . /// A vector whose elements are all-bits-set or zero, depending on if which of the corresponding elements in and were greater. [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector GreaterThan(Vector left, Vector right) => GreaterThan(left, right); /// Compares two vectors to determine which is greater on a per-element basis. /// The vector to compare with . /// The vector to compare with . /// A vector whose elements are all-bits-set or zero, depending on if which of the corresponding elements in and were greater. - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector GreaterThan(Vector left, Vector right) => GreaterThan(left, right); /// Compares two vectors to determine which is greater on a per-element basis. @@ -735,7 +674,6 @@ public static Vector GreaterThan(Vector left, Vector right) /// The vector to compare with . /// A vector whose elements are all-bits-set or zero, depending on if which of the corresponding elements in and were greater. [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector GreaterThan(Vector left, Vector right) => GreaterThan(left, right).As(); /// Compares two vectors to determine if all elements are greater. @@ -803,7 +741,6 @@ public static Vector GreaterThanOrEqual(Vector left, Vector right) /// The vector to compare with . /// A vector whose elements are all-bits-set or zero, depending on if which of the corresponding elements in and were greater or equal. [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector GreaterThanOrEqual(Vector left, Vector right) => GreaterThanOrEqual(left, right).As(); /// Compares two vectors to determine which is greater or equal on a per-element basis. @@ -811,7 +748,6 @@ public static Vector GreaterThanOrEqual(Vector left, Vector right) /// The vector to compare with . /// A vector whose elements are all-bits-set or zero, depending on if which of the corresponding elements in and were greater or equal. [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector GreaterThanOrEqual(Vector left, Vector right) => GreaterThanOrEqual(left, right); /// Compares two vectors to determine which is greater or equal on a per-element basis. @@ -819,7 +755,6 @@ public static Vector GreaterThanOrEqual(Vector left, Vector right) /// The vector to compare with . /// A vector whose elements are all-bits-set or zero, depending on if which of the corresponding elements in and were greater or equal. [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector GreaterThanOrEqual(Vector left, Vector right) => GreaterThanOrEqual(left, right); /// Compares two vectors to determine which is greater or equal on a per-element basis. @@ -827,7 +762,6 @@ public static Vector GreaterThanOrEqual(Vector left, Vector right) /// The vector to compare with . /// A vector whose elements are all-bits-set or zero, depending on if which of the corresponding elements in and were greater or equal. [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector GreaterThanOrEqual(Vector left, Vector right) => GreaterThanOrEqual(left, right).As(); /// Compares two vectors to determine if all elements are greater or equal. @@ -895,7 +829,6 @@ public static Vector LessThan(Vector left, Vector right) /// The vector to compare with . /// A vector whose elements are all-bits-set or zero, depending on if which of the corresponding elements in and were less. [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector LessThan(Vector left, Vector right) => LessThan(left, right).As(); /// Compares two vectors to determine which is less on a per-element basis. @@ -903,7 +836,6 @@ public static Vector LessThan(Vector left, Vector right) /// The vector to compare with . /// A vector whose elements are all-bits-set or zero, depending on if which of the corresponding elements in and were less. [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector LessThan(Vector left, Vector right) => LessThan(left, right); /// Compares two vectors to determine which is less on a per-element basis. @@ -911,7 +843,6 @@ public static Vector LessThan(Vector left, Vector right) /// The vector to compare with . /// A vector whose elements are all-bits-set or zero, depending on if which of the corresponding elements in and were less. [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector LessThan(Vector left, Vector right) => LessThan(left, right); /// Compares two vectors to determine which is less on a per-element basis. @@ -919,7 +850,6 @@ public static Vector LessThan(Vector left, Vector right) /// The vector to compare with . /// A vector whose elements are all-bits-set or zero, depending on if which of the corresponding elements in and were less. [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector LessThan(Vector left, Vector right) => LessThan(left, right).As(); /// Compares two vectors to determine if all elements are less. @@ -987,7 +917,6 @@ public static Vector LessThanOrEqual(Vector left, Vector right) /// The vector to compare with . /// A vector whose elements are all-bits-set or zero, depending on if which of the corresponding elements in and were less or equal. [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector LessThanOrEqual(Vector left, Vector right) => LessThanOrEqual(left, right).As(); /// Compares two vectors to determine which is less or equal on a per-element basis. @@ -995,7 +924,6 @@ public static Vector LessThanOrEqual(Vector left, Vector right) /// The vector to compare with . /// A vector whose elements are all-bits-set or zero, depending on if which of the corresponding elements in and were less or equal. [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector LessThanOrEqual(Vector left, Vector right) => LessThanOrEqual(left, right); /// Compares two vectors to determine which is less or equal on a per-element basis. @@ -1003,7 +931,6 @@ public static Vector LessThanOrEqual(Vector left, Vector right) /// The vector to compare with . /// A vector whose elements are all-bits-set or zero, depending on if which of the corresponding elements in and were less or equal. [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector LessThanOrEqual(Vector left, Vector right) => LessThanOrEqual(left, right); /// Compares two vectors to determine which is less or equal on a per-element basis. @@ -1011,7 +938,6 @@ public static Vector LessThanOrEqual(Vector left, Vector right) /// The vector to compare with . /// A vector whose elements are all-bits-set or zero, depending on if which of the corresponding elements in and were less or equal. [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector LessThanOrEqual(Vector left, Vector right) => LessThanOrEqual(left, right).As(); /// Compares two vectors to determine if all elements are less or equal. @@ -1060,9 +986,7 @@ public static bool LessThanOrEqualAny(Vector left, Vector right) /// The source from which the vector will be loaded. /// The vector loaded from . /// The type of () is not supported. - [Intrinsic] [CLSCompliant(false)] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector Load(T* source) => LoadUnsafe(ref *source); /// Loads a vector from the given aligned source. @@ -1093,7 +1017,6 @@ public static Vector LoadAligned(T* source) /// The type of () is not supported. [Intrinsic] [CLSCompliant(false)] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector LoadAlignedNonTemporal(T* source) => LoadAligned(source); #pragma warning restore CS8500 // This takes the address of, gets the size of, or declares a pointer to a managed type ('T') @@ -1172,8 +1095,6 @@ public static Vector Min(Vector left, Vector right) /// The vector to multiply with . /// The type of the elements in the vector. /// The element-wise product of and . - [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector Multiply(Vector left, Vector right) => left * right; /// Multiplies a vector by a scalar to compute their product. @@ -1181,8 +1102,6 @@ public static Vector Min(Vector left, Vector right) /// The scalar to multiply with . /// The type of the elements in the vector. /// The product of and . - [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector Multiply(Vector left, T right) => left * right; /// Multiplies a vector by a scalar to compute their product. @@ -1190,8 +1109,6 @@ public static Vector Min(Vector left, Vector right) /// The vector to multiply with . /// The type of the elements in the vector. /// The product of and . - [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector Multiply(T left, Vector right) => left * right; /// Narrows two instances into one . @@ -1377,227 +1294,173 @@ public static Vector Narrow(Vector low, Vector high) /// The vector to negate. /// The type of the elements in the vector. /// A vector whose elements are the unary negation of the corresponding elements in . - [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector Negate(Vector value) => -value; /// Computes the ones-complement of a vector. /// The vector whose ones-complement is to be computed. /// The type of the elements in the vector. /// A vector whose elements are the ones-complement of the corresponding elements in . - [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector OnesComplement(Vector value) => ~value; /// Shifts each element of a vector left by the specified amount. /// The vector whose elements are to be shifted. /// The number of bits by which to shift each element. /// A vector whose elements where shifted left by . - [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector ShiftLeft(Vector value, int shiftCount) => value << shiftCount; /// Shifts each element of a vector left by the specified amount. /// The vector whose elements are to be shifted. /// The number of bits by which to shift each element. /// A vector whose elements where shifted left by . - [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector ShiftLeft(Vector value, int shiftCount) => value << shiftCount; /// Shifts each element of a vector left by the specified amount. /// The vector whose elements are to be shifted. /// The number of bits by which to shift each element. /// A vector whose elements where shifted left by . - [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector ShiftLeft(Vector value, int shiftCount) => value << shiftCount; /// Shifts each element of a vector left by the specified amount. /// The vector whose elements are to be shifted. /// The number of bits by which to shift each element. /// A vector whose elements where shifted left by . - [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector ShiftLeft(Vector value, int shiftCount) => value << shiftCount; /// Shifts each element of a vector left by the specified amount. /// The vector whose elements are to be shifted. /// The number of bits by which to shift each element. /// A vector whose elements where shifted left by . - [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector ShiftLeft(Vector value, int shiftCount) => value << shiftCount; /// Shifts each element of a vector left by the specified amount. /// The vector whose elements are to be shifted. /// The number of bits by which to shift each element. /// A vector whose elements where shifted left by . - [Intrinsic] [CLSCompliant(false)] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector ShiftLeft(Vector value, int shiftCount) => value << shiftCount; /// Shifts each element of a vector left by the specified amount. /// The vector whose elements are to be shifted. /// The number of bits by which to shift each element. /// A vector whose elements where shifted left by . - [Intrinsic] [CLSCompliant(false)] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector ShiftLeft(Vector value, int shiftCount) => value << shiftCount; /// Shifts each element of a vector left by the specified amount. /// The vector whose elements are to be shifted. /// The number of bits by which to shift each element. /// A vector whose elements where shifted left by . - [Intrinsic] [CLSCompliant(false)] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector ShiftLeft(Vector value, int shiftCount) => value << shiftCount; /// Shifts each element of a vector left by the specified amount. /// The vector whose elements are to be shifted. /// The number of bits by which to shift each element. /// A vector whose elements where shifted left by . - [Intrinsic] [CLSCompliant(false)] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector ShiftLeft(Vector value, int shiftCount) => value << shiftCount; /// Shifts each element of a vector left by the specified amount. /// The vector whose elements are to be shifted. /// The number of bits by which to shift each element. /// A vector whose elements where shifted left by . - [Intrinsic] [CLSCompliant(false)] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector ShiftLeft(Vector value, int shiftCount) => value << shiftCount; /// Shifts (signed) each element of a vector right by the specified amount. /// The vector whose elements are to be shifted. /// The number of bits by which to shift each element. /// A vector whose elements where shifted right by . - [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector ShiftRightArithmetic(Vector value, int shiftCount) => value >> shiftCount; /// Shifts (signed) each element of a vector right by the specified amount. /// The vector whose elements are to be shifted. /// The number of bits by which to shift each element. /// A vector whose elements where shifted right by . - [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector ShiftRightArithmetic(Vector value, int shiftCount) => value >> shiftCount; /// Shifts (signed) each element of a vector right by the specified amount. /// The vector whose elements are to be shifted. /// The number of bits by which to shift each element. /// A vector whose elements where shifted right by . - [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector ShiftRightArithmetic(Vector value, int shiftCount) => value >> shiftCount; /// Shifts (signed) each element of a vector right by the specified amount. /// The vector whose elements are to be shifted. /// The number of bits by which to shift each element. /// A vector whose elements where shifted right by . - [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector ShiftRightArithmetic(Vector value, int shiftCount) => value >> shiftCount; /// Shifts (signed) each element of a vector right by the specified amount. /// The vector whose elements are to be shifted. /// The number of bits by which to shift each element. /// A vector whose elements where shifted right by . - [Intrinsic] [CLSCompliant(false)] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector ShiftRightArithmetic(Vector value, int shiftCount) => value >> shiftCount; /// Shifts (unsigned) each element of a vector right by the specified amount. /// The vector whose elements are to be shifted. /// The number of bits by which to shift each element. /// A vector whose elements where shifted right by . - [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector ShiftRightLogical(Vector value, int shiftCount) => value >>> shiftCount; /// Shifts (unsigned) each element of a vector right by the specified amount. /// The vector whose elements are to be shifted. /// The number of bits by which to shift each element. /// A vector whose elements where shifted right by . - [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector ShiftRightLogical(Vector value, int shiftCount) => value >>> shiftCount; /// Shifts (unsigned) each element of a vector right by the specified amount. /// The vector whose elements are to be shifted. /// The number of bits by which to shift each element. /// A vector whose elements where shifted right by . - [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector ShiftRightLogical(Vector value, int shiftCount) => value >>> shiftCount; /// Shifts (unsigned) each element of a vector right by the specified amount. /// The vector whose elements are to be shifted. /// The number of bits by which to shift each element. /// A vector whose elements where shifted right by . - [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector ShiftRightLogical(Vector value, int shiftCount) => value >>> shiftCount; /// Shifts (unsigned) each element of a vector right by the specified amount. /// The vector whose elements are to be shifted. /// The number of bits by which to shift each element. /// A vector whose elements where shifted right by . - [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector ShiftRightLogical(Vector value, int shiftCount) => value >>> shiftCount; /// Shifts (unsigned) each element of a vector right by the specified amount. /// The vector whose elements are to be shifted. /// The number of bits by which to shift each element. /// A vector whose elements where shifted right by . - [Intrinsic] [CLSCompliant(false)] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector ShiftRightLogical(Vector value, int shiftCount) => value >>> shiftCount; /// Shifts (unsigned) each element of a vector right by the specified amount. /// The vector whose elements are to be shifted. /// The number of bits by which to shift each element. /// A vector whose elements where shifted right by . - [Intrinsic] [CLSCompliant(false)] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector ShiftRightLogical(Vector value, int shiftCount) => value >>> shiftCount; /// Shifts (unsigned) each element of a vector right by the specified amount. /// The vector whose elements are to be shifted. /// The number of bits by which to shift each element. /// A vector whose elements where shifted right by . - [Intrinsic] [CLSCompliant(false)] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector ShiftRightLogical(Vector value, int shiftCount) => value >>> shiftCount; /// Shifts (unsigned) each element of a vector right by the specified amount. /// The vector whose elements are to be shifted. /// The number of bits by which to shift each element. /// A vector whose elements where shifted right by . - [Intrinsic] [CLSCompliant(false)] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector ShiftRightLogical(Vector value, int shiftCount) => value >>> shiftCount; /// Shifts (unsigned) each element of a vector right by the specified amount. /// The vector whose elements are to be shifted. /// The number of bits by which to shift each element. /// A vector whose elements where shifted right by . - [Intrinsic] [CLSCompliant(false)] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector ShiftRightLogical(Vector value, int shiftCount) => value >>> shiftCount; /// Computes the square root of a vector on a per-element basis. @@ -1625,9 +1488,7 @@ public static Vector SquareRoot(Vector value) /// The vector that will be stored. /// The destination at which will be stored. /// The type of () is not supported. - [Intrinsic] [CLSCompliant(false)] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static void Store(this Vector source, T* destination) => source.StoreUnsafe(ref *destination); /// Stores a vector at the given aligned destination. @@ -1658,7 +1519,6 @@ public static void StoreAligned(this Vector source, T* destination) /// The type of () is not supported. [Intrinsic] [CLSCompliant(false)] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static void StoreAlignedNonTemporal(this Vector source, T* destination) => source.StoreAligned(destination); #pragma warning restore CS8500 // This takes the address of, gets the size of, or declares a pointer to a managed type ('T') @@ -1697,8 +1557,6 @@ public static void StoreUnsafe(this Vector source, ref T destination, nuin /// The vector to subtract from . /// The type of the elements in the vector. /// The difference of and . - [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector Subtract(Vector left, Vector right) => left - right; /// @@ -1724,7 +1582,6 @@ public static T Sum(Vector value) /// A scalar containing the value of the first element. /// The type of () is not supported. [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static T ToScalar(this Vector vector) { ThrowHelper.ThrowForUnsupportedNumericsVectorBaseType(); @@ -2098,8 +1955,6 @@ public static Vector WithElement(this Vector vector, int index, T value /// The vector to exclusive-or with . /// The type of the elements in the vector. /// The exclusive-or of and . - [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector Xor(Vector left, Vector right) => left ^ right; [MethodImpl(MethodImplOptions.AggressiveInlining)] diff --git a/src/libraries/System.Private.CoreLib/src/System/Numerics/Vector2.cs b/src/libraries/System.Private.CoreLib/src/System/Numerics/Vector2.cs index e57dee217803ff..b259730dd5a1e8 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Numerics/Vector2.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Numerics/Vector2.cs @@ -56,35 +56,19 @@ public Vector2(ReadOnlySpan values) /// Returns a vector whose 2 elements are equal to zero. /// A vector whose two elements are equal to zero (that is, it returns the vector (0,0). - public static Vector2 Zero - { - [Intrinsic] - get => default; - } + public static Vector2 Zero => default; /// Gets a vector whose 2 elements are equal to one. /// A vector whose two elements are equal to one (that is, it returns the vector (1,1). - public static Vector2 One - { - [Intrinsic] - get => new Vector2(1.0f); - } + public static Vector2 One => new Vector2(1.0f); /// Gets the vector (1,0). /// The vector (1,0). - public static Vector2 UnitX - { - [Intrinsic] - get => new Vector2(1.0f, 0.0f); - } + public static Vector2 UnitX => new Vector2(1.0f, 0.0f); /// Gets the vector (0,1). /// The vector (0,1). - public static Vector2 UnitY - { - [Intrinsic] - get => new Vector2(0.0f, 1.0f); - } + public static Vector2 UnitY => new Vector2(0.0f, 1.0f); /// Gets or sets the element at the specified index. /// The index of the element to get or set. @@ -92,11 +76,8 @@ public static Vector2 UnitY /// was less than zero or greater than the number of elements. public float this[int index] { - [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] readonly get => this.GetElement(index); - [MethodImpl(MethodImplOptions.AggressiveInlining)] set => this = this.WithElement(index, value); } @@ -136,11 +117,7 @@ public float this[int index] /// The result of the division. /// The method defines the division operation for objects. [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static Vector2 operator /(Vector2 value1, float value2) - { - return value1 / new Vector2(value2); - } + public static Vector2 operator /(Vector2 value1, float value2) => value1 / new Vector2(value2); /// Returns a value that indicates whether each pair of elements in two specified vectors is equal. /// The first vector to compare. @@ -160,11 +137,7 @@ public float this[int index] /// The second vector to compare. /// if and are not equal; otherwise, . [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static bool operator !=(Vector2 left, Vector2 right) - { - return !(left == right); - } + public static bool operator !=(Vector2 left, Vector2 right) => !(left == right); /// Returns a new vector whose values are the product of each pair of elements in two specified vectors. /// The first vector. @@ -187,11 +160,7 @@ public float this[int index] /// The scaled vector. /// The method defines the multiplication operation for objects. [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static Vector2 operator *(Vector2 left, float right) - { - return left * new Vector2(right); - } + public static Vector2 operator *(Vector2 left, float right) => left * new Vector2(right); /// Multiplies the scalar value by the specified vector. /// The vector. @@ -199,11 +168,7 @@ public float this[int index] /// The scaled vector. /// The method defines the multiplication operation for objects. [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static Vector2 operator *(float left, Vector2 right) - { - return right * left; - } + public static Vector2 operator *(float left, Vector2 right) => right * left; /// Subtracts the second vector from the first. /// The first vector. @@ -225,11 +190,7 @@ public float this[int index] /// The negated vector. /// The method defines the unary negation operation for objects. [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static Vector2 operator -(Vector2 value) - { - return Zero - value; - } + public static Vector2 operator -(Vector2 value) => Zero - value; /// Returns a vector whose elements are the absolute values of each of the specified vector's elements. /// A vector. @@ -248,20 +209,13 @@ public static Vector2 Abs(Vector2 value) /// The first vector to add. /// The second vector to add. /// The summed vector. - [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static Vector2 Add(Vector2 left, Vector2 right) - { - return left + right; - } + public static Vector2 Add(Vector2 left, Vector2 right) => left + right; /// Restricts a vector between a minimum and a maximum value. /// The vector to restrict. /// The minimum value. /// The maximum value. /// The restricted vector. - [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector2 Clamp(Vector2 value1, Vector2 min, Vector2 max) { // We must follow HLSL behavior in the case user specified min value is bigger than max value. @@ -272,47 +226,25 @@ public static Vector2 Clamp(Vector2 value1, Vector2 min, Vector2 max) /// The first point. /// The second point. /// The distance. - [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static float Distance(Vector2 value1, Vector2 value2) - { - float distanceSquared = DistanceSquared(value1, value2); - return MathF.Sqrt(distanceSquared); - } + public static float Distance(Vector2 value1, Vector2 value2) => MathF.Sqrt(DistanceSquared(value1, value2)); /// Returns the Euclidean distance squared between two specified points. /// The first point. /// The second point. /// The distance squared. - [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static float DistanceSquared(Vector2 value1, Vector2 value2) - { - Vector2 difference = value1 - value2; - return Dot(difference, difference); - } + public static float DistanceSquared(Vector2 value1, Vector2 value2) => (value1 - value2).LengthSquared(); /// Divides the first vector by the second. /// The first vector. /// The second vector. /// The vector resulting from the division. - [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static Vector2 Divide(Vector2 left, Vector2 right) - { - return left / right; - } + public static Vector2 Divide(Vector2 left, Vector2 right) => left / right; /// Divides the specified vector by a specified scalar value. /// The vector. /// The scalar value. /// The vector that results from the division. - [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static Vector2 Divide(Vector2 left, float divisor) - { - return left / divisor; - } + public static Vector2 Divide(Vector2 left, float divisor) => left / divisor; /// Returns the dot product of two vectors. /// The first vector. @@ -336,10 +268,7 @@ public static float Dot(Vector2 value1, Vector2 value2) /// ]]> [Intrinsic] [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static Vector2 Lerp(Vector2 value1, Vector2 value2, float amount) - { - return (value1 * (1.0f - amount)) + (value2 * amount); - } + public static Vector2 Lerp(Vector2 value1, Vector2 value2, float amount) => (value1 * (1.0f - amount)) + (value2 * amount); /// Returns a vector whose elements are the maximum of each of the pairs of elements in two specified vectors. /// The first vector. @@ -373,65 +302,36 @@ public static Vector2 Min(Vector2 value1, Vector2 value2) /// The first vector. /// The second vector. /// The element-wise product vector. - [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static Vector2 Multiply(Vector2 left, Vector2 right) - { - return left * right; - } + public static Vector2 Multiply(Vector2 left, Vector2 right) => left * right; /// Multiplies a vector by a specified scalar. /// The vector to multiply. /// The scalar value. /// The scaled vector. - [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static Vector2 Multiply(Vector2 left, float right) - { - return left * right; - } + public static Vector2 Multiply(Vector2 left, float right) => left * right; /// Multiplies a scalar value by a specified vector. /// The scaled value. /// The vector. /// The scaled vector. - [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static Vector2 Multiply(float left, Vector2 right) - { - return left * right; - } + public static Vector2 Multiply(float left, Vector2 right) => left * right; /// Negates a specified vector. /// The vector to negate. /// The negated vector. - [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static Vector2 Negate(Vector2 value) - { - return -value; - } + public static Vector2 Negate(Vector2 value) => -value; /// Returns a vector with the same direction as the specified vector, but with a length of one. /// The vector to normalize. /// The normalized vector. - [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static Vector2 Normalize(Vector2 value) - { - return value / value.Length(); - } + public static Vector2 Normalize(Vector2 value) => value / value.Length(); /// Returns the reflection of a vector off a surface that has the specified normal. /// The source vector. /// The normal of the surface being reflected off. /// The reflected vector. [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static Vector2 Reflect(Vector2 vector, Vector2 normal) - { - float dot = Dot(vector, normal); - return vector - (2.0f * (dot * normal)); - } + public static Vector2 Reflect(Vector2 vector, Vector2 normal) => vector - (2.0f * (Dot(vector, normal) * normal)); /// Returns a vector whose elements are the square root of each of a specified vector's elements. /// A vector. @@ -450,22 +350,13 @@ public static Vector2 SquareRoot(Vector2 value) /// The first vector. /// The second vector. /// The difference vector. - [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static Vector2 Subtract(Vector2 left, Vector2 right) - { - return left - right; - } + public static Vector2 Subtract(Vector2 left, Vector2 right) => left - right; /// Transforms a vector by a specified 3x2 matrix. /// The vector to transform. /// The transformation matrix. /// The transformed vector. - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static Vector2 Transform(Vector2 position, Matrix3x2 matrix) - { - return Transform(position, in matrix.AsImpl()); - } + public static Vector2 Transform(Vector2 position, Matrix3x2 matrix) => Transform(position, in matrix.AsImpl()); [MethodImpl(MethodImplOptions.AggressiveInlining)] internal static Vector2 Transform(Vector2 position, in Matrix3x2.Impl matrix) @@ -483,10 +374,7 @@ internal static Vector2 Transform(Vector2 position, in Matrix3x2.Impl matrix) /// The transformation matrix. /// The transformed vector. [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static Vector2 Transform(Vector2 position, Matrix4x4 matrix) - { - return Vector4.Transform(position, in matrix.AsImpl()).AsVector128().AsVector2(); - } + public static Vector2 Transform(Vector2 position, Matrix4x4 matrix) => Vector4.Transform(position, in matrix.AsImpl()).AsVector128().AsVector2(); /// Transforms a vector by the specified Quaternion rotation value. /// The vector to rotate. @@ -515,11 +403,7 @@ public static Vector2 Transform(Vector2 value, Quaternion rotation) /// The source vector. /// The matrix. /// The transformed vector. - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static Vector2 TransformNormal(Vector2 normal, Matrix3x2 matrix) - { - return TransformNormal(normal, in matrix.AsImpl()); - } + public static Vector2 TransformNormal(Vector2 normal, Matrix3x2 matrix) => TransformNormal(normal, in matrix.AsImpl()); [MethodImpl(MethodImplOptions.AggressiveInlining)] internal static Vector2 TransformNormal(Vector2 normal, in Matrix3x2.Impl matrix) @@ -535,11 +419,7 @@ internal static Vector2 TransformNormal(Vector2 normal, in Matrix3x2.Impl matrix /// The source vector. /// The matrix. /// The transformed vector. - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static Vector2 TransformNormal(Vector2 normal, Matrix4x4 matrix) - { - return TransformNormal(normal, in matrix.AsImpl()); - } + public static Vector2 TransformNormal(Vector2 normal, Matrix4x4 matrix) => TransformNormal(normal, in matrix.AsImpl()); [MethodImpl(MethodImplOptions.AggressiveInlining)] internal static Vector2 TransformNormal(Vector2 normal, in Matrix4x4.Impl matrix) @@ -631,11 +511,7 @@ public readonly bool TryCopyTo(Span destination) /// The object to compare with the current instance. /// if the current instance and are equal; otherwise, . If is , the method returns . /// The current instance and are equal if is a object and their and elements are equal. - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public override readonly bool Equals([NotNullWhen(true)] object? obj) - { - return (obj is Vector2 other) && Equals(other); - } + public override readonly bool Equals([NotNullWhen(true)] object? obj) => (obj is Vector2 other) && Equals(other); /// Returns a value that indicates whether this instance and another vector are equal. /// The other vector. @@ -667,40 +543,23 @@ static bool SoftwareFallback(in Vector2 self, Vector2 other) /// Returns the hash code for this instance. /// The hash code. - public override readonly int GetHashCode() - { - return HashCode.Combine(X, Y); - } + public override readonly int GetHashCode() => HashCode.Combine(X, Y); /// Returns the length of the vector. /// The vector's length. /// - [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public readonly float Length() - { - float lengthSquared = LengthSquared(); - return MathF.Sqrt(lengthSquared); - } + public readonly float Length() => MathF.Sqrt(LengthSquared()); /// Returns the length of the vector squared. /// The vector's length squared. /// This operation offers better performance than a call to the method. /// - [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public readonly float LengthSquared() - { - return Dot(this, this); - } + public readonly float LengthSquared() => Dot(this, this); /// Returns the string representation of the current instance using default formatting. /// The string representation of the current instance. /// This method returns a string in which each element of the vector is formatted using the "G" (general) format string and the formatting conventions of the current thread culture. The "<" and ">" characters are used to begin and end the string, and the current culture's property followed by a space is used to separate each element. - public override readonly string ToString() - { - return ToString("G", CultureInfo.CurrentCulture); - } + public override readonly string ToString() => ToString("G", CultureInfo.CurrentCulture); /// Returns the string representation of the current instance using the specified format string to format individual elements. /// A standard or custom numeric format string that defines the format of individual elements. @@ -708,10 +567,7 @@ public override readonly string ToString() /// This method returns a string in which each element of the vector is formatted using and the current culture's formatting conventions. The "<" and ">" characters are used to begin and end the string, and the current culture's property followed by a space is used to separate each element. /// Standard Numeric Format Strings /// Custom Numeric Format Strings - public readonly string ToString([StringSyntax(StringSyntaxAttribute.NumericFormat)] string? format) - { - return ToString(format, CultureInfo.CurrentCulture); - } + public readonly string ToString([StringSyntax(StringSyntaxAttribute.NumericFormat)] string? format) => ToString(format, CultureInfo.CurrentCulture); /// Returns the string representation of the current instance using the specified format string to format individual elements and the specified format provider to define culture-specific formatting. /// A standard or custom numeric format string that defines the format of individual elements. diff --git a/src/libraries/System.Private.CoreLib/src/System/Numerics/Vector3.cs b/src/libraries/System.Private.CoreLib/src/System/Numerics/Vector3.cs index c4739ce80502c5..0b7fecb823d2c2 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Numerics/Vector3.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Numerics/Vector3.cs @@ -69,43 +69,23 @@ public Vector3(ReadOnlySpan values) /// Gets a vector whose 3 elements are equal to zero. /// A vector whose three elements are equal to zero (that is, it returns the vector (0,0,0). - public static Vector3 Zero - { - [Intrinsic] - get => default; - } + public static Vector3 Zero => default; /// Gets a vector whose 3 elements are equal to one. /// A vector whose three elements are equal to one (that is, it returns the vector (1,1,1). - public static Vector3 One - { - [Intrinsic] - get => new Vector3(1.0f); - } + public static Vector3 One => new Vector3(1.0f); /// Gets the vector (1,0,0). /// The vector (1,0,0). - public static Vector3 UnitX - { - [Intrinsic] - get => new Vector3(1.0f, 0.0f, 0.0f); - } + public static Vector3 UnitX => new Vector3(1.0f, 0.0f, 0.0f); /// Gets the vector (0,1,0). /// The vector (0,1,0). - public static Vector3 UnitY - { - [Intrinsic] - get => new Vector3(0.0f, 1.0f, 0.0f); - } + public static Vector3 UnitY => new Vector3(0.0f, 1.0f, 0.0f); /// Gets the vector (0,0,1). /// The vector (0,0,1). - public static Vector3 UnitZ - { - [Intrinsic] - get => new Vector3(0.0f, 0.0f, 1.0f); - } + public static Vector3 UnitZ => new Vector3(0.0f, 0.0f, 1.0f); /// Gets or sets the element at the specified index. /// The index of the element to get or set. @@ -113,11 +93,8 @@ public static Vector3 UnitZ /// was less than zero or greater than the number of elements. public float this[int index] { - [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] readonly get => this.GetElement(index); - [MethodImpl(MethodImplOptions.AggressiveInlining)] set => this = this.WithElement(index, value); } @@ -159,11 +136,7 @@ public float this[int index] /// The result of the division. /// The method defines the division operation for objects. [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static Vector3 operator /(Vector3 value1, float value2) - { - return value1 / new Vector3(value2); - } + public static Vector3 operator /(Vector3 value1, float value2) => value1 / new Vector3(value2); /// Returns a value that indicates whether each pair of elements in two specified vectors is equal. /// The first vector to compare. @@ -184,11 +157,7 @@ public float this[int index] /// The second vector to compare. /// if and are not equal; otherwise, . [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static bool operator !=(Vector3 left, Vector3 right) - { - return !(left == right); - } + public static bool operator !=(Vector3 left, Vector3 right) => !(left == right); /// Returns a new vector whose values are the product of each pair of elements in two specified vectors. /// The first vector. @@ -212,11 +181,7 @@ public float this[int index] /// The scaled vector. /// The method defines the multiplication operation for objects. [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static Vector3 operator *(Vector3 left, float right) - { - return left * new Vector3(right); - } + public static Vector3 operator *(Vector3 left, float right) => left * new Vector3(right); /// Multiplies the scalar value by the specified vector. /// The vector. @@ -224,11 +189,7 @@ public float this[int index] /// The scaled vector. /// The method defines the multiplication operation for objects. [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static Vector3 operator *(float left, Vector3 right) - { - return right * left; - } + public static Vector3 operator *(float left, Vector3 right) => right * left; /// Subtracts the second vector from the first. /// The first vector. @@ -251,11 +212,7 @@ public float this[int index] /// The negated vector. /// The method defines the unary negation operation for objects. [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static Vector3 operator -(Vector3 value) - { - return Zero - value; - } + public static Vector3 operator -(Vector3 value) => Zero - value; /// Returns a vector whose elements are the absolute values of each of the specified vector's elements. /// A vector. @@ -275,20 +232,13 @@ public static Vector3 Abs(Vector3 value) /// The first vector to add. /// The second vector to add. /// The summed vector. - [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static Vector3 Add(Vector3 left, Vector3 right) - { - return left + right; - } + public static Vector3 Add(Vector3 left, Vector3 right) => left + right; /// Restricts a vector between a minimum and a maximum value. /// The vector to restrict. /// The minimum value. /// The maximum value. /// The restricted vector. - [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector3 Clamp(Vector3 value1, Vector3 min, Vector3 max) { // We must follow HLSL behavior in the case user specified min value is bigger than max value. @@ -313,47 +263,25 @@ public static Vector3 Cross(Vector3 vector1, Vector3 vector2) /// The first point. /// The second point. /// The distance. - [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static float Distance(Vector3 value1, Vector3 value2) - { - float distanceSquared = DistanceSquared(value1, value2); - return MathF.Sqrt(distanceSquared); - } + public static float Distance(Vector3 value1, Vector3 value2) => MathF.Sqrt(DistanceSquared(value1, value2)); /// Returns the Euclidean distance squared between two specified points. /// The first point. /// The second point. /// The distance squared. - [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static float DistanceSquared(Vector3 value1, Vector3 value2) - { - Vector3 difference = value1 - value2; - return Dot(difference, difference); - } + public static float DistanceSquared(Vector3 value1, Vector3 value2) => (value1 - value2).LengthSquared(); /// Divides the first vector by the second. /// The first vector. /// The second vector. /// The vector resulting from the division. - [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static Vector3 Divide(Vector3 left, Vector3 right) - { - return left / right; - } + public static Vector3 Divide(Vector3 left, Vector3 right) => left / right; /// Divides the specified vector by a specified scalar value. /// The vector. /// The scalar value. /// The vector that results from the division. - [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static Vector3 Divide(Vector3 left, float divisor) - { - return left / divisor; - } + public static Vector3 Divide(Vector3 left, float divisor) => left / divisor; /// Returns the dot product of two vectors. /// The first vector. @@ -375,10 +303,7 @@ public static float Dot(Vector3 vector1, Vector3 vector2) /// The interpolated vector. [Intrinsic] [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static Vector3 Lerp(Vector3 value1, Vector3 value2, float amount) - { - return (value1 * (1.0f - amount)) + (value2 * amount); - } + public static Vector3 Lerp(Vector3 value1, Vector3 value2, float amount) => (value1 * (1.0f - amount)) + (value2 * amount); /// Returns a vector whose elements are the maximum of each of the pairs of elements in two specified vectors. /// The first vector. @@ -414,65 +339,36 @@ public static Vector3 Min(Vector3 value1, Vector3 value2) /// The first vector. /// The second vector. /// The element-wise product vector. - [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static Vector3 Multiply(Vector3 left, Vector3 right) - { - return left * right; - } + public static Vector3 Multiply(Vector3 left, Vector3 right) => left * right; /// Multiplies a vector by a specified scalar. /// The vector to multiply. /// The scalar value. /// The scaled vector. - [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static Vector3 Multiply(Vector3 left, float right) - { - return left * right; - } + public static Vector3 Multiply(Vector3 left, float right) => left * right; /// Multiplies a scalar value by a specified vector. /// The scaled value. /// The vector. /// The scaled vector. - [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static Vector3 Multiply(float left, Vector3 right) - { - return left * right; - } + public static Vector3 Multiply(float left, Vector3 right) => left * right; /// Negates a specified vector. /// The vector to negate. /// The negated vector. - [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static Vector3 Negate(Vector3 value) - { - return -value; - } + public static Vector3 Negate(Vector3 value) => -value; /// Returns a vector with the same direction as the specified vector, but with a length of one. /// The vector to normalize. /// The normalized vector. - [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static Vector3 Normalize(Vector3 value) - { - return value / value.Length(); - } + public static Vector3 Normalize(Vector3 value) => value / value.Length(); /// Returns the reflection of a vector off a surface that has the specified normal. /// The source vector. /// The normal of the surface being reflected off. /// The reflected vector. [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static Vector3 Reflect(Vector3 vector, Vector3 normal) - { - float dot = Dot(vector, normal); - return vector - (2.0f * (dot * normal)); - } + public static Vector3 Reflect(Vector3 vector, Vector3 normal) => vector - (2.0f * (Dot(vector, normal) * normal)); /// Returns a vector whose elements are the square root of each of a specified vector's elements. /// A vector. @@ -492,22 +388,14 @@ public static Vector3 SquareRoot(Vector3 value) /// The first vector. /// The second vector. /// The difference vector. - [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static Vector3 Subtract(Vector3 left, Vector3 right) - { - return left - right; - } + public static Vector3 Subtract(Vector3 left, Vector3 right) => left - right; /// Transforms a vector by a specified 4x4 matrix. /// The vector to transform. /// The transformation matrix. /// The transformed vector. [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static Vector3 Transform(Vector3 position, Matrix4x4 matrix) - { - return Vector4.Transform(position, in matrix.AsImpl()).AsVector128().AsVector3(); - } + public static Vector3 Transform(Vector3 position, Matrix4x4 matrix) => Vector4.Transform(position, in matrix.AsImpl()).AsVector128().AsVector3(); /// Transforms a vector by the specified Quaternion rotation value. /// The vector to rotate. @@ -542,10 +430,7 @@ public static Vector3 Transform(Vector3 value, Quaternion rotation) /// The matrix. /// The transformed vector. [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static Vector3 TransformNormal(Vector3 normal, Matrix4x4 matrix) - { - return TransformNormal(normal, in matrix.AsImpl()); - } + public static Vector3 TransformNormal(Vector3 normal, Matrix4x4 matrix) => TransformNormal(normal, in matrix.AsImpl()); [MethodImpl(MethodImplOptions.AggressiveInlining)] internal static Vector3 TransformNormal(Vector3 normal, in Matrix4x4.Impl matrix) @@ -638,11 +523,7 @@ public readonly bool TryCopyTo(Span destination) /// The object to compare with the current instance. /// if the current instance and are equal; otherwise, . If is , the method returns . /// The current instance and are equal if is a object and their corresponding elements are equal. - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public override readonly bool Equals([NotNullWhen(true)] object? obj) - { - return (obj is Vector3 other) && Equals(other); - } + public override readonly bool Equals([NotNullWhen(true)] object? obj) => (obj is Vector3 other) && Equals(other); /// Returns a value that indicates whether this instance and another vector are equal. /// The other vector. @@ -671,40 +552,24 @@ static bool SoftwareFallback(in Vector3 self, Vector3 other) /// Returns the hash code for this instance. /// The hash code. - public override readonly int GetHashCode() - { - return HashCode.Combine(X, Y, Z); - } + public override readonly int GetHashCode() => HashCode.Combine(X, Y, Z); /// Returns the length of this vector object. /// The vector's length. /// [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public readonly float Length() - { - float lengthSquared = LengthSquared(); - return MathF.Sqrt(lengthSquared); - } + public readonly float Length() => MathF.Sqrt(LengthSquared()); /// Returns the length of the vector squared. /// The vector's length squared. /// This operation offers better performance than a call to the method. /// - [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public readonly float LengthSquared() - { - return Dot(this, this); - } + public readonly float LengthSquared() => Dot(this, this); /// Returns the string representation of the current instance using default formatting. /// The string representation of the current instance. /// This method returns a string in which each element of the vector is formatted using the "G" (general) format string and the formatting conventions of the current thread culture. The "<" and ">" characters are used to begin and end the string, and the current culture's property followed by a space is used to separate each element. - public override readonly string ToString() - { - return ToString("G", CultureInfo.CurrentCulture); - } + public override readonly string ToString() => ToString("G", CultureInfo.CurrentCulture); /// Returns the string representation of the current instance using the specified format string to format individual elements. /// A standard or custom numeric format string that defines the format of individual elements. @@ -712,10 +577,7 @@ public override readonly string ToString() /// This method returns a string in which each element of the vector is formatted using and the current culture's formatting conventions. The "<" and ">" characters are used to begin and end the string, and the current culture's property followed by a space is used to separate each element. /// Standard Numeric Format Strings /// Custom Numeric Format Strings - public readonly string ToString([StringSyntax(StringSyntaxAttribute.NumericFormat)] string? format) - { - return ToString(format, CultureInfo.CurrentCulture); - } + public readonly string ToString([StringSyntax(StringSyntaxAttribute.NumericFormat)] string? format) => ToString(format, CultureInfo.CurrentCulture); /// Returns the string representation of the current instance using the specified format string to format individual elements and the specified format provider to define culture-specific formatting. /// A standard or custom numeric format string that defines the format of individual elements. diff --git a/src/libraries/System.Private.CoreLib/src/System/Numerics/Vector4.Extensions.cs b/src/libraries/System.Private.CoreLib/src/System/Numerics/Vector4.Extensions.cs index 0fbedb72c7d3f1..7886b9e1e6eb60 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Numerics/Vector4.Extensions.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Numerics/Vector4.Extensions.cs @@ -12,27 +12,19 @@ public static unsafe partial class Vector /// Reinterprets a as a new . /// The vector to reinterpret. /// reinterpreted as a new . - [MethodImpl(MethodImplOptions.AggressiveInlining)] - internal static Plane AsPlane(this Vector4 value) - => Unsafe.BitCast(value); + internal static Plane AsPlane(this Vector4 value) => Unsafe.BitCast(value); /// Reinterprets a as a new . /// The vector to reinterpret. /// reinterpreted as a new . - [MethodImpl(MethodImplOptions.AggressiveInlining)] - internal static Quaternion AsQuaternion(this Vector4 value) - => Unsafe.BitCast(value); + internal static Quaternion AsQuaternion(this Vector4 value) => Unsafe.BitCast(value); /// Gets the element at the specified index. /// The vector to get the element from. /// The index of the element to get. /// The value of the element at . /// was less than zero or greater than the number of elements. - [MethodImpl(MethodImplOptions.AggressiveInlining)] - internal static float GetElement(this Vector4 vector, int index) - { - return vector.AsVector128().GetElement(index); - } + internal static float GetElement(this Vector4 vector, int index) => vector.AsVector128().GetElement(index); /// Creates a new with the element at the specified index set to the specified value and the remaining elements set to the same value as that in the given vector. /// The vector to get the remaining elements from. @@ -40,10 +32,8 @@ internal static float GetElement(this Vector4 vector, int index) /// The value to set the element to. /// A with the value of the element at set to and the remaining elements set to the same value as that in . /// was less than zero or greater than the number of elements. - internal static Vector4 WithElement(this Vector4 vector, int index, float value) - { - return vector.AsVector128().WithElement(index, value).AsVector4(); - } + [MethodImpl(MethodImplOptions.AggressiveInlining)] + internal static Vector4 WithElement(this Vector4 vector, int index, float value) => vector.AsVector128().WithElement(index, value).AsVector4(); [MethodImpl(MethodImplOptions.AggressiveInlining)] private static float GetElementUnsafe(in this Vector4 vector, int index) diff --git a/src/libraries/System.Private.CoreLib/src/System/Numerics/Vector4.cs b/src/libraries/System.Private.CoreLib/src/System/Numerics/Vector4.cs index 1f0b78c37257d8..c897ff2be15fc4 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Numerics/Vector4.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Numerics/Vector4.cs @@ -80,46 +80,28 @@ public Vector4(ReadOnlySpan values) /// Gets a vector whose 4 elements are equal to zero. /// A vector whose four elements are equal to zero (that is, it returns the vector (0,0,0,0). - public static Vector4 Zero - { - get => default; - } + public static Vector4 Zero => default; /// Gets a vector whose 4 elements are equal to one. /// Returns . /// A vector whose four elements are equal to one (that is, it returns the vector (1,1,1,1). - public static Vector4 One - { - get => new Vector4(1); - } + public static Vector4 One => new Vector4(1); /// Gets the vector (1,0,0,0). /// The vector (1,0,0,0). - public static Vector4 UnitX - { - get => new Vector4(1.0f, 0.0f, 0.0f, 0.0f); - } + public static Vector4 UnitX => new Vector4(1.0f, 0.0f, 0.0f, 0.0f); /// Gets the vector (0,1,0,0). /// The vector (0,1,0,0). - public static Vector4 UnitY - { - get => new Vector4(0.0f, 1.0f, 0.0f, 0.0f); - } + public static Vector4 UnitY => new Vector4(0.0f, 1.0f, 0.0f, 0.0f); /// Gets the vector (0,0,1,0). /// The vector (0,0,1,0). - public static Vector4 UnitZ - { - get => new Vector4(0.0f, 0.0f, 1.0f, 0.0f); - } + public static Vector4 UnitZ => new Vector4(0.0f, 0.0f, 1.0f, 0.0f); /// Gets the vector (0,0,0,1). /// The vector (0,0,0,1). - public static Vector4 UnitW - { - get => new Vector4(0.0f, 0.0f, 0.0f, 1.0f); - } + public static Vector4 UnitW => new Vector4(0.0f, 0.0f, 0.0f, 1.0f); /// Gets or sets the element at the specified index. /// The index of the element to get or set. @@ -127,10 +109,8 @@ public static Vector4 UnitW /// was less than zero or greater than the number of elements. public float this[int index] { - [MethodImpl(MethodImplOptions.AggressiveInlining)] readonly get => this.GetElement(index); - [MethodImpl(MethodImplOptions.AggressiveInlining)] set => this = this.WithElement(index, value); } @@ -140,10 +120,7 @@ public float this[int index] /// The summed vector. /// The method defines the addition operation for objects. [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static Vector4 operator +(Vector4 left, Vector4 right) - { - return (left.AsVector128() + right.AsVector128()).AsVector4(); - } + public static Vector4 operator +(Vector4 left, Vector4 right) => (left.AsVector128() + right.AsVector128()).AsVector4(); /// Divides the first vector by the second. /// The first vector. @@ -151,21 +128,14 @@ public float this[int index] /// The vector that results from dividing by . /// The method defines the division operation for objects. [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static Vector4 operator /(Vector4 left, Vector4 right) - { - return (left.AsVector128() / right.AsVector128()).AsVector4(); - } + public static Vector4 operator /(Vector4 left, Vector4 right) => (left.AsVector128() / right.AsVector128()).AsVector4(); /// Divides the specified vector by a specified scalar value. /// The vector. /// The scalar value. /// The result of the division. /// The method defines the division operation for objects. - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static Vector4 operator /(Vector4 value1, float value2) - { - return value1 / new Vector4(value2); - } + public static Vector4 operator /(Vector4 value1, float value2) => value1 / new Vector4(value2); /// Returns a value that indicates whether each pair of elements in two specified vectors is equal. /// The first vector to compare. @@ -173,20 +143,13 @@ public float this[int index] /// if and are equal; otherwise, . /// Two objects are equal if each element in is equal to the corresponding element in . [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static bool operator ==(Vector4 left, Vector4 right) - { - return left.AsVector128() == right.AsVector128(); - } + public static bool operator ==(Vector4 left, Vector4 right) => left.AsVector128() == right.AsVector128(); /// Returns a value that indicates whether two specified vectors are not equal. /// The first vector to compare. /// The second vector to compare. /// if and are not equal; otherwise, . - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static bool operator !=(Vector4 left, Vector4 right) - { - return !(left == right); - } + public static bool operator !=(Vector4 left, Vector4 right) => !(left == right); /// Returns a new vector whose values are the product of each pair of elements in two specified vectors. /// The first vector. @@ -194,32 +157,21 @@ public float this[int index] /// The element-wise product vector. /// The method defines the multiplication operation for objects. [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static Vector4 operator *(Vector4 left, Vector4 right) - { - return (left.AsVector128() * right.AsVector128()).AsVector4(); - } + public static Vector4 operator *(Vector4 left, Vector4 right) => (left.AsVector128() * right.AsVector128()).AsVector4(); /// Multiplies the specified vector by the specified scalar value. /// The vector. /// The scalar value. /// The scaled vector. /// The method defines the multiplication operation for objects. - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static Vector4 operator *(Vector4 left, float right) - { - return left * new Vector4(right); - } + public static Vector4 operator *(Vector4 left, float right) => left * new Vector4(right); /// Multiplies the scalar value by the specified vector. /// The vector. /// The scalar value. /// The scaled vector. /// The method defines the multiplication operation for objects. - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static Vector4 operator *(float left, Vector4 right) - { - return right * left; - } + public static Vector4 operator *(float left, Vector4 right) => right * left; /// Subtracts the second vector from the first. /// The first vector. @@ -227,46 +179,32 @@ public float this[int index] /// The vector that results from subtracting from . /// The method defines the subtraction operation for objects. [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static Vector4 operator -(Vector4 left, Vector4 right) - { - return (left.AsVector128() - right.AsVector128()).AsVector4(); - } + public static Vector4 operator -(Vector4 left, Vector4 right) => (left.AsVector128() - right.AsVector128()).AsVector4(); /// Negates the specified vector. /// The vector to negate. /// The negated vector. /// The method defines the unary negation operation for objects. [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static Vector4 operator -(Vector4 value) - { - return (-value.AsVector128()).AsVector4(); - } + public static Vector4 operator -(Vector4 value) => (-value.AsVector128()).AsVector4(); /// Returns a vector whose elements are the absolute values of each of the specified vector's elements. /// A vector. /// The absolute value vector. [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static Vector4 Abs(Vector4 value) - { - return Vector128.Abs(value.AsVector128()).AsVector4(); - } + public static Vector4 Abs(Vector4 value) => Vector128.Abs(value.AsVector128()).AsVector4(); /// Adds two vectors together. /// The first vector to add. /// The second vector to add. /// The summed vector. - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static Vector4 Add(Vector4 left, Vector4 right) - { - return left + right; - } + public static Vector4 Add(Vector4 left, Vector4 right) => left + right; /// Restricts a vector between a minimum and a maximum value. /// The vector to restrict. /// The minimum value. /// The maximum value. /// The restricted vector. - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector4 Clamp(Vector4 value1, Vector4 min, Vector4 max) { // We must follow HLSL behavior in the case user specified min value is bigger than max value. @@ -277,51 +215,32 @@ public static Vector4 Clamp(Vector4 value1, Vector4 min, Vector4 max) /// The first point. /// The second point. /// The distance. - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static float Distance(Vector4 value1, Vector4 value2) - { - return MathF.Sqrt(DistanceSquared(value1, value2)); - } + public static float Distance(Vector4 value1, Vector4 value2) => MathF.Sqrt(DistanceSquared(value1, value2)); /// Returns the Euclidean distance squared between two specified points. /// The first point. /// The second point. /// The distance squared. - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static float DistanceSquared(Vector4 value1, Vector4 value2) - { - return (value1 - value2).LengthSquared(); - } + public static float DistanceSquared(Vector4 value1, Vector4 value2) => (value1 - value2).LengthSquared(); /// Divides the first vector by the second. /// The first vector. /// The second vector. /// The vector resulting from the division. - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static Vector4 Divide(Vector4 left, Vector4 right) - { - return left / right; - } + public static Vector4 Divide(Vector4 left, Vector4 right) => left / right; /// Divides the specified vector by a specified scalar value. /// The vector. /// The scalar value. /// The vector that results from the division. - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static Vector4 Divide(Vector4 left, float divisor) - { - return left / divisor; - } + public static Vector4 Divide(Vector4 left, float divisor) => left / divisor; /// Returns the dot product of two vectors. /// The first vector. /// The second vector. /// The dot product. [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static float Dot(Vector4 vector1, Vector4 vector2) - { - return Vector128.Dot(vector1.AsVector128(), vector2.AsVector128()); - } + public static float Dot(Vector4 vector1, Vector4 vector2) => Vector128.Dot(vector1.AsVector128(), vector2.AsVector128()); /// Performs a linear interpolation between two vectors based on the given weighting. /// The first vector. @@ -332,105 +251,67 @@ public static float Dot(Vector4 vector1, Vector4 vector2) /// The behavior of this method changed in .NET 5.0. For more information, see [Behavior change for Vector2.Lerp and Vector4.Lerp](/dotnet/core/compatibility/3.1-5.0#behavior-change-for-vector2lerp-and-vector4lerp). /// ]]> [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static Vector4 Lerp(Vector4 value1, Vector4 value2, float amount) - { - return (value1 * (1.0f - amount)) + (value2 * amount); - } + public static Vector4 Lerp(Vector4 value1, Vector4 value2, float amount) => (value1 * (1.0f - amount)) + (value2 * amount); /// Returns a vector whose elements are the maximum of each of the pairs of elements in two specified vectors. /// The first vector. /// The second vector. /// The maximized vector. [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static Vector4 Max(Vector4 value1, Vector4 value2) - { - return Vector128.Max(value1.AsVector128(), value2.AsVector128()).AsVector4(); - } + public static Vector4 Max(Vector4 value1, Vector4 value2) => Vector128.Max(value1.AsVector128(), value2.AsVector128()).AsVector4(); /// Returns a vector whose elements are the minimum of each of the pairs of elements in two specified vectors. /// The first vector. /// The second vector. /// The minimized vector. [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static Vector4 Min(Vector4 value1, Vector4 value2) - { - return Vector128.Min(value1.AsVector128(), value2.AsVector128()).AsVector4(); - } + public static Vector4 Min(Vector4 value1, Vector4 value2) => Vector128.Min(value1.AsVector128(), value2.AsVector128()).AsVector4(); /// Returns a new vector whose values are the product of each pair of elements in two specified vectors. /// The first vector. /// The second vector. /// The element-wise product vector. - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static Vector4 Multiply(Vector4 left, Vector4 right) - { - return left * right; - } + public static Vector4 Multiply(Vector4 left, Vector4 right) => left * right; /// Multiplies a vector by a specified scalar. /// The vector to multiply. /// The scalar value. /// The scaled vector. - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static Vector4 Multiply(Vector4 left, float right) - { - return left * right; - } + public static Vector4 Multiply(Vector4 left, float right) => left * right; /// Multiplies a scalar value by a specified vector. /// The scaled value. /// The vector. /// The scaled vector. - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static Vector4 Multiply(float left, Vector4 right) - { - return left * right; - } + public static Vector4 Multiply(float left, Vector4 right) => left * right; /// Negates a specified vector. /// The vector to negate. /// The negated vector. - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static Vector4 Negate(Vector4 value) - { - return -value; - } + public static Vector4 Negate(Vector4 value) => -value; /// Returns a vector with the same direction as the specified vector, but with a length of one. /// The vector to normalize. /// The normalized vector. - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static Vector4 Normalize(Vector4 vector) - { - return vector / vector.Length(); - } + public static Vector4 Normalize(Vector4 vector) => vector / vector.Length(); /// Returns a vector whose elements are the square root of each of a specified vector's elements. /// A vector. /// The square root vector. [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static Vector4 SquareRoot(Vector4 value) - { - return Vector128.Sqrt(value.AsVector128()).AsVector4(); - } + public static Vector4 SquareRoot(Vector4 value) => Vector128.Sqrt(value.AsVector128()).AsVector4(); /// Subtracts the second vector from the first. /// The first vector. /// The second vector. /// The difference vector. - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static Vector4 Subtract(Vector4 left, Vector4 right) - { - return left - right; - } + public static Vector4 Subtract(Vector4 left, Vector4 right) => left - right; /// Transforms a two-dimensional vector by a specified 4x4 matrix. /// The vector to transform. /// The transformation matrix. /// The transformed vector. - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static Vector4 Transform(Vector2 position, Matrix4x4 matrix) - => Transform(position, in matrix.AsImpl()); + public static Vector4 Transform(Vector2 position, Matrix4x4 matrix) => Transform(position, in matrix.AsImpl()); [MethodImpl(MethodImplOptions.AggressiveInlining)] internal static Vector4 Transform(Vector2 position, in Matrix4x4.Impl matrix) @@ -476,9 +357,7 @@ public static Vector4 Transform(Vector2 value, Quaternion rotation) /// The vector to transform. /// The transformation matrix. /// The transformed vector. - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static Vector4 Transform(Vector3 position, Matrix4x4 matrix) - => Transform(position, in matrix.AsImpl()); + public static Vector4 Transform(Vector3 position, Matrix4x4 matrix) => Transform(position, in matrix.AsImpl()); [MethodImpl(MethodImplOptions.AggressiveInlining)] internal static Vector4 Transform(Vector3 position, in Matrix4x4.Impl matrix) @@ -525,9 +404,7 @@ public static Vector4 Transform(Vector3 value, Quaternion rotation) /// The vector to transform. /// The transformation matrix. /// The transformed vector. - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static Vector4 Transform(Vector4 vector, Matrix4x4 matrix) - => Transform(vector, in matrix.AsImpl()); + public static Vector4 Transform(Vector4 vector, Matrix4x4 matrix) => Transform(vector, in matrix.AsImpl()); [MethodImpl(MethodImplOptions.AggressiveInlining)] internal static Vector4 Transform(Vector4 vector, in Matrix4x4.Impl matrix) @@ -575,11 +452,7 @@ public static Vector4 Transform(Vector4 value, Quaternion rotation) /// is . /// The number of elements in the current instance is greater than in the array. /// is multidimensional. - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public readonly void CopyTo(float[] array) - { - this.AsVector128().CopyTo(array); - } + public readonly void CopyTo(float[] array) => this.AsVector128().CopyTo(array); /// Copies the elements of the vector to a specified array starting at a specified index position. /// The destination array. @@ -591,83 +464,50 @@ public readonly void CopyTo(float[] array) /// -or- /// is greater than or equal to the array length. /// is multidimensional. - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public readonly void CopyTo(float[] array, int index) - { - this.AsVector128().CopyTo(array, index); - } + public readonly void CopyTo(float[] array, int index) => this.AsVector128().CopyTo(array, index); /// Copies the vector to the given . The length of the destination span must be at least 4. /// The destination span which the values are copied into. /// If number of elements in source vector is greater than those available in destination span. - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public readonly void CopyTo(Span destination) - { - this.AsVector128().CopyTo(destination); - } + public readonly void CopyTo(Span destination) => this.AsVector128().CopyTo(destination); /// Attempts to copy the vector to the given . The length of the destination span must be at least 4. /// The destination span which the values are copied into. /// if the source vector was successfully copied to . if is not large enough to hold the source vector. - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public readonly bool TryCopyTo(Span destination) - { - return this.AsVector128().TryCopyTo(destination); - } + public readonly bool TryCopyTo(Span destination) => this.AsVector128().TryCopyTo(destination); /// Returns a value that indicates whether this instance and another vector are equal. /// The other vector. /// if the two vectors are equal; otherwise, . /// Two vectors are equal if their , , , and elements are equal. [MethodImpl(MethodImplOptions.AggressiveInlining)] - public readonly bool Equals(Vector4 other) - { - return this.AsVector128().Equals(other.AsVector128()); - } + public readonly bool Equals(Vector4 other) => this.AsVector128().Equals(other.AsVector128()); /// Returns a value that indicates whether this instance and a specified object are equal. /// The object to compare with the current instance. /// if the current instance and are equal; otherwise, . If is , the method returns . /// The current instance and are equal if is a object and their corresponding elements are equal. - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public override readonly bool Equals([NotNullWhen(true)] object? obj) - { - return (obj is Vector4 other) && Equals(other); - } + public override readonly bool Equals([NotNullWhen(true)] object? obj) => (obj is Vector4 other) && Equals(other); /// Returns the hash code for this instance. /// The hash code. - public override readonly int GetHashCode() - { - return HashCode.Combine(X, Y, Z, W); - } + public override readonly int GetHashCode() => HashCode.Combine(X, Y, Z, W); /// Returns the length of this vector object. /// The vector's length. /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public readonly float Length() - { - return MathF.Sqrt(LengthSquared()); - } + public readonly float Length() => MathF.Sqrt(LengthSquared()); /// Returns the length of the vector squared. /// The vector's length squared. /// This operation offers better performance than a call to the method. /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public readonly float LengthSquared() - { - return Dot(this, this); - } + public readonly float LengthSquared() => Dot(this, this); /// Returns the string representation of the current instance using default formatting. /// The string representation of the current instance. /// This method returns a string in which each element of the vector is formatted using the "G" (general) format string and the formatting conventions of the current thread culture. The "<" and ">" characters are used to begin and end the string, and the current culture's property followed by a space is used to separate each element. - public override readonly string ToString() - { - return ToString("G", CultureInfo.CurrentCulture); - } + public override readonly string ToString() => ToString("G", CultureInfo.CurrentCulture); /// Returns the string representation of the current instance using the specified format string to format individual elements. /// A standard or custom numeric format string that defines the format of individual elements. @@ -675,10 +515,7 @@ public override readonly string ToString() /// This method returns a string in which each element of the vector is formatted using and the current culture's formatting conventions. The "<" and ">" characters are used to begin and end the string, and the current culture's property followed by a space is used to separate each element. /// Standard Numeric Format Strings /// Custom Numeric Format Strings - public readonly string ToString([StringSyntax(StringSyntaxAttribute.NumericFormat)] string? format) - { - return ToString(format, CultureInfo.CurrentCulture); - } + public readonly string ToString([StringSyntax(StringSyntaxAttribute.NumericFormat)] string? format) => ToString(format, CultureInfo.CurrentCulture); /// Returns the string representation of the current instance using the specified format string to format individual elements and the specified format provider to define culture-specific formatting. /// A standard or custom numeric format string that defines the format of individual elements. diff --git a/src/libraries/System.Private.CoreLib/src/System/Numerics/Vector_1.cs b/src/libraries/System.Private.CoreLib/src/System/Numerics/Vector_1.cs index 4ad327aebc9ee4..b796005660edf8 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Numerics/Vector_1.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Numerics/Vector_1.cs @@ -124,7 +124,6 @@ public unsafe Vector(ReadOnlySpan values) /// The span from which the vector is created. /// A new with its elements set to the first elements from . /// The length of is less than . - [MethodImpl(MethodImplOptions.AggressiveInlining)] public Vector(Span values) : this((ReadOnlySpan)values) { } @@ -134,12 +133,7 @@ public Vector(Span values) : this((ReadOnlySpan)values) public static Vector AllBitsSet { [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] - get - { - T scalar = Scalar.AllBitsSet; - return new Vector(scalar); - } + get => new Vector(Scalar.AllBitsSet); } #pragma warning disable CS8500 // This takes the address of, gets the size of, or declares a pointer to a managed type ('T') @@ -148,7 +142,6 @@ public static Vector AllBitsSet public static unsafe int Count { [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] get { ThrowHelper.ThrowForUnsupportedNumericsVectorBaseType(); @@ -202,20 +195,13 @@ public static bool IsSupported public static Vector One { [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] - get - { - T scalar = Scalar.One; - return new Vector(scalar); - } + get => new Vector(Scalar.One); } /// Gets a new with all elements initialized to zero. /// The type of the current instance () is not supported. public static Vector Zero { - [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] get { ThrowHelper.ThrowForUnsupportedNumericsVectorBaseType(); @@ -223,28 +209,14 @@ public static Vector Zero } } - internal string DisplayString - { - get - { - return IsSupported ? ToString() : SR.NotSupported_Type; - } - } + internal string DisplayString => IsSupported ? ToString() : SR.NotSupported_Type; /// Gets the element at the specified index. /// The index of the element to get. /// The value of the element at . /// The type of the current instance () is not supported. /// was less than zero or greater than the number of elements. - public T this[int index] - { - [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] - get - { - return this.GetElement(index); - } - } + public T this[int index] => this.GetElement(index); /// Adds two vectors to compute their sum. /// The vector to add with . @@ -394,120 +366,84 @@ public T this[int index] /// The vector to reinterpret. /// reinterpreted as a new . /// The type of () is not supported. - [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static explicit operator Vector(Vector value) => value.As(); /// Reinterprets a as a new . /// The vector to reinterpret. /// reinterpreted as a new . /// The type of () is not supported. - [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static explicit operator Vector(Vector value) => value.As(); /// Reinterprets a as a new . /// The vector to reinterpret. /// reinterpreted as a new . /// The type of () is not supported. - [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static explicit operator Vector(Vector value) => value.As(); /// Reinterprets a as a new . /// The vector to reinterpret. /// reinterpreted as a new . /// The type of () is not supported. - [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static explicit operator Vector(Vector value) => value.As(); /// Reinterprets a as a new . /// The vector to reinterpret. /// reinterpreted as a new . /// The type of () is not supported. - [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static explicit operator Vector(Vector value) => value.As(); /// Reinterprets a as a new . /// The vector to reinterpret. /// reinterpreted as a new . /// The type of () is not supported. - [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static explicit operator Vector(Vector value) => value.As(); /// Reinterprets a as a new . /// The vector to reinterpret. /// reinterpreted as a new . /// The type of () is not supported. - [Intrinsic] [CLSCompliant(false)] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static explicit operator Vector(Vector value) => value.As(); /// Reinterprets a as a new . /// The vector to reinterpret. /// reinterpreted as a new . /// The type of () is not supported. - [Intrinsic] [CLSCompliant(false)] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static explicit operator Vector(Vector value) => value.As(); /// Reinterprets a as a new . /// The vector to reinterpret. /// reinterpreted as a new . /// The type of () is not supported. - [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static explicit operator Vector(Vector value) => value.As(); /// Reinterprets a as a new . /// The vector to reinterpret. /// reinterpreted as a new . /// The type of () is not supported. - [Intrinsic] [CLSCompliant(false)] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static explicit operator Vector(Vector value) => value.As(); /// Reinterprets a as a new . /// The vector to reinterpret. /// reinterpreted as a new . /// The type of () is not supported. - [Intrinsic] [CLSCompliant(false)] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static explicit operator Vector(Vector value) => value.As(); /// Reinterprets a as a new . /// The vector to reinterpret. /// reinterpreted as a new . /// The type of () is not supported. - [Intrinsic] [CLSCompliant(false)] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static explicit operator Vector(Vector value) => value.As(); /// Compares two vectors to determine if any elements are not equal. /// The vector to compare with . /// The vector to compare with . /// true if any elements in was not equal to the corresponding element in . - [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static bool operator !=(Vector left, Vector right) - { - for (int index = 0; index < Count; index++) - { - if (!Scalar.Equals(left.GetElementUnsafe(index), right.GetElementUnsafe(index))) - { - return true; - } - } - return false; - } + public static bool operator !=(Vector left, Vector right) => !(left == right); /// Shifts each element of a vector left by the specified amount. /// The vector whose elements are to be shifted. @@ -552,26 +488,13 @@ public T this[int index] /// The scalar to multiply with . /// The product of and . [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static Vector operator *(Vector value, T factor) - { - Unsafe.SkipInit(out Vector result); - - for (int index = 0; index < Count; index++) - { - T element = Scalar.Multiply(value.GetElementUnsafe(index), factor); - result.SetElementUnsafe(index, element); - } - - return result; - } + public static Vector operator *(Vector value, T factor) => value * new Vector(factor); /// Multiplies a vector by a scalar to compute their product. /// The scalar to multiply with . /// The vector to multiply with . /// The product of and . [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector operator *(T factor, Vector value) => value * factor; /// Computes the ones-complement of a vector. @@ -637,15 +560,12 @@ public static Vector operator >>(Vector value, int shiftCount) /// The vector to negate. /// A vector whose elements are the unary negation of the corresponding elements in . [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector operator -(Vector value) => Zero - value; /// Returns a given vector unchanged. /// The vector. /// /// The type of the vector () is not supported. - [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector operator +(Vector value) { ThrowHelper.ThrowForUnsupportedNumericsVectorBaseType(); @@ -745,7 +665,6 @@ public void CopyTo(Span destination) /// Returns a boolean indicating whether the given Object is equal to this vector instance. /// The Object to compare against. /// True if the Object is equal to this vector; False otherwise. - [MethodImpl(MethodImplOptions.AggressiveInlining)] public override bool Equals([NotNullWhen(true)] object? obj) => (obj is Vector other) && Equals(other); /// Returns a boolean indicating whether the given vector is equal to this vector instance. diff --git a/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Vector128.cs b/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Vector128.cs index bc702b76a0bd4a..865b5c2d218c1f 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Vector128.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Vector128.cs @@ -70,8 +70,6 @@ public static Vector128 Abs(Vector128 vector) /// The vector to add with . /// The sum of and . /// The type of and () is not supported. - [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector128 Add(Vector128 left, Vector128 right) => left + right; /// Computes the bitwise-and of a given vector and the ones complement of another vector. @@ -95,14 +93,13 @@ public static Vector128 AndNot(Vector128 left, Vector128 right) /// The vector to reinterpret. /// reinterpreted as a new . /// The type of () or the type of the target () is not supported. - [Intrinsic] [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector128 As(this Vector128 vector) { ThrowHelper.ThrowForUnsupportedIntrinsicsVector128BaseType(); ThrowHelper.ThrowForUnsupportedIntrinsicsVector128BaseType(); - return Unsafe.As, Vector128>(ref vector); + return Unsafe.BitCast, Vector128>(vector); } /// Reinterprets a as a new . @@ -110,8 +107,6 @@ public static Vector128 As(this Vector128 vector) /// The vector to reinterpret. /// reinterpreted as a new . /// The type of () is not supported. - [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector128 AsByte(this Vector128 vector) => vector.As(); /// Reinterprets a as a new . @@ -119,8 +114,6 @@ public static Vector128 As(this Vector128 vector) /// The vector to reinterpret. /// reinterpreted as a new . /// The type of () is not supported. - [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector128 AsDouble(this Vector128 vector) => vector.As(); /// Reinterprets a as a new . @@ -128,8 +121,6 @@ public static Vector128 As(this Vector128 vector) /// The vector to reinterpret. /// reinterpreted as a new . /// The type of () is not supported. - [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector128 AsInt16(this Vector128 vector) => vector.As(); /// Reinterprets a as a new . @@ -137,8 +128,6 @@ public static Vector128 As(this Vector128 vector) /// The vector to reinterpret. /// reinterpreted as a new . /// The type of () is not supported. - [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector128 AsInt32(this Vector128 vector) => vector.As(); /// Reinterprets a as a new . @@ -146,8 +135,6 @@ public static Vector128 As(this Vector128 vector) /// The vector to reinterpret. /// reinterpreted as a new . /// The type of () is not supported. - [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector128 AsInt64(this Vector128 vector) => vector.As(); /// Reinterprets a as a new . @@ -155,8 +142,6 @@ public static Vector128 As(this Vector128 vector) /// The vector to reinterpret. /// reinterpreted as a new . /// The type of () is not supported. - [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector128 AsNInt(this Vector128 vector) => vector.As(); /// Reinterprets a as a new . @@ -164,33 +149,25 @@ public static Vector128 As(this Vector128 vector) /// The vector to reinterpret. /// reinterpreted as a new . /// The type of () is not supported. - [Intrinsic] [CLSCompliant(false)] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector128 AsNUInt(this Vector128 vector) => vector.As(); /// Reinterprets a as a new . /// The vector to reinterpret. /// reinterpreted as a new . - [MethodImpl(MethodImplOptions.AggressiveInlining)] - internal static Plane AsPlane(this Vector128 value) - => Unsafe.BitCast, Plane>(value); + internal static Plane AsPlane(this Vector128 value) => Unsafe.BitCast, Plane>(value); /// Reinterprets a as a new . /// The vector to reinterpret. /// reinterpreted as a new . - [MethodImpl(MethodImplOptions.AggressiveInlining)] - internal static Quaternion AsQuaternion(this Vector128 value) - => Unsafe.BitCast, Quaternion>(value); + internal static Quaternion AsQuaternion(this Vector128 value) => Unsafe.BitCast, Quaternion>(value); /// Reinterprets a as a new . /// The type of the elements in the vector. /// The vector to reinterpret. /// reinterpreted as a new . /// The type of () is not supported. - [Intrinsic] [CLSCompliant(false)] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector128 AsSByte(this Vector128 vector) => vector.As(); /// Reinterprets a as a new . @@ -198,8 +175,6 @@ internal static Quaternion AsQuaternion(this Vector128 value) /// The vector to reinterpret. /// reinterpreted as a new . /// The type of () is not supported. - [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector128 AsSingle(this Vector128 vector) => vector.As(); /// Reinterprets a as a new . @@ -207,9 +182,7 @@ internal static Quaternion AsQuaternion(this Vector128 value) /// The vector to reinterpret. /// reinterpreted as a new . /// The type of () is not supported. - [Intrinsic] [CLSCompliant(false)] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector128 AsUInt16(this Vector128 vector) => vector.As(); /// Reinterprets a as a new . @@ -217,9 +190,7 @@ internal static Quaternion AsQuaternion(this Vector128 value) /// The vector to reinterpret. /// reinterpreted as a new . /// The type of () is not supported. - [Intrinsic] [CLSCompliant(false)] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector128 AsUInt32(this Vector128 vector) => vector.As(); /// Reinterprets a as a new . @@ -227,47 +198,35 @@ internal static Quaternion AsQuaternion(this Vector128 value) /// The vector to reinterpret. /// reinterpreted as a new . /// The type of () is not supported. - [Intrinsic] [CLSCompliant(false)] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector128 AsUInt64(this Vector128 vector) => vector.As(); /// Reinterprets a as a new . /// The plane to reinterpret. /// reinterpreted as a new . - [MethodImpl(MethodImplOptions.AggressiveInlining)] - internal static Vector128 AsVector128(this Plane value) - => Unsafe.BitCast>(value); + internal static Vector128 AsVector128(this Plane value) => Unsafe.BitCast>(value); /// Reinterprets a as a new . /// The quaternion to reinterpret. /// reinterpreted as a new . - [MethodImpl(MethodImplOptions.AggressiveInlining)] - internal static Vector128 AsVector128(this Quaternion value) - => Unsafe.BitCast>(value); + internal static Vector128 AsVector128(this Quaternion value) => Unsafe.BitCast>(value); /// Reinterprets a as a new . /// The vector to reinterpret. /// reinterpreted as a new . [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static Vector128 AsVector128(this Vector2 value) - => new Vector4(value.X, value.Y, 0.0f, 0.0f).AsVector128(); + public static Vector128 AsVector128(this Vector2 value) => new Vector4(value.X, value.Y, 0.0f, 0.0f).AsVector128(); /// Reinterprets a as a new . /// The vector to reinterpret. /// reinterpreted as a new . [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static Vector128 AsVector128(this Vector3 value) - => new Vector4(value.X, value.Y, value.Z, 0.0f).AsVector128(); + public static Vector128 AsVector128(this Vector3 value) => new Vector4(value.X, value.Y, value.Z, 0.0f).AsVector128(); /// Reinterprets a as a new . /// The vector to reinterpret. /// reinterpreted as a new . - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static Vector128 AsVector128(this Vector4 value) - => Unsafe.BitCast>(value); + public static Vector128 AsVector128(this Vector4 value) => Unsafe.BitCast>(value); /// Reinterprets a as a new . /// The type of the elements in the vector. @@ -310,9 +269,7 @@ public static Vector3 AsVector3(this Vector128 value) /// Reinterprets a as a new . /// The vector to reinterpret. /// reinterpreted as a new . - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static Vector4 AsVector4(this Vector128 value) - => Unsafe.BitCast, Vector4>(value); + public static Vector4 AsVector4(this Vector128 value) => Unsafe.BitCast, Vector4>(value); /// Reinterprets a as a new . /// The type of the elements in the vector. @@ -337,8 +294,6 @@ public static Vector AsVector(this Vector128 value) /// The vector to bitwise-and with . /// The bitwise-and of and . /// The type of and () is not supported. - [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector128 BitwiseAnd(Vector128 left, Vector128 right) => left & right; /// Computes the bitwise-or of two vectors. @@ -347,8 +302,6 @@ public static Vector AsVector(this Vector128 value) /// The vector to bitwise-or with . /// The bitwise-or of and . /// The type of and () is not supported. - [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector128 BitwiseOr(Vector128 left, Vector128 right) => left | right; /// Computes the ceiling of each element in a vector. @@ -369,7 +322,6 @@ internal static Vector128 Ceiling(Vector128 vector) /// A vector whose elements are the ceiling of the elements in . /// [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector128 Ceiling(Vector128 vector) => Ceiling(vector); /// Computes the ceiling of each element in a vector. @@ -377,7 +329,6 @@ internal static Vector128 Ceiling(Vector128 vector) /// A vector whose elements are the ceiling of the elements in . /// [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector128 Ceiling(Vector128 vector) => Ceiling(vector); /// Conditionally selects a value from two vectors on a bitwise basis. @@ -726,7 +677,6 @@ public static void CopyTo(this Vector128 vector, Span destination) /// A new with all elements initialized to . /// The type of () is not supported. [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static unsafe Vector128 Create(T value) { Vector64 vector = Vector64.Create(value); @@ -738,7 +688,6 @@ public static unsafe Vector128 Create(T value) /// A new with all elements initialized to . /// On x86, this method corresponds to __m128i _mm_set1_epi8 [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static unsafe Vector128 Create(byte value) => Create(value); /// Creates a new instance with all elements initialized to the specified value. @@ -746,7 +695,6 @@ public static unsafe Vector128 Create(T value) /// A new with all elements initialized to . /// On x86, this method corresponds to __m128d _mm_set1_pd [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static unsafe Vector128 Create(double value) => Create(value); /// Creates a new instance with all elements initialized to the specified value. @@ -754,7 +702,6 @@ public static unsafe Vector128 Create(T value) /// A new with all elements initialized to . /// On x86, this method corresponds to __m128i _mm_set1_epi16 [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static unsafe Vector128 Create(short value) => Create(value); /// Creates a new instance with all elements initialized to the specified value. @@ -762,7 +709,6 @@ public static unsafe Vector128 Create(T value) /// A new with all elements initialized to . /// On x86, this method corresponds to __m128i _mm_set1_epi32 [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static unsafe Vector128 Create(int value) => Create(value); /// Creates a new instance with all elements initialized to the specified value. @@ -770,14 +716,12 @@ public static unsafe Vector128 Create(T value) /// A new with all elements initialized to . /// On x86, this method corresponds to __m128i _mm_set1_epi64x [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static unsafe Vector128 Create(long value) => Create(value); /// Creates a new instance with all elements initialized to the specified value. /// The value that all elements will be initialized to. /// A new with all elements initialized to . [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static unsafe Vector128 Create(nint value) => Create(value); /// Creates a new instance with all elements initialized to the specified value. @@ -785,7 +729,6 @@ public static unsafe Vector128 Create(T value) /// A new with all elements initialized to . [Intrinsic] [CLSCompliant(false)] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static unsafe Vector128 Create(nuint value) => Create(value); /// Creates a new instance with all elements initialized to the specified value. @@ -794,7 +737,6 @@ public static unsafe Vector128 Create(T value) /// On x86, this method corresponds to __m128i _mm_set1_epi8 [Intrinsic] [CLSCompliant(false)] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static unsafe Vector128 Create(sbyte value) => Create(value); /// Creates a new instance with all elements initialized to the specified value. @@ -802,7 +744,6 @@ public static unsafe Vector128 Create(T value) /// A new with all elements initialized to . /// On x86, this method corresponds to __m128 _mm_set1_ps [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static unsafe Vector128 Create(float value) => Create(value); /// Creates a new instance with all elements initialized to the specified value. @@ -811,7 +752,6 @@ public static unsafe Vector128 Create(T value) /// On x86, this method corresponds to __m128i _mm_set1_epi16 [Intrinsic] [CLSCompliant(false)] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static unsafe Vector128 Create(ushort value) => Create(value); /// Creates a new instance with all elements initialized to the specified value. @@ -820,7 +760,6 @@ public static unsafe Vector128 Create(T value) /// On x86, this method corresponds to __m128i _mm_set1_epi32 [Intrinsic] [CLSCompliant(false)] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static unsafe Vector128 Create(uint value) => Create(value); /// Creates a new instance with all elements initialized to the specified value. @@ -829,7 +768,6 @@ public static unsafe Vector128 Create(T value) /// On x86, this method corresponds to __m128i _mm_set1_epi64x [Intrinsic] [CLSCompliant(false)] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static unsafe Vector128 Create(ulong value) => Create(value); /// Creates a new from a given array. @@ -1119,21 +1057,18 @@ public static Vector128 Create(Vector64 lower, Vector64 upper) /// The value that the lower 64-bits will be initialized to. /// The value that the upper 64-bits will be initialized to. /// A new initialized from and . - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static unsafe Vector128 Create(Vector64 lower, Vector64 upper) => Create(lower, upper); /// Creates a new instance from two instances. /// The value that the lower 64-bits will be initialized to. /// The value that the upper 64-bits will be initialized to. /// A new initialized from and . - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static unsafe Vector128 Create(Vector64 lower, Vector64 upper) => Create(lower, upper); /// Creates a new instance from two instances. /// The value that the lower 64-bits will be initialized to. /// The value that the upper 64-bits will be initialized to. /// A new initialized from and . - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static unsafe Vector128 Create(Vector64 lower, Vector64 upper) => Create(lower, upper); /// Creates a new instance from two instances. @@ -1141,21 +1076,18 @@ public static Vector128 Create(Vector64 lower, Vector64 upper) /// The value that the upper 64-bits will be initialized to. /// On x86, this method corresponds to __m128i _mm_setr_epi64 /// A new initialized from and . - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static unsafe Vector128 Create(Vector64 lower, Vector64 upper) => Create(lower, upper); /// Creates a new instance from two instances. /// The value that the lower 64-bits will be initialized to. /// The value that the upper 64-bits will be initialized to. /// A new initialized from and . - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static unsafe Vector128 Create(Vector64 lower, Vector64 upper) => Create(lower, upper); /// Creates a new instance from two instances. /// The value that the lower 64-bits will be initialized to. /// The value that the upper 64-bits will be initialized to. /// A new initialized from and . - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static unsafe Vector128 Create(Vector64 lower, Vector64 upper) => Create(lower, upper); /// Creates a new instance from two instances. @@ -1163,7 +1095,6 @@ public static Vector128 Create(Vector64 lower, Vector64 upper) /// The value that the upper 64-bits will be initialized to. /// A new initialized from and . [CLSCompliant(false)] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static unsafe Vector128 Create(Vector64 lower, Vector64 upper) => Create(lower, upper); /// Creates a new instance from two instances. @@ -1171,14 +1102,12 @@ public static Vector128 Create(Vector64 lower, Vector64 upper) /// The value that the upper 64-bits will be initialized to. /// A new initialized from and . [CLSCompliant(false)] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static unsafe Vector128 Create(Vector64 lower, Vector64 upper) => Create(lower, upper); /// Creates a new instance from two instances. /// The value that the lower 64-bits will be initialized to. /// The value that the upper 64-bits will be initialized to. /// A new initialized from and . - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static unsafe Vector128 Create(Vector64 lower, Vector64 upper) => Create(lower, upper); /// Creates a new instance from two instances. @@ -1186,7 +1115,6 @@ public static Vector128 Create(Vector64 lower, Vector64 upper) /// The value that the upper 64-bits will be initialized to. /// A new initialized from and . [CLSCompliant(false)] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static unsafe Vector128 Create(Vector64 lower, Vector64 upper) => Create(lower, upper); /// Creates a new instance from two instances. @@ -1195,7 +1123,6 @@ public static Vector128 Create(Vector64 lower, Vector64 upper) /// On x86, this method corresponds to __m128i _mm_setr_epi64 /// A new initialized from and . [CLSCompliant(false)] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static unsafe Vector128 Create(Vector64 lower, Vector64 upper) => Create(lower, upper); /// Creates a new instance from two instances. @@ -1203,7 +1130,6 @@ public static Vector128 Create(Vector64 lower, Vector64 upper) /// The value that the upper 64-bits will be initialized to. /// A new initialized from and . [CLSCompliant(false)] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static unsafe Vector128 Create(Vector64 lower, Vector64 upper) => Create(lower, upper); /// Creates a new instance with the first element initialized to the specified value and the remaining elements initialized to zero. @@ -1212,49 +1138,42 @@ public static Vector128 Create(Vector64 lower, Vector64 upper) /// A new instance with the first element initialized to and the remaining elements initialized to zero. /// The type of () is not supported. [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static unsafe Vector128 CreateScalar(T value) => Vector64.CreateScalar(value).ToVector128(); /// Creates a new instance with the first element initialized to the specified value and the remaining elements initialized to zero. /// The value that element 0 will be initialized to. /// A new instance with the first element initialized to and the remaining elements initialized to zero. [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static unsafe Vector128 CreateScalar(byte value) => CreateScalar(value); /// Creates a new instance with the first element initialized to the specified value and the remaining elements initialized to zero. /// The value that element 0 will be initialized to. /// A new instance with the first element initialized to and the remaining elements initialized to zero. [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static unsafe Vector128 CreateScalar(double value) => CreateScalar(value); /// Creates a new instance with the first element initialized to the specified value and the remaining elements initialized to zero. /// The value that element 0 will be initialized to. /// A new instance with the first element initialized to and the remaining elements initialized to zero. [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static unsafe Vector128 CreateScalar(short value) => CreateScalar(value); /// Creates a new instance with the first element initialized to the specified value and the remaining elements initialized to zero. /// The value that element 0 will be initialized to. /// A new instance with the first element initialized to and the remaining elements initialized to zero. [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static unsafe Vector128 CreateScalar(int value) => CreateScalar(value); /// Creates a new instance with the first element initialized to the specified value and the remaining elements initialized to zero. /// The value that element 0 will be initialized to. /// A new instance with the first element initialized to and the remaining elements initialized to zero. [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static unsafe Vector128 CreateScalar(long value) => CreateScalar(value); /// Creates a new instance with the first element initialized to the specified value and the remaining elements initialized to zero. /// The value that element 0 will be initialized to. /// A new instance with the first element initialized to and the remaining elements initialized to zero. [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static unsafe Vector128 CreateScalar(nint value) => CreateScalar(value); /// Creates a new instance with the first element initialized to the specified value and the remaining elements initialized to zero. @@ -1262,7 +1181,6 @@ public static Vector128 Create(Vector64 lower, Vector64 upper) /// A new instance with the first element initialized to and the remaining elements initialized to zero. [Intrinsic] [CLSCompliant(false)] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static unsafe Vector128 CreateScalar(nuint value) => CreateScalar(value); /// Creates a new instance with the first element initialized to the specified value and the remaining elements initialized to zero. @@ -1270,14 +1188,12 @@ public static Vector128 Create(Vector64 lower, Vector64 upper) /// A new instance with the first element initialized to and the remaining elements initialized to zero. [Intrinsic] [CLSCompliant(false)] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static unsafe Vector128 CreateScalar(sbyte value) => CreateScalar(value); /// Creates a new instance with the first element initialized to the specified value and the remaining elements initialized to zero. /// The value that element 0 will be initialized to. /// A new instance with the first element initialized to and the remaining elements initialized to zero. [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static unsafe Vector128 CreateScalar(float value) => CreateScalar(value); /// Creates a new instance with the first element initialized to the specified value and the remaining elements initialized to zero. @@ -1285,7 +1201,6 @@ public static Vector128 Create(Vector64 lower, Vector64 upper) /// A new instance with the first element initialized to and the remaining elements initialized to zero. [Intrinsic] [CLSCompliant(false)] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static unsafe Vector128 CreateScalar(ushort value) => CreateScalar(value); /// Creates a new instance with the first element initialized to the specified value and the remaining elements initialized to zero. @@ -1293,7 +1208,6 @@ public static Vector128 Create(Vector64 lower, Vector64 upper) /// A new instance with the first element initialized to and the remaining elements initialized to zero. [Intrinsic] [CLSCompliant(false)] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static unsafe Vector128 CreateScalar(uint value) => CreateScalar(value); /// Creates a new instance with the first element initialized to the specified value and the remaining elements initialized to zero. @@ -1301,7 +1215,6 @@ public static Vector128 Create(Vector64 lower, Vector64 upper) /// A new instance with the first element initialized to and the remaining elements initialized to zero. [Intrinsic] [CLSCompliant(false)] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static unsafe Vector128 CreateScalar(ulong value) => CreateScalar(value); /// Creates a new instance with the first element initialized to the specified value and the remaining elements left uninitialized. @@ -1327,42 +1240,36 @@ public static Vector128 CreateScalarUnsafe(T value) /// The value that element 0 will be initialized to. /// A new instance with the first element initialized to and the remaining elements left uninitialized. [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static unsafe Vector128 CreateScalarUnsafe(byte value) => CreateScalarUnsafe(value); /// Creates a new instance with the first element initialized to the specified value and the remaining elements left uninitialized. /// The value that element 0 will be initialized to. /// A new instance with the first element initialized to and the remaining elements left uninitialized. [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static unsafe Vector128 CreateScalarUnsafe(double value) => CreateScalarUnsafe(value); /// Creates a new instance with the first element initialized to the specified value and the remaining elements left uninitialized. /// The value that element 0 will be initialized to. /// A new instance with the first element initialized to and the remaining elements left uninitialized. [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static unsafe Vector128 CreateScalarUnsafe(short value) => CreateScalarUnsafe(value); /// Creates a new instance with the first element initialized to the specified value and the remaining elements left uninitialized. /// The value that element 0 will be initialized to. /// A new instance with the first element initialized to and the remaining elements left uninitialized. [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static unsafe Vector128 CreateScalarUnsafe(int value) => CreateScalarUnsafe(value); /// Creates a new instance with the first element initialized to the specified value and the remaining elements left uninitialized. /// The value that element 0 will be initialized to. /// A new instance with the first element initialized to and the remaining elements left uninitialized. [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static unsafe Vector128 CreateScalarUnsafe(long value) => CreateScalarUnsafe(value); /// Creates a new instance with the first element initialized to the specified value and the remaining elements left uninitialized. /// The value that element 0 will be initialized to. /// A new instance with the first element initialized to and the remaining elements left uninitialized. [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static unsafe Vector128 CreateScalarUnsafe(nint value) => CreateScalarUnsafe(value); /// Creates a new instance with the first element initialized to the specified value and the remaining elements left uninitialized. @@ -1370,7 +1277,6 @@ public static Vector128 CreateScalarUnsafe(T value) /// A new instance with the first element initialized to and the remaining elements left uninitialized. [Intrinsic] [CLSCompliant(false)] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static unsafe Vector128 CreateScalarUnsafe(nuint value) => CreateScalarUnsafe(value); /// Creates a new instance with the first element initialized to the specified value and the remaining elements left uninitialized. @@ -1378,14 +1284,12 @@ public static Vector128 CreateScalarUnsafe(T value) /// A new instance with the first element initialized to and the remaining elements left uninitialized. [Intrinsic] [CLSCompliant(false)] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static unsafe Vector128 CreateScalarUnsafe(sbyte value) => CreateScalarUnsafe(value); /// Creates a new instance with the first element initialized to the specified value and the remaining elements left uninitialized. /// The value that element 0 will be initialized to. /// A new instance with the first element initialized to and the remaining elements left uninitialized. [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static unsafe Vector128 CreateScalarUnsafe(float value) => CreateScalarUnsafe(value); /// Creates a new instance with the first element initialized to the specified value and the remaining elements left uninitialized. @@ -1393,7 +1297,6 @@ public static Vector128 CreateScalarUnsafe(T value) /// A new instance with the first element initialized to and the remaining elements left uninitialized. [Intrinsic] [CLSCompliant(false)] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static unsafe Vector128 CreateScalarUnsafe(ushort value) => CreateScalarUnsafe(value); /// Creates a new instance with the first element initialized to the specified value and the remaining elements left uninitialized. @@ -1401,7 +1304,6 @@ public static Vector128 CreateScalarUnsafe(T value) /// A new instance with the first element initialized to and the remaining elements left uninitialized. [Intrinsic] [CLSCompliant(false)] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static unsafe Vector128 CreateScalarUnsafe(uint value) => CreateScalarUnsafe(value); /// Creates a new instance with the first element initialized to the specified value and the remaining elements left uninitialized. @@ -1409,7 +1311,6 @@ public static Vector128 CreateScalarUnsafe(T value) /// A new instance with the first element initialized to and the remaining elements left uninitialized. [Intrinsic] [CLSCompliant(false)] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static unsafe Vector128 CreateScalarUnsafe(ulong value) => CreateScalarUnsafe(value); /// Creates a new instance where the elements begin at a specified value and which are spaced apart according to another specified value. @@ -1427,8 +1328,6 @@ public static Vector128 CreateScalarUnsafe(T value) /// The vector that will divide . /// The quotient of divided by . /// The type of and () is not supported. - [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector128 Divide(Vector128 left, Vector128 right) => left / right; /// Divides a vector by a scalar to compute the per-element quotient. @@ -1436,8 +1335,6 @@ public static Vector128 CreateScalarUnsafe(T value) /// The scalar that will divide . /// The type of the elements in the vector. /// The quotient of divided by . - [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector128 Divide(Vector128 left, T right) => left / right; /// Computes the dot product of two vectors. @@ -1447,17 +1344,7 @@ public static Vector128 CreateScalarUnsafe(T value) /// The dot product of and . /// The type of and () is not supported. [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static T Dot(Vector128 left, Vector128 right) - { - // Doing this as Dot(lower) + Dot(upper) is important for floating-point determinism - // This is because the underlying dpps instruction on x86/x64 will do this equivalently - // and otherwise the software vs accelerated implementations may differ in returned result. - - T result = Vector64.Dot(left._lower, right._lower); - result = Scalar.Add(result, Vector64.Dot(left._upper, right._upper)); - return result; - } + public static T Dot(Vector128 left, Vector128 right) => Sum(left * right); /// Compares two vectors to determine if they are equal on a per-element basis. /// The type of the elements in the vector. @@ -1481,8 +1368,6 @@ public static Vector128 Equals(Vector128 left, Vector128 right) /// The vector to compare with . /// true if all elements in were equal to the corresponding element in . /// The type of and () is not supported. - [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static bool EqualsAll(Vector128 left, Vector128 right) => left == right; /// Compares two vectors to determine if any elements are equal. @@ -1566,7 +1451,6 @@ internal static Vector128 Floor(Vector128 vector) /// A vector whose elements are the floor of the elements in . /// [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector128 Floor(Vector128 vector) => Floor(vector); /// Computes the floor of each element in a vector. @@ -1574,7 +1458,6 @@ internal static Vector128 Floor(Vector128 vector) /// A vector whose elements are the floor of the elements in . /// [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector128 Floor(Vector128 vector) => Floor(vector); /// Gets the element at the specified index. @@ -1604,7 +1487,6 @@ public static T GetElement(this Vector128 vector, int index) /// The value of the lower 64-bits as a new . /// The type of () is not supported. [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector64 GetLower(this Vector128 vector) { ThrowHelper.ThrowForUnsupportedIntrinsicsVector128BaseType(); @@ -1617,7 +1499,6 @@ public static Vector64 GetLower(this Vector128 vector) /// The value of the upper 64-bits as a new . /// The type of () is not supported. [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector64 GetUpper(this Vector128 vector) { ThrowHelper.ThrowForUnsupportedIntrinsicsVector128BaseType(); @@ -1806,9 +1687,7 @@ public static bool LessThanOrEqualAny(Vector128 left, Vector128 right) /// The source from which the vector will be loaded. /// The vector loaded from . /// The type of () is not supported. - [Intrinsic] [CLSCompliant(false)] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static unsafe Vector128 Load(T* source) => LoadUnsafe(ref *source); /// Loads a vector from the given aligned source. @@ -1839,7 +1718,6 @@ public static unsafe Vector128 LoadAligned(T* source) /// The type of () is not supported. [Intrinsic] [CLSCompliant(false)] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static unsafe Vector128 LoadAlignedNonTemporal(T* source) => LoadAligned(source); #pragma warning restore CS8500 // This takes the address of, gets the size of, or declares a pointer to a managed type ('T') @@ -1876,17 +1754,13 @@ public static Vector128 LoadUnsafe(ref readonly T source, nuint elementOff /// Loads a vector from the given source and reinterprets it as . /// The source from which the vector will be loaded. /// The vector loaded from . - [MethodImpl(MethodImplOptions.AggressiveInlining)] - internal static Vector128 LoadUnsafe(ref char source) => - LoadUnsafe(ref Unsafe.As(ref source)); + internal static Vector128 LoadUnsafe(ref char source) => LoadUnsafe(ref Unsafe.As(ref source)); /// Loads a vector from the given source and element offset and reinterprets it as . /// The source to which will be added before loading the vector. /// The element offset from from which the vector will be loaded. /// The vector loaded from plus . - [MethodImpl(MethodImplOptions.AggressiveInlining)] - internal static Vector128 LoadUnsafe(ref char source, nuint elementOffset) => - LoadUnsafe(ref Unsafe.As(ref source), elementOffset); + internal static Vector128 LoadUnsafe(ref char source, nuint elementOffset) => LoadUnsafe(ref Unsafe.As(ref source), elementOffset); /// [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -1994,8 +1868,6 @@ public static Vector128 Min(Vector128 left, Vector128 right) /// The vector to multiply with . /// The element-wise product of and . /// The type of and () is not supported. - [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector128 Multiply(Vector128 left, Vector128 right) => left * right; /// Multiplies a vector by a scalar to compute their product. @@ -2004,8 +1876,6 @@ public static Vector128 Min(Vector128 left, Vector128 right) /// The scalar to multiply with . /// The product of and . /// The type of and () is not supported. - [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector128 Multiply(Vector128 left, T right) => left * right; /// Multiplies a vector by a scalar to compute their product. @@ -2014,8 +1884,6 @@ public static Vector128 Min(Vector128 left, Vector128 right) /// The vector to multiply with . /// The product of and . /// The type of and () is not supported. - [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector128 Multiply(T left, Vector128 right) => left * right; /// Narrows two instances into one . @@ -2125,8 +1993,6 @@ public static unsafe Vector128 Narrow(Vector128 lower, Vector128
    The vector to negate. /// A vector whose elements are the negation of the corresponding elements in . /// The type of () is not supported. - [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector128 Negate(Vector128 vector) => -vector; /// Computes the ones-complement of a vector. @@ -2134,243 +2000,185 @@ public static unsafe Vector128 Narrow(Vector128 lower, Vector128
      The vector whose ones-complement is to be computed. /// A vector whose elements are the ones-complement of the corresponding elements in . /// The type of () is not supported. - [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector128 OnesComplement(Vector128 vector) => ~vector; /// Shifts each element of a vector left by the specified amount. /// The vector whose elements are to be shifted. /// The number of bits by which to shift each element. /// A vector whose elements where shifted left by . - [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] internal static Vector128 ShiftLeft(Vector128 vector, int shiftCount) => vector << shiftCount; /// Shifts each element of a vector left by the specified amount. /// The vector whose elements are to be shifted. /// The number of bits by which to shift each element. /// A vector whose elements where shifted left by . - [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector128 ShiftLeft(Vector128 vector, int shiftCount) => vector << shiftCount; /// Shifts each element of a vector left by the specified amount. /// The vector whose elements are to be shifted. /// The number of bits by which to shift each element. /// A vector whose elements where shifted left by . - [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector128 ShiftLeft(Vector128 vector, int shiftCount) => vector << shiftCount; /// Shifts each element of a vector left by the specified amount. /// The vector whose elements are to be shifted. /// The number of bits by which to shift each element. /// A vector whose elements where shifted left by . - [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector128 ShiftLeft(Vector128 vector, int shiftCount) => vector << shiftCount; /// Shifts each element of a vector left by the specified amount. /// The vector whose elements are to be shifted. /// The number of bits by which to shift each element. /// A vector whose elements where shifted left by . - [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector128 ShiftLeft(Vector128 vector, int shiftCount) => vector << shiftCount; /// Shifts each element of a vector left by the specified amount. /// The vector whose elements are to be shifted. /// The number of bits by which to shift each element. /// A vector whose elements where shifted left by . - [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector128 ShiftLeft(Vector128 vector, int shiftCount) => vector << shiftCount; /// Shifts each element of a vector left by the specified amount. /// The vector whose elements are to be shifted. /// The number of bits by which to shift each element. /// A vector whose elements where shifted left by . - [Intrinsic] [CLSCompliant(false)] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector128 ShiftLeft(Vector128 vector, int shiftCount) => vector << shiftCount; /// Shifts each element of a vector left by the specified amount. /// The vector whose elements are to be shifted. /// The number of bits by which to shift each element. /// A vector whose elements where shifted left by . - [Intrinsic] [CLSCompliant(false)] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector128 ShiftLeft(Vector128 vector, int shiftCount) => vector << shiftCount; /// Shifts each element of a vector left by the specified amount. /// The vector whose elements are to be shifted. /// The number of bits by which to shift each element. /// A vector whose elements where shifted left by . - [Intrinsic] [CLSCompliant(false)] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector128 ShiftLeft(Vector128 vector, int shiftCount) => vector << shiftCount; /// Shifts each element of a vector left by the specified amount. /// The vector whose elements are to be shifted. /// The number of bits by which to shift each element. /// A vector whose elements where shifted left by . - [Intrinsic] [CLSCompliant(false)] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector128 ShiftLeft(Vector128 vector, int shiftCount) => vector << shiftCount; /// Shifts each element of a vector left by the specified amount. /// The vector whose elements are to be shifted. /// The number of bits by which to shift each element. /// A vector whose elements where shifted left by . - [Intrinsic] [CLSCompliant(false)] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector128 ShiftLeft(Vector128 vector, int shiftCount) => vector << shiftCount; /// Shifts (signed) each element of a vector right by the specified amount. /// The vector whose elements are to be shifted. /// The number of bits by which to shift each element. /// A vector whose elements where shifted right by . - [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] internal static Vector128 ShiftRightArithmetic(Vector128 vector, int shiftCount) => vector >> shiftCount; /// Shifts (signed) each element of a vector right by the specified amount. /// The vector whose elements are to be shifted. /// The number of bits by which to shift each element. /// A vector whose elements where shifted right by . - [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector128 ShiftRightArithmetic(Vector128 vector, int shiftCount) => vector >> shiftCount; /// Shifts (signed) each element of a vector right by the specified amount. /// The vector whose elements are to be shifted. /// The number of bits by which to shift each element. /// A vector whose elements where shifted right by . - [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector128 ShiftRightArithmetic(Vector128 vector, int shiftCount) => vector >> shiftCount; /// Shifts (signed) each element of a vector right by the specified amount. /// The vector whose elements are to be shifted. /// The number of bits by which to shift each element. /// A vector whose elements where shifted right by . - [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector128 ShiftRightArithmetic(Vector128 vector, int shiftCount) => vector >> shiftCount; /// Shifts (signed) each element of a vector right by the specified amount. /// The vector whose elements are to be shifted. /// The number of bits by which to shift each element. /// A vector whose elements where shifted right by . - [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector128 ShiftRightArithmetic(Vector128 vector, int shiftCount) => vector >> shiftCount; /// Shifts (signed) each element of a vector right by the specified amount. /// The vector whose elements are to be shifted. /// The number of bits by which to shift each element. /// A vector whose elements where shifted right by . - [Intrinsic] [CLSCompliant(false)] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector128 ShiftRightArithmetic(Vector128 vector, int shiftCount) => vector >> shiftCount; /// Shifts (unsigned) each element of a vector right by the specified amount. /// The vector whose elements are to be shifted. /// The number of bits by which to shift each element. /// A vector whose elements where shifted right by . - [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] internal static Vector128 ShiftRightLogical(Vector128 vector, int shiftCount) => vector >>> shiftCount; /// Shifts (unsigned) each element of a vector right by the specified amount. /// The vector whose elements are to be shifted. /// The number of bits by which to shift each element. /// A vector whose elements where shifted right by . - [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector128 ShiftRightLogical(Vector128 vector, int shiftCount) => vector >>> shiftCount; /// Shifts (unsigned) each element of a vector right by the specified amount. /// The vector whose elements are to be shifted. /// The number of bits by which to shift each element. /// A vector whose elements where shifted right by . - [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector128 ShiftRightLogical(Vector128 vector, int shiftCount) => vector >>> shiftCount; /// Shifts (unsigned) each element of a vector right by the specified amount. /// The vector whose elements are to be shifted. /// The number of bits by which to shift each element. /// A vector whose elements where shifted right by . - [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector128 ShiftRightLogical(Vector128 vector, int shiftCount) => vector >>> shiftCount; /// Shifts (unsigned) each element of a vector right by the specified amount. /// The vector whose elements are to be shifted. /// The number of bits by which to shift each element. /// A vector whose elements where shifted right by . - [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector128 ShiftRightLogical(Vector128 vector, int shiftCount) => vector >>> shiftCount; /// Shifts (unsigned) each element of a vector right by the specified amount. /// The vector whose elements are to be shifted. /// The number of bits by which to shift each element. /// A vector whose elements where shifted right by . - [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector128 ShiftRightLogical(Vector128 vector, int shiftCount) => vector >>> shiftCount; /// Shifts (unsigned) each element of a vector right by the specified amount. /// The vector whose elements are to be shifted. /// The number of bits by which to shift each element. /// A vector whose elements where shifted right by . - [Intrinsic] [CLSCompliant(false)] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector128 ShiftRightLogical(Vector128 vector, int shiftCount) => vector >>> shiftCount; /// Shifts (unsigned) each element of a vector right by the specified amount. /// The vector whose elements are to be shifted. /// The number of bits by which to shift each element. /// A vector whose elements where shifted right by . - [Intrinsic] [CLSCompliant(false)] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector128 ShiftRightLogical(Vector128 vector, int shiftCount) => vector >>> shiftCount; /// Shifts (unsigned) each element of a vector right by the specified amount. /// The vector whose elements are to be shifted. /// The number of bits by which to shift each element. /// A vector whose elements where shifted right by . - [Intrinsic] [CLSCompliant(false)] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector128 ShiftRightLogical(Vector128 vector, int shiftCount) => vector >>> shiftCount; /// Shifts (unsigned) each element of a vector right by the specified amount. /// The vector whose elements are to be shifted. /// The number of bits by which to shift each element. /// A vector whose elements where shifted right by . - [Intrinsic] [CLSCompliant(false)] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector128 ShiftRightLogical(Vector128 vector, int shiftCount) => vector >>> shiftCount; /// Shifts (unsigned) each element of a vector right by the specified amount. /// The vector whose elements are to be shifted. /// The number of bits by which to shift each element. /// A vector whose elements where shifted right by . - [Intrinsic] [CLSCompliant(false)] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector128 ShiftRightLogical(Vector128 vector, int shiftCount) => vector >>> shiftCount; /// Creates a new vector by selecting values from an input vector using a set of indices. @@ -2670,9 +2478,7 @@ public static Vector128 Sqrt(Vector128 vector) /// The vector that will be stored. /// The destination at which will be stored. /// The type of () is not supported. - [Intrinsic] [CLSCompliant(false)] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static unsafe void Store(this Vector128 source, T* destination) => source.StoreUnsafe(ref *destination); /// Stores a vector at the given aligned destination. @@ -2703,7 +2509,6 @@ public static unsafe void StoreAligned(this Vector128 source, T* destinati /// The type of () is not supported. [Intrinsic] [CLSCompliant(false)] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static unsafe void StoreAlignedNonTemporal(this Vector128 source, T* destination) => source.StoreAligned(destination); #pragma warning restore CS8500 // This takes the address of, gets the size of, or declares a pointer to a managed type ('T') @@ -2760,8 +2565,6 @@ public static void StoreUnsafe(this Vector128 source, ref T destination, n /// The vector to subtract from . /// The difference of and . /// The type of and () is not supported. - [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector128 Subtract(Vector128 left, Vector128 right) => left - right; /// Computes the sum of all elements in a vector. @@ -2789,7 +2592,6 @@ public static T Sum(Vector128 vector) /// A scalar containing the value of the first element. /// The type of () is not supported. [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static T ToScalar(this Vector128 vector) { ThrowHelper.ThrowForUnsupportedIntrinsicsVector128BaseType(); @@ -3175,8 +2977,6 @@ public static Vector128 WithUpper(this Vector128 vector, Vector64 va /// The vector to exclusive-or with . /// The exclusive-or of and . /// The type of and () is not supported. - [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector128 Xor(Vector128 left, Vector128 right) => left ^ right; [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -3196,16 +2996,10 @@ internal static void SetElementUnsafe(in this Vector128 vector, int index, } [MethodImpl(MethodImplOptions.AggressiveInlining)] - internal static void SetLowerUnsafe(in this Vector128 vector, Vector64 value) - { - Unsafe.AsRef(in vector._lower) = value; - } + internal static void SetLowerUnsafe(in this Vector128 vector, Vector64 value) => Unsafe.AsRef(in vector._lower) = value; [MethodImpl(MethodImplOptions.AggressiveInlining)] - internal static void SetUpperUnsafe(in this Vector128 vector, Vector64 value) - { - Unsafe.AsRef(in vector._upper) = value; - } + internal static void SetUpperUnsafe(in this Vector128 vector, Vector64 value) => Unsafe.AsRef(in vector._upper) = value; [MethodImpl(MethodImplOptions.AggressiveInlining)] [CompExactlyDependsOn(typeof(AdvSimd.Arm64))] diff --git a/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Vector128_1.cs b/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Vector128_1.cs index 23f027f12f7184..bbd89f973c7c9d 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Vector128_1.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Vector128_1.cs @@ -39,7 +39,6 @@ namespace System.Runtime.Intrinsics public static Vector128 AllBitsSet { [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] get { Vector64 vector = Vector64.AllBitsSet; @@ -52,11 +51,7 @@ public static Vector128 AllBitsSet public static int Count { [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] - get - { - return Vector64.Count * 2; - } + get => Vector64.Count * 2; } /// Gets a new with the elements set to their index. @@ -107,7 +102,6 @@ public static bool IsSupported public static Vector128 One { [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] get { Vector64 vector = Vector64.One; @@ -119,8 +113,6 @@ public static Vector128 One /// The type of the vector () is not supported. public static Vector128 Zero { - [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] get { ThrowHelper.ThrowForUnsupportedIntrinsicsVector128BaseType(); @@ -128,27 +120,14 @@ public static Vector128 Zero } } - internal string DisplayString - { - get - { - return IsSupported ? ToString() : SR.NotSupported_Type; - } - } + internal string DisplayString => IsSupported ? ToString() : SR.NotSupported_Type; /// Gets the element at the specified index. /// The index of the element to get. /// The value of the element at . /// was less than zero or greater than the number of elements. /// The type of the vector () is not supported. - public T this[int index] - { - [MethodImpl(MethodImplOptions.AggressiveInlining)] - get - { - return this.GetElement(index); - } - } + public T this[int index] => this.GetElement(index); /// Adds two vectors to compute their sum. /// The vector to add with . @@ -258,12 +237,7 @@ public T this[int index] /// true if any elements in was not equal to the corresponding element in . /// The type of the vector () is not supported. [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static bool operator !=(Vector128 left, Vector128 right) - { - return (left._lower != right._lower) - || (left._upper != right._upper); - } + public static bool operator !=(Vector128 left, Vector128 right) => !(left == right); /// Shifts each element of a vector left by the specified amount. /// The vector whose elements are to be shifted. @@ -379,8 +353,6 @@ public static Vector128 operator >>(Vector128 value, int shiftCount) /// The vector. /// /// The type of the vector () is not supported. - [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector128 operator +(Vector128 value) { ThrowHelper.ThrowForUnsupportedIntrinsicsVector128BaseType(); @@ -405,14 +377,13 @@ public static Vector128 operator >>>(Vector128 value, int shiftCount) /// The object to compare with the current instance. /// true if is a and is equal to the current instance; otherwise, false. /// The type of the vector () is not supported. - [MethodImpl(MethodImplOptions.AggressiveInlining)] public override bool Equals([NotNullWhen(true)] object? obj) => (obj is Vector128 other) && Equals(other); // Account for floating-point equality around NaN // This is in a separate method so it can be optimized by the mono interpreter/jiterpreter [Intrinsic] [MethodImpl(MethodImplOptions.AggressiveInlining)] - internal static bool EqualsFloatingPoint (Vector128 lhs, Vector128 rhs) + internal static bool EqualsFloatingPoint(Vector128 lhs, Vector128 rhs) { Vector128 result = Vector128.Equals(lhs, rhs) | ~(Vector128.Equals(lhs, lhs) | Vector128.Equals(rhs, rhs)); return result.AsInt32() == Vector128.AllBitsSet; @@ -464,7 +435,6 @@ public override int GetHashCode() /// Converts the current instance to an equivalent string representation. /// An equivalent string representation of the current instance. /// The type of the vector () is not supported. - [MethodImpl(MethodImplOptions.AggressiveInlining)] public override string ToString() => ToString("G", CultureInfo.InvariantCulture); private string ToString([StringSyntax(StringSyntaxAttribute.NumericFormat)] string? format, IFormatProvider? formatProvider) @@ -692,15 +662,9 @@ private string ToString([StringSyntax(StringSyntaxAttribute.NumericFormat)] stri // New Surface Area // - static bool ISimdVector, T>.AnyWhereAllBitsSet(Vector128 vector) - { - return Vector128.EqualsAny(vector, Vector128.AllBitsSet); - } + static bool ISimdVector, T>.AnyWhereAllBitsSet(Vector128 vector) => Vector128.EqualsAny(vector, AllBitsSet); - static bool ISimdVector, T>.Any(Vector128 vector, T value) - { - return Vector128.EqualsAny(vector, Vector128.Create((T)value)); - } + static bool ISimdVector, T>.Any(Vector128 vector, T value) => Vector128.EqualsAny(vector, Vector128.Create(value)); static int ISimdVector, T>.IndexOfLastMatch(Vector128 vector) { diff --git a/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Vector256.cs b/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Vector256.cs index 4d174eef197544..97e909e271588c 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Vector256.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Vector256.cs @@ -73,8 +73,6 @@ public static Vector256 Abs(Vector256 vector) /// The vector to add with . /// The sum of and . /// The type of and () is not supported. - [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector256 Add(Vector256 left, Vector256 right) => left + right; /// Computes the bitwise-and of a given vector and the ones complement of another vector. @@ -99,14 +97,13 @@ public static Vector256 AndNot(Vector256 left, Vector256 right) /// The vector to reinterpret. /// reinterpreted as a new . /// The type of () or the type of the target () is not supported. - [Intrinsic] [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector256 As(this Vector256 vector) { ThrowHelper.ThrowForUnsupportedIntrinsicsVector256BaseType(); ThrowHelper.ThrowForUnsupportedIntrinsicsVector256BaseType(); - return Unsafe.As, Vector256>(ref vector); + return Unsafe.BitCast, Vector256>(vector); } /// Reinterprets a as a new . @@ -114,8 +111,6 @@ public static Vector256 As(this Vector256 vector) /// The vector to reinterpret. /// reinterpreted as a new . /// The type of () is not supported. - [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector256 AsByte(this Vector256 vector) => vector.As(); /// Reinterprets a as a new . @@ -123,8 +118,6 @@ public static Vector256 As(this Vector256 vector) /// The vector to reinterpret. /// reinterpreted as a new . /// The type of () is not supported. - [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector256 AsDouble(this Vector256 vector) => vector.As(); /// Reinterprets a as a new . @@ -132,8 +125,6 @@ public static Vector256 As(this Vector256 vector) /// The vector to reinterpret. /// reinterpreted as a new . /// The type of () is not supported. - [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector256 AsInt16(this Vector256 vector) => vector.As(); /// Reinterprets a as a new . @@ -141,8 +132,6 @@ public static Vector256 As(this Vector256 vector) /// The vector to reinterpret. /// reinterpreted as a new . /// The type of () is not supported. - [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector256 AsInt32(this Vector256 vector) => vector.As(); /// Reinterprets a as a new . @@ -150,8 +139,6 @@ public static Vector256 As(this Vector256 vector) /// The vector to reinterpret. /// reinterpreted as a new . /// The type of () is not supported. - [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector256 AsInt64(this Vector256 vector) => vector.As(); /// Reinterprets a as a new . @@ -159,8 +146,6 @@ public static Vector256 As(this Vector256 vector) /// The vector to reinterpret. /// reinterpreted as a new . /// The type of () is not supported. - [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector256 AsNInt(this Vector256 vector) => vector.As(); /// Reinterprets a as a new . @@ -168,9 +153,7 @@ public static Vector256 As(this Vector256 vector) /// The vector to reinterpret. /// reinterpreted as a new . /// The type of () is not supported. - [Intrinsic] [CLSCompliant(false)] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector256 AsNUInt(this Vector256 vector) => vector.As(); /// Reinterprets a as a new . @@ -178,9 +161,7 @@ public static Vector256 As(this Vector256 vector) /// The vector to reinterpret. /// reinterpreted as a new . /// The type of () is not supported. - [Intrinsic] [CLSCompliant(false)] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector256 AsSByte(this Vector256 vector) => vector.As(); /// Reinterprets a as a new . @@ -188,8 +169,6 @@ public static Vector256 As(this Vector256 vector) /// The vector to reinterpret. /// reinterpreted as a new . /// The type of () is not supported. - [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector256 AsSingle(this Vector256 vector) => vector.As(); /// Reinterprets a as a new . @@ -197,9 +176,7 @@ public static Vector256 As(this Vector256 vector) /// The vector to reinterpret. /// reinterpreted as a new . /// The type of () is not supported. - [Intrinsic] [CLSCompliant(false)] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector256 AsUInt16(this Vector256 vector) => vector.As(); /// Reinterprets a as a new . @@ -207,9 +184,7 @@ public static Vector256 As(this Vector256 vector) /// The vector to reinterpret. /// reinterpreted as a new . /// The type of () is not supported. - [Intrinsic] [CLSCompliant(false)] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector256 AsUInt32(this Vector256 vector) => vector.As(); /// Reinterprets a as a new . @@ -217,9 +192,7 @@ public static Vector256 As(this Vector256 vector) /// The vector to reinterpret. /// reinterpreted as a new . /// The type of () is not supported. - [Intrinsic] [CLSCompliant(false)] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector256 AsUInt64(this Vector256 vector) => vector.As(); /// Reinterprets a as a new . @@ -261,8 +234,6 @@ public static Vector AsVector(this Vector256 value) /// The vector to bitwise-and with . /// The bitwise-and of and . /// The type of and () is not supported. - [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector256 BitwiseAnd(Vector256 left, Vector256 right) => left & right; /// Computes the bitwise-or of two vectors. @@ -271,8 +242,6 @@ public static Vector AsVector(this Vector256 value) /// The vector to bitwise-or with . /// The bitwise-or of and . /// The type of and () is not supported. - [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector256 BitwiseOr(Vector256 left, Vector256 right) => left | right; /// Computes the ceiling of each element in a vector. @@ -293,7 +262,6 @@ internal static Vector256 Ceiling(Vector256 vector) /// A vector whose elements are the ceiling of the elements in . /// [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector256 Ceiling(Vector256 vector) => Ceiling(vector); /// Computes the ceiling of each element in a vector. @@ -301,7 +269,6 @@ internal static Vector256 Ceiling(Vector256 vector) /// A vector whose elements are the ceiling of the elements in . /// [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector256 Ceiling(Vector256 vector) => Ceiling(vector); /// Conditionally selects a value from two vectors on a bitwise basis. @@ -624,7 +591,6 @@ public static void CopyTo(this Vector256 vector, Span destination) /// A new with all elements initialized to . /// The type of () is not supported. [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector256 Create(T value) { Vector128 vector = Vector128.Create(value); @@ -636,7 +602,6 @@ public static Vector256 Create(T value) /// A new with all elements initialized to . /// On x86, this method corresponds to __m256i _mm256_set1_epi8 [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector256 Create(byte value) => Create(value); /// Creates a new instance with all elements initialized to the specified value. @@ -644,7 +609,6 @@ public static Vector256 Create(T value) /// A new with all elements initialized to . /// On x86, this method corresponds to __m256d _mm256_set1_pd [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector256 Create(double value) => Create(value); /// Creates a new instance with all elements initialized to the specified value. @@ -652,7 +616,6 @@ public static Vector256 Create(T value) /// A new with all elements initialized to . /// On x86, this method corresponds to __m256i _mm256_set1_epi16 [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector256 Create(short value) => Create(value); /// Creates a new instance with all elements initialized to the specified value. @@ -660,7 +623,6 @@ public static Vector256 Create(T value) /// A new with all elements initialized to . /// On x86, this method corresponds to __m256i _mm256_set1_epi32 [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector256 Create(int value) => Create(value); /// Creates a new instance with all elements initialized to the specified value. @@ -668,14 +630,12 @@ public static Vector256 Create(T value) /// A new with all elements initialized to . /// On x86, this method corresponds to __m256i _mm256_set1_epi64x [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector256 Create(long value) => Create(value); /// Creates a new instance with all elements initialized to the specified value. /// The value that all elements will be initialized to. /// A new with all elements initialized to . [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector256 Create(nint value) => Create(value); /// Creates a new instance with all elements initialized to the specified value. @@ -683,7 +643,6 @@ public static Vector256 Create(T value) /// A new with all elements initialized to . [Intrinsic] [CLSCompliant(false)] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector256 Create(nuint value) => Create(value); /// Creates a new instance with all elements initialized to the specified value. @@ -692,7 +651,6 @@ public static Vector256 Create(T value) /// On x86, this method corresponds to __m256i _mm256_set1_epi8 [Intrinsic] [CLSCompliant(false)] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector256 Create(sbyte value) => Create(value); /// Creates a new instance with all elements initialized to the specified value. @@ -700,7 +658,6 @@ public static Vector256 Create(T value) /// A new with all elements initialized to . /// On x86, this method corresponds to __m256 _mm256_set1_ps [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector256 Create(float value) => Create(value); /// Creates a new instance with all elements initialized to the specified value. @@ -709,7 +666,6 @@ public static Vector256 Create(T value) /// On x86, this method corresponds to __m256i _mm256_set1_epi16 [Intrinsic] [CLSCompliant(false)] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector256 Create(ushort value) => Create(value); /// Creates a new instance with all elements initialized to the specified value. @@ -718,7 +674,6 @@ public static Vector256 Create(T value) /// On x86, this method corresponds to __m256i _mm256_set1_epi32 [Intrinsic] [CLSCompliant(false)] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector256 Create(uint value) => Create(value); /// Creates a new instance with all elements initialized to the specified value. @@ -727,7 +682,6 @@ public static Vector256 Create(T value) /// On x86, this method corresponds to __m256i _mm256_set1_epi64x [Intrinsic] [CLSCompliant(false)] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector256 Create(ulong value) => Create(value); /// Creates a new from a given array. @@ -1086,7 +1040,6 @@ public static Vector256 Create(Vector128 lower, Vector128 upper) /// The value that the lower 128-bits will be initialized to. /// The value that the upper 128-bits will be initialized to. /// A new initialized from and . - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector256 Create(Vector128 lower, Vector128 upper) => Create(lower, upper); /// Creates a new instance from two instances. @@ -1094,14 +1047,12 @@ public static Vector256 Create(Vector128 lower, Vector128 upper) /// The value that the upper 128-bits will be initialized to. /// A new initialized from and . /// On x86, this method corresponds to __m256d _mm256_setr_m128d (__m128d lo, __m128d hi) - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector256 Create(Vector128 lower, Vector128 upper) => Create(lower, upper); /// Creates a new instance from two instances. /// The value that the lower 128-bits will be initialized to. /// The value that the upper 128-bits will be initialized to. /// A new initialized from and . - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector256 Create(Vector128 lower, Vector128 upper) => Create(lower, upper); /// Creates a new instance from two instances. @@ -1109,21 +1060,18 @@ public static Vector256 Create(Vector128 lower, Vector128 upper) /// The value that the upper 128-bits will be initialized to. /// A new initialized from and . /// On x86, this method corresponds to __m256i _mm256_setr_m128i (__m128i lo, __m128i hi) - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector256 Create(Vector128 lower, Vector128 upper) => Create(lower, upper); /// Creates a new instance from two instances. /// The value that the lower 128-bits will be initialized to. /// The value that the upper 128-bits will be initialized to. /// A new initialized from and . - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector256 Create(Vector128 lower, Vector128 upper) => Create(lower, upper); /// Creates a new instance from two instances. /// The value that the lower 128-bits will be initialized to. /// The value that the upper 128-bits will be initialized to. /// A new initialized from and . - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector256 Create(Vector128 lower, Vector128 upper) => Create(lower, upper); /// Creates a new instance from two instances. @@ -1131,7 +1079,6 @@ public static Vector256 Create(Vector128 lower, Vector128 upper) /// The value that the upper 128-bits will be initialized to. /// A new initialized from and . [CLSCompliant(false)] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector256 Create(Vector128 lower, Vector128 upper) => Create(lower, upper); /// Creates a new instance from two instances. @@ -1139,7 +1086,6 @@ public static Vector256 Create(Vector128 lower, Vector128 upper) /// The value that the upper 128-bits will be initialized to. /// A new initialized from and . [CLSCompliant(false)] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector256 Create(Vector128 lower, Vector128 upper) => Create(lower, upper); /// Creates a new instance from two instances. @@ -1147,7 +1093,6 @@ public static Vector256 Create(Vector128 lower, Vector128 upper) /// The value that the upper 128-bits will be initialized to. /// A new initialized from and . /// On x86, this method corresponds to __m256 _mm256_setr_m128 (__m128 lo, __m128 hi) - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector256 Create(Vector128 lower, Vector128 upper) => Create(lower, upper); /// Creates a new instance from two instances. @@ -1155,7 +1100,6 @@ public static Vector256 Create(Vector128 lower, Vector128 upper) /// The value that the upper 128-bits will be initialized to. /// A new initialized from and . [CLSCompliant(false)] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector256 Create(Vector128 lower, Vector128 upper) => Create(lower, upper); /// Creates a new instance from two instances. @@ -1164,7 +1108,6 @@ public static Vector256 Create(Vector128 lower, Vector128 upper) /// A new initialized from and . /// On x86, this method corresponds to __m256i _mm256_setr_m128i (__m128i lo, __m128i hi) [CLSCompliant(false)] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector256 Create(Vector128 lower, Vector128 upper) => Create(lower, upper); /// Creates a new instance from two instances. @@ -1172,7 +1115,6 @@ public static Vector256 Create(Vector128 lower, Vector128 upper) /// The value that the upper 128-bits will be initialized to. /// A new initialized from and . [CLSCompliant(false)] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector256 Create(Vector128 lower, Vector128 upper) => Create(lower, upper); /// Creates a new instance with the first element initialized to the specified value and the remaining elements initialized to zero. @@ -1181,49 +1123,42 @@ public static Vector256 Create(Vector128 lower, Vector128 upper) /// A new instance with the first element initialized to and the remaining elements initialized to zero. /// The type of () is not supported. [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector256 CreateScalar(T value) => Vector128.CreateScalar(value).ToVector256(); /// Creates a new instance with the first element initialized to the specified value and the remaining elements initialized to zero. /// The value that element 0 will be initialized to. /// A new instance with the first element initialized to and the remaining elements initialized to zero. [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector256 CreateScalar(byte value) => CreateScalar(value); /// Creates a new instance with the first element initialized to the specified value and the remaining elements initialized to zero. /// The value that element 0 will be initialized to. /// A new instance with the first element initialized to and the remaining elements initialized to zero. [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector256 CreateScalar(double value) => CreateScalar(value); /// Creates a new instance with the first element initialized to the specified value and the remaining elements initialized to zero. /// The value that element 0 will be initialized to. /// A new instance with the first element initialized to and the remaining elements initialized to zero. [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector256 CreateScalar(short value) => CreateScalar(value); /// Creates a new instance with the first element initialized to the specified value and the remaining elements initialized to zero. /// The value that element 0 will be initialized to. /// A new instance with the first element initialized to and the remaining elements initialized to zero. [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector256 CreateScalar(int value) => CreateScalar(value); /// Creates a new instance with the first element initialized to the specified value and the remaining elements initialized to zero. /// The value that element 0 will be initialized to. /// A new instance with the first element initialized to and the remaining elements initialized to zero. [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector256 CreateScalar(long value) => CreateScalar(value); /// Creates a new instance with the first element initialized to the specified value and the remaining elements initialized to zero. /// The value that element 0 will be initialized to. /// A new instance with the first element initialized to and the remaining elements initialized to zero. [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector256 CreateScalar(nint value) => CreateScalar(value); /// Creates a new instance with the first element initialized to the specified value and the remaining elements initialized to zero. @@ -1231,7 +1166,6 @@ public static Vector256 Create(Vector128 lower, Vector128 upper) /// A new instance with the first element initialized to and the remaining elements initialized to zero. [Intrinsic] [CLSCompliant(false)] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector256 CreateScalar(nuint value) => CreateScalar(value); /// Creates a new instance with the first element initialized to the specified value and the remaining elements initialized to zero. @@ -1239,14 +1173,12 @@ public static Vector256 Create(Vector128 lower, Vector128 upper) /// A new instance with the first element initialized to and the remaining elements initialized to zero. [Intrinsic] [CLSCompliant(false)] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector256 CreateScalar(sbyte value) => CreateScalar(value); /// Creates a new instance with the first element initialized to the specified value and the remaining elements initialized to zero. /// The value that element 0 will be initialized to. /// A new instance with the first element initialized to and the remaining elements initialized to zero. [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector256 CreateScalar(float value) => CreateScalar(value); /// Creates a new instance with the first element initialized to the specified value and the remaining elements initialized to zero. @@ -1254,7 +1186,6 @@ public static Vector256 Create(Vector128 lower, Vector128 upper) /// A new instance with the first element initialized to and the remaining elements initialized to zero. [Intrinsic] [CLSCompliant(false)] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector256 CreateScalar(ushort value) => CreateScalar(value); /// Creates a new instance with the first element initialized to the specified value and the remaining elements initialized to zero. @@ -1262,7 +1193,6 @@ public static Vector256 Create(Vector128 lower, Vector128 upper) /// A new instance with the first element initialized to and the remaining elements initialized to zero. [Intrinsic] [CLSCompliant(false)] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector256 CreateScalar(uint value) => CreateScalar(value); /// Creates a new instance with the first element initialized to the specified value and the remaining elements initialized to zero. @@ -1270,7 +1200,6 @@ public static Vector256 Create(Vector128 lower, Vector128 upper) /// A new instance with the first element initialized to and the remaining elements initialized to zero. [Intrinsic] [CLSCompliant(false)] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector256 CreateScalar(ulong value) => CreateScalar(value); /// Creates a new instance with the first element initialized to the specified value and the remaining elements left uninitialized. @@ -1296,42 +1225,36 @@ public static Vector256 CreateScalarUnsafe(T value) /// The value that element 0 will be initialized to. /// A new instance with the first element initialized to and the remaining elements left uninitialized. [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector256 CreateScalarUnsafe(byte value) => CreateScalarUnsafe(value); /// Creates a new instance with the first element initialized to the specified value and the remaining elements left uninitialized. /// The value that element 0 will be initialized to. /// A new instance with the first element initialized to and the remaining elements left uninitialized. [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector256 CreateScalarUnsafe(double value) => CreateScalarUnsafe(value); /// Creates a new instance with the first element initialized to the specified value and the remaining elements left uninitialized. /// The value that element 0 will be initialized to. /// A new instance with the first element initialized to and the remaining elements left uninitialized. [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector256 CreateScalarUnsafe(short value) => CreateScalarUnsafe(value); /// Creates a new instance with the first element initialized to the specified value and the remaining elements left uninitialized. /// The value that element 0 will be initialized to. /// A new instance with the first element initialized to and the remaining elements left uninitialized. [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector256 CreateScalarUnsafe(int value) => CreateScalarUnsafe(value); /// Creates a new instance with the first element initialized to the specified value and the remaining elements left uninitialized. /// The value that element 0 will be initialized to. /// A new instance with the first element initialized to and the remaining elements left uninitialized. [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector256 CreateScalarUnsafe(long value) => CreateScalarUnsafe(value); /// Creates a new instance with the first element initialized to the specified value and the remaining elements left uninitialized. /// The value that element 0 will be initialized to. /// A new instance with the first element initialized to and the remaining elements left uninitialized. [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector256 CreateScalarUnsafe(nint value) => CreateScalarUnsafe(value); /// Creates a new instance with the first element initialized to the specified value and the remaining elements left uninitialized. @@ -1339,7 +1262,6 @@ public static Vector256 CreateScalarUnsafe(T value) /// A new instance with the first element initialized to and the remaining elements left uninitialized. [Intrinsic] [CLSCompliant(false)] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector256 CreateScalarUnsafe(nuint value) => CreateScalarUnsafe(value); /// Creates a new instance with the first element initialized to the specified value and the remaining elements left uninitialized. @@ -1347,14 +1269,12 @@ public static Vector256 CreateScalarUnsafe(T value) /// A new instance with the first element initialized to and the remaining elements left uninitialized. [Intrinsic] [CLSCompliant(false)] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector256 CreateScalarUnsafe(sbyte value) => CreateScalarUnsafe(value); /// Creates a new instance with the first element initialized to the specified value and the remaining elements left uninitialized. /// The value that element 0 will be initialized to. /// A new instance with the first element initialized to and the remaining elements left uninitialized. [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector256 CreateScalarUnsafe(float value) => CreateScalarUnsafe(value); /// Creates a new instance with the first element initialized to the specified value and the remaining elements left uninitialized. @@ -1362,7 +1282,6 @@ public static Vector256 CreateScalarUnsafe(T value) /// A new instance with the first element initialized to and the remaining elements left uninitialized. [Intrinsic] [CLSCompliant(false)] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector256 CreateScalarUnsafe(ushort value) => CreateScalarUnsafe(value); /// Creates a new instance with the first element initialized to the specified value and the remaining elements left uninitialized. @@ -1370,7 +1289,6 @@ public static Vector256 CreateScalarUnsafe(T value) /// A new instance with the first element initialized to and the remaining elements left uninitialized. [Intrinsic] [CLSCompliant(false)] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector256 CreateScalarUnsafe(uint value) => CreateScalarUnsafe(value); /// Creates a new instance with the first element initialized to the specified value and the remaining elements left uninitialized. @@ -1378,7 +1296,6 @@ public static Vector256 CreateScalarUnsafe(T value) /// A new instance with the first element initialized to and the remaining elements left uninitialized. [Intrinsic] [CLSCompliant(false)] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector256 CreateScalarUnsafe(ulong value) => CreateScalarUnsafe(value); /// Creates a new instance where the elements begin at a specified value and which are spaced apart according to another specified value. @@ -1396,8 +1313,6 @@ public static Vector256 CreateScalarUnsafe(T value) /// The vector that will divide . /// The quotient of divided by . /// The type of and () is not supported. - [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector256 Divide(Vector256 left, Vector256 right) => left / right; /// Divides a vector by a scalar to compute the per-element quotient. @@ -1405,8 +1320,6 @@ public static Vector256 CreateScalarUnsafe(T value) /// The scalar that will divide . /// The type of the elements in the vector. /// The quotient of divided by . - [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector256 Divide(Vector256 left, T right) => left / right; /// Computes the dot product of two vectors. @@ -1416,17 +1329,7 @@ public static Vector256 CreateScalarUnsafe(T value) /// The dot product of and . /// The type of and () is not supported. [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static T Dot(Vector256 left, Vector256 right) - { - // Doing this as Dot(lower) + Dot(upper) is important for floating-point determinism - // This is because the underlying dpps instruction on x86/x64 will do this equivalently - // and otherwise the software vs accelerated implementations may differ in returned result. - - T result = Vector128.Dot(left._lower, right._lower); - result = Scalar.Add(result, Vector128.Dot(left._upper, right._upper)); - return result; - } + public static T Dot(Vector256 left, Vector256 right) => Sum(left * right); /// Compares two vectors to determine if they are equal on a per-element basis. /// The type of the elements in the vector. @@ -1450,8 +1353,6 @@ public static Vector256 Equals(Vector256 left, Vector256 right) /// The type of the elements in the vector. /// true if all elements in were equal to the corresponding element in . /// The type of and () is not supported. - [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static bool EqualsAll(Vector256 left, Vector256 right) => left == right; /// Compares two vectors to determine if any elements are equal. @@ -1535,7 +1436,6 @@ internal static Vector256 Floor(Vector256 vector) /// A vector whose elements are the floor of the elements in . /// [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector256 Floor(Vector256 vector) => Floor(vector); /// Computes the floor of each element in a vector. @@ -1543,7 +1443,6 @@ internal static Vector256 Floor(Vector256 vector) /// A vector whose elements are the floor of the elements in . /// [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector256 Floor(Vector256 vector) => Floor(vector); /// Gets the element at the specified index. @@ -1571,7 +1470,6 @@ public static T GetElement(this Vector256 vector, int index) /// The value of the lower 128-bits as a new . /// The type of () is not supported. [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector128 GetLower(this Vector256 vector) { ThrowHelper.ThrowForUnsupportedIntrinsicsVector256BaseType(); @@ -1584,7 +1482,6 @@ public static Vector128 GetLower(this Vector256 vector) /// The value of the upper 128-bits as a new . /// The type of () is not supported. [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector128 GetUpper(this Vector256 vector) { ThrowHelper.ThrowForUnsupportedIntrinsicsVector256BaseType(); @@ -1773,9 +1670,7 @@ public static bool LessThanOrEqualAny(Vector256 left, Vector256 right) /// The source from which the vector will be loaded. /// The vector loaded from . /// The type of () is not supported. - [Intrinsic] [CLSCompliant(false)] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector256 Load(T* source) => LoadUnsafe(ref *source); /// Loads a vector from the given aligned source. @@ -1806,7 +1701,6 @@ public static Vector256 LoadAligned(T* source) /// This method may bypass the cache on certain platforms. [Intrinsic] [CLSCompliant(false)] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector256 LoadAlignedNonTemporal(T* source) => LoadAligned(source); #pragma warning restore CS8500 // This takes the address of, gets the size of, or declares a pointer to a managed type ('T') @@ -1843,17 +1737,13 @@ public static Vector256 LoadUnsafe(ref readonly T source, nuint elementOff /// Loads a vector from the given source and reinterprets it as . /// The source from which the vector will be loaded. /// The vector loaded from . - [MethodImpl(MethodImplOptions.AggressiveInlining)] - internal static Vector256 LoadUnsafe(ref char source) => - LoadUnsafe(ref Unsafe.As(ref source)); + internal static Vector256 LoadUnsafe(ref char source) => LoadUnsafe(ref Unsafe.As(ref source)); /// Loads a vector from the given source and element offset and reinterprets it as . /// The source to which will be added before loading the vector. /// The element offset from from which the vector will be loaded. /// The vector loaded from plus . - [MethodImpl(MethodImplOptions.AggressiveInlining)] - internal static Vector256 LoadUnsafe(ref char source, nuint elementOffset) => - LoadUnsafe(ref Unsafe.As(ref source), elementOffset); + internal static Vector256 LoadUnsafe(ref char source, nuint elementOffset) => LoadUnsafe(ref Unsafe.As(ref source), elementOffset); /// [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -1961,8 +1851,6 @@ public static Vector256 Min(Vector256 left, Vector256 right) /// The vector to multiply with . /// The element-wise product of and . /// The type of and () is not supported. - [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector256 Multiply(Vector256 left, Vector256 right) => left * right; /// Multiplies a vector by a scalar to compute their product. @@ -1971,8 +1859,6 @@ public static Vector256 Min(Vector256 left, Vector256 right) /// The scalar to multiply with . /// The product of and . /// The type of and () is not supported. - [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector256 Multiply(Vector256 left, T right) => left * right; /// Multiplies a vector by a scalar to compute their product. @@ -1981,8 +1867,6 @@ public static Vector256 Min(Vector256 left, Vector256 right) /// The vector to multiply with . /// The product of and . /// The type of and () is not supported. - [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector256 Multiply(T left, Vector256 right) => left * right; /// Narrows two instances into one . @@ -2092,8 +1976,6 @@ public static Vector256 Narrow(Vector256 lower, Vector256 up /// The vector to negate. /// A vector whose elements are the negation of the corresponding elements in . /// The type of () is not supported. - [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector256 Negate(Vector256 vector) => -vector; /// Computes the ones-complement of a vector. @@ -2101,8 +1983,6 @@ public static Vector256 Narrow(Vector256 lower, Vector256 up /// The vector whose ones-complement is to be computed. /// A vector whose elements are the ones-complement of the corresponding elements in . /// The type of () is not supported. - [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector256 OnesComplement(Vector256 vector) { return Create( @@ -2115,235 +1995,179 @@ public static Vector256 OnesComplement(Vector256 vector) /// The vector whose elements are to be shifted. /// The number of bits by which to shift each element. /// A vector whose elements where shifted left by . - [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] internal static Vector256 ShiftLeft(Vector256 vector, int shiftCount) => vector << shiftCount; /// Shifts each element of a vector left by the specified amount. /// The vector whose elements are to be shifted. /// The number of bits by which to shift each element. /// A vector whose elements where shifted left by . - [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector256 ShiftLeft(Vector256 vector, int shiftCount) => vector << shiftCount; /// Shifts each element of a vector left by the specified amount. /// The vector whose elements are to be shifted. /// The number of bits by which to shift each element. /// A vector whose elements where shifted left by . - [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector256 ShiftLeft(Vector256 vector, int shiftCount) => vector << shiftCount; /// Shifts each element of a vector left by the specified amount. /// The vector whose elements are to be shifted. /// The number of bits by which to shift each element. /// A vector whose elements where shifted left by . - [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector256 ShiftLeft(Vector256 vector, int shiftCount) => vector << shiftCount; /// Shifts each element of a vector left by the specified amount. /// The vector whose elements are to be shifted. /// The number of bits by which to shift each element. /// A vector whose elements where shifted left by . - [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector256 ShiftLeft(Vector256 vector, int shiftCount) => vector << shiftCount; /// Shifts each element of a vector left by the specified amount. /// The vector whose elements are to be shifted. /// The number of bits by which to shift each element. /// A vector whose elements where shifted left by . - [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector256 ShiftLeft(Vector256 vector, int shiftCount) => vector << shiftCount; /// Shifts each element of a vector left by the specified amount. /// The vector whose elements are to be shifted. /// The number of bits by which to shift each element. /// A vector whose elements where shifted left by . - [Intrinsic] [CLSCompliant(false)] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector256 ShiftLeft(Vector256 vector, int shiftCount) => vector << shiftCount; /// Shifts each element of a vector left by the specified amount. /// The vector whose elements are to be shifted. /// The number of bits by which to shift each element. /// A vector whose elements where shifted left by . - [Intrinsic] [CLSCompliant(false)] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector256 ShiftLeft(Vector256 vector, int shiftCount) => vector << shiftCount; /// Shifts each element of a vector left by the specified amount. /// The vector whose elements are to be shifted. /// The number of bits by which to shift each element. /// A vector whose elements where shifted left by . - [Intrinsic] [CLSCompliant(false)] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector256 ShiftLeft(Vector256 vector, int shiftCount) => vector << shiftCount; /// Shifts each element of a vector left by the specified amount. /// The vector whose elements are to be shifted. /// The number of bits by which to shift each element. /// A vector whose elements where shifted left by . - [Intrinsic] [CLSCompliant(false)] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector256 ShiftLeft(Vector256 vector, int shiftCount) => vector << shiftCount; /// Shifts each element of a vector left by the specified amount. /// The vector whose elements are to be shifted. /// The number of bits by which to shift each element. /// A vector whose elements where shifted left by . - [Intrinsic] [CLSCompliant(false)] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector256 ShiftLeft(Vector256 vector, int shiftCount) => vector << shiftCount; /// Shifts (signed) each element of a vector right by the specified amount. /// The vector whose elements are to be shifted. /// The number of bits by which to shift each element. /// A vector whose elements where shifted right by . - [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] internal static Vector256 ShiftRightArithmetic(Vector256 vector, int shiftCount) => vector >> shiftCount; /// Shifts (signed) each element of a vector right by the specified amount. /// The vector whose elements are to be shifted. /// The number of bits by which to shift each element. /// A vector whose elements where shifted right by . - [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector256 ShiftRightArithmetic(Vector256 vector, int shiftCount) => vector >> shiftCount; /// Shifts (signed) each element of a vector right by the specified amount. /// The vector whose elements are to be shifted. /// The number of bits by which to shift each element. /// A vector whose elements where shifted right by . - [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector256 ShiftRightArithmetic(Vector256 vector, int shiftCount) => vector >> shiftCount; /// Shifts (signed) each element of a vector right by the specified amount. /// The vector whose elements are to be shifted. /// The number of bits by which to shift each element. /// A vector whose elements where shifted right by . - [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector256 ShiftRightArithmetic(Vector256 vector, int shiftCount) => vector >> shiftCount; /// Shifts (signed) each element of a vector right by the specified amount. /// The vector whose elements are to be shifted. /// The number of bits by which to shift each element. /// A vector whose elements where shifted right by . - [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector256 ShiftRightArithmetic(Vector256 vector, int shiftCount) => vector >> shiftCount; /// Shifts (signed) each element of a vector right by the specified amount. /// The vector whose elements are to be shifted. /// The number of bits by which to shift each element. /// A vector whose elements where shifted right by . - [Intrinsic] [CLSCompliant(false)] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector256 ShiftRightArithmetic(Vector256 vector, int shiftCount) => vector >> shiftCount; /// Shifts (unsigned) each element of a vector right by the specified amount. /// The vector whose elements are to be shifted. /// The number of bits by which to shift each element. /// A vector whose elements where shifted right by . - [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] internal static Vector256 ShiftRightLogical(Vector256 vector, int shiftCount) => vector >>> shiftCount; /// Shifts (unsigned) each element of a vector right by the specified amount. /// The vector whose elements are to be shifted. /// The number of bits by which to shift each element. /// A vector whose elements where shifted right by . - [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector256 ShiftRightLogical(Vector256 vector, int shiftCount) => vector >>> shiftCount; /// Shifts (unsigned) each element of a vector right by the specified amount. /// The vector whose elements are to be shifted. /// The number of bits by which to shift each element. /// A vector whose elements where shifted right by . - [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector256 ShiftRightLogical(Vector256 vector, int shiftCount) => vector >>> shiftCount; /// Shifts (unsigned) each element of a vector right by the specified amount. /// The vector whose elements are to be shifted. /// The number of bits by which to shift each element. /// A vector whose elements where shifted right by . - [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector256 ShiftRightLogical(Vector256 vector, int shiftCount) => vector >>> shiftCount; /// Shifts (unsigned) each element of a vector right by the specified amount. /// The vector whose elements are to be shifted. /// The number of bits by which to shift each element. /// A vector whose elements where shifted right by . - [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector256 ShiftRightLogical(Vector256 vector, int shiftCount) => vector >>> shiftCount; /// Shifts (unsigned) each element of a vector right by the specified amount. /// The vector whose elements are to be shifted. /// The number of bits by which to shift each element. /// A vector whose elements where shifted right by . - [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector256 ShiftRightLogical(Vector256 vector, int shiftCount) => vector >>> shiftCount; /// Shifts (unsigned) each element of a vector right by the specified amount. /// The vector whose elements are to be shifted. /// The number of bits by which to shift each element. /// A vector whose elements where shifted right by . - [Intrinsic] [CLSCompliant(false)] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector256 ShiftRightLogical(Vector256 vector, int shiftCount) => vector >>> shiftCount; /// Shifts (unsigned) each element of a vector right by the specified amount. /// The vector whose elements are to be shifted. /// The number of bits by which to shift each element. /// A vector whose elements where shifted right by . - [Intrinsic] [CLSCompliant(false)] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector256 ShiftRightLogical(Vector256 vector, int shiftCount) => vector >>> shiftCount; /// Shifts (unsigned) each element of a vector right by the specified amount. /// The vector whose elements are to be shifted. /// The number of bits by which to shift each element. /// A vector whose elements where shifted right by . - [Intrinsic] [CLSCompliant(false)] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector256 ShiftRightLogical(Vector256 vector, int shiftCount) => vector >>> shiftCount; /// Shifts (unsigned) each element of a vector right by the specified amount. /// The vector whose elements are to be shifted. /// The number of bits by which to shift each element. /// A vector whose elements where shifted right by . - [Intrinsic] [CLSCompliant(false)] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector256 ShiftRightLogical(Vector256 vector, int shiftCount) => vector >>> shiftCount; /// Shifts (unsigned) each element of a vector right by the specified amount. /// The vector whose elements are to be shifted. /// The number of bits by which to shift each element. /// A vector whose elements where shifted right by . - [Intrinsic] [CLSCompliant(false)] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector256 ShiftRightLogical(Vector256 vector, int shiftCount) => vector >>> shiftCount; /// Creates a new vector by selecting values from an input vector using a set of indices. @@ -2611,9 +2435,7 @@ public static Vector256 Sqrt(Vector256 vector) /// The vector that will be stored. /// The destination at which will be stored. /// The type of and () is not supported. - [Intrinsic] [CLSCompliant(false)] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static void Store(this Vector256 source, T* destination) => source.StoreUnsafe(ref *destination); /// Stores a vector at the given aligned destination. @@ -2644,7 +2466,6 @@ public static void StoreAligned(this Vector256 source, T* destination) /// This method may bypass the cache on certain platforms. [Intrinsic] [CLSCompliant(false)] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static void StoreAlignedNonTemporal(this Vector256 source, T* destination) => source.StoreAligned(destination); #pragma warning restore CS8500 // This takes the address of, gets the size of, or declares a pointer to a managed type ('T') @@ -2684,8 +2505,6 @@ public static void StoreUnsafe(this Vector256 source, ref T destination, n /// The type of the elements in the vector. /// The difference of and . /// The type of and () is not supported. - [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector256 Subtract(Vector256 left, Vector256 right) => left - right; /// Computes the sum of all elements in a vector. @@ -2712,7 +2531,6 @@ public static T Sum(Vector256 vector) /// A scalar containing the value of the first element. /// The type of () is not supported. [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static T ToScalar(this Vector256 vector) { ThrowHelper.ThrowForUnsupportedIntrinsicsVector256BaseType(); @@ -3094,8 +2912,6 @@ public static Vector256 WithUpper(this Vector256 vector, Vector128 v /// The vector to exclusive-or with . /// The exclusive-or of and . /// The type of and () is not supported. - [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector256 Xor(Vector256 left, Vector256 right) => left ^ right; [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -3114,16 +2930,8 @@ internal static void SetElementUnsafe(in this Vector256 vector, int index, Unsafe.Add(ref address, index) = value; } - [MethodImpl(MethodImplOptions.AggressiveInlining)] - internal static void SetLowerUnsafe(in this Vector256 vector, Vector128 value) - { - Unsafe.AsRef(in vector._lower) = value; - } + internal static void SetLowerUnsafe(in this Vector256 vector, Vector128 value) => Unsafe.AsRef(in vector._lower) = value; - [MethodImpl(MethodImplOptions.AggressiveInlining)] - internal static void SetUpperUnsafe(in this Vector256 vector, Vector128 value) - { - Unsafe.AsRef(in vector._upper) = value; - } + internal static void SetUpperUnsafe(in this Vector256 vector, Vector128 value) => Unsafe.AsRef(in vector._upper) = value; } } diff --git a/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Vector256_1.cs b/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Vector256_1.cs index d506b0da02776b..bc5e052448f4fb 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Vector256_1.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Vector256_1.cs @@ -38,7 +38,6 @@ namespace System.Runtime.Intrinsics public static Vector256 AllBitsSet { [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] get { Vector128 vector = Vector128.AllBitsSet; @@ -51,11 +50,7 @@ public static Vector256 AllBitsSet public static int Count { [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] - get - { - return Vector128.Count * 2; - } + get => Vector128.Count * 2; } /// Gets a new with the elements set to their index. @@ -106,7 +101,6 @@ public static bool IsSupported public static Vector256 One { [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] get { Vector128 vector = Vector128.One; @@ -118,8 +112,6 @@ public static Vector256 One /// The type of the vector () is not supported. public static Vector256 Zero { - [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] get { ThrowHelper.ThrowForUnsupportedIntrinsicsVector256BaseType(); @@ -127,27 +119,14 @@ public static Vector256 Zero } } - internal string DisplayString - { - get - { - return IsSupported ? ToString() : SR.NotSupported_Type; - } - } + internal string DisplayString => IsSupported ? ToString() : SR.NotSupported_Type; /// Gets the element at the specified index. /// The index of the element to get. /// The value of the element at . /// was less than zero or greater than the number of elements. /// The type of the vector () is not supported. - public T this[int index] - { - [MethodImpl(MethodImplOptions.AggressiveInlining)] - get - { - return this.GetElement(index); - } - } + public T this[int index] => this.GetElement(index); /// Adds two vectors to compute their sum. /// The vector to add with . @@ -257,12 +236,7 @@ public T this[int index] /// true if any elements in was not equal to the corresponding element in . /// The type of the vector () is not supported. [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static bool operator !=(Vector256 left, Vector256 right) - { - return (left._lower != right._lower) - || (left._upper != right._upper); - } + public static bool operator !=(Vector256 left, Vector256 right) => !(left == right); /// Shifts each element of a vector left by the specified amount. /// The vector whose elements are to be shifted. @@ -314,7 +288,6 @@ public T this[int index] /// The product of and . /// The type of the vector () is not supported. [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector256 operator *(T left, Vector256 right) => right * left; /// Computes the ones-complement of a vector. @@ -378,8 +351,6 @@ public static Vector256 operator >>(Vector256 value, int shiftCount) /// The vector. /// /// The type of the vector () is not supported. - [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector256 operator +(Vector256 value) { ThrowHelper.ThrowForUnsupportedIntrinsicsVector256BaseType(); @@ -403,7 +374,6 @@ public static Vector256 operator >>>(Vector256 value, int shiftCount) /// Determines whether the specified object is equal to the current instance. /// The object to compare with the current instance. /// true if is a and is equal to the current instance; otherwise, false. - [MethodImpl(MethodImplOptions.AggressiveInlining)] public override bool Equals([NotNullWhen(true)] object? obj) => (obj is Vector256 other) && Equals(other); /// Determines whether the specified is equal to the current instance. @@ -454,7 +424,6 @@ public override int GetHashCode() /// Converts the current instance to an equivalent string representation. /// An equivalent string representation of the current instance. /// The type of the vector () is not supported. - [MethodImpl(MethodImplOptions.AggressiveInlining)] public override string ToString() => ToString("G", CultureInfo.InvariantCulture); private string ToString([StringSyntax(StringSyntaxAttribute.NumericFormat)] string? format, IFormatProvider? formatProvider) @@ -682,15 +651,9 @@ private string ToString([StringSyntax(StringSyntaxAttribute.NumericFormat)] stri // New Surface Area // - static bool ISimdVector, T>.AnyWhereAllBitsSet(Vector256 vector) - { - return Vector256.EqualsAny(vector, Vector256.AllBitsSet); - } + static bool ISimdVector, T>.AnyWhereAllBitsSet(Vector256 vector) => Vector256.EqualsAny(vector, AllBitsSet); - static bool ISimdVector, T>.Any(Vector256 vector, T value) - { - return Vector256.EqualsAny(vector, Vector256.Create((T)value)); - } + static bool ISimdVector, T>.Any(Vector256 vector, T value) => Vector256.EqualsAny(vector, Vector256.Create(value)); static int ISimdVector, T>.IndexOfLastMatch(Vector256 vector) { diff --git a/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Vector512.cs b/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Vector512.cs index d63f12afb64d9c..28459279fcbe03 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Vector512.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Vector512.cs @@ -73,8 +73,6 @@ public static Vector512 Abs(Vector512 vector) /// The vector to add with . /// The sum of and . /// The type of and () is not supported. - [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector512 Add(Vector512 left, Vector512 right) => left + right; /// Computes the bitwise-and of a given vector and the ones complement of another vector. @@ -99,14 +97,13 @@ public static Vector512 AndNot(Vector512 left, Vector512 right) /// The vector to reinterpret. /// reinterpreted as a new . /// The type of () or the type of the target () is not supported. - [Intrinsic] [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector512 As(this Vector512 vector) { ThrowHelper.ThrowForUnsupportedIntrinsicsVector512BaseType(); ThrowHelper.ThrowForUnsupportedIntrinsicsVector512BaseType(); - return Unsafe.As, Vector512>(ref vector); + return Unsafe.BitCast, Vector512>(vector); } /// Reinterprets a as a new . @@ -114,8 +111,6 @@ public static Vector512 As(this Vector512 vector) /// The vector to reinterpret. /// reinterpreted as a new . /// The type of () is not supported. - [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector512 AsByte(this Vector512 vector) => vector.As(); /// Reinterprets a as a new . @@ -123,8 +118,6 @@ public static Vector512 As(this Vector512 vector) /// The vector to reinterpret. /// reinterpreted as a new . /// The type of () is not supported. - [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector512 AsDouble(this Vector512 vector) => vector.As(); /// Reinterprets a as a new . @@ -132,8 +125,6 @@ public static Vector512 As(this Vector512 vector) /// The vector to reinterpret. /// reinterpreted as a new . /// The type of () is not supported. - [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector512 AsInt16(this Vector512 vector) => vector.As(); /// Reinterprets a as a new . @@ -141,8 +132,6 @@ public static Vector512 As(this Vector512 vector) /// The vector to reinterpret. /// reinterpreted as a new . /// The type of () is not supported. - [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector512 AsInt32(this Vector512 vector) => vector.As(); /// Reinterprets a as a new . @@ -150,8 +139,6 @@ public static Vector512 As(this Vector512 vector) /// The vector to reinterpret. /// reinterpreted as a new . /// The type of () is not supported. - [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector512 AsInt64(this Vector512 vector) => vector.As(); /// Reinterprets a as a new . @@ -159,8 +146,6 @@ public static Vector512 As(this Vector512 vector) /// The vector to reinterpret. /// reinterpreted as a new . /// The type of () is not supported. - [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector512 AsNInt(this Vector512 vector) => vector.As(); /// Reinterprets a as a new . @@ -168,9 +153,7 @@ public static Vector512 As(this Vector512 vector) /// The vector to reinterpret. /// reinterpreted as a new . /// The type of () is not supported. - [Intrinsic] [CLSCompliant(false)] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector512 AsNUInt(this Vector512 vector) => vector.As(); /// Reinterprets a as a new . @@ -178,9 +161,7 @@ public static Vector512 As(this Vector512 vector) /// The vector to reinterpret. /// reinterpreted as a new . /// The type of () is not supported. - [Intrinsic] [CLSCompliant(false)] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector512 AsSByte(this Vector512 vector) => vector.As(); /// Reinterprets a as a new . @@ -188,8 +169,6 @@ public static Vector512 As(this Vector512 vector) /// The vector to reinterpret. /// reinterpreted as a new . /// The type of () is not supported. - [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector512 AsSingle(this Vector512 vector) => vector.As(); /// Reinterprets a as a new . @@ -197,9 +176,7 @@ public static Vector512 As(this Vector512 vector) /// The vector to reinterpret. /// reinterpreted as a new . /// The type of () is not supported. - [Intrinsic] [CLSCompliant(false)] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector512 AsUInt16(this Vector512 vector) => vector.As(); /// Reinterprets a as a new . @@ -207,9 +184,7 @@ public static Vector512 As(this Vector512 vector) /// The vector to reinterpret. /// reinterpreted as a new . /// The type of () is not supported. - [Intrinsic] [CLSCompliant(false)] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector512 AsUInt32(this Vector512 vector) => vector.As(); /// Reinterprets a as a new . @@ -217,9 +192,7 @@ public static Vector512 As(this Vector512 vector) /// The vector to reinterpret. /// reinterpreted as a new . /// The type of () is not supported. - [Intrinsic] [CLSCompliant(false)] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector512 AsUInt64(this Vector512 vector) => vector.As(); /// Reinterprets a as a new . @@ -261,8 +234,6 @@ public static Vector AsVector(this Vector512 value) /// The vector to bitwise-and with . /// The bitwise-and of and . /// The type of and () is not supported. - [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector512 BitwiseAnd(Vector512 left, Vector512 right) => left & right; /// Computes the bitwise-or of two vectors. @@ -271,8 +242,6 @@ public static Vector AsVector(this Vector512 value) /// The vector to bitwise-or with . /// The bitwise-or of and . /// The type of and () is not supported. - [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector512 BitwiseOr(Vector512 left, Vector512 right) => left | right; /// Computes the ceiling of each element in a vector. @@ -293,7 +262,6 @@ internal static Vector512 Ceiling(Vector512 vector) /// A vector whose elements are the ceiling of the elements in . /// [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector512 Ceiling(Vector512 vector) => Ceiling(vector); /// Computes the ceiling of each element in a vector. @@ -301,7 +269,6 @@ internal static Vector512 Ceiling(Vector512 vector) /// A vector whose elements are the ceiling of the elements in . /// [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector512 Ceiling(Vector512 vector) => Ceiling(vector); /// Conditionally selects a value from two vectors on a bitwise basis. @@ -550,7 +517,6 @@ public static void CopyTo(this Vector512 vector, Span destination) /// A new with all elements initialized to . /// The type of () is not supported. [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector512 Create(T value) { Vector256 vector = Vector256.Create(value); @@ -562,7 +528,6 @@ public static Vector512 Create(T value) /// A new with all elements initialized to . /// On x86, this method corresponds to __m512i _mm512_set1_epi8 [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector512 Create(byte value) => Create(value); /// Creates a new instance with all elements initialized to the specified value. @@ -570,7 +535,6 @@ public static Vector512 Create(T value) /// A new with all elements initialized to . /// On x86, this method corresponds to __m512d _mm512_set1_pd [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector512 Create(double value) => Create(value); /// Creates a new instance with all elements initialized to the specified value. @@ -578,7 +542,6 @@ public static Vector512 Create(T value) /// A new with all elements initialized to . /// On x86, this method corresponds to __m512i _mm512_set1_epi16 [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector512 Create(short value) => Create(value); /// Creates a new instance with all elements initialized to the specified value. @@ -586,7 +549,6 @@ public static Vector512 Create(T value) /// A new with all elements initialized to . /// On x86, this method corresponds to __m512i _mm512_set1_epi32 [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector512 Create(int value) => Create(value); /// Creates a new instance with all elements initialized to the specified value. @@ -594,14 +556,12 @@ public static Vector512 Create(T value) /// A new with all elements initialized to . /// On x86, this method corresponds to __m512i _mm512_set1_epi64x [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector512 Create(long value) => Create(value); /// Creates a new instance with all elements initialized to the specified value. /// The value that all elements will be initialized to. /// A new with all elements initialized to . [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector512 Create(nint value) => Create(value); /// Creates a new instance with all elements initialized to the specified value. @@ -609,7 +569,6 @@ public static Vector512 Create(T value) /// A new with all elements initialized to . [Intrinsic] [CLSCompliant(false)] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector512 Create(nuint value) => Create(value); /// Creates a new instance with all elements initialized to the specified value. @@ -618,7 +577,6 @@ public static Vector512 Create(T value) /// On x86, this method corresponds to __m512i _mm512_set1_epi8 [Intrinsic] [CLSCompliant(false)] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector512 Create(sbyte value) => Create(value); /// Creates a new instance with all elements initialized to the specified value. @@ -626,7 +584,6 @@ public static Vector512 Create(T value) /// A new with all elements initialized to . /// On x86, this method corresponds to __m512 _mm512_set1_ps [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector512 Create(float value) => Create(value); /// Creates a new instance with all elements initialized to the specified value. @@ -635,7 +592,6 @@ public static Vector512 Create(T value) /// On x86, this method corresponds to __m512i _mm512_set1_epi16 [Intrinsic] [CLSCompliant(false)] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector512 Create(ushort value) => Create(value); /// Creates a new instance with all elements initialized to the specified value. @@ -644,7 +600,6 @@ public static Vector512 Create(T value) /// On x86, this method corresponds to __m512i _mm512_set1_epi32 [Intrinsic] [CLSCompliant(false)] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector512 Create(uint value) => Create(value); /// Creates a new instance with all elements initialized to the specified value. @@ -653,7 +608,6 @@ public static Vector512 Create(T value) /// On x86, this method corresponds to __m512i _mm512_set1_epi64x [Intrinsic] [CLSCompliant(false)] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector512 Create(ulong value) => Create(value); /// Creates a new from a given array. @@ -1140,7 +1094,6 @@ public static Vector512 Create(Vector256 lower, Vector256 upper) /// The value that the lower 256-bits will be initialized to. /// The value that the upper 256-bits will be initialized to. /// A new initialized from and . - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector512 Create(Vector256 lower, Vector256 upper) => Create(lower, upper); /// Creates a new instance from two instances. @@ -1148,14 +1101,12 @@ public static Vector512 Create(Vector256 lower, Vector256 upper) /// The value that the upper 256-bits will be initialized to. /// A new initialized from and . /// On x86, this method corresponds to __m512d _mm512_setr_m256d (__m256d lo, __m256d hi) - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector512 Create(Vector256 lower, Vector256 upper) => Create(lower, upper); /// Creates a new instance from two instances. /// The value that the lower 256-bits will be initialized to. /// The value that the upper 256-bits will be initialized to. /// A new initialized from and . - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector512 Create(Vector256 lower, Vector256 upper) => Create(lower, upper); /// Creates a new instance from two instances. @@ -1163,21 +1114,18 @@ public static Vector512 Create(Vector256 lower, Vector256 upper) /// The value that the upper 256-bits will be initialized to. /// A new initialized from and . /// On x86, this method corresponds to __m512i _mm512_setr_m256i (__m256i lo, __m256i hi) - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector512 Create(Vector256 lower, Vector256 upper) => Create(lower, upper); /// Creates a new instance from two instances. /// The value that the lower 256-bits will be initialized to. /// The value that the upper 256-bits will be initialized to. /// A new initialized from and . - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector512 Create(Vector256 lower, Vector256 upper) => Create(lower, upper); /// Creates a new instance from two instances. /// The value that the lower 256-bits will be initialized to. /// The value that the upper 256-bits will be initialized to. /// A new initialized from and . - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector512 Create(Vector256 lower, Vector256 upper) => Create(lower, upper); /// Creates a new instance from two instances. @@ -1185,7 +1133,6 @@ public static Vector512 Create(Vector256 lower, Vector256 upper) /// The value that the upper 256-bits will be initialized to. /// A new initialized from and . [CLSCompliant(false)] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector512 Create(Vector256 lower, Vector256 upper) => Create(lower, upper); /// Creates a new instance from two instances. @@ -1193,7 +1140,6 @@ public static Vector512 Create(Vector256 lower, Vector256 upper) /// The value that the upper 256-bits will be initialized to. /// A new initialized from and . [CLSCompliant(false)] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector512 Create(Vector256 lower, Vector256 upper) => Create(lower, upper); /// Creates a new instance from two instances. @@ -1201,7 +1147,6 @@ public static Vector512 Create(Vector256 lower, Vector256 upper) /// The value that the upper 256-bits will be initialized to. /// A new initialized from and . /// On x86, this method corresponds to __m512 _mm512_setr_m256 (__m256 lo, __m256 hi) - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector512 Create(Vector256 lower, Vector256 upper) => Create(lower, upper); /// Creates a new instance from two instances. @@ -1209,7 +1154,6 @@ public static Vector512 Create(Vector256 lower, Vector256 upper) /// The value that the upper 256-bits will be initialized to. /// A new initialized from and . [CLSCompliant(false)] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector512 Create(Vector256 lower, Vector256 upper) => Create(lower, upper); /// Creates a new instance from two instances. @@ -1218,7 +1162,6 @@ public static Vector512 Create(Vector256 lower, Vector256 upper) /// A new initialized from and . /// On x86, this method corresponds to __m512i _mm512_setr_m256i (__m256i lo, __m256i hi) [CLSCompliant(false)] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector512 Create(Vector256 lower, Vector256 upper) => Create(lower, upper); /// Creates a new instance from two instances. @@ -1226,7 +1169,6 @@ public static Vector512 Create(Vector256 lower, Vector256 upper) /// The value that the upper 256-bits will be initialized to. /// A new initialized from and . [CLSCompliant(false)] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector512 Create(Vector256 lower, Vector256 upper) => Create(lower, upper); /// Creates a new instance with the first element initialized to the specified value and the remaining elements initialized to zero. @@ -1234,84 +1176,84 @@ public static Vector512 Create(Vector256 lower, Vector256 upper) /// The value that element 0 will be initialized to. /// A new instance with the first element initialized to and the remaining elements initialized to zero. /// The type of () is not supported. - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [Intrinsic] public static Vector512 CreateScalar(T value) => Vector256.CreateScalar(value).ToVector512(); /// Creates a new instance with the first element initialized to the specified value and the remaining elements initialized to zero. /// The value that element 0 will be initialized to. /// A new instance with the first element initialized to and the remaining elements initialized to zero. - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [Intrinsic] public static Vector512 CreateScalar(byte value) => CreateScalar(value); /// Creates a new instance with the first element initialized to the specified value and the remaining elements initialized to zero. /// The value that element 0 will be initialized to. /// A new instance with the first element initialized to and the remaining elements initialized to zero. - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [Intrinsic] public static Vector512 CreateScalar(double value) => CreateScalar(value); /// Creates a new instance with the first element initialized to the specified value and the remaining elements initialized to zero. /// The value that element 0 will be initialized to. /// A new instance with the first element initialized to and the remaining elements initialized to zero. - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [Intrinsic] public static Vector512 CreateScalar(short value) => CreateScalar(value); /// Creates a new instance with the first element initialized to the specified value and the remaining elements initialized to zero. /// The value that element 0 will be initialized to. /// A new instance with the first element initialized to and the remaining elements initialized to zero. - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [Intrinsic] public static Vector512 CreateScalar(int value) => CreateScalar(value); /// Creates a new instance with the first element initialized to the specified value and the remaining elements initialized to zero. /// The value that element 0 will be initialized to. /// A new instance with the first element initialized to and the remaining elements initialized to zero. - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [Intrinsic] public static Vector512 CreateScalar(long value) => CreateScalar(value); /// Creates a new instance with the first element initialized to the specified value and the remaining elements initialized to zero. /// The value that element 0 will be initialized to. /// A new instance with the first element initialized to and the remaining elements initialized to zero. - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [Intrinsic] public static Vector512 CreateScalar(nint value) => CreateScalar(value); /// Creates a new instance with the first element initialized to the specified value and the remaining elements initialized to zero. /// The value that element 0 will be initialized to. /// A new instance with the first element initialized to and the remaining elements initialized to zero. + [Intrinsic] [CLSCompliant(false)] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector512 CreateScalar(nuint value) => CreateScalar(value); /// Creates a new instance with the first element initialized to the specified value and the remaining elements initialized to zero. /// The value that element 0 will be initialized to. /// A new instance with the first element initialized to and the remaining elements initialized to zero. + [Intrinsic] [CLSCompliant(false)] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector512 CreateScalar(sbyte value) => CreateScalar(value); /// Creates a new instance with the first element initialized to the specified value and the remaining elements initialized to zero. /// The value that element 0 will be initialized to. /// A new instance with the first element initialized to and the remaining elements initialized to zero. - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [Intrinsic] public static Vector512 CreateScalar(float value) => CreateScalar(value); /// Creates a new instance with the first element initialized to the specified value and the remaining elements initialized to zero. /// The value that element 0 will be initialized to. /// A new instance with the first element initialized to and the remaining elements initialized to zero. + [Intrinsic] [CLSCompliant(false)] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector512 CreateScalar(ushort value) => CreateScalar(value); /// Creates a new instance with the first element initialized to the specified value and the remaining elements initialized to zero. /// The value that element 0 will be initialized to. /// A new instance with the first element initialized to and the remaining elements initialized to zero. + [Intrinsic] [CLSCompliant(false)] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector512 CreateScalar(uint value) => CreateScalar(value); /// Creates a new instance with the first element initialized to the specified value and the remaining elements initialized to zero. /// The value that element 0 will be initialized to. /// A new instance with the first element initialized to and the remaining elements initialized to zero. + [Intrinsic] [CLSCompliant(false)] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector512 CreateScalar(ulong value) => CreateScalar(value); /// Creates a new instance with the first element initialized to the specified value and the remaining elements left uninitialized. @@ -1337,42 +1279,36 @@ public static Vector512 CreateScalarUnsafe(T value) /// The value that element 0 will be initialized to. /// A new instance with the first element initialized to and the remaining elements left uninitialized. [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector512 CreateScalarUnsafe(byte value) => CreateScalarUnsafe(value); /// Creates a new instance with the first element initialized to the specified value and the remaining elements left uninitialized. /// The value that element 0 will be initialized to. /// A new instance with the first element initialized to and the remaining elements left uninitialized. [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector512 CreateScalarUnsafe(double value) => CreateScalarUnsafe(value); /// Creates a new instance with the first element initialized to the specified value and the remaining elements left uninitialized. /// The value that element 0 will be initialized to. /// A new instance with the first element initialized to and the remaining elements left uninitialized. [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector512 CreateScalarUnsafe(short value) => CreateScalarUnsafe(value); /// Creates a new instance with the first element initialized to the specified value and the remaining elements left uninitialized. /// The value that element 0 will be initialized to. /// A new instance with the first element initialized to and the remaining elements left uninitialized. [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector512 CreateScalarUnsafe(int value) => CreateScalarUnsafe(value); /// Creates a new instance with the first element initialized to the specified value and the remaining elements left uninitialized. /// The value that element 0 will be initialized to. /// A new instance with the first element initialized to and the remaining elements left uninitialized. [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector512 CreateScalarUnsafe(long value) => CreateScalarUnsafe(value); /// Creates a new instance with the first element initialized to the specified value and the remaining elements left uninitialized. /// The value that element 0 will be initialized to. /// A new instance with the first element initialized to and the remaining elements left uninitialized. [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector512 CreateScalarUnsafe(nint value) => CreateScalarUnsafe(value); /// Creates a new instance with the first element initialized to the specified value and the remaining elements left uninitialized. @@ -1380,7 +1316,6 @@ public static Vector512 CreateScalarUnsafe(T value) /// A new instance with the first element initialized to and the remaining elements left uninitialized. [Intrinsic] [CLSCompliant(false)] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector512 CreateScalarUnsafe(nuint value) => CreateScalarUnsafe(value); /// Creates a new instance with the first element initialized to the specified value and the remaining elements left uninitialized. @@ -1388,14 +1323,12 @@ public static Vector512 CreateScalarUnsafe(T value) /// A new instance with the first element initialized to and the remaining elements left uninitialized. [Intrinsic] [CLSCompliant(false)] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector512 CreateScalarUnsafe(sbyte value) => CreateScalarUnsafe(value); /// Creates a new instance with the first element initialized to the specified value and the remaining elements left uninitialized. /// The value that element 0 will be initialized to. /// A new instance with the first element initialized to and the remaining elements left uninitialized. [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector512 CreateScalarUnsafe(float value) => CreateScalarUnsafe(value); /// Creates a new instance with the first element initialized to the specified value and the remaining elements left uninitialized. @@ -1403,7 +1336,6 @@ public static Vector512 CreateScalarUnsafe(T value) /// A new instance with the first element initialized to and the remaining elements left uninitialized. [Intrinsic] [CLSCompliant(false)] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector512 CreateScalarUnsafe(ushort value) => CreateScalarUnsafe(value); /// Creates a new instance with the first element initialized to the specified value and the remaining elements left uninitialized. @@ -1411,7 +1343,6 @@ public static Vector512 CreateScalarUnsafe(T value) /// A new instance with the first element initialized to and the remaining elements left uninitialized. [Intrinsic] [CLSCompliant(false)] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector512 CreateScalarUnsafe(uint value) => CreateScalarUnsafe(value); /// Creates a new instance with the first element initialized to the specified value and the remaining elements left uninitialized. @@ -1419,7 +1350,6 @@ public static Vector512 CreateScalarUnsafe(T value) /// A new instance with the first element initialized to and the remaining elements left uninitialized. [Intrinsic] [CLSCompliant(false)] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector512 CreateScalarUnsafe(ulong value) => CreateScalarUnsafe(value); /// Creates a new instance where the elements begin at a specified value and which are spaced apart according to another specified value. @@ -1437,7 +1367,6 @@ public static Vector512 CreateScalarUnsafe(T value) /// The vector that will divide . /// The quotient of divided by . /// The type of and () is not supported. - [Intrinsic] [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector512 Divide(Vector512 left, Vector512 right) { @@ -1452,8 +1381,6 @@ public static Vector512 Divide(Vector512 left, Vector512 right) /// The scalar that will divide . /// The type of the elements in the vector. /// The quotient of divided by . - [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector512 Divide(Vector512 left, T right) => left / right; /// Computes the dot product of two vectors. @@ -1463,17 +1390,7 @@ public static Vector512 Divide(Vector512 left, Vector512 right) /// The dot product of and . /// The type of and () is not supported. [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static T Dot(Vector512 left, Vector512 right) - { - // Doing this as Dot(lower) + Dot(upper) is important for floating-point determinism - // This is because the underlying dpps instruction on x86/x64 will do this equivalently - // and otherwise the software vs accelerated implementations may differ in returned result. - - T result = Vector256.Dot(left._lower, right._lower); - result = Scalar.Add(result, Vector256.Dot(left._upper, right._upper)); - return result; - } + public static T Dot(Vector512 left, Vector512 right) => Sum(left * right); /// Compares two vectors to determine if they are equal on a per-element basis. /// The type of the elements in the vector. @@ -1497,8 +1414,6 @@ public static Vector512 Equals(Vector512 left, Vector512 right) /// The type of the elements in the vector. /// true if all elements in were equal to the corresponding element in . /// The type of and () is not supported. - [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static bool EqualsAll(Vector512 left, Vector512 right) => left == right; /// Compares two vectors to determine if any elements are equal. @@ -1582,7 +1497,6 @@ internal static Vector512 Floor(Vector512 vector) /// A vector whose elements are the floor of the elements in . /// [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector512 Floor(Vector512 vector) => Floor(vector); /// Computes the floor of each element in a vector. @@ -1590,7 +1504,6 @@ internal static Vector512 Floor(Vector512 vector) /// A vector whose elements are the floor of the elements in . /// [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector512 Floor(Vector512 vector) => Floor(vector); /// Gets the element at the specified index. @@ -1618,7 +1531,6 @@ public static T GetElement(this Vector512 vector, int index) /// The value of the lower 256-bits as a new . /// The type of () is not supported. [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector256 GetLower(this Vector512 vector) { ThrowHelper.ThrowForUnsupportedIntrinsicsVector512BaseType(); @@ -1631,7 +1543,6 @@ public static Vector256 GetLower(this Vector512 vector) /// The value of the upper 256-bits as a new . /// The type of () is not supported. [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector256 GetUpper(this Vector512 vector) { ThrowHelper.ThrowForUnsupportedIntrinsicsVector512BaseType(); @@ -1820,9 +1731,7 @@ public static bool LessThanOrEqualAny(Vector512 left, Vector512 right) /// The source from which the vector will be loaded. /// The vector loaded from . /// The type of () is not supported. - [Intrinsic] [CLSCompliant(false)] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector512 Load(T* source) => LoadUnsafe(ref *source); /// Loads a vector from the given aligned source. @@ -1853,7 +1762,6 @@ public static Vector512 LoadAligned(T* source) /// This method may bypass the cache on certain platforms. [Intrinsic] [CLSCompliant(false)] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector512 LoadAlignedNonTemporal(T* source) => LoadAligned(source); #pragma warning restore CS8500 // This takes the address of, gets the size of, or declares a pointer to a managed type ('T') @@ -1890,17 +1798,13 @@ public static Vector512 LoadUnsafe(ref readonly T source, nuint elementOff /// Loads a vector from the given source and reinterprets it as . /// The source from which the vector will be loaded. /// The vector loaded from . - [MethodImpl(MethodImplOptions.AggressiveInlining)] - internal static Vector512 LoadUnsafe(ref char source) => - LoadUnsafe(ref Unsafe.As(ref source)); + internal static Vector512 LoadUnsafe(ref char source) => LoadUnsafe(ref Unsafe.As(ref source)); /// Loads a vector from the given source and element offset and reinterprets it as . /// The source to which will be added before loading the vector. /// The element offset from from which the vector will be loaded. /// The vector loaded from plus . - [MethodImpl(MethodImplOptions.AggressiveInlining)] - internal static Vector512 LoadUnsafe(ref char source, nuint elementOffset) => - LoadUnsafe(ref Unsafe.As(ref source), elementOffset); + internal static Vector512 LoadUnsafe(ref char source, nuint elementOffset) => LoadUnsafe(ref Unsafe.As(ref source), elementOffset); /// [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -2008,8 +1912,6 @@ public static Vector512 Min(Vector512 left, Vector512 right) /// The vector to multiply with . /// The element-wise product of and . /// The type of and () is not supported. - [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector512 Multiply(Vector512 left, Vector512 right) => left * right; /// Multiplies a vector by a scalar to compute their product. @@ -2018,8 +1920,6 @@ public static Vector512 Min(Vector512 left, Vector512 right) /// The scalar to multiply with . /// The product of and . /// The type of and () is not supported. - [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector512 Multiply(Vector512 left, T right) => left * right; /// Multiplies a vector by a scalar to compute their product. @@ -2028,8 +1928,6 @@ public static Vector512 Min(Vector512 left, Vector512 right) /// The vector to multiply with . /// The product of and . /// The type of and () is not supported. - [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector512 Multiply(T left, Vector512 right) => left * right; /// Narrows two instances into one . @@ -2139,8 +2037,6 @@ public static Vector512 Narrow(Vector512 lower, Vector512 up /// The vector to negate. /// A vector whose elements are the negation of the corresponding elements in . /// The type of () is not supported. - [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector512 Negate(Vector512 vector) => -vector; /// Computes the ones-complement of a vector. @@ -2148,8 +2044,6 @@ public static Vector512 Narrow(Vector512 lower, Vector512 up /// The vector whose ones-complement is to be computed. /// A vector whose elements are the ones-complement of the corresponding elements in . /// The type of () is not supported. - [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector512 OnesComplement(Vector512 vector) { return Create( @@ -2162,235 +2056,179 @@ public static Vector512 OnesComplement(Vector512 vector) /// The vector whose elements are to be shifted. /// The number of bits by which to shift each element. /// A vector whose elements where shifted left by . - [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] internal static Vector512 ShiftLeft(Vector512 vector, int shiftCount) => vector << shiftCount; /// Shifts each element of a vector left by the specified amount. /// The vector whose elements are to be shifted. /// The number of bits by which to shift each element. /// A vector whose elements where shifted left by . - [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector512 ShiftLeft(Vector512 vector, int shiftCount) => vector << shiftCount; /// Shifts each element of a vector left by the specified amount. /// The vector whose elements are to be shifted. /// The number of bits by which to shift each element. /// A vector whose elements where shifted left by . - [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector512 ShiftLeft(Vector512 vector, int shiftCount) => vector << shiftCount; /// Shifts each element of a vector left by the specified amount. /// The vector whose elements are to be shifted. /// The number of bits by which to shift each element. /// A vector whose elements where shifted left by . - [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector512 ShiftLeft(Vector512 vector, int shiftCount) => vector << shiftCount; /// Shifts each element of a vector left by the specified amount. /// The vector whose elements are to be shifted. /// The number of bits by which to shift each element. /// A vector whose elements where shifted left by . - [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector512 ShiftLeft(Vector512 vector, int shiftCount) => vector << shiftCount; /// Shifts each element of a vector left by the specified amount. /// The vector whose elements are to be shifted. /// The number of bits by which to shift each element. /// A vector whose elements where shifted left by . - [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector512 ShiftLeft(Vector512 vector, int shiftCount) => vector << shiftCount; /// Shifts each element of a vector left by the specified amount. /// The vector whose elements are to be shifted. /// The number of bits by which to shift each element. /// A vector whose elements where shifted left by . - [Intrinsic] [CLSCompliant(false)] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector512 ShiftLeft(Vector512 vector, int shiftCount) => vector << shiftCount; /// Shifts each element of a vector left by the specified amount. /// The vector whose elements are to be shifted. /// The number of bits by which to shift each element. /// A vector whose elements where shifted left by . - [Intrinsic] [CLSCompliant(false)] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector512 ShiftLeft(Vector512 vector, int shiftCount) => vector << shiftCount; /// Shifts each element of a vector left by the specified amount. /// The vector whose elements are to be shifted. /// The number of bits by which to shift each element. /// A vector whose elements where shifted left by . - [Intrinsic] [CLSCompliant(false)] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector512 ShiftLeft(Vector512 vector, int shiftCount) => vector << shiftCount; /// Shifts each element of a vector left by the specified amount. /// The vector whose elements are to be shifted. /// The number of bits by which to shift each element. /// A vector whose elements where shifted left by . - [Intrinsic] [CLSCompliant(false)] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector512 ShiftLeft(Vector512 vector, int shiftCount) => vector << shiftCount; /// Shifts each element of a vector left by the specified amount. /// The vector whose elements are to be shifted. /// The number of bits by which to shift each element. /// A vector whose elements where shifted left by . - [Intrinsic] [CLSCompliant(false)] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector512 ShiftLeft(Vector512 vector, int shiftCount) => vector << shiftCount; /// Shifts (signed) each element of a vector right by the specified amount. /// The vector whose elements are to be shifted. /// The number of bits by which to shift each element. /// A vector whose elements where shifted right by . - [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] internal static Vector512 ShiftRightArithmetic(Vector512 vector, int shiftCount) => vector >> shiftCount; /// Shifts (signed) each element of a vector right by the specified amount. /// The vector whose elements are to be shifted. /// The number of bits by which to shift each element. /// A vector whose elements where shifted right by . - [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector512 ShiftRightArithmetic(Vector512 vector, int shiftCount) => vector >> shiftCount; /// Shifts (signed) each element of a vector right by the specified amount. /// The vector whose elements are to be shifted. /// The number of bits by which to shift each element. /// A vector whose elements where shifted right by . - [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector512 ShiftRightArithmetic(Vector512 vector, int shiftCount) => vector >> shiftCount; /// Shifts (signed) each element of a vector right by the specified amount. /// The vector whose elements are to be shifted. /// The number of bits by which to shift each element. /// A vector whose elements where shifted right by . - [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector512 ShiftRightArithmetic(Vector512 vector, int shiftCount) => vector >> shiftCount; /// Shifts (signed) each element of a vector right by the specified amount. /// The vector whose elements are to be shifted. /// The number of bits by which to shift each element. /// A vector whose elements where shifted right by . - [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector512 ShiftRightArithmetic(Vector512 vector, int shiftCount) => vector >> shiftCount; /// Shifts (signed) each element of a vector right by the specified amount. /// The vector whose elements are to be shifted. /// The number of bits by which to shift each element. /// A vector whose elements where shifted right by . - [Intrinsic] [CLSCompliant(false)] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector512 ShiftRightArithmetic(Vector512 vector, int shiftCount) => vector >> shiftCount; /// Shifts (unsigned) each element of a vector right by the specified amount. /// The vector whose elements are to be shifted. /// The number of bits by which to shift each element. /// A vector whose elements where shifted right by . - [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] internal static Vector512 ShiftRightLogical(Vector512 vector, int shiftCount) => vector >>> shiftCount; /// Shifts (unsigned) each element of a vector right by the specified amount. /// The vector whose elements are to be shifted. /// The number of bits by which to shift each element. /// A vector whose elements where shifted right by . - [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector512 ShiftRightLogical(Vector512 vector, int shiftCount) => vector >>> shiftCount; /// Shifts (unsigned) each element of a vector right by the specified amount. /// The vector whose elements are to be shifted. /// The number of bits by which to shift each element. /// A vector whose elements where shifted right by . - [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector512 ShiftRightLogical(Vector512 vector, int shiftCount) => vector >>> shiftCount; /// Shifts (unsigned) each element of a vector right by the specified amount. /// The vector whose elements are to be shifted. /// The number of bits by which to shift each element. /// A vector whose elements where shifted right by . - [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector512 ShiftRightLogical(Vector512 vector, int shiftCount) => vector >>> shiftCount; /// Shifts (unsigned) each element of a vector right by the specified amount. /// The vector whose elements are to be shifted. /// The number of bits by which to shift each element. /// A vector whose elements where shifted right by . - [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector512 ShiftRightLogical(Vector512 vector, int shiftCount) => vector >>> shiftCount; /// Shifts (unsigned) each element of a vector right by the specified amount. /// The vector whose elements are to be shifted. /// The number of bits by which to shift each element. /// A vector whose elements where shifted right by . - [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector512 ShiftRightLogical(Vector512 vector, int shiftCount) => vector >>> shiftCount; /// Shifts (unsigned) each element of a vector right by the specified amount. /// The vector whose elements are to be shifted. /// The number of bits by which to shift each element. /// A vector whose elements where shifted right by . - [Intrinsic] [CLSCompliant(false)] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector512 ShiftRightLogical(Vector512 vector, int shiftCount) => vector >>> shiftCount; /// Shifts (unsigned) each element of a vector right by the specified amount. /// The vector whose elements are to be shifted. /// The number of bits by which to shift each element. /// A vector whose elements where shifted right by . - [Intrinsic] [CLSCompliant(false)] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector512 ShiftRightLogical(Vector512 vector, int shiftCount) => vector >>> shiftCount; /// Shifts (unsigned) each element of a vector right by the specified amount. /// The vector whose elements are to be shifted. /// The number of bits by which to shift each element. /// A vector whose elements where shifted right by . - [Intrinsic] [CLSCompliant(false)] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector512 ShiftRightLogical(Vector512 vector, int shiftCount) => vector >>> shiftCount; /// Shifts (unsigned) each element of a vector right by the specified amount. /// The vector whose elements are to be shifted. /// The number of bits by which to shift each element. /// A vector whose elements where shifted right by . - [Intrinsic] [CLSCompliant(false)] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector512 ShiftRightLogical(Vector512 vector, int shiftCount) => vector >>> shiftCount; /// Shifts (unsigned) each element of a vector right by the specified amount. /// The vector whose elements are to be shifted. /// The number of bits by which to shift each element. /// A vector whose elements where shifted right by . - [Intrinsic] [CLSCompliant(false)] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector512 ShiftRightLogical(Vector512 vector, int shiftCount) => vector >>> shiftCount; /// Creates a new vector by selecting values from an input vector using a set of indices. @@ -2658,9 +2496,7 @@ public static Vector512 Sqrt(Vector512 vector) /// The vector that will be stored. /// The destination at which will be stored. /// The type of and () is not supported. - [Intrinsic] [CLSCompliant(false)] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static void Store(this Vector512 source, T* destination) => source.StoreUnsafe(ref *destination); /// Stores a vector at the given aligned destination. @@ -2691,7 +2527,6 @@ public static void StoreAligned(this Vector512 source, T* destination) /// This method may bypass the cache on certain platforms. [Intrinsic] [CLSCompliant(false)] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static void StoreAlignedNonTemporal(this Vector512 source, T* destination) => source.StoreAligned(destination); #pragma warning restore CS8500 // This takes the address of, gets the size of, or declares a pointer to a managed type ('T') @@ -2731,8 +2566,6 @@ public static void StoreUnsafe(this Vector512 source, ref T destination, n /// The type of the elements in the vector. /// The difference of and . /// The type of and () is not supported. - [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector512 Subtract(Vector512 left, Vector512 right) => left - right; /// Computes the sum of all elements in a vector. @@ -2759,7 +2592,6 @@ public static T Sum(Vector512 vector) /// A scalar containing the value of the first element. /// The type of () is not supported. [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static T ToScalar(this Vector512 vector) { ThrowHelper.ThrowForUnsupportedIntrinsicsVector512BaseType(); @@ -3107,8 +2939,6 @@ public static Vector512 WithUpper(this Vector512 vector, Vector256 v /// The vector to exclusive-or with . /// The exclusive-or of and . /// The type of and () is not supported. - [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector512 Xor(Vector512 left, Vector512 right) => left ^ right; [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -3127,16 +2957,8 @@ internal static void SetElementUnsafe(in this Vector512 vector, int index, Unsafe.Add(ref address, index) = value; } - [MethodImpl(MethodImplOptions.AggressiveInlining)] - internal static void SetLowerUnsafe(in this Vector512 vector, Vector256 value) - { - Unsafe.AsRef(in vector._lower) = value; - } + internal static void SetLowerUnsafe(in this Vector512 vector, Vector256 value) => Unsafe.AsRef(in vector._lower) = value; - [MethodImpl(MethodImplOptions.AggressiveInlining)] - internal static void SetUpperUnsafe(in this Vector512 vector, Vector256 value) - { - Unsafe.AsRef(in vector._upper) = value; - } + internal static void SetUpperUnsafe(in this Vector512 vector, Vector256 value) => Unsafe.AsRef(in vector._upper) = value; } } diff --git a/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Vector512_1.cs b/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Vector512_1.cs index b070fc6e54dcba..db9c75fa084351 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Vector512_1.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Vector512_1.cs @@ -38,7 +38,6 @@ namespace System.Runtime.Intrinsics public static Vector512 AllBitsSet { [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] get { Vector256 vector = Vector256.AllBitsSet; @@ -51,11 +50,7 @@ public static Vector512 AllBitsSet public static int Count { [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] - get - { - return Vector256.Count * 2; - } + get => Vector256.Count * 2; } /// Gets a new with the elements set to their index. @@ -106,7 +101,6 @@ public static bool IsSupported public static Vector512 One { [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] get { Vector256 vector = Vector256.One; @@ -118,8 +112,6 @@ public static Vector512 One /// The type of the vector () is not supported. public static Vector512 Zero { - [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] get { ThrowHelper.ThrowForUnsupportedIntrinsicsVector512BaseType(); @@ -127,27 +119,14 @@ public static Vector512 Zero } } - internal string DisplayString - { - get - { - return IsSupported ? ToString() : SR.NotSupported_Type; - } - } + internal string DisplayString => IsSupported ? ToString() : SR.NotSupported_Type; /// Gets the element at the specified index. /// The index of the element to get. /// The value of the element at . /// was less than zero or greater than the number of elements. /// The type of the vector () is not supported. - public T this[int index] - { - [MethodImpl(MethodImplOptions.AggressiveInlining)] - get - { - return this.GetElement(index); - } - } + public T this[int index] => this.GetElement(index); /// Adds two vectors to compute their sum. /// The vector to add with . @@ -257,12 +236,7 @@ public T this[int index] /// true if any elements in was not equal to the corresponding element in . /// The type of the vector () is not supported. [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static bool operator !=(Vector512 left, Vector512 right) - { - return (left._lower != right._lower) - || (left._upper != right._upper); - } + public static bool operator !=(Vector512 left, Vector512 right) => !(left == right); /// Shifts each element of a vector left by the specified amount. /// The vector whose elements are to be shifted. @@ -314,7 +288,6 @@ public T this[int index] /// The product of and . /// The type of the vector () is not supported. [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector512 operator *(T left, Vector512 right) => right * left; /// Computes the ones-complement of a vector. @@ -378,8 +351,6 @@ public static Vector512 operator >>(Vector512 value, int shiftCount) /// The vector. /// /// The type of the vector () is not supported. - [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector512 operator +(Vector512 value) { ThrowHelper.ThrowForUnsupportedIntrinsicsVector512BaseType(); @@ -403,7 +374,6 @@ public static Vector512 operator >>>(Vector512 value, int shiftCount) /// Determines whether the specified object is equal to the current instance. /// The object to compare with the current instance. /// true if is a and is equal to the current instance; otherwise, false. - [MethodImpl(MethodImplOptions.AggressiveInlining)] public override bool Equals([NotNullWhen(true)] object? obj) => (obj is Vector512 other) && Equals(other); /// Determines whether the specified is equal to the current instance. @@ -454,7 +424,6 @@ public override int GetHashCode() /// Converts the current instance to an equivalent string representation. /// An equivalent string representation of the current instance. /// The type of the vector () is not supported. - [MethodImpl(MethodImplOptions.AggressiveInlining)] public override string ToString() => ToString("G", CultureInfo.InvariantCulture); private string ToString([StringSyntax(StringSyntaxAttribute.NumericFormat)] string? format, IFormatProvider? formatProvider) @@ -682,15 +651,9 @@ private string ToString([StringSyntax(StringSyntaxAttribute.NumericFormat)] stri // New Surface Area // - static bool ISimdVector, T>.AnyWhereAllBitsSet(Vector512 vector) - { - return Vector512.EqualsAny(vector, Vector512.AllBitsSet); - } + static bool ISimdVector, T>.AnyWhereAllBitsSet(Vector512 vector) => Vector512.EqualsAny(vector, AllBitsSet); - static bool ISimdVector, T>.Any(Vector512 vector, T value) - { - return Vector512.EqualsAny(vector, Vector512.Create((T)value)); - } + static bool ISimdVector, T>.Any(Vector512 vector, T value) => Vector512.EqualsAny(vector, Vector512.Create(value)); static int ISimdVector, T>.IndexOfLastMatch(Vector512 vector) { diff --git a/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Vector64.cs b/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Vector64.cs index f3e35f7ecc36fc..463339371e44ae 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Vector64.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Vector64.cs @@ -62,8 +62,6 @@ public static Vector64 Abs(Vector64 vector) /// The vector to add with . /// The sum of and . /// The type of and () is not supported. - [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector64 Add(Vector64 left, Vector64 right) => left + right; /// Computes the bitwise-and of a given vector and the ones complement of another vector. @@ -73,16 +71,7 @@ public static Vector64 Abs(Vector64 vector) /// The bitwise-and of and the ones-complement of . /// The type of and () is not supported. [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static Vector64 AndNot(Vector64 left, Vector64 right) - { - ThrowHelper.ThrowForUnsupportedIntrinsicsVector64BaseType(); - - Unsafe.SkipInit(out Vector64 result); - Unsafe.AsRef(in result._00) = left._00 & ~right._00; - - return result; - } + public static Vector64 AndNot(Vector64 left, Vector64 right) => left & ~right; /// Reinterprets a as a new . /// The type of the elements in the input vector. @@ -90,14 +79,13 @@ public static Vector64 AndNot(Vector64 left, Vector64 right) /// The vector to reinterpret. /// reinterpreted as a new . /// The type of () or the type of the target () is not supported. - [Intrinsic] [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector64 As(this Vector64 vector) { ThrowHelper.ThrowForUnsupportedIntrinsicsVector64BaseType(); ThrowHelper.ThrowForUnsupportedIntrinsicsVector64BaseType(); - return Unsafe.As, Vector64>(ref vector); + return Unsafe.BitCast, Vector64>(vector); } /// Reinterprets a as a new . @@ -105,8 +93,6 @@ public static Vector64 As(this Vector64 vector) /// The vector to reinterpret. /// reinterpreted as a new . /// The type of () is not supported. - [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector64 AsByte(this Vector64 vector) => vector.As(); /// Reinterprets a as a new . @@ -114,8 +100,6 @@ public static Vector64 As(this Vector64 vector) /// The vector to reinterpret. /// reinterpreted as a new . /// The type of () is not supported. - [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector64 AsDouble(this Vector64 vector) => vector.As(); /// Reinterprets a as a new . @@ -123,8 +107,6 @@ public static Vector64 As(this Vector64 vector) /// The vector to reinterpret. /// reinterpreted as a new . /// The type of () is not supported. - [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector64 AsInt16(this Vector64 vector) => vector.As(); /// Reinterprets a as a new . @@ -132,8 +114,6 @@ public static Vector64 As(this Vector64 vector) /// The vector to reinterpret. /// reinterpreted as a new . /// The type of () is not supported. - [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector64 AsInt32(this Vector64 vector) => vector.As(); /// Reinterprets a as a new . @@ -141,8 +121,6 @@ public static Vector64 As(this Vector64 vector) /// The vector to reinterpret. /// reinterpreted as a new . /// The type of () is not supported. - [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector64 AsInt64(this Vector64 vector) => vector.As(); /// Reinterprets a as a new . @@ -150,8 +128,6 @@ public static Vector64 As(this Vector64 vector) /// The vector to reinterpret. /// reinterpreted as a new . /// The type of () is not supported. - [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector64 AsNInt(this Vector64 vector) => vector.As(); /// Reinterprets a as a new . @@ -159,9 +135,7 @@ public static Vector64 As(this Vector64 vector) /// The vector to reinterpret. /// reinterpreted as a new . /// The type of () is not supported. - [Intrinsic] [CLSCompliant(false)] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector64 AsNUInt(this Vector64 vector) => vector.As(); /// Reinterprets a as a new . @@ -169,9 +143,7 @@ public static Vector64 As(this Vector64 vector) /// The vector to reinterpret. /// reinterpreted as a new . /// The type of () is not supported. - [Intrinsic] [CLSCompliant(false)] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector64 AsSByte(this Vector64 vector) => vector.As(); /// Reinterprets a as a new . @@ -179,8 +151,6 @@ public static Vector64 As(this Vector64 vector) /// The vector to reinterpret. /// reinterpreted as a new . /// The type of () is not supported. - [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector64 AsSingle(this Vector64 vector) => vector.As(); /// Reinterprets a as a new . @@ -188,9 +158,7 @@ public static Vector64 As(this Vector64 vector) /// The vector to reinterpret. /// reinterpreted as a new . /// The type of () is not supported. - [Intrinsic] [CLSCompliant(false)] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector64 AsUInt16(this Vector64 vector) => vector.As(); /// Reinterprets a as a new . @@ -198,9 +166,7 @@ public static Vector64 As(this Vector64 vector) /// The vector to reinterpret. /// reinterpreted as a new . /// The type of () is not supported. - [Intrinsic] [CLSCompliant(false)] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector64 AsUInt32(this Vector64 vector) => vector.As(); /// Reinterprets a as a new . @@ -208,9 +174,7 @@ public static Vector64 As(this Vector64 vector) /// The vector to reinterpret. /// reinterpreted as a new . /// The type of () is not supported. - [Intrinsic] [CLSCompliant(false)] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector64 AsUInt64(this Vector64 vector) => vector.As(); /// Computes the bitwise-and of two vectors. @@ -219,8 +183,6 @@ public static Vector64 As(this Vector64 vector) /// The vector to bitwise-and with . /// The bitwise-and of and . /// The type of and () is not supported. - [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector64 BitwiseAnd(Vector64 left, Vector64 right) => left & right; /// Computes the bitwise-or of two vectors. @@ -229,8 +191,6 @@ public static Vector64 As(this Vector64 vector) /// The vector to bitwise-or with . /// The bitwise-or of and . /// The type of and () is not supported. - [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector64 BitwiseOr(Vector64 left, Vector64 right) => left | right; /// Computes the ceiling of each element in a vector. @@ -272,7 +232,6 @@ internal static Vector64 Ceiling(Vector64 vector) /// A vector whose elements are the ceiling of the elements in . /// [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector64 Ceiling(Vector64 vector) => Ceiling(vector); /// Computes the ceiling of each element in a vector. @@ -280,7 +239,6 @@ internal static Vector64 Ceiling(Vector64 vector) /// A vector whose elements are the ceiling of the elements in . /// [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector64 Ceiling(Vector64 vector) => Ceiling(vector); /// Conditionally selects a value from two vectors on a bitwise basis. @@ -292,15 +250,7 @@ internal static Vector64 Ceiling(Vector64 vector) /// The type of , , and () is not supported. [Intrinsic] [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static Vector64 ConditionalSelect(Vector64 condition, Vector64 left, Vector64 right) - { - ThrowHelper.ThrowForUnsupportedIntrinsicsVector64BaseType(); - - Unsafe.SkipInit(out Vector64 result); - Unsafe.AsRef(in result._00) = (left._00 & condition._00) | (right._00 & ~condition._00); - - return result; - } + public static Vector64 ConditionalSelect(Vector64 condition, Vector64 left, Vector64 right) => (left & condition) | (right & ~condition); /// Converts a to a . /// The vector to convert. @@ -611,14 +561,12 @@ public static unsafe Vector64 Create(T value) /// On x86, this method corresponds to __m64 _mm_set1_pi8 /// A new with all elements initialized to . [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static unsafe Vector64 Create(byte value) => Create(value); /// Creates a new instance with all elements initialized to the specified value. /// The value that all elements will be initialized to. /// A new with all elements initialized to . [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static unsafe Vector64 Create(double value) => Create(value); /// Creates a new instance with all elements initialized to the specified value. @@ -626,7 +574,6 @@ public static unsafe Vector64 Create(T value) /// On x86, this method corresponds to __m64 _mm_set1_pi16 /// A new with all elements initialized to . [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static unsafe Vector64 Create(short value) => Create(value); /// Creates a new instance with all elements initialized to the specified value. @@ -634,21 +581,18 @@ public static unsafe Vector64 Create(T value) /// On x86, this method corresponds to __m64 _mm_set1_pi32 /// A new with all elements initialized to . [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static unsafe Vector64 Create(int value) => Create(value); /// Creates a new instance with all elements initialized to the specified value. /// The value that all elements will be initialized to. /// A new with all elements initialized to . [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static unsafe Vector64 Create(long value) => Create(value); /// Creates a new instance with all elements initialized to the specified value. /// The value that all elements will be initialized to. /// A new with all elements initialized to . [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static unsafe Vector64 Create(nint value) => Create(value); /// Creates a new instance with all elements initialized to the specified value. @@ -656,7 +600,6 @@ public static unsafe Vector64 Create(T value) /// A new with all elements initialized to . [Intrinsic] [CLSCompliant(false)] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static unsafe Vector64 Create(nuint value) => Create(value); /// Creates a new instance with all elements initialized to the specified value. @@ -665,14 +608,12 @@ public static unsafe Vector64 Create(T value) /// A new with all elements initialized to . [Intrinsic] [CLSCompliant(false)] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static unsafe Vector64 Create(sbyte value) => Create(value); /// Creates a new instance with all elements initialized to the specified value. /// The value that all elements will be initialized to. /// A new with all elements initialized to . [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static unsafe Vector64 Create(float value) => Create(value); /// Creates a new instance with all elements initialized to the specified value. @@ -681,7 +622,6 @@ public static unsafe Vector64 Create(T value) /// A new with all elements initialized to . [Intrinsic] [CLSCompliant(false)] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static unsafe Vector64 Create(ushort value) => Create(value); /// Creates a new instance with all elements initialized to the specified value. @@ -690,7 +630,6 @@ public static unsafe Vector64 Create(T value) /// A new with all elements initialized to . [Intrinsic] [CLSCompliant(false)] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static unsafe Vector64 Create(uint value) => Create(value); /// Creates a new instance with all elements initialized to the specified value. @@ -698,7 +637,6 @@ public static unsafe Vector64 Create(T value) /// A new with all elements initialized to . [Intrinsic] [CLSCompliant(false)] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static unsafe Vector64 Create(ulong value) => Create(value); /// Creates a new from a given array. @@ -916,42 +854,36 @@ public static unsafe Vector64 CreateScalar(T value) /// The value that element 0 will be initialized to. /// A new instance with the first element initialized to and the remaining elements initialized to zero. [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static unsafe Vector64 CreateScalar(byte value) => CreateScalar(value); /// Creates a new instance with the first element initialized to the specified value and the remaining elements initialized to zero. /// The value that element 0 will be initialized to. /// A new instance with the first element initialized to and the remaining elements initialized to zero. [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static unsafe Vector64 CreateScalar(double value) => CreateScalar(value); /// Creates a new instance with the first element initialized to the specified value and the remaining elements initialized to zero. /// The value that element 0 will be initialized to. /// A new instance with the first element initialized to and the remaining elements initialized to zero. [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static unsafe Vector64 CreateScalar(short value) => CreateScalar(value); /// Creates a new instance with the first element initialized to the specified value and the remaining elements initialized to zero. /// The value that element 0 will be initialized to. /// A new instance with the first element initialized to and the remaining elements initialized to zero. [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static unsafe Vector64 CreateScalar(int value) => CreateScalar(value); /// Creates a new instance with the first element initialized to the specified value and the remaining elements initialized to zero. /// The value that element 0 will be initialized to. /// A new instance with the first element initialized to and the remaining elements initialized to zero. [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static unsafe Vector64 CreateScalar(long value) => CreateScalar(value); /// Creates a new instance with the first element initialized to the specified value and the remaining elements initialized to zero. /// The value that element 0 will be initialized to. /// A new instance with the first element initialized to and the remaining elements initialized to zero. [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static unsafe Vector64 CreateScalar(nint value) => CreateScalar(value); /// Creates a new instance with the first element initialized to the specified value and the remaining elements initialized to zero. @@ -959,7 +891,6 @@ public static unsafe Vector64 CreateScalar(T value) /// A new instance with the first element initialized to and the remaining elements initialized to zero. [Intrinsic] [CLSCompliant(false)] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static unsafe Vector64 CreateScalar(nuint value) => CreateScalar(value); /// Creates a new instance with the first element initialized to the specified value and the remaining elements initialized to zero. @@ -967,14 +898,12 @@ public static unsafe Vector64 CreateScalar(T value) /// A new instance with the first element initialized to and the remaining elements initialized to zero. [Intrinsic] [CLSCompliant(false)] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static unsafe Vector64 CreateScalar(sbyte value) => CreateScalar(value); /// Creates a new instance with the first element initialized to the specified value and the remaining elements initialized to zero. /// The value that element 0 will be initialized to. /// A new instance with the first element initialized to and the remaining elements initialized to zero. [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static unsafe Vector64 CreateScalar(float value) => CreateScalar(value); /// Creates a new instance with the first element initialized to the specified value and the remaining elements initialized to zero. @@ -982,7 +911,6 @@ public static unsafe Vector64 CreateScalar(T value) /// A new instance with the first element initialized to and the remaining elements initialized to zero. [Intrinsic] [CLSCompliant(false)] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static unsafe Vector64 CreateScalar(ushort value) => CreateScalar(value); /// Creates a new instance with the first element initialized to the specified value and the remaining elements initialized to zero. @@ -990,7 +918,6 @@ public static unsafe Vector64 CreateScalar(T value) /// A new instance with the first element initialized to and the remaining elements initialized to zero. [Intrinsic] [CLSCompliant(false)] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static unsafe Vector64 CreateScalar(uint value) => CreateScalar(value); /// Creates a new instance with the first element initialized to the specified value and the remaining elements initialized to zero. @@ -998,7 +925,6 @@ public static unsafe Vector64 CreateScalar(T value) /// A new instance with the first element initialized to and the remaining elements initialized to zero. [Intrinsic] [CLSCompliant(false)] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static unsafe Vector64 CreateScalar(ulong value) => CreateScalar(value); /// Creates a new instance with the first element initialized to the specified value and the remaining elements left uninitialized. @@ -1024,42 +950,36 @@ public static Vector64 CreateScalarUnsafe(T value) /// The value that element 0 will be initialized to. /// A new instance with the first element initialized to and the remaining elements left uninitialized. [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static unsafe Vector64 CreateScalarUnsafe(byte value) => CreateScalarUnsafe(value); /// Creates a new instance with the first element initialized to the specified value and the remaining elements left uninitialized. /// The value that element 0 will be initialized to. /// A new instance with the first element initialized to and the remaining elements left uninitialized. [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static unsafe Vector64 CreateScalarUnsafe(double value) => CreateScalarUnsafe(value); /// Creates a new instance with the first element initialized to the specified value and the remaining elements left uninitialized. /// The value that element 0 will be initialized to. /// A new instance with the first element initialized to and the remaining elements left uninitialized. [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static unsafe Vector64 CreateScalarUnsafe(short value) => CreateScalarUnsafe(value); /// Creates a new instance with the first element initialized to the specified value and the remaining elements left uninitialized. /// The value that element 0 will be initialized to. /// A new instance with the first element initialized to and the remaining elements left uninitialized. [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static unsafe Vector64 CreateScalarUnsafe(int value) => CreateScalarUnsafe(value); /// Creates a new instance with the first element initialized to the specified value and the remaining elements left uninitialized. /// The value that element 0 will be initialized to. /// A new instance with the first element initialized to and the remaining elements left uninitialized. [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static unsafe Vector64 CreateScalarUnsafe(long value) => CreateScalarUnsafe(value); /// Creates a new instance with the first element initialized to the specified value and the remaining elements left uninitialized. /// The value that element 0 will be initialized to. /// A new instance with the first element initialized to and the remaining elements left uninitialized. [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static unsafe Vector64 CreateScalarUnsafe(nint value) => CreateScalarUnsafe(value); /// Creates a new instance with the first element initialized to the specified value and the remaining elements left uninitialized. @@ -1067,7 +987,6 @@ public static Vector64 CreateScalarUnsafe(T value) /// A new instance with the first element initialized to and the remaining elements left uninitialized. [Intrinsic] [CLSCompliant(false)] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static unsafe Vector64 CreateScalarUnsafe(nuint value) => CreateScalarUnsafe(value); /// Creates a new instance with the first element initialized to the specified value and the remaining elements left uninitialized. @@ -1075,14 +994,12 @@ public static Vector64 CreateScalarUnsafe(T value) /// A new instance with the first element initialized to and the remaining elements left uninitialized. [Intrinsic] [CLSCompliant(false)] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static unsafe Vector64 CreateScalarUnsafe(sbyte value) => CreateScalarUnsafe(value); /// Creates a new instance with the first element initialized to the specified value and the remaining elements left uninitialized. /// The value that element 0 will be initialized to. /// A new instance with the first element initialized to and the remaining elements left uninitialized. [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static unsafe Vector64 CreateScalarUnsafe(float value) => CreateScalarUnsafe(value); /// Creates a new instance with the first element initialized to the specified value and the remaining elements left uninitialized. @@ -1090,7 +1007,6 @@ public static Vector64 CreateScalarUnsafe(T value) /// A new instance with the first element initialized to and the remaining elements left uninitialized. [Intrinsic] [CLSCompliant(false)] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static unsafe Vector64 CreateScalarUnsafe(ushort value) => CreateScalarUnsafe(value); /// Creates a new instance with the first element initialized to the specified value and the remaining elements left uninitialized. @@ -1098,7 +1014,6 @@ public static Vector64 CreateScalarUnsafe(T value) /// A new instance with the first element initialized to and the remaining elements left uninitialized. [Intrinsic] [CLSCompliant(false)] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static unsafe Vector64 CreateScalarUnsafe(uint value) => CreateScalarUnsafe(value); /// Creates a new instance with the first element initialized to the specified value and the remaining elements left uninitialized. @@ -1106,7 +1021,6 @@ public static Vector64 CreateScalarUnsafe(T value) /// A new instance with the first element initialized to and the remaining elements left uninitialized. [Intrinsic] [CLSCompliant(false)] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static unsafe Vector64 CreateScalarUnsafe(ulong value) => CreateScalarUnsafe(value); /// Creates a new instance where the elements begin at a specified value and which are spaced apart according to another specified value. @@ -1124,8 +1038,6 @@ public static Vector64 CreateScalarUnsafe(T value) /// The vector that will divide . /// The quotient of divided by . /// The type of and () is not supported. - [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector64 Divide(Vector64 left, Vector64 right) => left / right; /// Divides a vector by a scalar to compute the per-element quotient. @@ -1133,8 +1045,6 @@ public static Vector64 CreateScalarUnsafe(T value) /// The scalar that will divide . /// The type of the elements in the vector. /// The quotient of divided by . - [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector64 Divide(Vector64 left, T right) => left / right; /// Computes the dot product of two vectors. @@ -1144,34 +1054,7 @@ public static Vector64 CreateScalarUnsafe(T value) /// The dot product of and . /// The type of and () is not supported. [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static T Dot(Vector64 left, Vector64 right) - { - T result = default!; - - // Doing this as pairs is important for floating-point determinism - // This is because the underlying dpps instruction on x86/x64 will do this equivalently - // and otherwise the software vs accelerated implementations may differ in returned result. - - if (Vector64.Count != 1) - { - for (int index = 0; index < Vector64.Count; index += 2) - { - T value = Scalar.Add( - Scalar.Multiply(left.GetElementUnsafe(index + 0), right.GetElementUnsafe(index + 0)), - Scalar.Multiply(left.GetElementUnsafe(index + 1), right.GetElementUnsafe(index + 1)) - ); - - result = Scalar.Add(result, value); - } - } - else - { - result = Scalar.Multiply(left.GetElementUnsafe(0), right.GetElementUnsafe(0)); - } - - return result; - } + public static T Dot(Vector64 left, Vector64 right) => Sum(left * right); /// Compares two vectors to determine if they are equal on a per-element basis. /// The type of the elements in the vector. @@ -1200,8 +1083,6 @@ public static Vector64 Equals(Vector64 left, Vector64 right) /// The vector to compare with . /// true if all elements in were equal to the corresponding element in . /// The type of and () is not supported. - [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static bool EqualsAll(Vector64 left, Vector64 right) => left == right; /// Compares two vectors to determine if any elements are equal. @@ -1331,7 +1212,6 @@ internal static Vector64 Floor(Vector64 vector) /// A vector whose elements are the floor of the elements in . /// [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector64 Floor(Vector64 vector) => Floor(vector); /// Computes the floor of each element in a vector. @@ -1339,7 +1219,6 @@ internal static Vector64 Floor(Vector64 vector) /// A vector whose elements are the floor of the elements in . /// [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector64 Floor(Vector64 vector) => Floor(vector); /// Gets the element at the specified index. @@ -1619,9 +1498,7 @@ public static bool LessThanOrEqualAny(Vector64 left, Vector64 right) /// The source from which the vector will be loaded. /// The vector loaded from . /// The type of () is not supported. - [Intrinsic] [CLSCompliant(false)] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static unsafe Vector64 Load(T* source) => LoadUnsafe(ref *source); /// Loads a vector from the given aligned source. @@ -1652,7 +1529,6 @@ public static unsafe Vector64 LoadAligned(T* source) /// The type of () is not supported. [Intrinsic] [CLSCompliant(false)] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static unsafe Vector64 LoadAlignedNonTemporal(T* source) => LoadAligned(source); #pragma warning restore CS8500 // This takes the address of, gets the size of, or declares a pointer to a managed type ('T') @@ -1826,8 +1702,6 @@ public static Vector64 Min(Vector64 left, Vector64 right) /// The vector to multiply with . /// The element-wise product of and . /// The type of and () is not supported. - [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector64 Multiply(Vector64 left, Vector64 right) => left * right; /// Multiplies a vector by a scalar to compute their product. @@ -1836,8 +1710,6 @@ public static Vector64 Min(Vector64 left, Vector64 right) /// The scalar to multiply with . /// The product of and . /// The type of and () is not supported. - [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector64 Multiply(Vector64 left, T right) => left * right; /// Multiplies a vector by a scalar to compute their product. @@ -1846,8 +1718,6 @@ public static Vector64 Min(Vector64 left, Vector64 right) /// The vector to multiply with . /// The product of and . /// The type of and () is not supported. - [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector64 Multiply(T left, Vector64 right) => left * right; /// Narrows two instances into one . @@ -2034,8 +1904,6 @@ public static unsafe Vector64 Narrow(Vector64 lower, Vector64The vector to negate. /// A vector whose elements are the negation of the corresponding elements in . /// The type of () is not supported. - [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector64 Negate(Vector64 vector) => -vector; /// Computes the ones-complement of a vector. @@ -2043,243 +1911,185 @@ public static unsafe Vector64 Narrow(Vector64 lower, Vector64The vector whose ones-complement is to be computed. /// A vector whose elements are the ones-complement of the corresponding elements in . /// The type of () is not supported. - [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector64 OnesComplement(Vector64 vector) => ~vector; /// Shifts each element of a vector left by the specified amount. /// The vector whose elements are to be shifted. /// The number of bits by which to shift each element. /// A vector whose elements where shifted left by . - [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] internal static Vector64 ShiftLeft(Vector64 vector, int shiftCount) => vector << shiftCount; /// Shifts each element of a vector left by the specified amount. /// The vector whose elements are to be shifted. /// The number of bits by which to shift each element. /// A vector whose elements where shifted left by . - [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector64 ShiftLeft(Vector64 vector, int shiftCount) => vector << shiftCount; /// Shifts each element of a vector left by the specified amount. /// The vector whose elements are to be shifted. /// The number of bits by which to shift each element. /// A vector whose elements where shifted left by . - [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector64 ShiftLeft(Vector64 vector, int shiftCount) => vector << shiftCount; /// Shifts each element of a vector left by the specified amount. /// The vector whose elements are to be shifted. /// The number of bits by which to shift each element. /// A vector whose elements where shifted left by . - [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector64 ShiftLeft(Vector64 vector, int shiftCount) => vector << shiftCount; /// Shifts each element of a vector left by the specified amount. /// The vector whose elements are to be shifted. /// The number of bits by which to shift each element. /// A vector whose elements where shifted left by . - [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector64 ShiftLeft(Vector64 vector, int shiftCount) => vector << shiftCount; /// Shifts each element of a vector left by the specified amount. /// The vector whose elements are to be shifted. /// The number of bits by which to shift each element. /// A vector whose elements where shifted left by . - [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector64 ShiftLeft(Vector64 vector, int shiftCount) => vector << shiftCount; /// Shifts each element of a vector left by the specified amount. /// The vector whose elements are to be shifted. /// The number of bits by which to shift each element. /// A vector whose elements where shifted left by . - [Intrinsic] [CLSCompliant(false)] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector64 ShiftLeft(Vector64 vector, int shiftCount) => vector << shiftCount; /// Shifts each element of a vector left by the specified amount. /// The vector whose elements are to be shifted. /// The number of bits by which to shift each element. /// A vector whose elements where shifted left by . - [Intrinsic] [CLSCompliant(false)] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector64 ShiftLeft(Vector64 vector, int shiftCount) => vector << shiftCount; /// Shifts each element of a vector left by the specified amount. /// The vector whose elements are to be shifted. /// The number of bits by which to shift each element. /// A vector whose elements where shifted left by . - [Intrinsic] [CLSCompliant(false)] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector64 ShiftLeft(Vector64 vector, int shiftCount) => vector << shiftCount; /// Shifts each element of a vector left by the specified amount. /// The vector whose elements are to be shifted. /// The number of bits by which to shift each element. /// A vector whose elements where shifted left by . - [Intrinsic] [CLSCompliant(false)] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector64 ShiftLeft(Vector64 vector, int shiftCount) => vector << shiftCount; /// Shifts each element of a vector left by the specified amount. /// The vector whose elements are to be shifted. /// The number of bits by which to shift each element. /// A vector whose elements where shifted left by . - [Intrinsic] [CLSCompliant(false)] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector64 ShiftLeft(Vector64 vector, int shiftCount) => vector << shiftCount; /// Shifts (signed) each element of a vector right by the specified amount. /// The vector whose elements are to be shifted. /// The number of bits by which to shift each element. /// A vector whose elements where shifted right by . - [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] internal static Vector64 ShiftRightArithmetic(Vector64 vector, int shiftCount) => vector >> shiftCount; /// Shifts (signed) each element of a vector right by the specified amount. /// The vector whose elements are to be shifted. /// The number of bits by which to shift each element. /// A vector whose elements where shifted right by . - [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector64 ShiftRightArithmetic(Vector64 vector, int shiftCount) => vector >> shiftCount; /// Shifts (signed) each element of a vector right by the specified amount. /// The vector whose elements are to be shifted. /// The number of bits by which to shift each element. /// A vector whose elements where shifted right by . - [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector64 ShiftRightArithmetic(Vector64 vector, int shiftCount) => vector >> shiftCount; /// Shifts (signed) each element of a vector right by the specified amount. /// The vector whose elements are to be shifted. /// The number of bits by which to shift each element. /// A vector whose elements where shifted right by . - [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector64 ShiftRightArithmetic(Vector64 vector, int shiftCount) => vector >> shiftCount; /// Shifts (signed) each element of a vector right by the specified amount. /// The vector whose elements are to be shifted. /// The number of bits by which to shift each element. /// A vector whose elements where shifted right by . - [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector64 ShiftRightArithmetic(Vector64 vector, int shiftCount) => vector >> shiftCount; /// Shifts (signed) each element of a vector right by the specified amount. /// The vector whose elements are to be shifted. /// The number of bits by which to shift each element. /// A vector whose elements where shifted right by . - [Intrinsic] [CLSCompliant(false)] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector64 ShiftRightArithmetic(Vector64 vector, int shiftCount) => vector >> shiftCount; /// Shifts (unsigned) each element of a vector right by the specified amount. /// The vector whose elements are to be shifted. /// The number of bits by which to shift each element. /// A vector whose elements where shifted right by . - [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] internal static Vector64 ShiftRightLogical(Vector64 vector, int shiftCount) => vector >>> shiftCount; /// Shifts (unsigned) each element of a vector right by the specified amount. /// The vector whose elements are to be shifted. /// The number of bits by which to shift each element. /// A vector whose elements where shifted right by . - [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector64 ShiftRightLogical(Vector64 vector, int shiftCount) => vector >>> shiftCount; /// Shifts (unsigned) each element of a vector right by the specified amount. /// The vector whose elements are to be shifted. /// The number of bits by which to shift each element. /// A vector whose elements where shifted right by . - [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector64 ShiftRightLogical(Vector64 vector, int shiftCount) => vector >>> shiftCount; /// Shifts (unsigned) each element of a vector right by the specified amount. /// The vector whose elements are to be shifted. /// The number of bits by which to shift each element. /// A vector whose elements where shifted right by . - [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector64 ShiftRightLogical(Vector64 vector, int shiftCount) => vector >>> shiftCount; /// Shifts (unsigned) each element of a vector right by the specified amount. /// The vector whose elements are to be shifted. /// The number of bits by which to shift each element. /// A vector whose elements where shifted right by . - [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector64 ShiftRightLogical(Vector64 vector, int shiftCount) => vector >>> shiftCount; /// Shifts (unsigned) each element of a vector right by the specified amount. /// The vector whose elements are to be shifted. /// The number of bits by which to shift each element. /// A vector whose elements where shifted right by . - [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector64 ShiftRightLogical(Vector64 vector, int shiftCount) => vector >>> shiftCount; /// Shifts (unsigned) each element of a vector right by the specified amount. /// The vector whose elements are to be shifted. /// The number of bits by which to shift each element. /// A vector whose elements where shifted right by . - [Intrinsic] [CLSCompliant(false)] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector64 ShiftRightLogical(Vector64 vector, int shiftCount) => vector >>> shiftCount; /// Shifts (unsigned) each element of a vector right by the specified amount. /// The vector whose elements are to be shifted. /// The number of bits by which to shift each element. /// A vector whose elements where shifted right by . - [Intrinsic] [CLSCompliant(false)] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector64 ShiftRightLogical(Vector64 vector, int shiftCount) => vector >>> shiftCount; /// Shifts (unsigned) each element of a vector right by the specified amount. /// The vector whose elements are to be shifted. /// The number of bits by which to shift each element. /// A vector whose elements where shifted right by . - [Intrinsic] [CLSCompliant(false)] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector64 ShiftRightLogical(Vector64 vector, int shiftCount) => vector >>> shiftCount; /// Shifts (unsigned) each element of a vector right by the specified amount. /// The vector whose elements are to be shifted. /// The number of bits by which to shift each element. /// A vector whose elements where shifted right by . - [Intrinsic] [CLSCompliant(false)] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector64 ShiftRightLogical(Vector64 vector, int shiftCount) => vector >>> shiftCount; /// Shifts (unsigned) each element of a vector right by the specified amount. /// The vector whose elements are to be shifted. /// The number of bits by which to shift each element. /// A vector whose elements where shifted right by . - [Intrinsic] [CLSCompliant(false)] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector64 ShiftRightLogical(Vector64 vector, int shiftCount) => vector >>> shiftCount; /// Creates a new vector by selecting values from an input vector using a set of indices. @@ -2479,9 +2289,7 @@ public static Vector64 Sqrt(Vector64 vector) /// The vector that will be stored. /// The destination at which will be stored. /// The type of () is not supported. - [Intrinsic] [CLSCompliant(false)] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static unsafe void Store(this Vector64 source, T* destination) => source.StoreUnsafe(ref *destination); /// Stores a vector at the given aligned destination. @@ -2512,7 +2320,6 @@ public static unsafe void StoreAligned(this Vector64 source, T* destinatio /// The type of () is not supported. [Intrinsic] [CLSCompliant(false)] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static unsafe void StoreAlignedNonTemporal(this Vector64 source, T* destination) => source.StoreAligned(destination); #pragma warning restore CS8500 // This takes the address of, gets the size of, or declares a pointer to a managed type ('T') @@ -2552,8 +2359,6 @@ public static void StoreUnsafe(this Vector64 source, ref T destination, nu /// The vector to subtract from . /// The difference of and . /// The type of and () is not supported. - [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector64 Subtract(Vector64 left, Vector64 right) => left - right; /// Computes the sum of all elements in a vector. @@ -2581,7 +2386,6 @@ public static T Sum(Vector64 vector) /// A scalar containing the value of the first element. /// The type of () is not supported. [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static T ToScalar(this Vector64 vector) { ThrowHelper.ThrowForUnsupportedIntrinsicsVector64BaseType(); @@ -2975,8 +2779,6 @@ public static Vector64 WithElement(this Vector64 vector, int index, T v /// The vector to exclusive-or with . /// The exclusive-or of and . /// The type of and () is not supported. - [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector64 Xor(Vector64 left, Vector64 right) => left ^ right; [MethodImpl(MethodImplOptions.AggressiveInlining)] diff --git a/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Vector64_1.cs b/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Vector64_1.cs index 362977a3b22754..d129cf58082b29 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Vector64_1.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Vector64_1.cs @@ -56,7 +56,6 @@ public static Vector64 AllBitsSet public static unsafe int Count { [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] get { ThrowHelper.ThrowForUnsupportedIntrinsicsVector64BaseType(); @@ -113,20 +112,13 @@ public static bool IsSupported public static Vector64 One { [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] - get - { - T scalar = Scalar.One; - return Vector64.Create(scalar); - } + get => Vector64.Create(Scalar.One); } /// Gets a new with all elements initialized to zero. /// The type of the vector () is not supported. public static Vector64 Zero { - [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] get { ThrowHelper.ThrowForUnsupportedIntrinsicsVector64BaseType(); @@ -134,27 +126,14 @@ public static Vector64 Zero } } - internal string DisplayString - { - get - { - return IsSupported ? ToString() : SR.NotSupported_Type; - } - } + internal string DisplayString => IsSupported ? ToString() : SR.NotSupported_Type; /// Gets the element at the specified index. /// The index of the element to get. /// The value of the element at . /// was less than zero or greater than the number of elements. /// The type of the vector () is not supported. - public T this[int index] - { - [MethodImpl(MethodImplOptions.AggressiveInlining)] - get - { - return this.GetElement(index); - } - } + public T this[int index] => this.GetElement(index); /// Adds two vectors to compute their sum. /// The vector to add with . @@ -291,18 +270,7 @@ public T this[int index] /// true if any elements in was not equal to the corresponding element in . /// The type of the vector () is not supported. [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static bool operator !=(Vector64 left, Vector64 right) - { - for (int index = 0; index < Count; index++) - { - if (!Scalar.Equals(left.GetElementUnsafe(index), right.GetElementUnsafe(index))) - { - return true; - } - } - return false; - } + public static bool operator !=(Vector64 left, Vector64 right) => !(left == right); /// Shifts each element of a vector left by the specified amount. /// The vector whose elements are to be shifted. @@ -369,7 +337,6 @@ public T this[int index] /// The product of and . /// The type of the vector () is not supported. [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector64 operator *(T left, Vector64 right) => right * left; /// Computes the ones-complement of a vector. @@ -432,15 +399,12 @@ public static Vector64 operator >>(Vector64 value, int shiftCount) /// A vector whose elements are the unary negation of the corresponding elements in . /// The type of the vector () is not supported. [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector64 operator -(Vector64 vector) => Zero - vector; /// Returns a given vector unchanged. /// The vector. /// /// The type of the vector () is not supported. - [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector64 operator +(Vector64 value) { ThrowHelper.ThrowForUnsupportedIntrinsicsVector64BaseType(); @@ -469,7 +433,6 @@ public static Vector64 operator >>>(Vector64 value, int shiftCount) /// Determines whether the specified object is equal to the current instance. /// The object to compare with the current instance. /// true if is a and is equal to the current instance; otherwise, false. - [MethodImpl(MethodImplOptions.AggressiveInlining)] public override bool Equals([NotNullWhen(true)] object? obj) => (obj is Vector64 other) && Equals(other); /// Determines whether the specified is equal to the current instance. @@ -529,7 +492,6 @@ public override int GetHashCode() /// Converts the current instance to an equivalent string representation. /// An equivalent string representation of the current instance. /// The type of the vector () is not supported. - [MethodImpl(MethodImplOptions.AggressiveInlining)] public override string ToString() => ToString("G", CultureInfo.InvariantCulture); private string ToString([StringSyntax(StringSyntaxAttribute.NumericFormat)] string? format, IFormatProvider? formatProvider) @@ -757,15 +719,9 @@ private string ToString([StringSyntax(StringSyntaxAttribute.NumericFormat)] stri // New Surface Area // - static bool ISimdVector, T>.AnyWhereAllBitsSet(Vector64 vector) - { - return Vector64.EqualsAny(vector, Vector64.AllBitsSet); - } + static bool ISimdVector, T>.AnyWhereAllBitsSet(Vector64 vector) => Vector64.EqualsAny(vector, AllBitsSet); - static bool ISimdVector, T>.Any(Vector64 vector, T value) - { - return Vector64.EqualsAny(vector, Vector64.Create((T)value)); - } + static bool ISimdVector, T>.Any(Vector64 vector, T value) => Vector64.EqualsAny(vector, Vector64.Create(value)); static int ISimdVector, T>.IndexOfLastMatch(Vector64 vector) { From 2514560e3a8f96f257a17995ac1d6b25d1e94f40 Mon Sep 17 00:00:00 2001 From: Tanner Gooding Date: Fri, 17 May 2024 07:19:29 -0700 Subject: [PATCH 6/9] Don't regress the implementation of Dot --- .../src/System/Runtime/Intrinsics/Vector128.cs | 12 +++++++++++- .../src/System/Runtime/Intrinsics/Vector256.cs | 12 +++++++++++- .../src/System/Runtime/Intrinsics/Vector512.cs | 12 +++++++++++- 3 files changed, 33 insertions(+), 3 deletions(-) diff --git a/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Vector128.cs b/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Vector128.cs index c5785bcdf9b804..28810437e844ca 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Vector128.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Vector128.cs @@ -1344,7 +1344,17 @@ public static Vector128 CreateScalarUnsafe(T value) /// The dot product of and . /// The type of and () is not supported. [Intrinsic] - public static T Dot(Vector128 left, Vector128 right) => Sum(left * right); + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static T Dot(Vector128 left, Vector128 right) + { + // Doing this as Dot(lower) + Dot(upper) is important for floating-point determinism + // This is because the underlying dpps instruction on x86/x64 will do this equivalently + // and otherwise the software vs accelerated implementations may differ in returned result. + + T result = Vector64.Dot(left._lower, right._lower); + result = Scalar.Add(result, Vector64.Dot(left._upper, right._upper)); + return result; + } /// Compares two vectors to determine if they are equal on a per-element basis. /// The type of the elements in the vector. diff --git a/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Vector256.cs b/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Vector256.cs index 50a0f07a205230..5d04c413106722 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Vector256.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Vector256.cs @@ -1330,7 +1330,17 @@ public static Vector256 CreateScalarUnsafe(T value) /// The dot product of and . /// The type of and () is not supported. [Intrinsic] - public static T Dot(Vector256 left, Vector256 right) => Sum(left * right); + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static T Dot(Vector256 left, Vector256 right) + { + // Doing this as Dot(lower) + Dot(upper) is important for floating-point determinism + // This is because the underlying dpps instruction on x86/x64 will do this equivalently + // and otherwise the software vs accelerated implementations may differ in returned result. + + T result = Vector128.Dot(left._lower, right._lower); + result = Scalar.Add(result, Vector128.Dot(left._upper, right._upper)); + return result; + } /// Compares two vectors to determine if they are equal on a per-element basis. /// The type of the elements in the vector. diff --git a/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Vector512.cs b/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Vector512.cs index 6245ed58ef2eb6..39e47372577c74 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Vector512.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Vector512.cs @@ -1391,7 +1391,17 @@ public static Vector512 Divide(Vector512 left, Vector512 right) /// The dot product of and . /// The type of and () is not supported. [Intrinsic] - public static T Dot(Vector512 left, Vector512 right) => Sum(left * right); + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static T Dot(Vector512 left, Vector512 right) + { + // Doing this as Dot(lower) + Dot(upper) is important for floating-point determinism + // This is because the underlying dpps instruction on x86/x64 will do this equivalently + // and otherwise the software vs accelerated implementations may differ in returned result. + + T result = Vector256.Dot(left._lower, right._lower); + result = Scalar.Add(result, Vector256.Dot(left._upper, right._upper)); + return result; + } /// Compares two vectors to determine if they are equal on a per-element basis. /// The type of the elements in the vector. From 3eae1a6458c10e6a58b1aa8d72f775c971522592 Mon Sep 17 00:00:00 2001 From: Tanner Gooding Date: Mon, 3 Jun 2024 12:17:19 -0700 Subject: [PATCH 7/9] Fixing the handling of Vector512.CreateScalar --- src/coreclr/jit/lowerxarch.cpp | 26 ++++++++++++++++++-------- 1 file changed, 18 insertions(+), 8 deletions(-) diff --git a/src/coreclr/jit/lowerxarch.cpp b/src/coreclr/jit/lowerxarch.cpp index 22526033478ca0..2599c7a8b4d84c 100644 --- a/src/coreclr/jit/lowerxarch.cpp +++ b/src/coreclr/jit/lowerxarch.cpp @@ -3551,24 +3551,34 @@ GenTree* Lowering::LowerHWIntrinsicCreate(GenTreeHWIntrinsic* node) } } - if (simdSize == 32) + if (simdSize > 16) { - // We're creating a Vector256 scalar so we need to treat the original op as Vector128, - // we need to unsafely extend up to Vector256 (which is actually safe since the 128-bit - // op will zero extend up to 256-bits), and then we need to replace the original use - // with the new TYP_SIMD32 node. + assert((simdSize == 32) || (simdSize == 64)); + + // We're creating a Vector256/512 scalar so we need to treat the original op as Vector128, + // we need to unsafely extend up to Vector256/512 (which is actually safe since the 128-bit + // op will zero extend up to 256/512-bits), and then we need to replace the original use + // with the new TYP_SIMD32/64 node. node->ChangeType(TYP_SIMD16); node->SetSimdSize(16); LowerNode(node); - tmp2 = comp->gtNewSimdHWIntrinsicNode(TYP_SIMD32, node, NI_Vector128_ToVector256Unsafe, simdBaseJitType, - 16); - LIR::Use use; bool foundUse = BlockRange().TryGetUse(node, &use); + + tmp2 = comp->gtNewSimdHWIntrinsicNode(TYP_SIMD32, node, NI_Vector128_ToVector256Unsafe, simdBaseJitType, + 16); BlockRange().InsertAfter(node, tmp2); + if (simdSize == 64) + { + tmp3 = comp->gtNewSimdHWIntrinsicNode(TYP_SIMD64, tmp2, NI_Vector256_ToVector512Unsafe, + simdBaseJitType, 32); + BlockRange().InsertAfter(tmp2, tmp3); + tmp2 = tmp3; + } + if (foundUse) { use.ReplaceWith(tmp2); From 6c6d71ee896e67e7f657c099914b1a5c96ef8e01 Mon Sep 17 00:00:00 2001 From: Tanner Gooding Date: Mon, 3 Jun 2024 12:40:34 -0700 Subject: [PATCH 8/9] Continue tracking the System.Numerics and System.Runtime.Intrinsics APIs as intrinsic for the profitability boost --- src/coreclr/jit/importercalls.cpp | 19 +++++ src/coreclr/jit/namedintrinsiclist.h | 4 + .../src/System/Numerics/Plane.cs | 6 ++ .../System/Numerics/Quaternion.Extensions.cs | 2 + .../src/System/Numerics/Quaternion.cs | 31 +++++++- .../src/System/Numerics/Vector.cs | 55 ++++++++++++++ .../src/System/Numerics/Vector2.cs | 39 +++++++++- .../src/System/Numerics/Vector3.cs | 44 +++++++++-- .../src/System/Numerics/Vector4.Extensions.cs | 4 + .../src/System/Numerics/Vector4.cs | 73 +++++++++++++++++-- .../src/System/Numerics/Vector_1.cs | 21 +++++- .../System/Runtime/Intrinsics/Vector128.cs | 58 +++++++++++++++ .../System/Runtime/Intrinsics/Vector128_1.cs | 2 + .../System/Runtime/Intrinsics/Vector256.cs | 56 ++++++++++++++ .../System/Runtime/Intrinsics/Vector256_1.cs | 2 + .../System/Runtime/Intrinsics/Vector512.cs | 56 ++++++++++++++ .../System/Runtime/Intrinsics/Vector512_1.cs | 2 + .../src/System/Runtime/Intrinsics/Vector64.cs | 56 ++++++++++++++ .../System/Runtime/Intrinsics/Vector64_1.cs | 2 + 19 files changed, 514 insertions(+), 18 deletions(-) diff --git a/src/coreclr/jit/importercalls.cpp b/src/coreclr/jit/importercalls.cpp index 1f33585a720338..9da10b439415d9 100644 --- a/src/coreclr/jit/importercalls.cpp +++ b/src/coreclr/jit/importercalls.cpp @@ -3089,6 +3089,13 @@ GenTree* Compiler::impIntrinsic(GenTree* newobjThis, } #endif // FEATURE_HW_INTRINSICS + if ((ni == NI_System_Numerics_Intrinsic) || (ni == NI_System_Runtime_Intrinsics_Intrinsic)) + { + // These are special markers used just to ensure we still get the inlining profitability + // boost. We actually have the implementation in managed, however, to keep the JIT simpler. + return nullptr; + } + if (!isIntrinsic) { // Outside the cases above, there are many intrinsics which apply to only a @@ -10080,6 +10087,12 @@ NamedIntrinsic Compiler::lookupNamedIntrinsic(CORINFO_METHOD_HANDLE method) result = NI_Throw_PlatformNotSupportedException; } + else + { + // Otherwise mark this as a general intrinsic in the namespace + // so we can still get the inlining profitability boost. + result = NI_System_Runtime_Intrinsics_Intrinsic; + } } } } @@ -10304,6 +10317,12 @@ NamedIntrinsic Compiler::lookupNamedIntrinsic(CORINFO_METHOD_HANDLE method) result = NI_Throw_PlatformNotSupportedException; } + else + { + // Otherwise mark this as a general intrinsic in the namespace + // so we can still get the inlining profitability boost. + result = NI_System_Numerics_Intrinsic; + } } } } diff --git a/src/coreclr/jit/namedintrinsiclist.h b/src/coreclr/jit/namedintrinsiclist.h index de20de7bfbe5bd..f3a7b84a21f68c 100644 --- a/src/coreclr/jit/namedintrinsiclist.h +++ b/src/coreclr/jit/namedintrinsiclist.h @@ -140,6 +140,10 @@ enum NamedIntrinsic : unsigned short NI_System_Threading_Interlocked_MemoryBarrier, NI_System_Threading_Interlocked_ReadMemoryBarrier, + // These two are special marker IDs so that we still get the inlining profitability boost + NI_System_Numerics_Intrinsic, + NI_System_Runtime_Intrinsics_Intrinsic, + #ifdef FEATURE_HW_INTRINSICS NI_HW_INTRINSIC_START, #if defined(TARGET_XARCH) diff --git a/src/libraries/System.Private.CoreLib/src/System/Numerics/Plane.cs b/src/libraries/System.Private.CoreLib/src/System/Numerics/Plane.cs index 5df3be211aa2f4..09d19a137f9173 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Numerics/Plane.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Numerics/Plane.cs @@ -27,6 +27,7 @@ public struct Plane : IEquatable /// The Y component of the normal. /// The Z component of the normal. /// The distance of the plane along its normal from the origin. + [Intrinsic] public Plane(float x, float y, float z, float d) { this = Vector128.Create(x, y, z, d).AsPlane(); @@ -35,6 +36,7 @@ public Plane(float x, float y, float z, float d) /// Creates a object from a specified normal and the distance along the normal from the origin. /// The plane's normal vector. /// The plane's distance from the origin along its normal vector. + [Intrinsic] public Plane(Vector3 normal, float d) { this = new Vector4(normal, d).AsPlane(); @@ -42,6 +44,7 @@ public Plane(Vector3 normal, float d) /// Creates a object from a specified four-dimensional vector. /// A vector whose first three elements describe the normal vector, and whose defines the distance along that normal from the origin. + [Intrinsic] public Plane(Vector4 value) { this = value.AsPlane(); @@ -103,6 +106,7 @@ public static Plane CreateFromVertices(Vector3 point1, Vector3 point2, Vector3 p /// The plane. /// The four-dimensional vector. /// The dot product. + [Intrinsic] [MethodImpl(MethodImplOptions.AggressiveInlining)] public static float Dot(Plane plane, Vector4 value) => Vector128.Dot(plane.AsVector128(), value.AsVector128()); @@ -204,6 +208,7 @@ public static Plane Transform(Plane plane, Quaternion rotation) /// if and are equal; otherwise, . /// Two objects are equal if their and fields are equal. /// The method defines the operation of the equality operator for objects. + [Intrinsic] [MethodImpl(MethodImplOptions.AggressiveInlining)] public static bool operator ==(Plane value1, Plane value2) => value1.AsVector128() == value2.AsVector128(); @@ -212,6 +217,7 @@ public static Plane Transform(Plane plane, Quaternion rotation) /// The second plane to compare. /// if and are not equal; otherwise, . /// The method defines the operation of the inequality operator for objects. + [Intrinsic] public static bool operator !=(Plane value1, Plane value2) => !(value1 == value2); /// Returns a value that indicates whether this instance and a specified object are equal. diff --git a/src/libraries/System.Private.CoreLib/src/System/Numerics/Quaternion.Extensions.cs b/src/libraries/System.Private.CoreLib/src/System/Numerics/Quaternion.Extensions.cs index 8c9f6cb0c99368..42ac2e3d0dfc3d 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Numerics/Quaternion.Extensions.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Numerics/Quaternion.Extensions.cs @@ -14,6 +14,7 @@ public static unsafe partial class Vector /// The index of the element to get. /// The value of the element at . /// was less than zero or greater than the number of elements. + [Intrinsic] [MethodImpl(MethodImplOptions.AggressiveInlining)] internal static float GetElement(this Quaternion quaternion, int index) { @@ -26,6 +27,7 @@ internal static float GetElement(this Quaternion quaternion, int index) /// The value to set the element to. /// A with the value of the element at set to and the remaining elements set to the same value as that in . /// was less than zero or greater than the number of elements. + [Intrinsic] internal static Quaternion WithElement(this Quaternion quaternion, int index, float value) { return quaternion.AsVector128().WithElement(index, value).AsQuaternion(); diff --git a/src/libraries/System.Private.CoreLib/src/System/Numerics/Quaternion.cs b/src/libraries/System.Private.CoreLib/src/System/Numerics/Quaternion.cs index c575c800db18ff..4ec7f536ed43f3 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Numerics/Quaternion.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Numerics/Quaternion.cs @@ -35,6 +35,7 @@ public struct Quaternion : IEquatable /// The value to assign to the Y component of the quaternion. /// The value to assign to the Z component of the quaternion. /// The value to assign to the W component of the quaternion. + [Intrinsic] public Quaternion(float x, float y, float z, float w) { this = Vector128.Create(x, y, z, w).AsQuaternion(); @@ -43,6 +44,7 @@ public Quaternion(float x, float y, float z, float w) /// Creates a quaternion from the specified vector and rotation parts. /// The vector part of the quaternion. /// The rotation part of the quaternion. + [Intrinsic] public Quaternion(Vector3 vectorPart, float scalarPart) { this = new Vector4(vectorPart, scalarPart).AsQuaternion(); @@ -50,11 +52,19 @@ public Quaternion(Vector3 vectorPart, float scalarPart) /// Gets a quaternion that represents a zero. /// A quaternion whose values are (0, 0, 0, 0). - public static Quaternion Zero => default; + public static Quaternion Zero + { + [Intrinsic] + get => default; + } /// Gets a quaternion that represents no rotation. /// A quaternion whose values are (0, 0, 0, 1). - public static Quaternion Identity => new Quaternion(0.0f, 0.0f, 0.0f, 1.0f); + public static Quaternion Identity + { + [Intrinsic] + get => new Quaternion(0.0f, 0.0f, 0.0f, 1.0f); + } /// Gets or sets the element at the specified index. /// The index of the element to get or set. @@ -62,6 +72,7 @@ public Quaternion(Vector3 vectorPart, float scalarPart) /// was less than zero or greater than the number of elements. public float this[int index] { + [Intrinsic] readonly get => this.GetElement(index); set => this = this.WithElement(index, value); @@ -77,6 +88,7 @@ public float this[int index] /// The second quaternion. /// The quaternion that contains the summed values of and . /// The method defines the operation of the addition operator for objects. + [Intrinsic] [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Quaternion operator +(Quaternion value1, Quaternion value2) => (value1.AsVector128() + value2.AsVector128()).AsQuaternion(); @@ -129,6 +141,7 @@ public float this[int index] /// if the two quaternions are equal; otherwise, . /// Two quaternions are equal if each of their corresponding components is equal. /// The method defines the operation of the equality operator for objects. + [Intrinsic] [MethodImpl(MethodImplOptions.AggressiveInlining)] public static bool operator ==(Quaternion value1, Quaternion value2) => value1.AsVector128() == value2.AsVector128(); @@ -136,6 +149,7 @@ public float this[int index] /// The first quaternion to compare. /// The second quaternion to compare. /// if and are not equal; otherwise, . + [Intrinsic] public static bool operator !=(Quaternion value1, Quaternion value2) => !(value1 == value2); /// Returns the quaternion that results from multiplying two quaternions together. @@ -191,6 +205,7 @@ public float this[int index] /// The scalar value. /// The scaled quaternion. /// The method defines the operation of the multiplication operator for objects. + [Intrinsic] [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Quaternion operator *(Quaternion value1, float value2) => (value1.AsVector128() * value2).AsQuaternion(); @@ -199,6 +214,7 @@ public float this[int index] /// The second quaternion. /// The quaternion containing the values that result from subtracting each element in from its corresponding element in . /// The method defines the operation of the subtraction operator for objects. + [Intrinsic] [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Quaternion operator -(Quaternion value1, Quaternion value2) => (value1.AsVector128() - value2.AsVector128()).AsQuaternion(); @@ -206,6 +222,7 @@ public float this[int index] /// The quaternion to negate. /// The negated quaternion. /// The method defines the operation of the unary negation operator for objects. + [Intrinsic] [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Quaternion operator -(Quaternion value) => (-value.AsVector128()).AsQuaternion(); @@ -213,6 +230,7 @@ public float this[int index] /// The first quaternion. /// The second quaternion. /// The quaternion that contains the summed values of and . + [Intrinsic] public static Quaternion Add(Quaternion value1, Quaternion value2) => value1 + value2; /// Concatenates two quaternions. @@ -253,6 +271,7 @@ public static Quaternion Concatenate(Quaternion value1, Quaternion value2) /// Returns the conjugate of a specified quaternion. /// The quaternion. /// A new quaternion that is the conjugate of . + [Intrinsic] [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Quaternion Conjugate(Quaternion value) => (value.AsVector128() * Vector128.Create(-1.0f, -1.0f, -1.0f, 1.0f)).AsQuaternion(); @@ -372,12 +391,14 @@ public static Quaternion CreateFromYawPitchRoll(float yaw, float pitch, float ro /// The first quaternion. /// The second quaternion. /// The dot product. + [Intrinsic] [MethodImpl(MethodImplOptions.AggressiveInlining)] public static float Dot(Quaternion quaternion1, Quaternion quaternion2) => Vector128.Dot(quaternion1.AsVector128(), quaternion2.AsVector128()); /// Returns the inverse of a quaternion. /// The quaternion. /// The inverted quaternion. + [Intrinsic] [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Quaternion Inverse(Quaternion value) { @@ -440,16 +461,19 @@ public static Quaternion Lerp(Quaternion quaternion1, Quaternion quaternion2, fl /// The source quaternion. /// The scalar value. /// The scaled quaternion. + [Intrinsic] public static Quaternion Multiply(Quaternion value1, float value2) => value1 * value2; /// Reverses the sign of each component of the quaternion. /// The quaternion to negate. /// The negated quaternion. + [Intrinsic] public static Quaternion Negate(Quaternion value) => -value; /// Divides each component of a specified by its length. /// The quaternion to normalize. /// The normalized quaternion. + [Intrinsic] [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Quaternion Normalize(Quaternion value) => (value.AsVector128() / value.Length()).AsQuaternion(); @@ -506,6 +530,7 @@ public static Quaternion Slerp(Quaternion quaternion1, Quaternion quaternion2, f /// The first quaternion. /// The second quaternion. /// The quaternion containing the values that result from subtracting each element in from its corresponding element in . + [Intrinsic] public static Quaternion Subtract(Quaternion value1, Quaternion value2) => value1 - value2; /// Returns a value that indicates whether this instance and a specified object are equal. @@ -527,10 +552,12 @@ public static Quaternion Slerp(Quaternion quaternion1, Quaternion quaternion2, f /// Calculates the length of the quaternion. /// The computed length of the quaternion. + [Intrinsic] public readonly float Length() => MathF.Sqrt(LengthSquared()); /// Calculates the squared length of the quaternion. /// The length squared of the quaternion. + [Intrinsic] public readonly float LengthSquared() => Dot(this, this); /// Returns a string that represents this quaternion. diff --git a/src/libraries/System.Private.CoreLib/src/System/Numerics/Vector.cs b/src/libraries/System.Private.CoreLib/src/System/Numerics/Vector.cs index 11129addf154a7..c49154e717246a 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Numerics/Vector.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Numerics/Vector.cs @@ -59,6 +59,7 @@ public static Vector Abs(Vector value) /// The vector to add with . /// The type of the elements in the vector. /// The sum of and . + [Intrinsic] public static Vector Add(Vector left, Vector right) => left + right; /// Computes the bitwise-and of a given vector and the ones complement of another vector. @@ -75,6 +76,7 @@ public static Vector Abs(Vector value) /// The vector to reinterpret. /// reinterpreted as a new . /// The type of () or the type of the target () is not supported. + [Intrinsic] [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector As(this Vector vector) { @@ -89,6 +91,7 @@ public static Vector As(this Vector vector) /// The vector to reinterpret. /// reinterpreted as a new . /// The type of () is not supported. + [Intrinsic] public static Vector AsVectorByte(Vector value) => value.As(); /// Reinterprets a as a new . @@ -96,6 +99,7 @@ public static Vector As(this Vector vector) /// The vector to reinterpret. /// reinterpreted as a new . /// The type of () is not supported. + [Intrinsic] public static Vector AsVectorDouble(Vector value) => value.As(); /// Reinterprets a as a new . @@ -103,6 +107,7 @@ public static Vector As(this Vector vector) /// The vector to reinterpret. /// reinterpreted as a new . /// The type of () is not supported. + [Intrinsic] public static Vector AsVectorInt16(Vector value) => value.As(); /// Reinterprets a as a new . @@ -110,6 +115,7 @@ public static Vector As(this Vector vector) /// The vector to reinterpret. /// reinterpreted as a new . /// The type of () is not supported. + [Intrinsic] public static Vector AsVectorInt32(Vector value) => value.As(); /// Reinterprets a as a new . @@ -117,6 +123,7 @@ public static Vector As(this Vector vector) /// The vector to reinterpret. /// reinterpreted as a new . /// The type of () is not supported. + [Intrinsic] public static Vector AsVectorInt64(Vector value) => value.As(); /// Reinterprets a as a new . @@ -124,6 +131,7 @@ public static Vector As(this Vector vector) /// The vector to reinterpret. /// reinterpreted as a new . /// The type of () is not supported. + [Intrinsic] public static Vector AsVectorNInt(Vector value) => value.As(); /// Reinterprets a as a new . @@ -131,6 +139,7 @@ public static Vector As(this Vector vector) /// The vector to reinterpret. /// reinterpreted as a new . /// The type of () is not supported. + [Intrinsic] [CLSCompliant(false)] public static Vector AsVectorNUInt(Vector value) => value.As(); @@ -139,6 +148,7 @@ public static Vector As(this Vector vector) /// The vector to reinterpret. /// reinterpreted as a new . /// The type of () is not supported. + [Intrinsic] [CLSCompliant(false)] public static Vector AsVectorSByte(Vector value) => value.As(); @@ -147,6 +157,7 @@ public static Vector As(this Vector vector) /// The vector to reinterpret. /// reinterpreted as a new . /// The type of () is not supported. + [Intrinsic] public static Vector AsVectorSingle(Vector value) => value.As(); /// Reinterprets a as a new . @@ -154,6 +165,7 @@ public static Vector As(this Vector vector) /// The vector to reinterpret. /// reinterpreted as a new . /// The type of () is not supported. + [Intrinsic] [CLSCompliant(false)] public static Vector AsVectorUInt16(Vector value) => value.As(); @@ -162,6 +174,7 @@ public static Vector As(this Vector vector) /// The vector to reinterpret. /// reinterpreted as a new . /// The type of () is not supported. + [Intrinsic] [CLSCompliant(false)] public static Vector AsVectorUInt32(Vector value) => value.As(); @@ -170,6 +183,7 @@ public static Vector As(this Vector vector) /// The vector to reinterpret. /// reinterpreted as a new . /// The type of () is not supported. + [Intrinsic] [CLSCompliant(false)] public static Vector AsVectorUInt64(Vector value) => value.As(); @@ -178,6 +192,7 @@ public static Vector As(this Vector vector) /// The vector to bitwise-and with . /// The type of the elements in the vector. /// The bitwise-and of and . + [Intrinsic] public static Vector BitwiseAnd(Vector left, Vector right) => left & right; /// Computes the bitwise-or of two vectors. @@ -185,6 +200,7 @@ public static Vector As(this Vector vector) /// The vector to bitwise-or with . /// The type of the elements in the vector. /// The bitwise-or of and . + [Intrinsic] public static Vector BitwiseOr(Vector left, Vector right) => left | right; /// Computes the ceiling of each element in a vector. @@ -481,6 +497,7 @@ public static Vector ConvertToUInt64Native(Vector value) /// The vector that will divide . /// The type of the elements in the vector. /// The quotient of divided by . + [Intrinsic] public static Vector Divide(Vector left, Vector right) => left / right; /// Divides a vector by a scalar to compute the per-element quotient. @@ -488,6 +505,7 @@ public static Vector ConvertToUInt64Native(Vector value) /// The scalar that will divide . /// The type of the elements in the vector. /// The quotient of divided by . + [Intrinsic] public static Vector Divide(Vector left, T right) => left / right; /// Computes the dot product of two vectors. @@ -495,6 +513,7 @@ public static Vector ConvertToUInt64Native(Vector value) /// The vector that will be dotted with . /// The type of the elements in the vector. /// The dot product of and . + [Intrinsic] public static T Dot(Vector left, Vector right) => Sum(left * right); /// Compares two vectors to determine if they are equal on a per-element basis. @@ -550,6 +569,7 @@ public static Vector Equals(Vector left, Vector right) /// The vector to compare with . /// The type of the elements in the vector. /// true if all elements in were equal to the corresponding element in . + [Intrinsic] public static bool EqualsAll(Vector left, Vector right) => left == right; /// Compares two vectors to determine if any elements are equal. @@ -715,6 +735,7 @@ public static Vector GreaterThan(Vector left, Vector right) /// The vector to compare with . /// The vector to compare with . /// A vector whose elements are all-bits-set or zero, depending on if which of the corresponding elements in and were greater. + [Intrinsic] public static Vector GreaterThan(Vector left, Vector right) => GreaterThan(left, right); /// Compares two vectors to determine which is greater on a per-element basis. @@ -1034,6 +1055,7 @@ public static bool LessThanOrEqualAny(Vector left, Vector right) /// The source from which the vector will be loaded. /// The vector loaded from . /// The type of () is not supported. + [Intrinsic] [CLSCompliant(false)] public static Vector Load(T* source) => LoadUnsafe(ref *source); @@ -1143,6 +1165,7 @@ public static Vector Min(Vector left, Vector right) /// The vector to multiply with . /// The type of the elements in the vector. /// The element-wise product of and . + [Intrinsic] public static Vector Multiply(Vector left, Vector right) => left * right; /// Multiplies a vector by a scalar to compute their product. @@ -1150,6 +1173,7 @@ public static Vector Min(Vector left, Vector right) /// The scalar to multiply with . /// The type of the elements in the vector. /// The product of and . + [Intrinsic] public static Vector Multiply(Vector left, T right) => left * right; /// Multiplies a vector by a scalar to compute their product. @@ -1157,6 +1181,7 @@ public static Vector Min(Vector left, Vector right) /// The vector to multiply with . /// The type of the elements in the vector. /// The product of and . + [Intrinsic] public static Vector Multiply(T left, Vector right) => left * right; /// @@ -1374,48 +1399,56 @@ public static Vector Narrow(Vector low, Vector high) /// The vector to negate. /// The type of the elements in the vector. /// A vector whose elements are the unary negation of the corresponding elements in . + [Intrinsic] public static Vector Negate(Vector value) => -value; /// Computes the ones-complement of a vector. /// The vector whose ones-complement is to be computed. /// The type of the elements in the vector. /// A vector whose elements are the ones-complement of the corresponding elements in . + [Intrinsic] public static Vector OnesComplement(Vector value) => ~value; /// Shifts each element of a vector left by the specified amount. /// The vector whose elements are to be shifted. /// The number of bits by which to shift each element. /// A vector whose elements where shifted left by . + [Intrinsic] public static Vector ShiftLeft(Vector value, int shiftCount) => value << shiftCount; /// Shifts each element of a vector left by the specified amount. /// The vector whose elements are to be shifted. /// The number of bits by which to shift each element. /// A vector whose elements where shifted left by . + [Intrinsic] public static Vector ShiftLeft(Vector value, int shiftCount) => value << shiftCount; /// Shifts each element of a vector left by the specified amount. /// The vector whose elements are to be shifted. /// The number of bits by which to shift each element. /// A vector whose elements where shifted left by . + [Intrinsic] public static Vector ShiftLeft(Vector value, int shiftCount) => value << shiftCount; /// Shifts each element of a vector left by the specified amount. /// The vector whose elements are to be shifted. /// The number of bits by which to shift each element. /// A vector whose elements where shifted left by . + [Intrinsic] public static Vector ShiftLeft(Vector value, int shiftCount) => value << shiftCount; /// Shifts each element of a vector left by the specified amount. /// The vector whose elements are to be shifted. /// The number of bits by which to shift each element. /// A vector whose elements where shifted left by . + [Intrinsic] public static Vector ShiftLeft(Vector value, int shiftCount) => value << shiftCount; /// Shifts each element of a vector left by the specified amount. /// The vector whose elements are to be shifted. /// The number of bits by which to shift each element. /// A vector whose elements where shifted left by . + [Intrinsic] [CLSCompliant(false)] public static Vector ShiftLeft(Vector value, int shiftCount) => value << shiftCount; @@ -1423,6 +1456,7 @@ public static Vector Narrow(Vector low, Vector high) /// The vector whose elements are to be shifted. /// The number of bits by which to shift each element. /// A vector whose elements where shifted left by . + [Intrinsic] [CLSCompliant(false)] public static Vector ShiftLeft(Vector value, int shiftCount) => value << shiftCount; @@ -1430,6 +1464,7 @@ public static Vector Narrow(Vector low, Vector high) /// The vector whose elements are to be shifted. /// The number of bits by which to shift each element. /// A vector whose elements where shifted left by . + [Intrinsic] [CLSCompliant(false)] public static Vector ShiftLeft(Vector value, int shiftCount) => value << shiftCount; @@ -1437,6 +1472,7 @@ public static Vector Narrow(Vector low, Vector high) /// The vector whose elements are to be shifted. /// The number of bits by which to shift each element. /// A vector whose elements where shifted left by . + [Intrinsic] [CLSCompliant(false)] public static Vector ShiftLeft(Vector value, int shiftCount) => value << shiftCount; @@ -1444,6 +1480,7 @@ public static Vector Narrow(Vector low, Vector high) /// The vector whose elements are to be shifted. /// The number of bits by which to shift each element. /// A vector whose elements where shifted left by . + [Intrinsic] [CLSCompliant(false)] public static Vector ShiftLeft(Vector value, int shiftCount) => value << shiftCount; @@ -1451,30 +1488,35 @@ public static Vector Narrow(Vector low, Vector high) /// The vector whose elements are to be shifted. /// The number of bits by which to shift each element. /// A vector whose elements where shifted right by . + [Intrinsic] public static Vector ShiftRightArithmetic(Vector value, int shiftCount) => value >> shiftCount; /// Shifts (signed) each element of a vector right by the specified amount. /// The vector whose elements are to be shifted. /// The number of bits by which to shift each element. /// A vector whose elements where shifted right by . + [Intrinsic] public static Vector ShiftRightArithmetic(Vector value, int shiftCount) => value >> shiftCount; /// Shifts (signed) each element of a vector right by the specified amount. /// The vector whose elements are to be shifted. /// The number of bits by which to shift each element. /// A vector whose elements where shifted right by . + [Intrinsic] public static Vector ShiftRightArithmetic(Vector value, int shiftCount) => value >> shiftCount; /// Shifts (signed) each element of a vector right by the specified amount. /// The vector whose elements are to be shifted. /// The number of bits by which to shift each element. /// A vector whose elements where shifted right by . + [Intrinsic] public static Vector ShiftRightArithmetic(Vector value, int shiftCount) => value >> shiftCount; /// Shifts (signed) each element of a vector right by the specified amount. /// The vector whose elements are to be shifted. /// The number of bits by which to shift each element. /// A vector whose elements where shifted right by . + [Intrinsic] [CLSCompliant(false)] public static Vector ShiftRightArithmetic(Vector value, int shiftCount) => value >> shiftCount; @@ -1482,36 +1524,42 @@ public static Vector Narrow(Vector low, Vector high) /// The vector whose elements are to be shifted. /// The number of bits by which to shift each element. /// A vector whose elements where shifted right by . + [Intrinsic] public static Vector ShiftRightLogical(Vector value, int shiftCount) => value >>> shiftCount; /// Shifts (unsigned) each element of a vector right by the specified amount. /// The vector whose elements are to be shifted. /// The number of bits by which to shift each element. /// A vector whose elements where shifted right by . + [Intrinsic] public static Vector ShiftRightLogical(Vector value, int shiftCount) => value >>> shiftCount; /// Shifts (unsigned) each element of a vector right by the specified amount. /// The vector whose elements are to be shifted. /// The number of bits by which to shift each element. /// A vector whose elements where shifted right by . + [Intrinsic] public static Vector ShiftRightLogical(Vector value, int shiftCount) => value >>> shiftCount; /// Shifts (unsigned) each element of a vector right by the specified amount. /// The vector whose elements are to be shifted. /// The number of bits by which to shift each element. /// A vector whose elements where shifted right by . + [Intrinsic] public static Vector ShiftRightLogical(Vector value, int shiftCount) => value >>> shiftCount; /// Shifts (unsigned) each element of a vector right by the specified amount. /// The vector whose elements are to be shifted. /// The number of bits by which to shift each element. /// A vector whose elements where shifted right by . + [Intrinsic] public static Vector ShiftRightLogical(Vector value, int shiftCount) => value >>> shiftCount; /// Shifts (unsigned) each element of a vector right by the specified amount. /// The vector whose elements are to be shifted. /// The number of bits by which to shift each element. /// A vector whose elements where shifted right by . + [Intrinsic] [CLSCompliant(false)] public static Vector ShiftRightLogical(Vector value, int shiftCount) => value >>> shiftCount; @@ -1519,6 +1567,7 @@ public static Vector Narrow(Vector low, Vector high) /// The vector whose elements are to be shifted. /// The number of bits by which to shift each element. /// A vector whose elements where shifted right by . + [Intrinsic] [CLSCompliant(false)] public static Vector ShiftRightLogical(Vector value, int shiftCount) => value >>> shiftCount; @@ -1526,6 +1575,7 @@ public static Vector Narrow(Vector low, Vector high) /// The vector whose elements are to be shifted. /// The number of bits by which to shift each element. /// A vector whose elements where shifted right by . + [Intrinsic] [CLSCompliant(false)] public static Vector ShiftRightLogical(Vector value, int shiftCount) => value >>> shiftCount; @@ -1533,6 +1583,7 @@ public static Vector Narrow(Vector low, Vector high) /// The vector whose elements are to be shifted. /// The number of bits by which to shift each element. /// A vector whose elements where shifted right by . + [Intrinsic] [CLSCompliant(false)] public static Vector ShiftRightLogical(Vector value, int shiftCount) => value >>> shiftCount; @@ -1540,6 +1591,7 @@ public static Vector Narrow(Vector low, Vector high) /// The vector whose elements are to be shifted. /// The number of bits by which to shift each element. /// A vector whose elements where shifted right by . + [Intrinsic] [CLSCompliant(false)] public static Vector ShiftRightLogical(Vector value, int shiftCount) => value >>> shiftCount; @@ -1568,6 +1620,7 @@ public static Vector SquareRoot(Vector value) /// The vector that will be stored. /// The destination at which will be stored. /// The type of () is not supported. + [Intrinsic] [CLSCompliant(false)] public static void Store(this Vector source, T* destination) => source.StoreUnsafe(ref *destination); @@ -1637,6 +1690,7 @@ public static void StoreUnsafe(this Vector source, ref T destination, nuin /// The vector to subtract from . /// The type of the elements in the vector. /// The difference of and . + [Intrinsic] public static Vector Subtract(Vector left, Vector right) => left - right; /// @@ -2035,6 +2089,7 @@ public static Vector WithElement(this Vector vector, int index, T value /// The vector to exclusive-or with . /// The type of the elements in the vector. /// The exclusive-or of and . + [Intrinsic] public static Vector Xor(Vector left, Vector right) => left ^ right; [MethodImpl(MethodImplOptions.AggressiveInlining)] diff --git a/src/libraries/System.Private.CoreLib/src/System/Numerics/Vector2.cs b/src/libraries/System.Private.CoreLib/src/System/Numerics/Vector2.cs index dc66855899d0a5..931cbf5eca86bd 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Numerics/Vector2.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Numerics/Vector2.cs @@ -56,19 +56,35 @@ public Vector2(ReadOnlySpan values) /// Returns a vector whose 2 elements are equal to zero. /// A vector whose two elements are equal to zero (that is, it returns the vector (0,0). - public static Vector2 Zero => default; + public static Vector2 Zero + { + [Intrinsic] + get => default; + } /// Gets a vector whose 2 elements are equal to one. /// A vector whose two elements are equal to one (that is, it returns the vector (1,1). - public static Vector2 One => new Vector2(1.0f); + public static Vector2 One + { + [Intrinsic] + get => new Vector2(1.0f); + } /// Gets the vector (1,0). /// The vector (1,0). - public static Vector2 UnitX => new Vector2(1.0f, 0.0f); + public static Vector2 UnitX + { + [Intrinsic] + get => new Vector2(1.0f, 0.0f); + } /// Gets the vector (0,1). /// The vector (0,1). - public static Vector2 UnitY => new Vector2(0.0f, 1.0f); + public static Vector2 UnitY + { + [Intrinsic] + get => new Vector2(0.0f, 1.0f); + } /// Gets or sets the element at the specified index. /// The index of the element to get or set. @@ -76,6 +92,7 @@ public Vector2(ReadOnlySpan values) /// was less than zero or greater than the number of elements. public float this[int index] { + [Intrinsic] readonly get => this.GetElement(index); set => this = this.WithElement(index, value); @@ -209,6 +226,7 @@ public static Vector2 Abs(Vector2 value) /// The first vector to add. /// The second vector to add. /// The summed vector. + [Intrinsic] public static Vector2 Add(Vector2 left, Vector2 right) => left + right; /// Restricts a vector between a minimum and a maximum value. @@ -216,6 +234,7 @@ public static Vector2 Abs(Vector2 value) /// The minimum value. /// The maximum value. /// The restricted vector. + [Intrinsic] public static Vector2 Clamp(Vector2 value1, Vector2 min, Vector2 max) { // We must follow HLSL behavior in the case user specified min value is bigger than max value. @@ -226,24 +245,28 @@ public static Vector2 Clamp(Vector2 value1, Vector2 min, Vector2 max) /// The first point. /// The second point. /// The distance. + [Intrinsic] public static float Distance(Vector2 value1, Vector2 value2) => MathF.Sqrt(DistanceSquared(value1, value2)); /// Returns the Euclidean distance squared between two specified points. /// The first point. /// The second point. /// The distance squared. + [Intrinsic] public static float DistanceSquared(Vector2 value1, Vector2 value2) => (value1 - value2).LengthSquared(); /// Divides the first vector by the second. /// The first vector. /// The second vector. /// The vector resulting from the division. + [Intrinsic] public static Vector2 Divide(Vector2 left, Vector2 right) => left / right; /// Divides the specified vector by a specified scalar value. /// The vector. /// The scalar value. /// The vector that results from the division. + [Intrinsic] public static Vector2 Divide(Vector2 left, float divisor) => left / divisor; /// Returns the dot product of two vectors. @@ -313,18 +336,21 @@ public static Vector2 Min(Vector2 value1, Vector2 value2) /// The first vector. /// The second vector. /// The element-wise product vector. + [Intrinsic] public static Vector2 Multiply(Vector2 left, Vector2 right) => left * right; /// Multiplies a vector by a specified scalar. /// The vector to multiply. /// The scalar value. /// The scaled vector. + [Intrinsic] public static Vector2 Multiply(Vector2 left, float right) => left * right; /// Multiplies a scalar value by a specified vector. /// The scaled value. /// The vector. /// The scaled vector. + [Intrinsic] public static Vector2 Multiply(float left, Vector2 right) => left * right; /// @@ -341,11 +367,13 @@ public static Vector2 MultiplyAddEstimate(Vector2 left, Vector2 right, Vector2 a /// Negates a specified vector. /// The vector to negate. /// The negated vector. + [Intrinsic] public static Vector2 Negate(Vector2 value) => -value; /// Returns a vector with the same direction as the specified vector, but with a length of one. /// The vector to normalize. /// The normalized vector. + [Intrinsic] public static Vector2 Normalize(Vector2 value) => value / value.Length(); /// Returns the reflection of a vector off a surface that has the specified normal. @@ -372,6 +400,7 @@ public static Vector2 SquareRoot(Vector2 value) /// The first vector. /// The second vector. /// The difference vector. + [Intrinsic] public static Vector2 Subtract(Vector2 left, Vector2 right) => left - right; /// Transforms a vector by a specified 3x2 matrix. @@ -570,12 +599,14 @@ static bool SoftwareFallback(in Vector2 self, Vector2 other) /// Returns the length of the vector. /// The vector's length. /// + [Intrinsic] public readonly float Length() => MathF.Sqrt(LengthSquared()); /// Returns the length of the vector squared. /// The vector's length squared. /// This operation offers better performance than a call to the method. /// + [Intrinsic] public readonly float LengthSquared() => Dot(this, this); /// Returns the string representation of the current instance using default formatting. diff --git a/src/libraries/System.Private.CoreLib/src/System/Numerics/Vector3.cs b/src/libraries/System.Private.CoreLib/src/System/Numerics/Vector3.cs index 039a33350e5398..7dc4994040eaa0 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Numerics/Vector3.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Numerics/Vector3.cs @@ -69,23 +69,43 @@ public Vector3(ReadOnlySpan values) /// Gets a vector whose 3 elements are equal to zero. /// A vector whose three elements are equal to zero (that is, it returns the vector (0,0,0). - public static Vector3 Zero => default; + public static Vector3 Zero + { + [Intrinsic] + get => default; + } /// Gets a vector whose 3 elements are equal to one. /// A vector whose three elements are equal to one (that is, it returns the vector (1,1,1). - public static Vector3 One => new Vector3(1.0f); + public static Vector3 One + { + [Intrinsic] + get => new Vector3(1.0f); + } /// Gets the vector (1,0,0). /// The vector (1,0,0). - public static Vector3 UnitX => new Vector3(1.0f, 0.0f, 0.0f); + public static Vector3 UnitX + { + [Intrinsic] + get => new Vector3(1.0f, 0.0f, 0.0f); + } /// Gets the vector (0,1,0). /// The vector (0,1,0). - public static Vector3 UnitY => new Vector3(0.0f, 1.0f, 0.0f); + public static Vector3 UnitY + { + [Intrinsic] + get => new Vector3(0.0f, 1.0f, 0.0f); + } /// Gets the vector (0,0,1). /// The vector (0,0,1). - public static Vector3 UnitZ => new Vector3(0.0f, 0.0f, 1.0f); + public static Vector3 UnitZ + { + [Intrinsic] + get => new Vector3(0.0f, 0.0f, 1.0f); + } /// Gets or sets the element at the specified index. /// The index of the element to get or set. @@ -93,6 +113,7 @@ public Vector3(ReadOnlySpan values) /// was less than zero or greater than the number of elements. public float this[int index] { + [Intrinsic] readonly get => this.GetElement(index); set => this = this.WithElement(index, value); @@ -232,6 +253,7 @@ public static Vector3 Abs(Vector3 value) /// The first vector to add. /// The second vector to add. /// The summed vector. + [Intrinsic] public static Vector3 Add(Vector3 left, Vector3 right) => left + right; /// Restricts a vector between a minimum and a maximum value. @@ -239,6 +261,7 @@ public static Vector3 Abs(Vector3 value) /// The minimum value. /// The maximum value. /// The restricted vector. + [Intrinsic] public static Vector3 Clamp(Vector3 value1, Vector3 min, Vector3 max) { // We must follow HLSL behavior in the case user specified min value is bigger than max value. @@ -263,24 +286,28 @@ public static Vector3 Cross(Vector3 vector1, Vector3 vector2) /// The first point. /// The second point. /// The distance. + [Intrinsic] public static float Distance(Vector3 value1, Vector3 value2) => MathF.Sqrt(DistanceSquared(value1, value2)); /// Returns the Euclidean distance squared between two specified points. /// The first point. /// The second point. /// The distance squared. + [Intrinsic] public static float DistanceSquared(Vector3 value1, Vector3 value2) => (value1 - value2).LengthSquared(); /// Divides the first vector by the second. /// The first vector. /// The second vector. /// The vector resulting from the division. + [Intrinsic] public static Vector3 Divide(Vector3 left, Vector3 right) => left / right; /// Divides the specified vector by a specified scalar value. /// The vector. /// The scalar value. /// The vector that results from the division. + [Intrinsic] public static Vector3 Divide(Vector3 left, float divisor) => left / divisor; /// Returns the dot product of two vectors. @@ -351,18 +378,21 @@ public static Vector3 Min(Vector3 value1, Vector3 value2) /// The first vector. /// The second vector. /// The element-wise product vector. + [Intrinsic] public static Vector3 Multiply(Vector3 left, Vector3 right) => left * right; /// Multiplies a vector by a specified scalar. /// The vector to multiply. /// The scalar value. /// The scaled vector. + [Intrinsic] public static Vector3 Multiply(Vector3 left, float right) => left * right; /// Multiplies a scalar value by a specified vector. /// The scaled value. /// The vector. /// The scaled vector. + [Intrinsic] public static Vector3 Multiply(float left, Vector3 right) => left * right; /// @@ -380,11 +410,13 @@ public static Vector3 MultiplyAddEstimate(Vector3 left, Vector3 right, Vector3 a /// Negates a specified vector. /// The vector to negate. /// The negated vector. + [Intrinsic] public static Vector3 Negate(Vector3 value) => -value; /// Returns a vector with the same direction as the specified vector, but with a length of one. /// The vector to normalize. /// The normalized vector. + [Intrinsic] public static Vector3 Normalize(Vector3 value) => value / value.Length(); /// Returns the reflection of a vector off a surface that has the specified normal. @@ -412,6 +444,7 @@ public static Vector3 SquareRoot(Vector3 value) /// The first vector. /// The second vector. /// The difference vector. + [Intrinsic] public static Vector3 Subtract(Vector3 left, Vector3 right) => left - right; /// Transforms a vector by a specified 4x4 matrix. @@ -588,6 +621,7 @@ static bool SoftwareFallback(in Vector3 self, Vector3 other) /// The vector's length squared. /// This operation offers better performance than a call to the method. /// + [Intrinsic] public readonly float LengthSquared() => Dot(this, this); /// Returns the string representation of the current instance using default formatting. diff --git a/src/libraries/System.Private.CoreLib/src/System/Numerics/Vector4.Extensions.cs b/src/libraries/System.Private.CoreLib/src/System/Numerics/Vector4.Extensions.cs index 7886b9e1e6eb60..5fb86e34da7722 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Numerics/Vector4.Extensions.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Numerics/Vector4.Extensions.cs @@ -12,11 +12,13 @@ public static unsafe partial class Vector /// Reinterprets a as a new . /// The vector to reinterpret. /// reinterpreted as a new . + [Intrinsic] internal static Plane AsPlane(this Vector4 value) => Unsafe.BitCast(value); /// Reinterprets a as a new . /// The vector to reinterpret. /// reinterpreted as a new . + [Intrinsic] internal static Quaternion AsQuaternion(this Vector4 value) => Unsafe.BitCast(value); /// Gets the element at the specified index. @@ -24,6 +26,7 @@ public static unsafe partial class Vector /// The index of the element to get. /// The value of the element at . /// was less than zero or greater than the number of elements. + [Intrinsic] internal static float GetElement(this Vector4 vector, int index) => vector.AsVector128().GetElement(index); /// Creates a new with the element at the specified index set to the specified value and the remaining elements set to the same value as that in the given vector. @@ -32,6 +35,7 @@ public static unsafe partial class Vector /// The value to set the element to. /// A with the value of the element at set to and the remaining elements set to the same value as that in . /// was less than zero or greater than the number of elements. + [Intrinsic] [MethodImpl(MethodImplOptions.AggressiveInlining)] internal static Vector4 WithElement(this Vector4 vector, int index, float value) => vector.AsVector128().WithElement(index, value).AsVector4(); diff --git a/src/libraries/System.Private.CoreLib/src/System/Numerics/Vector4.cs b/src/libraries/System.Private.CoreLib/src/System/Numerics/Vector4.cs index 1c4cafc475fc51..f6893396cc4fcb 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Numerics/Vector4.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Numerics/Vector4.cs @@ -34,6 +34,7 @@ public partial struct Vector4 : IEquatable, IFormattable /// Creates a new object whose four elements have the same value. /// The value to assign to all four elements. + [Intrinsic] public Vector4(float value) { this = Vector128.Create(value).AsVector4(); @@ -43,6 +44,7 @@ public Vector4(float value) /// The vector to use for the X and Y components. /// The Z component. /// The W component. + [Intrinsic] public Vector4(Vector2 value, float z, float w) { this = value.AsVector128() @@ -54,6 +56,7 @@ public Vector4(Vector2 value, float z, float w) /// Constructs a new object from the specified object and a W component. /// The vector to use for the X, Y, and Z components. /// The W component. + [Intrinsic] public Vector4(Vector3 value, float w) { this = value.AsVector128() @@ -66,6 +69,7 @@ public Vector4(Vector3 value, float w) /// The value to assign to the field. /// The value to assign to the field. /// The value to assign to the field. + [Intrinsic] public Vector4(float x, float y, float z, float w) { this = Vector128.Create(x, y, z, w).AsVector4(); @@ -80,28 +84,52 @@ public Vector4(ReadOnlySpan values) /// Gets a vector whose 4 elements are equal to zero. /// A vector whose four elements are equal to zero (that is, it returns the vector (0,0,0,0). - public static Vector4 Zero => default; + public static Vector4 Zero + { + [Intrinsic] + get => default; + } /// Gets a vector whose 4 elements are equal to one. /// Returns . /// A vector whose four elements are equal to one (that is, it returns the vector (1,1,1,1). - public static Vector4 One => new Vector4(1); + public static Vector4 One + { + [Intrinsic] + get => new Vector4(1); + } /// Gets the vector (1,0,0,0). /// The vector (1,0,0,0). - public static Vector4 UnitX => new Vector4(1.0f, 0.0f, 0.0f, 0.0f); + public static Vector4 UnitX + { + [Intrinsic] + get => new Vector4(1.0f, 0.0f, 0.0f, 0.0f); + } /// Gets the vector (0,1,0,0). /// The vector (0,1,0,0). - public static Vector4 UnitY => new Vector4(0.0f, 1.0f, 0.0f, 0.0f); + public static Vector4 UnitY + { + [Intrinsic] + get => new Vector4(0.0f, 1.0f, 0.0f, 0.0f); + } /// Gets the vector (0,0,1,0). /// The vector (0,0,1,0). - public static Vector4 UnitZ => new Vector4(0.0f, 0.0f, 1.0f, 0.0f); + public static Vector4 UnitZ + { + [Intrinsic] + get => new Vector4(0.0f, 0.0f, 1.0f, 0.0f); + } /// Gets the vector (0,0,0,1). /// The vector (0,0,0,1). - public static Vector4 UnitW => new Vector4(0.0f, 0.0f, 0.0f, 1.0f); + public static Vector4 UnitW + { + [Intrinsic] + get => new Vector4(0.0f, 0.0f, 0.0f, 1.0f); + } /// Gets or sets the element at the specified index. /// The index of the element to get or set. @@ -109,6 +137,7 @@ public Vector4(ReadOnlySpan values) /// was less than zero or greater than the number of elements. public float this[int index] { + [Intrinsic] readonly get => this.GetElement(index); set => this = this.WithElement(index, value); @@ -119,6 +148,7 @@ public float this[int index] /// The second vector to add. /// The summed vector. /// The method defines the addition operation for objects. + [Intrinsic] [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector4 operator +(Vector4 left, Vector4 right) => (left.AsVector128() + right.AsVector128()).AsVector4(); @@ -127,6 +157,7 @@ public float this[int index] /// The second vector. /// The vector that results from dividing by . /// The method defines the division operation for objects. + [Intrinsic] [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector4 operator /(Vector4 left, Vector4 right) => (left.AsVector128() / right.AsVector128()).AsVector4(); @@ -135,6 +166,7 @@ public float this[int index] /// The scalar value. /// The result of the division. /// The method defines the division operation for objects. + [Intrinsic] public static Vector4 operator /(Vector4 value1, float value2) => value1 / new Vector4(value2); /// Returns a value that indicates whether each pair of elements in two specified vectors is equal. @@ -142,6 +174,7 @@ public float this[int index] /// The second vector to compare. /// if and are equal; otherwise, . /// Two objects are equal if each element in is equal to the corresponding element in . + [Intrinsic] [MethodImpl(MethodImplOptions.AggressiveInlining)] public static bool operator ==(Vector4 left, Vector4 right) => left.AsVector128() == right.AsVector128(); @@ -149,6 +182,7 @@ public float this[int index] /// The first vector to compare. /// The second vector to compare. /// if and are not equal; otherwise, . + [Intrinsic] public static bool operator !=(Vector4 left, Vector4 right) => !(left == right); /// Returns a new vector whose values are the product of each pair of elements in two specified vectors. @@ -156,6 +190,7 @@ public float this[int index] /// The second vector. /// The element-wise product vector. /// The method defines the multiplication operation for objects. + [Intrinsic] [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector4 operator *(Vector4 left, Vector4 right) => (left.AsVector128() * right.AsVector128()).AsVector4(); @@ -164,6 +199,7 @@ public float this[int index] /// The scalar value. /// The scaled vector. /// The method defines the multiplication operation for objects. + [Intrinsic] public static Vector4 operator *(Vector4 left, float right) => left * new Vector4(right); /// Multiplies the scalar value by the specified vector. @@ -171,6 +207,7 @@ public float this[int index] /// The scalar value. /// The scaled vector. /// The method defines the multiplication operation for objects. + [Intrinsic] public static Vector4 operator *(float left, Vector4 right) => right * left; /// Subtracts the second vector from the first. @@ -178,6 +215,7 @@ public float this[int index] /// The second vector. /// The vector that results from subtracting from . /// The method defines the subtraction operation for objects. + [Intrinsic] [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector4 operator -(Vector4 left, Vector4 right) => (left.AsVector128() - right.AsVector128()).AsVector4(); @@ -185,12 +223,14 @@ public float this[int index] /// The vector to negate. /// The negated vector. /// The method defines the unary negation operation for objects. + [Intrinsic] [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector4 operator -(Vector4 value) => (-value.AsVector128()).AsVector4(); /// Returns a vector whose elements are the absolute values of each of the specified vector's elements. /// A vector. /// The absolute value vector. + [Intrinsic] [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector4 Abs(Vector4 value) => Vector128.Abs(value.AsVector128()).AsVector4(); @@ -198,6 +238,7 @@ public float this[int index] /// The first vector to add. /// The second vector to add. /// The summed vector. + [Intrinsic] public static Vector4 Add(Vector4 left, Vector4 right) => left + right; /// Restricts a vector between a minimum and a maximum value. @@ -205,6 +246,7 @@ public float this[int index] /// The minimum value. /// The maximum value. /// The restricted vector. + [Intrinsic] public static Vector4 Clamp(Vector4 value1, Vector4 min, Vector4 max) { // We must follow HLSL behavior in the case user specified min value is bigger than max value. @@ -215,34 +257,40 @@ public static Vector4 Clamp(Vector4 value1, Vector4 min, Vector4 max) /// The first point. /// The second point. /// The distance. + [Intrinsic] public static float Distance(Vector4 value1, Vector4 value2) => MathF.Sqrt(DistanceSquared(value1, value2)); /// Returns the Euclidean distance squared between two specified points. /// The first point. /// The second point. /// The distance squared. + [Intrinsic] public static float DistanceSquared(Vector4 value1, Vector4 value2) => (value1 - value2).LengthSquared(); /// Divides the first vector by the second. /// The first vector. /// The second vector. /// The vector resulting from the division. + [Intrinsic] public static Vector4 Divide(Vector4 left, Vector4 right) => left / right; /// Divides the specified vector by a specified scalar value. /// The vector. /// The scalar value. /// The vector that results from the division. + [Intrinsic] public static Vector4 Divide(Vector4 left, float divisor) => left / divisor; /// Returns the dot product of two vectors. /// The first vector. /// The second vector. /// The dot product. + [Intrinsic] [MethodImpl(MethodImplOptions.AggressiveInlining)] public static float Dot(Vector4 vector1, Vector4 vector2) => Vector128.Dot(vector1.AsVector128(), vector2.AsVector128()); /// + [Intrinsic] [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector4 FusedMultiplyAdd(Vector4 left, Vector4 right, Vector4 addend) => Vector128.FusedMultiplyAdd(left.AsVector128(), right.AsVector128(), addend.AsVector128()).AsVector4(); @@ -254,6 +302,7 @@ public static Vector4 Clamp(Vector4 value1, Vector4 min, Vector4 max) /// + [Intrinsic] [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector4 Lerp(Vector4 value1, Vector4 value2, float amount) => (value1 * (1.0f - amount)) + (value2 * amount); @@ -261,6 +310,7 @@ public static Vector4 Clamp(Vector4 value1, Vector4 min, Vector4 max) /// The first vector. /// The second vector. /// The maximized vector. + [Intrinsic] [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector4 Max(Vector4 value1, Vector4 value2) => Vector128.Max(value1.AsVector128(), value2.AsVector128()).AsVector4(); @@ -268,6 +318,7 @@ public static Vector4 Clamp(Vector4 value1, Vector4 min, Vector4 max) /// The first vector. /// The second vector. /// The minimized vector. + [Intrinsic] [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector4 Min(Vector4 value1, Vector4 value2) => Vector128.Min(value1.AsVector128(), value2.AsVector128()).AsVector4(); @@ -275,37 +326,44 @@ public static Vector4 Clamp(Vector4 value1, Vector4 min, Vector4 max) /// The first vector. /// The second vector. /// The element-wise product vector. + [Intrinsic] public static Vector4 Multiply(Vector4 left, Vector4 right) => left * right; /// Multiplies a vector by a specified scalar. /// The vector to multiply. /// The scalar value. /// The scaled vector. + [Intrinsic] public static Vector4 Multiply(Vector4 left, float right) => left * right; /// Multiplies a scalar value by a specified vector. /// The scaled value. /// The vector. /// The scaled vector. + [Intrinsic] public static Vector4 Multiply(float left, Vector4 right) => left * right; /// + [Intrinsic] [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector4 MultiplyAddEstimate(Vector4 left, Vector4 right, Vector4 addend) => Vector128.MultiplyAddEstimate(left.AsVector128(), right.AsVector128(), addend.AsVector128()).AsVector4(); /// Negates a specified vector. /// The vector to negate. /// The negated vector. + [Intrinsic] public static Vector4 Negate(Vector4 value) => -value; /// Returns a vector with the same direction as the specified vector, but with a length of one. /// The vector to normalize. /// The normalized vector. + [Intrinsic] public static Vector4 Normalize(Vector4 vector) => vector / vector.Length(); /// Returns a vector whose elements are the square root of each of a specified vector's elements. /// A vector. /// The square root vector. + [Intrinsic] [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector4 SquareRoot(Vector4 value) => Vector128.Sqrt(value.AsVector128()).AsVector4(); @@ -313,6 +371,7 @@ public static Vector4 Clamp(Vector4 value1, Vector4 min, Vector4 max) /// The first vector. /// The second vector. /// The difference vector. + [Intrinsic] public static Vector4 Subtract(Vector4 left, Vector4 right) => left - right; /// Transforms a two-dimensional vector by a specified 4x4 matrix. @@ -504,12 +563,14 @@ public static Vector4 Transform(Vector4 value, Quaternion rotation) /// Returns the length of this vector object. /// The vector's length. /// + [Intrinsic] public readonly float Length() => MathF.Sqrt(LengthSquared()); /// Returns the length of the vector squared. /// The vector's length squared. /// This operation offers better performance than a call to the method. /// + [Intrinsic] public readonly float LengthSquared() => Dot(this, this); /// Returns the string representation of the current instance using default formatting. diff --git a/src/libraries/System.Private.CoreLib/src/System/Numerics/Vector_1.cs b/src/libraries/System.Private.CoreLib/src/System/Numerics/Vector_1.cs index b796005660edf8..4009387a4f796c 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Numerics/Vector_1.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Numerics/Vector_1.cs @@ -202,6 +202,7 @@ public static Vector One /// The type of the current instance () is not supported. public static Vector Zero { + [Intrinsic] get { ThrowHelper.ThrowForUnsupportedNumericsVectorBaseType(); @@ -216,7 +217,11 @@ public static Vector Zero /// The value of the element at . /// The type of the current instance () is not supported. /// was less than zero or greater than the number of elements. - public T this[int index] => this.GetElement(index); + public T this[int index] + { + [Intrinsic] + get => this.GetElement(index); + } /// Adds two vectors to compute their sum. /// The vector to add with . @@ -366,42 +371,49 @@ public static Vector Zero /// The vector to reinterpret. /// reinterpreted as a new . /// The type of () is not supported. + [Intrinsic] public static explicit operator Vector(Vector value) => value.As(); /// Reinterprets a as a new . /// The vector to reinterpret. /// reinterpreted as a new . /// The type of () is not supported. + [Intrinsic] public static explicit operator Vector(Vector value) => value.As(); /// Reinterprets a as a new . /// The vector to reinterpret. /// reinterpreted as a new . /// The type of () is not supported. + [Intrinsic] public static explicit operator Vector(Vector value) => value.As(); /// Reinterprets a as a new . /// The vector to reinterpret. /// reinterpreted as a new . /// The type of () is not supported. + [Intrinsic] public static explicit operator Vector(Vector value) => value.As(); /// Reinterprets a as a new . /// The vector to reinterpret. /// reinterpreted as a new . /// The type of () is not supported. + [Intrinsic] public static explicit operator Vector(Vector value) => value.As(); /// Reinterprets a as a new . /// The vector to reinterpret. /// reinterpreted as a new . /// The type of () is not supported. + [Intrinsic] public static explicit operator Vector(Vector value) => value.As(); /// Reinterprets a as a new . /// The vector to reinterpret. /// reinterpreted as a new . /// The type of () is not supported. + [Intrinsic] [CLSCompliant(false)] public static explicit operator Vector(Vector value) => value.As(); @@ -409,6 +421,7 @@ public static Vector Zero /// The vector to reinterpret. /// reinterpreted as a new . /// The type of () is not supported. + [Intrinsic] [CLSCompliant(false)] public static explicit operator Vector(Vector value) => value.As(); @@ -416,12 +429,14 @@ public static Vector Zero /// The vector to reinterpret. /// reinterpreted as a new . /// The type of () is not supported. + [Intrinsic] public static explicit operator Vector(Vector value) => value.As(); /// Reinterprets a as a new . /// The vector to reinterpret. /// reinterpreted as a new . /// The type of () is not supported. + [Intrinsic] [CLSCompliant(false)] public static explicit operator Vector(Vector value) => value.As(); @@ -429,6 +444,7 @@ public static Vector Zero /// The vector to reinterpret. /// reinterpreted as a new . /// The type of () is not supported. + [Intrinsic] [CLSCompliant(false)] public static explicit operator Vector(Vector value) => value.As(); @@ -436,6 +452,7 @@ public static Vector Zero /// The vector to reinterpret. /// reinterpreted as a new . /// The type of () is not supported. + [Intrinsic] [CLSCompliant(false)] public static explicit operator Vector(Vector value) => value.As(); @@ -443,6 +460,7 @@ public static Vector Zero /// The vector to compare with . /// The vector to compare with . /// true if any elements in was not equal to the corresponding element in . + [Intrinsic] public static bool operator !=(Vector left, Vector right) => !(left == right); /// Shifts each element of a vector left by the specified amount. @@ -566,6 +584,7 @@ public static Vector operator >>(Vector value, int shiftCount) /// The vector. /// /// The type of the vector () is not supported. + [Intrinsic] public static Vector operator +(Vector value) { ThrowHelper.ThrowForUnsupportedNumericsVectorBaseType(); diff --git a/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Vector128.cs b/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Vector128.cs index 28810437e844ca..2d92f4ea4d4c8d 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Vector128.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Vector128.cs @@ -70,6 +70,7 @@ public static Vector128 Abs(Vector128 vector) /// The vector to add with . /// The sum of and . /// The type of and () is not supported. + [Intrinsic] public static Vector128 Add(Vector128 left, Vector128 right) => left + right; /// Computes the bitwise-and of a given vector and the ones complement of another vector. @@ -93,6 +94,7 @@ public static Vector128 AndNot(Vector128 left, Vector128 right) /// The vector to reinterpret. /// reinterpreted as a new . /// The type of () or the type of the target () is not supported. + [Intrinsic] [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector128 As(this Vector128 vector) { @@ -107,6 +109,7 @@ public static Vector128 As(this Vector128 vector) /// The vector to reinterpret. /// reinterpreted as a new . /// The type of () is not supported. + [Intrinsic] public static Vector128 AsByte(this Vector128 vector) => vector.As(); /// Reinterprets a as a new . @@ -114,6 +117,7 @@ public static Vector128 As(this Vector128 vector) /// The vector to reinterpret. /// reinterpreted as a new . /// The type of () is not supported. + [Intrinsic] public static Vector128 AsDouble(this Vector128 vector) => vector.As(); /// Reinterprets a as a new . @@ -121,6 +125,7 @@ public static Vector128 As(this Vector128 vector) /// The vector to reinterpret. /// reinterpreted as a new . /// The type of () is not supported. + [Intrinsic] public static Vector128 AsInt16(this Vector128 vector) => vector.As(); /// Reinterprets a as a new . @@ -128,6 +133,7 @@ public static Vector128 As(this Vector128 vector) /// The vector to reinterpret. /// reinterpreted as a new . /// The type of () is not supported. + [Intrinsic] public static Vector128 AsInt32(this Vector128 vector) => vector.As(); /// Reinterprets a as a new . @@ -135,6 +141,7 @@ public static Vector128 As(this Vector128 vector) /// The vector to reinterpret. /// reinterpreted as a new . /// The type of () is not supported. + [Intrinsic] public static Vector128 AsInt64(this Vector128 vector) => vector.As(); /// Reinterprets a as a new . @@ -142,6 +149,7 @@ public static Vector128 As(this Vector128 vector) /// The vector to reinterpret. /// reinterpreted as a new . /// The type of () is not supported. + [Intrinsic] public static Vector128 AsNInt(this Vector128 vector) => vector.As(); /// Reinterprets a as a new . @@ -149,6 +157,7 @@ public static Vector128 As(this Vector128 vector) /// The vector to reinterpret. /// reinterpreted as a new . /// The type of () is not supported. + [Intrinsic] [CLSCompliant(false)] public static Vector128 AsNUInt(this Vector128 vector) => vector.As(); @@ -167,6 +176,7 @@ public static Vector128 As(this Vector128 vector) /// The vector to reinterpret. /// reinterpreted as a new . /// The type of () is not supported. + [Intrinsic] [CLSCompliant(false)] public static Vector128 AsSByte(this Vector128 vector) => vector.As(); @@ -175,6 +185,7 @@ public static Vector128 As(this Vector128 vector) /// The vector to reinterpret. /// reinterpreted as a new . /// The type of () is not supported. + [Intrinsic] public static Vector128 AsSingle(this Vector128 vector) => vector.As(); /// Reinterprets a as a new . @@ -182,6 +193,7 @@ public static Vector128 As(this Vector128 vector) /// The vector to reinterpret. /// reinterpreted as a new . /// The type of () is not supported. + [Intrinsic] [CLSCompliant(false)] public static Vector128 AsUInt16(this Vector128 vector) => vector.As(); @@ -190,6 +202,7 @@ public static Vector128 As(this Vector128 vector) /// The vector to reinterpret. /// reinterpreted as a new . /// The type of () is not supported. + [Intrinsic] [CLSCompliant(false)] public static Vector128 AsUInt32(this Vector128 vector) => vector.As(); @@ -198,6 +211,7 @@ public static Vector128 As(this Vector128 vector) /// The vector to reinterpret. /// reinterpreted as a new . /// The type of () is not supported. + [Intrinsic] [CLSCompliant(false)] public static Vector128 AsUInt64(this Vector128 vector) => vector.As(); @@ -226,6 +240,7 @@ public static Vector128 As(this Vector128 vector) /// Reinterprets a as a new . /// The vector to reinterpret. /// reinterpreted as a new . + [Intrinsic] public static Vector128 AsVector128(this Vector4 value) => Unsafe.BitCast>(value); /// Reinterprets a as a new . @@ -269,6 +284,7 @@ public static Vector3 AsVector3(this Vector128 value) /// Reinterprets a as a new . /// The vector to reinterpret. /// reinterpreted as a new . + [Intrinsic] public static Vector4 AsVector4(this Vector128 value) => Unsafe.BitCast, Vector4>(value); /// Reinterprets a as a new . @@ -294,6 +310,7 @@ public static Vector AsVector(this Vector128 value) /// The vector to bitwise-and with . /// The bitwise-and of and . /// The type of and () is not supported. + [Intrinsic] public static Vector128 BitwiseAnd(Vector128 left, Vector128 right) => left & right; /// Computes the bitwise-or of two vectors. @@ -302,6 +319,7 @@ public static Vector AsVector(this Vector128 value) /// The vector to bitwise-or with . /// The bitwise-or of and . /// The type of and () is not supported. + [Intrinsic] public static Vector128 BitwiseOr(Vector128 left, Vector128 right) => left | right; /// Computes the ceiling of each element in a vector. @@ -1328,6 +1346,7 @@ public static Vector128 CreateScalarUnsafe(T value) /// The vector that will divide . /// The quotient of divided by . /// The type of and () is not supported. + [Intrinsic] public static Vector128 Divide(Vector128 left, Vector128 right) => left / right; /// Divides a vector by a scalar to compute the per-element quotient. @@ -1335,6 +1354,7 @@ public static Vector128 CreateScalarUnsafe(T value) /// The scalar that will divide . /// The type of the elements in the vector. /// The quotient of divided by . + [Intrinsic] public static Vector128 Divide(Vector128 left, T right) => left / right; /// Computes the dot product of two vectors. @@ -1378,6 +1398,7 @@ public static Vector128 Equals(Vector128 left, Vector128 right) /// The vector to compare with . /// true if all elements in were equal to the corresponding element in . /// The type of and () is not supported. + [Intrinsic] public static bool EqualsAll(Vector128 left, Vector128 right) => left == right; /// Compares two vectors to determine if any elements are equal. @@ -1719,6 +1740,7 @@ public static bool LessThanOrEqualAny(Vector128 left, Vector128 right) /// The source from which the vector will be loaded. /// The vector loaded from . /// The type of () is not supported. + [Intrinsic] [CLSCompliant(false)] public static unsafe Vector128 Load(T* source) => LoadUnsafe(ref *source); @@ -1900,6 +1922,7 @@ public static Vector128 Min(Vector128 left, Vector128 right) /// The vector to multiply with . /// The element-wise product of and . /// The type of and () is not supported. + [Intrinsic] public static Vector128 Multiply(Vector128 left, Vector128 right) => left * right; /// Multiplies a vector by a scalar to compute their product. @@ -1908,6 +1931,7 @@ public static Vector128 Min(Vector128 left, Vector128 right) /// The scalar to multiply with . /// The product of and . /// The type of and () is not supported. + [Intrinsic] public static Vector128 Multiply(Vector128 left, T right) => left * right; /// Multiplies a vector by a scalar to compute their product. @@ -1916,6 +1940,7 @@ public static Vector128 Min(Vector128 left, Vector128 right) /// The vector to multiply with . /// The product of and . /// The type of and () is not supported. + [Intrinsic] public static Vector128 Multiply(T left, Vector128 right) => left * right; /// @@ -2047,6 +2072,7 @@ public static unsafe Vector128 Narrow(Vector128 lower, Vector128
        The vector to negate. /// A vector whose elements are the negation of the corresponding elements in . /// The type of () is not supported. + [Intrinsic] public static Vector128 Negate(Vector128 vector) => -vector; /// Computes the ones-complement of a vector. @@ -2054,48 +2080,56 @@ public static unsafe Vector128 Narrow(Vector128 lower, Vector128
          The vector whose ones-complement is to be computed. /// A vector whose elements are the ones-complement of the corresponding elements in . /// The type of () is not supported. + [Intrinsic] public static Vector128 OnesComplement(Vector128 vector) => ~vector; /// Shifts each element of a vector left by the specified amount. /// The vector whose elements are to be shifted. /// The number of bits by which to shift each element. /// A vector whose elements where shifted left by . + [Intrinsic] internal static Vector128 ShiftLeft(Vector128 vector, int shiftCount) => vector << shiftCount; /// Shifts each element of a vector left by the specified amount. /// The vector whose elements are to be shifted. /// The number of bits by which to shift each element. /// A vector whose elements where shifted left by . + [Intrinsic] public static Vector128 ShiftLeft(Vector128 vector, int shiftCount) => vector << shiftCount; /// Shifts each element of a vector left by the specified amount. /// The vector whose elements are to be shifted. /// The number of bits by which to shift each element. /// A vector whose elements where shifted left by . + [Intrinsic] public static Vector128 ShiftLeft(Vector128 vector, int shiftCount) => vector << shiftCount; /// Shifts each element of a vector left by the specified amount. /// The vector whose elements are to be shifted. /// The number of bits by which to shift each element. /// A vector whose elements where shifted left by . + [Intrinsic] public static Vector128 ShiftLeft(Vector128 vector, int shiftCount) => vector << shiftCount; /// Shifts each element of a vector left by the specified amount. /// The vector whose elements are to be shifted. /// The number of bits by which to shift each element. /// A vector whose elements where shifted left by . + [Intrinsic] public static Vector128 ShiftLeft(Vector128 vector, int shiftCount) => vector << shiftCount; /// Shifts each element of a vector left by the specified amount. /// The vector whose elements are to be shifted. /// The number of bits by which to shift each element. /// A vector whose elements where shifted left by . + [Intrinsic] public static Vector128 ShiftLeft(Vector128 vector, int shiftCount) => vector << shiftCount; /// Shifts each element of a vector left by the specified amount. /// The vector whose elements are to be shifted. /// The number of bits by which to shift each element. /// A vector whose elements where shifted left by . + [Intrinsic] [CLSCompliant(false)] public static Vector128 ShiftLeft(Vector128 vector, int shiftCount) => vector << shiftCount; @@ -2103,6 +2137,7 @@ public static unsafe Vector128 Narrow(Vector128 lower, Vector128
            The vector whose elements are to be shifted. /// The number of bits by which to shift each element. /// A vector whose elements where shifted left by . + [Intrinsic] [CLSCompliant(false)] public static Vector128 ShiftLeft(Vector128 vector, int shiftCount) => vector << shiftCount; @@ -2110,6 +2145,7 @@ public static unsafe Vector128 Narrow(Vector128 lower, Vector128
              The vector whose elements are to be shifted. /// The number of bits by which to shift each element. /// A vector whose elements where shifted left by . + [Intrinsic] [CLSCompliant(false)] public static Vector128 ShiftLeft(Vector128 vector, int shiftCount) => vector << shiftCount; @@ -2117,6 +2153,7 @@ public static unsafe Vector128 Narrow(Vector128 lower, Vector128
                The vector whose elements are to be shifted. /// The number of bits by which to shift each element. /// A vector whose elements where shifted left by . + [Intrinsic] [CLSCompliant(false)] public static Vector128 ShiftLeft(Vector128 vector, int shiftCount) => vector << shiftCount; @@ -2124,6 +2161,7 @@ public static unsafe Vector128 Narrow(Vector128 lower, Vector128
                  The vector whose elements are to be shifted. /// The number of bits by which to shift each element. /// A vector whose elements where shifted left by . + [Intrinsic] [CLSCompliant(false)] public static Vector128 ShiftLeft(Vector128 vector, int shiftCount) => vector << shiftCount; @@ -2131,36 +2169,42 @@ public static unsafe Vector128 Narrow(Vector128 lower, Vector128
                    The vector whose elements are to be shifted. /// The number of bits by which to shift each element. /// A vector whose elements where shifted right by . + [Intrinsic] internal static Vector128 ShiftRightArithmetic(Vector128 vector, int shiftCount) => vector >> shiftCount; /// Shifts (signed) each element of a vector right by the specified amount. /// The vector whose elements are to be shifted. /// The number of bits by which to shift each element. /// A vector whose elements where shifted right by . + [Intrinsic] public static Vector128 ShiftRightArithmetic(Vector128 vector, int shiftCount) => vector >> shiftCount; /// Shifts (signed) each element of a vector right by the specified amount. /// The vector whose elements are to be shifted. /// The number of bits by which to shift each element. /// A vector whose elements where shifted right by . + [Intrinsic] public static Vector128 ShiftRightArithmetic(Vector128 vector, int shiftCount) => vector >> shiftCount; /// Shifts (signed) each element of a vector right by the specified amount. /// The vector whose elements are to be shifted. /// The number of bits by which to shift each element. /// A vector whose elements where shifted right by . + [Intrinsic] public static Vector128 ShiftRightArithmetic(Vector128 vector, int shiftCount) => vector >> shiftCount; /// Shifts (signed) each element of a vector right by the specified amount. /// The vector whose elements are to be shifted. /// The number of bits by which to shift each element. /// A vector whose elements where shifted right by . + [Intrinsic] public static Vector128 ShiftRightArithmetic(Vector128 vector, int shiftCount) => vector >> shiftCount; /// Shifts (signed) each element of a vector right by the specified amount. /// The vector whose elements are to be shifted. /// The number of bits by which to shift each element. /// A vector whose elements where shifted right by . + [Intrinsic] [CLSCompliant(false)] public static Vector128 ShiftRightArithmetic(Vector128 vector, int shiftCount) => vector >> shiftCount; @@ -2168,42 +2212,49 @@ public static unsafe Vector128 Narrow(Vector128 lower, Vector128
                      The vector whose elements are to be shifted. /// The number of bits by which to shift each element. /// A vector whose elements where shifted right by . + [Intrinsic] internal static Vector128 ShiftRightLogical(Vector128 vector, int shiftCount) => vector >>> shiftCount; /// Shifts (unsigned) each element of a vector right by the specified amount. /// The vector whose elements are to be shifted. /// The number of bits by which to shift each element. /// A vector whose elements where shifted right by . + [Intrinsic] public static Vector128 ShiftRightLogical(Vector128 vector, int shiftCount) => vector >>> shiftCount; /// Shifts (unsigned) each element of a vector right by the specified amount. /// The vector whose elements are to be shifted. /// The number of bits by which to shift each element. /// A vector whose elements where shifted right by . + [Intrinsic] public static Vector128 ShiftRightLogical(Vector128 vector, int shiftCount) => vector >>> shiftCount; /// Shifts (unsigned) each element of a vector right by the specified amount. /// The vector whose elements are to be shifted. /// The number of bits by which to shift each element. /// A vector whose elements where shifted right by . + [Intrinsic] public static Vector128 ShiftRightLogical(Vector128 vector, int shiftCount) => vector >>> shiftCount; /// Shifts (unsigned) each element of a vector right by the specified amount. /// The vector whose elements are to be shifted. /// The number of bits by which to shift each element. /// A vector whose elements where shifted right by . + [Intrinsic] public static Vector128 ShiftRightLogical(Vector128 vector, int shiftCount) => vector >>> shiftCount; /// Shifts (unsigned) each element of a vector right by the specified amount. /// The vector whose elements are to be shifted. /// The number of bits by which to shift each element. /// A vector whose elements where shifted right by . + [Intrinsic] public static Vector128 ShiftRightLogical(Vector128 vector, int shiftCount) => vector >>> shiftCount; /// Shifts (unsigned) each element of a vector right by the specified amount. /// The vector whose elements are to be shifted. /// The number of bits by which to shift each element. /// A vector whose elements where shifted right by . + [Intrinsic] [CLSCompliant(false)] public static Vector128 ShiftRightLogical(Vector128 vector, int shiftCount) => vector >>> shiftCount; @@ -2211,6 +2262,7 @@ public static unsafe Vector128 Narrow(Vector128 lower, Vector128
                        The vector whose elements are to be shifted. /// The number of bits by which to shift each element. /// A vector whose elements where shifted right by . + [Intrinsic] [CLSCompliant(false)] public static Vector128 ShiftRightLogical(Vector128 vector, int shiftCount) => vector >>> shiftCount; @@ -2218,6 +2270,7 @@ public static unsafe Vector128 Narrow(Vector128 lower, Vector128
                          The vector whose elements are to be shifted. /// The number of bits by which to shift each element. /// A vector whose elements where shifted right by . + [Intrinsic] [CLSCompliant(false)] public static Vector128 ShiftRightLogical(Vector128 vector, int shiftCount) => vector >>> shiftCount; @@ -2225,6 +2278,7 @@ public static unsafe Vector128 Narrow(Vector128 lower, Vector128
                            The vector whose elements are to be shifted. /// The number of bits by which to shift each element. /// A vector whose elements where shifted right by . + [Intrinsic] [CLSCompliant(false)] public static Vector128 ShiftRightLogical(Vector128 vector, int shiftCount) => vector >>> shiftCount; @@ -2232,6 +2286,7 @@ public static unsafe Vector128 Narrow(Vector128 lower, Vector128
                              The vector whose elements are to be shifted. /// The number of bits by which to shift each element. /// A vector whose elements where shifted right by . + [Intrinsic] [CLSCompliant(false)] public static Vector128 ShiftRightLogical(Vector128 vector, int shiftCount) => vector >>> shiftCount; @@ -2532,6 +2587,7 @@ public static Vector128 Sqrt(Vector128 vector) /// The vector that will be stored. /// The destination at which will be stored. /// The type of () is not supported. + [Intrinsic] [CLSCompliant(false)] public static unsafe void Store(this Vector128 source, T* destination) => source.StoreUnsafe(ref *destination); @@ -2619,6 +2675,7 @@ public static void StoreUnsafe(this Vector128 source, ref T destination, n /// The vector to subtract from . /// The difference of and . /// The type of and () is not supported. + [Intrinsic] public static Vector128 Subtract(Vector128 left, Vector128 right) => left - right; /// Computes the sum of all elements in a vector. @@ -3031,6 +3088,7 @@ public static Vector128 WithUpper(this Vector128 vector, Vector64 va /// The vector to exclusive-or with . /// The exclusive-or of and . /// The type of and () is not supported. + [Intrinsic] public static Vector128 Xor(Vector128 left, Vector128 right) => left ^ right; [MethodImpl(MethodImplOptions.AggressiveInlining)] diff --git a/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Vector128_1.cs b/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Vector128_1.cs index bbd89f973c7c9d..c9f1b6e3f21efd 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Vector128_1.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Vector128_1.cs @@ -113,6 +113,7 @@ public static Vector128 One /// The type of the vector () is not supported. public static Vector128 Zero { + [Intrinsic] get { ThrowHelper.ThrowForUnsupportedIntrinsicsVector128BaseType(); @@ -353,6 +354,7 @@ public static Vector128 operator >>(Vector128 value, int shiftCount) /// The vector. /// /// The type of the vector () is not supported. + [Intrinsic] public static Vector128 operator +(Vector128 value) { ThrowHelper.ThrowForUnsupportedIntrinsicsVector128BaseType(); diff --git a/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Vector256.cs b/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Vector256.cs index 5d04c413106722..c7b390347266ea 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Vector256.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Vector256.cs @@ -74,6 +74,7 @@ public static Vector256 Abs(Vector256 vector) /// The vector to add with . /// The sum of and . /// The type of and () is not supported. + [Intrinsic] public static Vector256 Add(Vector256 left, Vector256 right) => left + right; /// Computes the bitwise-and of a given vector and the ones complement of another vector. @@ -98,6 +99,7 @@ public static Vector256 AndNot(Vector256 left, Vector256 right) /// The vector to reinterpret. /// reinterpreted as a new . /// The type of () or the type of the target () is not supported. + [Intrinsic] [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector256 As(this Vector256 vector) { @@ -112,6 +114,7 @@ public static Vector256 As(this Vector256 vector) /// The vector to reinterpret. /// reinterpreted as a new . /// The type of () is not supported. + [Intrinsic] public static Vector256 AsByte(this Vector256 vector) => vector.As(); /// Reinterprets a as a new . @@ -119,6 +122,7 @@ public static Vector256 As(this Vector256 vector) /// The vector to reinterpret. /// reinterpreted as a new . /// The type of () is not supported. + [Intrinsic] public static Vector256 AsDouble(this Vector256 vector) => vector.As(); /// Reinterprets a as a new . @@ -126,6 +130,7 @@ public static Vector256 As(this Vector256 vector) /// The vector to reinterpret. /// reinterpreted as a new . /// The type of () is not supported. + [Intrinsic] public static Vector256 AsInt16(this Vector256 vector) => vector.As(); /// Reinterprets a as a new . @@ -133,6 +138,7 @@ public static Vector256 As(this Vector256 vector) /// The vector to reinterpret. /// reinterpreted as a new . /// The type of () is not supported. + [Intrinsic] public static Vector256 AsInt32(this Vector256 vector) => vector.As(); /// Reinterprets a as a new . @@ -140,6 +146,7 @@ public static Vector256 As(this Vector256 vector) /// The vector to reinterpret. /// reinterpreted as a new . /// The type of () is not supported. + [Intrinsic] public static Vector256 AsInt64(this Vector256 vector) => vector.As(); /// Reinterprets a as a new . @@ -147,6 +154,7 @@ public static Vector256 As(this Vector256 vector) /// The vector to reinterpret. /// reinterpreted as a new . /// The type of () is not supported. + [Intrinsic] public static Vector256 AsNInt(this Vector256 vector) => vector.As(); /// Reinterprets a as a new . @@ -154,6 +162,7 @@ public static Vector256 As(this Vector256 vector) /// The vector to reinterpret. /// reinterpreted as a new . /// The type of () is not supported. + [Intrinsic] [CLSCompliant(false)] public static Vector256 AsNUInt(this Vector256 vector) => vector.As(); @@ -162,6 +171,7 @@ public static Vector256 As(this Vector256 vector) /// The vector to reinterpret. /// reinterpreted as a new . /// The type of () is not supported. + [Intrinsic] [CLSCompliant(false)] public static Vector256 AsSByte(this Vector256 vector) => vector.As(); @@ -170,6 +180,7 @@ public static Vector256 As(this Vector256 vector) /// The vector to reinterpret. /// reinterpreted as a new . /// The type of () is not supported. + [Intrinsic] public static Vector256 AsSingle(this Vector256 vector) => vector.As(); /// Reinterprets a as a new . @@ -177,6 +188,7 @@ public static Vector256 As(this Vector256 vector) /// The vector to reinterpret. /// reinterpreted as a new . /// The type of () is not supported. + [Intrinsic] [CLSCompliant(false)] public static Vector256 AsUInt16(this Vector256 vector) => vector.As(); @@ -185,6 +197,7 @@ public static Vector256 As(this Vector256 vector) /// The vector to reinterpret. /// reinterpreted as a new . /// The type of () is not supported. + [Intrinsic] [CLSCompliant(false)] public static Vector256 AsUInt32(this Vector256 vector) => vector.As(); @@ -193,6 +206,7 @@ public static Vector256 As(this Vector256 vector) /// The vector to reinterpret. /// reinterpreted as a new . /// The type of () is not supported. + [Intrinsic] [CLSCompliant(false)] public static Vector256 AsUInt64(this Vector256 vector) => vector.As(); @@ -235,6 +249,7 @@ public static Vector AsVector(this Vector256 value) /// The vector to bitwise-and with . /// The bitwise-and of and . /// The type of and () is not supported. + [Intrinsic] public static Vector256 BitwiseAnd(Vector256 left, Vector256 right) => left & right; /// Computes the bitwise-or of two vectors. @@ -243,6 +258,7 @@ public static Vector AsVector(this Vector256 value) /// The vector to bitwise-or with . /// The bitwise-or of and . /// The type of and () is not supported. + [Intrinsic] public static Vector256 BitwiseOr(Vector256 left, Vector256 right) => left | right; /// Computes the ceiling of each element in a vector. @@ -1314,6 +1330,7 @@ public static Vector256 CreateScalarUnsafe(T value) /// The vector that will divide . /// The quotient of divided by . /// The type of and () is not supported. + [Intrinsic] public static Vector256 Divide(Vector256 left, Vector256 right) => left / right; /// Divides a vector by a scalar to compute the per-element quotient. @@ -1321,6 +1338,7 @@ public static Vector256 CreateScalarUnsafe(T value) /// The scalar that will divide . /// The type of the elements in the vector. /// The quotient of divided by . + [Intrinsic] public static Vector256 Divide(Vector256 left, T right) => left / right; /// Computes the dot product of two vectors. @@ -1364,6 +1382,7 @@ public static Vector256 Equals(Vector256 left, Vector256 right) /// The type of the elements in the vector. /// true if all elements in were equal to the corresponding element in . /// The type of and () is not supported. + [Intrinsic] public static bool EqualsAll(Vector256 left, Vector256 right) => left == right; /// Compares two vectors to determine if any elements are equal. @@ -1703,6 +1722,7 @@ public static bool LessThanOrEqualAny(Vector256 left, Vector256 right) /// The source from which the vector will be loaded. /// The vector loaded from . /// The type of () is not supported. + [Intrinsic] [CLSCompliant(false)] public static Vector256 Load(T* source) => LoadUnsafe(ref *source); @@ -1884,6 +1904,7 @@ public static Vector256 Min(Vector256 left, Vector256 right) /// The vector to multiply with . /// The element-wise product of and . /// The type of and () is not supported. + [Intrinsic] public static Vector256 Multiply(Vector256 left, Vector256 right) => left * right; /// Multiplies a vector by a scalar to compute their product. @@ -1892,6 +1913,7 @@ public static Vector256 Min(Vector256 left, Vector256 right) /// The scalar to multiply with . /// The product of and . /// The type of and () is not supported. + [Intrinsic] public static Vector256 Multiply(Vector256 left, T right) => left * right; /// Multiplies a vector by a scalar to compute their product. @@ -1900,6 +1922,7 @@ public static Vector256 Min(Vector256 left, Vector256 right) /// The vector to multiply with . /// The product of and . /// The type of and () is not supported. + [Intrinsic] public static Vector256 Multiply(T left, Vector256 right) => left * right; /// @@ -2031,6 +2054,7 @@ public static Vector256 Narrow(Vector256 lower, Vector256 up /// The vector to negate. /// A vector whose elements are the negation of the corresponding elements in . /// The type of () is not supported. + [Intrinsic] public static Vector256 Negate(Vector256 vector) => -vector; /// Computes the ones-complement of a vector. @@ -2038,6 +2062,7 @@ public static Vector256 Narrow(Vector256 lower, Vector256 up /// The vector whose ones-complement is to be computed. /// A vector whose elements are the ones-complement of the corresponding elements in . /// The type of () is not supported. + [Intrinsic] public static Vector256 OnesComplement(Vector256 vector) { return Create( @@ -2050,42 +2075,49 @@ public static Vector256 OnesComplement(Vector256 vector) /// The vector whose elements are to be shifted. /// The number of bits by which to shift each element. /// A vector whose elements where shifted left by . + [Intrinsic] internal static Vector256 ShiftLeft(Vector256 vector, int shiftCount) => vector << shiftCount; /// Shifts each element of a vector left by the specified amount. /// The vector whose elements are to be shifted. /// The number of bits by which to shift each element. /// A vector whose elements where shifted left by . + [Intrinsic] public static Vector256 ShiftLeft(Vector256 vector, int shiftCount) => vector << shiftCount; /// Shifts each element of a vector left by the specified amount. /// The vector whose elements are to be shifted. /// The number of bits by which to shift each element. /// A vector whose elements where shifted left by . + [Intrinsic] public static Vector256 ShiftLeft(Vector256 vector, int shiftCount) => vector << shiftCount; /// Shifts each element of a vector left by the specified amount. /// The vector whose elements are to be shifted. /// The number of bits by which to shift each element. /// A vector whose elements where shifted left by . + [Intrinsic] public static Vector256 ShiftLeft(Vector256 vector, int shiftCount) => vector << shiftCount; /// Shifts each element of a vector left by the specified amount. /// The vector whose elements are to be shifted. /// The number of bits by which to shift each element. /// A vector whose elements where shifted left by . + [Intrinsic] public static Vector256 ShiftLeft(Vector256 vector, int shiftCount) => vector << shiftCount; /// Shifts each element of a vector left by the specified amount. /// The vector whose elements are to be shifted. /// The number of bits by which to shift each element. /// A vector whose elements where shifted left by . + [Intrinsic] public static Vector256 ShiftLeft(Vector256 vector, int shiftCount) => vector << shiftCount; /// Shifts each element of a vector left by the specified amount. /// The vector whose elements are to be shifted. /// The number of bits by which to shift each element. /// A vector whose elements where shifted left by . + [Intrinsic] [CLSCompliant(false)] public static Vector256 ShiftLeft(Vector256 vector, int shiftCount) => vector << shiftCount; @@ -2093,6 +2125,7 @@ public static Vector256 OnesComplement(Vector256 vector) /// The vector whose elements are to be shifted. /// The number of bits by which to shift each element. /// A vector whose elements where shifted left by . + [Intrinsic] [CLSCompliant(false)] public static Vector256 ShiftLeft(Vector256 vector, int shiftCount) => vector << shiftCount; @@ -2100,6 +2133,7 @@ public static Vector256 OnesComplement(Vector256 vector) /// The vector whose elements are to be shifted. /// The number of bits by which to shift each element. /// A vector whose elements where shifted left by . + [Intrinsic] [CLSCompliant(false)] public static Vector256 ShiftLeft(Vector256 vector, int shiftCount) => vector << shiftCount; @@ -2107,6 +2141,7 @@ public static Vector256 OnesComplement(Vector256 vector) /// The vector whose elements are to be shifted. /// The number of bits by which to shift each element. /// A vector whose elements where shifted left by . + [Intrinsic] [CLSCompliant(false)] public static Vector256 ShiftLeft(Vector256 vector, int shiftCount) => vector << shiftCount; @@ -2114,6 +2149,7 @@ public static Vector256 OnesComplement(Vector256 vector) /// The vector whose elements are to be shifted. /// The number of bits by which to shift each element. /// A vector whose elements where shifted left by . + [Intrinsic] [CLSCompliant(false)] public static Vector256 ShiftLeft(Vector256 vector, int shiftCount) => vector << shiftCount; @@ -2121,36 +2157,42 @@ public static Vector256 OnesComplement(Vector256 vector) /// The vector whose elements are to be shifted. /// The number of bits by which to shift each element. /// A vector whose elements where shifted right by . + [Intrinsic] internal static Vector256 ShiftRightArithmetic(Vector256 vector, int shiftCount) => vector >> shiftCount; /// Shifts (signed) each element of a vector right by the specified amount. /// The vector whose elements are to be shifted. /// The number of bits by which to shift each element. /// A vector whose elements where shifted right by . + [Intrinsic] public static Vector256 ShiftRightArithmetic(Vector256 vector, int shiftCount) => vector >> shiftCount; /// Shifts (signed) each element of a vector right by the specified amount. /// The vector whose elements are to be shifted. /// The number of bits by which to shift each element. /// A vector whose elements where shifted right by . + [Intrinsic] public static Vector256 ShiftRightArithmetic(Vector256 vector, int shiftCount) => vector >> shiftCount; /// Shifts (signed) each element of a vector right by the specified amount. /// The vector whose elements are to be shifted. /// The number of bits by which to shift each element. /// A vector whose elements where shifted right by . + [Intrinsic] public static Vector256 ShiftRightArithmetic(Vector256 vector, int shiftCount) => vector >> shiftCount; /// Shifts (signed) each element of a vector right by the specified amount. /// The vector whose elements are to be shifted. /// The number of bits by which to shift each element. /// A vector whose elements where shifted right by . + [Intrinsic] public static Vector256 ShiftRightArithmetic(Vector256 vector, int shiftCount) => vector >> shiftCount; /// Shifts (signed) each element of a vector right by the specified amount. /// The vector whose elements are to be shifted. /// The number of bits by which to shift each element. /// A vector whose elements where shifted right by . + [Intrinsic] [CLSCompliant(false)] public static Vector256 ShiftRightArithmetic(Vector256 vector, int shiftCount) => vector >> shiftCount; @@ -2158,42 +2200,49 @@ public static Vector256 OnesComplement(Vector256 vector) /// The vector whose elements are to be shifted. /// The number of bits by which to shift each element. /// A vector whose elements where shifted right by . + [Intrinsic] internal static Vector256 ShiftRightLogical(Vector256 vector, int shiftCount) => vector >>> shiftCount; /// Shifts (unsigned) each element of a vector right by the specified amount. /// The vector whose elements are to be shifted. /// The number of bits by which to shift each element. /// A vector whose elements where shifted right by . + [Intrinsic] public static Vector256 ShiftRightLogical(Vector256 vector, int shiftCount) => vector >>> shiftCount; /// Shifts (unsigned) each element of a vector right by the specified amount. /// The vector whose elements are to be shifted. /// The number of bits by which to shift each element. /// A vector whose elements where shifted right by . + [Intrinsic] public static Vector256 ShiftRightLogical(Vector256 vector, int shiftCount) => vector >>> shiftCount; /// Shifts (unsigned) each element of a vector right by the specified amount. /// The vector whose elements are to be shifted. /// The number of bits by which to shift each element. /// A vector whose elements where shifted right by . + [Intrinsic] public static Vector256 ShiftRightLogical(Vector256 vector, int shiftCount) => vector >>> shiftCount; /// Shifts (unsigned) each element of a vector right by the specified amount. /// The vector whose elements are to be shifted. /// The number of bits by which to shift each element. /// A vector whose elements where shifted right by . + [Intrinsic] public static Vector256 ShiftRightLogical(Vector256 vector, int shiftCount) => vector >>> shiftCount; /// Shifts (unsigned) each element of a vector right by the specified amount. /// The vector whose elements are to be shifted. /// The number of bits by which to shift each element. /// A vector whose elements where shifted right by . + [Intrinsic] public static Vector256 ShiftRightLogical(Vector256 vector, int shiftCount) => vector >>> shiftCount; /// Shifts (unsigned) each element of a vector right by the specified amount. /// The vector whose elements are to be shifted. /// The number of bits by which to shift each element. /// A vector whose elements where shifted right by . + [Intrinsic] [CLSCompliant(false)] public static Vector256 ShiftRightLogical(Vector256 vector, int shiftCount) => vector >>> shiftCount; @@ -2201,6 +2250,7 @@ public static Vector256 OnesComplement(Vector256 vector) /// The vector whose elements are to be shifted. /// The number of bits by which to shift each element. /// A vector whose elements where shifted right by . + [Intrinsic] [CLSCompliant(false)] public static Vector256 ShiftRightLogical(Vector256 vector, int shiftCount) => vector >>> shiftCount; @@ -2208,6 +2258,7 @@ public static Vector256 OnesComplement(Vector256 vector) /// The vector whose elements are to be shifted. /// The number of bits by which to shift each element. /// A vector whose elements where shifted right by . + [Intrinsic] [CLSCompliant(false)] public static Vector256 ShiftRightLogical(Vector256 vector, int shiftCount) => vector >>> shiftCount; @@ -2215,6 +2266,7 @@ public static Vector256 OnesComplement(Vector256 vector) /// The vector whose elements are to be shifted. /// The number of bits by which to shift each element. /// A vector whose elements where shifted right by . + [Intrinsic] [CLSCompliant(false)] public static Vector256 ShiftRightLogical(Vector256 vector, int shiftCount) => vector >>> shiftCount; @@ -2222,6 +2274,7 @@ public static Vector256 OnesComplement(Vector256 vector) /// The vector whose elements are to be shifted. /// The number of bits by which to shift each element. /// A vector whose elements where shifted right by . + [Intrinsic] [CLSCompliant(false)] public static Vector256 ShiftRightLogical(Vector256 vector, int shiftCount) => vector >>> shiftCount; @@ -2490,6 +2543,7 @@ public static Vector256 Sqrt(Vector256 vector) /// The vector that will be stored. /// The destination at which will be stored. /// The type of and () is not supported. + [Intrinsic] [CLSCompliant(false)] public static void Store(this Vector256 source, T* destination) => source.StoreUnsafe(ref *destination); @@ -2560,6 +2614,7 @@ public static void StoreUnsafe(this Vector256 source, ref T destination, n /// The type of the elements in the vector. /// The difference of and . /// The type of and () is not supported. + [Intrinsic] public static Vector256 Subtract(Vector256 left, Vector256 right) => left - right; /// Computes the sum of all elements in a vector. @@ -2967,6 +3022,7 @@ public static Vector256 WithUpper(this Vector256 vector, Vector128 v /// The vector to exclusive-or with . /// The exclusive-or of and . /// The type of and () is not supported. + [Intrinsic] public static Vector256 Xor(Vector256 left, Vector256 right) => left ^ right; [MethodImpl(MethodImplOptions.AggressiveInlining)] diff --git a/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Vector256_1.cs b/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Vector256_1.cs index bc5e052448f4fb..36b704682d3202 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Vector256_1.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Vector256_1.cs @@ -112,6 +112,7 @@ public static Vector256 One /// The type of the vector () is not supported. public static Vector256 Zero { + [Intrinsic] get { ThrowHelper.ThrowForUnsupportedIntrinsicsVector256BaseType(); @@ -351,6 +352,7 @@ public static Vector256 operator >>(Vector256 value, int shiftCount) /// The vector. /// /// The type of the vector () is not supported. + [Intrinsic] public static Vector256 operator +(Vector256 value) { ThrowHelper.ThrowForUnsupportedIntrinsicsVector256BaseType(); diff --git a/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Vector512.cs b/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Vector512.cs index 39e47372577c74..3e4b9b8af27f28 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Vector512.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Vector512.cs @@ -74,6 +74,7 @@ public static Vector512 Abs(Vector512 vector) /// The vector to add with . /// The sum of and . /// The type of and () is not supported. + [Intrinsic] public static Vector512 Add(Vector512 left, Vector512 right) => left + right; /// Computes the bitwise-and of a given vector and the ones complement of another vector. @@ -98,6 +99,7 @@ public static Vector512 AndNot(Vector512 left, Vector512 right) /// The vector to reinterpret. /// reinterpreted as a new . /// The type of () or the type of the target () is not supported. + [Intrinsic] [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector512 As(this Vector512 vector) { @@ -112,6 +114,7 @@ public static Vector512 As(this Vector512 vector) /// The vector to reinterpret. /// reinterpreted as a new . /// The type of () is not supported. + [Intrinsic] public static Vector512 AsByte(this Vector512 vector) => vector.As(); /// Reinterprets a as a new . @@ -119,6 +122,7 @@ public static Vector512 As(this Vector512 vector) /// The vector to reinterpret. /// reinterpreted as a new . /// The type of () is not supported. + [Intrinsic] public static Vector512 AsDouble(this Vector512 vector) => vector.As(); /// Reinterprets a as a new . @@ -126,6 +130,7 @@ public static Vector512 As(this Vector512 vector) /// The vector to reinterpret. /// reinterpreted as a new . /// The type of () is not supported. + [Intrinsic] public static Vector512 AsInt16(this Vector512 vector) => vector.As(); /// Reinterprets a as a new . @@ -133,6 +138,7 @@ public static Vector512 As(this Vector512 vector) /// The vector to reinterpret. /// reinterpreted as a new . /// The type of () is not supported. + [Intrinsic] public static Vector512 AsInt32(this Vector512 vector) => vector.As(); /// Reinterprets a as a new . @@ -140,6 +146,7 @@ public static Vector512 As(this Vector512 vector) /// The vector to reinterpret. /// reinterpreted as a new . /// The type of () is not supported. + [Intrinsic] public static Vector512 AsInt64(this Vector512 vector) => vector.As(); /// Reinterprets a as a new . @@ -147,6 +154,7 @@ public static Vector512 As(this Vector512 vector) /// The vector to reinterpret. /// reinterpreted as a new . /// The type of () is not supported. + [Intrinsic] public static Vector512 AsNInt(this Vector512 vector) => vector.As(); /// Reinterprets a as a new . @@ -154,6 +162,7 @@ public static Vector512 As(this Vector512 vector) /// The vector to reinterpret. /// reinterpreted as a new . /// The type of () is not supported. + [Intrinsic] [CLSCompliant(false)] public static Vector512 AsNUInt(this Vector512 vector) => vector.As(); @@ -162,6 +171,7 @@ public static Vector512 As(this Vector512 vector) /// The vector to reinterpret. /// reinterpreted as a new . /// The type of () is not supported. + [Intrinsic] [CLSCompliant(false)] public static Vector512 AsSByte(this Vector512 vector) => vector.As(); @@ -170,6 +180,7 @@ public static Vector512 As(this Vector512 vector) /// The vector to reinterpret. /// reinterpreted as a new . /// The type of () is not supported. + [Intrinsic] public static Vector512 AsSingle(this Vector512 vector) => vector.As(); /// Reinterprets a as a new . @@ -177,6 +188,7 @@ public static Vector512 As(this Vector512 vector) /// The vector to reinterpret. /// reinterpreted as a new . /// The type of () is not supported. + [Intrinsic] [CLSCompliant(false)] public static Vector512 AsUInt16(this Vector512 vector) => vector.As(); @@ -185,6 +197,7 @@ public static Vector512 As(this Vector512 vector) /// The vector to reinterpret. /// reinterpreted as a new . /// The type of () is not supported. + [Intrinsic] [CLSCompliant(false)] public static Vector512 AsUInt32(this Vector512 vector) => vector.As(); @@ -193,6 +206,7 @@ public static Vector512 As(this Vector512 vector) /// The vector to reinterpret. /// reinterpreted as a new . /// The type of () is not supported. + [Intrinsic] [CLSCompliant(false)] public static Vector512 AsUInt64(this Vector512 vector) => vector.As(); @@ -235,6 +249,7 @@ public static Vector AsVector(this Vector512 value) /// The vector to bitwise-and with . /// The bitwise-and of and . /// The type of and () is not supported. + [Intrinsic] public static Vector512 BitwiseAnd(Vector512 left, Vector512 right) => left & right; /// Computes the bitwise-or of two vectors. @@ -243,6 +258,7 @@ public static Vector AsVector(this Vector512 value) /// The vector to bitwise-or with . /// The bitwise-or of and . /// The type of and () is not supported. + [Intrinsic] public static Vector512 BitwiseOr(Vector512 left, Vector512 right) => left | right; /// Computes the ceiling of each element in a vector. @@ -1368,6 +1384,7 @@ public static Vector512 CreateScalarUnsafe(T value) /// The vector that will divide . /// The quotient of divided by . /// The type of and () is not supported. + [Intrinsic] [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector512 Divide(Vector512 left, Vector512 right) { @@ -1382,6 +1399,7 @@ public static Vector512 Divide(Vector512 left, Vector512 right) /// The scalar that will divide . /// The type of the elements in the vector. /// The quotient of divided by . + [Intrinsic] public static Vector512 Divide(Vector512 left, T right) => left / right; /// Computes the dot product of two vectors. @@ -1425,6 +1443,7 @@ public static Vector512 Equals(Vector512 left, Vector512 right) /// The type of the elements in the vector. /// true if all elements in were equal to the corresponding element in . /// The type of and () is not supported. + [Intrinsic] public static bool EqualsAll(Vector512 left, Vector512 right) => left == right; /// Compares two vectors to determine if any elements are equal. @@ -1764,6 +1783,7 @@ public static bool LessThanOrEqualAny(Vector512 left, Vector512 right) /// The source from which the vector will be loaded. /// The vector loaded from . /// The type of () is not supported. + [Intrinsic] [CLSCompliant(false)] public static Vector512 Load(T* source) => LoadUnsafe(ref *source); @@ -1945,6 +1965,7 @@ public static Vector512 Min(Vector512 left, Vector512 right) /// The vector to multiply with . /// The element-wise product of and . /// The type of and () is not supported. + [Intrinsic] public static Vector512 Multiply(Vector512 left, Vector512 right) => left * right; /// Multiplies a vector by a scalar to compute their product. @@ -1953,6 +1974,7 @@ public static Vector512 Min(Vector512 left, Vector512 right) /// The scalar to multiply with . /// The product of and . /// The type of and () is not supported. + [Intrinsic] public static Vector512 Multiply(Vector512 left, T right) => left * right; /// Multiplies a vector by a scalar to compute their product. @@ -1961,6 +1983,7 @@ public static Vector512 Min(Vector512 left, Vector512 right) /// The vector to multiply with . /// The product of and . /// The type of and () is not supported. + [Intrinsic] public static Vector512 Multiply(T left, Vector512 right) => left * right; /// @@ -2091,6 +2114,7 @@ public static Vector512 Narrow(Vector512 lower, Vector512 up /// The vector to negate. /// A vector whose elements are the negation of the corresponding elements in . /// The type of () is not supported. + [Intrinsic] public static Vector512 Negate(Vector512 vector) => -vector; /// Computes the ones-complement of a vector. @@ -2098,6 +2122,7 @@ public static Vector512 Narrow(Vector512 lower, Vector512 up /// The vector whose ones-complement is to be computed. /// A vector whose elements are the ones-complement of the corresponding elements in . /// The type of () is not supported. + [Intrinsic] public static Vector512 OnesComplement(Vector512 vector) { return Create( @@ -2110,42 +2135,49 @@ public static Vector512 OnesComplement(Vector512 vector) /// The vector whose elements are to be shifted. /// The number of bits by which to shift each element. /// A vector whose elements where shifted left by . + [Intrinsic] internal static Vector512 ShiftLeft(Vector512 vector, int shiftCount) => vector << shiftCount; /// Shifts each element of a vector left by the specified amount. /// The vector whose elements are to be shifted. /// The number of bits by which to shift each element. /// A vector whose elements where shifted left by . + [Intrinsic] public static Vector512 ShiftLeft(Vector512 vector, int shiftCount) => vector << shiftCount; /// Shifts each element of a vector left by the specified amount. /// The vector whose elements are to be shifted. /// The number of bits by which to shift each element. /// A vector whose elements where shifted left by . + [Intrinsic] public static Vector512 ShiftLeft(Vector512 vector, int shiftCount) => vector << shiftCount; /// Shifts each element of a vector left by the specified amount. /// The vector whose elements are to be shifted. /// The number of bits by which to shift each element. /// A vector whose elements where shifted left by . + [Intrinsic] public static Vector512 ShiftLeft(Vector512 vector, int shiftCount) => vector << shiftCount; /// Shifts each element of a vector left by the specified amount. /// The vector whose elements are to be shifted. /// The number of bits by which to shift each element. /// A vector whose elements where shifted left by . + [Intrinsic] public static Vector512 ShiftLeft(Vector512 vector, int shiftCount) => vector << shiftCount; /// Shifts each element of a vector left by the specified amount. /// The vector whose elements are to be shifted. /// The number of bits by which to shift each element. /// A vector whose elements where shifted left by . + [Intrinsic] public static Vector512 ShiftLeft(Vector512 vector, int shiftCount) => vector << shiftCount; /// Shifts each element of a vector left by the specified amount. /// The vector whose elements are to be shifted. /// The number of bits by which to shift each element. /// A vector whose elements where shifted left by . + [Intrinsic] [CLSCompliant(false)] public static Vector512 ShiftLeft(Vector512 vector, int shiftCount) => vector << shiftCount; @@ -2153,6 +2185,7 @@ public static Vector512 OnesComplement(Vector512 vector) /// The vector whose elements are to be shifted. /// The number of bits by which to shift each element. /// A vector whose elements where shifted left by . + [Intrinsic] [CLSCompliant(false)] public static Vector512 ShiftLeft(Vector512 vector, int shiftCount) => vector << shiftCount; @@ -2160,6 +2193,7 @@ public static Vector512 OnesComplement(Vector512 vector) /// The vector whose elements are to be shifted. /// The number of bits by which to shift each element. /// A vector whose elements where shifted left by . + [Intrinsic] [CLSCompliant(false)] public static Vector512 ShiftLeft(Vector512 vector, int shiftCount) => vector << shiftCount; @@ -2167,6 +2201,7 @@ public static Vector512 OnesComplement(Vector512 vector) /// The vector whose elements are to be shifted. /// The number of bits by which to shift each element. /// A vector whose elements where shifted left by . + [Intrinsic] [CLSCompliant(false)] public static Vector512 ShiftLeft(Vector512 vector, int shiftCount) => vector << shiftCount; @@ -2174,6 +2209,7 @@ public static Vector512 OnesComplement(Vector512 vector) /// The vector whose elements are to be shifted. /// The number of bits by which to shift each element. /// A vector whose elements where shifted left by . + [Intrinsic] [CLSCompliant(false)] public static Vector512 ShiftLeft(Vector512 vector, int shiftCount) => vector << shiftCount; @@ -2181,36 +2217,42 @@ public static Vector512 OnesComplement(Vector512 vector) /// The vector whose elements are to be shifted. /// The number of bits by which to shift each element. /// A vector whose elements where shifted right by . + [Intrinsic] internal static Vector512 ShiftRightArithmetic(Vector512 vector, int shiftCount) => vector >> shiftCount; /// Shifts (signed) each element of a vector right by the specified amount. /// The vector whose elements are to be shifted. /// The number of bits by which to shift each element. /// A vector whose elements where shifted right by . + [Intrinsic] public static Vector512 ShiftRightArithmetic(Vector512 vector, int shiftCount) => vector >> shiftCount; /// Shifts (signed) each element of a vector right by the specified amount. /// The vector whose elements are to be shifted. /// The number of bits by which to shift each element. /// A vector whose elements where shifted right by . + [Intrinsic] public static Vector512 ShiftRightArithmetic(Vector512 vector, int shiftCount) => vector >> shiftCount; /// Shifts (signed) each element of a vector right by the specified amount. /// The vector whose elements are to be shifted. /// The number of bits by which to shift each element. /// A vector whose elements where shifted right by . + [Intrinsic] public static Vector512 ShiftRightArithmetic(Vector512 vector, int shiftCount) => vector >> shiftCount; /// Shifts (signed) each element of a vector right by the specified amount. /// The vector whose elements are to be shifted. /// The number of bits by which to shift each element. /// A vector whose elements where shifted right by . + [Intrinsic] public static Vector512 ShiftRightArithmetic(Vector512 vector, int shiftCount) => vector >> shiftCount; /// Shifts (signed) each element of a vector right by the specified amount. /// The vector whose elements are to be shifted. /// The number of bits by which to shift each element. /// A vector whose elements where shifted right by . + [Intrinsic] [CLSCompliant(false)] public static Vector512 ShiftRightArithmetic(Vector512 vector, int shiftCount) => vector >> shiftCount; @@ -2218,42 +2260,49 @@ public static Vector512 OnesComplement(Vector512 vector) /// The vector whose elements are to be shifted. /// The number of bits by which to shift each element. /// A vector whose elements where shifted right by . + [Intrinsic] internal static Vector512 ShiftRightLogical(Vector512 vector, int shiftCount) => vector >>> shiftCount; /// Shifts (unsigned) each element of a vector right by the specified amount. /// The vector whose elements are to be shifted. /// The number of bits by which to shift each element. /// A vector whose elements where shifted right by . + [Intrinsic] public static Vector512 ShiftRightLogical(Vector512 vector, int shiftCount) => vector >>> shiftCount; /// Shifts (unsigned) each element of a vector right by the specified amount. /// The vector whose elements are to be shifted. /// The number of bits by which to shift each element. /// A vector whose elements where shifted right by . + [Intrinsic] public static Vector512 ShiftRightLogical(Vector512 vector, int shiftCount) => vector >>> shiftCount; /// Shifts (unsigned) each element of a vector right by the specified amount. /// The vector whose elements are to be shifted. /// The number of bits by which to shift each element. /// A vector whose elements where shifted right by . + [Intrinsic] public static Vector512 ShiftRightLogical(Vector512 vector, int shiftCount) => vector >>> shiftCount; /// Shifts (unsigned) each element of a vector right by the specified amount. /// The vector whose elements are to be shifted. /// The number of bits by which to shift each element. /// A vector whose elements where shifted right by . + [Intrinsic] public static Vector512 ShiftRightLogical(Vector512 vector, int shiftCount) => vector >>> shiftCount; /// Shifts (unsigned) each element of a vector right by the specified amount. /// The vector whose elements are to be shifted. /// The number of bits by which to shift each element. /// A vector whose elements where shifted right by . + [Intrinsic] public static Vector512 ShiftRightLogical(Vector512 vector, int shiftCount) => vector >>> shiftCount; /// Shifts (unsigned) each element of a vector right by the specified amount. /// The vector whose elements are to be shifted. /// The number of bits by which to shift each element. /// A vector whose elements where shifted right by . + [Intrinsic] [CLSCompliant(false)] public static Vector512 ShiftRightLogical(Vector512 vector, int shiftCount) => vector >>> shiftCount; @@ -2261,6 +2310,7 @@ public static Vector512 OnesComplement(Vector512 vector) /// The vector whose elements are to be shifted. /// The number of bits by which to shift each element. /// A vector whose elements where shifted right by . + [Intrinsic] [CLSCompliant(false)] public static Vector512 ShiftRightLogical(Vector512 vector, int shiftCount) => vector >>> shiftCount; @@ -2268,6 +2318,7 @@ public static Vector512 OnesComplement(Vector512 vector) /// The vector whose elements are to be shifted. /// The number of bits by which to shift each element. /// A vector whose elements where shifted right by . + [Intrinsic] [CLSCompliant(false)] public static Vector512 ShiftRightLogical(Vector512 vector, int shiftCount) => vector >>> shiftCount; @@ -2275,6 +2326,7 @@ public static Vector512 OnesComplement(Vector512 vector) /// The vector whose elements are to be shifted. /// The number of bits by which to shift each element. /// A vector whose elements where shifted right by . + [Intrinsic] [CLSCompliant(false)] public static Vector512 ShiftRightLogical(Vector512 vector, int shiftCount) => vector >>> shiftCount; @@ -2282,6 +2334,7 @@ public static Vector512 OnesComplement(Vector512 vector) /// The vector whose elements are to be shifted. /// The number of bits by which to shift each element. /// A vector whose elements where shifted right by . + [Intrinsic] [CLSCompliant(false)] public static Vector512 ShiftRightLogical(Vector512 vector, int shiftCount) => vector >>> shiftCount; @@ -2550,6 +2603,7 @@ public static Vector512 Sqrt(Vector512 vector) /// The vector that will be stored. /// The destination at which will be stored. /// The type of and () is not supported. + [Intrinsic] [CLSCompliant(false)] public static void Store(this Vector512 source, T* destination) => source.StoreUnsafe(ref *destination); @@ -2620,6 +2674,7 @@ public static void StoreUnsafe(this Vector512 source, ref T destination, n /// The type of the elements in the vector. /// The difference of and . /// The type of and () is not supported. + [Intrinsic] public static Vector512 Subtract(Vector512 left, Vector512 right) => left - right; /// Computes the sum of all elements in a vector. @@ -2993,6 +3048,7 @@ public static Vector512 WithUpper(this Vector512 vector, Vector256 v /// The vector to exclusive-or with . /// The exclusive-or of and . /// The type of and () is not supported. + [Intrinsic] public static Vector512 Xor(Vector512 left, Vector512 right) => left ^ right; [MethodImpl(MethodImplOptions.AggressiveInlining)] diff --git a/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Vector512_1.cs b/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Vector512_1.cs index db9c75fa084351..235871dbe6069b 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Vector512_1.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Vector512_1.cs @@ -112,6 +112,7 @@ public static Vector512 One /// The type of the vector () is not supported. public static Vector512 Zero { + [Intrinsic] get { ThrowHelper.ThrowForUnsupportedIntrinsicsVector512BaseType(); @@ -351,6 +352,7 @@ public static Vector512 operator >>(Vector512 value, int shiftCount) /// The vector. /// /// The type of the vector () is not supported. + [Intrinsic] public static Vector512 operator +(Vector512 value) { ThrowHelper.ThrowForUnsupportedIntrinsicsVector512BaseType(); diff --git a/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Vector64.cs b/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Vector64.cs index 081f56cf857905..0b0e7787c0e413 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Vector64.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Vector64.cs @@ -64,6 +64,7 @@ public static Vector64 Abs(Vector64 vector) /// The vector to add with . /// The sum of and . /// The type of and () is not supported. + [Intrinsic] public static Vector64 Add(Vector64 left, Vector64 right) => left + right; /// Computes the bitwise-and of a given vector and the ones complement of another vector. @@ -81,6 +82,7 @@ public static Vector64 Abs(Vector64 vector) /// The vector to reinterpret. /// reinterpreted as a new . /// The type of () or the type of the target () is not supported. + [Intrinsic] [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector64 As(this Vector64 vector) { @@ -95,6 +97,7 @@ public static Vector64 As(this Vector64 vector) /// The vector to reinterpret. /// reinterpreted as a new . /// The type of () is not supported. + [Intrinsic] public static Vector64 AsByte(this Vector64 vector) => vector.As(); /// Reinterprets a as a new . @@ -102,6 +105,7 @@ public static Vector64 As(this Vector64 vector) /// The vector to reinterpret. /// reinterpreted as a new . /// The type of () is not supported. + [Intrinsic] public static Vector64 AsDouble(this Vector64 vector) => vector.As(); /// Reinterprets a as a new . @@ -109,6 +113,7 @@ public static Vector64 As(this Vector64 vector) /// The vector to reinterpret. /// reinterpreted as a new . /// The type of () is not supported. + [Intrinsic] public static Vector64 AsInt16(this Vector64 vector) => vector.As(); /// Reinterprets a as a new . @@ -116,6 +121,7 @@ public static Vector64 As(this Vector64 vector) /// The vector to reinterpret. /// reinterpreted as a new . /// The type of () is not supported. + [Intrinsic] public static Vector64 AsInt32(this Vector64 vector) => vector.As(); /// Reinterprets a as a new . @@ -123,6 +129,7 @@ public static Vector64 As(this Vector64 vector) /// The vector to reinterpret. /// reinterpreted as a new . /// The type of () is not supported. + [Intrinsic] public static Vector64 AsInt64(this Vector64 vector) => vector.As(); /// Reinterprets a as a new . @@ -130,6 +137,7 @@ public static Vector64 As(this Vector64 vector) /// The vector to reinterpret. /// reinterpreted as a new . /// The type of () is not supported. + [Intrinsic] public static Vector64 AsNInt(this Vector64 vector) => vector.As(); /// Reinterprets a as a new . @@ -137,6 +145,7 @@ public static Vector64 As(this Vector64 vector) /// The vector to reinterpret. /// reinterpreted as a new . /// The type of () is not supported. + [Intrinsic] [CLSCompliant(false)] public static Vector64 AsNUInt(this Vector64 vector) => vector.As(); @@ -145,6 +154,7 @@ public static Vector64 As(this Vector64 vector) /// The vector to reinterpret. /// reinterpreted as a new . /// The type of () is not supported. + [Intrinsic] [CLSCompliant(false)] public static Vector64 AsSByte(this Vector64 vector) => vector.As(); @@ -153,6 +163,7 @@ public static Vector64 As(this Vector64 vector) /// The vector to reinterpret. /// reinterpreted as a new . /// The type of () is not supported. + [Intrinsic] public static Vector64 AsSingle(this Vector64 vector) => vector.As(); /// Reinterprets a as a new . @@ -160,6 +171,7 @@ public static Vector64 As(this Vector64 vector) /// The vector to reinterpret. /// reinterpreted as a new . /// The type of () is not supported. + [Intrinsic] [CLSCompliant(false)] public static Vector64 AsUInt16(this Vector64 vector) => vector.As(); @@ -168,6 +180,7 @@ public static Vector64 As(this Vector64 vector) /// The vector to reinterpret. /// reinterpreted as a new . /// The type of () is not supported. + [Intrinsic] [CLSCompliant(false)] public static Vector64 AsUInt32(this Vector64 vector) => vector.As(); @@ -176,6 +189,7 @@ public static Vector64 As(this Vector64 vector) /// The vector to reinterpret. /// reinterpreted as a new . /// The type of () is not supported. + [Intrinsic] [CLSCompliant(false)] public static Vector64 AsUInt64(this Vector64 vector) => vector.As(); @@ -185,6 +199,7 @@ public static Vector64 As(this Vector64 vector) /// The vector to bitwise-and with . /// The bitwise-and of and . /// The type of and () is not supported. + [Intrinsic] public static Vector64 BitwiseAnd(Vector64 left, Vector64 right) => left & right; /// Computes the bitwise-or of two vectors. @@ -193,6 +208,7 @@ public static Vector64 As(this Vector64 vector) /// The vector to bitwise-or with . /// The bitwise-or of and . /// The type of and () is not supported. + [Intrinsic] public static Vector64 BitwiseOr(Vector64 left, Vector64 right) => left | right; /// Computes the ceiling of each element in a vector. @@ -1040,6 +1056,7 @@ public static Vector64 CreateScalarUnsafe(T value) /// The vector that will divide . /// The quotient of divided by . /// The type of and () is not supported. + [Intrinsic] public static Vector64 Divide(Vector64 left, Vector64 right) => left / right; /// Divides a vector by a scalar to compute the per-element quotient. @@ -1047,6 +1064,7 @@ public static Vector64 CreateScalarUnsafe(T value) /// The scalar that will divide . /// The type of the elements in the vector. /// The quotient of divided by . + [Intrinsic] public static Vector64 Divide(Vector64 left, T right) => left / right; /// Computes the dot product of two vectors. @@ -1085,6 +1103,7 @@ public static Vector64 Equals(Vector64 left, Vector64 right) /// The vector to compare with . /// true if all elements in were equal to the corresponding element in . /// The type of and () is not supported. + [Intrinsic] public static bool EqualsAll(Vector64 left, Vector64 right) => left == right; /// Compares two vectors to determine if any elements are equal. @@ -1548,6 +1567,7 @@ public static bool LessThanOrEqualAny(Vector64 left, Vector64 right) /// The source from which the vector will be loaded. /// The vector loaded from . /// The type of () is not supported. + [Intrinsic] [CLSCompliant(false)] public static unsafe Vector64 Load(T* source) => LoadUnsafe(ref *source); @@ -1752,6 +1772,7 @@ public static Vector64 Min(Vector64 left, Vector64 right) /// The vector to multiply with . /// The element-wise product of and . /// The type of and () is not supported. + [Intrinsic] public static Vector64 Multiply(Vector64 left, Vector64 right) => left * right; /// Multiplies a vector by a scalar to compute their product. @@ -1760,6 +1781,7 @@ public static Vector64 Min(Vector64 left, Vector64 right) /// The scalar to multiply with . /// The product of and . /// The type of and () is not supported. + [Intrinsic] public static Vector64 Multiply(Vector64 left, T right) => left * right; /// Multiplies a vector by a scalar to compute their product. @@ -1768,6 +1790,7 @@ public static Vector64 Min(Vector64 left, Vector64 right) /// The vector to multiply with . /// The product of and . /// The type of and () is not supported. + [Intrinsic] public static Vector64 Multiply(T left, Vector64 right) => left * right; /// Computes an estimate of ( * ) + . @@ -2002,6 +2025,7 @@ public static unsafe Vector64 Narrow(Vector64 lower, Vector64The vector to negate. /// A vector whose elements are the negation of the corresponding elements in . /// The type of () is not supported. + [Intrinsic] public static Vector64 Negate(Vector64 vector) => -vector; /// Computes the ones-complement of a vector. @@ -2009,48 +2033,56 @@ public static unsafe Vector64 Narrow(Vector64 lower, Vector64The vector whose ones-complement is to be computed. /// A vector whose elements are the ones-complement of the corresponding elements in . /// The type of () is not supported. + [Intrinsic] public static Vector64 OnesComplement(Vector64 vector) => ~vector; /// Shifts each element of a vector left by the specified amount. /// The vector whose elements are to be shifted. /// The number of bits by which to shift each element. /// A vector whose elements where shifted left by . + [Intrinsic] internal static Vector64 ShiftLeft(Vector64 vector, int shiftCount) => vector << shiftCount; /// Shifts each element of a vector left by the specified amount. /// The vector whose elements are to be shifted. /// The number of bits by which to shift each element. /// A vector whose elements where shifted left by . + [Intrinsic] public static Vector64 ShiftLeft(Vector64 vector, int shiftCount) => vector << shiftCount; /// Shifts each element of a vector left by the specified amount. /// The vector whose elements are to be shifted. /// The number of bits by which to shift each element. /// A vector whose elements where shifted left by . + [Intrinsic] public static Vector64 ShiftLeft(Vector64 vector, int shiftCount) => vector << shiftCount; /// Shifts each element of a vector left by the specified amount. /// The vector whose elements are to be shifted. /// The number of bits by which to shift each element. /// A vector whose elements where shifted left by . + [Intrinsic] public static Vector64 ShiftLeft(Vector64 vector, int shiftCount) => vector << shiftCount; /// Shifts each element of a vector left by the specified amount. /// The vector whose elements are to be shifted. /// The number of bits by which to shift each element. /// A vector whose elements where shifted left by . + [Intrinsic] public static Vector64 ShiftLeft(Vector64 vector, int shiftCount) => vector << shiftCount; /// Shifts each element of a vector left by the specified amount. /// The vector whose elements are to be shifted. /// The number of bits by which to shift each element. /// A vector whose elements where shifted left by . + [Intrinsic] public static Vector64 ShiftLeft(Vector64 vector, int shiftCount) => vector << shiftCount; /// Shifts each element of a vector left by the specified amount. /// The vector whose elements are to be shifted. /// The number of bits by which to shift each element. /// A vector whose elements where shifted left by . + [Intrinsic] [CLSCompliant(false)] public static Vector64 ShiftLeft(Vector64 vector, int shiftCount) => vector << shiftCount; @@ -2058,6 +2090,7 @@ public static unsafe Vector64 Narrow(Vector64 lower, Vector64The vector whose elements are to be shifted. /// The number of bits by which to shift each element. /// A vector whose elements where shifted left by . + [Intrinsic] [CLSCompliant(false)] public static Vector64 ShiftLeft(Vector64 vector, int shiftCount) => vector << shiftCount; @@ -2065,6 +2098,7 @@ public static unsafe Vector64 Narrow(Vector64 lower, Vector64The vector whose elements are to be shifted. /// The number of bits by which to shift each element. /// A vector whose elements where shifted left by . + [Intrinsic] [CLSCompliant(false)] public static Vector64 ShiftLeft(Vector64 vector, int shiftCount) => vector << shiftCount; @@ -2072,6 +2106,7 @@ public static unsafe Vector64 Narrow(Vector64 lower, Vector64The vector whose elements are to be shifted. /// The number of bits by which to shift each element. /// A vector whose elements where shifted left by . + [Intrinsic] [CLSCompliant(false)] public static Vector64 ShiftLeft(Vector64 vector, int shiftCount) => vector << shiftCount; @@ -2079,6 +2114,7 @@ public static unsafe Vector64 Narrow(Vector64 lower, Vector64The vector whose elements are to be shifted. /// The number of bits by which to shift each element. /// A vector whose elements where shifted left by . + [Intrinsic] [CLSCompliant(false)] public static Vector64 ShiftLeft(Vector64 vector, int shiftCount) => vector << shiftCount; @@ -2086,36 +2122,42 @@ public static unsafe Vector64 Narrow(Vector64 lower, Vector64The vector whose elements are to be shifted. /// The number of bits by which to shift each element. /// A vector whose elements where shifted right by . + [Intrinsic] internal static Vector64 ShiftRightArithmetic(Vector64 vector, int shiftCount) => vector >> shiftCount; /// Shifts (signed) each element of a vector right by the specified amount. /// The vector whose elements are to be shifted. /// The number of bits by which to shift each element. /// A vector whose elements where shifted right by . + [Intrinsic] public static Vector64 ShiftRightArithmetic(Vector64 vector, int shiftCount) => vector >> shiftCount; /// Shifts (signed) each element of a vector right by the specified amount. /// The vector whose elements are to be shifted. /// The number of bits by which to shift each element. /// A vector whose elements where shifted right by . + [Intrinsic] public static Vector64 ShiftRightArithmetic(Vector64 vector, int shiftCount) => vector >> shiftCount; /// Shifts (signed) each element of a vector right by the specified amount. /// The vector whose elements are to be shifted. /// The number of bits by which to shift each element. /// A vector whose elements where shifted right by . + [Intrinsic] public static Vector64 ShiftRightArithmetic(Vector64 vector, int shiftCount) => vector >> shiftCount; /// Shifts (signed) each element of a vector right by the specified amount. /// The vector whose elements are to be shifted. /// The number of bits by which to shift each element. /// A vector whose elements where shifted right by . + [Intrinsic] public static Vector64 ShiftRightArithmetic(Vector64 vector, int shiftCount) => vector >> shiftCount; /// Shifts (signed) each element of a vector right by the specified amount. /// The vector whose elements are to be shifted. /// The number of bits by which to shift each element. /// A vector whose elements where shifted right by . + [Intrinsic] [CLSCompliant(false)] public static Vector64 ShiftRightArithmetic(Vector64 vector, int shiftCount) => vector >> shiftCount; @@ -2123,42 +2165,49 @@ public static unsafe Vector64 Narrow(Vector64 lower, Vector64The vector whose elements are to be shifted. /// The number of bits by which to shift each element. /// A vector whose elements where shifted right by . + [Intrinsic] internal static Vector64 ShiftRightLogical(Vector64 vector, int shiftCount) => vector >>> shiftCount; /// Shifts (unsigned) each element of a vector right by the specified amount. /// The vector whose elements are to be shifted. /// The number of bits by which to shift each element. /// A vector whose elements where shifted right by . + [Intrinsic] public static Vector64 ShiftRightLogical(Vector64 vector, int shiftCount) => vector >>> shiftCount; /// Shifts (unsigned) each element of a vector right by the specified amount. /// The vector whose elements are to be shifted. /// The number of bits by which to shift each element. /// A vector whose elements where shifted right by . + [Intrinsic] public static Vector64 ShiftRightLogical(Vector64 vector, int shiftCount) => vector >>> shiftCount; /// Shifts (unsigned) each element of a vector right by the specified amount. /// The vector whose elements are to be shifted. /// The number of bits by which to shift each element. /// A vector whose elements where shifted right by . + [Intrinsic] public static Vector64 ShiftRightLogical(Vector64 vector, int shiftCount) => vector >>> shiftCount; /// Shifts (unsigned) each element of a vector right by the specified amount. /// The vector whose elements are to be shifted. /// The number of bits by which to shift each element. /// A vector whose elements where shifted right by . + [Intrinsic] public static Vector64 ShiftRightLogical(Vector64 vector, int shiftCount) => vector >>> shiftCount; /// Shifts (unsigned) each element of a vector right by the specified amount. /// The vector whose elements are to be shifted. /// The number of bits by which to shift each element. /// A vector whose elements where shifted right by . + [Intrinsic] public static Vector64 ShiftRightLogical(Vector64 vector, int shiftCount) => vector >>> shiftCount; /// Shifts (unsigned) each element of a vector right by the specified amount. /// The vector whose elements are to be shifted. /// The number of bits by which to shift each element. /// A vector whose elements where shifted right by . + [Intrinsic] [CLSCompliant(false)] public static Vector64 ShiftRightLogical(Vector64 vector, int shiftCount) => vector >>> shiftCount; @@ -2166,6 +2215,7 @@ public static unsafe Vector64 Narrow(Vector64 lower, Vector64The vector whose elements are to be shifted. /// The number of bits by which to shift each element. /// A vector whose elements where shifted right by . + [Intrinsic] [CLSCompliant(false)] public static Vector64 ShiftRightLogical(Vector64 vector, int shiftCount) => vector >>> shiftCount; @@ -2173,6 +2223,7 @@ public static unsafe Vector64 Narrow(Vector64 lower, Vector64The vector whose elements are to be shifted. /// The number of bits by which to shift each element. /// A vector whose elements where shifted right by . + [Intrinsic] [CLSCompliant(false)] public static Vector64 ShiftRightLogical(Vector64 vector, int shiftCount) => vector >>> shiftCount; @@ -2180,6 +2231,7 @@ public static unsafe Vector64 Narrow(Vector64 lower, Vector64The vector whose elements are to be shifted. /// The number of bits by which to shift each element. /// A vector whose elements where shifted right by . + [Intrinsic] [CLSCompliant(false)] public static Vector64 ShiftRightLogical(Vector64 vector, int shiftCount) => vector >>> shiftCount; @@ -2187,6 +2239,7 @@ public static unsafe Vector64 Narrow(Vector64 lower, Vector64The vector whose elements are to be shifted. /// The number of bits by which to shift each element. /// A vector whose elements where shifted right by . + [Intrinsic] [CLSCompliant(false)] public static Vector64 ShiftRightLogical(Vector64 vector, int shiftCount) => vector >>> shiftCount; @@ -2387,6 +2440,7 @@ public static Vector64 Sqrt(Vector64 vector) /// The vector that will be stored. /// The destination at which will be stored. /// The type of () is not supported. + [Intrinsic] [CLSCompliant(false)] public static unsafe void Store(this Vector64 source, T* destination) => source.StoreUnsafe(ref *destination); @@ -2457,6 +2511,7 @@ public static void StoreUnsafe(this Vector64 source, ref T destination, nu /// The vector to subtract from . /// The difference of and . /// The type of and () is not supported. + [Intrinsic] public static Vector64 Subtract(Vector64 left, Vector64 right) => left - right; /// Computes the sum of all elements in a vector. @@ -2877,6 +2932,7 @@ public static Vector64 WithElement(this Vector64 vector, int index, T v /// The vector to exclusive-or with . /// The exclusive-or of and . /// The type of and () is not supported. + [Intrinsic] public static Vector64 Xor(Vector64 left, Vector64 right) => left ^ right; [MethodImpl(MethodImplOptions.AggressiveInlining)] diff --git a/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Vector64_1.cs b/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Vector64_1.cs index d129cf58082b29..23730bb5b00900 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Vector64_1.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Vector64_1.cs @@ -119,6 +119,7 @@ public static Vector64 One /// The type of the vector () is not supported. public static Vector64 Zero { + [Intrinsic] get { ThrowHelper.ThrowForUnsupportedIntrinsicsVector64BaseType(); @@ -405,6 +406,7 @@ public static Vector64 operator >>(Vector64 value, int shiftCount) /// The vector. /// /// The type of the vector () is not supported. + [Intrinsic] public static Vector64 operator +(Vector64 value) { ThrowHelper.ThrowForUnsupportedIntrinsicsVector64BaseType(); From 4dae1fc6dd06b6ae5e8282a94c0f7d1255f37346 Mon Sep 17 00:00:00 2001 From: Tanner Gooding Date: Mon, 3 Jun 2024 15:40:58 -0700 Subject: [PATCH 9/9] Don't use Unsafe.BitCast on Mono --- .../src/System/Numerics/Vector.cs | 4 ++ .../src/System/Numerics/Vector4.Extensions.cs | 20 +++++-- .../System/Runtime/Intrinsics/Vector128.cs | 60 +++++++++++++++++-- .../System/Runtime/Intrinsics/Vector256.cs | 4 ++ .../System/Runtime/Intrinsics/Vector512.cs | 4 ++ .../src/System/Runtime/Intrinsics/Vector64.cs | 4 ++ 6 files changed, 86 insertions(+), 10 deletions(-) diff --git a/src/libraries/System.Private.CoreLib/src/System/Numerics/Vector.cs b/src/libraries/System.Private.CoreLib/src/System/Numerics/Vector.cs index c49154e717246a..41961bbb54c790 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Numerics/Vector.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Numerics/Vector.cs @@ -83,7 +83,11 @@ public static Vector As(this Vector vector) ThrowHelper.ThrowForUnsupportedNumericsVectorBaseType(); ThrowHelper.ThrowForUnsupportedNumericsVectorBaseType(); +#if MONO + return Unsafe.As, Vector>(ref vector); +#else return Unsafe.BitCast, Vector>(vector); +#endif } /// Reinterprets a as a new . diff --git a/src/libraries/System.Private.CoreLib/src/System/Numerics/Vector4.Extensions.cs b/src/libraries/System.Private.CoreLib/src/System/Numerics/Vector4.Extensions.cs index 5fb86e34da7722..5e276425a0e537 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Numerics/Vector4.Extensions.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Numerics/Vector4.Extensions.cs @@ -12,14 +12,26 @@ public static unsafe partial class Vector /// Reinterprets a as a new . /// The vector to reinterpret. /// reinterpreted as a new . - [Intrinsic] - internal static Plane AsPlane(this Vector4 value) => Unsafe.BitCast(value); + internal static Plane AsPlane(this Vector4 value) + { +#if MONO + return Unsafe.As(ref value); +#else + return Unsafe.BitCast(value); +#endif + } /// Reinterprets a as a new . /// The vector to reinterpret. /// reinterpreted as a new . - [Intrinsic] - internal static Quaternion AsQuaternion(this Vector4 value) => Unsafe.BitCast(value); + internal static Quaternion AsQuaternion(this Vector4 value) + { +#if MONO + return Unsafe.As(ref value); +#else + return Unsafe.BitCast(value); +#endif + } /// Gets the element at the specified index. /// The vector to get the element from. diff --git a/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Vector128.cs b/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Vector128.cs index 2d92f4ea4d4c8d..7f83b8c09d79e7 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Vector128.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Vector128.cs @@ -101,7 +101,11 @@ public static Vector128 As(this Vector128 vector) ThrowHelper.ThrowForUnsupportedIntrinsicsVector128BaseType(); ThrowHelper.ThrowForUnsupportedIntrinsicsVector128BaseType(); +#if MONO + return Unsafe.As, Vector128>(ref vector); +#else return Unsafe.BitCast, Vector128>(vector); +#endif } /// Reinterprets a as a new . @@ -164,12 +168,26 @@ public static Vector128 As(this Vector128 vector) /// Reinterprets a as a new . /// The vector to reinterpret. /// reinterpreted as a new . - internal static Plane AsPlane(this Vector128 value) => Unsafe.BitCast, Plane>(value); + internal static Plane AsPlane(this Vector128 value) + { +#if MONO + return Unsafe.As, Plane>(ref value); +#else + return Unsafe.BitCast, Plane>(value); +#endif + } /// Reinterprets a as a new . /// The vector to reinterpret. /// reinterpreted as a new . - internal static Quaternion AsQuaternion(this Vector128 value) => Unsafe.BitCast, Quaternion>(value); + internal static Quaternion AsQuaternion(this Vector128 value) + { +#if MONO + return Unsafe.As, Quaternion>(ref value); +#else + return Unsafe.BitCast, Quaternion>(value); +#endif + } /// Reinterprets a as a new . /// The type of the elements in the vector. @@ -218,12 +236,28 @@ public static Vector128 As(this Vector128 vector) /// Reinterprets a as a new . /// The plane to reinterpret. /// reinterpreted as a new . - internal static Vector128 AsVector128(this Plane value) => Unsafe.BitCast>(value); + [Intrinsic] + internal static Vector128 AsVector128(this Plane value) + { +#if MONO + return Unsafe.As>(ref value); +#else + return Unsafe.BitCast>(value); +#endif + } /// Reinterprets a as a new . /// The quaternion to reinterpret. /// reinterpreted as a new . - internal static Vector128 AsVector128(this Quaternion value) => Unsafe.BitCast>(value); + [Intrinsic] + internal static Vector128 AsVector128(this Quaternion value) + { +#if MONO + return Unsafe.As>(ref value); +#else + return Unsafe.BitCast>(value); +#endif + } /// Reinterprets a as a new . /// The vector to reinterpret. @@ -241,7 +275,14 @@ public static Vector128 As(this Vector128 vector) /// The vector to reinterpret. /// reinterpreted as a new . [Intrinsic] - public static Vector128 AsVector128(this Vector4 value) => Unsafe.BitCast>(value); + public static Vector128 AsVector128(this Vector4 value) + { +#if MONO + return Unsafe.As>(ref value); +#else + return Unsafe.BitCast>(value); +#endif + } /// Reinterprets a as a new . /// The type of the elements in the vector. @@ -285,7 +326,14 @@ public static Vector3 AsVector3(this Vector128 value) /// The vector to reinterpret. /// reinterpreted as a new . [Intrinsic] - public static Vector4 AsVector4(this Vector128 value) => Unsafe.BitCast, Vector4>(value); + public static Vector4 AsVector4(this Vector128 value) + { +#if MONO + return Unsafe.As, Vector4>(ref value); +#else + return Unsafe.BitCast, Vector4>(value); +#endif + } /// Reinterprets a as a new . /// The type of the elements in the vector. diff --git a/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Vector256.cs b/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Vector256.cs index c7b390347266ea..e8f16472b3695f 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Vector256.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Vector256.cs @@ -106,7 +106,11 @@ public static Vector256 As(this Vector256 vector) ThrowHelper.ThrowForUnsupportedIntrinsicsVector256BaseType(); ThrowHelper.ThrowForUnsupportedIntrinsicsVector256BaseType(); +#if MONO + return Unsafe.As, Vector256>(ref vector); +#else return Unsafe.BitCast, Vector256>(vector); +#endif } /// Reinterprets a as a new . diff --git a/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Vector512.cs b/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Vector512.cs index 3e4b9b8af27f28..8d44bf28998417 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Vector512.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Vector512.cs @@ -106,7 +106,11 @@ public static Vector512 As(this Vector512 vector) ThrowHelper.ThrowForUnsupportedIntrinsicsVector512BaseType(); ThrowHelper.ThrowForUnsupportedIntrinsicsVector512BaseType(); +#if MONO + return Unsafe.As, Vector512>(ref vector); +#else return Unsafe.BitCast, Vector512>(vector); +#endif } /// Reinterprets a as a new . diff --git a/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Vector64.cs b/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Vector64.cs index 0b0e7787c0e413..743aad0a6503f9 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Vector64.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Vector64.cs @@ -89,7 +89,11 @@ public static Vector64 As(this Vector64 vector) ThrowHelper.ThrowForUnsupportedIntrinsicsVector64BaseType(); ThrowHelper.ThrowForUnsupportedIntrinsicsVector64BaseType(); +#if MONO + return Unsafe.As, Vector64>(ref vector); +#else return Unsafe.BitCast, Vector64>(vector); +#endif } /// Reinterprets a as a new .