have the sign extend instructions also extend zero sign

floats
Ondřej Hruška 4 years ago
parent 5b163e969f
commit 22cbfeb4ff
Signed by untrusted user: MightyPork
GPG Key ID: 2C5FD5035250423D
  1. 6
      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)?;

Loading…
Cancel
Save