have the sign extend instructions also extend zero sign

pull/21/head
Ondřej Hruška 4 years ago
parent 5b163e969f
commit 22cbfeb4ff
Signed by: 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) { let res = if 0 != (val & 0x8000_0000) {
0xFFFF_FFFF_0000_0000 | val 0xFFFF_FFFF_0000_0000 | val
} else { } else {
val val & 0xFFFF_FFFF
}; };
state.update_status(res); state.update_status(res);
state.write(dst, res)?; state.write(dst, res)?;
@ -323,7 +323,7 @@ impl OpTrait for ArithOp {
let res = if 0 != (val & 0x8000) { let res = if 0 != (val & 0x8000) {
0xFFFF_FFFF_FFFF_0000 | val 0xFFFF_FFFF_FFFF_0000 | val
} else { } else {
val val & 0xFFFF
}; };
state.update_status(res); state.update_status(res);
state.write(dst, res)?; state.write(dst, res)?;
@ -334,7 +334,7 @@ impl OpTrait for ArithOp {
let res = if 0 != (val & 0x80) { let res = if 0 != (val & 0x80) {
0xFFFF_FFFF_FFFF_FF00 | val 0xFFFF_FFFF_FFFF_FF00 | val
} else { } else {
val val & 0xFF
}; };
state.update_status(res); state.update_status(res);
state.write(dst, res)?; state.write(dst, res)?;

Loading…
Cancel
Save