Skip to content

Commit

Permalink
JitArm64: Use AArch64 imm masks in rlwimix slow case
Browse files Browse the repository at this point in the history
All valid PPC imm masks (except for all zeroes and all ones) are also
valid AArch64 imm masks. This lets us optimize things a little.

Note that because I'm now ANDing rS before rotating it, its AND mask
is rotated left. All AArch64 imm masks can be rotated by any amount and
still be valid AArch64 imm masks.
  • Loading branch information
JosJuice committed Dec 25, 2024
1 parent c528a70 commit 5080578
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions Source/Core/Core/PowerPC/JitArm64/JitArm64_Integer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2113,12 +2113,10 @@ void JitArm64::rlwimix(UGeckoInstruction inst)
gpr.BindToRegister(a, true);
ARM64Reg RA = gpr.R(a);
auto WA = gpr.GetScopedReg();
auto WB = a == s ? gpr.GetScopedReg() : Arm64GPRCache::ScopedARM64Reg(RA);

MOVI2R(WA, mask);
BIC(WB, RA, WA);
AND(WA, WA, gpr.R(s), ArithOption(gpr.R(s), ShiftType::ROR, rot_dist));
ORR(RA, WB, WA);
AND(WA, gpr.R(s), LogicalImm(std::rotl(mask, rot_dist), GPRSize::B32));
AND(RA, RA, LogicalImm(~mask, GPRSize::B32));
ORR(RA, RA, WA, ArithOption(WA, ShiftType::ROR, rot_dist));
}

if (inst.Rc)
Expand Down

0 comments on commit 5080578

Please sign in to comment.