From: Andrey Miroshnikov Date: Mon, 24 Oct 2022 12:26:53 +0000 (+0100) Subject: bitmanip: fixed syntax for code block X-Git-Tag: opf_rfc_ls005_v1~45 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=ad50fb7a86964eb092ea983664f8a762904a2020;p=libreriscv.git bitmanip: fixed syntax for code block --- diff --git a/openpower/sv/bitmanip.mdwn b/openpower/sv/bitmanip.mdwn index 11bf89447..4744974a8 100644 --- a/openpower/sv/bitmanip.mdwn +++ b/openpower/sv/bitmanip.mdwn @@ -249,23 +249,20 @@ Replaces a pair of explicit instructions in hot-loops. | PO | RT | RA | RB |sm | XO |Rc | ``` -``` -Pseudo-code (shadd): + Pseudo-code (shadd): shift <- sm & 0x3 # Ensure sm is 2-bit 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) sum[0:63] <- (n << shift) + (RA) # Shift n, add RA RT <- sum # Result stored in RT -``` ``` uint_xlen_t shadd(uint_xlen_t RA, uint_xlen_t RB, uint8_t sm) {