From 7f29387dc6838bcd46d9d3c4f2cd5d9a44bcc319 Mon Sep 17 00:00:00 2001 From: lkcl Date: Sun, 15 May 2022 23:30:37 +0100 Subject: [PATCH] --- openpower/sv/bitmanip.mdwn | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/openpower/sv/bitmanip.mdwn b/openpower/sv/bitmanip.mdwn index 7b1de7be7..617675cdc 100644 --- a/openpower/sv/bitmanip.mdwn +++ b/openpower/sv/bitmanip.mdwn @@ -469,8 +469,8 @@ lut2(imm, a, b): idx = b << 1 | a return imm[idx] # idx by LSB0 order -dorow(imm8, step_i, chunksize): - for j in 0 to 63: +dorow(imm8, step_i, chunksize, us32b): + for j in 0 to 31 if is32b else 63: if (j&chunk_size) == 0 imm = imm8[0..3] else @@ -478,15 +478,15 @@ dorow(imm8, step_i, chunksize): 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 imm, bool iv) +uint64_t grevlut(uint64_t RA, uint64_t RB, uint8 imm, bool iv, bool is32b) { uint64_t x = 0x5555_5555_5555_5555; if (RA != 0) x = GPR(RA); if (iv) x = ~x; - int shamt = RB & 63; - for i in 0 to 6 + int shamt = RB & 31 if is32b else 63 + for i in 0 to (6-is32b) step = 1<