16template <
typename TLoadOp,
typename TInstrContext>
class BinaryLoadInstrWithImm {
18 using It =
typename TInstrContext::It;
19 using Pc =
typename TInstrContext::Pc;
21 using ExcTrig =
typename TInstrContext::ExcTrig;
23 template <
typename TTgt,
typename TArg0>
25 const TTgt &rt,
const TArg0 &rn,
const u32 &imm32) {
26 const bool is_index = (iflags &
static_cast<InstrFlagsSet
>(InstrFlags::kIndex)) != 0U;
27 const bool is_add = (iflags &
static_cast<InstrFlagsSet
>(InstrFlags::kAdd)) != 0U;
30 if (!condition_passed) {
31 PostExecAdvancePcAndIt::Call(ictx, iflags);
34 const auto n = ictx.cpua.ReadRegister(rn.Get());
35 const me_adr_t offset_addr = is_add ==
true ? n + imm32 : n - imm32;
36 const me_adr_t address = is_index ==
true ? offset_addr : n;
40 const bool is_wback = (iflags &
static_cast<InstrFlagsSet
>(InstrFlags::kWBack)) != 0U;
42 PostExecWriteRegPcExcluded::Call(ictx, rn, offset_addr);
44 const bool is_aligned = (address & 0x3U) == 0U;
45 TRY(
InstrExecResult, PostExecWriteRegPcIncluded::Call(ictx, iflags, rt, data, is_aligned));
53 BinaryLoadInstrWithImm() =
delete;
58 ~BinaryLoadInstrWithImm() =
delete;
64 BinaryLoadInstrWithImm(
const BinaryLoadInstrWithImm &r_src) =
delete;
70 BinaryLoadInstrWithImm &operator=(
const BinaryLoadInstrWithImm &r_src) =
delete;
76 BinaryLoadInstrWithImm(BinaryLoadInstrWithImm &&r_src) =
delete;
82 BinaryLoadInstrWithImm &operator=(BinaryLoadInstrWithImm &&r_src) =
delete;
#define TRY_ASSIGN(NAME, OUT_TYPE, CALL)
Try to assign a value to a variable and return an error if the assignment fails.
Definition result.h:123
#define TRY(OUT_TYPE, CALL)
Try to call a function and return an error if the call fails.
Definition result.h:138