summaryrefslogtreecommitdiff
path: root/src/arch/x86/insts/static_inst.hh
diff options
context:
space:
mode:
Diffstat (limited to 'src/arch/x86/insts/static_inst.hh')
-rw-r--r--src/arch/x86/insts/static_inst.hh21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/arch/x86/insts/static_inst.hh b/src/arch/x86/insts/static_inst.hh
index 22139fc77..e5c333e75 100644
--- a/src/arch/x86/insts/static_inst.hh
+++ b/src/arch/x86/insts/static_inst.hh
@@ -140,6 +140,27 @@ namespace X86ISA
panic("Tried to pick with unrecognized size %d.\n", size);
}
}
+
+ inline int64_t signedPick(uint64_t from, int idx, int size) const
+ {
+ X86IntReg reg = from;
+ DPRINTF(X86, "Picking with size %d\n", size);
+ if(_srcRegIdx[idx] & (1 << 6))
+ return reg.SH;
+ switch(size)
+ {
+ case 1:
+ return reg.SL;
+ case 2:
+ return reg.SX;
+ case 4:
+ return reg.SE;
+ case 8:
+ return reg.SR;
+ default:
+ panic("Tried to pick with unrecognized size %d.\n", size);
+ }
+ }
};
}