From 7bb2f70106b582f0e69ff50e6f32bf0bf4ad7345 Mon Sep 17 00:00:00 2001 From: lkcl Date: Mon, 18 Apr 2022 03:10:32 +0100 Subject: [PATCH] --- openpower/sv/bitmanip/appendix.mdwn | 22 ++-------------------- 1 file changed, 2 insertions(+), 20 deletions(-) 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. -- 2.30.2