changeset 580a6fbc7585 in /z/repo/m5
details: http://repo.m5sim.org/m5?cmd=changeset;node=580a6fbc7585
description:
        X86: Fix the carry flag for shr.

diffstat:

1 file changed, 4 insertions(+), 1 deletion(-)
src/arch/x86/isa/microops/regop.isa |    5 ++++-

diffs (16 lines):

diff -r 801f1fc07a58 -r 580a6fbc7585 src/arch/x86/isa/microops/regop.isa
--- a/src/arch/x86/isa/microops/regop.isa       Wed Aug 05 02:56:38 2009 -0700
+++ b/src/arch/x86/isa/microops/regop.isa       Wed Aug 05 02:56:49 2009 -0700
@@ -680,8 +680,11 @@
                 //worry about setting them.
                 ccFlagBits = ccFlagBits & ~(ext & (CFBit | ECFBit | OFBit));
                 //If some combination of the CF bits need to be set, set them.
-                if ((ext & (CFBit | ECFBit)) && bits(SrcReg1, shiftAmt - 1))
+                if ((ext & (CFBit | ECFBit)) && 
+                        shiftAmt <= dataSize * 8 &&
+                        bits(SrcReg1, shiftAmt - 1)) {
                     ccFlagBits = ccFlagBits | (ext & (CFBit | ECFBit));
+                }
                 //Figure out what the OF bit should be.
                 if ((ext & OFBit) && bits(SrcReg1, dataSize * 8 - 1))
                     ccFlagBits = ccFlagBits | OFBit;
_______________________________________________
m5-dev mailing list
[email protected]
http://m5sim.org/mailman/listinfo/m5-dev

Reply via email to