Fix reading Time zone rules using Julian days (#17672)
[platform/upstream/coreclr.git] / src / jit / namedintrinsiclist.h
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.
4
5 #ifndef _NAMEDINTRINSICLIST_H_
6 #define _NAMEDINTRINSICLIST_H_
7
8 // Named jit intrinsics
9
10 enum NamedIntrinsic : unsigned int
11 {
12     NI_Illegal                                                 = 0,
13     NI_System_Enum_HasFlag                                     = 1,
14     NI_MathF_Round                                             = 2,
15     NI_Math_Round                                              = 3,
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) \
21     NI_##id,
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_)
30     NI_HW_INTRINSIC_END,
31 #endif // FEATURE_HW_INTRINSICS
32 };
33
34 #if defined(FEATURE_HW_INTRINSICS) && defined(_TARGET_XARCH_)
35 enum HWIntrinsicFlag : unsigned int
36 {
37     HW_Flag_NoFlag = 0,
38
39     // Commutative
40     // - if a binary-op intrinsic is commutative (e.g., Add, Multiply), its op1 can be contained
41     HW_Flag_Commutative = 0x1,
42
43     // Full range IMM intrinsic
44     // - the immediate value is valid on the full range of imm8 (0-255)
45     HW_Flag_FullRangeIMM = 0x2,
46
47     // Generic
48     // - must throw NotSupportException if the type argument is not numeric type
49     HW_Flag_OneTypeGeneric = 0x4,
50     // Two-type Generic
51     // - the intrinsic has two type parameters
52     HW_Flag_TwoTypeGeneric = 0x8,
53
54     // NoCodeGen
55     // - should be transformed in the compiler front-end, cannot reach CodeGen
56     HW_Flag_NoCodeGen = 0x10,
57
58     // Unfixed SIMD-size
59     // - overloaded on multiple vector sizes (SIMD size in the table is unreliable)
60     HW_Flag_UnfixedSIMDSize = 0x20,
61
62     // Complex overload
63     // - the codegen of overloads cannot be determined by intrinsicID and base type
64     HW_Flag_ComplexOverloads = 0x40,
65
66     // Multi-instruction
67     // - that one intrinsic can generate multiple instructions
68     HW_Flag_MultiIns = 0x80,
69
70     // NoContainment
71     // the intrinsic cannot be contained
72     HW_Flag_NoContainment = 0x100,
73
74     // Copy Upper bits
75     // some SIMD scalar intrinsics need the semantics of copying upper bits from the source operand
76     HW_Flag_CopyUpperBits = 0x200,
77
78     // Select base type using the first argument type
79     HW_Flag_BaseTypeFromFirstArg = 0x400,
80
81     // Indicates compFloatingPointUsed does not need to be set.
82     HW_Flag_NoFloatingPointUsed = 0x800,
83
84     // Maybe IMM
85     // the intrinsic has either imm or Vector overloads
86     HW_Flag_MaybeIMM = 0x1000,
87
88     // NoJmpTable IMM
89     // the imm intrinsic does not need jumptable fallback when it gets non-const argument
90     HW_Flag_NoJmpTableIMM = 0x2000,
91
92     // 64-bit intrinsics
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,
96
97     // Select base type using the second argument type
98     HW_Flag_BaseTypeFromSecondArg = 0x10000,
99
100     // Special codegen
101     // the intrinsics need special rules in CodeGen,
102     // but may be table-driven in the front-end
103     HW_Flag_SpecialCodeGen = 0x20000,
104
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,
108
109     // Special import
110     // the intrinsics need special rules in importer,
111     // but may be table-driven in the back-end
112     HW_Flag_SpecialImport = 0x80000,
113 };
114
115 enum HWIntrinsicCategory : unsigned int
116 {
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,
122
123     // IsSupported Property
124     // - each ISA class has an "IsSupported" property
125     HW_Category_IsSupportedProperty,
126
127     // IMM intrinsics
128     // - some SIMD intrinsics requires immediate value (i.e. imm8) to generate instruction
129     HW_Category_IMM,
130
131     // Scalar intrinsics
132     // - operate over general purpose registers, like crc32, lzcnt, popcnt, etc.
133     HW_Category_Scalar,
134
135     // SIMD scalar
136     // - operate over vector registers(XMM), but just compute on the first element
137     HW_Category_SIMDScalar,
138
139     // Memory access intrinsics
140     // - e.g., Avx.Load, Avx.Store, Sse.LoadAligned
141     HW_Category_MemoryLoad,
142     HW_Category_MemoryStore,
143
144     // Helper intrinsics
145     // - do not directly correspond to a instruction, such as Avx.SetAllVector256
146     HW_Category_Helper,
147
148     // Special intrinsics
149     // - have to be addressed specially
150     HW_Category_Special
151 };
152
153 #endif // FEATURE_HW_INTRINSICS && defined(_TARGET_XARCH_)
154
155 #endif // _NAMEDINTRINSICLIST_H_