Skip to content

Commit

Permalink
[ARM64_DYNAREC] Make sure neg on 16bits is correctly computed
Browse files Browse the repository at this point in the history
  • Loading branch information
ptitSeb committed Oct 29, 2024
1 parent fdfc5c4 commit 4a440b6
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/dynarec/arm64/dynarec_arm64_emit_math.c
Original file line number Diff line number Diff line change
Expand Up @@ -1726,10 +1726,11 @@ void emit_neg16(dynarec_arm_t* dyn, int ninst, int s1, int s3, int s4)
IFX(X_AF|X_OF) {
MOVw_REG(s3, s1);
}
NEGw_REG(s1, s1);
IFX(X_ZF) {
NEGSw_REG(s1, s1);
ANDSw_mask(s1, s1, 0, 15); //mask=0xffff
} else {
NEGw_REG(s1, s1);
ANDw_mask(s1, s1, 0, 15); //mask=0xffff
}
IFX(X_PEND) {
STRH_U12(s1, xEmu, offsetof(x64emu_t, res));
Expand Down

0 comments on commit 4a440b6

Please sign in to comment.