diff options
author | bd <bdunahu@operationnull.com> | 2025-05-08 19:44:23 -0400 |
---|---|---|
committer | bd <bdunahu@operationnull.com> | 2025-05-08 19:44:23 -0400 |
commit | f4a5db14436ddbb2820c0abefcb34e5482105a12 (patch) | |
tree | 2b716eba64b247f03e2454f1d62d15643f203a1f /src/instr.cc | |
parent | c7132dbc9c38ff766053bd9a0b72c68b23cd08d2 (diff) |
Move is_logical_type and is_vector_type to instr.h
Diffstat (limited to 'src/instr.cc')
-rw-r--r-- | src/instr.cc | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/instr.cc b/src/instr.cc index 9bd951b..0282be3 100644 --- a/src/instr.cc +++ b/src/instr.cc @@ -37,4 +37,19 @@ const std::unordered_map<unsigned int, Mnemonic> mnemonic_map = { {0b0011010, BUF}, {0b0011110, BOF}, {0b0100010, PUSH}, {0b0100110, POP}, {0b0101010, RET}, }; + +bool is_vector_type(Mnemonic m) +{ + return ( + m == ADDV || m == SUBV || m == MULV || m == DIVV || m == CEV || + m == LOADV || m == STOREV); +} + +bool is_logical_type(Mnemonic m) +{ + return ( + m == ANDI || m == ORI || m == XORI || m == AND || m == OR || m == XOR || + m == NOT); +} + } // namespace instr |