Fix reading Time zone rules using Julian days (#17672)
[platform/upstream/coreclr.git] / src / jit / fp.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 _JIT_FP
6
7 #define _JIT_FP
8
9 // Auxiliary structures.
10 #if FEATURE_STACK_FP_X87
11
12 enum dummyFPenum
13 {
14 #define REGDEF(name, rnum, mask, sname) dummmy_##name = rnum,
15 #include "registerfp.h"
16
17     FP_VIRTUALREGISTERS,
18 };
19
20 // FlatFPStateX87 holds the state of the virtual register file. For each
21 // virtual register we keep track to which physical register we're
22 // mapping. We also keep track of the physical stack.
23
24 #define FP_PHYSICREGISTERS FP_VIRTUALREGISTERS
25 #define FP_VRNOTMAPPED -1
26
27 struct FlatFPStateX87
28 {
29 public:
30     void Init(FlatFPStateX87* pFrom = 0);
31     bool Mapped(unsigned uEntry); // Is virtual register mapped
32     void Unmap(unsigned uEntry);  // Unmaps a virtual register
33     void Associate(unsigned uEntry, unsigned uStack);
34     unsigned StackToST(unsigned uEntry); // Maps the stack to a ST(x) entry
35     unsigned VirtualToST(unsigned uEntry);
36     unsigned STToVirtual(unsigned uST);
37     unsigned TopIndex();
38     unsigned TopVirtual();
39     void Rename(unsigned uVirtualTo, unsigned uVirtualFrom);
40     unsigned Pop();
41     void Push(unsigned uEntry);
42     bool IsEmpty();
43
44     // Debug/test methods
45     static bool AreEqual(FlatFPStateX87* pSrc, FlatFPStateX87* pDst);
46 #ifdef DEBUG
47     bool IsValidEntry(unsigned uEntry);
48     bool IsConsistent();
49     void UpdateMappingFromStack();
50     void Dump();
51
52     // In some optimizations the stack will be inconsistent in some transactions. We want to keep
53     // the checks for everthing else, so if have the stack in an inconsistent state, you must
54     // ignore it on purpose.
55     bool m_bIgnoreConsistencyChecks;
56
57     inline void IgnoreConsistencyChecks(bool bIgnore)
58     {
59         m_bIgnoreConsistencyChecks = bIgnore;
60     }
61 #else
62     inline void IgnoreConsistencyChecks(bool bIgnore)
63     {
64     }
65 #endif
66
67     unsigned m_uVirtualMap[FP_VIRTUALREGISTERS];
68     unsigned m_uStack[FP_PHYSICREGISTERS];
69     unsigned m_uStackSize;
70 };
71
72 #endif // FEATURE_STACK_FP_X87
73 #endif