Skip to content

Commit

Permalink
[ARM64_DYNAREC] Mostly cosmetic change on (I)DIV 8bits opcode
Browse files Browse the repository at this point in the history
  • Loading branch information
ptitSeb committed Feb 10, 2025
1 parent f5174d1 commit 7e0c4dc
Showing 1 changed file with 31 additions and 35 deletions.
66 changes: 31 additions & 35 deletions src/dynarec/arm64/dynarec_arm64_00.c
Original file line number Diff line number Diff line change
Expand Up @@ -3496,25 +3496,23 @@ uintptr_t dynarec64_00(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin
UXTBw(x2, xRAX);
MULw(x1, x2, x1);
BFIx(xRAX, x1, 0, 16);
UFLAG_IF {
SET_DFNONE();
IFX(X_CF|X_OF) {
CMPSw_REG_LSR(xZR, x1, 8);
CSETw(x3, cNE);
IFX(X_CF) {
BFIw(xFlags, x3, F_CF, 1);
}
IFX(X_OF) {
BFIw(xFlags, x3, F_OF, 1);
}
SET_DFNONE();
IFX(X_CF|X_OF) {
CMPSw_REG_LSR(xZR, x1, 8);
CSETw(x3, cNE);
IFX(X_CF) {
BFIw(xFlags, x3, F_CF, 1);
}
IFX(X_OF) {
BFIw(xFlags, x3, F_OF, 1);
}
IFX(X_AF | X_PF | X_ZF | X_SF)
if (BOX64ENV(dynarec_test)) {
// to avoid noise during test
MOV32w(x3, (1<<F_ZF)|(1<<F_AF)|(1<<F_PF)|(1<<F_SF));
BICw(xFlags, xFlags, x3);
}
}
IFX(X_AF | X_PF | X_ZF | X_SF)
if (BOX64ENV(dynarec_test)) {
// to avoid noise during test
MOV32w(x3, (1<<F_ZF)|(1<<F_AF)|(1<<F_PF)|(1<<F_SF));
BICw(xFlags, xFlags, x3);
}
break;
case 5:
INST_NAME("IMUL AL, Eb");
Expand All @@ -3523,26 +3521,24 @@ uintptr_t dynarec64_00(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin
SXTBw(x2, xRAX);
MULw(x1, x2, x1);
BFIx(xRAX, x1, 0, 16);
UFLAG_IF {
SET_DFNONE();
IFX(X_CF|X_OF) {
ASRxw(x2, x1, 8);
CMPSw_REG_ASR(x2, x1, 16);
CSETw(x3, cNE);
IFX(X_CF) {
BFIw(xFlags, x3, F_CF, 1);
}
IFX(X_OF) {
BFIw(xFlags, x3, F_OF, 1);
}
SET_DFNONE();
IFX(X_CF|X_OF) {
ASRxw(x2, x1, 8);
CMPSw_REG_ASR(x2, x1, 16);
CSETw(x3, cNE);
IFX(X_CF) {
BFIw(xFlags, x3, F_CF, 1);
}
IFX(X_OF) {
BFIw(xFlags, x3, F_OF, 1);
}
IFX(X_AF | X_PF | X_ZF | X_SF)
if (BOX64ENV(dynarec_test)) {
// to avoid noise during test
MOV32w(x3, (1<<F_ZF)|(1<<F_AF)|(1<<F_PF)|(1<<F_SF));
BICw(xFlags, xFlags, x3);
}
}
IFX(X_AF | X_PF | X_ZF | X_SF)
if (BOX64ENV(dynarec_test)) {
// to avoid noise during test
MOV32w(x3, (1<<F_ZF)|(1<<F_AF)|(1<<F_PF)|(1<<F_SF));
BICw(xFlags, xFlags, x3);
}
break;
case 6:
INST_NAME("DIV Eb");
Expand Down

0 comments on commit 7e0c4dc

Please sign in to comment.