summaryrefslogtreecommitdiff
path: root/isa/isa.h
diff options
context:
space:
mode:
authorJulian Blake Kongslie2023-01-15 14:02:54 -0800
committerJulian Blake Kongslie2023-01-15 15:04:07 -0800
commit27a58c86ce494588a12023a12b027b7f44bb35fc (patch)
treeb793a60b97ab402d8438aba0800667d4151909fe /isa/isa.h
parentEnable parallel LTO linking. (diff)
downloadbiggolf-27a58c86ce494588a12023a12b027b7f44bb35fc.tar.xz
Stall decode after an instruction with stores until the stores are done.
Diffstat (limited to '')
-rw-r--r--isa/isa.h27
1 files changed, 26 insertions, 1 deletions
diff --git a/isa/isa.h b/isa/isa.h
index 4083e16..f94a117 100644
--- a/isa/isa.h
+++ b/isa/isa.h
@@ -57,6 +57,9 @@ static std::string opr_disasm_group2_neg[0366];
57static std::string opr_disasm_extended_arith[0376]; 57static std::string opr_disasm_extended_arith[0376];
58 58
59struct instruction_context { 59struct 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
93void init_disasm_tables(); 118void init_disasm_tables();