diff options
author | Gabe Black <gblack@eecs.umich.edu> | 2007-09-06 16:22:08 -0700 |
---|---|---|
committer | Gabe Black <gblack@eecs.umich.edu> | 2007-09-06 16:22:08 -0700 |
commit | 5052e2cb10b78da55ddef2b1deb67ab2e2aa3255 (patch) | |
tree | d04b0ccb1c28491a1a0884023c2dc2a152919a3e /src/arch/x86/insts | |
parent | 832ef7412b7ab35cb50613fb1b53bd32c48d5a1f (diff) | |
download | gem5-5052e2cb10b78da55ddef2b1deb67ab2e2aa3255.tar.xz |
X86: Make signed versions of partial register values available to microops.
--HG--
extra : convert_revision : c820d1250f505911a341ced42d4f73796ea77f87
Diffstat (limited to 'src/arch/x86/insts')
-rw-r--r-- | src/arch/x86/insts/static_inst.hh | 21 |
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); + } + } }; } |