reg &= ~(1 << 6);
if(fold)
- {
suffix = "h";
- reg -= 4;
- }
else if(reg < 8 && size == 1)
suffix = "l";
#include "arch/x86/x86_traits.hh"
#include "base/bitunion.hh"
+#include "base/misc.hh"
+#include "sim/core.hh"
namespace X86ISA
{
inline static IntRegIndex
INTREG_FOLDED(int index, int foldBit)
{
- return (IntRegIndex)(((index & 0x1C) == 4 ? foldBit : 0) | index);
+ if ((index & 0x1C) == 4 && foldBit)
+ index = (index - 4) | foldBit;
+ return (IntRegIndex)index;
}
};
* Authors: Gabe Black
*/
-#include "arch/x86/floatregs.hh"
#include "arch/x86/isa.hh"
#include "arch/x86/tlb.hh"
#include "cpu/base.hh"
UNSERIALIZE_ARRAY(regVal, NumMiscRegs);
}
-int
-ISA::flattenIntIndex(int reg)
-{
- //If we need to fold over the index to match byte semantics, do that.
- //Otherwise, just strip off any extra bits and pass it through.
- if (reg & (1 << 6))
- return (reg & (~(1 << 6) - 0x4));
- else
- return (reg & ~(1 << 6));
-}
-
-int
-ISA::flattenFloatIndex(int reg)
-{
- if (reg >= NUM_FLOATREGS) {
- int top = readMiscRegNoEffect(MISCREG_X87_TOP);
- reg = FLOATREG_STACK(reg - NUM_FLOATREGS, top);
- }
- return reg;
-}
-
}
#ifndef __ARCH_X86_ISA_HH__
#define __ARCH_X86_ISA_HH__
+#include "arch/x86/floatregs.hh"
#include "arch/x86/miscregs.hh"
#include "arch/x86/registers.hh"
#include "base/types.hh"
void setMiscRegNoEffect(int miscReg, MiscReg val);
void setMiscReg(int miscReg, MiscReg val, ThreadContext *tc);
- int flattenIntIndex(int reg);
- int flattenFloatIndex(int reg);
+ int
+ flattenIntIndex(int reg)
+ {
+ return reg & ~(1 << 6);
+ }
+
+ int
+ flattenFloatIndex(int reg)
+ {
+ if (reg >= NUM_FLOATREGS) {
+ reg = FLOATREG_STACK(reg - NUM_FLOATREGS,
+ regVal[MISCREG_X87_TOP]);
+ }
+ return reg;
+ }
void serialize(EventManager *em, std::ostream &os);
void unserialize(EventManager *em, Checkpoint *cp,