Fix reading Time zone rules using Julian days (#17672)
[platform/upstream/coreclr.git] / src / jit / regalloc.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 REGALLOC_H_
6 #define REGALLOC_H_
7
8 // Some things that are used by both LSRA and regpredict allocators.
9
10 enum FrameType
11 {
12     FT_NOT_SET,
13     FT_ESP_FRAME,
14     FT_EBP_FRAME,
15 #if DOUBLE_ALIGN
16     FT_DOUBLE_ALIGN_FRAME,
17 #endif
18 };
19
20 #if DOUBLE_ALIGN
21 enum CanDoubleAlign
22 {
23     CANT_DOUBLE_ALIGN,
24     CAN_DOUBLE_ALIGN,
25     MUST_DOUBLE_ALIGN,
26     COUNT_DOUBLE_ALIGN,
27
28     DEFAULT_DOUBLE_ALIGN = CAN_DOUBLE_ALIGN
29 };
30 #endif
31
32 #ifdef LEGACY_BACKEND
33
34 #include "varset.h"
35
36 /*****************************************************************************/
37 /*****************************************************************************/
38
39 // This enumeration specifies register restrictions for the predictor
40 enum rpPredictReg
41 {
42     PREDICT_NONE,        // any subtree
43     PREDICT_ADDR,        // subtree is left side of an assignment
44     PREDICT_REG,         // subtree must be any register
45     PREDICT_SCRATCH_REG, // subtree must be any writable register
46
47 #if defined(_TARGET_ARM_)
48     PREDICT_PAIR_R0R1, // subtree will write R0 and R1
49     PREDICT_PAIR_R2R3, // subtree will write R2 and R3
50
51 #elif defined(_TARGET_AMD64_)
52
53     PREDICT_NOT_REG_EAX, // subtree must be any writable register, except EAX
54     PREDICT_NOT_REG_ECX, // subtree must be any writable register, except ECX
55
56 #elif defined(_TARGET_X86_)
57
58     PREDICT_NOT_REG_EAX, // subtree must be any writable register, except EAX
59     PREDICT_NOT_REG_ECX, // subtree must be any writable register, except ECX
60
61     PREDICT_PAIR_EAXEDX, // subtree will write EAX and EDX
62     PREDICT_PAIR_ECXEBX, // subtree will write ECX and EBX
63
64 #else
65 #error "Unknown Target!"
66 #endif // _TARGET_
67
68 #define REGDEF(name, rnum, mask, sname) PREDICT_REG_##name,
69 #include "register.h"
70
71     // The following are use whenever we have a ASG node into a LCL_VAR that
72     // we predict to be enregistered.  This flags indicates that we can expect
73     // to use the register that is being assigned into as the temporary to
74     // compute the right side of the ASGN node.
75
76     PREDICT_REG_VAR_T00, // write the register used by tracked varable 00
77     PREDICT_REG_VAR_MAX = PREDICT_REG_VAR_T00 + lclMAX_TRACKED - 1,
78
79     PREDICT_COUNT = PREDICT_REG_VAR_T00,
80
81 #define REGDEF(name, rnum, mask, sname)
82 #define REGALIAS(alias, realname) PREDICT_REG_##alias = PREDICT_REG_##realname,
83 #include "register.h"
84
85 #if defined(_TARGET_ARM_)
86
87     PREDICT_REG_FIRST = PREDICT_REG_R0,
88     PREDICT_INTRET    = PREDICT_REG_R0,
89     PREDICT_LNGRET    = PREDICT_PAIR_R0R1,
90     PREDICT_FLTRET    = PREDICT_REG_F0,
91
92 #elif defined(_TARGET_AMD64_)
93
94     PREDICT_REG_FIRST = PREDICT_REG_RAX,
95     PREDICT_INTRET    = PREDICT_REG_EAX,
96     PREDICT_LNGRET    = PREDICT_REG_RAX,
97
98 #elif defined(_TARGET_X86_)
99
100     PREDICT_REG_FIRST = PREDICT_REG_EAX,
101     PREDICT_INTRET    = PREDICT_REG_EAX,
102     PREDICT_LNGRET    = PREDICT_PAIR_EAXEDX,
103
104 #else
105 #error "Unknown _TARGET_"
106 #endif // _TARGET_
107
108 };
109 #endif // LEGACY_BACKEND
110
111 #endif // REGALLOC_H_