Skip to content

Commit

Permalink
fixup! peepopt: Support shift amounts zero-padded from below
Browse files Browse the repository at this point in the history
  • Loading branch information
povik committed Aug 2, 2023
1 parent bed6414 commit c2eebb3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion passes/pmgen/peepopt_shiftmul_left.pmg
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ code

int factor_bits = ceil_log2(mul_const.as_int());
// make sure the multiplication never wraps around
if (GetSize(shift_amount) < factor_bits + GetSize(mul_din))
if (GetSize(shift_amount) + log2scale < factor_bits + GetSize(mul_din))
reject;

if (neg) {
Expand Down

0 comments on commit c2eebb3

Please sign in to comment.