mirror of
https://github.com/hrydgard/ppsspp.git
synced 2025-04-02 11:01:50 -04:00
Compat: Option to use accurate dotprod for VMMUL.
Eliminates Tekken 6 leg shaking.
This commit is contained in:
parent
c1c869df27
commit
f65a71d6d8
9 changed files with 54 additions and 13 deletions
|
@ -1,6 +1,7 @@
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "ppsspp_config.h"
|
#include "ppsspp_config.h"
|
||||||
|
#include <cstdint>
|
||||||
|
|
||||||
#if PPSSPP_PLATFORM(WINDOWS)
|
#if PPSSPP_PLATFORM(WINDOWS)
|
||||||
#include "Common/CommonWindows.h"
|
#include "Common/CommonWindows.h"
|
||||||
|
|
|
@ -65,6 +65,7 @@ void Compatibility::CheckSettings(IniFile &iniFile, const std::string &gameID) {
|
||||||
CheckSetting(iniFile, gameID, "ForceMax60FPS", &flags_.ForceMax60FPS);
|
CheckSetting(iniFile, gameID, "ForceMax60FPS", &flags_.ForceMax60FPS);
|
||||||
CheckSetting(iniFile, gameID, "JitInvalidationHack", &flags_.JitInvalidationHack);
|
CheckSetting(iniFile, gameID, "JitInvalidationHack", &flags_.JitInvalidationHack);
|
||||||
CheckSetting(iniFile, gameID, "HideISOFiles", &flags_.HideISOFiles);
|
CheckSetting(iniFile, gameID, "HideISOFiles", &flags_.HideISOFiles);
|
||||||
|
CheckSetting(iniFile, gameID, "MoreAccurateVMMUL", &flags_.MoreAccurateVMMUL);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Compatibility::CheckSetting(IniFile &iniFile, const std::string &gameID, const char *option, bool *flag) {
|
void Compatibility::CheckSetting(IniFile &iniFile, const std::string &gameID, const char *option, bool *flag) {
|
||||||
|
|
|
@ -65,6 +65,7 @@ struct CompatFlags {
|
||||||
bool ForceMax60FPS;
|
bool ForceMax60FPS;
|
||||||
bool JitInvalidationHack;
|
bool JitInvalidationHack;
|
||||||
bool HideISOFiles;
|
bool HideISOFiles;
|
||||||
|
bool MoreAccurateVMMUL;
|
||||||
};
|
};
|
||||||
|
|
||||||
class IniFile;
|
class IniFile;
|
||||||
|
|
|
@ -21,14 +21,16 @@
|
||||||
#include <cmath>
|
#include <cmath>
|
||||||
#include "math/math_util.h"
|
#include "math/math_util.h"
|
||||||
|
|
||||||
|
#include "Core/Compatibility.h"
|
||||||
|
#include "Core/Config.h"
|
||||||
#include "Core/MemMap.h"
|
#include "Core/MemMap.h"
|
||||||
|
#include "Core/Reporting.h"
|
||||||
|
#include "Core/System.h"
|
||||||
#include "Core/MIPS/MIPS.h"
|
#include "Core/MIPS/MIPS.h"
|
||||||
#include "Core/MIPS/MIPSTables.h"
|
#include "Core/MIPS/MIPSTables.h"
|
||||||
#include "Core/MIPS/MIPSAnalyst.h"
|
#include "Core/MIPS/MIPSAnalyst.h"
|
||||||
#include "Core/MIPS/MIPSCodeUtils.h"
|
#include "Core/MIPS/MIPSCodeUtils.h"
|
||||||
#include "Common/CPUDetect.h"
|
#include "Common/CPUDetect.h"
|
||||||
#include "Core/Config.h"
|
|
||||||
#include "Core/Reporting.h"
|
|
||||||
|
|
||||||
#include "Core/MIPS/ARM/ArmJit.h"
|
#include "Core/MIPS/ARM/ArmJit.h"
|
||||||
#include "Core/MIPS/ARM/ArmRegCache.h"
|
#include "Core/MIPS/ARM/ArmRegCache.h"
|
||||||
|
@ -1468,12 +1470,16 @@ namespace MIPSComp
|
||||||
|
|
||||||
void ArmJit::Comp_Vmmul(MIPSOpcode op) {
|
void ArmJit::Comp_Vmmul(MIPSOpcode op) {
|
||||||
CONDITIONAL_DISABLE(VFPU_MTX_VMMUL);
|
CONDITIONAL_DISABLE(VFPU_MTX_VMMUL);
|
||||||
if (js.HasUnknownPrefix()) {
|
if (!js.HasNoPrefix()) {
|
||||||
DISABLE;
|
DISABLE;
|
||||||
}
|
}
|
||||||
NEON_IF_AVAILABLE(CompNEON_Vmmul);
|
NEON_IF_AVAILABLE(CompNEON_Vmmul);
|
||||||
|
|
||||||
// TODO: This probably ignores prefixes?
|
if (PSP_CoreParameter().compat.flags().MoreAccurateVMMUL) {
|
||||||
|
// Fall back to interpreter, which has the accurate implementation.
|
||||||
|
// Later we might do something more optimized here.
|
||||||
|
DISABLE;
|
||||||
|
}
|
||||||
|
|
||||||
MatrixSize sz = GetMtxSize(op);
|
MatrixSize sz = GetMtxSize(op);
|
||||||
int n = GetMatrixSide(sz);
|
int n = GetMatrixSide(sz);
|
||||||
|
|
|
@ -21,15 +21,16 @@
|
||||||
#include <cmath>
|
#include <cmath>
|
||||||
#include "math/math_util.h"
|
#include "math/math_util.h"
|
||||||
|
|
||||||
|
#include "Core/Compatibility.h"
|
||||||
|
#include "Core/Config.h"
|
||||||
#include "Core/MemMap.h"
|
#include "Core/MemMap.h"
|
||||||
|
#include "Core/Reporting.h"
|
||||||
|
#include "Core/System.h"
|
||||||
#include "Core/MIPS/MIPS.h"
|
#include "Core/MIPS/MIPS.h"
|
||||||
#include "Core/MIPS/MIPSTables.h"
|
#include "Core/MIPS/MIPSTables.h"
|
||||||
#include "Core/MIPS/MIPSAnalyst.h"
|
#include "Core/MIPS/MIPSAnalyst.h"
|
||||||
#include "Core/MIPS/MIPSCodeUtils.h"
|
#include "Core/MIPS/MIPSCodeUtils.h"
|
||||||
#include "Common/CPUDetect.h"
|
#include "Common/CPUDetect.h"
|
||||||
#include "Core/Config.h"
|
|
||||||
#include "Core/Reporting.h"
|
|
||||||
|
|
||||||
#include "Common/Arm64Emitter.h"
|
#include "Common/Arm64Emitter.h"
|
||||||
#include "Core/MIPS/ARM64/Arm64Jit.h"
|
#include "Core/MIPS/ARM64/Arm64Jit.h"
|
||||||
#include "Core/MIPS/ARM64/Arm64RegCache.h"
|
#include "Core/MIPS/ARM64/Arm64RegCache.h"
|
||||||
|
@ -1219,6 +1220,12 @@ namespace MIPSComp {
|
||||||
DISABLE;
|
DISABLE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (PSP_CoreParameter().compat.flags().MoreAccurateVMMUL) {
|
||||||
|
// Fall back to interpreter, which has the accurate implementation.
|
||||||
|
// Later we might do something more optimized here.
|
||||||
|
DISABLE;
|
||||||
|
}
|
||||||
|
|
||||||
MatrixSize sz = GetMtxSize(op);
|
MatrixSize sz = GetMtxSize(op);
|
||||||
int n = GetMatrixSide(sz);
|
int n = GetMatrixSide(sz);
|
||||||
|
|
||||||
|
|
|
@ -20,6 +20,7 @@
|
||||||
#include "math/math_util.h"
|
#include "math/math_util.h"
|
||||||
|
|
||||||
#include "Common/CPUDetect.h"
|
#include "Common/CPUDetect.h"
|
||||||
|
#include "Core/Compatibility.h"
|
||||||
#include "Core/Config.h"
|
#include "Core/Config.h"
|
||||||
#include "Core/MemMap.h"
|
#include "Core/MemMap.h"
|
||||||
#include "Core/MIPS/MIPS.h"
|
#include "Core/MIPS/MIPS.h"
|
||||||
|
@ -29,6 +30,7 @@
|
||||||
#include "Core/MIPS/IR/IRFrontend.h"
|
#include "Core/MIPS/IR/IRFrontend.h"
|
||||||
#include "Core/MIPS/IR/IRRegCache.h"
|
#include "Core/MIPS/IR/IRRegCache.h"
|
||||||
#include "Core/Reporting.h"
|
#include "Core/Reporting.h"
|
||||||
|
#include "Core/System.h"
|
||||||
|
|
||||||
|
|
||||||
// All functions should have CONDITIONAL_DISABLE, so we can narrow things down to a file quickly.
|
// All functions should have CONDITIONAL_DISABLE, so we can narrow things down to a file quickly.
|
||||||
|
@ -1242,6 +1244,12 @@ namespace MIPSComp {
|
||||||
DISABLE;
|
DISABLE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (PSP_CoreParameter().compat.flags().MoreAccurateVMMUL) {
|
||||||
|
// Fall back to interpreter, which has the accurate implementation.
|
||||||
|
// Later we might do something more optimized here.
|
||||||
|
DISABLE;
|
||||||
|
}
|
||||||
|
|
||||||
// Matrix multiply (weird prefixes)
|
// Matrix multiply (weird prefixes)
|
||||||
// D[0 .. N, 0 .. M] = S[0 .. N, 0 .. M]' * T[0 .. N, 0 .. M]
|
// D[0 .. N, 0 .. M] = S[0 .. N, 0 .. M]' * T[0 .. N, 0 .. M]
|
||||||
// Note: Behaves as if it's implemented through a series of vdots.
|
// Note: Behaves as if it's implemented through a series of vdots.
|
||||||
|
|
|
@ -23,9 +23,11 @@
|
||||||
|
|
||||||
#include "math/math_util.h"
|
#include "math/math_util.h"
|
||||||
|
|
||||||
|
#include "Core/Compatibility.h"
|
||||||
#include "Core/Core.h"
|
#include "Core/Core.h"
|
||||||
#include "Core/Reporting.h"
|
|
||||||
#include "Core/MemMap.h"
|
#include "Core/MemMap.h"
|
||||||
|
#include "Core/Reporting.h"
|
||||||
|
#include "Core/System.h"
|
||||||
|
|
||||||
#include "Core/MIPS/MIPS.h"
|
#include "Core/MIPS/MIPS.h"
|
||||||
#include "Core/MIPS/MIPSInt.h"
|
#include "Core/MIPS/MIPSInt.h"
|
||||||
|
@ -467,6 +469,8 @@ namespace MIPSInt
|
||||||
ReadMatrix(s, sz, vs);
|
ReadMatrix(s, sz, vs);
|
||||||
ReadMatrix(t, sz, vt);
|
ReadMatrix(t, sz, vt);
|
||||||
|
|
||||||
|
// TODO: Always use the more accurate path in interpreter?
|
||||||
|
bool useAccurateDot = USE_VFPU_DOT || PSP_CoreParameter().compat.flags().MoreAccurateVMMUL;
|
||||||
for (int a = 0; a < n; a++) {
|
for (int a = 0; a < n; a++) {
|
||||||
for (int b = 0; b < n; b++) {
|
for (int b = 0; b < n; b++) {
|
||||||
union { float f; uint32_t u; } sum = { 0.0f };
|
union { float f; uint32_t u; } sum = { 0.0f };
|
||||||
|
@ -476,7 +480,7 @@ namespace MIPSInt
|
||||||
ApplySwizzleT(&t[a * 4], V_Quad);
|
ApplySwizzleT(&t[a * 4], V_Quad);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (USE_VFPU_DOT) {
|
if (useAccurateDot) {
|
||||||
sum.f = vfpu_dot(&s[b * 4], &t[a * 4]);
|
sum.f = vfpu_dot(&s[b * 4], &t[a * 4]);
|
||||||
if (my_isnan(sum.f)) {
|
if (my_isnan(sum.f)) {
|
||||||
sum.u = 0x7f800001;
|
sum.u = 0x7f800001;
|
||||||
|
|
|
@ -29,9 +29,11 @@
|
||||||
#include "math/math_util.h"
|
#include "math/math_util.h"
|
||||||
|
|
||||||
#include "Common/CPUDetect.h"
|
#include "Common/CPUDetect.h"
|
||||||
#include "Core/MemMap.h"
|
#include "Core/Compatibility.h"
|
||||||
#include "Core/Config.h"
|
#include "Core/Config.h"
|
||||||
|
#include "Core/MemMap.h"
|
||||||
#include "Core/Reporting.h"
|
#include "Core/Reporting.h"
|
||||||
|
#include "Core/System.h"
|
||||||
#include "Core/MIPS/MIPSAnalyst.h"
|
#include "Core/MIPS/MIPSAnalyst.h"
|
||||||
#include "Core/MIPS/MIPSCodeUtils.h"
|
#include "Core/MIPS/MIPSCodeUtils.h"
|
||||||
#include "Core/MIPS/MIPSVFPUUtils.h"
|
#include "Core/MIPS/MIPSVFPUUtils.h"
|
||||||
|
@ -2803,10 +2805,15 @@ void Jit::Comp_VScl(MIPSOpcode op) {
|
||||||
|
|
||||||
void Jit::Comp_Vmmul(MIPSOpcode op) {
|
void Jit::Comp_Vmmul(MIPSOpcode op) {
|
||||||
CONDITIONAL_DISABLE(VFPU_MTX_VMMUL);
|
CONDITIONAL_DISABLE(VFPU_MTX_VMMUL);
|
||||||
|
if (!js.HasNoPrefix()) {
|
||||||
// TODO: This probably ignores prefixes?
|
|
||||||
if (js.HasUnknownPrefix())
|
|
||||||
DISABLE;
|
DISABLE;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (PSP_CoreParameter().compat.flags().MoreAccurateVMMUL) {
|
||||||
|
// Fall back to interpreter, which has the accurate implementation.
|
||||||
|
// Later we might do something more optimized here.
|
||||||
|
DISABLE;
|
||||||
|
}
|
||||||
|
|
||||||
MatrixSize sz = GetMtxSize(op);
|
MatrixSize sz = GetMtxSize(op);
|
||||||
VectorSize vsz = GetVectorSize(sz);
|
VectorSize vsz = GetVectorSize(sz);
|
||||||
|
|
|
@ -620,3 +620,9 @@ NPJH50471 = true
|
||||||
ULJM06033 = true
|
ULJM06033 = true
|
||||||
NPJH50559 = true
|
NPJH50559 = true
|
||||||
NPEH00030 = true
|
NPEH00030 = true
|
||||||
|
|
||||||
|
[MoreAccurateVMMUL]
|
||||||
|
# Fixes leg shaking in Tekken 6. The potential for slowdown in other games is large enough
|
||||||
|
# that we will not generally apply this accurate mode where not needed.
|
||||||
|
ULES01376 = true
|
||||||
|
ULUS10466 = true
|
||||||
|
|
Loading…
Add table
Reference in a new issue