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.
9 // Auxiliary structures.
10 #if FEATURE_STACK_FP_X87
14 #define REGDEF(name, rnum, mask, sname) dummmy_##name = rnum,
15 #include "registerfp.h"
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.
24 #define FP_PHYSICREGISTERS FP_VIRTUALREGISTERS
25 #define FP_VRNOTMAPPED -1
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);
38 unsigned TopVirtual();
39 void Rename(unsigned uVirtualTo, unsigned uVirtualFrom);
41 void Push(unsigned uEntry);
45 static bool AreEqual(FlatFPStateX87* pSrc, FlatFPStateX87* pDst);
47 bool IsValidEntry(unsigned uEntry);
49 void UpdateMappingFromStack();
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;
57 inline void IgnoreConsistencyChecks(bool bIgnore)
59 m_bIgnoreConsistencyChecks = bIgnore;
62 inline void IgnoreConsistencyChecks(bool bIgnore)
67 unsigned m_uVirtualMap[FP_VIRTUALREGISTERS];
68 unsigned m_uStack[FP_PHYSICREGISTERS];
69 unsigned m_uStackSize;
72 #endif // FEATURE_STACK_FP_X87