Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/RuntimeCommon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -437,16 +437,16 @@ SymExpr _sym_build_funnel_shift_left(SymExpr a, SymExpr b, SymExpr c) {
SymExpr concat = _sym_concat_helper(a, b);
SymExpr shift = _sym_build_unsigned_rem(c, _sym_build_integer(bits, bits));

return _sym_extract_helper(_sym_build_shift_left(concat, shift), 0, bits);
return _sym_extract_helper(_sym_build_shift_left(concat, shift), 2 * bits - 1, bits);
}

SymExpr _sym_build_funnel_shift_right(SymExpr a, SymExpr b, SymExpr c) {
size_t bits = _sym_bits_helper(c);
SymExpr concat = _sym_concat_helper(a, b);
SymExpr shift = _sym_build_unsigned_rem(c, _sym_build_integer(bits, bits));

return _sym_extract_helper(_sym_build_logical_shift_right(concat, shift), 0,
bits);
return _sym_extract_helper(_sym_build_logical_shift_right(concat, shift), bits - 1,
0);
}

SymExpr _sym_build_abs(SymExpr expr) {
Expand Down