From 54538a07bf4e0b8b2335e146198cda02a49589c8 Mon Sep 17 00:00:00 2001 From: iximeow Date: Sun, 1 Jun 2025 09:11:30 +0000 Subject: revise_instruction is the same on all bitnesses, so macro it too --- src/long_mode/mod.rs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/long_mode/mod.rs') diff --git a/src/long_mode/mod.rs b/src/long_mode/mod.rs index e471391..1ec924a 100644 --- a/src/long_mode/mod.rs +++ b/src/long_mode/mod.rs @@ -3,7 +3,6 @@ mod evex; #[cfg(feature = "fmt")] mod display; pub mod uarch; -mod isa_settings; pub use crate::MemoryAccessSize; @@ -19,6 +18,10 @@ use yaxpeax_arch::annotation::{AnnotatingDecoder, DescriptionSink, NullSink}; use yaxpeax_arch::{DecodeError as ArchDecodeError}; use yaxpeax_arch::safer_unchecked::unreachable_kinda_unchecked as unreachable_unchecked; +// generate InstDecoder settings and `revise_instruction` here. a bit early, but +// gets it out of the way.. +crate::isa_settings::gen_arch_isa_settings!(Instruction, Opcode, DecodeError, InstDecoder); + use core::fmt; impl fmt::Display for DecodeError { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { @@ -2865,7 +2868,7 @@ fn decode_with_annotation< return Err(DecodeError::TooLong); } - isa_settings::revise_instruction(decoder, instr)?; + revise_instruction(decoder, instr)?; Ok(()) } -- cgit v1.1