Skip to content

Commit

Permalink
Combine binary extraction
Browse files Browse the repository at this point in the history
  • Loading branch information
bjorng committed Aug 19, 2023
1 parent 80ab43c commit 8305553
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
12 changes: 12 additions & 0 deletions erts/emulator/beam/jit/arm/instr_bs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -954,6 +954,18 @@ void BeamModuleAssembler::emit_i_bs_get_binary2(const ArgRegister &Ctx,
}
}

void BeamModuleAssembler::emit_i_bs_get_bin_and_tail(const ArgRegister &Ctx,
const ArgLabel &Fail,
const ArgWord &Live,
const ArgRegister &Size,
const ArgWord &Unit,
const ArgRegister &Dst1,
const ArgRegister &Dst2) {
ArgWord flags(0);
emit_i_bs_get_binary2(Ctx, Fail, Live, Size, flags, Dst1);
emit_bs_get_tail(Ctx, Dst2, Live);
}

void BeamModuleAssembler::emit_i_bs_get_float2(const ArgRegister &Ctx,
const ArgLabel &Fail,
const ArgWord &Live,
Expand Down
8 changes: 8 additions & 0 deletions erts/emulator/beam/jit/arm/ops.tab
Original file line number Diff line number Diff line change
Expand Up @@ -920,6 +920,14 @@ i_bs_match_string S f W M
# Fetching integers from binaries.
bs_get_integer2 f S t s t t d

bs_get_binary2 Fail=f Ms1=xy Live1=u Sz=xy Unit=u Flags=u Dst1=d |
bs_get_tail Ms2=xy Dst2 Live2 |
equal(Ms1, Ms2) |
equal(Live1, Live2) =>
i_bs_get_bin_and_tail Ms1 Fail Live1 Sz Unit Dst1 Dst2

i_bs_get_bin_and_tail S f t S t d d

# Fetching binaries from binaries.
bs_get_binary2 Fail=f Ms=xy Live=u Sz=a==am_all Unit=u Flags=u Dst=d =>
i_bs_get_binary_all2 Ms Fail Live Unit Dst
Expand Down

0 comments on commit 8305553

Please sign in to comment.