cxxrtl: fix rzext().

This was a correctness issue, but one of the consequences is that it
resulted in jumps in generated machine code where there should have
been none. As a side effect of fixing the bug, Minerva SoC became 10%
faster.
This commit is contained in:
whitequark 2020-06-13 00:49:44 +00:00
parent a5f0cb4eba
commit 6cf02ed94f
1 changed files with 2 additions and 2 deletions

View File

@ -165,8 +165,8 @@ struct value : public expr_base<value<Bits>> {
carry = (shift_bits == 0) ? 0
: data[n] >> (chunk::bits - shift_bits);
}
if (carry != 0)
result.data[result.chunks - 1] = carry;
if (shift_chunks + chunks < result.chunks)
result.data[shift_chunks + chunks] = carry;
return result;
}