From 81147159d3e8a11a0a97d112bd631b5aeeaa73c6 Mon Sep 17 00:00:00 2001 From: iximeow Date: Mon, 16 Dec 2019 00:29:40 -0800 Subject: add avx decoder flag, and a display impl showing active features --- src/lib.rs | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/lib.rs') diff --git a/src/lib.rs b/src/lib.rs index 272db75..1d798ab 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1330,6 +1330,7 @@ pub struct InstDecoder { // 52. tbm // 53. intel quirks // 54. amd quirks + // 55. avx (intel ?, amd ?) flags: u64, } @@ -1839,6 +1840,15 @@ impl InstDecoder { self } + pub fn avx(&self) -> bool { + self.flags & (1 << 54) != 0 + } + + pub fn with_avx(mut self) -> Self { + self.flags |= 1 << 54; + self + } + /// Optionally reject or reinterpret instruction according to the decoder's /// declared extensions. fn revise_instruction(&self, inst: &mut Instruction) -> Result<(), ()> { -- cgit v1.1