Merge branch 'ppc_fp'
This commit is contained in:
commit
b863e40677
11 files changed
+93
-50
No files matched your search
@@ -5,6 +5,7 @@
|
||||
#ifndef _INTERPRETER_FPUTILS_H
|
||||
#define _INTERPRETER_FPUTILS_H
|
||||
|
||||
#include "CPUDetect.h"
|
||||
#include "Interpreter.h"
|
||||
#include "MathUtil.h"
|
||||
|
||||
@@ -69,28 +70,22 @@ inline void UpdateFPSCR()
|
||||
|
||||
inline double ForceSingle(double _x)
|
||||
{
|
||||
//if (FPSCR.RN != 0)
|
||||
// PanicAlert("RN = %d at %x", (int)FPSCR.RN, PC);
|
||||
if (FPSCR.NI)
|
||||
_x = FlushToZeroAsFloat(_x);
|
||||
|
||||
double x = static_cast<float>(_x);
|
||||
|
||||
// convert to float...
|
||||
float x = _x;
|
||||
if (!cpu_info.bFlushToZero && FPSCR.NI)
|
||||
{
|
||||
x = FlushToZero(x);
|
||||
}
|
||||
// ...and back to double:
|
||||
return x;
|
||||
}
|
||||
|
||||
inline double ForceDouble(double d)
|
||||
{
|
||||
//if (FPSCR.RN != 0)
|
||||
// PanicAlert("RN = %d at %x", (int)FPSCR.RN, PC);
|
||||
|
||||
//if (FPSCR.NI)
|
||||
//{
|
||||
// IntDouble x; x.d = d;
|
||||
//if ((x.i & DOUBLE_EXP) == 0)
|
||||
// x.i &= DOUBLE_SIGN; // turn into signed zero
|
||||
// return x.d;
|
||||
//}
|
||||
if (!cpu_info.bFlushToZero && FPSCR.NI)
|
||||
{
|
||||
d = FlushToZero(d);
|
||||
}
|
||||
return d;
|
||||
}
|
||||
|
||||
|
||||
@@ -48,15 +48,8 @@ static void FPSCRtoFPUSettings(UReg_FPSCR fp)
|
||||
// Pokemon Colosseum does this. Gah.
|
||||
}
|
||||
|
||||
// Also corresponding SSE rounding mode setting
|
||||
if (FPSCR.NI)
|
||||
{
|
||||
// Either one of these two breaks Beyond Good & Evil.
|
||||
// if (cpu_info.bSSSE3)
|
||||
// csr |= DAZ;
|
||||
// csr |= FTZ;
|
||||
}
|
||||
FPURoundMode::SetSIMDMode(FPSCR.RN);
|
||||
// Set SSE rounding mode and denormal handling
|
||||
FPURoundMode::SetSIMDMode(FPSCR.RN, FPSCR.NI);
|
||||
}
|
||||
|
||||
void Interpreter::mtfsb0x(UGeckoInstruction _inst)
|
||||
|
||||
@@ -182,7 +182,7 @@ public:
|
||||
void ps_sum(UGeckoInstruction inst);
|
||||
void ps_muls(UGeckoInstruction inst);
|
||||
|
||||
void fp_arith_s(UGeckoInstruction inst);
|
||||
void fp_arith(UGeckoInstruction inst);
|
||||
void frsqrtex(UGeckoInstruction inst);
|
||||
|
||||
void fcmpx(UGeckoInstruction inst);
|
||||
|
||||
@@ -320,12 +320,12 @@ static GekkoOPTemplate table31_2[] =
|
||||
|
||||
static GekkoOPTemplate table59[] =
|
||||
{
|
||||
{18, &Jit64::Default}, //{"fdivsx", OPTYPE_FPU, FL_RC_BIT_F, 16}},
|
||||
{20, &Jit64::fp_arith_s}, //"fsubsx", OPTYPE_FPU, FL_RC_BIT_F}},
|
||||
{21, &Jit64::fp_arith_s}, //"faddsx", OPTYPE_FPU, FL_RC_BIT_F}},
|
||||
{18, &Jit64::fp_arith}, //{"fdivsx", OPTYPE_FPU, FL_RC_BIT_F, 16}},
|
||||
{20, &Jit64::fp_arith}, //"fsubsx", OPTYPE_FPU, FL_RC_BIT_F}},
|
||||
{21, &Jit64::fp_arith}, //"faddsx", OPTYPE_FPU, FL_RC_BIT_F}},
|
||||
// {22, &Jit64::Default}, //"fsqrtsx", OPTYPE_FPU, FL_RC_BIT_F}}, // Not implemented on gekko
|
||||
{24, &Jit64::Default}, //"fresx", OPTYPE_FPU, FL_RC_BIT_F}},
|
||||
{25, &Jit64::fp_arith_s}, //"fmulsx", OPTYPE_FPU, FL_RC_BIT_F}},
|
||||
{25, &Jit64::fp_arith}, //"fmulsx", OPTYPE_FPU, FL_RC_BIT_F}},
|
||||
{28, &Jit64::fmaddXX}, //"fmsubsx", OPTYPE_FPU, FL_RC_BIT_F}},
|
||||
{29, &Jit64::fmaddXX}, //"fmaddsx", OPTYPE_FPU, FL_RC_BIT_F}},
|
||||
{30, &Jit64::fmaddXX}, //"fnmsubsx", OPTYPE_FPU, FL_RC_BIT_F}},
|
||||
@@ -354,12 +354,12 @@ static GekkoOPTemplate table63[] =
|
||||
|
||||
static GekkoOPTemplate table63_2[] =
|
||||
{
|
||||
{18, &Jit64::Default}, //"fdivx", OPTYPE_FPU, FL_RC_BIT_F, 30}},
|
||||
{20, &Jit64::Default}, //"fsubx", OPTYPE_FPU, FL_RC_BIT_F}},
|
||||
{21, &Jit64::Default}, //"faddx", OPTYPE_FPU, FL_RC_BIT_F}},
|
||||
{18, &Jit64::fp_arith}, //"fdivx", OPTYPE_FPU, FL_RC_BIT_F, 30}},
|
||||
{20, &Jit64::fp_arith}, //"fsubx", OPTYPE_FPU, FL_RC_BIT_F}},
|
||||
{21, &Jit64::fp_arith}, //"faddx", OPTYPE_FPU, FL_RC_BIT_F}},
|
||||
{22, &Jit64::Default}, //"fsqrtx", OPTYPE_FPU, FL_RC_BIT_F}},
|
||||
{23, &Jit64::Default}, //"fselx", OPTYPE_FPU, FL_RC_BIT_F}},
|
||||
{25, &Jit64::fp_arith_s}, //"fmulx", OPTYPE_FPU, FL_RC_BIT_F}},
|
||||
{25, &Jit64::fp_arith}, //"fmulx", OPTYPE_FPU, FL_RC_BIT_F}},
|
||||
{26, &Jit64::frsqrtex}, //"frsqrtex", OPTYPE_FPU, FL_RC_BIT_F}},
|
||||
{28, &Jit64::fmaddXX}, //"fmsubx", OPTYPE_FPU, FL_RC_BIT_F}},
|
||||
{29, &Jit64::fmaddXX}, //"fmaddx", OPTYPE_FPU, FL_RC_BIT_F}},
|
||||
|
||||
@@ -85,7 +85,7 @@ void Jit64::fp_tri_op(int d, int a, int b, bool reversible, bool single,
|
||||
fpr.UnlockAll();
|
||||
}
|
||||
|
||||
void Jit64::fp_arith_s(UGeckoInstruction inst)
|
||||
void Jit64::fp_arith(UGeckoInstruction inst)
|
||||
{
|
||||
INSTRUCTION_START
|
||||
JITDISABLE(bJITFloatingPointOff)
|
||||
@@ -106,7 +106,7 @@ void Jit64::fp_arith_s(UGeckoInstruction inst)
|
||||
case 21: fp_tri_op(inst.FD, inst.FA, inst.FB, true, single, &XEmitter::ADDSD, &XEmitter::VADDSD); break; //add
|
||||
case 25: fp_tri_op(inst.FD, inst.FA, inst.FC, true, single, &XEmitter::MULSD, &XEmitter::VMULSD); break; //mul
|
||||
default:
|
||||
_assert_msg_(DYNA_REC, 0, "fp_arith_s WTF!!!");
|
||||
_assert_msg_(DYNA_REC, 0, "fp_arith WTF!!!");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user