JitArm64: Track singles in psq_st.

This commit is contained in:
degasus 2016-02-12 11:22:44 +01:00
parent fe87462be8
commit 84395b65f6
3 changed files with 49 additions and 21 deletions

View File

@ -73,6 +73,11 @@ void JitArm64::EmitBackpatchRoutine(u32 flags, bool fastmem, bool do_farcode,
m_float_emit.REV32(8, D0, D0);
m_float_emit.STR(64, Q0, X28, addr);
}
else if (flags & BackPatchInfo::FLAG_SIZE_F32X2I)
{
m_float_emit.REV32(8, D0, RS);
m_float_emit.STR(64, Q0, X28, addr);
}
else
{
m_float_emit.REV64(8, Q0, RS);
@ -197,6 +202,13 @@ void JitArm64::EmitBackpatchRoutine(u32 flags, bool fastmem, bool do_farcode,
MOVI2R(X30, (u64)PowerPC::Write_U64);
BLR(X30);
}
else if (flags & BackPatchInfo::FLAG_SIZE_F32X2I)
{
m_float_emit.UMOV(64, X0, RS, 0);
ORR(X0, SP, X0, ArithOption(X0, ST_ROR, 32));
MOVI2R(X30, (u64)PowerPC::Write_U64);
BLR(X30);
}
else
{
MOVI2R(X30, (u64)&PowerPC::Write_U64);

View File

@ -115,8 +115,10 @@ void JitArm64::psq_st(UGeckoInstruction inst)
gpr.Lock(W0, W1, W2, W30);
fpr.Lock(Q0, Q1);
bool single = fpr.IsSingle(inst.RS);
ARM64Reg arm_addr = gpr.R(inst.RA);
ARM64Reg VS = fpr.R(inst.RS, REG_REG);
ARM64Reg VS = fpr.R(inst.RS, single ? REG_REG_SINGLE : REG_REG);
ARM64Reg scale_reg = W0;
ARM64Reg addr_reg = W1;
@ -150,7 +152,12 @@ void JitArm64::psq_st(UGeckoInstruction inst)
if (js.assumeNoPairedQuantize)
{
u32 flags = BackPatchInfo::FLAG_STORE;
flags |= (inst.W ? BackPatchInfo::FLAG_SIZE_F32 : BackPatchInfo::FLAG_SIZE_F32X2);
if (single)
flags |= (inst.W ? BackPatchInfo::FLAG_SIZE_F32I : BackPatchInfo::FLAG_SIZE_F32X2I);
else
flags |= (inst.W ? BackPatchInfo::FLAG_SIZE_F32 : BackPatchInfo::FLAG_SIZE_F32X2);
EmitBackpatchRoutine(flags,
jo.fastmem,
jo.fastmem,
@ -160,10 +167,17 @@ void JitArm64::psq_st(UGeckoInstruction inst)
}
else
{
if (inst.W)
m_float_emit.FCVT(32, 64, D0, VS);
if (single)
{
m_float_emit.ORR(D0, VS, VS);
}
else
m_float_emit.FCVTN(32, D0, VS);
{
if (inst.W)
m_float_emit.FCVT(32, 64, D0, VS);
else
m_float_emit.FCVTN(32, D0, VS);
}
LDR(INDEX_UNSIGNED, scale_reg, X29, PPCSTATE_OFF(spr[SPR_GQR0 + inst.I]));
UBFM(type_reg, scale_reg, 0, 2); // Type

View File

@ -9,22 +9,24 @@ struct BackPatchInfo
{
enum
{
FLAG_STORE = (1 << 0),
FLAG_LOAD = (1 << 1),
FLAG_SIZE_8 = (1 << 2),
FLAG_SIZE_16 = (1 << 3),
FLAG_SIZE_32 = (1 << 4),
FLAG_SIZE_F32 = (1 << 5),
FLAG_SIZE_F32X2 = (1 << 6),
FLAG_SIZE_F64 = (1 << 7),
FLAG_REVERSE = (1 << 8),
FLAG_EXTEND = (1 << 9),
FLAG_SIZE_F32I = (1 << 10),
FLAG_ZERO_256 = (1 << 11),
FLAG_MASK_FLOAT = FLAG_SIZE_F32 |
FLAG_SIZE_F32X2 |
FLAG_SIZE_F64 |
FLAG_SIZE_F32I,
FLAG_STORE = (1 << 0),
FLAG_LOAD = (1 << 1),
FLAG_SIZE_8 = (1 << 2),
FLAG_SIZE_16 = (1 << 3),
FLAG_SIZE_32 = (1 << 4),
FLAG_SIZE_F32 = (1 << 5),
FLAG_SIZE_F32X2 = (1 << 6),
FLAG_SIZE_F32X2I = (1 << 7),
FLAG_SIZE_F64 = (1 << 8),
FLAG_REVERSE = (1 << 9),
FLAG_EXTEND = (1 << 10),
FLAG_SIZE_F32I = (1 << 11),
FLAG_ZERO_256 = (1 << 12),
FLAG_MASK_FLOAT = FLAG_SIZE_F32 |
FLAG_SIZE_F32X2 |
FLAG_SIZE_F32X2I |
FLAG_SIZE_F64 |
FLAG_SIZE_F32I,
};
static u32 GetFlagSize(u32 flags)