12template <
typename TStoreOp,
typename TInstrContext>
class TernaryStoreInstrWithImm {
14 using It =
typename TInstrContext::It;
15 using Pc =
typename TInstrContext::Pc;
17 template <
typename TDest,
typename TTgt,
typename TArg0>
19 const TDest &rd,
const TTgt &rt,
const TArg0 &rn,
21 const bool is_index = (iflags &
static_cast<InstrFlagsSet
>(InstrFlags::kIndex)) != 0U;
22 const bool is_add = (iflags &
static_cast<InstrFlagsSet
>(InstrFlags::kAdd)) != 0U;
25 if (!condition_passed) {
26 PostExecAdvancePcAndIt::Call(ictx, iflags);
30 InstrExecFlagsSet eflags{kNoInstrExecFlags};
31 const auto n = ictx.cpua.ReadRegister(rn.Get());
33 const me_adr_t offset_addr = is_add ==
true ? n + imm32 : n - imm32;
34 const me_adr_t address = is_index ==
true ? offset_addr : n;
36 const auto t = ictx.cpua.ReadRegister(rt.Get());
42 ictx.cpua.WriteRegister(rd.Get(), d);
44 const bool is_wback = (iflags &
static_cast<InstrFlagsSet
>(InstrFlags::kWBack)) != 0U;
46 PostExecWriteRegPcExcluded::Call(ictx, rn, offset_addr);
48 PostExecAdvancePcAndIt::Call(ictx, iflags);
56 TernaryStoreInstrWithImm() =
delete;
61 ~TernaryStoreInstrWithImm() =
delete;
67 TernaryStoreInstrWithImm(
const TernaryStoreInstrWithImm &r_src) =
delete;
73 TernaryStoreInstrWithImm &operator=(
const TernaryStoreInstrWithImm &r_src) =
delete;
79 TernaryStoreInstrWithImm(TernaryStoreInstrWithImm &&r_src) =
delete;
85 TernaryStoreInstrWithImm &operator=(TernaryStoreInstrWithImm &&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