projects
/
libreriscv.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
c503d6d
)
split out condition
author
Jacob Lifshay
<programmerjake@gmail.com>
Mon, 18 Apr 2022 17:38:12 +0000
(10:38 -0700)
committer
Jacob Lifshay
<programmerjake@gmail.com>
Mon, 18 Apr 2022 17:38:12 +0000
(10:38 -0700)
openpower/sv/bitmanip/divmnu64.c
patch
|
blob
|
history
diff --git
a/openpower/sv/bitmanip/divmnu64.c
b/openpower/sv/bitmanip/divmnu64.c
index f9f6572d04f0171509d2c5f5472bbf16a4388bf5..1d3585eec60139aaeb377044887aa15cdff459b0 100644
(file)
--- a/
openpower/sv/bitmanip/divmnu64.c
+++ b/
openpower/sv/bitmanip/divmnu64.c
@@
-8,6
+8,7
@@
machine which has a 64/64 division instruction. */
#include <stdio.h>
#include <stdlib.h> //To define "exit", req'd by XLC.
+#include <stdbool.h>
#define max(x, y) ((x) > (y) ? (x) : (y))
@@
-115,9
+116,10
@@
again:
}
t = un[j+n] - k;
un[j+n] = t;
+ bool need_fixup = t < 0;
q[j] = qhat; // Store quotient digit.
- if (
t < 0) {
// If we subtracted too
+ if (
need_fixup) {
// If we subtracted too
q[j] = q[j] - 1; // much, add back.
k = 0;
for (i = 0; i < n; i++) {