Merge pull request #2151 from whitequark/cxxrtl-fix-rzext

cxxrtl: fix rzext()
This commit is contained in:
whitequark 2020-06-13 22:18:35 +00:00 committed by GitHub
commit 971a765155
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -185,8 +185,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;
}