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

diffstat:

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

diffs (15 lines):

diff -r 78d25904f66a -r 801f1fc07a58 src/arch/x86/isa/microops/regop.isa
--- a/src/arch/x86/isa/microops/regop.isa       Wed Aug 05 02:56:12 2009 -0700
+++ b/src/arch/x86/isa/microops/regop.isa       Wed Aug 05 02:56:38 2009 -0700
@@ -648,8 +648,10 @@
                 ccFlagBits = ccFlagBits & ~(ext & (CFBit | ECFBit | OFBit));
                 int CFBits = 0;
                 //Figure out if we -would- set the CF bits if requested.
-                if (bits(SrcReg1, dataSize * 8 - shiftAmt))
+                if (shiftAmt <= dataSize * 8 &&
+                        bits(SrcReg1, dataSize * 8 - shiftAmt)) {
                     CFBits = 1;
+                }
                 //If some combination of the CF bits need to be set, set them.
                 if ((ext & (CFBit | ECFBit)) && CFBits)
                     ccFlagBits = ccFlagBits | (ext & (CFBit | ECFBit));
_______________________________________________
m5-dev mailing list
[email protected]
http://m5sim.org/mailman/listinfo/m5-dev

Reply via email to