Skip to content

Commit

Permalink
fixup! peepopt: Add right-shift 'shiftmul' variant
Browse files Browse the repository at this point in the history
  • Loading branch information
povik committed Aug 2, 2023
1 parent c2eebb3 commit 7e7917b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion passes/pmgen/peepopt_shiftmul_right.pmg
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,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;

did_something = true;
Expand Down

0 comments on commit 7e7917b

Please sign in to comment.