From f0b70fe1774a0da0cd6148fb28b933d6dfb122f8 Mon Sep 17 00:00:00 2001 From: Johannes Stoelp Date: Mon, 18 Mar 2024 22:58:34 +0100 Subject: asm: add cmovnz/cmovz instructions --- src/insn/cmovnz.rs | 8 ++++++++ src/insn/cmovz.rs | 8 ++++++++ 2 files changed, 16 insertions(+) create mode 100644 src/insn/cmovnz.rs create mode 100644 src/insn/cmovz.rs (limited to 'src/insn') diff --git a/src/insn/cmovnz.rs b/src/insn/cmovnz.rs new file mode 100644 index 0000000..3e7f21c --- /dev/null +++ b/src/insn/cmovnz.rs @@ -0,0 +1,8 @@ +use super::Cmovnz; +use crate::{Asm, Reg64}; + +impl Cmovnz for Asm { + fn cmovnz(&mut self, op1: Reg64, op2: Reg64) { + self.encode_rr(&[0x0f, 0x45], op2, op1); + } +} diff --git a/src/insn/cmovz.rs b/src/insn/cmovz.rs new file mode 100644 index 0000000..c49aa35 --- /dev/null +++ b/src/insn/cmovz.rs @@ -0,0 +1,8 @@ +use super::Cmovz; +use crate::{Asm, Reg64}; + +impl Cmovz for Asm { + fn cmovz(&mut self, op1: Reg64, op2: Reg64) { + self.encode_rr(&[0x0f, 0x44], op2, op1); + } +} -- cgit v1.2.3