M new/include/viua/libs/lexer.h => new/include/viua/libs/lexer.h +17 -0
@@ 268,6 268,12 @@ inline auto const OPCODE_NAMES = std::set<std::string>{
"g.sm",
"lm",
"g.lm",
+ "aa",
+ "g.aa",
+ "ad",
+ "g.ad",
+ "ptr",
+ "g.ptr",
/*
* Pseudoinstructions listed below.
@@ 294,6 300,17 @@ inline auto const OPCODE_NAMES = std::set<std::string>{
"sq",
"lq",
"mq",
+
+ "aba",
+ "aha",
+ "awa",
+ "ada",
+ "aqa",
+ "abd",
+ "ahd",
+ "awd",
+ "add",
+ "aqd",
};
auto lex(std::string_view) -> std::vector<Lexeme>;
M new/src/tools/exec/dis.cpp => new/src/tools/exec/dis.cpp +15 -2
@@ 416,7 416,7 @@ auto demangle_memory(Cooked_text& text) -> void
using enum viua::arch::ops::OPCODE;
for (auto i = size_t{0}; i < text.size(); ++i) {
using viua::arch::ops::GREEDY;
- if (m(i, SM) or m(i, LM)) {
+ if (m(i, SM) or m(i, LM) or m(i, AA) or m(i, AD)) {
using viua::arch::ops::M;
auto const op = M::decode(ins_at(i));
@@ 428,9 428,12 @@ auto demangle_memory(Cooked_text& text) -> void
case LM:
name = "l";
break;
+ case AA:
+ case AD:
+ name = "a";
+ break;
default:
abort();
- break;
}
switch (op.spec) {
case 0:
@@ 452,6 455,16 @@ auto demangle_memory(Cooked_text& text) -> void
abort();
break;
}
+ switch (static_cast<viua::arch::ops::OPCODE>(op.opcode)) {
+ case AA:
+ name += "a";
+ break;
+ case AD:
+ name += "d";
+ break;
+ default:
+ break;
+ }
auto idx = text.at(i).index;
idx.physical_span = idx.physical;
M new/src/tools/libs/stage.cpp => new/src/tools/libs/stage.cpp +22 -0
@@ 991,6 991,18 @@ auto expand_memory_access(std::vector<ast::Instruction>& cooked,
auto synth = ast::Instruction{};
synth.opcode = raw.opcode;
synth.opcode.text[1] = 'm';
+ if (synth.opcode.text[0] == 'a') {
+ switch (synth.opcode.text.back()) {
+ case 'a':
+ synth.opcode.text = "aa";
+ break;
+ case 'd':
+ synth.opcode.text = "ad";
+ break;
+ default:
+ abort();
+ }
+ }
synth.physical_index = raw.physical_index;
synth.operands.push_back(raw.operands.at(0));
@@ 1049,6 1061,16 @@ auto expand_pseudoinstructions(std::vector<ast::Instruction> raw,
"sq",
"lq",
"mq",
+ "aba",
+ "aha",
+ "awa",
+ "ada",
+ "aqa",
+ "abd",
+ "ahd",
+ "awd",
+ "add",
+ "aqd",
};
/*