From 52a0308e18fbbec25f0e9f31ec8f11589a35f351 Mon Sep 17 00:00:00 2001 From: johannst Date: Mon, 18 Mar 2024 22:02:54 +0000 Subject: deploy: 7653ced7e8ce18b9ada2b666c63832007f8becf2 --- src/tiny_vm/tiny_vm.rs.html | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'src/tiny_vm/tiny_vm.rs.html') diff --git a/src/tiny_vm/tiny_vm.rs.html b/src/tiny_vm/tiny_vm.rs.html index 938bc61..e8937f6 100644 --- a/src/tiny_vm/tiny_vm.rs.html +++ b/src/tiny_vm/tiny_vm.rs.html @@ -744,7 +744,7 @@ use juicebox_asm::insn::*; use juicebox_asm::Runtime; -use juicebox_asm::{Asm, Imm16, Imm64, Label, MemOp, Reg16, Reg64}; +use juicebox_asm::{Asm, Imm16, Imm64, MemOp, Reg16, Reg64}; /// A guest physical address. pub struct PhysAddr(pub u16); @@ -1036,13 +1036,13 @@ TinyInsn::BranchZero(a, disp) => { bb.cmp(reg_op(a), Imm16::from(0u16)); bb.mov(Reg64::rax, Imm64::from(bb_icnt())); - bb.mov(Reg64::rdx, Imm64::from(reenter_pc(disp))); + // Default fall-through PC (branch not taken). + bb.mov(Reg64::rdx, Imm64::from(reenter_pc(pc))); + + // Conditionally update PC if condition is ZERO (branch taken). + bb.mov(Reg64::r11, Imm64::from(reenter_pc(disp))); + bb.cmovz(Reg64::rdx, Reg64::r11); - let mut skip_next_pc = Label::new(); - // If register is zero, skip setting next pc as reenter pc. - bb.jz(&mut skip_next_pc); - bb.mov(Reg64::rdx, Imm64::from(reenter_pc(pc))); - bb.bind(&mut skip_next_pc); bb.ret(); break 'outer; } -- cgit v1.2.3