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// clang-format off
6
7/*****************************************************************************/
8
9#ifndef GTSTRUCT_0
10#error Define GTSTRUCT_0 before including this file.
11#endif
12
13#ifndef GTSTRUCT_1
14#error Define GTSTRUCT_1 before including this file.
15#endif
16
17#ifndef GTSTRUCT_2
18#error Define GTSTRUCT_2 before including this file.
19#endif
20
21#ifndef GTSTRUCT_3
22#error Define GTSTRUCT_3 before including this file.
23#endif
24
25#ifndef GTSTRUCT_4
26#error Define GTSTRUCT_4 before including this file.
27#endif
28
29#ifndef GTSTRUCT_N
30#error Define GTSTRUCT_N before including this file.
31#endif
32
33#ifndef GTSTRUCT_2_SPECIAL
34#error Define GTSTRUCT_2_SPECIAL before including this file.
35#endif
36
37#ifndef GTSTRUCT_3_SPECIAL
38#error Define GTSTRUCT_3_SPECIAL before including this file.
39#endif
40
41/*****************************************************************************/
42
43//
44// Field name , Allowed node enum(s)
45//
46// The "SPECIAL" variants indicate that some or all of the allowed opers exist elsewhere. This is
47// used in the DEBUGGABLE_GENTREE implementation when determining which vtable pointer to use for
48// a given oper. For example, IntConCommon (for the GenTreeIntConCommon type) allows opers
49// for all its subtypes. The "SPECIAL" version is attached to the supertypes. "N" is always
50// considered "special".
51
52GTSTRUCT_0(UnOp , GT_OP)
53GTSTRUCT_0(Op , GT_OP)
54#if !FEATURE_EH_FUNCLETS
55GTSTRUCT_2(Val , GT_END_LFIN, GT_JMP)
56#else
57GTSTRUCT_1(Val , GT_JMP)
58#endif
59GTSTRUCT_3_SPECIAL(IntConCommon, GT_CNS_INT, GT_CNS_LNG, GT_JMPTABLE)
60GTSTRUCT_1(JumpTable , GT_JMPTABLE)
61GTSTRUCT_1(IntCon , GT_CNS_INT)
62GTSTRUCT_1(LngCon , GT_CNS_LNG)
63GTSTRUCT_1(DblCon , GT_CNS_DBL)
64GTSTRUCT_1(StrCon , GT_CNS_STR)
65GTSTRUCT_N(LclVarCommon, GT_LCL_VAR, GT_LCL_FLD, GT_PHI_ARG, GT_STORE_LCL_VAR, GT_STORE_LCL_FLD, GT_LCL_VAR_ADDR, GT_LCL_FLD_ADDR)
66GTSTRUCT_3(LclVar , GT_LCL_VAR, GT_LCL_VAR_ADDR, GT_STORE_LCL_VAR)
67GTSTRUCT_3(LclFld , GT_LCL_FLD, GT_STORE_LCL_FLD, GT_LCL_FLD_ADDR)
68GTSTRUCT_1(Cast , GT_CAST)
69GTSTRUCT_1(Box , GT_BOX)
70GTSTRUCT_1(Field , GT_FIELD)
71GTSTRUCT_1(Call , GT_CALL)
72GTSTRUCT_2_SPECIAL(ArgList , GT_LIST, GT_FIELD_LIST)
73GTSTRUCT_1(FieldList , GT_FIELD_LIST)
74GTSTRUCT_1(Colon , GT_COLON)
75GTSTRUCT_1(FptrVal , GT_FTN_ADDR)
76GTSTRUCT_1(Intrinsic , GT_INTRINSIC)
77GTSTRUCT_1(Index , GT_INDEX)
78GTSTRUCT_1(IndexAddr , GT_INDEX_ADDR)
79#if defined(FEATURE_HW_INTRINSICS) && defined(FEATURE_SIMD)
80GTSTRUCT_3(BoundsChk , GT_ARR_BOUNDS_CHECK, GT_SIMD_CHK, GT_HW_INTRINSIC_CHK)
81#elif defined(FEATURE_SIMD)
82GTSTRUCT_2(BoundsChk , GT_ARR_BOUNDS_CHECK, GT_SIMD_CHK)
83#elif defined(FEATURE_HW_INTRINSICS)
84GTSTRUCT_2(BoundsChk , GT_ARR_BOUNDS_CHECK, GT_HW_INTRINSIC_CHK)
85#else // !FEATURE_SIMD && !FEATURE_HW_INTRINSICS
86GTSTRUCT_1(BoundsChk , GT_ARR_BOUNDS_CHECK)
87#endif // !FEATURE_SIMD && !FEATURE_HW_INTRINSICS
88GTSTRUCT_1(ArrLen , GT_ARR_LENGTH)
89GTSTRUCT_1(ArrElem , GT_ARR_ELEM)
90GTSTRUCT_1(ArrOffs , GT_ARR_OFFSET)
91GTSTRUCT_1(ArrIndex , GT_ARR_INDEX)
92GTSTRUCT_1(RetExpr , GT_RET_EXPR)
93GTSTRUCT_2(Stmt , GT_STMT, GT_IL_OFFSET)
94GTSTRUCT_2(CopyOrReload, GT_COPY, GT_RELOAD)
95GTSTRUCT_2(ClsVar , GT_CLS_VAR, GT_CLS_VAR_ADDR)
96GTSTRUCT_1(ArgPlace , GT_ARGPLACE)
97GTSTRUCT_1(Label , GT_LABEL)
98GTSTRUCT_1(CmpXchg , GT_CMPXCHG)
99GTSTRUCT_1(AddrMode , GT_LEA)
100GTSTRUCT_N(Blk , GT_BLK, GT_STORE_BLK, GT_OBJ, GT_STORE_OBJ, GT_DYN_BLK, GT_STORE_DYN_BLK)
101GTSTRUCT_2(Obj , GT_OBJ, GT_STORE_OBJ)
102GTSTRUCT_2(DynBlk , GT_DYN_BLK, GT_STORE_DYN_BLK)
103GTSTRUCT_1(Qmark , GT_QMARK)
104GTSTRUCT_1(PhiArg , GT_PHI_ARG)
105GTSTRUCT_1(StoreInd , GT_STOREIND)
106GTSTRUCT_N(Indir , GT_STOREIND, GT_IND, GT_NULLCHECK, GT_BLK, GT_STORE_BLK, GT_OBJ, GT_STORE_OBJ, GT_DYN_BLK, GT_STORE_DYN_BLK)
107#if FEATURE_ARG_SPLIT
108GTSTRUCT_2_SPECIAL(PutArgStk, GT_PUTARG_STK, GT_PUTARG_SPLIT)
109GTSTRUCT_1(PutArgSplit , GT_PUTARG_SPLIT)
110#else // !FEATURE_ARG_SPLIT
111GTSTRUCT_1(PutArgStk , GT_PUTARG_STK)
112#endif // !FEATURE_ARG_SPLIT
113GTSTRUCT_1(PhysReg , GT_PHYSREG)
114#ifdef FEATURE_SIMD
115GTSTRUCT_1(SIMD , GT_SIMD)
116#endif // FEATURE_SIMD
117#ifdef FEATURE_HW_INTRINSICS
118GTSTRUCT_1(HWIntrinsic , GT_HWIntrinsic)
119#endif // FEATURE_HW_INTRINSICS
120GTSTRUCT_1(AllocObj , GT_ALLOCOBJ)
121GTSTRUCT_1(RuntimeLookup, GT_RUNTIMELOOKUP)
122GTSTRUCT_2(CC , GT_JCC, GT_SETCC)
123#if defined(_TARGET_X86_)
124GTSTRUCT_1(MultiRegOp , GT_MUL_LONG)
125#elif defined (_TARGET_ARM_)
126GTSTRUCT_3(MultiRegOp , GT_MUL_LONG, GT_PUTARG_REG, GT_BITCAST)
127#endif
128/*****************************************************************************/
129#undef GTSTRUCT_0
130#undef GTSTRUCT_1
131#undef GTSTRUCT_2
132#undef GTSTRUCT_3
133#undef GTSTRUCT_4
134#undef GTSTRUCT_N
135#undef GTSTRUCT_2_SPECIAL
136#undef GTSTRUCT_3_SPECIAL
137/*****************************************************************************/
138
139// clang-format on
140