aboutsummaryrefslogtreecommitdiff
path: root/src/lib.rs
diff options
context:
space:
mode:
authoriximeow <me@iximeow.net>2019-12-16 00:29:40 -0800
committeriximeow <me@iximeow.net>2020-01-12 16:10:14 -0800
commit81147159d3e8a11a0a97d112bd631b5aeeaa73c6 (patch)
tree8d2764c37311aea76a7d3e006cf1b93e97c860d2 /src/lib.rs
parent8d8cb8d594217a630dea605348211539afe3f940 (diff)
add avx decoder flag, and a display impl showing active features
Diffstat (limited to 'src/lib.rs')
-rw-r--r--src/lib.rs10
1 files changed, 10 insertions, 0 deletions
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<(), ()> {