interp: Correct vmfvc register behavior.

The target and source registers were completely wrong.
This commit is contained in:
Unknown W. Brackets committed 2019-03-31 13:41:48 -07:00
1 parent b2e024025f
commit 5749ae09d0
5 files changed
+23 -23

No files matched your search

+5 -5
View File
@@ -1333,16 +1333,16 @@ namespace MIPSComp
NEON_IF_AVAILABLE(CompNEON_Vmtvc);
CONDITIONAL_DISABLE(VFPU_XFER);
int vs = _VS;
int imm = op & 0xFF;
int vd = _VD;
int imm = (op >> 8) & 0xFF;
if (imm >= 128 && imm < 128 + VFPU_CTRL_MAX) {
fpr.MapRegV(vs);
fpr.MapRegV(vd);
if (imm - 128 == VFPU_CTRL_CC) {
gpr.MapReg(MIPS_REG_VFPUCC, 0);
VMOV(fpr.V(vs), gpr.R(MIPS_REG_VFPUCC));
VMOV(fpr.V(vd), gpr.R(MIPS_REG_VFPUCC));
} else {
ADDI2R(SCRATCHREG1, CTXREG, offsetof(MIPSState, vfpuCtrl[0]) + (imm - 128) * 4, SCRATCHREG2);
VLDR(fpr.V(vs), SCRATCHREG1, 0);
VLDR(fpr.V(vd), SCRATCHREG1, 0);
}
fpr.ReleaseSpillLocksAndDiscardTemps();
}
+5 -5
View File
@@ -1066,16 +1066,16 @@ namespace MIPSComp {
void Arm64Jit::Comp_Vmfvc(MIPSOpcode op) {
CONDITIONAL_DISABLE(VFPU_XFER);
int vs = _VS;
int imm = op & 0xFF;
int vd = _VD;
int imm = (op >> 8) & 0xFF;
if (imm >= 128 && imm < 128 + VFPU_CTRL_MAX) {
fpr.MapRegV(vs);
fpr.MapRegV(vd);
if (imm - 128 == VFPU_CTRL_CC) {
gpr.MapReg(MIPS_REG_VFPUCC, 0);
fp.FMOV(fpr.V(vs), gpr.R(MIPS_REG_VFPUCC));
fp.FMOV(fpr.V(vd), gpr.R(MIPS_REG_VFPUCC));
} else {
ADDI2R(SCRATCH1_64, CTXREG, offsetof(MIPSState, vfpuCtrl[0]) + (imm - 128) * 4, SCRATCH2);
fp.LDR(32, INDEX_UNSIGNED, fpr.V(vs), SCRATCH1_64, 0);
fp.LDR(32, INDEX_UNSIGNED, fpr.V(vd), SCRATCH1_64, 0);
}
fpr.ReleaseSpillLocksAndDiscardTemps();
}
+4 -4
View File
@@ -1018,13 +1018,13 @@ namespace MIPSComp {
CONDITIONAL_DISABLE(VFPU_XFER);
// Vector Move from vector control reg (no prefixes)
// S[0] = VFPU_CTRL[i]
// D[0] = VFPU_CTRL[i]
int vs = _VS;
int imm = op & 0xFF;
int vd = _VD;
int imm = (op >> 8) & 0xFF;
if (imm >= 128 && imm < 128 + VFPU_CTRL_MAX) {
ir.Write(IROp::VfpuCtrlToReg, IRTEMP_0, imm - 128);
ir.Write(IROp::FMovFromGPR, vfpuBase + voffset[vs], IRTEMP_0);
ir.Write(IROp::FMovFromGPR, vfpuBase + voffset[vd], IRTEMP_0);
} else {
INVALIDOP;
}
+4 -4
View File
@@ -1495,7 +1495,7 @@ namespace MIPSInt
if (rt != 0) {
if (imm < 128) {
R(rt) = VI(imm);
} else if (imm < 128 + VFPU_CTRL_MAX) { //mtvc
} else if (imm < 128 + VFPU_CTRL_MAX) { //mfvc
R(rt) = currentMIPS->vfpuCtrl[imm - 128];
} else {
//ERROR - maybe need to make this value too an "interlock" value?
@@ -1526,10 +1526,10 @@ namespace MIPSInt
}
void Int_Vmfvc(MIPSOpcode op) {
int vs = _VS;
int imm = op & 0xFF;
int vd = _VD;
int imm = (op >> 8) & 0xFF;
if (imm >= 128 && imm < 128 + VFPU_CTRL_MAX) {
VI(vs) = currentMIPS->vfpuCtrl[imm - 128];
VI(vd) = currentMIPS->vfpuCtrl[imm - 128];
}
PC += 4;
}
+5 -5
View File
@@ -2528,15 +2528,15 @@ void Jit::Comp_Mftv(MIPSOpcode op) {
void Jit::Comp_Vmfvc(MIPSOpcode op) {
CONDITIONAL_DISABLE(VFPU_XFER);
int vs = _VS;
int imm = op & 0xFF;
int vd = _VD;
int imm = (op >> 8) & 0xFF;
if (imm >= 128 && imm < 128 + VFPU_CTRL_MAX) {
fpr.MapRegV(vs, MAP_DIRTY | MAP_NOINIT);
fpr.MapRegV(vd, MAP_DIRTY | MAP_NOINIT);
if (imm - 128 == VFPU_CTRL_CC) {
gpr.MapReg(MIPS_REG_VFPUCC, true, false);
MOVD_xmm(fpr.VX(vs), gpr.R(MIPS_REG_VFPUCC));
MOVD_xmm(fpr.VX(vd), gpr.R(MIPS_REG_VFPUCC));
} else {
MOVSS(fpr.VX(vs), MIPSSTATE_VAR_ELEM32(vfpuCtrl[0], imm - 128));
MOVSS(fpr.VX(vd), MIPSSTATE_VAR_ELEM32(vfpuCtrl[0], imm - 128));
}
fpr.ReleaseSpillLocks();
}