Skip to content

Commit

Permalink
fixup! Fuse multiplication with addition
Browse files Browse the repository at this point in the history
  • Loading branch information
bjorng committed Aug 14, 2023
1 parent 2ffb85e commit b78544f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion erts/emulator/beam/jit/x86/instr_arith.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1015,6 +1015,7 @@ void BeamModuleAssembler::emit_i_mul_add(const ArgLabel &Fail,
is_product_small && is_sum_small) {
x86::Mem p;
Sint increment = Src4.as<ArgSmall>().get();
increment -= factor * _TAG_IMMED1_SMALL;

switch (factor) {
case 2:
Expand All @@ -1040,7 +1041,6 @@ void BeamModuleAssembler::emit_i_mul_add(const ArgLabel &Fail,
if (Support::isInt32(increment) && p.hasIndex()) {
comment("optimizing multiplication and addition using LEA");
mov_arg(RET, Src1);
a.and_(RET, imm(~_TAG_IMMED1_MASK));
a.lea(RET, p);
mov_arg(Dst, RET);
return;
Expand Down

0 comments on commit b78544f

Please sign in to comment.