require_extension('A');
require_rv64;
-WRITE_RD(MMU.amo_uint64(RS1, [&](uint64_t lhs) { return std::max(lhs, RS2); }));
+WRITE_RD(MMU.amo_uint64(RS1, [&](uint64_t lhs) { return (lhs > RS2) ? lhs : RS2; }));
require_extension('A');
require_rv64;
-WRITE_RD(MMU.amo_uint64(RS1, [&](uint64_t lhs) { return std::min(lhs, RS2); }));
+WRITE_RD(MMU.amo_uint64(RS1, [&](uint64_t lhs) { return (lhs < RS2) ? lhs : RS2; }));
}
*/
-RS1::operator reg_t () const {
+RS1::operator reg_t () const & {
return _insn->p->get_state()->XPR[_insn->rs1()];
}
+RS2::operator reg_t () const & {
+ return _insn->p->get_state()->XPR[_insn->rs2()];
+}
+
#include "sv_decode.h"
#undef RS1
+#undef RS2
class processor_t;
class insn_t;
RS1() : _insn(NULL) {}
//sv_insn_t & operator = (sv_insn_t &i)
//{ _insn = &i; return i; }
- operator reg_t () const;
+ operator reg_t () const &;
+};
+
+class RS2 {
+ public:
+ sv_insn_t *_insn;
+ RS2() : _insn(NULL) {}
+ //sv_insn_t & operator = (sv_insn_t &i)
+ //{ _insn = &i; return i; }
+ operator reg_t () const &;
};
class sv_proc_t
processor_t *p;
class RS1 RS1;
+ class RS2 RS2;
class {
public:
void set_insn(sv_insn_t *i) {
this->insn = *i;
RS1._insn = i;
+ RS2._insn = i;
}
#include "sv_insn_decl.h"