From: lkcl Date: Sat, 13 Feb 2021 21:24:36 +0000 (+0000) Subject: (no commit message) X-Git-Tag: convert-csv-opcode-to-binary~184 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=8efad93794277a20d89c56be731bf3e3ad6d4d4b;p=libreriscv.git --- diff --git a/openpower/sv/bitmanip.mdwn b/openpower/sv/bitmanip.mdwn index 19b4a528b..057cf2bb8 100644 --- a/openpower/sv/bitmanip.mdwn +++ b/openpower/sv/bitmanip.mdwn @@ -278,12 +278,21 @@ uint_xlen_t bmext(RA, RB, sh) } ``` -bitmask extract with reverse +bitmask extract with reverse. can be done by bitinverting all of RA and getting bits of RA from the opposite end. ``` msb = rb[5:0]; rev[0:msb] = ra[msb:0]; rt = ZE(rev[msb:0]); + +uint_xlen_t bmextrev(RA, RB, sh) +{ + int shamt = (RB & (XLEN - 1)); + shamt = (XLEN-1)-shamt; # shift other end + bra = bitreverse(RA) # swap LSB-MSB + mask = (2<> shamt); +} ``` | 0.5|6.10|11.15|16.20|21.26| 27..30 |31| name |