diff options
author | Andrew Waterman <andrew@sifive.com> | 2022-01-06 17:19:11 -0800 |
---|---|---|
committer | Andrew Waterman <andrew@sifive.com> | 2022-01-06 17:21:06 -0800 |
commit | fc572daaef35fdc081466e6a67413b1f3b4d6a3e (patch) | |
tree | 1b13e962055a28f0d3044720f2f6e2b05c3addfc /riscv/processor.h | |
parent | 2fbc6cde0b6b0e7d4ef77ae092c4ae286a77e2bf (diff) | |
download | spike-fc572daaef35fdc081466e6a67413b1f3b4d6a3e.zip spike-fc572daaef35fdc081466e6a67413b1f3b4d6a3e.tar.gz spike-fc572daaef35fdc081466e6a67413b1f3b4d6a3e.tar.bz2 |
Support RV32E/RV64E base ISAs
Diffstat (limited to 'riscv/processor.h')
-rw-r--r-- | riscv/processor.h | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/riscv/processor.h b/riscv/processor.h index de896bf..35f8afc 100644 --- a/riscv/processor.h +++ b/riscv/processor.h @@ -29,14 +29,22 @@ struct insn_desc_t { insn_bits_t match; insn_bits_t mask; - insn_func_t rv32; - insn_func_t rv64; + insn_func_t rv32i; + insn_func_t rv64i; + insn_func_t rv32e; + insn_func_t rv64e; - insn_func_t func(int xlen) { return xlen == 64 ? rv64 : rv32; } + insn_func_t func(int xlen, bool rve) + { + if (rve) + return xlen == 64 ? rv64e : rv32e; + else + return xlen == 64 ? rv64i : rv32i; + } static insn_desc_t illegal() { - return {0, 0, &illegal_instruction, &illegal_instruction}; + return {0, 0, &illegal_instruction, &illegal_instruction, &illegal_instruction, &illegal_instruction}; } }; @@ -603,9 +611,4 @@ public: vectorUnit_t VU; }; -#define REGISTER_INSN(proc, name, match, mask, archen) \ - extern reg_t rv32_##name(processor_t*, insn_t, reg_t); \ - extern reg_t rv64_##name(processor_t*, insn_t, reg_t); \ - proc->register_insn((insn_desc_t){match, mask, rv32_##name, rv64_##name,archen}); - #endif |