From bd4cfa18b0ed7828de9bc9ae2b8ef9542f2bbe9c Mon Sep 17 00:00:00 2001 From: Luke Kenneth Casson Leighton Date: Mon, 18 Apr 2022 20:33:31 +0100 Subject: [PATCH] experiment expressing borrow as ~val+1 instead of -val --- openpower/sv/bitmanip/divmnu64.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/openpower/sv/bitmanip/divmnu64.c b/openpower/sv/bitmanip/divmnu64.c index 52f1715aa..bc9b033b1 100644 --- a/openpower/sv/bitmanip/divmnu64.c +++ b/openpower/sv/bitmanip/divmnu64.c @@ -107,7 +107,7 @@ again: if (rhat < b) goto again; } -#define MUL_RSUB_CARRY1 +#define SUB_MUL_BORROW #ifdef ORIGINAL // Multiply and subtract. k = 0; @@ -141,7 +141,7 @@ again: // this is the new (odd) instruction for(int i = 0; i <= n; i++) { uint64_t value = (((uint64_t)phi[i]<<32) | plo[i]) - borrow; - borrow = -(uint32_t)(value >> 32); + borrow = ~(value >> 32)+1; // -(uint32_t)(value >> 32); un[i + j] = (uint32_t)value; } bool need_fixup = borrow != 0; -- 2.30.2