summaryrefslogtreecommitdiff
path: root/src/arch/x86
diff options
context:
space:
mode:
authorGabe Black <gblack@eecs.umich.edu>2007-07-30 13:26:48 -0700
committerGabe Black <gblack@eecs.umich.edu>2007-07-30 13:26:48 -0700
commitfad96cd0fc3052e5e08d23c8cd29842e1e9c830e (patch)
treebbfa393a0942865822506bc601b7ea3c96542518 /src/arch/x86
parent0d31a41304c56b68d3544a520a1c0f1e8d779bfe (diff)
downloadgem5-fad96cd0fc3052e5e08d23c8cd29842e1e9c830e.tar.xz
X86: Make merge and pick work with high bytes. Fix a sizing issue in pick.
--HG-- extra : convert_revision : 4ddc2ca8c23bb7e90a646329ebf27a013ac5e3d6
Diffstat (limited to 'src/arch/x86')
-rw-r--r--src/arch/x86/insts/static_inst.hh21
1 files changed, 13 insertions, 8 deletions
diff --git a/src/arch/x86/insts/static_inst.hh b/src/arch/x86/insts/static_inst.hh
index f42e6693d..22139fc77 100644
--- a/src/arch/x86/insts/static_inst.hh
+++ b/src/arch/x86/insts/static_inst.hh
@@ -92,9 +92,12 @@ namespace X86ISA
inline uint64_t merge(uint64_t into, uint64_t val, int size) const
{
- X86IntReg reg;
- reg = into;
- //FIXME This needs to be handle high bytes as well
+ X86IntReg reg = into;
+ if(_destRegIdx[0] & (1 << 6))
+ {
+ reg.H = val;
+ return reg;
+ }
switch(size)
{
case 1:
@@ -117,18 +120,20 @@ namespace X86ISA
return reg;
}
- inline uint64_t pick(uint64_t from, int size)
+ inline uint64_t pick(uint64_t from, int idx, int size) const
{
- X86IntReg reg;
- reg = from;
+ X86IntReg reg = from;
+ DPRINTF(X86, "Picking with size %d\n", size);
+ if(_srcRegIdx[idx] & (1 << 6))
+ return reg.H;
switch(size)
{
case 1:
return reg.L;
case 2:
- return reg.E;
- case 4:
return reg.X;
+ case 4:
+ return reg.E;
case 8:
return reg.R;
default: