projects
/
libreriscv.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
9c38e63
)
fix bug
author
Jacob Lifshay
<programmerjake@gmail.com>
Fri, 22 Apr 2022 02:05:13 +0000
(19:05 -0700)
committer
Jacob Lifshay
<programmerjake@gmail.com>
Fri, 22 Apr 2022 02:05:13 +0000
(19:05 -0700)
openpower/sv/biginteger/mulmnu.c
patch
|
blob
|
history
diff --git
a/openpower/sv/biginteger/mulmnu.c
b/openpower/sv/biginteger/mulmnu.c
index 4c6bb861703f1e87709e6658a44a9625e2d6840c..0326a154d12a76730b03642f23e9c7fe39de5eab 100644
(file)
--- a/
openpower/sv/biginteger/mulmnu.c
+++ b/
openpower/sv/biginteger/mulmnu.c
@@
-30,13
+30,13
@@
void mulmnu(unsigned short w[], unsigned short u[], unsigned short v[], int m,
unsigned short plo[2000];
for (i = 0; i < m; i++)
{
- unsigned product = u[i] * v[j] + w[i + j];
+ unsigned product =
(unsigned)
u[i] * v[j] + w[i + j];
phi[i] = product >> 16;
plo[i] = product;
}
for (i = 0; i < m; i++)
{
- t = (
phi[i] << 16) | plo[i]
+ k;
+ t = (
((unsigned)phi[i] << 16) | plo[i])
+ k;
w[i + j] = t; // (I.e., t & 0xFFFF).
k = t >> 16;
}