Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions src/dynarec/la64/dynarec_la64_d9.c
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,9 @@ uintptr_t dynarec64_D9(dynarec_la64_t* dyn, uintptr_t addr, uintptr_t ip, int ni
// swap the cache value, not the double value itself :p
x87_get_st(dyn, ninst, x1, x2, nextop & 7, X87_ST(nextop & 7));
x87_get_st(dyn, ninst, x1, x2, 0, X87_ST0);
if (!BOX64ENV(dynarec_fastround)) {
x87_swap_fpu_ld(dyn, ninst, x1, x2, x3, x4, 0, nextop & 7);
}
x87_swapreg(dyn, ninst, x1, x2, 0, nextop & 7);
// should set C1 to 0
break;
Expand All @@ -92,7 +95,14 @@ uintptr_t dynarec64_D9(dynarec_la64_t* dyn, uintptr_t addr, uintptr_t ip, int ni
if (ST_IS_F(0)) {
FNEG_S(v1, v1);
} else {
if (!BOX64ENV(dynarec_fastround)) {
MOVFR2GR_D(x2, v1); // old ST0.q
}
FNEG_D(v1, v1);
if (!BOX64ENV(dynarec_fastround)) {
MOVFR2GR_D(x3, v1); // new ST0.q
x87_update_fpu_ld_sign(dyn, ninst, x1, x4, x5, x2, x3, 0, 1);
}
}
break;
case 0xE1:
Expand All @@ -101,7 +111,14 @@ uintptr_t dynarec64_D9(dynarec_la64_t* dyn, uintptr_t addr, uintptr_t ip, int ni
if (ST_IS_F(0)) {
FABS_S(v1, v1);
} else {
if (!BOX64ENV(dynarec_fastround)) {
MOVFR2GR_D(x2, v1); // old ST0.q
}
FABS_D(v1, v1);
if (!BOX64ENV(dynarec_fastround)) {
MOVFR2GR_D(x3, v1); // new ST0.q
x87_update_fpu_ld_sign(dyn, ninst, x1, x4, x5, x2, x3, 0, 0);
}
}
break;

Expand Down
19 changes: 18 additions & 1 deletion src/dynarec/la64/dynarec_la64_db.c
Original file line number Diff line number Diff line change
Expand Up @@ -123,23 +123,40 @@ uintptr_t dynarec64_DB(dynarec_la64_t* dyn, uintptr_t addr, uintptr_t ip, int ni
SETFLAGS(X_ALL, SF_SET_NODF, NAT_FLAGS_NOFUSION);
v1 = x87_get_st(dyn, ninst, x1, x2, 0, X87_COMBINE(0, nextop & 7));
v2 = x87_get_st(dyn, ninst, x1, x2, nextop & 7, X87_COMBINE(0, nextop & 7));
if (!BOX64ENV(dynarec_fastround)) {
MOVFR2GR_D(x6, v1);
MOVFR2GR_D(x7, v2);
x87_fcomi_fpu_ld(dyn, ninst, x1, x2, x3, x4, x5, x6, x7, nextop & 7);
BNEZ_MARK(x1);
}
if (ST_IS_F(0)) {
FCOMIS(v1, v2, x1, x2);
} else {
FCOMID(v1, v2, x1, x2);
}

if (!BOX64ENV(dynarec_fastround)) {
MARK;
}
break;
case 0xF0 ... 0xF7:
INST_NAME("FCOMI ST0, STx");
SETFLAGS(X_ALL, SF_SET_NODF, NAT_FLAGS_NOFUSION);
v1 = x87_get_st(dyn, ninst, x1, x2, 0, X87_COMBINE(0, nextop & 7));
v2 = x87_get_st(dyn, ninst, x1, x2, nextop & 7, X87_COMBINE(0, nextop & 7));
if (!BOX64ENV(dynarec_fastround)) {
MOVFR2GR_D(x6, v1);
MOVFR2GR_D(x7, v2);
x87_fcomi_fpu_ld(dyn, ninst, x1, x2, x3, x4, x5, x6, x7, nextop & 7);
BNEZ_MARK(x1);
}
if (ST_IS_F(0)) {
FCOMIS(v1, v2, x1, x2);
} else {
FCOMID(v1, v2, x1, x2);
}
if (!BOX64ENV(dynarec_fastround)) {
MARK;
}
break;
default:
DEFAULT;
Expand Down
9 changes: 9 additions & 0 deletions src/dynarec/la64/dynarec_la64_df.c
Original file line number Diff line number Diff line change
Expand Up @@ -91,11 +91,20 @@ uintptr_t dynarec64_DF(dynarec_la64_t* dyn, uintptr_t addr, uintptr_t ip, int ni
SET_DFNONE();
v1 = x87_get_st(dyn, ninst, x1, x2, 0, X87_COMBINE(0, nextop & 7));
v2 = x87_get_st(dyn, ninst, x1, x2, nextop & 7, X87_COMBINE(0, nextop & 7));
if (!BOX64ENV(dynarec_fastround)) {
MOVFR2GR_D(x6, v1);
MOVFR2GR_D(x7, v2);
x87_fcomi_fpu_ld(dyn, ninst, x1, x2, x3, x4, x5, x6, x7, nextop & 7);
BNEZ_MARK(x1);
}
if (ST_IS_F(0)) {
FCOMIS(v1, v2, x1, x2);
} else {
FCOMID(v1, v2, x1, x2);
}
if (!BOX64ENV(dynarec_fastround)) {
MARK;
}
X87_POP_OR_FAIL(dyn, ninst, x3);
break;
default:
Expand Down
Loading
Loading