X86: Make the 0xA0-0xA3 versions of mov use the right sized immediates.
authorGabe Black <gblack@eecs.umich.edu>
Sun, 2 Dec 2007 08:02:51 +0000 (00:02 -0800)
committerGabe Black <gblack@eecs.umich.edu>
Sun, 2 Dec 2007 08:02:51 +0000 (00:02 -0800)
--HG--
extra : convert_revision : a702403de29772618abb5bd5c5555279d91bdd59

src/arch/x86/isa/insts/general_purpose/data_transfer/move.py
src/arch/x86/predecoder.cc

index 069d1010e7263da81e1f36811b138acdd45e1f68..3b8608c48ebd21708afa255c6b61f30c12f58093 100644 (file)
@@ -60,12 +60,12 @@ microcode = '''
 #
 
 def macroop MOV_R_MI {
-    limm t1, imm
+    limm t1, imm, dataSize=asz
     ld reg, seg, [1, t0, t1]
 };
 
 def macroop MOV_MI_R {
-    limm t1, imm
+    limm t1, imm, dataSize=asz
     st reg, seg, [1, t0, t1]
 };
 
index ace4a6b943251236c9e4904fa1d4a2c7ed7c7aa5..407a09ec037c1b96b75ede56da95f9a167c9dc97 100644 (file)
@@ -270,7 +270,10 @@ namespace X86ISA
             //Figure out how big of an immediate we'll retreive based
             //on the opcode.
             int immType = ImmediateType[emi.opcode.num - 1][nextByte];
-            immediateSize = SizeTypeToSize[logOpSize - 1][immType];
+            if (emi.opcode.num == 1 && nextByte >= 0xA0 && nextByte <= 0xA3)
+                immediateSize = SizeTypeToSize[logAddrSize - 1][immType];
+            else
+                immediateSize = SizeTypeToSize[logOpSize - 1][immType];
 
             //Determine what to expect next
             if (UsesModRM[emi.opcode.num - 1][nextByte]) {