changeset c52c581277bf in /z/repo/m5
details: http://repo.m5sim.org/m5?cmd=changeset;node=c52c581277bf
description:
        X86: Actual change that fixes div. How did that happen?

diffstat:

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

diffs (24 lines):

diff -r 56bbefb997fe -r c52c581277bf src/arch/x86/isa/microops/regop.isa
--- a/src/arch/x86/isa/microops/regop.isa       Wed May 12 00:37:29 2010 -0700
+++ b/src/arch/x86/isa/microops/regop.isa       Wed May 12 00:49:12 2010 -0700
@@ -620,14 +620,18 @@
                         remaining--;
                     }
                     if (dividend & (ULL(1) << 63)) {
+                        bool highBit = false;
                         if (dividend < divisor && remaining) {
+                            highBit = true;
                             dividend = (dividend << 1) |
                                 bits(SrcReg1, remaining - 1);
                             quotient <<= 1;
                             remaining--;
                         }
-                        quotient++;
-                        dividend -= divisor;
+                        if (highBit || divisor <= dividend) {
+                            quotient++;
+                            dividend -= divisor;
+                        }
                     }
                     remainder = dividend;
                 } else {
_______________________________________________
m5-dev mailing list
[email protected]
http://m5sim.org/mailman/listinfo/m5-dev

Reply via email to