diff options
author | Johannes Stoelp <johannes.stoelp@gmail.com> | 2024-12-13 20:50:37 +0100 |
---|---|---|
committer | Johannes Stoelp <johannes.stoelp@gmail.com> | 2024-12-13 20:50:37 +0100 |
commit | 1b67ac9fb28b475edfaf2406f0707ba746999cb3 (patch) | |
tree | 053e8fa46ca67990d070141295ad57ed3d4ae9f0 /examples/bf.rs | |
parent | f06967bbe80d5647412a4b709b1d3de0fe056627 (diff) | |
download | juicebox-asm-1b67ac9fb28b475edfaf2406f0707ba746999cb3.tar.gz juicebox-asm-1b67ac9fb28b475edfaf2406f0707ba746999cb3.zip |
bf: update upper bound check
Diffstat (limited to 'examples/bf.rs')
-rw-r--r-- | examples/bf.rs | 8 |
1 files changed, 2 insertions, 6 deletions
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), |