summaryrefslogtreecommitdiff
path: root/erts/emulator/beam/jit/arm/instr_bs.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'erts/emulator/beam/jit/arm/instr_bs.cpp')
-rw-r--r--erts/emulator/beam/jit/arm/instr_bs.cpp85
1 files changed, 49 insertions, 36 deletions
diff --git a/erts/emulator/beam/jit/arm/instr_bs.cpp b/erts/emulator/beam/jit/arm/instr_bs.cpp
index 3a8d6652f5..2914dd0ebf 100644
--- a/erts/emulator/beam/jit/arm/instr_bs.cpp
+++ b/erts/emulator/beam/jit/arm/instr_bs.cpp
@@ -1453,7 +1453,7 @@ void BeamModuleAssembler::emit_i_bs_create_bin(const ArgVal &Fail,
*/
for (std::size_t i = 0; i < n; i += 6) {
BscSegment seg;
- Uint bsc_op;
+ JitBSCOp bsc_op;
Uint bsc_segment;
ASSERT(args[i].isImmed());
@@ -1492,7 +1492,7 @@ void BeamModuleAssembler::emit_i_bs_create_bin(const ArgVal &Fail,
* Save segment number and operation for use in extended
* error information.
*/
- seg.error_info = BSC_SET_SEGMENT_OP(bsc_segment, bsc_op);
+ seg.error_info = beam_jit_set_bsc_segment_op(bsc_segment, bsc_op);
/*
* Attempt to calculate the effective size of this segment.
@@ -1571,8 +1571,9 @@ void BeamModuleAssembler::emit_i_bs_create_bin(const ArgVal &Fail,
fragment_call(ga->get_bs_bit_size_shared());
if (Fail.getValue() == 0) {
mov_imm(ARG4,
- seg.error_info | BSC_SET_REASON_INFO(BSC_REASON_BADARG,
- BSC_INFO_TYPE));
+ beam_jit_update_bsc_reason_info(seg.error_info,
+ BSC_REASON_BADARG,
+ BSC_INFO_TYPE));
}
a.cond_mi().b(resolve_label(error, disp1MB));
a.add(sizeReg, sizeReg, ARG1);
@@ -1583,15 +1584,16 @@ void BeamModuleAssembler::emit_i_bs_create_bin(const ArgVal &Fail,
a.cmp(TMP2, imm(_TAG_IMMED1_SMALL));
if (Fail.getValue() == 0) {
mov_imm(ARG4,
- seg.error_info | BSC_SET_REASON_INFO(BSC_REASON_DEPENDS,
- BSC_INFO_DEPENDS));
+ beam_jit_update_bsc_reason_info(seg.error_info,
+ BSC_REASON_DEPENDS,
+ BSC_INFO_DEPENDS));
}
a.cond_ne().b(resolve_label(error, disp1MB));
if (Fail.getValue() == 0) {
mov_imm(ARG4,
- seg.error_info |
- BSC_SET_REASON_INFO(BSC_REASON_BADARG,
- BSC_INFO_NEGATIVE));
+ beam_jit_update_bsc_reason_info(seg.error_info,
+ BSC_REASON_BADARG,
+ BSC_INFO_NEGATIVE));
}
a.tbnz(ARG1, 63, resolve_label(error, disp32K));
a.asr(TMP1, ARG1, imm(_TAG_IMMED1_SIZE));
@@ -1600,9 +1602,10 @@ void BeamModuleAssembler::emit_i_bs_create_bin(const ArgVal &Fail,
} else {
if (Fail.getValue() == 0) {
mov_imm(ARG4,
- seg.error_info |
- BSC_SET_REASON_INFO(BSC_REASON_SYSTEM_LIMIT,
- BSC_INFO_SIZE));
+ beam_jit_update_bsc_reason_info(
+ seg.error_info,
+ BSC_REASON_SYSTEM_LIMIT,
+ BSC_INFO_SIZE));
}
a.tst(TMP1, imm(0xffful << 52));
a.cond_ne().b(resolve_label(error, disp1MB));
@@ -1657,9 +1660,9 @@ void BeamModuleAssembler::emit_i_bs_create_bin(const ArgVal &Fail,
if (Fail.getValue() == 0) {
mov_imm(ARG4,
- seg.error_info |
- BSC_SET_REASON_INFO(BSC_REASON_BADARG,
- BSC_INFO_TYPE));
+ beam_jit_update_bsc_reason_info(seg.error_info,
+ BSC_REASON_BADARG,
+ BSC_INFO_TYPE));
}
a.add(sizeReg, sizeReg, imm(4 * 8));
@@ -1714,8 +1717,9 @@ void BeamModuleAssembler::emit_i_bs_create_bin(const ArgVal &Fail,
if (Fail.getValue() == 0) {
mov_imm(ARG4,
- seg.error_info | BSC_SET_REASON_INFO(BSC_REASON_BADARG,
- BSC_INFO_FVALUE));
+ beam_jit_update_bsc_reason_info(seg.error_info,
+ BSC_REASON_BADARG,
+ BSC_INFO_FVALUE));
}
emit_branch_if_not_value(ARG1, resolve_label(error, dispUnknown));
} else if (segments[0].type == am_private_append) {
@@ -1737,8 +1741,9 @@ void BeamModuleAssembler::emit_i_bs_create_bin(const ArgVal &Fail,
emit_leave_runtime(Live.getValue());
if (Fail.getValue() == 0) {
mov_imm(ARG4,
- seg.error_info | BSC_SET_REASON_INFO(BSC_REASON_FREASON,
- BSC_INFO_FVALUE));
+ beam_jit_update_bsc_reason_info(seg.error_info,
+ BSC_REASON_FREASON,
+ BSC_INFO_FVALUE));
}
emit_branch_if_not_value(ARG1, resolve_label(error, dispUnknown));
} else {
@@ -1784,8 +1789,9 @@ void BeamModuleAssembler::emit_i_bs_create_bin(const ArgVal &Fail,
mov_arg(ARG2, seg.src);
a.mov(ARG1, c_p);
runtime_call<3>(erts_new_bs_put_binary);
- error_info =
- BSC_SET_REASON_INFO(BSC_REASON_BADARG, BSC_INFO_FVALUE);
+ error_info = beam_jit_update_bsc_reason_info(seg.error_info,
+ BSC_REASON_BADARG,
+ BSC_INFO_FVALUE);
} else if (seg.size.isImmed() && seg.size.getValue() == am_all) {
/* Include the entire binary/bitstring in the
* resulting binary. */
@@ -1793,8 +1799,9 @@ void BeamModuleAssembler::emit_i_bs_create_bin(const ArgVal &Fail,
mov_arg(ARG2, seg.src);
a.mov(ARG1, c_p);
runtime_call<3>(erts_new_bs_put_binary_all);
- error_info =
- BSC_SET_REASON_INFO(BSC_REASON_BADARG, BSC_INFO_UNIT);
+ error_info = beam_jit_update_bsc_reason_info(seg.error_info,
+ BSC_REASON_BADARG,
+ BSC_INFO_UNIT);
} else {
/* The size is a variable. We have verified that
* the value is a non-negative small in the
@@ -1809,12 +1816,13 @@ void BeamModuleAssembler::emit_i_bs_create_bin(const ArgVal &Fail,
mov_arg(ARG2, seg.src);
a.mov(ARG1, c_p);
runtime_call<3>(erts_new_bs_put_binary);
- error_info =
- BSC_SET_REASON_INFO(BSC_REASON_BADARG, BSC_INFO_FVALUE);
+ error_info = beam_jit_update_bsc_reason_info(seg.error_info,
+ BSC_REASON_BADARG,
+ BSC_INFO_FVALUE);
}
emit_leave_runtime<Update::eReductions>(Live.getValue());
if (Fail.getValue() == 0) {
- mov_imm(ARG4, seg.error_info | error_info);
+ mov_imm(ARG4, error_info);
}
a.cbz(ARG1, resolve_label(error, disp1MB));
break;
@@ -1841,8 +1849,9 @@ void BeamModuleAssembler::emit_i_bs_create_bin(const ArgVal &Fail,
if (Fail.getValue() == 0) {
mov_imm(ARG4,
- seg.error_info | BSC_SET_REASON_INFO(BSC_REASON_BADARG,
- BSC_INFO_FVALUE));
+ beam_jit_update_bsc_reason_info(seg.error_info,
+ BSC_REASON_BADARG,
+ BSC_INFO_FVALUE));
}
a.cbz(ARG1, resolve_label(error, disp1MB));
break;
@@ -1868,8 +1877,9 @@ void BeamModuleAssembler::emit_i_bs_create_bin(const ArgVal &Fail,
if (Fail.getValue() == 0) {
mov_imm(ARG4,
- seg.error_info | BSC_SET_REASON_INFO(BSC_REASON_BADARG,
- BSC_INFO_TYPE));
+ beam_jit_update_bsc_reason_info(seg.error_info,
+ BSC_REASON_BADARG,
+ BSC_INFO_TYPE));
}
a.cbz(ARG1, resolve_label(error, disp1MB));
break;
@@ -1897,8 +1907,9 @@ void BeamModuleAssembler::emit_i_bs_create_bin(const ArgVal &Fail,
emit_leave_runtime(Live.getValue());
if (Fail.getValue() == 0) {
mov_imm(ARG4,
- seg.error_info | BSC_SET_REASON_INFO(BSC_REASON_BADARG,
- BSC_INFO_TYPE));
+ beam_jit_update_bsc_reason_info(seg.error_info,
+ BSC_REASON_BADARG,
+ BSC_INFO_TYPE));
}
a.cbz(ARG1, resolve_label(error, disp1MB));
break;
@@ -1914,8 +1925,9 @@ void BeamModuleAssembler::emit_i_bs_create_bin(const ArgVal &Fail,
if (Fail.getValue() == 0) {
mov_imm(ARG4,
- seg.error_info | BSC_SET_REASON_INFO(BSC_REASON_BADARG,
- BSC_INFO_TYPE));
+ beam_jit_update_bsc_reason_info(seg.error_info,
+ BSC_REASON_BADARG,
+ BSC_INFO_TYPE));
}
a.cbz(ARG1, resolve_label(error, disp1MB));
break;
@@ -1931,8 +1943,9 @@ void BeamModuleAssembler::emit_i_bs_create_bin(const ArgVal &Fail,
if (Fail.getValue() == 0) {
mov_imm(ARG4,
- seg.error_info | BSC_SET_REASON_INFO(BSC_REASON_BADARG,
- BSC_INFO_TYPE));
+ beam_jit_update_bsc_reason_info(seg.error_info,
+ BSC_REASON_BADARG,
+ BSC_INFO_TYPE));
}
a.cbz(ARG1, resolve_label(error, disp1MB));
break;