mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-04-23 21:14:56 +00:00
JitArm64: Add special zero case to ADDI2R
This normally doesn't reduce the instruction count, but is nonetheless useful on CPUs that can do 0-cycle moves.
This commit is contained in:
parent
25ffb0dbfc
commit
67791d227c
1 changed files with 11 additions and 1 deletions
|
@ -4125,6 +4125,8 @@ void ARM64XEmitter::AddImmediate(ARM64Reg Rd, ARM64Reg Rn, u64 imm, bool shift,
|
||||||
void ARM64XEmitter::ADDI2R_internal(ARM64Reg Rd, ARM64Reg Rn, u64 imm, bool negative, bool flags,
|
void ARM64XEmitter::ADDI2R_internal(ARM64Reg Rd, ARM64Reg Rn, u64 imm, bool negative, bool flags,
|
||||||
ARM64Reg scratch)
|
ARM64Reg scratch)
|
||||||
{
|
{
|
||||||
|
DEBUG_ASSERT(Is64Bit(Rd) == Is64Bit(Rn));
|
||||||
|
|
||||||
if (!Is64Bit(Rd))
|
if (!Is64Bit(Rd))
|
||||||
imm &= 0xFFFFFFFFULL;
|
imm &= 0xFFFFFFFFULL;
|
||||||
|
|
||||||
|
@ -4132,7 +4134,15 @@ void ARM64XEmitter::ADDI2R_internal(ARM64Reg Rd, ARM64Reg Rn, u64 imm, bool nega
|
||||||
u64 imm_neg = Is64Bit(Rd) ? u64(-s64(imm)) : u64(-s64(imm)) & 0xFFFFFFFFuLL;
|
u64 imm_neg = Is64Bit(Rd) ? u64(-s64(imm)) : u64(-s64(imm)) & 0xFFFFFFFFuLL;
|
||||||
bool neg_neg = negative ? false : true;
|
bool neg_neg = negative ? false : true;
|
||||||
|
|
||||||
// Fast paths, aarch64 immediate instructions
|
// Special path for zeroes
|
||||||
|
if (imm == 0 && !flags)
|
||||||
|
{
|
||||||
|
if (Rd != Rn)
|
||||||
|
MOV(Rd, Rn);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Regular fast paths, aarch64 immediate instructions
|
||||||
// Try them all first
|
// Try them all first
|
||||||
if (imm <= 0xFFF)
|
if (imm <= 0xFFF)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Reference in a new issue