diff options
author | Karel Kočí <cynerd@email.cz> | 2017-11-21 23:54:04 +0100 |
---|---|---|
committer | Karel Kočí <cynerd@email.cz> | 2017-11-21 23:54:04 +0100 |
commit | f5d4468b2a8afa28ddad0bad425f762725eb69a7 (patch) | |
tree | 618b54866130da61a65968775a5550960e8c954c /qtmips_machine/core.cpp | |
parent | 054225612d13e9a32b7900e423590367b5969b6e (diff) | |
download | qtmips-f5d4468b2a8afa28ddad0bad425f762725eb69a7.tar.gz qtmips-f5d4468b2a8afa28ddad0bad425f762725eb69a7.tar.bz2 qtmips-f5d4468b2a8afa28ddad0bad425f762725eb69a7.zip |
Implement some logical operations
Diffstat (limited to 'qtmips_machine/core.cpp')
-rw-r--r-- | qtmips_machine/core.cpp | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/qtmips_machine/core.cpp b/qtmips_machine/core.cpp index c79801c..d86a6f4 100644 --- a/qtmips_machine/core.cpp +++ b/qtmips_machine/core.cpp @@ -18,6 +18,8 @@ // This is temporally operation place holder #define NOPE { .flags = 0, .alu = ALU_OP_SLL } +#define FLAGS_ALU_I (DM_SUPPORTED | DM_ALUSRC | DM_REGWRITE) + // This is map from opcode to signals. static const struct DecodeMap dmap[] = { { .flags = DM_SUPPORTED | DM_REGD | DM_REGWRITE, .alu = ALU_OP_SLL }, // Alu operations @@ -28,13 +30,13 @@ static const struct DecodeMap dmap[] = { NOPE, // BNE NOPE, // BLEZ NOPE, // BGTZ - { .flags = DM_SUPPORTED | DM_ALUSRC | DM_REGWRITE, .alu = ALU_OP_ADD }, // ADDI - { .flags = DM_SUPPORTED | DM_ALUSRC | DM_REGWRITE, .alu = ALU_OP_ADDU }, // ADDIU - { .flags = DM_SUPPORTED | DM_ALUSRC | DM_REGWRITE, .alu = ALU_OP_SLT }, // SLTI - { .flags = DM_SUPPORTED | DM_ALUSRC | DM_REGWRITE, .alu = ALU_OP_SLTU }, // SLTIU - NOPE, // ANDI - NOPE, // ORI - NOPE, // XORI + { .flags = FLAGS_ALU_I, .alu = ALU_OP_ADD }, // ADDI + { .flags = FLAGS_ALU_I, .alu = ALU_OP_ADDU }, // ADDIU + { .flags = FLAGS_ALU_I, .alu = ALU_OP_SLT }, // SLTI + { .flags = FLAGS_ALU_I, .alu = ALU_OP_SLTU }, // SLTIU + { .flags = FLAGS_ALU_I, .alu = ALU_OP_AND }, // ANDI + { .flags = FLAGS_ALU_I, .alu = ALU_OP_OR }, // ORI + { .flags = FLAGS_ALU_I, .alu = ALU_OP_XOR }, // XORI NOPE, // LUI NOPE, // 16 NOPE, // 17 |