changeset f2c472d4ff9c in /z/repo/gem5
details: http://repo.gem5.org/gem5?cmd=changeset;node=f2c472d4ff9c
description:
        x86: change divide-by-zero fault to divide-error
        Same exception is raised whether division with zero is performed or the
        quotient is greater than the maximum value that the provided space can 
hold.
        Divide-by-Zero is the AMD terminology, while Divide-Error is Intel's.

diffstat:

 src/arch/x86/faults.hh              |  9 +++++----
 src/arch/x86/isa/microops/regop.isa |  4 ++--
 2 files changed, 7 insertions(+), 6 deletions(-)

diffs (49 lines):

diff -r df2aa91dba5b -r f2c472d4ff9c src/arch/x86/faults.hh
--- a/src/arch/x86/faults.hh    Fri Apr 24 03:30:08 2015 -0400
+++ b/src/arch/x86/faults.hh    Wed Apr 29 22:35:22 2015 -0500
@@ -167,7 +167,7 @@
 
     // Class  |  Type    | vector |               Cause                 | mnem
     //------------------------------------------------------------------------
-    //Contrib   Fault     0         Divide-by-Zero-Error                  #DE
+    //Contrib   Fault     0         Divide Error                          #DE
     //Benign    Either    1         Debug                                 #DB
     //Benign    Interrupt 2         Non-Maskable-Interrupt                #NMI
     //Benign    Trap      3         Breakpoint                            #BP
@@ -193,11 +193,12 @@
     //Benign    Interrupt 0-255     External Interrupts                   #INTR
     //Benign    Interrupt 0-255     Software Interrupts                   INTn
 
-    class DivideByZero : public X86Fault
+    // Note that
+    class DivideError : public X86Fault
     {
       public:
-        DivideByZero() :
-            X86Fault("Divide-by-Zero-Error", "#DE", 0)
+        DivideError() :
+            X86Fault("Divide-Error", "#DE", 0)
         {}
     };
 
diff -r df2aa91dba5b -r f2c472d4ff9c src/arch/x86/isa/microops/regop.isa
--- a/src/arch/x86/isa/microops/regop.isa       Fri Apr 24 03:30:08 2015 -0400
+++ b/src/arch/x86/isa/microops/regop.isa       Wed Apr 29 22:35:22 2015 -0500
@@ -629,7 +629,7 @@
             uint64_t dividend = remainder;
             //Do the division.
             if (divisor == 0) {
-                fault = std::make_shared<DivideByZero>();
+                fault = std::make_shared<DivideError>();
             } else {
                 divide(dividend, divisor, quotient, remainder);
                 //Record the final results.
@@ -652,7 +652,7 @@
             //If we overshot, do nothing. This lets us unrool division loops a
             //little.
             if (divisor == 0) {
-                fault = std::make_shared<DivideByZero>();
+                fault = std::make_shared<DivideError>();
             } else if (remaining) {
                 if (divisor & (ULL(1) << 63)) {
                     while (remaining && !(dividend & (ULL(1) << 63))) {
_______________________________________________
gem5-dev mailing list
[email protected]
http://m5sim.org/mailman/listinfo/gem5-dev

Reply via email to