summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoland McGrath <roland@gnu.org>1994-10-21 17:15:34 +0000
committerRoland McGrath <roland@gnu.org>1994-10-21 17:15:34 +0000
commit1e1954979ee90a70c4fba827e538da7c2e32c285 (patch)
tree941fb6c04e5ef424278cbff47027dc1632f398e3
parent80920c1572f9266c74960b2a8754e2157587065f (diff)
(entry point): For OP=rem, set SIGN from dividend only, ignoring divisor.
(Lgot_result): Test SIGN here for OP=rem too (as originally).
-rw-r--r--sysdeps/sparc/divrem.m47
1 files changed, 4 insertions, 3 deletions
diff --git a/sysdeps/sparc/divrem.m4 b/sysdeps/sparc/divrem.m4
index e440d886e0..bde8a21e29 100644
--- a/sysdeps/sparc/divrem.m4
+++ b/sysdeps/sparc/divrem.m4
@@ -94,7 +94,9 @@ ifelse(S, `true',
` ! compute sign of result; if neither is negative, no problem
orcc divisor, dividend, %g0 ! either negative?
bge 2f ! no, go do the divide
- xor divisor, dividend, SIGN ! compute sign in any case
+ifelse(OP, `div',
+` xor divisor, dividend, SIGN ! compute sign in any case',
+` mov dividend, SIGN ! sign of remainder matches dividend')
tst divisor
bge 1f
tst dividend
@@ -223,11 +225,10 @@ ifelse(OP, `div',
Lgot_result:
ifelse(S, `true',
-`ifelse(OP, `div', dnl Remainder should always be positive, says RMS.
` ! check to see if answer should be < 0
tst SIGN
bl,a 1f
ifelse(OP, `div', `sub %g0, Q, Q', `sub %g0, R, R')
-1:')')
+1:')
retl
ifelse(OP, `div', `mov Q, %o0', `mov R, %o0')