A few small JitIL changes that I've had sitting in my tree for a while;
nothing really significant to note. git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@2106 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
parent
48a3c6eeb4
commit
a883726233
|
@ -585,6 +585,18 @@ InstLoc IRBuilder::FoldInterpreterFallback(InstLoc Op1, InstLoc Op2) {
|
||||||
return EmitBiOp(InterpreterFallback, Op1, Op2);
|
return EmitBiOp(InterpreterFallback, Op1, Op2);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
InstLoc IRBuilder::FoldDoubleBiOp(unsigned Opcode, InstLoc Op1, InstLoc Op2) {
|
||||||
|
if (getOpcode(*Op1) == InsertDoubleInMReg) {
|
||||||
|
return FoldDoubleBiOp(Opcode, getOp1(Op1), Op2);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (getOpcode(*Op2) == InsertDoubleInMReg) {
|
||||||
|
return FoldDoubleBiOp(Opcode, Op1, getOp1(Op2));
|
||||||
|
}
|
||||||
|
|
||||||
|
return EmitBiOp(Opcode, Op1, Op2);
|
||||||
|
}
|
||||||
|
|
||||||
InstLoc IRBuilder::FoldBiOp(unsigned Opcode, InstLoc Op1, InstLoc Op2, unsigned extra) {
|
InstLoc IRBuilder::FoldBiOp(unsigned Opcode, InstLoc Op1, InstLoc Op2, unsigned extra) {
|
||||||
switch (Opcode) {
|
switch (Opcode) {
|
||||||
case Add: return FoldAdd(Op1, Op2);
|
case Add: return FoldAdd(Op1, Op2);
|
||||||
|
@ -601,6 +613,7 @@ InstLoc IRBuilder::FoldBiOp(unsigned Opcode, InstLoc Op1, InstLoc Op2, unsigned
|
||||||
case ICmpSgt: case ICmpSlt: case ICmpSge: case ICmpSle:
|
case ICmpSgt: case ICmpSlt: case ICmpSge: case ICmpSle:
|
||||||
return FoldICmp(Opcode, Op1, Op2);
|
return FoldICmp(Opcode, Op1, Op2);
|
||||||
case InterpreterFallback: return FoldInterpreterFallback(Op1, Op2);
|
case InterpreterFallback: return FoldInterpreterFallback(Op1, Op2);
|
||||||
|
case FDMul: case FDAdd: case FDSub: return FoldDoubleBiOp(Opcode, Op1, Op2);
|
||||||
default: return EmitBiOp(Opcode, Op1, Op2, extra);
|
default: return EmitBiOp(Opcode, Op1, Op2, extra);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -88,7 +88,6 @@ namespace IREmitter {
|
||||||
Store16,
|
Store16,
|
||||||
Store32,
|
Store32,
|
||||||
BranchCond,
|
BranchCond,
|
||||||
#if 0
|
|
||||||
// Floating-point
|
// Floating-point
|
||||||
// There are three floating-point formats: single, double,
|
// There are three floating-point formats: single, double,
|
||||||
// and packed. For any operation where the format of the
|
// and packed. For any operation where the format of the
|
||||||
|
@ -98,59 +97,15 @@ namespace IREmitter {
|
||||||
// The "mreg" format is a pair of doubles; this is the
|
// The "mreg" format is a pair of doubles; this is the
|
||||||
// most general possible represenation which is used
|
// most general possible represenation which is used
|
||||||
// in the register state.
|
// in the register state.
|
||||||
// This might seem like overkill, but it's a huge advantage
|
// This might seem like overkill, but the semantics require
|
||||||
// to keep operands in the right format because extra
|
// having the different formats.
|
||||||
// precision can screw up games.
|
// FIXME: Check the accuracy of the mapping:
|
||||||
// FIXME: Does the slight loss of precision due to not
|
// 1. Is paired arithmetic always rounded to single-precision
|
||||||
// having a madd instruction matter? It would be a
|
// first, or does it do double-to-single like the
|
||||||
// performance loss for singles because the operations
|
// single-precision instructions?
|
||||||
// would have to be done in double precision, and a completely
|
// 2. The implementation of madd is slightly off, and
|
||||||
// accurate double madd would require an extremely expensive
|
// the implementation of fmuls is very slightly off;
|
||||||
// fallback.
|
// likely nothing cares, though.
|
||||||
FDAdd,
|
|
||||||
FDSub,
|
|
||||||
FDMul,
|
|
||||||
FDDiv,
|
|
||||||
FDNeg,
|
|
||||||
FSAdd,
|
|
||||||
FSSub,
|
|
||||||
FSMul,
|
|
||||||
FSDiv,
|
|
||||||
FSNeg,
|
|
||||||
FPSAdd,
|
|
||||||
FPSSub,
|
|
||||||
FPSMul,
|
|
||||||
FPSDiv,
|
|
||||||
FPSNeg,
|
|
||||||
// FP Loads
|
|
||||||
LoadSingle,
|
|
||||||
LoadDouble,
|
|
||||||
// LoadPacked, // FIXME: Work out how this instruction should
|
|
||||||
// be implemented
|
|
||||||
// FP Stores
|
|
||||||
StoreSingle,
|
|
||||||
StoreDouble,
|
|
||||||
// StorePacked, // FIXME: Work out how this instruction should
|
|
||||||
// be implemented
|
|
||||||
PackedToSingle, // Extract PS0 from packed (type-pun)
|
|
||||||
// PackedToDouble == PackedToSingle+SingleToDouble
|
|
||||||
PackedToMReg, // Convert from packed format to mreg format (CVTPS2PD)
|
|
||||||
SingleToDouble, // Widen single to double (CVTSS2SD)
|
|
||||||
SingleToPacked, // Duplicate single to packed
|
|
||||||
// SingleToMReg == SingleToPacked+PackedToMReg
|
|
||||||
MRegToPacked, // Convert from mreg format to packed format (CVTPD2PS)
|
|
||||||
MRegToDouble, // Extract bottom half from mreg format. (type-pun)
|
|
||||||
// MRegToSingle == MRegToDouble + DoubleToSingle
|
|
||||||
DoubleToMReg, // Convert from double format to mreg format
|
|
||||||
DoubleToSingle, // Convert from double to single format (CVTSD2SS)
|
|
||||||
// DoubleToPacked should never be needed
|
|
||||||
|
|
||||||
ForceToPacked, // ForceTo* are "virtual"; they should be
|
|
||||||
// folded into the above conversions.
|
|
||||||
ForceToSingle,
|
|
||||||
ForceToDouble,
|
|
||||||
ForceToMReg,
|
|
||||||
#endif
|
|
||||||
FResult_Start,
|
FResult_Start,
|
||||||
LoadSingle,
|
LoadSingle,
|
||||||
LoadDouble,
|
LoadDouble,
|
||||||
|
@ -263,6 +218,7 @@ namespace IREmitter {
|
||||||
InstLoc FoldXor(InstLoc Op1, InstLoc Op2);
|
InstLoc FoldXor(InstLoc Op1, InstLoc Op2);
|
||||||
InstLoc FoldBranchCond(InstLoc Op1, InstLoc Op2);
|
InstLoc FoldBranchCond(InstLoc Op1, InstLoc Op2);
|
||||||
InstLoc FoldICmp(unsigned Opcode, InstLoc Op1, InstLoc Op2);
|
InstLoc FoldICmp(unsigned Opcode, InstLoc Op1, InstLoc Op2);
|
||||||
|
InstLoc FoldDoubleBiOp(unsigned Opcode, InstLoc Op1, InstLoc Op2);
|
||||||
|
|
||||||
InstLoc FoldInterpreterFallback(InstLoc Op1, InstLoc Op2);
|
InstLoc FoldInterpreterFallback(InstLoc Op1, InstLoc Op2);
|
||||||
|
|
||||||
|
|
|
@ -178,7 +178,7 @@ namespace CPUCompare
|
||||||
CODE_SIZE = 1024*1024*8*8;
|
CODE_SIZE = 1024*1024*8*8;
|
||||||
|
|
||||||
jo.optimizeStack = true;
|
jo.optimizeStack = true;
|
||||||
jo.enableBlocklink = true; // Speed boost, but not 100% safe
|
jo.enableBlocklink = false; // Speed boost, but not 100% safe
|
||||||
#ifdef _M_X64
|
#ifdef _M_X64
|
||||||
jo.enableFastMem = Core::GetStartupParameter().bUseFastMem;
|
jo.enableFastMem = Core::GetStartupParameter().bUseFastMem;
|
||||||
#else
|
#else
|
||||||
|
@ -200,6 +200,13 @@ namespace CPUCompare
|
||||||
asm_routines.Init();
|
asm_routines.Init();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Jit64::ClearCache()
|
||||||
|
{
|
||||||
|
blocks.Clear();
|
||||||
|
trampolines.ClearCodeSpace();
|
||||||
|
ClearCodeSpace();
|
||||||
|
}
|
||||||
|
|
||||||
void Jit64::Shutdown()
|
void Jit64::Shutdown()
|
||||||
{
|
{
|
||||||
FreeCodeSpace();
|
FreeCodeSpace();
|
||||||
|
|
|
@ -146,11 +146,7 @@ public:
|
||||||
|
|
||||||
void NotifyBreakpoint(u32 em_address, bool set);
|
void NotifyBreakpoint(u32 em_address, bool set);
|
||||||
|
|
||||||
void ClearCache()
|
void ClearCache();
|
||||||
{
|
|
||||||
blocks.Clear();
|
|
||||||
trampolines.ClearCodeSpace();
|
|
||||||
}
|
|
||||||
|
|
||||||
// Run!
|
// Run!
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue