#define IS_DEBUG_ON(cfg) ((cfg)->verbose_level >= 3)
#define DEBUG(a) do { if (IS_DEBUG_ON(cfg)) { a; } } while (0)
+
+/*
+This enum MUST be kept in sync with its managed mirror Mono.Simd.AccelMode.
+ */
+enum {
+ SIMD_VERSION_SSE1 = 1 << 0,
+ SIMD_VERSION_SSE2 = 1 << 1,
+ SIMD_VERSION_SSE3 = 1 << 2,
+ SIMD_VERSION_SSSE3 = 1 << 3,
+ SIMD_VERSION_SSE41 = 1 << 4,
+ SIMD_VERSION_SSE42 = 1 << 5,
+ SIMD_VERSION_SSE4a = 1 << 6,
+};
+
enum {
SIMD_EMIT_BINARY,
SIMD_EMIT_UNARY,
typedef struct {
guint16 name;
guint16 opcode;
- guint8 simd_version_flags;
+ guint32 simd_version;
guint8 simd_emit_mode : 4;
guint8 flags : 4;
} SimdIntrinsic;
static const SimdIntrinsic vector4f_intrinsics[] = {
- { SN_ctor, OP_EXPAND_R4, SIMD_VERSION_SSE1, SIMD_EMIT_CTOR },
- { SN_AddSub, OP_ADDSUBPS, SIMD_VERSION_SSE3, SIMD_EMIT_BINARY},
- { SN_AndNot, OP_ANDNPS, SIMD_VERSION_SSE1, SIMD_EMIT_BINARY},
- { SN_CompareEqual, OP_COMPPS, SIMD_VERSION_SSE1, SIMD_EMIT_BINARY, SIMD_COMP_EQ },
- { SN_CompareLessEqual, OP_COMPPS, SIMD_VERSION_SSE1, SIMD_EMIT_BINARY, SIMD_COMP_LE },
- { SN_CompareLessThan, OP_COMPPS, SIMD_VERSION_SSE1, SIMD_EMIT_BINARY, SIMD_COMP_LT },
- { SN_CompareNotEqual, OP_COMPPS, SIMD_VERSION_SSE1, SIMD_EMIT_BINARY, SIMD_COMP_NEQ },
- { SN_CompareNotLessEqual, OP_COMPPS, SIMD_VERSION_SSE1, SIMD_EMIT_BINARY, SIMD_COMP_NLE },
- { SN_CompareNotLessThan, OP_COMPPS, SIMD_VERSION_SSE1, SIMD_EMIT_BINARY, SIMD_COMP_NLT },
- { SN_CompareOrdered, OP_COMPPS, SIMD_VERSION_SSE1, SIMD_EMIT_BINARY, SIMD_COMP_ORD },
- { SN_CompareUnordered, OP_COMPPS, SIMD_VERSION_SSE1, SIMD_EMIT_BINARY, SIMD_COMP_UNORD },
- { SN_ConvertToDouble, OP_CVTPS2PD, SIMD_VERSION_SSE2, SIMD_EMIT_UNARY },
- { SN_ConvertToInt, OP_CVTPS2DQ, SIMD_VERSION_SSE2, SIMD_EMIT_UNARY },
- { SN_ConvertToIntTruncated, OP_CVTTPS2DQ, SIMD_VERSION_SSE2, SIMD_EMIT_UNARY },
- { SN_DuplicateHigh, OP_DUPPS_HIGH, SIMD_VERSION_SSE3, SIMD_EMIT_UNARY },
- { SN_DuplicateLow, OP_DUPPS_LOW, SIMD_VERSION_SSE3, SIMD_EMIT_UNARY },
- { SN_HorizontalAdd, OP_HADDPS, SIMD_VERSION_SSE3, SIMD_EMIT_BINARY },
- { SN_HorizontalSub, OP_HSUBPS, SIMD_VERSION_SSE3, SIMD_EMIT_BINARY },
- { SN_InterleaveHigh, OP_UNPACK_HIGHPS, SIMD_VERSION_SSE1, SIMD_EMIT_BINARY },
- { SN_InterleaveLow, OP_UNPACK_LOWPS, SIMD_VERSION_SSE1, SIMD_EMIT_BINARY },
- { SN_InvSqrt, OP_RSQRTPS, SIMD_VERSION_SSE1, SIMD_EMIT_UNARY },
- { SN_LoadAligned, 0, SIMD_VERSION_SSE1, SIMD_EMIT_LOAD_ALIGNED },
- { SN_Max, OP_MAXPS, SIMD_VERSION_SSE1, SIMD_EMIT_BINARY },
- { SN_Min, OP_MINPS, SIMD_VERSION_SSE1, SIMD_EMIT_BINARY },
- { SN_PrefetchTemporalAllCacheLevels, 0, SIMD_VERSION_SSE1, SIMD_EMIT_PREFETCH, SIMD_PREFETCH_MODE_0 },
- { SN_PrefetchTemporal1stLevelCache, 0, SIMD_VERSION_SSE1, SIMD_EMIT_PREFETCH, SIMD_PREFETCH_MODE_1 },
- { SN_PrefetchTemporal2ndLevelCache, 0, SIMD_VERSION_SSE1, SIMD_EMIT_PREFETCH, SIMD_PREFETCH_MODE_2 },
- { SN_PrefetchNonTemporal, 0, SIMD_VERSION_SSE1, SIMD_EMIT_PREFETCH, SIMD_PREFETCH_MODE_NTA },
- { SN_Reciprocal, OP_RCPPS, SIMD_VERSION_SSE1, SIMD_EMIT_UNARY },
- { SN_Shuffle, OP_PSHUFLED, SIMD_VERSION_SSE1, SIMD_EMIT_SHUFFLE },
- { SN_Sqrt, OP_SQRTPS, SIMD_VERSION_SSE1, SIMD_EMIT_UNARY },
- { SN_StoreAligned, OP_STOREX_ALIGNED_MEMBASE_REG, SIMD_VERSION_SSE1, SIMD_EMIT_STORE },
- { SN_StoreNonTemporal, OP_STOREX_NTA_MEMBASE_REG, SIMD_VERSION_SSE1, SIMD_EMIT_STORE },
- { SN_get_W, 3, SIMD_VERSION_SSE1, SIMD_EMIT_GETTER },
- { SN_get_X, 0, SIMD_VERSION_SSE1, SIMD_EMIT_GETTER },
- { SN_get_Y, 1, SIMD_VERSION_SSE1, SIMD_EMIT_GETTER },
- { SN_get_Z, 2, SIMD_VERSION_SSE1, SIMD_EMIT_GETTER },
- { SN_op_Addition, OP_ADDPS, SIMD_VERSION_SSE1, SIMD_EMIT_BINARY },
- { SN_op_BitwiseAnd, OP_ANDPS, SIMD_VERSION_SSE1, SIMD_EMIT_BINARY },
- { SN_op_BitwiseOr, OP_ORPS, SIMD_VERSION_SSE1, SIMD_EMIT_BINARY },
- { SN_op_Division, OP_DIVPS, SIMD_VERSION_SSE1, SIMD_EMIT_BINARY },
- { SN_op_Equality, OP_COMPPS, SIMD_VERSION_SSE1, SIMD_EMIT_EQUALITY, SIMD_COMP_EQ },
- { SN_op_ExclusiveOr, OP_XORPS, SIMD_VERSION_SSE1, SIMD_EMIT_BINARY },
- { SN_op_Explicit, 0, SIMD_VERSION_SSE1, SIMD_EMIT_CAST },
- { SN_op_Inequality, OP_COMPPS, SIMD_VERSION_SSE1, SIMD_EMIT_EQUALITY, SIMD_COMP_NEQ },
- { SN_op_Multiply, OP_MULPS, SIMD_VERSION_SSE1, SIMD_EMIT_BINARY },
- { SN_op_Subtraction, OP_SUBPS, SIMD_VERSION_SSE1, SIMD_EMIT_BINARY },
- { SN_set_W, 3, SIMD_VERSION_SSE1, SIMD_EMIT_SETTER },
- { SN_set_X, 0, SIMD_VERSION_SSE1, SIMD_EMIT_SETTER },
- { SN_set_Y, 1, SIMD_VERSION_SSE1, SIMD_EMIT_SETTER },
- { SN_set_Z, 2, SIMD_VERSION_SSE1, SIMD_EMIT_SETTER }
+ { SN_ctor, OP_EXPAND_R4, MONO_CPU_X86_SSE, SIMD_EMIT_CTOR },
+ { SN_AddSub, OP_ADDSUBPS, MONO_CPU_X86_SSE3, SIMD_EMIT_BINARY},
+ { SN_AndNot, OP_ANDNPS, MONO_CPU_X86_SSE, SIMD_EMIT_BINARY},
+ { SN_CompareEqual, OP_COMPPS, MONO_CPU_X86_SSE, SIMD_EMIT_BINARY, SIMD_COMP_EQ },
+ { SN_CompareLessEqual, OP_COMPPS, MONO_CPU_X86_SSE, SIMD_EMIT_BINARY, SIMD_COMP_LE },
+ { SN_CompareLessThan, OP_COMPPS, MONO_CPU_X86_SSE, SIMD_EMIT_BINARY, SIMD_COMP_LT },
+ { SN_CompareNotEqual, OP_COMPPS, MONO_CPU_X86_SSE, SIMD_EMIT_BINARY, SIMD_COMP_NEQ },
+ { SN_CompareNotLessEqual, OP_COMPPS, MONO_CPU_X86_SSE, SIMD_EMIT_BINARY, SIMD_COMP_NLE },
+ { SN_CompareNotLessThan, OP_COMPPS, MONO_CPU_X86_SSE, SIMD_EMIT_BINARY, SIMD_COMP_NLT },
+ { SN_CompareOrdered, OP_COMPPS, MONO_CPU_X86_SSE, SIMD_EMIT_BINARY, SIMD_COMP_ORD },
+ { SN_CompareUnordered, OP_COMPPS, MONO_CPU_X86_SSE, SIMD_EMIT_BINARY, SIMD_COMP_UNORD },
+ { SN_ConvertToDouble, OP_CVTPS2PD, MONO_CPU_X86_SSE2, SIMD_EMIT_UNARY },
+ { SN_ConvertToInt, OP_CVTPS2DQ, MONO_CPU_X86_SSE2, SIMD_EMIT_UNARY },
+ { SN_ConvertToIntTruncated, OP_CVTTPS2DQ, MONO_CPU_X86_SSE2, SIMD_EMIT_UNARY },
+ { SN_DuplicateHigh, OP_DUPPS_HIGH, MONO_CPU_X86_SSE3, SIMD_EMIT_UNARY },
+ { SN_DuplicateLow, OP_DUPPS_LOW, MONO_CPU_X86_SSE3, SIMD_EMIT_UNARY },
+ { SN_HorizontalAdd, OP_HADDPS, MONO_CPU_X86_SSE3, SIMD_EMIT_BINARY },
+ { SN_HorizontalSub, OP_HSUBPS, MONO_CPU_X86_SSE3, SIMD_EMIT_BINARY },
+ { SN_InterleaveHigh, OP_UNPACK_HIGHPS, MONO_CPU_X86_SSE, SIMD_EMIT_BINARY },
+ { SN_InterleaveLow, OP_UNPACK_LOWPS, MONO_CPU_X86_SSE, SIMD_EMIT_BINARY },
+ { SN_InvSqrt, OP_RSQRTPS, MONO_CPU_X86_SSE, SIMD_EMIT_UNARY },
+ { SN_LoadAligned, 0, MONO_CPU_X86_SSE, SIMD_EMIT_LOAD_ALIGNED },
+ { SN_Max, OP_MAXPS, MONO_CPU_X86_SSE, SIMD_EMIT_BINARY },
+ { SN_Min, OP_MINPS, MONO_CPU_X86_SSE, SIMD_EMIT_BINARY },
+ { SN_PrefetchTemporalAllCacheLevels, 0, MONO_CPU_X86_SSE, SIMD_EMIT_PREFETCH, SIMD_PREFETCH_MODE_0 },
+ { SN_PrefetchTemporal1stLevelCache, 0, MONO_CPU_X86_SSE, SIMD_EMIT_PREFETCH, SIMD_PREFETCH_MODE_1 },
+ { SN_PrefetchTemporal2ndLevelCache, 0, MONO_CPU_X86_SSE, SIMD_EMIT_PREFETCH, SIMD_PREFETCH_MODE_2 },
+ { SN_PrefetchNonTemporal, 0, MONO_CPU_X86_SSE, SIMD_EMIT_PREFETCH, SIMD_PREFETCH_MODE_NTA },
+ { SN_Reciprocal, OP_RCPPS, MONO_CPU_X86_SSE, SIMD_EMIT_UNARY },
+ { SN_Shuffle, OP_PSHUFLED, MONO_CPU_X86_SSE, SIMD_EMIT_SHUFFLE },
+ { SN_Sqrt, OP_SQRTPS, MONO_CPU_X86_SSE, SIMD_EMIT_UNARY },
+ { SN_StoreAligned, OP_STOREX_ALIGNED_MEMBASE_REG, MONO_CPU_X86_SSE, SIMD_EMIT_STORE },
+ { SN_StoreNonTemporal, OP_STOREX_NTA_MEMBASE_REG, MONO_CPU_X86_SSE, SIMD_EMIT_STORE },
+ { SN_get_W, 3, MONO_CPU_X86_SSE, SIMD_EMIT_GETTER },
+ { SN_get_X, 0, MONO_CPU_X86_SSE, SIMD_EMIT_GETTER },
+ { SN_get_Y, 1, MONO_CPU_X86_SSE, SIMD_EMIT_GETTER },
+ { SN_get_Z, 2, MONO_CPU_X86_SSE, SIMD_EMIT_GETTER },
+ { SN_op_Addition, OP_ADDPS, MONO_CPU_X86_SSE, SIMD_EMIT_BINARY },
+ { SN_op_BitwiseAnd, OP_ANDPS, MONO_CPU_X86_SSE, SIMD_EMIT_BINARY },
+ { SN_op_BitwiseOr, OP_ORPS, MONO_CPU_X86_SSE, SIMD_EMIT_BINARY },
+ { SN_op_Division, OP_DIVPS, MONO_CPU_X86_SSE, SIMD_EMIT_BINARY },
+ { SN_op_Equality, OP_COMPPS, MONO_CPU_X86_SSE, SIMD_EMIT_EQUALITY, SIMD_COMP_EQ },
+ { SN_op_ExclusiveOr, OP_XORPS, MONO_CPU_X86_SSE, SIMD_EMIT_BINARY },
+ { SN_op_Explicit, 0, MONO_CPU_X86_SSE, SIMD_EMIT_CAST },
+ { SN_op_Inequality, OP_COMPPS, MONO_CPU_X86_SSE, SIMD_EMIT_EQUALITY, SIMD_COMP_NEQ },
+ { SN_op_Multiply, OP_MULPS, MONO_CPU_X86_SSE, SIMD_EMIT_BINARY },
+ { SN_op_Subtraction, OP_SUBPS, MONO_CPU_X86_SSE, SIMD_EMIT_BINARY },
+ { SN_set_W, 3, MONO_CPU_X86_SSE, SIMD_EMIT_SETTER },
+ { SN_set_X, 0, MONO_CPU_X86_SSE, SIMD_EMIT_SETTER },
+ { SN_set_Y, 1, MONO_CPU_X86_SSE, SIMD_EMIT_SETTER },
+ { SN_set_Z, 2, MONO_CPU_X86_SSE, SIMD_EMIT_SETTER }
};
static const SimdIntrinsic vector2d_intrinsics[] = {
- { SN_ctor, OP_EXPAND_R8, SIMD_VERSION_SSE1, SIMD_EMIT_CTOR },
- { SN_AddSub, OP_ADDSUBPD, SIMD_VERSION_SSE3, SIMD_EMIT_BINARY,},
- { SN_AndNot, OP_ANDNPD, SIMD_VERSION_SSE1, SIMD_EMIT_BINARY },
- { SN_CompareEqual, OP_COMPPD, SIMD_VERSION_SSE1, SIMD_EMIT_BINARY, SIMD_COMP_EQ },
- { SN_CompareLessEqual, OP_COMPPD, SIMD_VERSION_SSE1, SIMD_EMIT_BINARY, SIMD_COMP_LE },
- { SN_CompareLessThan, OP_COMPPD, SIMD_VERSION_SSE1, SIMD_EMIT_BINARY, SIMD_COMP_LT },
- { SN_CompareNotEqual, OP_COMPPD, SIMD_VERSION_SSE1, SIMD_EMIT_BINARY, SIMD_COMP_NEQ },
- { SN_CompareNotLessEqual, OP_COMPPD, SIMD_VERSION_SSE1, SIMD_EMIT_BINARY, SIMD_COMP_NLE },
- { SN_CompareNotLessThan, OP_COMPPD, SIMD_VERSION_SSE1, SIMD_EMIT_BINARY, SIMD_COMP_NLT },
- { SN_CompareOrdered, OP_COMPPD, SIMD_VERSION_SSE1, SIMD_EMIT_BINARY, SIMD_COMP_ORD },
- { SN_CompareUnordered, OP_COMPPD, SIMD_VERSION_SSE1, SIMD_EMIT_BINARY, SIMD_COMP_UNORD },
- { SN_ConvertToFloat, OP_CVTPD2PS, SIMD_VERSION_SSE2, SIMD_EMIT_UNARY },
- { SN_ConvertToInt, OP_CVTPD2DQ, SIMD_VERSION_SSE2, SIMD_EMIT_UNARY },
- { SN_ConvertToIntTruncated, OP_CVTTPD2DQ, SIMD_VERSION_SSE2, SIMD_EMIT_UNARY },
- { SN_Duplicate, OP_DUPPD, SIMD_VERSION_SSE3, SIMD_EMIT_UNARY },
- { SN_HorizontalAdd, OP_HADDPD, SIMD_VERSION_SSE3, SIMD_EMIT_BINARY },
- { SN_HorizontalSub, OP_HSUBPD, SIMD_VERSION_SSE3, SIMD_EMIT_BINARY },
- { SN_InterleaveHigh, OP_UNPACK_HIGHPD, SIMD_VERSION_SSE1, SIMD_EMIT_BINARY },
- { SN_InterleaveLow, OP_UNPACK_LOWPD, SIMD_VERSION_SSE1, SIMD_EMIT_BINARY },
- { SN_LoadAligned, 0, SIMD_VERSION_SSE1, SIMD_EMIT_LOAD_ALIGNED },
- { SN_Max, OP_MAXPD, SIMD_VERSION_SSE1, SIMD_EMIT_BINARY },
- { SN_Min, OP_MINPD, SIMD_VERSION_SSE1, SIMD_EMIT_BINARY },
- { SN_PrefetchTemporalAllCacheLevels, 0, SIMD_VERSION_SSE1, SIMD_EMIT_PREFETCH, SIMD_PREFETCH_MODE_0 },
- { SN_PrefetchTemporal1stLevelCache, 0, SIMD_VERSION_SSE1, SIMD_EMIT_PREFETCH, SIMD_PREFETCH_MODE_1 },
- { SN_PrefetchTemporal2ndLevelCache, 0, SIMD_VERSION_SSE1, SIMD_EMIT_PREFETCH, SIMD_PREFETCH_MODE_2 },
- { SN_PrefetchNonTemporal, 0, SIMD_VERSION_SSE1, SIMD_EMIT_PREFETCH, SIMD_PREFETCH_MODE_NTA },
- { SN_Shuffle, OP_SHUFPD, SIMD_VERSION_SSE1, SIMD_EMIT_SHUFFLE },
- { SN_Sqrt, OP_SQRTPD, SIMD_VERSION_SSE1, SIMD_EMIT_UNARY },
- { SN_StoreAligned, OP_STOREX_ALIGNED_MEMBASE_REG, SIMD_VERSION_SSE1, SIMD_EMIT_STORE },
- { SN_get_X, 0, SIMD_VERSION_SSE1, SIMD_EMIT_GETTER_QWORD },
- { SN_get_Y, 1, SIMD_VERSION_SSE1, SIMD_EMIT_GETTER_QWORD },
- { SN_op_Addition, OP_ADDPD, SIMD_VERSION_SSE1, SIMD_EMIT_BINARY },
- { SN_op_BitwiseAnd, OP_ANDPD, SIMD_VERSION_SSE1, SIMD_EMIT_BINARY },
- { SN_op_BitwiseOr, OP_ORPD, SIMD_VERSION_SSE1, SIMD_EMIT_BINARY },
- { SN_op_Division, OP_DIVPD, SIMD_VERSION_SSE1, SIMD_EMIT_BINARY },
- { SN_op_ExclusiveOr, OP_XORPD, SIMD_VERSION_SSE1, SIMD_EMIT_BINARY },
- { SN_op_Explicit, 0, SIMD_VERSION_SSE1, SIMD_EMIT_CAST },
- { SN_op_Multiply, OP_MULPD, SIMD_VERSION_SSE1, SIMD_EMIT_BINARY },
- { SN_op_Subtraction, OP_SUBPD, SIMD_VERSION_SSE1, SIMD_EMIT_BINARY },
- { SN_set_X, 0, SIMD_VERSION_SSE1, SIMD_EMIT_SETTER },
- { SN_set_Y, 1, SIMD_VERSION_SSE1, SIMD_EMIT_SETTER },
+ { SN_ctor, OP_EXPAND_R8, MONO_CPU_X86_SSE, SIMD_EMIT_CTOR },
+ { SN_AddSub, OP_ADDSUBPD, MONO_CPU_X86_SSE3, SIMD_EMIT_BINARY,},
+ { SN_AndNot, OP_ANDNPD, MONO_CPU_X86_SSE, SIMD_EMIT_BINARY },
+ { SN_CompareEqual, OP_COMPPD, MONO_CPU_X86_SSE, SIMD_EMIT_BINARY, SIMD_COMP_EQ },
+ { SN_CompareLessEqual, OP_COMPPD, MONO_CPU_X86_SSE, SIMD_EMIT_BINARY, SIMD_COMP_LE },
+ { SN_CompareLessThan, OP_COMPPD, MONO_CPU_X86_SSE, SIMD_EMIT_BINARY, SIMD_COMP_LT },
+ { SN_CompareNotEqual, OP_COMPPD, MONO_CPU_X86_SSE, SIMD_EMIT_BINARY, SIMD_COMP_NEQ },
+ { SN_CompareNotLessEqual, OP_COMPPD, MONO_CPU_X86_SSE, SIMD_EMIT_BINARY, SIMD_COMP_NLE },
+ { SN_CompareNotLessThan, OP_COMPPD, MONO_CPU_X86_SSE, SIMD_EMIT_BINARY, SIMD_COMP_NLT },
+ { SN_CompareOrdered, OP_COMPPD, MONO_CPU_X86_SSE, SIMD_EMIT_BINARY, SIMD_COMP_ORD },
+ { SN_CompareUnordered, OP_COMPPD, MONO_CPU_X86_SSE, SIMD_EMIT_BINARY, SIMD_COMP_UNORD },
+ { SN_ConvertToFloat, OP_CVTPD2PS, MONO_CPU_X86_SSE2, SIMD_EMIT_UNARY },
+ { SN_ConvertToInt, OP_CVTPD2DQ, MONO_CPU_X86_SSE2, SIMD_EMIT_UNARY },
+ { SN_ConvertToIntTruncated, OP_CVTTPD2DQ, MONO_CPU_X86_SSE2, SIMD_EMIT_UNARY },
+ { SN_Duplicate, OP_DUPPD, MONO_CPU_X86_SSE3, SIMD_EMIT_UNARY },
+ { SN_HorizontalAdd, OP_HADDPD, MONO_CPU_X86_SSE3, SIMD_EMIT_BINARY },
+ { SN_HorizontalSub, OP_HSUBPD, MONO_CPU_X86_SSE3, SIMD_EMIT_BINARY },
+ { SN_InterleaveHigh, OP_UNPACK_HIGHPD, MONO_CPU_X86_SSE, SIMD_EMIT_BINARY },
+ { SN_InterleaveLow, OP_UNPACK_LOWPD, MONO_CPU_X86_SSE, SIMD_EMIT_BINARY },
+ { SN_LoadAligned, 0, MONO_CPU_X86_SSE, SIMD_EMIT_LOAD_ALIGNED },
+ { SN_Max, OP_MAXPD, MONO_CPU_X86_SSE, SIMD_EMIT_BINARY },
+ { SN_Min, OP_MINPD, MONO_CPU_X86_SSE, SIMD_EMIT_BINARY },
+ { SN_PrefetchTemporalAllCacheLevels, 0, MONO_CPU_X86_SSE, SIMD_EMIT_PREFETCH, SIMD_PREFETCH_MODE_0 },
+ { SN_PrefetchTemporal1stLevelCache, 0, MONO_CPU_X86_SSE, SIMD_EMIT_PREFETCH, SIMD_PREFETCH_MODE_1 },
+ { SN_PrefetchTemporal2ndLevelCache, 0, MONO_CPU_X86_SSE, SIMD_EMIT_PREFETCH, SIMD_PREFETCH_MODE_2 },
+ { SN_PrefetchNonTemporal, 0, MONO_CPU_X86_SSE, SIMD_EMIT_PREFETCH, SIMD_PREFETCH_MODE_NTA },
+ { SN_Shuffle, OP_SHUFPD, MONO_CPU_X86_SSE, SIMD_EMIT_SHUFFLE },
+ { SN_Sqrt, OP_SQRTPD, MONO_CPU_X86_SSE, SIMD_EMIT_UNARY },
+ { SN_StoreAligned, OP_STOREX_ALIGNED_MEMBASE_REG, MONO_CPU_X86_SSE, SIMD_EMIT_STORE },
+ { SN_get_X, 0, MONO_CPU_X86_SSE, SIMD_EMIT_GETTER_QWORD },
+ { SN_get_Y, 1, MONO_CPU_X86_SSE, SIMD_EMIT_GETTER_QWORD },
+ { SN_op_Addition, OP_ADDPD, MONO_CPU_X86_SSE, SIMD_EMIT_BINARY },
+ { SN_op_BitwiseAnd, OP_ANDPD, MONO_CPU_X86_SSE, SIMD_EMIT_BINARY },
+ { SN_op_BitwiseOr, OP_ORPD, MONO_CPU_X86_SSE, SIMD_EMIT_BINARY },
+ { SN_op_Division, OP_DIVPD, MONO_CPU_X86_SSE, SIMD_EMIT_BINARY },
+ { SN_op_ExclusiveOr, OP_XORPD, MONO_CPU_X86_SSE, SIMD_EMIT_BINARY },
+ { SN_op_Explicit, 0, MONO_CPU_X86_SSE, SIMD_EMIT_CAST },
+ { SN_op_Multiply, OP_MULPD, MONO_CPU_X86_SSE, SIMD_EMIT_BINARY },
+ { SN_op_Subtraction, OP_SUBPD, MONO_CPU_X86_SSE, SIMD_EMIT_BINARY },
+ { SN_set_X, 0, MONO_CPU_X86_SSE, SIMD_EMIT_SETTER },
+ { SN_set_Y, 1, MONO_CPU_X86_SSE, SIMD_EMIT_SETTER },
};
static const SimdIntrinsic vector2ul_intrinsics[] = {
- { SN_ctor, OP_EXPAND_I8, SIMD_VERSION_SSE1, SIMD_EMIT_CTOR },
- { SN_CompareEqual, OP_PCMPEQQ, SIMD_VERSION_SSE41, SIMD_EMIT_BINARY },
- { SN_LoadAligned, 0, SIMD_VERSION_SSE1, SIMD_EMIT_LOAD_ALIGNED },
- { SN_PrefetchTemporalAllCacheLevels, 0, SIMD_VERSION_SSE1, SIMD_EMIT_PREFETCH, SIMD_PREFETCH_MODE_0 },
- { SN_PrefetchTemporal1stLevelCache, 0, SIMD_VERSION_SSE1, SIMD_EMIT_PREFETCH, SIMD_PREFETCH_MODE_1 },
- { SN_PrefetchTemporal2ndLevelCache, 0, SIMD_VERSION_SSE1, SIMD_EMIT_PREFETCH, SIMD_PREFETCH_MODE_2 },
- { SN_PrefetchNonTemporal, 0, SIMD_VERSION_SSE1, SIMD_EMIT_PREFETCH, SIMD_PREFETCH_MODE_NTA },
- { SN_Shuffle, OP_SHUFPD, SIMD_VERSION_SSE1, SIMD_EMIT_SHUFFLE },
- { SN_StoreAligned, OP_STOREX_ALIGNED_MEMBASE_REG, SIMD_VERSION_SSE1, SIMD_EMIT_STORE },
- { SN_UnpackHigh, OP_UNPACK_HIGHQ, SIMD_VERSION_SSE1, SIMD_EMIT_BINARY },
- { SN_UnpackLow, OP_UNPACK_LOWQ, SIMD_VERSION_SSE1, SIMD_EMIT_BINARY },
- { SN_get_X, 0, SIMD_VERSION_SSE1, SIMD_EMIT_GETTER_QWORD },
- { SN_get_Y, 1, SIMD_VERSION_SSE1, SIMD_EMIT_GETTER_QWORD },
- { SN_op_Addition, OP_PADDQ, SIMD_VERSION_SSE1, SIMD_EMIT_BINARY },
- { SN_op_BitwiseAnd, OP_PAND, SIMD_VERSION_SSE1, SIMD_EMIT_BINARY },
- { SN_op_BitwiseOr, OP_POR, SIMD_VERSION_SSE1, SIMD_EMIT_BINARY },
- { SN_op_ExclusiveOr, OP_PXOR, SIMD_EMIT_BINARY, SIMD_VERSION_SSE1 },
- { SN_op_Explicit, 0, SIMD_VERSION_SSE1, SIMD_EMIT_CAST },
- { SN_op_LeftShift, OP_PSHLQ, SIMD_VERSION_SSE1, SIMD_EMIT_SHIFT },
- { SN_op_Multiply, OP_PMULQ, SIMD_VERSION_SSE1, SIMD_EMIT_BINARY },
- { SN_op_RightShift, OP_PSHRQ, SIMD_VERSION_SSE1, SIMD_EMIT_SHIFT },
- { SN_op_Subtraction, OP_PSUBQ, SIMD_VERSION_SSE1, SIMD_EMIT_BINARY },
- { SN_set_X, 0, SIMD_VERSION_SSE1, SIMD_EMIT_SETTER },
- { SN_set_Y, 1, SIMD_VERSION_SSE1, SIMD_EMIT_SETTER },
+ { SN_ctor, OP_EXPAND_I8, MONO_CPU_X86_SSE, SIMD_EMIT_CTOR },
+ { SN_CompareEqual, OP_PCMPEQQ, MONO_CPU_X86_SSE41, SIMD_EMIT_BINARY },
+ { SN_LoadAligned, 0, MONO_CPU_X86_SSE, SIMD_EMIT_LOAD_ALIGNED },
+ { SN_PrefetchTemporalAllCacheLevels, 0, MONO_CPU_X86_SSE, SIMD_EMIT_PREFETCH, SIMD_PREFETCH_MODE_0 },
+ { SN_PrefetchTemporal1stLevelCache, 0, MONO_CPU_X86_SSE, SIMD_EMIT_PREFETCH, SIMD_PREFETCH_MODE_1 },
+ { SN_PrefetchTemporal2ndLevelCache, 0, MONO_CPU_X86_SSE, SIMD_EMIT_PREFETCH, SIMD_PREFETCH_MODE_2 },
+ { SN_PrefetchNonTemporal, 0, MONO_CPU_X86_SSE, SIMD_EMIT_PREFETCH, SIMD_PREFETCH_MODE_NTA },
+ { SN_Shuffle, OP_SHUFPD, MONO_CPU_X86_SSE, SIMD_EMIT_SHUFFLE },
+ { SN_StoreAligned, OP_STOREX_ALIGNED_MEMBASE_REG, MONO_CPU_X86_SSE, SIMD_EMIT_STORE },
+ { SN_UnpackHigh, OP_UNPACK_HIGHQ, MONO_CPU_X86_SSE, SIMD_EMIT_BINARY },
+ { SN_UnpackLow, OP_UNPACK_LOWQ, MONO_CPU_X86_SSE, SIMD_EMIT_BINARY },
+ { SN_get_X, 0, MONO_CPU_X86_SSE, SIMD_EMIT_GETTER_QWORD },
+ { SN_get_Y, 1, MONO_CPU_X86_SSE, SIMD_EMIT_GETTER_QWORD },
+ { SN_op_Addition, OP_PADDQ, MONO_CPU_X86_SSE, SIMD_EMIT_BINARY },
+ { SN_op_BitwiseAnd, OP_PAND, MONO_CPU_X86_SSE, SIMD_EMIT_BINARY },
+ { SN_op_BitwiseOr, OP_POR, MONO_CPU_X86_SSE, SIMD_EMIT_BINARY },
+ { SN_op_ExclusiveOr, OP_PXOR, SIMD_EMIT_BINARY, MONO_CPU_X86_SSE },
+ { SN_op_Explicit, 0, MONO_CPU_X86_SSE, SIMD_EMIT_CAST },
+ { SN_op_LeftShift, OP_PSHLQ, MONO_CPU_X86_SSE, SIMD_EMIT_SHIFT },
+ { SN_op_Multiply, OP_PMULQ, MONO_CPU_X86_SSE, SIMD_EMIT_BINARY },
+ { SN_op_RightShift, OP_PSHRQ, MONO_CPU_X86_SSE, SIMD_EMIT_SHIFT },
+ { SN_op_Subtraction, OP_PSUBQ, MONO_CPU_X86_SSE, SIMD_EMIT_BINARY },
+ { SN_set_X, 0, MONO_CPU_X86_SSE, SIMD_EMIT_SETTER },
+ { SN_set_Y, 1, MONO_CPU_X86_SSE, SIMD_EMIT_SETTER },
};
static const SimdIntrinsic vector2l_intrinsics[] = {
- { SN_ctor, OP_EXPAND_I8, SIMD_VERSION_SSE1, SIMD_EMIT_CTOR },
- { SN_CompareEqual, OP_PCMPEQQ, SIMD_VERSION_SSE41, SIMD_EMIT_BINARY },
- { SN_CompareGreaterThan, OP_PCMPGTQ, SIMD_VERSION_SSE42, SIMD_EMIT_BINARY },
- { SN_LoadAligned, 0, SIMD_VERSION_SSE1, SIMD_EMIT_LOAD_ALIGNED },
- { SN_LogicalRightShift, OP_PSHRQ, SIMD_VERSION_SSE1, SIMD_EMIT_SHIFT },
- { SN_PrefetchTemporalAllCacheLevels, 0, SIMD_VERSION_SSE1, SIMD_EMIT_PREFETCH, SIMD_PREFETCH_MODE_0 },
- { SN_PrefetchTemporal1stLevelCache, 0, SIMD_VERSION_SSE1, SIMD_EMIT_PREFETCH, SIMD_PREFETCH_MODE_1 },
- { SN_PrefetchTemporal2ndLevelCache, 0, SIMD_VERSION_SSE1, SIMD_EMIT_PREFETCH, SIMD_PREFETCH_MODE_2 },
- { SN_PrefetchNonTemporal, 0, SIMD_VERSION_SSE1, SIMD_EMIT_PREFETCH, SIMD_PREFETCH_MODE_NTA },
- { SN_Shuffle, OP_SHUFPD, SIMD_VERSION_SSE1, SIMD_EMIT_SHUFFLE },
- { SN_StoreAligned, OP_STOREX_ALIGNED_MEMBASE_REG, SIMD_VERSION_SSE1, SIMD_EMIT_STORE },
- { SN_UnpackHigh, OP_UNPACK_HIGHQ, SIMD_VERSION_SSE1, SIMD_EMIT_BINARY },
- { SN_UnpackLow, OP_UNPACK_LOWQ, SIMD_VERSION_SSE1, SIMD_EMIT_BINARY },
- { SN_get_X, 0, SIMD_VERSION_SSE1, SIMD_EMIT_GETTER_QWORD },
- { SN_get_Y, 1, SIMD_VERSION_SSE1, SIMD_EMIT_GETTER_QWORD },
- { SN_op_Addition, OP_PADDQ, SIMD_VERSION_SSE1, SIMD_EMIT_BINARY },
- { SN_op_BitwiseAnd, OP_PAND, SIMD_VERSION_SSE1, SIMD_EMIT_BINARY },
- { SN_op_BitwiseOr, OP_POR, SIMD_VERSION_SSE1, SIMD_EMIT_BINARY },
- { SN_op_ExclusiveOr, OP_PXOR, SIMD_VERSION_SSE1, SIMD_EMIT_BINARY },
- { SN_op_Explicit, 0, SIMD_VERSION_SSE1, SIMD_EMIT_CAST },
- { SN_op_LeftShift, OP_PSHLQ, SIMD_VERSION_SSE1, SIMD_EMIT_SHIFT },
- { SN_op_Multiply, OP_PMULQ, SIMD_VERSION_SSE1, SIMD_EMIT_BINARY },
- { SN_op_Subtraction, OP_PSUBQ, SIMD_VERSION_SSE1, SIMD_EMIT_BINARY },
- { SN_set_X, 0, SIMD_VERSION_SSE1, SIMD_EMIT_SETTER },
- { SN_set_Y, 1, SIMD_VERSION_SSE1, SIMD_EMIT_SETTER },
+ { SN_ctor, OP_EXPAND_I8, MONO_CPU_X86_SSE, SIMD_EMIT_CTOR },
+ { SN_CompareEqual, OP_PCMPEQQ, MONO_CPU_X86_SSE41, SIMD_EMIT_BINARY },
+ { SN_CompareGreaterThan, OP_PCMPGTQ, MONO_CPU_X86_SSE42, SIMD_EMIT_BINARY },
+ { SN_LoadAligned, 0, MONO_CPU_X86_SSE, SIMD_EMIT_LOAD_ALIGNED },
+ { SN_LogicalRightShift, OP_PSHRQ, MONO_CPU_X86_SSE, SIMD_EMIT_SHIFT },
+ { SN_PrefetchTemporalAllCacheLevels, 0, MONO_CPU_X86_SSE, SIMD_EMIT_PREFETCH, SIMD_PREFETCH_MODE_0 },
+ { SN_PrefetchTemporal1stLevelCache, 0, MONO_CPU_X86_SSE, SIMD_EMIT_PREFETCH, SIMD_PREFETCH_MODE_1 },
+ { SN_PrefetchTemporal2ndLevelCache, 0, MONO_CPU_X86_SSE, SIMD_EMIT_PREFETCH, SIMD_PREFETCH_MODE_2 },
+ { SN_PrefetchNonTemporal, 0, MONO_CPU_X86_SSE, SIMD_EMIT_PREFETCH, SIMD_PREFETCH_MODE_NTA },
+ { SN_Shuffle, OP_SHUFPD, MONO_CPU_X86_SSE, SIMD_EMIT_SHUFFLE },
+ { SN_StoreAligned, OP_STOREX_ALIGNED_MEMBASE_REG, MONO_CPU_X86_SSE, SIMD_EMIT_STORE },
+ { SN_UnpackHigh, OP_UNPACK_HIGHQ, MONO_CPU_X86_SSE, SIMD_EMIT_BINARY },
+ { SN_UnpackLow, OP_UNPACK_LOWQ, MONO_CPU_X86_SSE, SIMD_EMIT_BINARY },
+ { SN_get_X, 0, MONO_CPU_X86_SSE, SIMD_EMIT_GETTER_QWORD },
+ { SN_get_Y, 1, MONO_CPU_X86_SSE, SIMD_EMIT_GETTER_QWORD },
+ { SN_op_Addition, OP_PADDQ, MONO_CPU_X86_SSE, SIMD_EMIT_BINARY },
+ { SN_op_BitwiseAnd, OP_PAND, MONO_CPU_X86_SSE, SIMD_EMIT_BINARY },
+ { SN_op_BitwiseOr, OP_POR, MONO_CPU_X86_SSE, SIMD_EMIT_BINARY },
+ { SN_op_ExclusiveOr, OP_PXOR, MONO_CPU_X86_SSE, SIMD_EMIT_BINARY },
+ { SN_op_Explicit, 0, MONO_CPU_X86_SSE, SIMD_EMIT_CAST },
+ { SN_op_LeftShift, OP_PSHLQ, MONO_CPU_X86_SSE, SIMD_EMIT_SHIFT },
+ { SN_op_Multiply, OP_PMULQ, MONO_CPU_X86_SSE, SIMD_EMIT_BINARY },
+ { SN_op_Subtraction, OP_PSUBQ, MONO_CPU_X86_SSE, SIMD_EMIT_BINARY },
+ { SN_set_X, 0, MONO_CPU_X86_SSE, SIMD_EMIT_SETTER },
+ { SN_set_Y, 1, MONO_CPU_X86_SSE, SIMD_EMIT_SETTER },
};
static const SimdIntrinsic vector4ui_intrinsics[] = {
- { SN_ctor, OP_EXPAND_I4, SIMD_VERSION_SSE1, SIMD_EMIT_CTOR },
- { SN_ArithmeticRightShift, OP_PSARD, SIMD_VERSION_SSE1, SIMD_EMIT_SHIFT },
- { SN_CompareEqual, OP_PCMPEQD, SIMD_VERSION_SSE1, SIMD_EMIT_BINARY },
- { SN_LoadAligned, 0, SIMD_VERSION_SSE1, SIMD_EMIT_LOAD_ALIGNED },
- { SN_Max, OP_PMAXD_UN, SIMD_VERSION_SSE41, SIMD_EMIT_BINARY },
- { SN_Min, OP_PMIND_UN, SIMD_VERSION_SSE41, SIMD_EMIT_BINARY },
- { SN_PrefetchTemporalAllCacheLevels, 0, SIMD_VERSION_SSE1, SIMD_EMIT_PREFETCH, SIMD_PREFETCH_MODE_0 },
- { SN_PrefetchTemporal1stLevelCache, 0, SIMD_VERSION_SSE1, SIMD_EMIT_PREFETCH, SIMD_PREFETCH_MODE_1 },
- { SN_PrefetchTemporal2ndLevelCache, 0, SIMD_VERSION_SSE1, SIMD_EMIT_PREFETCH, SIMD_PREFETCH_MODE_2 },
- { SN_PrefetchNonTemporal, 0, SIMD_VERSION_SSE1, SIMD_EMIT_PREFETCH, SIMD_PREFETCH_MODE_NTA },
- { SN_Shuffle, OP_PSHUFLED, SIMD_VERSION_SSE1, SIMD_EMIT_SHUFFLE },
- { SN_SignedPackWithSignedSaturation, OP_PACKD, SIMD_VERSION_SSE1, SIMD_EMIT_BINARY },
- { SN_SignedPackWithUnsignedSaturation, OP_PACKD_UN, SIMD_VERSION_SSE41, SIMD_EMIT_BINARY },
- { SN_StoreAligned, OP_STOREX_ALIGNED_MEMBASE_REG, SIMD_VERSION_SSE1, SIMD_EMIT_STORE },
- { SN_UnpackHigh, OP_UNPACK_HIGHD, SIMD_VERSION_SSE1, SIMD_EMIT_BINARY },
- { SN_UnpackLow, OP_UNPACK_LOWD, SIMD_VERSION_SSE1, SIMD_EMIT_BINARY },
- { SN_get_W, 3, SIMD_VERSION_SSE1, SIMD_EMIT_GETTER },
- { SN_get_X, 0, SIMD_VERSION_SSE1, SIMD_EMIT_GETTER },
- { SN_get_Y, 1, SIMD_VERSION_SSE1, SIMD_EMIT_GETTER },
- { SN_get_Z, 2, SIMD_VERSION_SSE1, SIMD_EMIT_GETTER },
- { SN_op_Addition, OP_PADDD, SIMD_VERSION_SSE1, SIMD_EMIT_BINARY },
- { SN_op_BitwiseAnd, OP_PAND, SIMD_VERSION_SSE1, SIMD_EMIT_BINARY },
- { SN_op_BitwiseOr, OP_POR, SIMD_VERSION_SSE1, SIMD_EMIT_BINARY },
- { SN_op_Equality, OP_PCMPEQD, SIMD_VERSION_SSE1, SIMD_EMIT_EQUALITY, SIMD_COMP_EQ },
- { SN_op_ExclusiveOr, OP_PXOR, SIMD_VERSION_SSE1, SIMD_EMIT_BINARY },
- { SN_op_Explicit, 0, SIMD_VERSION_SSE1, SIMD_EMIT_CAST },
- { SN_op_Inequality, OP_PCMPEQD, SIMD_VERSION_SSE1, SIMD_EMIT_EQUALITY, SIMD_COMP_NEQ },
- { SN_op_LeftShift, OP_PSHLD, SIMD_VERSION_SSE1, SIMD_EMIT_SHIFT },
- { SN_op_Multiply, OP_PMULD, SIMD_VERSION_SSE41, SIMD_EMIT_BINARY },
- { SN_op_RightShift, OP_PSHRD, SIMD_VERSION_SSE1, SIMD_EMIT_SHIFT },
- { SN_op_Subtraction, OP_PSUBD, SIMD_VERSION_SSE1, SIMD_EMIT_BINARY },
- { SN_set_W, 3, SIMD_VERSION_SSE1, SIMD_EMIT_SETTER },
- { SN_set_X, 0, SIMD_VERSION_SSE1, SIMD_EMIT_SETTER },
- { SN_set_Y, 1, SIMD_VERSION_SSE1, SIMD_EMIT_SETTER },
- { SN_set_Z, 2, SIMD_VERSION_SSE1, SIMD_EMIT_SETTER },
+ { SN_ctor, OP_EXPAND_I4, MONO_CPU_X86_SSE, SIMD_EMIT_CTOR },
+ { SN_ArithmeticRightShift, OP_PSARD, MONO_CPU_X86_SSE, SIMD_EMIT_SHIFT },
+ { SN_CompareEqual, OP_PCMPEQD, MONO_CPU_X86_SSE, SIMD_EMIT_BINARY },
+ { SN_LoadAligned, 0, MONO_CPU_X86_SSE, SIMD_EMIT_LOAD_ALIGNED },
+ { SN_Max, OP_PMAXD_UN, MONO_CPU_X86_SSE41, SIMD_EMIT_BINARY },
+ { SN_Min, OP_PMIND_UN, MONO_CPU_X86_SSE41, SIMD_EMIT_BINARY },
+ { SN_PrefetchTemporalAllCacheLevels, 0, MONO_CPU_X86_SSE, SIMD_EMIT_PREFETCH, SIMD_PREFETCH_MODE_0 },
+ { SN_PrefetchTemporal1stLevelCache, 0, MONO_CPU_X86_SSE, SIMD_EMIT_PREFETCH, SIMD_PREFETCH_MODE_1 },
+ { SN_PrefetchTemporal2ndLevelCache, 0, MONO_CPU_X86_SSE, SIMD_EMIT_PREFETCH, SIMD_PREFETCH_MODE_2 },
+ { SN_PrefetchNonTemporal, 0, MONO_CPU_X86_SSE, SIMD_EMIT_PREFETCH, SIMD_PREFETCH_MODE_NTA },
+ { SN_Shuffle, OP_PSHUFLED, MONO_CPU_X86_SSE, SIMD_EMIT_SHUFFLE },
+ { SN_SignedPackWithSignedSaturation, OP_PACKD, MONO_CPU_X86_SSE, SIMD_EMIT_BINARY },
+ { SN_SignedPackWithUnsignedSaturation, OP_PACKD_UN, MONO_CPU_X86_SSE41, SIMD_EMIT_BINARY },
+ { SN_StoreAligned, OP_STOREX_ALIGNED_MEMBASE_REG, MONO_CPU_X86_SSE, SIMD_EMIT_STORE },
+ { SN_UnpackHigh, OP_UNPACK_HIGHD, MONO_CPU_X86_SSE, SIMD_EMIT_BINARY },
+ { SN_UnpackLow, OP_UNPACK_LOWD, MONO_CPU_X86_SSE, SIMD_EMIT_BINARY },
+ { SN_get_W, 3, MONO_CPU_X86_SSE, SIMD_EMIT_GETTER },
+ { SN_get_X, 0, MONO_CPU_X86_SSE, SIMD_EMIT_GETTER },
+ { SN_get_Y, 1, MONO_CPU_X86_SSE, SIMD_EMIT_GETTER },
+ { SN_get_Z, 2, MONO_CPU_X86_SSE, SIMD_EMIT_GETTER },
+ { SN_op_Addition, OP_PADDD, MONO_CPU_X86_SSE, SIMD_EMIT_BINARY },
+ { SN_op_BitwiseAnd, OP_PAND, MONO_CPU_X86_SSE, SIMD_EMIT_BINARY },
+ { SN_op_BitwiseOr, OP_POR, MONO_CPU_X86_SSE, SIMD_EMIT_BINARY },
+ { SN_op_Equality, OP_PCMPEQD, MONO_CPU_X86_SSE, SIMD_EMIT_EQUALITY, SIMD_COMP_EQ },
+ { SN_op_ExclusiveOr, OP_PXOR, MONO_CPU_X86_SSE, SIMD_EMIT_BINARY },
+ { SN_op_Explicit, 0, MONO_CPU_X86_SSE, SIMD_EMIT_CAST },
+ { SN_op_Inequality, OP_PCMPEQD, MONO_CPU_X86_SSE, SIMD_EMIT_EQUALITY, SIMD_COMP_NEQ },
+ { SN_op_LeftShift, OP_PSHLD, MONO_CPU_X86_SSE, SIMD_EMIT_SHIFT },
+ { SN_op_Multiply, OP_PMULD, MONO_CPU_X86_SSE41, SIMD_EMIT_BINARY },
+ { SN_op_RightShift, OP_PSHRD, MONO_CPU_X86_SSE, SIMD_EMIT_SHIFT },
+ { SN_op_Subtraction, OP_PSUBD, MONO_CPU_X86_SSE, SIMD_EMIT_BINARY },
+ { SN_set_W, 3, MONO_CPU_X86_SSE, SIMD_EMIT_SETTER },
+ { SN_set_X, 0, MONO_CPU_X86_SSE, SIMD_EMIT_SETTER },
+ { SN_set_Y, 1, MONO_CPU_X86_SSE, SIMD_EMIT_SETTER },
+ { SN_set_Z, 2, MONO_CPU_X86_SSE, SIMD_EMIT_SETTER },
};
static const SimdIntrinsic vector4i_intrinsics[] = {
- { SN_ctor, OP_EXPAND_I4, SIMD_VERSION_SSE1, SIMD_EMIT_CTOR },
- { SN_CompareEqual, OP_PCMPEQD, SIMD_VERSION_SSE1, SIMD_EMIT_BINARY },
- { SN_CompareGreaterThan, OP_PCMPGTD, SIMD_VERSION_SSE1, SIMD_EMIT_BINARY },
- { SN_ConvertToDouble, OP_CVTDQ2PD, SIMD_VERSION_SSE2, SIMD_EMIT_UNARY },
- { SN_ConvertToFloat, OP_CVTDQ2PS, SIMD_VERSION_SSE2, SIMD_EMIT_UNARY },
- { SN_LoadAligned, 0, SIMD_VERSION_SSE1, SIMD_EMIT_LOAD_ALIGNED },
- { SN_LogicalRightShift, OP_PSHRD, SIMD_VERSION_SSE1, SIMD_EMIT_SHIFT },
- { SN_Max, OP_PMAXD, SIMD_VERSION_SSE41, SIMD_EMIT_BINARY },
- { SN_Min, OP_PMIND, SIMD_VERSION_SSE41, SIMD_EMIT_BINARY },
- { SN_PackWithSignedSaturation, OP_PACKD, SIMD_VERSION_SSE1, SIMD_EMIT_BINARY },
- { SN_PackWithUnsignedSaturation, OP_PACKD_UN, SIMD_VERSION_SSE41, SIMD_EMIT_BINARY },
- { SN_PrefetchTemporalAllCacheLevels, 0, SIMD_VERSION_SSE1, SIMD_EMIT_PREFETCH, SIMD_PREFETCH_MODE_0 },
- { SN_PrefetchTemporal1stLevelCache, 0, SIMD_VERSION_SSE1, SIMD_EMIT_PREFETCH, SIMD_PREFETCH_MODE_1 },
- { SN_PrefetchTemporal2ndLevelCache, 0, SIMD_VERSION_SSE1, SIMD_EMIT_PREFETCH, SIMD_PREFETCH_MODE_2 },
- { SN_PrefetchNonTemporal, 0, SIMD_VERSION_SSE1, SIMD_EMIT_PREFETCH, SIMD_PREFETCH_MODE_NTA },
- { SN_Shuffle, OP_PSHUFLED, SIMD_VERSION_SSE1, SIMD_EMIT_SHUFFLE },
- { SN_StoreAligned, OP_STOREX_ALIGNED_MEMBASE_REG, SIMD_VERSION_SSE1, SIMD_EMIT_STORE },
- { SN_UnpackHigh, OP_UNPACK_HIGHD, SIMD_VERSION_SSE1, SIMD_EMIT_BINARY },
- { SN_UnpackLow, OP_UNPACK_LOWD, SIMD_VERSION_SSE1, SIMD_EMIT_BINARY },
- { SN_get_W, 3, SIMD_VERSION_SSE1, SIMD_EMIT_GETTER },
- { SN_get_X, 0, SIMD_VERSION_SSE1, SIMD_EMIT_GETTER },
- { SN_get_Y, 1, SIMD_VERSION_SSE1, SIMD_EMIT_GETTER },
- { SN_get_Z, 2, SIMD_VERSION_SSE1, SIMD_EMIT_GETTER },
- { SN_op_Addition, OP_PADDD, SIMD_VERSION_SSE1, SIMD_EMIT_BINARY },
- { SN_op_BitwiseAnd, OP_PAND, SIMD_VERSION_SSE1, SIMD_EMIT_BINARY },
- { SN_op_BitwiseOr, OP_POR, SIMD_VERSION_SSE1, SIMD_EMIT_BINARY },
- { SN_op_Equality, OP_PCMPEQD, SIMD_VERSION_SSE1, SIMD_EMIT_EQUALITY, SIMD_COMP_EQ },
- { SN_op_ExclusiveOr, OP_PXOR, SIMD_VERSION_SSE1, SIMD_EMIT_BINARY },
- { SN_op_Explicit, 0, SIMD_VERSION_SSE1, SIMD_EMIT_CAST },
- { SN_op_Inequality, OP_PCMPEQD, SIMD_VERSION_SSE1, SIMD_EMIT_EQUALITY, SIMD_COMP_NEQ },
- { SN_op_LeftShift, OP_PSHLD, SIMD_VERSION_SSE1, SIMD_EMIT_SHIFT },
- { SN_op_Multiply, OP_PMULD, SIMD_VERSION_SSE41, SIMD_EMIT_BINARY },
- { SN_op_RightShift, OP_PSARD, SIMD_VERSION_SSE1, SIMD_EMIT_SHIFT },
- { SN_op_Subtraction, OP_PSUBD, SIMD_VERSION_SSE1, SIMD_EMIT_BINARY },
- { SN_set_W, 3, SIMD_VERSION_SSE1, SIMD_EMIT_SETTER },
- { SN_set_X, 0, SIMD_VERSION_SSE1, SIMD_EMIT_SETTER },
- { SN_set_Y, 1, SIMD_VERSION_SSE1, SIMD_EMIT_SETTER },
- { SN_set_Z, 2, SIMD_VERSION_SSE1, SIMD_EMIT_SETTER },
+ { SN_ctor, OP_EXPAND_I4, MONO_CPU_X86_SSE, SIMD_EMIT_CTOR },
+ { SN_CompareEqual, OP_PCMPEQD, MONO_CPU_X86_SSE, SIMD_EMIT_BINARY },
+ { SN_CompareGreaterThan, OP_PCMPGTD, MONO_CPU_X86_SSE, SIMD_EMIT_BINARY },
+ { SN_ConvertToDouble, OP_CVTDQ2PD, MONO_CPU_X86_SSE2, SIMD_EMIT_UNARY },
+ { SN_ConvertToFloat, OP_CVTDQ2PS, MONO_CPU_X86_SSE2, SIMD_EMIT_UNARY },
+ { SN_LoadAligned, 0, MONO_CPU_X86_SSE, SIMD_EMIT_LOAD_ALIGNED },
+ { SN_LogicalRightShift, OP_PSHRD, MONO_CPU_X86_SSE, SIMD_EMIT_SHIFT },
+ { SN_Max, OP_PMAXD, MONO_CPU_X86_SSE41, SIMD_EMIT_BINARY },
+ { SN_Min, OP_PMIND, MONO_CPU_X86_SSE41, SIMD_EMIT_BINARY },
+ { SN_PackWithSignedSaturation, OP_PACKD, MONO_CPU_X86_SSE, SIMD_EMIT_BINARY },
+ { SN_PackWithUnsignedSaturation, OP_PACKD_UN, MONO_CPU_X86_SSE41, SIMD_EMIT_BINARY },
+ { SN_PrefetchTemporalAllCacheLevels, 0, MONO_CPU_X86_SSE, SIMD_EMIT_PREFETCH, SIMD_PREFETCH_MODE_0 },
+ { SN_PrefetchTemporal1stLevelCache, 0, MONO_CPU_X86_SSE, SIMD_EMIT_PREFETCH, SIMD_PREFETCH_MODE_1 },
+ { SN_PrefetchTemporal2ndLevelCache, 0, MONO_CPU_X86_SSE, SIMD_EMIT_PREFETCH, SIMD_PREFETCH_MODE_2 },
+ { SN_PrefetchNonTemporal, 0, MONO_CPU_X86_SSE, SIMD_EMIT_PREFETCH, SIMD_PREFETCH_MODE_NTA },
+ { SN_Shuffle, OP_PSHUFLED, MONO_CPU_X86_SSE, SIMD_EMIT_SHUFFLE },
+ { SN_StoreAligned, OP_STOREX_ALIGNED_MEMBASE_REG, MONO_CPU_X86_SSE, SIMD_EMIT_STORE },
+ { SN_UnpackHigh, OP_UNPACK_HIGHD, MONO_CPU_X86_SSE, SIMD_EMIT_BINARY },
+ { SN_UnpackLow, OP_UNPACK_LOWD, MONO_CPU_X86_SSE, SIMD_EMIT_BINARY },
+ { SN_get_W, 3, MONO_CPU_X86_SSE, SIMD_EMIT_GETTER },
+ { SN_get_X, 0, MONO_CPU_X86_SSE, SIMD_EMIT_GETTER },
+ { SN_get_Y, 1, MONO_CPU_X86_SSE, SIMD_EMIT_GETTER },
+ { SN_get_Z, 2, MONO_CPU_X86_SSE, SIMD_EMIT_GETTER },
+ { SN_op_Addition, OP_PADDD, MONO_CPU_X86_SSE, SIMD_EMIT_BINARY },
+ { SN_op_BitwiseAnd, OP_PAND, MONO_CPU_X86_SSE, SIMD_EMIT_BINARY },
+ { SN_op_BitwiseOr, OP_POR, MONO_CPU_X86_SSE, SIMD_EMIT_BINARY },
+ { SN_op_Equality, OP_PCMPEQD, MONO_CPU_X86_SSE, SIMD_EMIT_EQUALITY, SIMD_COMP_EQ },
+ { SN_op_ExclusiveOr, OP_PXOR, MONO_CPU_X86_SSE, SIMD_EMIT_BINARY },
+ { SN_op_Explicit, 0, MONO_CPU_X86_SSE, SIMD_EMIT_CAST },
+ { SN_op_Inequality, OP_PCMPEQD, MONO_CPU_X86_SSE, SIMD_EMIT_EQUALITY, SIMD_COMP_NEQ },
+ { SN_op_LeftShift, OP_PSHLD, MONO_CPU_X86_SSE, SIMD_EMIT_SHIFT },
+ { SN_op_Multiply, OP_PMULD, MONO_CPU_X86_SSE41, SIMD_EMIT_BINARY },
+ { SN_op_RightShift, OP_PSARD, MONO_CPU_X86_SSE, SIMD_EMIT_SHIFT },
+ { SN_op_Subtraction, OP_PSUBD, MONO_CPU_X86_SSE, SIMD_EMIT_BINARY },
+ { SN_set_W, 3, MONO_CPU_X86_SSE, SIMD_EMIT_SETTER },
+ { SN_set_X, 0, MONO_CPU_X86_SSE, SIMD_EMIT_SETTER },
+ { SN_set_Y, 1, MONO_CPU_X86_SSE, SIMD_EMIT_SETTER },
+ { SN_set_Z, 2, MONO_CPU_X86_SSE, SIMD_EMIT_SETTER },
};
static const SimdIntrinsic vector8us_intrinsics[] = {
- { SN_ctor, OP_EXPAND_I2, SIMD_VERSION_SSE1, SIMD_EMIT_CTOR },
- { SN_AddWithSaturation, OP_PADDW_SAT_UN, SIMD_VERSION_SSE1, SIMD_EMIT_BINARY },
- { SN_ArithmeticRightShift, OP_PSARW, SIMD_VERSION_SSE1, SIMD_EMIT_SHIFT },
- { SN_Average, OP_PAVGW_UN, SIMD_VERSION_SSE1, SIMD_EMIT_BINARY },
- { SN_CompareEqual, OP_PCMPEQW, SIMD_VERSION_SSE1, SIMD_EMIT_BINARY, SIMD_VERSION_SSE1 },
- { SN_LoadAligned, 0, SIMD_VERSION_SSE1, SIMD_EMIT_LOAD_ALIGNED },
- { SN_Max, OP_PMAXW_UN, SIMD_VERSION_SSE41, SIMD_EMIT_BINARY },
- { SN_Min, OP_PMINW_UN, SIMD_VERSION_SSE41, SIMD_EMIT_BINARY },
- { SN_MultiplyStoreHigh, OP_PMULW_HIGH_UN, SIMD_VERSION_SSE1, SIMD_EMIT_BINARY },
- { SN_PrefetchTemporalAllCacheLevels, 0, SIMD_VERSION_SSE1, SIMD_EMIT_PREFETCH, SIMD_PREFETCH_MODE_0 },
- { SN_PrefetchTemporal1stLevelCache, 0, SIMD_VERSION_SSE1, SIMD_EMIT_PREFETCH, SIMD_PREFETCH_MODE_1 },
- { SN_PrefetchTemporal2ndLevelCache, 0, SIMD_VERSION_SSE1, SIMD_EMIT_PREFETCH, SIMD_PREFETCH_MODE_2 },
- { SN_PrefetchNonTemporal, 0, SIMD_VERSION_SSE1, SIMD_EMIT_PREFETCH, SIMD_PREFETCH_MODE_NTA },
- { SN_ShuffleHigh, OP_PSHUFLEW_HIGH, SIMD_VERSION_SSE1, SIMD_EMIT_SHUFFLE },
- { SN_ShuffleLow, OP_PSHUFLEW_LOW, SIMD_VERSION_SSE1, SIMD_EMIT_SHUFFLE },
- { SN_SignedPackWithSignedSaturation, OP_PACKW, SIMD_VERSION_SSE1, SIMD_EMIT_BINARY },
- { SN_SignedPackWithUnsignedSaturation, OP_PACKW_UN, SIMD_VERSION_SSE1, SIMD_EMIT_BINARY },
- { SN_StoreAligned, OP_STOREX_ALIGNED_MEMBASE_REG, SIMD_VERSION_SSE1, SIMD_EMIT_STORE },
- { SN_SubtractWithSaturation, OP_PSUBW_SAT_UN, SIMD_VERSION_SSE1, SIMD_EMIT_BINARY },
- { SN_UnpackHigh, OP_UNPACK_HIGHW, SIMD_VERSION_SSE1, SIMD_EMIT_BINARY },
- { SN_UnpackLow, OP_UNPACK_LOWW, SIMD_VERSION_SSE1, SIMD_EMIT_BINARY },
- { SN_get_V0, 0, SIMD_VERSION_SSE1, SIMD_EMIT_GETTER },
- { SN_get_V1, 1, SIMD_VERSION_SSE1, SIMD_EMIT_GETTER },
- { SN_get_V2, 2, SIMD_VERSION_SSE1, SIMD_EMIT_GETTER },
- { SN_get_V3, 3, SIMD_VERSION_SSE1, SIMD_EMIT_GETTER },
- { SN_get_V4, 4, SIMD_VERSION_SSE1, SIMD_EMIT_GETTER },
- { SN_get_V5, 5, SIMD_VERSION_SSE1, SIMD_EMIT_GETTER },
- { SN_get_V6, 6, SIMD_VERSION_SSE1, SIMD_EMIT_GETTER },
- { SN_get_V7, 7, SIMD_VERSION_SSE1, SIMD_EMIT_GETTER },
- { SN_op_Addition, OP_PADDW, SIMD_VERSION_SSE1, SIMD_EMIT_BINARY },
- { SN_op_BitwiseAnd, OP_PAND, SIMD_VERSION_SSE1, SIMD_EMIT_BINARY },
- { SN_op_BitwiseOr, OP_POR, SIMD_VERSION_SSE1, SIMD_EMIT_BINARY },
- { SN_op_Equality, OP_PCMPEQW, SIMD_VERSION_SSE1, SIMD_EMIT_EQUALITY, SIMD_COMP_EQ },
- { SN_op_ExclusiveOr, OP_PXOR, SIMD_VERSION_SSE1, SIMD_EMIT_BINARY },
- { SN_op_Explicit, 0, SIMD_VERSION_SSE1, SIMD_EMIT_CAST },
- { SN_op_Inequality, OP_PCMPEQW, SIMD_VERSION_SSE1, SIMD_EMIT_EQUALITY, SIMD_COMP_NEQ },
- { SN_op_LeftShift, OP_PSHLW, SIMD_VERSION_SSE1, SIMD_EMIT_SHIFT },
- { SN_op_Multiply, OP_PMULW, SIMD_VERSION_SSE1, SIMD_EMIT_BINARY },
- { SN_op_RightShift, OP_PSHRW, SIMD_VERSION_SSE1, SIMD_EMIT_SHIFT },
- { SN_op_Subtraction, OP_PSUBW, SIMD_VERSION_SSE1, SIMD_EMIT_BINARY },
- { SN_set_V0, 0, SIMD_VERSION_SSE1, SIMD_EMIT_SETTER },
- { SN_set_V1, 1, SIMD_VERSION_SSE1, SIMD_EMIT_SETTER },
- { SN_set_V2, 2, SIMD_VERSION_SSE1, SIMD_EMIT_SETTER },
- { SN_set_V3, 3, SIMD_VERSION_SSE1, SIMD_EMIT_SETTER },
- { SN_set_V4, 4, SIMD_VERSION_SSE1, SIMD_EMIT_SETTER },
- { SN_set_V5, 5, SIMD_VERSION_SSE1, SIMD_EMIT_SETTER },
- { SN_set_V6, 6, SIMD_VERSION_SSE1, SIMD_EMIT_SETTER },
- { SN_set_V7, 7, SIMD_VERSION_SSE1, SIMD_EMIT_SETTER },
+ { SN_ctor, OP_EXPAND_I2, MONO_CPU_X86_SSE, SIMD_EMIT_CTOR },
+ { SN_AddWithSaturation, OP_PADDW_SAT_UN, MONO_CPU_X86_SSE, SIMD_EMIT_BINARY },
+ { SN_ArithmeticRightShift, OP_PSARW, MONO_CPU_X86_SSE, SIMD_EMIT_SHIFT },
+ { SN_Average, OP_PAVGW_UN, MONO_CPU_X86_SSE, SIMD_EMIT_BINARY },
+ { SN_CompareEqual, OP_PCMPEQW, MONO_CPU_X86_SSE, SIMD_EMIT_BINARY, MONO_CPU_X86_SSE },
+ { SN_LoadAligned, 0, MONO_CPU_X86_SSE, SIMD_EMIT_LOAD_ALIGNED },
+ { SN_Max, OP_PMAXW_UN, MONO_CPU_X86_SSE41, SIMD_EMIT_BINARY },
+ { SN_Min, OP_PMINW_UN, MONO_CPU_X86_SSE41, SIMD_EMIT_BINARY },
+ { SN_MultiplyStoreHigh, OP_PMULW_HIGH_UN, MONO_CPU_X86_SSE, SIMD_EMIT_BINARY },
+ { SN_PrefetchTemporalAllCacheLevels, 0, MONO_CPU_X86_SSE, SIMD_EMIT_PREFETCH, SIMD_PREFETCH_MODE_0 },
+ { SN_PrefetchTemporal1stLevelCache, 0, MONO_CPU_X86_SSE, SIMD_EMIT_PREFETCH, SIMD_PREFETCH_MODE_1 },
+ { SN_PrefetchTemporal2ndLevelCache, 0, MONO_CPU_X86_SSE, SIMD_EMIT_PREFETCH, SIMD_PREFETCH_MODE_2 },
+ { SN_PrefetchNonTemporal, 0, MONO_CPU_X86_SSE, SIMD_EMIT_PREFETCH, SIMD_PREFETCH_MODE_NTA },
+ { SN_ShuffleHigh, OP_PSHUFLEW_HIGH, MONO_CPU_X86_SSE, SIMD_EMIT_SHUFFLE },
+ { SN_ShuffleLow, OP_PSHUFLEW_LOW, MONO_CPU_X86_SSE, SIMD_EMIT_SHUFFLE },
+ { SN_SignedPackWithSignedSaturation, OP_PACKW, MONO_CPU_X86_SSE, SIMD_EMIT_BINARY },
+ { SN_SignedPackWithUnsignedSaturation, OP_PACKW_UN, MONO_CPU_X86_SSE, SIMD_EMIT_BINARY },
+ { SN_StoreAligned, OP_STOREX_ALIGNED_MEMBASE_REG, MONO_CPU_X86_SSE, SIMD_EMIT_STORE },
+ { SN_SubtractWithSaturation, OP_PSUBW_SAT_UN, MONO_CPU_X86_SSE, SIMD_EMIT_BINARY },
+ { SN_UnpackHigh, OP_UNPACK_HIGHW, MONO_CPU_X86_SSE, SIMD_EMIT_BINARY },
+ { SN_UnpackLow, OP_UNPACK_LOWW, MONO_CPU_X86_SSE, SIMD_EMIT_BINARY },
+ { SN_get_V0, 0, MONO_CPU_X86_SSE, SIMD_EMIT_GETTER },
+ { SN_get_V1, 1, MONO_CPU_X86_SSE, SIMD_EMIT_GETTER },
+ { SN_get_V2, 2, MONO_CPU_X86_SSE, SIMD_EMIT_GETTER },
+ { SN_get_V3, 3, MONO_CPU_X86_SSE, SIMD_EMIT_GETTER },
+ { SN_get_V4, 4, MONO_CPU_X86_SSE, SIMD_EMIT_GETTER },
+ { SN_get_V5, 5, MONO_CPU_X86_SSE, SIMD_EMIT_GETTER },
+ { SN_get_V6, 6, MONO_CPU_X86_SSE, SIMD_EMIT_GETTER },
+ { SN_get_V7, 7, MONO_CPU_X86_SSE, SIMD_EMIT_GETTER },
+ { SN_op_Addition, OP_PADDW, MONO_CPU_X86_SSE, SIMD_EMIT_BINARY },
+ { SN_op_BitwiseAnd, OP_PAND, MONO_CPU_X86_SSE, SIMD_EMIT_BINARY },
+ { SN_op_BitwiseOr, OP_POR, MONO_CPU_X86_SSE, SIMD_EMIT_BINARY },
+ { SN_op_Equality, OP_PCMPEQW, MONO_CPU_X86_SSE, SIMD_EMIT_EQUALITY, SIMD_COMP_EQ },
+ { SN_op_ExclusiveOr, OP_PXOR, MONO_CPU_X86_SSE, SIMD_EMIT_BINARY },
+ { SN_op_Explicit, 0, MONO_CPU_X86_SSE, SIMD_EMIT_CAST },
+ { SN_op_Inequality, OP_PCMPEQW, MONO_CPU_X86_SSE, SIMD_EMIT_EQUALITY, SIMD_COMP_NEQ },
+ { SN_op_LeftShift, OP_PSHLW, MONO_CPU_X86_SSE, SIMD_EMIT_SHIFT },
+ { SN_op_Multiply, OP_PMULW, MONO_CPU_X86_SSE, SIMD_EMIT_BINARY },
+ { SN_op_RightShift, OP_PSHRW, MONO_CPU_X86_SSE, SIMD_EMIT_SHIFT },
+ { SN_op_Subtraction, OP_PSUBW, MONO_CPU_X86_SSE, SIMD_EMIT_BINARY },
+ { SN_set_V0, 0, MONO_CPU_X86_SSE, SIMD_EMIT_SETTER },
+ { SN_set_V1, 1, MONO_CPU_X86_SSE, SIMD_EMIT_SETTER },
+ { SN_set_V2, 2, MONO_CPU_X86_SSE, SIMD_EMIT_SETTER },
+ { SN_set_V3, 3, MONO_CPU_X86_SSE, SIMD_EMIT_SETTER },
+ { SN_set_V4, 4, MONO_CPU_X86_SSE, SIMD_EMIT_SETTER },
+ { SN_set_V5, 5, MONO_CPU_X86_SSE, SIMD_EMIT_SETTER },
+ { SN_set_V6, 6, MONO_CPU_X86_SSE, SIMD_EMIT_SETTER },
+ { SN_set_V7, 7, MONO_CPU_X86_SSE, SIMD_EMIT_SETTER },
};
static const SimdIntrinsic vector8s_intrinsics[] = {
- { SN_ctor, OP_EXPAND_I2, SIMD_VERSION_SSE1, SIMD_EMIT_CTOR },
- { SN_AddWithSaturation, OP_PADDW_SAT, SIMD_VERSION_SSE1, SIMD_EMIT_BINARY },
- { SN_CompareEqual, OP_PCMPEQW, SIMD_VERSION_SSE1, SIMD_EMIT_BINARY },
- { SN_CompareGreaterThan, OP_PCMPGTW, SIMD_VERSION_SSE1, SIMD_EMIT_BINARY },
- { SN_LoadAligned, 0, SIMD_VERSION_SSE1, SIMD_EMIT_LOAD_ALIGNED },
- { SN_LogicalRightShift, OP_PSHRW, SIMD_VERSION_SSE1, SIMD_EMIT_SHIFT },
- { SN_Max, OP_PMAXW, SIMD_VERSION_SSE1, SIMD_EMIT_BINARY },
- { SN_Min, OP_PMINW, SIMD_VERSION_SSE1, SIMD_EMIT_BINARY },
- { SN_MultiplyStoreHigh, OP_PMULW_HIGH, SIMD_VERSION_SSE1, SIMD_EMIT_BINARY },
- { SN_PackWithSignedSaturation, OP_PACKW, SIMD_VERSION_SSE1, SIMD_EMIT_BINARY },
- { SN_PackWithUnsignedSaturation, OP_PACKW_UN, SIMD_VERSION_SSE1, SIMD_EMIT_BINARY },
- { SN_PrefetchTemporalAllCacheLevels, 0, SIMD_VERSION_SSE1, SIMD_EMIT_PREFETCH, SIMD_PREFETCH_MODE_0 },
- { SN_PrefetchTemporal1stLevelCache, 0, SIMD_VERSION_SSE1, SIMD_EMIT_PREFETCH, SIMD_PREFETCH_MODE_1 },
- { SN_PrefetchTemporal2ndLevelCache, 0, SIMD_VERSION_SSE1, SIMD_EMIT_PREFETCH, SIMD_PREFETCH_MODE_2 },
- { SN_PrefetchNonTemporal, 0, SIMD_VERSION_SSE1, SIMD_EMIT_PREFETCH, SIMD_PREFETCH_MODE_NTA },
- { SN_ShuffleHigh, OP_PSHUFLEW_HIGH, SIMD_VERSION_SSE1, SIMD_EMIT_SHUFFLE },
- { SN_ShuffleLow, OP_PSHUFLEW_LOW, SIMD_VERSION_SSE1, SIMD_EMIT_SHUFFLE },
- { SN_StoreAligned, OP_STOREX_ALIGNED_MEMBASE_REG, SIMD_VERSION_SSE1, SIMD_EMIT_STORE },
- { SN_SubtractWithSaturation, OP_PSUBW_SAT_UN, SIMD_VERSION_SSE1, SIMD_EMIT_BINARY },
- { SN_UnpackHigh, OP_UNPACK_HIGHW, SIMD_VERSION_SSE1, SIMD_EMIT_BINARY },
- { SN_UnpackLow, OP_UNPACK_LOWW, SIMD_VERSION_SSE1, SIMD_EMIT_BINARY },
- { SN_get_V0, 0, SIMD_VERSION_SSE1, SIMD_EMIT_GETTER },
- { SN_get_V1, 1, SIMD_VERSION_SSE1, SIMD_EMIT_GETTER },
- { SN_get_V2, 2, SIMD_VERSION_SSE1, SIMD_EMIT_GETTER },
- { SN_get_V3, 3, SIMD_VERSION_SSE1, SIMD_EMIT_GETTER },
- { SN_get_V4, 4, SIMD_VERSION_SSE1, SIMD_EMIT_GETTER },
- { SN_get_V5, 5, SIMD_VERSION_SSE1, SIMD_EMIT_GETTER },
- { SN_get_V6, 6, SIMD_VERSION_SSE1, SIMD_EMIT_GETTER },
- { SN_get_V7, 7, SIMD_VERSION_SSE1, SIMD_EMIT_GETTER },
- { SN_op_Addition, OP_PADDW, SIMD_VERSION_SSE1, SIMD_EMIT_BINARY },
- { SN_op_BitwiseAnd, OP_PAND, SIMD_VERSION_SSE1, SIMD_EMIT_BINARY },
- { SN_op_BitwiseOr, OP_POR, SIMD_VERSION_SSE1, SIMD_EMIT_BINARY },
- { SN_op_Equality, OP_PCMPEQW, SIMD_VERSION_SSE1, SIMD_EMIT_EQUALITY, SIMD_COMP_EQ },
- { SN_op_ExclusiveOr, OP_PXOR, SIMD_VERSION_SSE1, SIMD_EMIT_BINARY },
- { SN_op_Explicit, 0, SIMD_VERSION_SSE1, SIMD_EMIT_CAST },
- { SN_op_Inequality, OP_PCMPEQW, SIMD_VERSION_SSE1, SIMD_EMIT_EQUALITY, SIMD_COMP_NEQ },
- { SN_op_LeftShift, OP_PSHLW, SIMD_VERSION_SSE1, SIMD_EMIT_SHIFT },
- { SN_op_Multiply, OP_PMULW, SIMD_VERSION_SSE1, SIMD_EMIT_BINARY },
- { SN_op_RightShift, OP_PSARW, SIMD_VERSION_SSE1, SIMD_EMIT_SHIFT },
- { SN_op_Subtraction, OP_PSUBW, SIMD_VERSION_SSE1, SIMD_EMIT_BINARY },
- { SN_set_V0, 0, SIMD_VERSION_SSE1, SIMD_EMIT_SETTER },
- { SN_set_V1, 1, SIMD_VERSION_SSE1, SIMD_EMIT_SETTER },
- { SN_set_V2, 2, SIMD_VERSION_SSE1, SIMD_EMIT_SETTER },
- { SN_set_V3, 3, SIMD_VERSION_SSE1, SIMD_EMIT_SETTER },
- { SN_set_V4, 4, SIMD_VERSION_SSE1, SIMD_EMIT_SETTER },
- { SN_set_V5, 5, SIMD_VERSION_SSE1, SIMD_EMIT_SETTER },
- { SN_set_V6, 6, SIMD_VERSION_SSE1, SIMD_EMIT_SETTER },
- { SN_set_V7, 7, SIMD_VERSION_SSE1, SIMD_EMIT_SETTER },
+ { SN_ctor, OP_EXPAND_I2, MONO_CPU_X86_SSE, SIMD_EMIT_CTOR },
+ { SN_AddWithSaturation, OP_PADDW_SAT, MONO_CPU_X86_SSE, SIMD_EMIT_BINARY },
+ { SN_CompareEqual, OP_PCMPEQW, MONO_CPU_X86_SSE, SIMD_EMIT_BINARY },
+ { SN_CompareGreaterThan, OP_PCMPGTW, MONO_CPU_X86_SSE, SIMD_EMIT_BINARY },
+ { SN_LoadAligned, 0, MONO_CPU_X86_SSE, SIMD_EMIT_LOAD_ALIGNED },
+ { SN_LogicalRightShift, OP_PSHRW, MONO_CPU_X86_SSE, SIMD_EMIT_SHIFT },
+ { SN_Max, OP_PMAXW, MONO_CPU_X86_SSE, SIMD_EMIT_BINARY },
+ { SN_Min, OP_PMINW, MONO_CPU_X86_SSE, SIMD_EMIT_BINARY },
+ { SN_MultiplyStoreHigh, OP_PMULW_HIGH, MONO_CPU_X86_SSE, SIMD_EMIT_BINARY },
+ { SN_PackWithSignedSaturation, OP_PACKW, MONO_CPU_X86_SSE, SIMD_EMIT_BINARY },
+ { SN_PackWithUnsignedSaturation, OP_PACKW_UN, MONO_CPU_X86_SSE, SIMD_EMIT_BINARY },
+ { SN_PrefetchTemporalAllCacheLevels, 0, MONO_CPU_X86_SSE, SIMD_EMIT_PREFETCH, SIMD_PREFETCH_MODE_0 },
+ { SN_PrefetchTemporal1stLevelCache, 0, MONO_CPU_X86_SSE, SIMD_EMIT_PREFETCH, SIMD_PREFETCH_MODE_1 },
+ { SN_PrefetchTemporal2ndLevelCache, 0, MONO_CPU_X86_SSE, SIMD_EMIT_PREFETCH, SIMD_PREFETCH_MODE_2 },
+ { SN_PrefetchNonTemporal, 0, MONO_CPU_X86_SSE, SIMD_EMIT_PREFETCH, SIMD_PREFETCH_MODE_NTA },
+ { SN_ShuffleHigh, OP_PSHUFLEW_HIGH, MONO_CPU_X86_SSE, SIMD_EMIT_SHUFFLE },
+ { SN_ShuffleLow, OP_PSHUFLEW_LOW, MONO_CPU_X86_SSE, SIMD_EMIT_SHUFFLE },
+ { SN_StoreAligned, OP_STOREX_ALIGNED_MEMBASE_REG, MONO_CPU_X86_SSE, SIMD_EMIT_STORE },
+ { SN_SubtractWithSaturation, OP_PSUBW_SAT_UN, MONO_CPU_X86_SSE, SIMD_EMIT_BINARY },
+ { SN_UnpackHigh, OP_UNPACK_HIGHW, MONO_CPU_X86_SSE, SIMD_EMIT_BINARY },
+ { SN_UnpackLow, OP_UNPACK_LOWW, MONO_CPU_X86_SSE, SIMD_EMIT_BINARY },
+ { SN_get_V0, 0, MONO_CPU_X86_SSE, SIMD_EMIT_GETTER },
+ { SN_get_V1, 1, MONO_CPU_X86_SSE, SIMD_EMIT_GETTER },
+ { SN_get_V2, 2, MONO_CPU_X86_SSE, SIMD_EMIT_GETTER },
+ { SN_get_V3, 3, MONO_CPU_X86_SSE, SIMD_EMIT_GETTER },
+ { SN_get_V4, 4, MONO_CPU_X86_SSE, SIMD_EMIT_GETTER },
+ { SN_get_V5, 5, MONO_CPU_X86_SSE, SIMD_EMIT_GETTER },
+ { SN_get_V6, 6, MONO_CPU_X86_SSE, SIMD_EMIT_GETTER },
+ { SN_get_V7, 7, MONO_CPU_X86_SSE, SIMD_EMIT_GETTER },
+ { SN_op_Addition, OP_PADDW, MONO_CPU_X86_SSE, SIMD_EMIT_BINARY },
+ { SN_op_BitwiseAnd, OP_PAND, MONO_CPU_X86_SSE, SIMD_EMIT_BINARY },
+ { SN_op_BitwiseOr, OP_POR, MONO_CPU_X86_SSE, SIMD_EMIT_BINARY },
+ { SN_op_Equality, OP_PCMPEQW, MONO_CPU_X86_SSE, SIMD_EMIT_EQUALITY, SIMD_COMP_EQ },
+ { SN_op_ExclusiveOr, OP_PXOR, MONO_CPU_X86_SSE, SIMD_EMIT_BINARY },
+ { SN_op_Explicit, 0, MONO_CPU_X86_SSE, SIMD_EMIT_CAST },
+ { SN_op_Inequality, OP_PCMPEQW, MONO_CPU_X86_SSE, SIMD_EMIT_EQUALITY, SIMD_COMP_NEQ },
+ { SN_op_LeftShift, OP_PSHLW, MONO_CPU_X86_SSE, SIMD_EMIT_SHIFT },
+ { SN_op_Multiply, OP_PMULW, MONO_CPU_X86_SSE, SIMD_EMIT_BINARY },
+ { SN_op_RightShift, OP_PSARW, MONO_CPU_X86_SSE, SIMD_EMIT_SHIFT },
+ { SN_op_Subtraction, OP_PSUBW, MONO_CPU_X86_SSE, SIMD_EMIT_BINARY },
+ { SN_set_V0, 0, MONO_CPU_X86_SSE, SIMD_EMIT_SETTER },
+ { SN_set_V1, 1, MONO_CPU_X86_SSE, SIMD_EMIT_SETTER },
+ { SN_set_V2, 2, MONO_CPU_X86_SSE, SIMD_EMIT_SETTER },
+ { SN_set_V3, 3, MONO_CPU_X86_SSE, SIMD_EMIT_SETTER },
+ { SN_set_V4, 4, MONO_CPU_X86_SSE, SIMD_EMIT_SETTER },
+ { SN_set_V5, 5, MONO_CPU_X86_SSE, SIMD_EMIT_SETTER },
+ { SN_set_V6, 6, MONO_CPU_X86_SSE, SIMD_EMIT_SETTER },
+ { SN_set_V7, 7, MONO_CPU_X86_SSE, SIMD_EMIT_SETTER },
};
static const SimdIntrinsic vector16b_intrinsics[] = {
- { SN_ctor, OP_EXPAND_I1, SIMD_VERSION_SSE1, SIMD_EMIT_CTOR },
- { SN_AddWithSaturation, OP_PADDB_SAT_UN, SIMD_VERSION_SSE1, SIMD_EMIT_BINARY },
- { SN_Average, OP_PAVGB_UN, SIMD_VERSION_SSE1, SIMD_EMIT_BINARY },
- { SN_CompareEqual, OP_PCMPEQB, SIMD_VERSION_SSE1, SIMD_EMIT_BINARY },
- { SN_ExtractByteMask, 0, SIMD_VERSION_SSE1, SIMD_EMIT_EXTRACT_MASK },
- { SN_LoadAligned, 0, SIMD_VERSION_SSE1, SIMD_EMIT_LOAD_ALIGNED },
- { SN_Max, OP_PMAXB_UN, SIMD_VERSION_SSE1, SIMD_EMIT_BINARY },
- { SN_Min, OP_PMINB_UN, SIMD_VERSION_SSE1, SIMD_EMIT_BINARY },
- { SN_PrefetchTemporalAllCacheLevels, 0, SIMD_VERSION_SSE1, SIMD_EMIT_PREFETCH, SIMD_PREFETCH_MODE_0 },
- { SN_PrefetchTemporal1stLevelCache, 0, SIMD_VERSION_SSE1, SIMD_EMIT_PREFETCH, SIMD_PREFETCH_MODE_1 },
- { SN_PrefetchTemporal2ndLevelCache, 0, SIMD_VERSION_SSE1, SIMD_EMIT_PREFETCH, SIMD_PREFETCH_MODE_2 },
- { SN_PrefetchNonTemporal, 0, SIMD_VERSION_SSE1, SIMD_EMIT_PREFETCH, SIMD_PREFETCH_MODE_NTA },
- { SN_StoreAligned, OP_STOREX_ALIGNED_MEMBASE_REG, SIMD_VERSION_SSE1, SIMD_EMIT_STORE },
- { SN_SubtractWithSaturation, OP_PSUBB_SAT_UN, SIMD_VERSION_SSE1, SIMD_EMIT_BINARY },
- { SN_SumOfAbsoluteDifferences, OP_PSUM_ABS_DIFF, SIMD_VERSION_SSE1, SIMD_EMIT_BINARY },
- { SN_UnpackHigh, OP_UNPACK_HIGHB, SIMD_VERSION_SSE1, SIMD_EMIT_BINARY },
- { SN_UnpackLow, OP_UNPACK_LOWB, SIMD_VERSION_SSE1, SIMD_EMIT_BINARY },
- { SN_get_V0, 0, SIMD_VERSION_SSE1, SIMD_EMIT_GETTER },
- { SN_get_V1, 1, SIMD_VERSION_SSE1, SIMD_EMIT_GETTER },
- { SN_get_V10, 10, SIMD_VERSION_SSE1, SIMD_EMIT_GETTER },
- { SN_get_V11, 11, SIMD_VERSION_SSE1, SIMD_EMIT_GETTER },
- { SN_get_V12, 12, SIMD_VERSION_SSE1, SIMD_EMIT_GETTER },
- { SN_get_V13, 13, SIMD_VERSION_SSE1, SIMD_EMIT_GETTER },
- { SN_get_V14, 14, SIMD_VERSION_SSE1, SIMD_EMIT_GETTER },
- { SN_get_V15, 15, SIMD_VERSION_SSE1, SIMD_EMIT_GETTER },
- { SN_get_V2, 2, SIMD_VERSION_SSE1, SIMD_EMIT_GETTER },
- { SN_get_V3, 3, SIMD_VERSION_SSE1, SIMD_EMIT_GETTER },
- { SN_get_V4, 4, SIMD_VERSION_SSE1, SIMD_EMIT_GETTER },
- { SN_get_V5, 5, SIMD_VERSION_SSE1, SIMD_EMIT_GETTER },
- { SN_get_V6, 6, SIMD_VERSION_SSE1, SIMD_EMIT_GETTER },
- { SN_get_V7, 7, SIMD_VERSION_SSE1, SIMD_EMIT_GETTER },
- { SN_get_V8, 8, SIMD_VERSION_SSE1, SIMD_EMIT_GETTER },
- { SN_get_V9, 9, SIMD_VERSION_SSE1, SIMD_EMIT_GETTER },
- { SN_op_Addition, OP_PADDB, SIMD_VERSION_SSE1, SIMD_EMIT_BINARY },
- { SN_op_BitwiseAnd, OP_PAND, SIMD_VERSION_SSE1, SIMD_EMIT_BINARY },
- { SN_op_BitwiseOr, OP_POR, SIMD_VERSION_SSE1, SIMD_EMIT_BINARY },
- { SN_op_Equality, OP_PCMPEQB, SIMD_VERSION_SSE1, SIMD_EMIT_EQUALITY, SIMD_COMP_EQ },
- { SN_op_ExclusiveOr, OP_PXOR, SIMD_VERSION_SSE1, SIMD_EMIT_BINARY },
- { SN_op_Explicit, 0, SIMD_VERSION_SSE1, SIMD_EMIT_CAST },
- { SN_op_Inequality, OP_PCMPEQB, SIMD_VERSION_SSE1, SIMD_EMIT_EQUALITY, SIMD_COMP_NEQ },
- { SN_op_Subtraction, OP_PSUBB, SIMD_VERSION_SSE1, SIMD_EMIT_BINARY },
- { SN_set_V0, 0, SIMD_VERSION_SSE1, SIMD_EMIT_SETTER },
- { SN_set_V1, 1, SIMD_VERSION_SSE1, SIMD_EMIT_SETTER },
- { SN_set_V10, 10, SIMD_VERSION_SSE1, SIMD_EMIT_SETTER },
- { SN_set_V11, 11, SIMD_VERSION_SSE1, SIMD_EMIT_SETTER },
- { SN_set_V12, 12, SIMD_VERSION_SSE1, SIMD_EMIT_SETTER },
- { SN_set_V13, 13, SIMD_VERSION_SSE1, SIMD_EMIT_SETTER },
- { SN_set_V14, 14, SIMD_VERSION_SSE1, SIMD_EMIT_SETTER },
- { SN_set_V15, 15, SIMD_VERSION_SSE1, SIMD_EMIT_SETTER },
- { SN_set_V2, 2, SIMD_VERSION_SSE1, SIMD_EMIT_SETTER },
- { SN_set_V3, 3, SIMD_VERSION_SSE1, SIMD_EMIT_SETTER },
- { SN_set_V4, 4, SIMD_VERSION_SSE1, SIMD_EMIT_SETTER },
- { SN_set_V5, 5, SIMD_VERSION_SSE1, SIMD_EMIT_SETTER },
- { SN_set_V6, 6, SIMD_VERSION_SSE1, SIMD_EMIT_SETTER },
- { SN_set_V7, 7, SIMD_VERSION_SSE1, SIMD_EMIT_SETTER },
- { SN_set_V8, 8, SIMD_VERSION_SSE1, SIMD_EMIT_SETTER },
- { SN_set_V9, 9, SIMD_VERSION_SSE1, SIMD_EMIT_SETTER },
+ { SN_ctor, OP_EXPAND_I1, MONO_CPU_X86_SSE, SIMD_EMIT_CTOR },
+ { SN_AddWithSaturation, OP_PADDB_SAT_UN, MONO_CPU_X86_SSE, SIMD_EMIT_BINARY },
+ { SN_Average, OP_PAVGB_UN, MONO_CPU_X86_SSE, SIMD_EMIT_BINARY },
+ { SN_CompareEqual, OP_PCMPEQB, MONO_CPU_X86_SSE, SIMD_EMIT_BINARY },
+ { SN_ExtractByteMask, 0, MONO_CPU_X86_SSE, SIMD_EMIT_EXTRACT_MASK },
+ { SN_LoadAligned, 0, MONO_CPU_X86_SSE, SIMD_EMIT_LOAD_ALIGNED },
+ { SN_Max, OP_PMAXB_UN, MONO_CPU_X86_SSE, SIMD_EMIT_BINARY },
+ { SN_Min, OP_PMINB_UN, MONO_CPU_X86_SSE, SIMD_EMIT_BINARY },
+ { SN_PrefetchTemporalAllCacheLevels, 0, MONO_CPU_X86_SSE, SIMD_EMIT_PREFETCH, SIMD_PREFETCH_MODE_0 },
+ { SN_PrefetchTemporal1stLevelCache, 0, MONO_CPU_X86_SSE, SIMD_EMIT_PREFETCH, SIMD_PREFETCH_MODE_1 },
+ { SN_PrefetchTemporal2ndLevelCache, 0, MONO_CPU_X86_SSE, SIMD_EMIT_PREFETCH, SIMD_PREFETCH_MODE_2 },
+ { SN_PrefetchNonTemporal, 0, MONO_CPU_X86_SSE, SIMD_EMIT_PREFETCH, SIMD_PREFETCH_MODE_NTA },
+ { SN_StoreAligned, OP_STOREX_ALIGNED_MEMBASE_REG, MONO_CPU_X86_SSE, SIMD_EMIT_STORE },
+ { SN_SubtractWithSaturation, OP_PSUBB_SAT_UN, MONO_CPU_X86_SSE, SIMD_EMIT_BINARY },
+ { SN_SumOfAbsoluteDifferences, OP_PSUM_ABS_DIFF, MONO_CPU_X86_SSE, SIMD_EMIT_BINARY },
+ { SN_UnpackHigh, OP_UNPACK_HIGHB, MONO_CPU_X86_SSE, SIMD_EMIT_BINARY },
+ { SN_UnpackLow, OP_UNPACK_LOWB, MONO_CPU_X86_SSE, SIMD_EMIT_BINARY },
+ { SN_get_V0, 0, MONO_CPU_X86_SSE, SIMD_EMIT_GETTER },
+ { SN_get_V1, 1, MONO_CPU_X86_SSE, SIMD_EMIT_GETTER },
+ { SN_get_V10, 10, MONO_CPU_X86_SSE, SIMD_EMIT_GETTER },
+ { SN_get_V11, 11, MONO_CPU_X86_SSE, SIMD_EMIT_GETTER },
+ { SN_get_V12, 12, MONO_CPU_X86_SSE, SIMD_EMIT_GETTER },
+ { SN_get_V13, 13, MONO_CPU_X86_SSE, SIMD_EMIT_GETTER },
+ { SN_get_V14, 14, MONO_CPU_X86_SSE, SIMD_EMIT_GETTER },
+ { SN_get_V15, 15, MONO_CPU_X86_SSE, SIMD_EMIT_GETTER },
+ { SN_get_V2, 2, MONO_CPU_X86_SSE, SIMD_EMIT_GETTER },
+ { SN_get_V3, 3, MONO_CPU_X86_SSE, SIMD_EMIT_GETTER },
+ { SN_get_V4, 4, MONO_CPU_X86_SSE, SIMD_EMIT_GETTER },
+ { SN_get_V5, 5, MONO_CPU_X86_SSE, SIMD_EMIT_GETTER },
+ { SN_get_V6, 6, MONO_CPU_X86_SSE, SIMD_EMIT_GETTER },
+ { SN_get_V7, 7, MONO_CPU_X86_SSE, SIMD_EMIT_GETTER },
+ { SN_get_V8, 8, MONO_CPU_X86_SSE, SIMD_EMIT_GETTER },
+ { SN_get_V9, 9, MONO_CPU_X86_SSE, SIMD_EMIT_GETTER },
+ { SN_op_Addition, OP_PADDB, MONO_CPU_X86_SSE, SIMD_EMIT_BINARY },
+ { SN_op_BitwiseAnd, OP_PAND, MONO_CPU_X86_SSE, SIMD_EMIT_BINARY },
+ { SN_op_BitwiseOr, OP_POR, MONO_CPU_X86_SSE, SIMD_EMIT_BINARY },
+ { SN_op_Equality, OP_PCMPEQB, MONO_CPU_X86_SSE, SIMD_EMIT_EQUALITY, SIMD_COMP_EQ },
+ { SN_op_ExclusiveOr, OP_PXOR, MONO_CPU_X86_SSE, SIMD_EMIT_BINARY },
+ { SN_op_Explicit, 0, MONO_CPU_X86_SSE, SIMD_EMIT_CAST },
+ { SN_op_Inequality, OP_PCMPEQB, MONO_CPU_X86_SSE, SIMD_EMIT_EQUALITY, SIMD_COMP_NEQ },
+ { SN_op_Subtraction, OP_PSUBB, MONO_CPU_X86_SSE, SIMD_EMIT_BINARY },
+ { SN_set_V0, 0, MONO_CPU_X86_SSE, SIMD_EMIT_SETTER },
+ { SN_set_V1, 1, MONO_CPU_X86_SSE, SIMD_EMIT_SETTER },
+ { SN_set_V10, 10, MONO_CPU_X86_SSE, SIMD_EMIT_SETTER },
+ { SN_set_V11, 11, MONO_CPU_X86_SSE, SIMD_EMIT_SETTER },
+ { SN_set_V12, 12, MONO_CPU_X86_SSE, SIMD_EMIT_SETTER },
+ { SN_set_V13, 13, MONO_CPU_X86_SSE, SIMD_EMIT_SETTER },
+ { SN_set_V14, 14, MONO_CPU_X86_SSE, SIMD_EMIT_SETTER },
+ { SN_set_V15, 15, MONO_CPU_X86_SSE, SIMD_EMIT_SETTER },
+ { SN_set_V2, 2, MONO_CPU_X86_SSE, SIMD_EMIT_SETTER },
+ { SN_set_V3, 3, MONO_CPU_X86_SSE, SIMD_EMIT_SETTER },
+ { SN_set_V4, 4, MONO_CPU_X86_SSE, SIMD_EMIT_SETTER },
+ { SN_set_V5, 5, MONO_CPU_X86_SSE, SIMD_EMIT_SETTER },
+ { SN_set_V6, 6, MONO_CPU_X86_SSE, SIMD_EMIT_SETTER },
+ { SN_set_V7, 7, MONO_CPU_X86_SSE, SIMD_EMIT_SETTER },
+ { SN_set_V8, 8, MONO_CPU_X86_SSE, SIMD_EMIT_SETTER },
+ { SN_set_V9, 9, MONO_CPU_X86_SSE, SIMD_EMIT_SETTER },
};
/*
setters
*/
static const SimdIntrinsic vector16sb_intrinsics[] = {
- { SN_ctor, OP_EXPAND_I1, SIMD_VERSION_SSE1, SIMD_EMIT_CTOR },
- { SN_AddWithSaturation, OP_PADDB_SAT, SIMD_VERSION_SSE1, SIMD_EMIT_BINARY },
- { SN_CompareEqual, OP_PCMPEQB, SIMD_VERSION_SSE1, SIMD_EMIT_BINARY },
- { SN_CompareGreaterThan, OP_PCMPGTB, SIMD_VERSION_SSE1, SIMD_EMIT_BINARY },
- { SN_ExtractByteMask, 0, SIMD_VERSION_SSE1, SIMD_EMIT_EXTRACT_MASK },
- { SN_LoadAligned, 0, SIMD_VERSION_SSE1, SIMD_EMIT_LOAD_ALIGNED },
- { SN_Max, OP_PMAXB, SIMD_VERSION_SSE41, SIMD_EMIT_BINARY },
- { SN_Min, OP_PMINB, SIMD_VERSION_SSE41, SIMD_EMIT_BINARY },
- { SN_PrefetchTemporalAllCacheLevels, 0, SIMD_VERSION_SSE1, SIMD_EMIT_PREFETCH, SIMD_PREFETCH_MODE_0 },
- { SN_PrefetchTemporal1stLevelCache, 0, SIMD_VERSION_SSE1, SIMD_EMIT_PREFETCH, SIMD_PREFETCH_MODE_1 },
- { SN_PrefetchTemporal2ndLevelCache, 0, SIMD_VERSION_SSE1, SIMD_EMIT_PREFETCH, SIMD_PREFETCH_MODE_2 },
- { SN_PrefetchNonTemporal, 0, SIMD_VERSION_SSE1, SIMD_EMIT_PREFETCH, SIMD_PREFETCH_MODE_NTA },
- { SN_StoreAligned, OP_STOREX_ALIGNED_MEMBASE_REG, SIMD_VERSION_SSE1, SIMD_EMIT_STORE },
- { SN_SubtractWithSaturation, OP_PSUBB_SAT, SIMD_VERSION_SSE1, SIMD_EMIT_BINARY },
- { SN_UnpackHigh, OP_UNPACK_HIGHB, SIMD_VERSION_SSE1, SIMD_EMIT_BINARY },
- { SN_UnpackLow, OP_UNPACK_LOWB, SIMD_VERSION_SSE1, SIMD_EMIT_BINARY },
- { SN_get_V0, 0, SIMD_VERSION_SSE1, SIMD_EMIT_GETTER },
- { SN_get_V1, 1, SIMD_VERSION_SSE1, SIMD_EMIT_GETTER },
- { SN_get_V10, 10, SIMD_VERSION_SSE1, SIMD_EMIT_GETTER },
- { SN_get_V11, 11, SIMD_VERSION_SSE1, SIMD_EMIT_GETTER },
- { SN_get_V12, 12, SIMD_VERSION_SSE1, SIMD_EMIT_GETTER },
- { SN_get_V13, 13, SIMD_VERSION_SSE1, SIMD_EMIT_GETTER },
- { SN_get_V14, 14, SIMD_VERSION_SSE1, SIMD_EMIT_GETTER },
- { SN_get_V15, 15, SIMD_VERSION_SSE1, SIMD_EMIT_GETTER },
- { SN_get_V2, 2, SIMD_VERSION_SSE1, SIMD_EMIT_GETTER },
- { SN_get_V3, 3, SIMD_VERSION_SSE1, SIMD_EMIT_GETTER },
- { SN_get_V4, 4, SIMD_VERSION_SSE1, SIMD_EMIT_GETTER },
- { SN_get_V5, 5, SIMD_VERSION_SSE1, SIMD_EMIT_GETTER },
- { SN_get_V6, 6, SIMD_VERSION_SSE1, SIMD_EMIT_GETTER },
- { SN_get_V7, 7, SIMD_VERSION_SSE1, SIMD_EMIT_GETTER },
- { SN_get_V8, 8, SIMD_VERSION_SSE1, SIMD_EMIT_GETTER },
- { SN_get_V9, 9, SIMD_VERSION_SSE1, SIMD_EMIT_GETTER },
- { SN_op_Addition, OP_PADDB, SIMD_VERSION_SSE1, SIMD_EMIT_BINARY },
- { SN_op_BitwiseAnd, OP_PAND, SIMD_VERSION_SSE1, SIMD_EMIT_BINARY },
- { SN_op_BitwiseOr, OP_POR, SIMD_VERSION_SSE1, SIMD_EMIT_BINARY },
- { SN_op_Equality, OP_PCMPEQB, SIMD_VERSION_SSE1, SIMD_EMIT_EQUALITY, SIMD_COMP_EQ },
- { SN_op_ExclusiveOr, OP_PXOR, SIMD_VERSION_SSE1, SIMD_EMIT_BINARY },
- { SN_op_Explicit, 0, SIMD_VERSION_SSE1, SIMD_EMIT_CAST },
- { SN_op_Inequality, OP_PCMPEQB, SIMD_VERSION_SSE1, SIMD_EMIT_EQUALITY, SIMD_COMP_NEQ },
- { SN_op_Subtraction, OP_PSUBB, SIMD_VERSION_SSE1, SIMD_EMIT_BINARY },
- { SN_set_V0, 0, SIMD_VERSION_SSE1, SIMD_EMIT_SETTER },
- { SN_set_V1, 1, SIMD_VERSION_SSE1, SIMD_EMIT_SETTER },
- { SN_set_V10, 10, SIMD_VERSION_SSE1, SIMD_EMIT_SETTER },
- { SN_set_V11, 11, SIMD_VERSION_SSE1, SIMD_EMIT_SETTER },
- { SN_set_V12, 12, SIMD_VERSION_SSE1, SIMD_EMIT_SETTER },
- { SN_set_V13, 13, SIMD_VERSION_SSE1, SIMD_EMIT_SETTER },
- { SN_set_V14, 14, SIMD_VERSION_SSE1, SIMD_EMIT_SETTER },
- { SN_set_V15, 15, SIMD_VERSION_SSE1, SIMD_EMIT_SETTER },
- { SN_set_V2, 2, SIMD_VERSION_SSE1, SIMD_EMIT_SETTER },
- { SN_set_V3, 3, SIMD_VERSION_SSE1, SIMD_EMIT_SETTER },
- { SN_set_V4, 4, SIMD_VERSION_SSE1, SIMD_EMIT_SETTER },
- { SN_set_V5, 5, SIMD_VERSION_SSE1, SIMD_EMIT_SETTER },
- { SN_set_V6, 6, SIMD_VERSION_SSE1, SIMD_EMIT_SETTER },
- { SN_set_V7, 7, SIMD_VERSION_SSE1, SIMD_EMIT_SETTER },
- { SN_set_V8, 8, SIMD_VERSION_SSE1, SIMD_EMIT_SETTER },
- { SN_set_V9, 9, SIMD_VERSION_SSE1, SIMD_EMIT_SETTER },
+ { SN_ctor, OP_EXPAND_I1, MONO_CPU_X86_SSE, SIMD_EMIT_CTOR },
+ { SN_AddWithSaturation, OP_PADDB_SAT, MONO_CPU_X86_SSE, SIMD_EMIT_BINARY },
+ { SN_CompareEqual, OP_PCMPEQB, MONO_CPU_X86_SSE, SIMD_EMIT_BINARY },
+ { SN_CompareGreaterThan, OP_PCMPGTB, MONO_CPU_X86_SSE, SIMD_EMIT_BINARY },
+ { SN_ExtractByteMask, 0, MONO_CPU_X86_SSE, SIMD_EMIT_EXTRACT_MASK },
+ { SN_LoadAligned, 0, MONO_CPU_X86_SSE, SIMD_EMIT_LOAD_ALIGNED },
+ { SN_Max, OP_PMAXB, MONO_CPU_X86_SSE41, SIMD_EMIT_BINARY },
+ { SN_Min, OP_PMINB, MONO_CPU_X86_SSE41, SIMD_EMIT_BINARY },
+ { SN_PrefetchTemporalAllCacheLevels, 0, MONO_CPU_X86_SSE, SIMD_EMIT_PREFETCH, SIMD_PREFETCH_MODE_0 },
+ { SN_PrefetchTemporal1stLevelCache, 0, MONO_CPU_X86_SSE, SIMD_EMIT_PREFETCH, SIMD_PREFETCH_MODE_1 },
+ { SN_PrefetchTemporal2ndLevelCache, 0, MONO_CPU_X86_SSE, SIMD_EMIT_PREFETCH, SIMD_PREFETCH_MODE_2 },
+ { SN_PrefetchNonTemporal, 0, MONO_CPU_X86_SSE, SIMD_EMIT_PREFETCH, SIMD_PREFETCH_MODE_NTA },
+ { SN_StoreAligned, OP_STOREX_ALIGNED_MEMBASE_REG, MONO_CPU_X86_SSE, SIMD_EMIT_STORE },
+ { SN_SubtractWithSaturation, OP_PSUBB_SAT, MONO_CPU_X86_SSE, SIMD_EMIT_BINARY },
+ { SN_UnpackHigh, OP_UNPACK_HIGHB, MONO_CPU_X86_SSE, SIMD_EMIT_BINARY },
+ { SN_UnpackLow, OP_UNPACK_LOWB, MONO_CPU_X86_SSE, SIMD_EMIT_BINARY },
+ { SN_get_V0, 0, MONO_CPU_X86_SSE, SIMD_EMIT_GETTER },
+ { SN_get_V1, 1, MONO_CPU_X86_SSE, SIMD_EMIT_GETTER },
+ { SN_get_V10, 10, MONO_CPU_X86_SSE, SIMD_EMIT_GETTER },
+ { SN_get_V11, 11, MONO_CPU_X86_SSE, SIMD_EMIT_GETTER },
+ { SN_get_V12, 12, MONO_CPU_X86_SSE, SIMD_EMIT_GETTER },
+ { SN_get_V13, 13, MONO_CPU_X86_SSE, SIMD_EMIT_GETTER },
+ { SN_get_V14, 14, MONO_CPU_X86_SSE, SIMD_EMIT_GETTER },
+ { SN_get_V15, 15, MONO_CPU_X86_SSE, SIMD_EMIT_GETTER },
+ { SN_get_V2, 2, MONO_CPU_X86_SSE, SIMD_EMIT_GETTER },
+ { SN_get_V3, 3, MONO_CPU_X86_SSE, SIMD_EMIT_GETTER },
+ { SN_get_V4, 4, MONO_CPU_X86_SSE, SIMD_EMIT_GETTER },
+ { SN_get_V5, 5, MONO_CPU_X86_SSE, SIMD_EMIT_GETTER },
+ { SN_get_V6, 6, MONO_CPU_X86_SSE, SIMD_EMIT_GETTER },
+ { SN_get_V7, 7, MONO_CPU_X86_SSE, SIMD_EMIT_GETTER },
+ { SN_get_V8, 8, MONO_CPU_X86_SSE, SIMD_EMIT_GETTER },
+ { SN_get_V9, 9, MONO_CPU_X86_SSE, SIMD_EMIT_GETTER },
+ { SN_op_Addition, OP_PADDB, MONO_CPU_X86_SSE, SIMD_EMIT_BINARY },
+ { SN_op_BitwiseAnd, OP_PAND, MONO_CPU_X86_SSE, SIMD_EMIT_BINARY },
+ { SN_op_BitwiseOr, OP_POR, MONO_CPU_X86_SSE, SIMD_EMIT_BINARY },
+ { SN_op_Equality, OP_PCMPEQB, MONO_CPU_X86_SSE, SIMD_EMIT_EQUALITY, SIMD_COMP_EQ },
+ { SN_op_ExclusiveOr, OP_PXOR, MONO_CPU_X86_SSE, SIMD_EMIT_BINARY },
+ { SN_op_Explicit, 0, MONO_CPU_X86_SSE, SIMD_EMIT_CAST },
+ { SN_op_Inequality, OP_PCMPEQB, MONO_CPU_X86_SSE, SIMD_EMIT_EQUALITY, SIMD_COMP_NEQ },
+ { SN_op_Subtraction, OP_PSUBB, MONO_CPU_X86_SSE, SIMD_EMIT_BINARY },
+ { SN_set_V0, 0, MONO_CPU_X86_SSE, SIMD_EMIT_SETTER },
+ { SN_set_V1, 1, MONO_CPU_X86_SSE, SIMD_EMIT_SETTER },
+ { SN_set_V10, 10, MONO_CPU_X86_SSE, SIMD_EMIT_SETTER },
+ { SN_set_V11, 11, MONO_CPU_X86_SSE, SIMD_EMIT_SETTER },
+ { SN_set_V12, 12, MONO_CPU_X86_SSE, SIMD_EMIT_SETTER },
+ { SN_set_V13, 13, MONO_CPU_X86_SSE, SIMD_EMIT_SETTER },
+ { SN_set_V14, 14, MONO_CPU_X86_SSE, SIMD_EMIT_SETTER },
+ { SN_set_V15, 15, MONO_CPU_X86_SSE, SIMD_EMIT_SETTER },
+ { SN_set_V2, 2, MONO_CPU_X86_SSE, SIMD_EMIT_SETTER },
+ { SN_set_V3, 3, MONO_CPU_X86_SSE, SIMD_EMIT_SETTER },
+ { SN_set_V4, 4, MONO_CPU_X86_SSE, SIMD_EMIT_SETTER },
+ { SN_set_V5, 5, MONO_CPU_X86_SSE, SIMD_EMIT_SETTER },
+ { SN_set_V6, 6, MONO_CPU_X86_SSE, SIMD_EMIT_SETTER },
+ { SN_set_V7, 7, MONO_CPU_X86_SSE, SIMD_EMIT_SETTER },
+ { SN_set_V8, 8, MONO_CPU_X86_SSE, SIMD_EMIT_SETTER },
+ { SN_set_V9, 9, MONO_CPU_X86_SSE, SIMD_EMIT_SETTER },
};
-static guint32 simd_supported_versions;
-
static MonoInst* emit_sys_numerics_intrinsics (MonoCompile *cfg, MonoMethod *cmethod, MonoMethodSignature *fsig, MonoInst **args);
static MonoInst* emit_sys_numerics_vectors_intrinsics (MonoCompile *cfg, MonoMethod *cmethod, MonoMethodSignature *fsig, MonoInst **args);
void
mono_simd_intrinsics_init (void)
{
- simd_supported_versions = mono_arch_cpu_enumerate_simd_versions ();
- /*TODO log the supported flags*/
}
static gboolean
return ins;
}
-static const char *
-simd_version_name (guint32 version)
-{
- switch (version) {
- case SIMD_VERSION_SSE1:
- return "sse1";
- case SIMD_VERSION_SSE2:
- return "sse2";
- case SIMD_VERSION_SSE3:
- return "sse3";
- case SIMD_VERSION_SSSE3:
- return "ssse3";
- case SIMD_VERSION_SSE41:
- return "sse41";
- case SIMD_VERSION_SSE42:
- return "sse42";
- case SIMD_VERSION_SSE4a:
- return "sse4a";
- }
- return "n/a";
-}
-
static MonoInst*
emit_intrinsics (MonoCompile *cfg, MonoMethod *cmethod, MonoMethodSignature *fsig, MonoInst **args, const SimdIntrinsic *intrinsics, guint32 size)
{
mono_print_ins (args [i]);
}
}
- if (result->simd_version_flags && !(result->simd_version_flags & simd_supported_versions)) {
- if (IS_DEBUG_ON (cfg)) {
- int x;
- printf ("function %s::%s/%d requires one of unsuported SIMD instruction set(s): ", m_class_get_name (cmethod->klass), cmethod->name, fsig->param_count);
- for (x = 1; x <= SIMD_VERSION_INDEX_END; x++)
- if (result->simd_version_flags & (1 << x))
- printf ("%s ", simd_version_name (1 << x));
-
- printf ("\n");
+ if (result->simd_version) {
+ MonoCPUFeatures features = mini_get_cpu_features (cfg);
+ if ((result->simd_version & features) == 0) {
+ printf ("function %s::%s/%d requires one of unsuported SIMD instruction set(s). \n", m_class_get_name (cmethod->klass), cmethod->name, fsig->param_count);
+ if (IS_DEBUG_ON (cfg))
+ printf ("function %s::%s/%d requires one of unsuported SIMD instruction set(s). \n", m_class_get_name (cmethod->klass), cmethod->name, fsig->param_count);
+ return NULL;
}
- return NULL;
}
switch (result->simd_emit_mode) {
return NULL;
}
+static guint32
+get_simd_supported_versions (MonoCompile *cfg)
+{
+ MonoCPUFeatures features = mini_get_cpu_features (cfg);
+ guint32 versions = 0;
+
+ if (features & MONO_CPU_X86_SSE)
+ versions |= SIMD_VERSION_SSE1;
+ if (features & MONO_CPU_X86_SSE2)
+ versions |= SIMD_VERSION_SSE2;
+ if (features & MONO_CPU_X86_SSE3)
+ versions |= SIMD_VERSION_SSE3;
+ if (features & MONO_CPU_X86_SSSE3)
+ versions |= SIMD_VERSION_SSSE3;
+ if (features & MONO_CPU_X86_SSE41)
+ versions |= SIMD_VERSION_SSE41;
+ if (features & MONO_CPU_X86_SSE42)
+ versions |= SIMD_VERSION_SSE42;
+ return versions;
+}
+
static MonoInst*
emit_simd_runtime_intrinsics (MonoCompile *cfg, MonoMethod *cmethod, MonoMethodSignature *fsig, MonoInst **args)
{
if (!strcmp ("get_AccelMode", cmethod->name) && fsig->param_count == 0) {
MonoInst *ins;
- EMIT_NEW_ICONST (cfg, ins, simd_supported_versions);
+ guint32 versions = get_simd_supported_versions (cfg);
+ EMIT_NEW_ICONST (cfg, ins, versions);
return ins;
}
return NULL;
{ SN_ctor, OP_EXPAND_R4 },
{ SN_Abs },
{ SN_Dot, OP_DPPS },
- { SN_Equals, OP_COMPPS, SIMD_VERSION_SSE1, SIMD_EMIT_EQUALITY, SIMD_COMP_EQ },
- { SN_Max, OP_MAXPS, SIMD_VERSION_SSE1, SIMD_EMIT_BINARY },
- { SN_Min, OP_MINPS, SIMD_VERSION_SSE1, SIMD_EMIT_BINARY },
- { SN_SquareRoot, OP_SQRTPS, SIMD_VERSION_SSE1, SIMD_EMIT_UNARY },
- { SN_op_Addition, OP_ADDPS, SIMD_VERSION_SSE1, SIMD_EMIT_BINARY },
- { SN_op_Division, OP_DIVPS, SIMD_VERSION_SSE1, SIMD_EMIT_BINARY },
- { SN_op_Multiply, OP_MULPS, SIMD_VERSION_SSE1, SIMD_EMIT_BINARY },
- { SN_op_Subtraction, OP_SUBPS, SIMD_VERSION_SSE1, SIMD_EMIT_BINARY },
+ { SN_Equals, OP_COMPPS, MONO_CPU_X86_SSE, SIMD_EMIT_EQUALITY, SIMD_COMP_EQ },
+ { SN_Max, OP_MAXPS, MONO_CPU_X86_SSE, SIMD_EMIT_BINARY },
+ { SN_Min, OP_MINPS, MONO_CPU_X86_SSE, SIMD_EMIT_BINARY },
+ { SN_SquareRoot, OP_SQRTPS, MONO_CPU_X86_SSE, SIMD_EMIT_UNARY },
+ { SN_op_Addition, OP_ADDPS, MONO_CPU_X86_SSE, SIMD_EMIT_BINARY },
+ { SN_op_Division, OP_DIVPS, MONO_CPU_X86_SSE, SIMD_EMIT_BINARY },
+ { SN_op_Multiply, OP_MULPS, MONO_CPU_X86_SSE, SIMD_EMIT_BINARY },
+ { SN_op_Subtraction, OP_SUBPS, MONO_CPU_X86_SSE, SIMD_EMIT_BINARY },
};
static MonoInst*
{
MonoInst *ins;
- if (simd_supported_versions)
+ if (get_simd_supported_versions (cfg))
EMIT_NEW_ICONST (cfg, ins, 1);
else
EMIT_NEW_ICONST (cfg, ins, 0);