1 // Licensed to the .NET Foundation under one or more agreements.
2 // The .NET Foundation licenses this file to you under the MIT license.
3 // See the LICENSE file in the project root for more information.
5 #ifndef _NAMEDINTRINSICLIST_H_
6 #define _NAMEDINTRINSICLIST_H_
8 // Named jit intrinsics
10 enum NamedIntrinsic : unsigned int
13 NI_System_Enum_HasFlag = 1,
16 NI_System_Collections_Generic_EqualityComparer_get_Default = 4,
17 #ifdef FEATURE_HW_INTRINSICS
18 NI_HW_INTRINSIC_START,
19 #if defined(_TARGET_XARCH_)
20 #define HARDWARE_INTRINSIC(id, name, isa, ival, size, numarg, t1, t2, t3, t4, t5, t6, t7, t8, t9, t10, category, flag) \
22 #include "hwintrinsiclistxarch.h"
23 #elif defined(_TARGET_ARM64_)
24 NI_ARM64_IsSupported_False,
25 NI_ARM64_IsSupported_True,
26 NI_ARM64_PlatformNotSupported,
27 #define HARDWARE_INTRINSIC(id, isa, name, form, ins0, ins1, ins2, flags) id,
28 #include "hwintrinsiclistArm64.h"
29 #endif // !defined(_TARGET_XARCH_) && !defined(_TARGET_ARM64_)
31 #endif // FEATURE_HW_INTRINSICS
34 #if defined(FEATURE_HW_INTRINSICS) && defined(_TARGET_XARCH_)
35 enum HWIntrinsicFlag : unsigned int
40 // - if a binary-op intrinsic is commutative (e.g., Add, Multiply), its op1 can be contained
41 HW_Flag_Commutative = 0x1,
43 // Full range IMM intrinsic
44 // - the immediate value is valid on the full range of imm8 (0-255)
45 HW_Flag_FullRangeIMM = 0x2,
48 // - must throw NotSupportException if the type argument is not numeric type
49 HW_Flag_OneTypeGeneric = 0x4,
51 // - the intrinsic has two type parameters
52 HW_Flag_TwoTypeGeneric = 0x8,
55 // - should be transformed in the compiler front-end, cannot reach CodeGen
56 HW_Flag_NoCodeGen = 0x10,
59 // - overloaded on multiple vector sizes (SIMD size in the table is unreliable)
60 HW_Flag_UnfixedSIMDSize = 0x20,
63 // - the codegen of overloads cannot be determined by intrinsicID and base type
64 HW_Flag_ComplexOverloads = 0x40,
67 // - that one intrinsic can generate multiple instructions
68 HW_Flag_MultiIns = 0x80,
71 // the intrinsic cannot be contained
72 HW_Flag_NoContainment = 0x100,
75 // some SIMD scalar intrinsics need the semantics of copying upper bits from the source operand
76 HW_Flag_CopyUpperBits = 0x200,
78 // Select base type using the first argument type
79 HW_Flag_BaseTypeFromFirstArg = 0x400,
81 // Indicates compFloatingPointUsed does not need to be set.
82 HW_Flag_NoFloatingPointUsed = 0x800,
85 // the intrinsic has either imm or Vector overloads
86 HW_Flag_MaybeIMM = 0x1000,
89 // the imm intrinsic does not need jumptable fallback when it gets non-const argument
90 HW_Flag_NoJmpTableIMM = 0x2000,
93 // Intrinsics that operate over 64-bit general purpose registers are not supported on 32-bit platform
94 HW_Flag_64BitOnly = 0x4000,
95 HW_Flag_SecondArgMaybe64Bit = 0x8000,
97 // Select base type using the second argument type
98 HW_Flag_BaseTypeFromSecondArg = 0x10000,
101 // the intrinsics need special rules in CodeGen,
102 // but may be table-driven in the front-end
103 HW_Flag_SpecialCodeGen = 0x20000,
105 // No Read/Modify/Write Semantics
106 // the intrinsic doesn't have read/modify/write semantics in two/three-operand form.
107 HW_Flag_NoRMWSemantics = 0x40000,
110 // the intrinsics need special rules in importer,
111 // but may be table-driven in the back-end
112 HW_Flag_SpecialImport = 0x80000,
115 enum HWIntrinsicCategory : unsigned int
117 // Simple SIMD intrinsics
118 // - take Vector128/256<T> parameters
119 // - return a Vector128/256<T>
120 // - the codegen of overloads can be determined by intrinsicID and base type of returned vector
121 HW_Category_SimpleSIMD,
123 // IsSupported Property
124 // - each ISA class has an "IsSupported" property
125 HW_Category_IsSupportedProperty,
128 // - some SIMD intrinsics requires immediate value (i.e. imm8) to generate instruction
132 // - operate over general purpose registers, like crc32, lzcnt, popcnt, etc.
136 // - operate over vector registers(XMM), but just compute on the first element
137 HW_Category_SIMDScalar,
139 // Memory access intrinsics
140 // - e.g., Avx.Load, Avx.Store, Sse.LoadAligned
141 HW_Category_MemoryLoad,
142 HW_Category_MemoryStore,
145 // - do not directly correspond to a instruction, such as Avx.SetAllVector256
148 // Special intrinsics
149 // - have to be addressed specially
153 #endif // FEATURE_HW_INTRINSICS && defined(_TARGET_XARCH_)
155 #endif // _NAMEDINTRINSICLIST_H_