* <https://lists.libre-soc.org/pipermail/libre-soc-dev/2022-April/004700.html>
* <https://news.ycombinator.com/item?id=21151646>
+## Variant 1
+
Row-based multiply using temporary vector. Simple implementation
of Knuth M: <https://git.libre-soc.org/?p=libreriscv.git;a=blob;f=openpower/sv/bitmanip/mulmnu.c;hb=HEAD>
# here, RS=RB+VL, therefore again RS starts at r8.v
sv.addxd r0.v, r18, r0.v
+## Variant 2
+
+```
+ for (i = 0; i < m; i++) {
+ unsigned product = u[i]*v[j] + k;
+ k = product>>16;
+ plo[i] = product; // & 0xffff
+ }
+ k = 0;
+ for (i = 0; i < m; i++) {
+ t = plo[i] + w[i + j] + k;
+ w[i + j] = t; // (I.e., t & 0xFFFF).
+ k = t >> 16; // carry: should only be 1 bit
+ }
+```
+
+**maddx RT, RA, RB, RC**
+
+ prod[0:127] = (RA) * (RB)
+ sum[0:127] = EXTZ(RC) + prod
+ RT <- sum[64:127]
+ RC <- sum[0:63]
+
# big integer division
links