From 90d98a7c5bd9765066c3c553fead6c2cd0c71989 Mon Sep 17 00:00:00 2001 From: lkcl Date: Tue, 25 Oct 2022 11:22:16 +0100 Subject: [PATCH] --- openpower/sv/bitmanip.mdwn | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/openpower/sv/bitmanip.mdwn b/openpower/sv/bitmanip.mdwn index 4744974a8..a4d68a0c6 100644 --- a/openpower/sv/bitmanip.mdwn +++ b/openpower/sv/bitmanip.mdwn @@ -249,18 +249,16 @@ Replaces a pair of explicit instructions in hot-loops. | PO | RT | RA | RB |sm | XO |Rc | ``` - Pseudo-code (shadd): - shift <- sm & 0x3 # Ensure sm is 2-bit +Pseudo-code (shadd): + shift <- shift + 1 # Shift is between 1-4 sum[0:63] <- ((RB) << shift) + (RA) # Shift RB, add RA RT <- sum # Result stored in RT -Is Rc used to indicate the two modes? +Pseudo-code (shadduw): - Pseudo-code (shadduw): - shift <- sm & 0x3 # Ensure sm is 2-bit shift <- shift + 1 # Shift is between 1-4 - n <- (RB) & 0xFFFFFFFF # Limit RB to upper word (32-bits) + n <- (RB)[XLEN/2:XLEN-1] # Limit RB to upper word (32-bits) sum[0:63] <- (n << shift) + (RA) # Shift n, add RA RT <- sum # Result stored in RT -- 2.30.2