29 explicit Instruction(
int l) : lineno(l), slot(-1) {}
30 virtual ~Instruction() {}
32 virtual std::string name() = 0;
34 virtual void dbprint(std::ostream &)
const = 0;
35 virtual bool equiv(Instruction *a) = 0;
36 bool equiv(
const std::unique_ptr<Instruction> &a) {
return equiv(a.get()); }
37 virtual bool salu_output()
const {
return false; }
38 virtual bool salu_alu()
const {
return false; }
39 virtual bool phvRead(std::function<
void(
const Phv::Slice &sl)>) = 0;
43#define VIRTUAL_TARGET_METHODS(TARGET) \
44 virtual void write_regs(Target::TARGET::mau_regs &, Table *, Table::Actions::Action *) = 0;
45 FOR_ALL_REGISTER_SETS(VIRTUAL_TARGET_METHODS)
46#undef VIRTUAL_TARGET_METHODS
47#define DECLARE_FORWARD_VIRTUAL_INSTRUCTION_WRITE_REGS(TARGET) \
48 void write_regs(Target::TARGET::mau_regs ®s, Table *tbl, Table::Actions::Action *act) \
52 enum instruction_set_t { VLIW_ALU = 0, STATEFUL_ALU = 1, NUM_SETS = 2 };
54 static std::multimap<std::string, Decode *> opcode[NUM_SETS];
57 explicit Decode(
const char *name,
int set = VLIW_ALU,
bool ts =
false);
58 Decode(
const char *name, target_t target,
int set = VLIW_ALU,
bool ts =
false);
59 Decode(
const char *name, std::set<target_t> target,
int set = VLIW_ALU,
bool ts =
false);
60 const Decode &alias(
const char *name,
int set = VLIW_ALU,
bool ts =
false) {
61 opcode[set].emplace(name,
this);
65 const VECTOR(
value_t) & op)
const = 0;