aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorJohannes Stoelp <johannes.stoelp@gmail.com>2024-12-13 22:10:54 +0100
committerJohannes Stoelp <johannes.stoelp@gmail.com>2024-12-13 22:10:54 +0100
commite6095b086f6e2429fb952ae75a193dc89b4b9082 (patch)
tree40dc5c0da02e8919f5d0ed767c9c29eb1a0651e8 /src
parente744d0d1d27a0cf4fb7cc50bce09fc2aea9eeafe (diff)
downloadjuicebox-asm-e6095b086f6e2429fb952ae75a193dc89b4b9082.tar.gz
juicebox-asm-e6095b086f6e2429fb952ae75a193dc89b4b9082.zip
bf: add runtime check for data ptr over/underflow
Fix bug to properly save callee-saved registers on jit entry and restore registers on jit exit.
Diffstat (limited to 'src')
-rw-r--r--src/insn/cmp.rs8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/insn/cmp.rs b/src/insn/cmp.rs
index 2d6f48b..57e53eb 100644
--- a/src/insn/cmp.rs
+++ b/src/insn/cmp.rs
@@ -1,5 +1,5 @@
use super::Cmp;
-use crate::{Asm, Imm16, Imm8, Mem16, Mem8};
+use crate::{Asm, Imm16, Imm8, Mem16, Mem8, Reg64};
impl Cmp<Mem8, Imm8> for Asm {
fn cmp(&mut self, op1: Mem8, op2: Imm8) {
@@ -12,3 +12,9 @@ impl Cmp<Mem16, Imm16> for Asm {
self.encode_mi(0x81, 0x7, op1, op2);
}
}
+
+impl Cmp<Reg64, Reg64> for Asm {
+ fn cmp(&mut self, op1: Reg64, op2: Reg64) {
+ self.encode_rr(&[0x3b], op1, op2);
+ }
+}