From 79b088cc3450c65ce019fd83ab70c73b762eccf3 Mon Sep 17 00:00:00 2001 From: lkcl Date: Sun, 13 Mar 2022 15:25:56 +0000 Subject: [PATCH] --- openpower/sv/bitmanip.mdwn | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/openpower/sv/bitmanip.mdwn b/openpower/sv/bitmanip.mdwn index 671790fda..f5d74efc1 100644 --- a/openpower/sv/bitmanip.mdwn +++ b/openpower/sv/bitmanip.mdwn @@ -343,6 +343,16 @@ grevlut should be arranged so as to produce the constants needed to put into bext (bitextract) so as in turn to be able to emulate x86 pmovmask instructions + +| RA | RB | imm | iv | result | +| ------- | ------- | ---------- | -- | ---------- | +| 0x555.. | 0b10 | 0b01101100 | 0 | 0x111111... | +| 0x555.. | 0b110 | 0b01101100 | 0 | 0x010101... | +| 0x555.. | 0b1110 | 0b01101100 | 0 | 0x00010001... | +| 0x555.. | 0b10 | 0b11000110 | 1 | 0x88888... | +| 0x555.. | 0b110 | 0b11000110 | 1 | 0x808080... | +| 0x555.. | 0b1110 | 0b11000110 | 1 | 0x80008000... | + Better diagram showing the correct ordering of shamt. @@ -363,7 +373,7 @@ dorow(imm8, step_i, chunksize): uint64_t grevlut64(uint64_t RA, uint64_t RB, uint8 imm, bool iv) { - uint64_t x = 0; + uint64_t x = 0x5555_5555_5555_5555; if (RA != 0) x = GPR(RA); if (iv) x = ~x; int shamt = RB & 63; -- 2.30.2