2#1011001010# => (ALU, OP_ADD, RA, NONE, NONE, RT, '0', '0', '0', '0', CA, '1', NONE, '0', '0', '0', '0', '0', '0', RC, '0', '0'), -- addzeo
2#0000011100# => (ALU, OP_AND, NONE, RB, RS, RA, '0', '0', '0', '0', ZERO, '0', NONE, '0', '0', '0', '0', '0', '0', RC, '0', '0'), -- and
2#0000111100# => (ALU, OP_AND, NONE, RB, RS, RA, '0', '0', '1', '0', ZERO, '0', NONE, '0', '0', '0', '0', '0', '0', RC, '0', '0'), -- andc
- -- 2#0011111100# bperm
+ 2#0011111100# => (ALU, OP_BPERM, NONE, NONE, RS, RA, '0', '0', '0', '0', ZERO, '0', NONE, '0', '0', '0', '0', '0', '0', NONE, '0', '0'), -- bperm
2#0000000000# => (ALU, OP_CMP, RA, RB, NONE, NONE, '0', '1', '1', '0', ONE, '0', NONE, '0', '0', '0', '0', '0', '1', NONE, '0', '0'), -- cmp
2#0111111100# => (ALU, OP_CMPB, NONE, RB, RS, RA, '0', '1', '0', '0', ZERO, '0', NONE, '0', '0', '0', '0', '0', '0', NONE, '0', '0'), -- cmpb
-- 2#0011100000# cmpeqb
signal par0, par1 : std_ulogic;
signal popcnt : std_ulogic_vector(63 downto 0);
signal parity : std_ulogic_vector(63 downto 0);
+ signal permute : std_ulogic_vector(7 downto 0);
begin
logical_0: process(all)
variable rb_adj, tmp : std_ulogic_vector(63 downto 0);
variable negative : std_ulogic;
+ variable j : integer;
begin
-- population counts
for i in 0 to 31 loop
parity(32) <= par1;
end if;
+ -- bit permutation
+ for i in 0 to 7 loop
+ j := i * 8;
+ if rs(j+7 downto j+6) = "00" then
+ permute(i) <= rb(to_integer(unsigned(rs(j+5 downto j))));
+ else
+ permute(i) <= '0';
+ end if;
+ end loop;
+
rb_adj := rb;
if invert_in = '1' then
rb_adj := not rb;
tmp := parity;
when OP_CMPB =>
tmp := ppc_cmpb(rs, rb);
+ when OP_BPERM =>
+ tmp := std_ulogic_vector(resize(unsigned(permute), 64));
when others =>
-- EXTS
-- note datalen is a 1-hot encoding