From ac9506a1a785495a8f5f299ca90f948cce28ecc7 Mon Sep 17 00:00:00 2001 From: taitep Date: Sun, 21 Dec 2025 12:07:12 +0100 Subject: (BIG CHANGE) Switch instruction identification/execution to use a plain match tree, should improve performance by quite a bit --- src/instructions/gen_tools.rs | 28 ---------------------------- 1 file changed, 28 deletions(-) delete mode 100644 src/instructions/gen_tools.rs (limited to 'src/instructions/gen_tools.rs') diff --git a/src/instructions/gen_tools.rs b/src/instructions/gen_tools.rs deleted file mode 100644 index a3d45bc..0000000 --- a/src/instructions/gen_tools.rs +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (c) 2025 taitep -// SPDX-License-Identifier: MIT -// -// This file is part of TRVE (https://gitea.taitep.se/taitep/trve) -// See LICENSE file in the project root for full license text. - -use std::hint::unreachable_unchecked; - -use crate::instructions::{OpcodeHandler, Splitter}; - -pub fn insert_funct3_splitter(splitter: &mut Option) -> &mut [OpcodeHandler; 8] { - match splitter { - Some(Splitter::Funct3Splitter(s)) => s.as_mut(), - Some(_) => panic!("Unexpected splitter variant"), - None => { - *splitter = Some(Splitter::Funct3Splitter(Box::new(std::array::from_fn( - |_i| OpcodeHandler { - handler: None, - splitter: None, - }, - )))); - match splitter { - Some(Splitter::Funct3Splitter(s)) => s.as_mut(), - _ => unsafe { unreachable_unchecked() }, - } - } - } -} -- cgit v1.2.3