Skip to content

Commit

Permalink
WIP: Add workaround for instruction that fails to encode
Browse files Browse the repository at this point in the history
The following is no longer legal in asmjit:

    a.cmp(ARG3, TMP2, a64::uxth(0));

The intention is to produce the following instruction:

    cmp ARG3, TMP2, uxth

Until we find out how to express this with the new asmjit, split the
instruction into two instructions:

    and TMP2, TMP2, 0xffff
    cmp ARG3, TMP2
  • Loading branch information
bjorng committed Feb 28, 2025
1 parent 876a2ce commit 60db2f1
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion erts/emulator/beam/jit/arm/instr_fun.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -380,7 +380,8 @@ a64::Gp BeamModuleAssembler::emit_call_fun(bool skip_box_test,
a.ldp(TMP2, ARG1, arm::Mem(TMP2));

/* Combined fun type and arity test. */
a.cmp(ARG3, TMP2, a64::uxth(0));
a.and_(TMP2, TMP2, imm(0xffff));
a.cmp(ARG3, TMP2);
a.b_ne(next);
}

Expand Down

0 comments on commit 60db2f1

Please sign in to comment.