From a8232c8fa455058d8534f76fdbf70c252fe9ff7d Mon Sep 17 00:00:00 2001 From: Luke Kenneth Casson Leighton Date: Mon, 18 Apr 2022 21:58:04 +0100 Subject: [PATCH] split out mul add x into separate instruction or at least looking like it --- openpower/sv/bitmanip/mulmnu.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/openpower/sv/bitmanip/mulmnu.c b/openpower/sv/bitmanip/mulmnu.c index 2acdc08ec..a38afc4be 100644 --- a/openpower/sv/bitmanip/mulmnu.c +++ b/openpower/sv/bitmanip/mulmnu.c @@ -24,8 +24,15 @@ void mulmnu(unsigned short w[], unsigned short u[], for (j = 0; j < n; j++) { k = 0; + unsigned short phi[2000]; + unsigned short plo[2000]; for (i = 0; i < m; i++) { - t = u[i]*v[j] + w[i + j] + k; + unsigned product = 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; w[i + j] = t; // (I.e., t & 0xFFFF). k = t >> 16; } -- 2.30.2