aboutsummaryrefslogtreecommitdiff
path: root/src/long_mode/vex.rs
diff options
context:
space:
mode:
authoriximeow <me@iximeow.net>2021-08-13 23:44:28 -0700
committeriximeow <me@iximeow.net>2021-08-21 19:08:40 -0700
commita07098315bea8b880688831f931bc5213ebb6a5f (patch)
tree67b134241aefde7919091c51e97bbc6b0f6c62b1 /src/long_mode/vex.rs
parent9cb6967f484553d78f75113ad534a34960184db8 (diff)
extend annotation reporting to 32- and 16-bit modes, kinda
Diffstat (limited to 'src/long_mode/vex.rs')
-rw-r--r--src/long_mode/vex.rs12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/long_mode/vex.rs b/src/long_mode/vex.rs
index 9649e72..893d624 100644
--- a/src/long_mode/vex.rs
+++ b/src/long_mode/vex.rs
@@ -1,8 +1,10 @@
use yaxpeax_arch::Reader;
+use yaxpeax_arch::DescriptionSink;
use crate::long_mode::Arch;
use crate::long_mode::OperandSpec;
use crate::long_mode::DecodeError;
+use crate::long_mode::FieldDescription;
use crate::long_mode::RegSpec;
use crate::long_mode::RegisterBank;
use crate::long_mode::Instruction;
@@ -100,7 +102,10 @@ enum VEXOperandCode {
}
#[inline(never)]
-pub(crate) fn three_byte_vex<T: Reader<<Arch as yaxpeax_arch::Arch>::Address, <Arch as yaxpeax_arch::Arch>::Word>>(words: &mut T, instruction: &mut Instruction) -> Result<(), DecodeError> {
+pub(crate) fn three_byte_vex<
+ T: Reader<<Arch as yaxpeax_arch::Arch>::Address, <Arch as yaxpeax_arch::Arch>::Word>,
+ S: DescriptionSink<FieldDescription>,
+>(words: &mut T, instruction: &mut Instruction, sink: &mut S) -> Result<(), DecodeError> {
let vex_byte_one = words.next().ok().ok_or(DecodeError::ExhaustedInput)?;
let vex_byte_two = words.next().ok().ok_or(DecodeError::ExhaustedInput)?;
let p = vex_byte_two & 0x03;
@@ -130,7 +135,10 @@ pub(crate) fn three_byte_vex<T: Reader<<Arch as yaxpeax_arch::Arch>::Address, <A
read_vex_instruction(m, words, instruction, p)
}
-pub(crate) fn two_byte_vex<T: Reader<<Arch as yaxpeax_arch::Arch>::Address, <Arch as yaxpeax_arch::Arch>::Word>>(words: &mut T, instruction: &mut Instruction) -> Result<(), DecodeError> {
+pub(crate) fn two_byte_vex<
+ T: Reader<<Arch as yaxpeax_arch::Arch>::Address, <Arch as yaxpeax_arch::Arch>::Word>,
+ S: DescriptionSink<FieldDescription>,
+>(words: &mut T, instruction: &mut Instruction, sink: &mut S) -> Result<(), DecodeError> {
let vex_byte = words.next().ok().ok_or(DecodeError::ExhaustedInput)?;
let p = vex_byte & 0x03;
let p = match p {