diff options
| author | Julian Blake Kongslie | 2023-01-15 14:02:54 -0800 |
|---|---|---|
| committer | Julian Blake Kongslie | 2023-01-15 15:04:07 -0800 |
| commit | 27a58c86ce494588a12023a12b027b7f44bb35fc (patch) | |
| tree | b793a60b97ab402d8438aba0800667d4151909fe /isa/isa.h | |
| parent | Enable parallel LTO linking. (diff) | |
| download | biggolf-27a58c86ce494588a12023a12b027b7f44bb35fc.tar.xz | |
Stall decode after an instruction with stores until the stores are done.
Diffstat (limited to '')
| -rw-r--r-- | isa/isa.h | 27 |
1 files changed, 26 insertions, 1 deletions
| @@ -57,6 +57,9 @@ static std::string opr_disasm_group2_neg[0366]; | |||
| 57 | static std::string opr_disasm_extended_arith[0376]; | 57 | static std::string opr_disasm_extended_arith[0376]; |
| 58 | 58 | ||
| 59 | struct instruction_context { | 59 | struct instruction_context { |
| 60 | // Known statically before decode time | ||
| 61 | unsigned int bits; | ||
| 62 | |||
| 60 | // Known statically at decode time | 63 | // Known statically at decode time |
| 61 | bool need_indirect_load = false; // final_address = mem[init_address] | 64 | bool need_indirect_load = false; // final_address = mem[init_address] |
| 62 | bool need_autoinc_store = false; // mem[init_address] += 1 | 65 | bool need_autoinc_store = false; // mem[init_address] += 1 |
| @@ -79,7 +82,6 @@ struct instruction_context { | |||
| 79 | void execute() { ef(*this); } | 82 | void execute() { ef(*this); } |
| 80 | 83 | ||
| 81 | // May change over the lifetime of the instruction execution | 84 | // May change over the lifetime of the instruction execution |
| 82 | unsigned int bits; | ||
| 83 | unsigned int next_pc; // includes IF | 85 | unsigned int next_pc; // includes IF |
| 84 | std::optional<unsigned int> init_address; // includes DF | 86 | std::optional<unsigned int> init_address; // includes DF |
| 85 | std::optional<unsigned int> final_address; // includes DF | 87 | std::optional<unsigned int> final_address; // includes DF |
| @@ -88,6 +90,29 @@ struct instruction_context { | |||
| 88 | std::optional<unsigned int> acc; | 90 | std::optional<unsigned int> acc; |
| 89 | std::optional<bool> link; | 91 | std::optional<bool> link; |
| 90 | std::optional<unsigned int> mq; | 92 | std::optional<unsigned int> mq; |
| 93 | |||
| 94 | // N.B. two "identical" instructions may compare unequal if they are at different points in their execution | ||
| 95 | bool operator==(const instruction_context &that) const { | ||
| 96 | if (bits != that.bits) | ||
| 97 | return false; | ||
| 98 | if (init_address != that.init_address) | ||
| 99 | return false; | ||
| 100 | if (final_address != that.final_address) | ||
| 101 | return false; | ||
| 102 | if (ctlval != that.ctlval) | ||
| 103 | return false; | ||
| 104 | if (data != that.data) | ||
| 105 | return false; | ||
| 106 | if (acc != that.acc) | ||
| 107 | return false; | ||
| 108 | if (link != that.link) | ||
| 109 | return false; | ||
| 110 | if (mq != that.mq) | ||
| 111 | return false; | ||
| 112 | if (next_pc != that.next_pc) | ||
| 113 | return false; | ||
| 114 | return true; | ||
| 115 | } | ||
| 91 | }; | 116 | }; |
| 92 | 117 | ||
| 93 | void init_disasm_tables(); | 118 | void init_disasm_tables(); |
