From a781322552d9fb52b7b5e51641f49f12678f682f Mon Sep 17 00:00:00 2001 From: iximeow Date: Thu, 1 Jul 2021 23:54:06 -0700 Subject: reallocate OperandCode, convert disparate registers to array also remove redundant assignments of operand_count and some OperandSpec, bulk-assign all registers and operands on entry to `read_instr`. this all, taken together, shaves off about 7 cycles per decode. --- test/long_mode/display.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'test/long_mode/display.rs') diff --git a/test/long_mode/display.rs b/test/long_mode/display.rs index 4ef3f74..fc59427 100644 --- a/test/long_mode/display.rs +++ b/test/long_mode/display.rs @@ -12,7 +12,8 @@ fn test_display_under(decoder: &InstDecoder, data: &[u8], expected: &'static str for b in data { write!(hex, "{:02x}", b).unwrap(); } - match decoder.decode(data.into_iter().map(|x| *x)) { + let mut reader = yaxpeax_arch::U8Reader::new(data); + match decoder.decode(&mut reader) { Ok(instr) => { let text = format!("{}", instr.display_with(DisplayStyle::C)); assert!( -- cgit v1.1