From: lkcl Date: Wed, 4 May 2022 11:33:58 +0000 (+0100) Subject: (no commit message) X-Git-Tag: opf_rfc_ls005_v1~2479 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=bcfe155742dee313bab6d52dc2c46181898bd281;p=libreriscv.git --- diff --git a/openpower/sv/bitmanip.mdwn b/openpower/sv/bitmanip.mdwn index 6bd55bacf..e165b9bd7 100644 --- a/openpower/sv/bitmanip.mdwn +++ b/openpower/sv/bitmanip.mdwn @@ -262,12 +262,12 @@ Replaces a pair of explicit instructions in hot-loops. ``` uint_xlen_t shadd(uint_xlen_t rs1, uint_xlen_t rs2, uint8_t sh) { - return (rs1 << sh) + rs2; + return (rs1 << (sh+1)) + rs2; } uint_xlen_t shadduw(uint_xlen_t rs1, uint_xlen_t rs2, uint8_t sh) { uint_xlen_t rs1z = rs1 & 0xFFFFFFFF; - return (rs1z << sh) + rs2; + return (rs1z << (sh+1)) + rs2; } ```