X86: Make the Ruflag microop work correctly, and make the code a little clearer.
authorGabe Black <gblack@eecs.umich.edu>
Mon, 27 Aug 2007 03:41:36 +0000 (20:41 -0700)
committerGabe Black <gblack@eecs.umich.edu>
Mon, 27 Aug 2007 03:41:36 +0000 (20:41 -0700)
--HG--
extra : convert_revision : c551f51cdda46df99370363ed2d70916db8413eb

src/arch/x86/isa/microops/regop.isa

index b91c77c2126da14c218c31e3a902da9383c599ef..616f7a5fc91799d25bed3fc0dda89f4cbd98d324 100644 (file)
@@ -652,10 +652,10 @@ let {{
     defineMicroRegOpRd('Rdip', 'DestReg = RIP')
     defineMicroRegOpRd('Ruflags', 'DestReg = ccFlagBits')
     defineMicroRegOpRdImm('Ruflag', '''
-            int flag = bits(ccFlagBits, (1 << imm8) + 0*psrc1);
+            int flag = bits(ccFlagBits, imm8 + 0*psrc1);
             DestReg = merge(DestReg, flag, dataSize);
-            ccFlagBits = ccFlagBits & ~EZFBit;
-            ccFlagBits = ccFlagBits | ((flag == 0) ? EZFBit : 0);
+            ccFlagBits = (flag == 0) ? (ccFlagBits | EZFBit) :
+                                       (ccFlagBits & ~EZFBit);
             ''')
 
     defineMicroRegOpImm('Sext', '''