diff options
author | iximeow <me@iximeow.net> | 2019-12-16 00:29:40 -0800 |
---|---|---|
committer | iximeow <me@iximeow.net> | 2020-01-12 16:10:14 -0800 |
commit | 81147159d3e8a11a0a97d112bd631b5aeeaa73c6 (patch) | |
tree | 8d2764c37311aea76a7d3e006cf1b93e97c860d2 /src/lib.rs | |
parent | 8d8cb8d594217a630dea605348211539afe3f940 (diff) |
add avx decoder flag, and a display impl showing active features
Diffstat (limited to 'src/lib.rs')
-rw-r--r-- | src/lib.rs | 10 |
1 files changed, 10 insertions, 0 deletions
@@ -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<(), ()> { |