From 0bdf6ee415079d8b9941ff8468dd864c77baef3f Mon Sep 17 00:00:00 2001 From: Jacob Lifshay Date: Thu, 21 Apr 2022 19:05:13 -0700 Subject: [PATCH] fix bug --- openpower/sv/biginteger/mulmnu.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/openpower/sv/biginteger/mulmnu.c b/openpower/sv/biginteger/mulmnu.c index 4c6bb8617..0326a154d 100644 --- 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; } -- 2.30.2