From 50b7c2e1eb6dbf07bb05346d012a27cbdd6e1cdc Mon Sep 17 00:00:00 2001 From: lkcl Date: Tue, 15 Feb 2022 06:07:23 +0000 Subject: [PATCH] --- openpower/sv/bitmanip.mdwn | 28 +++++++++++++++++++++------- 1 file changed, 21 insertions(+), 7 deletions(-) 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<