From: lkcl Date: Tue, 15 Feb 2022 06:07:23 +0000 (+0000) Subject: (no commit message) X-Git-Tag: opf_rfc_ls005_v1~3204 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=50b7c2e1eb6dbf07bb05346d012a27cbdd6e1cdc;p=libreriscv.git --- diff --git a/openpower/sv/bitmanip.mdwn b/openpower/sv/bitmanip.mdwn index c7821f130..a3248d830 100644 --- a/openpower/sv/bitmanip.mdwn +++ b/openpower/sv/bitmanip.mdwn @@ -318,14 +318,28 @@ uint_xlen_t bmextrev(RA, RB, sh) # grevlut - lut2(imm, a, b): - idx = b << 1 | a - return imm[idx] # idx by LSB0 order +``` +lut2(imm, a, b): + idx = b << 1 | a + return imm[idx] # idx by LSB0 order + +dorow(imm, step_i, chunksize): + for j in 0 to 63: + step_o[j] = lut2(imm, step_i[j], step_i[j ^ chunk_size]) + return step_o + +uint64_t grevlut64(uint64_t RA, uint64_t RB, uint8 lut2) +{ + uint64_t x = RA; + int shamt = RB & 63; + int imm = lut2 & 0b1111; + for i in 0 to 6 + step = 1<