summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGabe Black <gblack@eecs.umich.edu>2007-06-14 20:52:24 +0000
committerGabe Black <gblack@eecs.umich.edu>2007-06-14 20:52:24 +0000
commitdad30582248b049a72dd3aa0350f19b1b8c456ee (patch)
tree211e26d960bbf53a2ecd560930bf7ad2f0687da3
parent721394411088a40f786fbe3486f5a099c6e9d2d3 (diff)
downloadgem5-dad30582248b049a72dd3aa0350f19b1b8c456ee.tar.xz
Sign extend byte immediates as well. There might need to be a fancier system in place to handle this in the future.
--HG-- extra : convert_revision : 2c5bd719c770d9a93a57bd29782842f82384863d
-rw-r--r--src/arch/x86/predecoder.cc9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/arch/x86/predecoder.cc b/src/arch/x86/predecoder.cc
index 72b60385b..3ed18aeb2 100644
--- a/src/arch/x86/predecoder.cc
+++ b/src/arch/x86/predecoder.cc
@@ -390,8 +390,15 @@ namespace X86ISA
//Instructions which use true 64 bit immediates won't be
//affected, and instructions that use true 32 bit immediates
//won't notice.
- if(immediateSize == 4)
+ switch(immediateSize)
+ {
+ case 4:
emi.immediate = sext<32>(emi.immediate);
+ break;
+ case 1:
+ emi.immediate = sext<8>(emi.immediate);
+ }
+
DPRINTF(Predecoder, "Collected immediate %#x.\n",
emi.immediate);
emiIsReady = true;