Hackery to help track down #15149. Runs without breaking on PC.

This commit is contained in:
Henrik Rydgård 2022-05-02 08:50:42 +02:00
parent 7fb5cbace4
commit 2003890a48
3 changed files with 14 additions and 4 deletions

View file

@ -235,7 +235,7 @@ namespace MIPSInt
d[i] = Memory::Read_Float(addr + 4 * i);
}
}
WriteVector(d, V_Quad, vt);
WriteVector(d, V_Quad, vt, true);
}
break;
@ -247,7 +247,7 @@ namespace MIPSInt
#ifndef COMMON_BIG_ENDIAN
f = reinterpret_cast<float *>(Memory::GetPointer(addr));
if (f)
WriteVector(f, V_Quad, vt);
WriteVector(f, V_Quad, vt, true);
#else
float lvqd[4];

View file

@ -22,6 +22,7 @@
#include "Common/BitScan.h"
#include "Common/CommonFuncs.h"
#include "Common/Math/math_util.h"
#include "Core/Reporting.h"
#include "Core/MIPS/MIPS.h"
#include "Core/MIPS/MIPSVFPUUtils.h"
@ -183,7 +184,7 @@ void ReadVector(float *rd, VectorSize size, int reg) {
}
}
void WriteVector(const float *rd, VectorSize size, int reg) {
void WriteVector(const float *rd, VectorSize size, int reg, bool is_svq) {
if (size == V_Single) {
// Optimize the common case.
if (!currentMIPS->VfpuWriteMask(0)) {
@ -206,6 +207,15 @@ void WriteVector(const float *rd, VectorSize size, int reg) {
default: _assert_msg_(false, "%s: Bad vector size", __FUNCTION__);
}
// TEMP HACK for issue #15149
// There's often garbage in the fourth coordinate so ignore it.
// Additionally, the SVQ instruction specifically stores some NaN data.
for (int i = 0; i < std::min(length, 3); i++) {
if (my_isnan(rd[i]) && !is_svq) {
DebugBreak();
}
}
if (currentMIPS->VfpuWriteMask() == 0) {
if (transpose) {
const int base = mtx * 4 + col * 32;

View file

@ -150,7 +150,7 @@ u32 VFPURewritePrefix(int ctrl, u32 remove, u32 add);
void ReadMatrix(float *rd, MatrixSize size, int reg);
void WriteMatrix(const float *rs, MatrixSize size, int reg);
void WriteVector(const float *rs, VectorSize N, int reg);
void WriteVector(const float *rs, VectorSize N, int reg, bool is_svq = false);
void ReadVector(float *rd, VectorSize N, int reg);
void GetVectorRegs(u8 regs[4], VectorSize N, int vectorReg);