From e433752d59c1bb790c2de86f2b5e327de8de793d Mon Sep 17 00:00:00 2001 From: iximeow Date: Sun, 9 Aug 2020 00:47:02 -0700 Subject: avoid a bunch of checks in the likely display path rep_any will get speculated `false` quite quickly, whereas checking if the opcode is a string instruction will be costly no matter what. in the rare case rep_any is true, i don't care how costly displaying the instruction is - string instructions are relatively rare, and rep movs is typically not more than one instance when it shows up. --- src/long_mode/display.rs | 20 ++++++++++---------- src/long_mode/mod.rs | 2 ++ 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/src/long_mode/display.rs b/src/long_mode/display.rs index 42d3683..5dac6cf 100644 --- a/src/long_mode/display.rs +++ b/src/long_mode/display.rs @@ -2244,18 +2244,18 @@ impl > ShowContextual bool { self.bits & 0x30 != 0x00 } + #[inline] fn operand_size(&self) -> bool { self.bits & 0x1 == 1 } #[inline] fn set_operand_size(&mut self) { self.bits = self.bits | 0x1 } -- cgit v1.1