38template <
typename TInstrContext>
class Bl1ImmOp {
40 using It =
typename TInstrContext::It;
41 using Pc =
typename TInstrContext::Pc;
45 static_cast<void>(iflags);
46 const me_adr_t pc =
static_cast<me_adr_t
>(ictx.cpua.template ReadRegister<RegisterId::kPc>());
47 ictx.cpua.template WriteRegister<RegisterId::kLr>(
static_cast<uint32_t
>((pc & ~0x1U) | 0x1U));
48 auto branch_res = pc + imm32;
49 PostExecBranch::Call(ictx, branch_res);
50 return Ok(kNoInstrExecFlags);
54template <
typename TOp,
typename TInstrContext>
class UnaryBranchInstrImm {
56 using It =
typename TInstrContext::It;
57 using Pc =
typename TInstrContext::Pc;
61 TRY_ASSIGN(condition_passed, InstrExecResult, It::ConditionPassed(ictx.cpua));
62 if (!condition_passed) {
63 PostExecAdvancePcAndIt::Call(ictx, iflags);
64 return Ok(InstrExecResult{kNoInstrExecFlags});
67 TRY_ASSIGN(eflags, InstrExecResult, TOp::Call(ictx, iflags, imm32));
68 return Ok(InstrExecResult{eflags});
75 UnaryBranchInstrImm() =
delete;
80 ~UnaryBranchInstrImm() =
delete;
86 UnaryBranchInstrImm(
const UnaryBranchInstrImm &r_src) =
delete;
92 UnaryBranchInstrImm &operator=(
const UnaryBranchInstrImm &r_src) =
delete;
98 UnaryBranchInstrImm(UnaryBranchInstrImm &&r_src) =
delete;
104 UnaryBranchInstrImm &operator=(UnaryBranchInstrImm &&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