aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoriximeow <me@iximeow.net>2019-10-20 04:13:55 -0700
committeriximeow <me@iximeow.net>2020-01-12 16:10:13 -0800
commit6b84ac1fc52bbf720a2e706036fb85d850545014 (patch)
treea98516559a5ffcf166e39fb8ded74c8b215efb2a
parentcd10937143a4fbcf1569f7572dcacb0c113cb34b (diff)
move jbs operand code up for improved speculation
-rw-r--r--src/lib.rs12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/lib.rs b/src/lib.rs
index f2184bb..d2a1acd 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -2372,6 +2372,12 @@ pub fn read_operands<T: Iterator<Item=u8>>(mut bytes_iter: T, instruction: &mut
read_E(&mut bytes_iter, instruction, modrm, 0, opwidth)?;
instruction.operands[1] =
Operand::Register(RegSpec::gp_from_parts((modrm >> 3) & 7, instruction.prefixes.rex().r(), opwidth, instruction.prefixes.rex().present()));
+ } else if operand_code == OperandCode::Jbs {
+ // TODO: arch width (8 in 64, 4 in 32, 2 in 16)
+ instruction.operands = [
+ read_imm_signed(&mut bytes_iter, 1, 8, &mut instruction.length)?,
+ Operand::Nothing
+ ];
} else if operand_code == OperandCode::Gb_Eb {
let opwidth = 1;
let modrm = read_modrm(&mut bytes_iter, &mut instruction.length)?;
@@ -2386,12 +2392,6 @@ pub fn read_operands<T: Iterator<Item=u8>>(mut bytes_iter: T, instruction: &mut
read_E(&mut bytes_iter, instruction, modrm, 0, opwidth)?;
instruction.operands[1] =
Operand::Register(RegSpec::gp_from_parts((modrm >> 3) & 7, instruction.prefixes.rex().r(), opwidth, instruction.prefixes.rex().present()));
- } else if operand_code == OperandCode::Jbs {
- // TODO: arch width (8 in 64, 4 in 32, 2 in 16)
- instruction.operands = [
- read_imm_signed(&mut bytes_iter, 1, 8, &mut instruction.length)?,
- Operand::Nothing
- ];
} else {
match operand_code {
/*