From: lkcl Date: Mon, 18 Apr 2022 02:10:32 +0000 (+0100) Subject: (no commit message) X-Git-Tag: opf_rfc_ls005_v1~2737 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=7bb2f70106b582f0e69ff50e6f32bf0bf4ad7345;p=libreriscv.git --- diff --git a/openpower/sv/bitmanip/appendix.mdwn b/openpower/sv/bitmanip/appendix.mdwn index d589f070e..59dc6f5f5 100644 --- a/openpower/sv/bitmanip/appendix.mdwn +++ b/openpower/sv/bitmanip/appendix.mdwn @@ -146,9 +146,9 @@ in order to carry on the algorithm. **weirdaddx RT, RA, RB** (RS=RB+VL for SVP64, RS=RB+1 for scalar) cat[0:127] = (RS) || (RB) - sum[0:127] = cat + EXTZ(RA) + [1]*128 + sum[0:127] = cat + EXTZ(RA) - 1 rhi[0:63] = sum[0:63] - if (RA) <= 1 then rhi = rhi + ([0]*63 || 1) + if (RA) <= 1 then rhi = rhi + 1 RA = rhi RT = sum[64:127] @@ -168,24 +168,6 @@ As a result, a big-integer subtract and multiply may be carried out in only 3 instructions, one of which is setting a scalar integer to zero. -## 2nd experiment - -``` - uint32_t carry = 0, carry2 = 0; - uint64_t products[]; - for(int j = d_bytes / sizeof(d[0]) - 1; j >= 0; j--) { - products[j] = (uint64_t)q[i] * d[j]; - } - for(int j = d_bytes / sizeof(d[0]) - 1; j >= 0; j--) { - uint64_t v = products[j] + carry; - carry = v >> 32; - v = (uint32_t)v; - v = n[i + j] - v + carry2; - carry2 = v >> 32; // either ~0 or 0 - n[i + j] = v; - } -``` - ## EXT004 Opcode map See Power ISA v3.1, Book III, Appendix D, Table 13 (sheet 7 of 8), p1357.