diff options
author | Andrew Waterman <andrew@sifive.com> | 2025-06-19 14:41:36 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-06-19 14:41:36 -0700 |
commit | 065950a045d88f7558295df43416dfc25d1aeaf1 (patch) | |
tree | fd2be5de2150a004ff754e905381f6ed017320a7 | |
parent | 5cb0a97677faf340f75ba3e480b1a5a13cfe90e8 (diff) | |
parent | 4dfba258d98428461fc9b0248736fa097901bb67 (diff) | |
download | spike-master.zip spike-master.tar.gz spike-master.tar.bz2 |
Performance: processor_t::take_interrupt() should check EXT_SSAIA
-rw-r--r-- | riscv/processor.cc | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/riscv/processor.cc b/riscv/processor.cc index ec3c998..5e608a9 100644 --- a/riscv/processor.cc +++ b/riscv/processor.cc @@ -303,9 +303,15 @@ bool processor_t::is_handled_in_vs() void processor_t::take_interrupt(reg_t pending_interrupts) { - const reg_t s_pending_interrupts = state.nonvirtual_sip->read() & state.nonvirtual_sie->read(); - const reg_t vstopi = state.vstopi->read(); - const reg_t vs_pending_interrupt = vstopi ? (reg_t(1) << get_field(vstopi, MTOPI_IID)) : 0; + reg_t s_pending_interrupts = 0; + reg_t vstopi = 0; + reg_t vs_pending_interrupt = 0; + + if (extension_enable_table[EXT_SSAIA]) { + s_pending_interrupts = state.nonvirtual_sip->read() & state.nonvirtual_sie->read(); + vstopi = state.vstopi->read(); + vs_pending_interrupt = vstopi ? (reg_t(1) << get_field(vstopi, MTOPI_IID)) : 0; + } // Do nothing if no pending interrupts if (!pending_interrupts && !s_pending_interrupts && !vs_pending_interrupt) { |