From: Gabe Black Date: Thu, 14 Jun 2007 20:52:24 +0000 (+0000) Subject: Sign extend byte immediates as well. There might need to be a fancier system in place... X-Git-Tag: m5_2.0_beta4~341 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=dad30582248b049a72dd3aa0350f19b1b8c456ee;p=gem5.git 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 --- 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;