Skip to content

Commit

Permalink
fixup! Optimize equality tests with known literals
Browse files Browse the repository at this point in the history
  • Loading branch information
bjorng committed Nov 28, 2023
1 parent 36316f7 commit 3d579ba
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions erts/emulator/beam/jit/arm/instr_common.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1481,7 +1481,6 @@ void BeamModuleAssembler::emit_i_test_arity(const ArgLabel &Fail,
a.b_ne(resolve_beam_label(Fail, disp1MB));
}


/*
* ARG1 = Fist operand
* ARG2 = Literal list
Expand Down Expand Up @@ -1522,7 +1521,7 @@ void BeamGlobalAssembler::emit_is_eq_exact_list_shared() {

static bool is_list_of_immediates(Eterm term) {
while (is_list(term)) {
Eterm* cons = list_val(term);
Eterm *cons = list_val(term);
if (!is_immed(CAR(cons))) {
return false;
}
Expand Down Expand Up @@ -1551,7 +1550,8 @@ void BeamGlobalAssembler::emit_is_eq_exact_shallow_boxed_shared() {
a.lsr(ARG3, TMP3, imm(_HEADER_ARITY_OFFS));
a.sub(ARG3, ARG3, imm(1));

a.bind(loop); {
a.bind(loop);
{
a.ldp(TMP3, TMP4, arm::Mem(TMP1).post(16));
a.ldp(TMP5, TMP6, arm::Mem(TMP2).post(16));
a.cmp(TMP3, TMP5);
Expand Down Expand Up @@ -1579,7 +1579,7 @@ void BeamGlobalAssembler::emit_is_eq_exact_shallow_boxed_shared() {

static bool is_shallow_boxed(Eterm term) {
if (is_tuple(term)) {
Eterm* tuple_ptr = tuple_val(term);
Eterm *tuple_ptr = tuple_val(term);
for (int i = 1; i <= arityval(*tuple_ptr); i++) {
if (!is_immed(tuple_ptr[i])) {
return false;
Expand Down
2 changes: 1 addition & 1 deletion erts/emulator/beam/jit/x86/instr_common.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1434,7 +1434,7 @@ void BeamGlobalAssembler::emit_is_eq_exact_list_shared() {

static bool is_list_of_immediates(Eterm term) {
while (is_list(term)) {
Eterm* cons = list_val(term);
Eterm *cons = list_val(term);
if (!is_immed(CAR(cons))) {
return false;
}
Expand Down

0 comments on commit 3d579ba

Please sign in to comment.