summaryrefslogtreecommitdiff
path: root/inc
diff options
context:
space:
mode:
authorbd <bdunahu@operationnull.com>2025-05-10 18:25:23 -0400
committerbd <bdunahu@operationnull.com>2025-05-10 18:25:23 -0400
commitebb2a3d33d4536bcace34e9ba95198067ae19522 (patch)
tree9773c935932ee3a4e2fdaa1d25e61ba3f06abd03 /inc
parentf0f773a1f2acc3030c89fc5aa6335f667987aa2a (diff)
Add type field to InstrDTO, required for next refactor
Diffstat (limited to 'inc')
-rw-r--r--inc/instr.h13
-rw-r--r--inc/instrDTO.h4
2 files changed, 15 insertions, 2 deletions
diff --git a/inc/instr.h b/inc/instr.h
index c4f5e37..0c49a79 100644
--- a/inc/instr.h
+++ b/inc/instr.h
@@ -61,11 +61,20 @@ enum Mnemonic {
NOP,
};
+enum FieldType {
+ SI_INT,
+ R_VECT,
+ I_VECT,
+};
+
namespace instr
{
extern const std::unordered_map<unsigned int, Mnemonic> mnemonic_map;
-bool is_vector_type(Mnemonic m);
-bool is_logical_type(Mnemonic m);
+/**
+ * @param a mnemonic
+ * @return an enum representing the types of the decoded instruction fields.
+ */
+FieldType get_field_types(Mnemonic m);
} // namespace instr
#endif /* INSTR_H_INCLUDED */
diff --git a/inc/instrDTO.h b/inc/instrDTO.h
index f4ef416..98247a3 100644
--- a/inc/instrDTO.h
+++ b/inc/instrDTO.h
@@ -60,6 +60,10 @@ struct InstrDTO {
* The register this instruction checks out.
*/
signed int checked_out;
+ /**
+ * The currently active union member.
+ */
+ FieldType type;
union {
struct U_INT_TYPE integer;
struct V_TYPE vector;