From: lkcl Date: Tue, 25 Oct 2022 10:22:16 +0000 (+0100) Subject: (no commit message) X-Git-Tag: opf_rfc_ls005_v1~42 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=90d98a7c5bd9765066c3c553fead6c2cd0c71989;p=libreriscv.git --- 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