20 template <
typename TArg0>
22 const TArg0 &rn,
const u32 &imm) {
23 const auto n = ictx.cpua.ReadRegister(rn.Get());
25 const u32 n_imm32 = ~imm;
26 const auto result = Alu32::AddWithCarry(n, n_imm32,
true);
28 const auto op_res =
OpResult{result.value, result.carry_out, result.overflow};
29 PostExecSetFlags::Call(ictx, op_res);
30 PostExecAdvancePcAndIt::Call(ictx, iflags);
31 return Ok(kNoInstrExecFlags);
42 template <
typename TArg0>
44 const TArg0 &rn,
const u32 &imm) {
45 const auto n = ictx.cpua.ReadRegister(rn.Get());
46 const auto result = Alu32::AddWithCarry(n, imm,
false);
48 const auto op_res =
OpResult{result.value, result.carry_out, result.overflow};
49 PostExecSetFlags::Call(ictx, op_res);
50 PostExecAdvancePcAndIt::Call(ictx, iflags);
51 return Ok(kNoInstrExecFlags);
55template <
typename TOp,
typename TInstrContext>
class BinaryNullInstrWithImm {
57 using It =
typename TInstrContext::It;
58 using Pc =
typename TInstrContext::Pc;
60 template <
typename TArg0>
62 const TArg0 &rn,
const u32 &imm) {
64 if (!condition_passed) {
65 PostExecAdvancePcAndIt::Call(ictx, iflags);
77 BinaryNullInstrWithImm() =
delete;
82 ~BinaryNullInstrWithImm() =
delete;
88 BinaryNullInstrWithImm(
const BinaryNullInstrWithImm &r_src) =
delete;
94 BinaryNullInstrWithImm &operator=(
const BinaryNullInstrWithImm &r_src) =
delete;
100 BinaryNullInstrWithImm(BinaryNullInstrWithImm &&r_src) =
delete;
106 BinaryNullInstrWithImm &operator=(BinaryNullInstrWithImm &&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