From 22cbfeb4fff4a7802b5033017a39d33fb1ee80f5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20Hru=C5=A1ka?= Date: Thu, 15 Oct 2020 00:55:11 +0200 Subject: [PATCH] have the sign extend instructions also extend zero sign --- crsn_arith/src/exec.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/crsn_arith/src/exec.rs b/crsn_arith/src/exec.rs index ab2b4f1..64722e2 100644 --- a/crsn_arith/src/exec.rs +++ b/crsn_arith/src/exec.rs @@ -312,7 +312,7 @@ impl OpTrait for ArithOp { let res = if 0 != (val & 0x8000_0000) { 0xFFFF_FFFF_0000_0000 | val } else { - val + val & 0xFFFF_FFFF }; state.update_status(res); state.write(dst, res)?; @@ -323,7 +323,7 @@ impl OpTrait for ArithOp { let res = if 0 != (val & 0x8000) { 0xFFFF_FFFF_FFFF_0000 | val } else { - val + val & 0xFFFF }; state.update_status(res); state.write(dst, res)?; @@ -334,7 +334,7 @@ impl OpTrait for ArithOp { let res = if 0 != (val & 0x80) { 0xFFFF_FFFF_FFFF_FF00 | val } else { - val + val & 0xFF }; state.update_status(res); state.write(dst, res)?;