When required to negate the absoulte result of a division/remainder
operation (by subtracting the absolute result from 0), don't test for overflow. This avoids an arithmetic exception when dividing LONG_MIN by 1: This is the only case that causes overflow, and the resulting value is correct under 2's compliment arithmetic. PR: 72024 Approved by: dwmalone@ Obtained from: NetBSD MFC after: 4 days
This commit is contained in:
parent
2adb8d6ab0
commit
2909df6916
@ -172,7 +172,7 @@ ifelse(OP, `div',
|
||||
ifelse(S, `true',
|
||||
`
|
||||
/* Check to see if we should negate it. */
|
||||
subqv zero, RESULT, T_0
|
||||
subq zero, RESULT, T_0
|
||||
cmovlbs NEG, T_0, RESULT
|
||||
')
|
||||
|
||||
|
@ -172,7 +172,7 @@ ifelse(OP, `div',
|
||||
ifelse(S, `true',
|
||||
`
|
||||
/* Check to see if we should negate it. */
|
||||
subqv zero, RESULT, T_0
|
||||
subq zero, RESULT, T_0
|
||||
cmovlbs NEG, T_0, RESULT
|
||||
')
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user