1
0
mirror of https://github.com/antonblanchard/microwatt.git synced 2026-04-12 22:56:59 +00:00

bitsort: Fix bperm instruction (#456)

The result byte needs to be zero when the index byte value is >= 64.

Fixes: 23ff954059 ("core: Change bperm to a simpler and slower implementation", 2025-01-07)

Signed-off-by: Paul Mackerras <paulus@ozlabs.org>
This commit is contained in:
Paul Mackerras
2025-12-15 08:27:42 +11:00
committed by GitHub
parent da695e7927
commit 0b3df8ab00

View File

@@ -108,7 +108,9 @@ begin
end process;
-- bit permutation
bperm_res(7) <= rb_bp(to_integer(unsigned(not rs_sr(5 downto 0)))) when not is_X(rs_sr)
bperm_res(7) <= (rb_bp(to_integer(unsigned(not rs_sr(5 downto 0))))
and not (rs_sr(6) or rs_sr(7)))
when not is_X(rs_sr)
else 'X';
bperm_r: process(clk)