Sign extend byte immediates as well. There might need to be a fancier system in place...
authorGabe Black <gblack@eecs.umich.edu>
Thu, 14 Jun 2007 20:52:24 +0000 (20:52 +0000)
committerGabe Black <gblack@eecs.umich.edu>
Thu, 14 Jun 2007 20:52:24 +0000 (20:52 +0000)
--HG--
extra : convert_revision : 2c5bd719c770d9a93a57bd29782842f82384863d

src/arch/x86/predecoder.cc

index 72b60385b9097bb52561e8313c9c32b8a9441e3d..3ed18aeb24c24587a82555e07ffff47f99687476 100644 (file)
@@ -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;