Skip to content

Commit

Permalink
Merge pull request #12217 from unknownbrackets/vfpu-dot
Browse files Browse the repository at this point in the history
Merge vfpu-dot changes and add compat flag for Tekken
  • Loading branch information
hrydgard authored Aug 5, 2019
2 parents dc9e794 + 85b9ad8 commit 2ba998d
Show file tree
Hide file tree
Showing 11 changed files with 478 additions and 63 deletions.
1 change: 1 addition & 0 deletions Common/BitScan.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#pragma once

#include "ppsspp_config.h"
#include <cstdint>

#if PPSSPP_PLATFORM(WINDOWS)
#include "Common/CommonWindows.h"
Expand Down
1 change: 1 addition & 0 deletions Core/Compatibility.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ void Compatibility::CheckSettings(IniFile &iniFile, const std::string &gameID) {
CheckSetting(iniFile, gameID, "ForceMax60FPS", &flags_.ForceMax60FPS);
CheckSetting(iniFile, gameID, "JitInvalidationHack", &flags_.JitInvalidationHack);
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) {
Expand Down
1 change: 1 addition & 0 deletions Core/Compatibility.h
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ struct CompatFlags {
bool ForceMax60FPS;
bool JitInvalidationHack;
bool HideISOFiles;
bool MoreAccurateVMMUL;
};

class IniFile;
Expand Down
14 changes: 10 additions & 4 deletions Core/MIPS/ARM/ArmCompVFPU.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,16 @@
#include <cmath>
#include "math/math_util.h"

#include "Core/Compatibility.h"
#include "Core/Config.h"
#include "Core/MemMap.h"
#include "Core/Reporting.h"
#include "Core/System.h"
#include "Core/MIPS/MIPS.h"
#include "Core/MIPS/MIPSTables.h"
#include "Core/MIPS/MIPSAnalyst.h"
#include "Core/MIPS/MIPSCodeUtils.h"
#include "Common/CPUDetect.h"
#include "Core/Config.h"
#include "Core/Reporting.h"

#include "Core/MIPS/ARM/ArmJit.h"
#include "Core/MIPS/ARM/ArmRegCache.h"
Expand Down Expand Up @@ -1468,12 +1470,16 @@ namespace MIPSComp

void ArmJit::Comp_Vmmul(MIPSOpcode op) {
CONDITIONAL_DISABLE(VFPU_MTX_VMMUL);
if (js.HasUnknownPrefix()) {
if (!js.HasNoPrefix()) {
DISABLE;
}
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);
int n = GetMatrixSide(sz);
Expand Down
13 changes: 10 additions & 3 deletions Core/MIPS/ARM64/Arm64CompVFPU.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,16 @@
#include <cmath>
#include "math/math_util.h"

#include "Core/Compatibility.h"
#include "Core/Config.h"
#include "Core/MemMap.h"
#include "Core/Reporting.h"
#include "Core/System.h"
#include "Core/MIPS/MIPS.h"
#include "Core/MIPS/MIPSTables.h"
#include "Core/MIPS/MIPSAnalyst.h"
#include "Core/MIPS/MIPSCodeUtils.h"
#include "Common/CPUDetect.h"
#include "Core/Config.h"
#include "Core/Reporting.h"

#include "Common/Arm64Emitter.h"
#include "Core/MIPS/ARM64/Arm64Jit.h"
#include "Core/MIPS/ARM64/Arm64RegCache.h"
Expand Down Expand Up @@ -1219,6 +1220,12 @@ namespace MIPSComp {
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);
int n = GetMatrixSide(sz);

Expand Down
8 changes: 8 additions & 0 deletions Core/MIPS/IR/IRCompVFPU.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
#include "math/math_util.h"

#include "Common/CPUDetect.h"
#include "Core/Compatibility.h"
#include "Core/Config.h"
#include "Core/MemMap.h"
#include "Core/MIPS/MIPS.h"
Expand All @@ -29,6 +30,7 @@
#include "Core/MIPS/IR/IRFrontend.h"
#include "Core/MIPS/IR/IRRegCache.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.
Expand Down Expand Up @@ -1242,6 +1244,12 @@ namespace MIPSComp {
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)
// 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.
Expand Down
Loading

0 comments on commit 2ba998d

Please sign in to comment.