aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/insn
diff options
context:
space:
mode:
authorJohannes Stoelp <johannes.stoelp@gmail.com>2024-03-18 22:58:34 +0100
committerJohannes Stoelp <johannes.stoelp@gmail.com>2024-03-18 22:58:34 +0100
commitf0b70fe1774a0da0cd6148fb28b933d6dfb122f8 (patch)
tree8b263f1cb3f1bc1861824366ec00c3ceee04bae2 /src/insn
parentd65d1327459a5f3866c8803fb1d9fbdb2de96f75 (diff)
downloadjuicebox-asm-f0b70fe1774a0da0cd6148fb28b933d6dfb122f8.tar.gz
juicebox-asm-f0b70fe1774a0da0cd6148fb28b933d6dfb122f8.zip
asm: add cmovnz/cmovz instructions
Diffstat (limited to 'src/insn')
-rw-r--r--src/insn/cmovnz.rs8
-rw-r--r--src/insn/cmovz.rs8
2 files changed, 16 insertions, 0 deletions
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<Reg64, Reg64> 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<Reg64, Reg64> for Asm {
+ fn cmovz(&mut self, op1: Reg64, op2: Reg64) {
+ self.encode_rr(&[0x0f, 0x44], op2, op1);
+ }
+}