Arm64Emitter: Remove optimize parameter from MOVI2R

I don't really see the use of this. (Maybe in the past it
was used for when we need a constant number of instructions
for backpatching? But we don't use MOVI2R for that now.)
This commit is contained in:
JosJuice 2021-01-01 19:39:24 +01:00
parent a2fa89b15e
commit d226b8f825
3 changed files with 7 additions and 10 deletions

View File

@ -2004,7 +2004,7 @@ void ARM64XEmitter::ADRP(ARM64Reg Rd, s32 imm)
}
// Wrapper around MOVZ+MOVK (and later MOVN)
void ARM64XEmitter::MOVI2R(ARM64Reg Rd, u64 imm, bool optimize)
void ARM64XEmitter::MOVI2R(ARM64Reg Rd, u64 imm)
{
unsigned int parts = Is64Bit(Rd) ? 4 : 2;
BitSet32 upload_part(0);
@ -2041,13 +2041,10 @@ void ARM64XEmitter::MOVI2R(ARM64Reg Rd, u64 imm, bool optimize)
// XXX: Use MOVN when possible.
// XXX: Optimize more
// XXX: Support rotating immediates to save instructions
if (optimize)
for (unsigned int i = 0; i < parts; ++i)
{
for (unsigned int i = 0; i < parts; ++i)
{
if ((imm >> (i * 16)) & 0xFFFF)
upload_part[i] = 1;
}
if ((imm >> (i * 16)) & 0xFFFF)
upload_part[i] = 1;
}
u64 aligned_pc = (u64)GetCodePtr() & ~0xFFF;
@ -2090,7 +2087,7 @@ void ARM64XEmitter::MOVI2R(ARM64Reg Rd, u64 imm, bool optimize)
}
else
{
if (upload_part[i] || !optimize)
if (upload_part[i])
MOVK(Rd, (imm >> (i * 16)) & 0xFFFF, (ShiftAmount)i);
}
}

View File

@ -865,7 +865,7 @@ public:
void ADRP(ARM64Reg Rd, s32 imm);
// Wrapper around MOVZ+MOVK
void MOVI2R(ARM64Reg Rd, u64 imm, bool optimize = true);
void MOVI2R(ARM64Reg Rd, u64 imm);
bool MOVI2R2(ARM64Reg Rd, u64 imm1, u64 imm2);
template <class P>
void MOVP2R(ARM64Reg Rd, P* ptr)

View File

@ -912,7 +912,7 @@ void JitArm64::subfex(UGeckoInstruction inst)
ARM64Reg WA = gpr.GetReg();
if (js.carryFlagSet)
{
MOVI2R(WA, ~i + j, gpr.R(d));
MOVI2R(WA, ~i + j);
ADC(gpr.R(d), WA, WZR);
}
else