aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Waterman <andrew@sifive.com>2025-06-19 14:41:36 -0700
committerGitHub <noreply@github.com>2025-06-19 14:41:36 -0700
commit065950a045d88f7558295df43416dfc25d1aeaf1 (patch)
treefd2be5de2150a004ff754e905381f6ed017320a7
parent5cb0a97677faf340f75ba3e480b1a5a13cfe90e8 (diff)
parent4dfba258d98428461fc9b0248736fa097901bb67 (diff)
downloadspike-master.zip
spike-master.tar.gz
spike-master.tar.bz2
Merge pull request #2010 from jmonesti/perf.aiaHEADmaster
Performance: processor_t::take_interrupt() should check EXT_SSAIA
-rw-r--r--riscv/processor.cc12
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) {