summaryrefslogtreecommitdiff
path: root/src/instructions/gen_tools.rs
diff options
context:
space:
mode:
authortaitep <taitep@taitep.se>2025-12-21 12:07:12 +0100
committertaitep <taitep@taitep.se>2025-12-21 12:07:12 +0100
commitac9506a1a785495a8f5f299ca90f948cce28ecc7 (patch)
treea3517406fc74edca336249601cc89b65477f5d2e /src/instructions/gen_tools.rs
parente2d521bbe73708da64662478155630d634e00932 (diff)
(BIG CHANGE) Switch instruction identification/execution to use a plain match tree, should improve performance by quite a bit
Diffstat (limited to 'src/instructions/gen_tools.rs')
-rw-r--r--src/instructions/gen_tools.rs28
1 files changed, 0 insertions, 28 deletions
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<Splitter>) -> &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() },
- }
- }
- }
-}