From 1b67ac9fb28b475edfaf2406f0707ba746999cb3 Mon Sep 17 00:00:00 2001 From: Johannes Stoelp Date: Fri, 13 Dec 2024 20:50:37 +0100 Subject: bf: update upper bound check --- examples/bf.rs | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'examples/bf.rs') diff --git a/examples/bf.rs b/examples/bf.rs index fb75c09..4bd232e 100644 --- a/examples/bf.rs +++ b/examples/bf.rs @@ -207,9 +207,7 @@ fn run_jit(prog: &str) { 1 => { asm.inc(Mem8::indirect_base_index(dmem_base, dmem_idx)); } - cnt if cnt <= i8::MAX as usize => { - // For add m64, imm8, the immediate is sign-extend and - // hence treated as signed. + cnt if cnt <= u8::MAX as usize => { asm.add( Mem8::indirect_base_index(dmem_base, dmem_idx), Imm8::from(cnt as u8), @@ -230,9 +228,7 @@ fn run_jit(prog: &str) { 1 => { asm.dec(Mem8::indirect_base_index(dmem_base, dmem_idx)); } - cnt if cnt <= i8::MAX as usize => { - // For sub m64, imm8, the immediate is sign-extend and - // hence treated as signed. + cnt if cnt <= u8::MAX as usize => { asm.sub( Mem8::indirect_base_index(dmem_base, dmem_idx), Imm8::from(cnt as u8), -- cgit v1.2.3