diff --git a/mach/proto/fp/div_ext.c b/mach/proto/fp/div_ext.c index 883bd5497..447fdd164 100644 --- a/mach/proto/fp/div_ext.c +++ b/mach/proto/fp/div_ext.c @@ -31,6 +31,15 @@ EXTEND *e1,*e2; unsigned long result[2]; register unsigned long *lp; + if ((e2->m1 | e2->m2) == 0) { + /* + * Exception 8.2 - Divide by zero + */ + trap(EFDIVZ); + e1->m1 = e1->m2 = 0L; + e1->exp = EXT_MAX; + return; + } if ((e1->m1 | e1->m2) == 0) { /* 0 / anything == 0 */ e1->exp = 0; /* make sure */ return; @@ -57,15 +66,6 @@ EXTEND *e1,*e2; e1->m1 = e1->m2 = 0L; return; } - if ((e2->m1 | e2->m2) == 0) { - /* - * Exception 8.2 - Divide by zero - */ - trap(EFDIVZ); - e1->m1 = e1->m2 = 0L; - e1->exp = EXT_MAX; - return; - } if (e1->exp >= EXT_MAX) { /* * Exception 8.3 - Overflow