mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-12-04 03:33:44 +01:00
Also implement vcst in x86 jit
This commit is contained in:
1 parent
bac7e87125
commit
b603214777
2 files changed
+76
-11
No files matched your search
@@ -37,7 +37,7 @@
|
||||
|
||||
// TODO: Test and maybe fix: https://code.google.com/p/jpcsp/source/detail?r=3082#
|
||||
|
||||
#include "../Core.h"
|
||||
#include "Core/Core.h"
|
||||
#include "Core/Reporting.h"
|
||||
#include "math/math_util.h"
|
||||
|
||||
|
||||
+75
-10
@@ -15,16 +15,19 @@
|
||||
// Official git repository and contact information can be found at
|
||||
// https://github.com/hrydgard/ppsspp and http://www.ppsspp.org/.
|
||||
|
||||
#include "../../MemMap.h"
|
||||
#include "../../Config.h"
|
||||
#include "../MIPSAnalyst.h"
|
||||
#include "Core/Reporting.h"
|
||||
#include <cmath>
|
||||
#include <limits>
|
||||
#include "math/math_util.h"
|
||||
|
||||
#include "Core/MemMap.h"
|
||||
#include "Core/Config.h"
|
||||
#include "Core/Reporting.h"
|
||||
#include "Core/MIPS/MIPSAnalyst.h"
|
||||
|
||||
#include "Core/MIPS/MIPSVFPUUtils.h"
|
||||
#include "Jit.h"
|
||||
#include "../MIPSVFPUUtils.h"
|
||||
#include "RegCache.h"
|
||||
|
||||
// VERY UNFINISHED!
|
||||
|
||||
// All functions should have CONDITIONAL_DISABLE, so we can narrow things down to a file quickly.
|
||||
// Currently known non working ones should have DISABLE.
|
||||
@@ -43,6 +46,24 @@
|
||||
#define _POS ((op>>6 ) & 0x1F)
|
||||
#define _SIZE ((op>>11 ) & 0x1F)
|
||||
|
||||
|
||||
#ifndef M_LOG2E
|
||||
#define M_E 2.71828182845904523536f
|
||||
#define M_LOG2E 1.44269504088896340736f
|
||||
#define M_LOG10E 0.434294481903251827651f
|
||||
#define M_LN2 0.693147180559945309417f
|
||||
#define M_LN10 2.30258509299404568402f
|
||||
#undef M_PI
|
||||
#define M_PI 3.14159265358979323846f
|
||||
#define M_PI_2 1.57079632679489661923f
|
||||
#define M_PI_4 0.785398163397448309616f
|
||||
#define M_1_PI 0.318309886183790671538f
|
||||
#define M_2_PI 0.636619772367581343076f
|
||||
#define M_2_SQRTPI 1.12837916709551257390f
|
||||
#define M_SQRT2 1.41421356237309504880f
|
||||
#define M_SQRT1_2 0.707106781186547524401f
|
||||
#endif
|
||||
|
||||
using namespace Gen;
|
||||
|
||||
namespace MIPSComp
|
||||
@@ -550,6 +571,7 @@ void Jit::Comp_Vi2f(u32 op) {
|
||||
MOV(32, R(EAX), fpr.V(sregs[i]));
|
||||
CVTSI2SS(XMM0, R(EAX));
|
||||
MULSS(XMM0, R(XMM1));
|
||||
fpr.MapRegV(dregs[i], (dregs[i] == sregs[i] ? 0 : MAP_NOINIT) | MAP_DIRTY);
|
||||
MOVSS(fpr.V(dregs[i]), XMM0);
|
||||
}
|
||||
|
||||
@@ -557,6 +579,53 @@ void Jit::Comp_Vi2f(u32 op) {
|
||||
fpr.ReleaseSpillLocks();
|
||||
}
|
||||
|
||||
static const float cst_constants[32] = {
|
||||
0,
|
||||
std::numeric_limits<float>::max(), // all these are verified on real PSP
|
||||
sqrtf(2.0f),
|
||||
sqrtf(0.5f),
|
||||
2.0f/sqrtf((float)M_PI),
|
||||
2.0f/(float)M_PI,
|
||||
1.0f/(float)M_PI,
|
||||
(float)M_PI/4,
|
||||
(float)M_PI/2,
|
||||
(float)M_PI,
|
||||
(float)M_E,
|
||||
(float)M_LOG2E,
|
||||
(float)M_LOG10E,
|
||||
(float)M_LN2,
|
||||
(float)M_LN10,
|
||||
2*(float)M_PI,
|
||||
(float)M_PI/6,
|
||||
log10f(2.0f),
|
||||
logf(10.0f)/logf(2.0f),
|
||||
sqrtf(3.0f)/2.0f,
|
||||
};
|
||||
|
||||
void Jit::Comp_Vcst(u32 op) {
|
||||
CONDITIONAL_DISABLE;
|
||||
|
||||
if (js.HasUnknownPrefix())
|
||||
DISABLE;
|
||||
|
||||
int conNum = (op >> 16) & 0x1f;
|
||||
int vd = _VD;
|
||||
|
||||
VectorSize sz = GetVecSize(op);
|
||||
int n = GetNumVectorElements(sz);
|
||||
|
||||
u8 dregs[4];
|
||||
GetVectorRegsPrefixD(dregs, sz, _VD);
|
||||
|
||||
MOVSS(XMM0, M((void *)&cst_constants[conNum]));
|
||||
fpr.MapRegsV(dregs, sz, MAP_NOINIT | MAP_DIRTY);
|
||||
for (int i = 0; i < n; i++) {
|
||||
MOVSS(fpr.V(dregs[i]), XMM0);
|
||||
}
|
||||
ApplyPrefixD(dregs, sz);
|
||||
fpr.ReleaseSpillLocks();
|
||||
}
|
||||
|
||||
void Jit::Comp_VV2Op(u32 op) {
|
||||
CONDITIONAL_DISABLE;
|
||||
|
||||
@@ -1019,10 +1088,6 @@ void Jit::Comp_Vf2i(u32 op) {
|
||||
DISABLE;
|
||||
}
|
||||
|
||||
void Jit::Comp_Vcst(u32 op) {
|
||||
DISABLE;
|
||||
}
|
||||
|
||||
void Jit::Comp_Vhoriz(u32 op) {
|
||||
DISABLE;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user