[RV64_DYNAREC] Fixed emit_sub8/16 (#685)

This commit is contained in:
Yang Liu 2023-04-11 15:11:33 +08:00 committed by GitHub
parent 5d63071849
commit fdb6908474
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -390,11 +390,12 @@ void emit_sub8(dynarec_rv64_t* dyn, int ninst, int s1, int s2, int s3, int s4, i
}
SUB(s1, s1, s2);
ANDI(s1, s1, 0xff);
IFX(X_SF) {
BGE(s1, xZR, 8);
SRLI(s3, s1, 7);
BEQZ(s3, 8);
ORI(xFlags, xFlags, 1 << F_SF);
}
ANDI(s1, s1, 0xff);
IFX(X_PEND) {
SB(s1, xEmu, offsetof(x64emu_t, res));
}
@ -436,11 +437,11 @@ void emit_sub16(dynarec_rv64_t* dyn, int ninst, int s1, int s2, int s3, int s4,
IFX(X_PEND) {
SH(s1, xEmu, offsetof(x64emu_t, res));
}
SLLI(s1, s1, 48);
IFX(X_SF) {
BGE(s1, xZR, 8);
ORI(xFlags, xFlags, 1 << F_SF);
}
SLLI(s1, s1, 48);
SRLI(s1, s1, 48);
CALC_SUB_FLAGS(s5, s2, s1, s3, s4, 16);