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/mod.rs | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/long_mode/mod.rs') diff --git a/src/long_mode/mod.rs b/src/long_mode/mod.rs index 3b3bddb..5c431b4 100644 --- a/src/long_mode/mod.rs +++ b/src/long_mode/mod.rs @@ -3223,6 +3223,8 @@ impl Prefixes { #[inline] fn set_repnz(&mut self) { self.bits = (self.bits & 0xcf) | 0x30 } #[inline] + pub fn rep_any(&self) -> 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