From ad50fb7a86964eb092ea983664f8a762904a2020 Mon Sep 17 00:00:00 2001 From: Andrey Miroshnikov Date: Mon, 24 Oct 2022 13:26:53 +0100 Subject: [PATCH] bitmanip: fixed syntax for code block --- openpower/sv/bitmanip.mdwn | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) 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) { -- 2.30.2