From: Luke Kenneth Casson Leighton Date: Mon, 18 Apr 2022 20:58:04 +0000 (+0100) Subject: split out mul add x into separate instruction X-Git-Tag: opf_rfc_ls005_v1~2718 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=a8232c8fa455058d8534f76fdbf70c252fe9ff7d;p=libreriscv.git split out mul add x into separate instruction or at least looking like it --- 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; }