Commit 7f15b703 authored by Marc's avatar Marc
Browse files

minor error correction on immediate simd

parent fe9f0384
......@@ -2384,6 +2384,7 @@ end;
immediate_data := (others => '0'); inst := insn;
rhzeros := to_integer(unsigned(inst(3 downto 1))); --number of right hand 0s, for pow2
if inst(13) = '1' then
case inst(9 downto 5) is -- custom immediate depending on operation
-- for additions/subtractions value in inst(4 downto 0) is operand
when S1_ADD | S1_SADD | S1_USADD | S1_SUB | S1_SSUB | S1_USSUB => -- no need for negative values we can use sub or add
......@@ -2391,7 +2392,6 @@ end;
-- for multiplications/division signed first bit is sign, 3 next indicate 2^(1+inst(3 downto 1))
-- and inst(0) adds one (allows for 3, 5, 9, -1, -3, -7...)
when S1_MUL | S1_SMUL =>
report integer'image(to_integer(unsigned(inst)));
if rhzeros < 7 then
immediate_data(rhzeros + 1) := '1';
else
......@@ -2433,6 +2433,9 @@ end;
immediate_data := "000" & inst(4 downto 0);
end case;
return immediate_data & immediate_data & immediate_data & immediate_data;
else
return (others => '0');
end if;
end;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment