changeset 1d4dbb357560 in /z/repo/m5
details: http://repo.m5sim.org/m5?cmd=changeset;node=1d4dbb357560
description:
        X86: Fix the overflow bit for rotate right with carry.

diffstat:

1 file changed, 4 insertions(+), 2 deletions(-)
src/arch/x86/isa/microops/regop.isa |    6 ++++--

diffs (21 lines):

diff -r 751b06abbaae -r 1d4dbb357560 src/arch/x86/isa/microops/regop.isa
--- a/src/arch/x86/isa/microops/regop.isa       Wed Aug 05 03:01:07 2009 -0700
+++ b/src/arch/x86/isa/microops/regop.isa       Wed Aug 05 03:01:23 2009 -0700
@@ -777,13 +777,15 @@
         flag_code = '''
             // If the shift amount is zero, no flags should be modified.
             if (shiftAmt) {
+                int origCFBit = (ccFlagBits & CFBit) ? 1 : 0;
                 //Zero out any flags we might modify. This way we only have to
                 //worry about setting them.
                 ccFlagBits = ccFlagBits & ~(ext & (CFBit | ECFBit | OFBit));
                 //Figure out what the OF bit should be.
-                if ((ext & OFBit) && ((ccFlagBits & CFBit) ^
-                                      bits(SrcReg1, dataSize * 8 - 1)))
+                if ((ext & OFBit) && (origCFBit ^
+                                      bits(SrcReg1, dataSize * 8 - 1))) {
                     ccFlagBits = ccFlagBits | OFBit;
+                }
                 //If some combination of the CF bits need to be set, set them.
                 if ((ext & (CFBit | ECFBit)) && bits(SrcReg1, shiftAmt - 1))
                     ccFlagBits = ccFlagBits | (ext & (CFBit | ECFBit));
_______________________________________________
m5-dev mailing list
[email protected]
http://m5sim.org/mailman/listinfo/m5-dev

Reply via email to