JitArm64: Fix LSL/LSR/ROR/ASR wrappers.
The other method has a latency of 2 cycles. This also improves the throughput a lot.
This commit is contained in:
parent
5ee7f86199
commit
d78009877b
|
@ -1542,19 +1542,22 @@ void ARM64XEmitter::MVN(ARM64Reg Rd, ARM64Reg Rm)
|
|||
}
|
||||
void ARM64XEmitter::LSL(ARM64Reg Rd, ARM64Reg Rm, int shift)
|
||||
{
|
||||
ORR(Rd, Is64Bit(Rd) ? ZR : WZR, Rm, ArithOption(Rm, ST_LSL, shift));
|
||||
int bits = Is64Bit(Rd) ? 64 : 32;
|
||||
UBFM(Rd, Rm, (bits - shift) & (bits - 1), bits - shift - 1);
|
||||
}
|
||||
void ARM64XEmitter::LSR(ARM64Reg Rd, ARM64Reg Rm, int shift)
|
||||
{
|
||||
ORR(Rd, Is64Bit(Rd) ? ZR : WZR, Rm, ArithOption(Rm, ST_LSR, shift));
|
||||
int bits = Is64Bit(Rd) ? 64 : 32;
|
||||
UBFM(Rd, Rm, shift, bits - 1);
|
||||
}
|
||||
void ARM64XEmitter::ASR(ARM64Reg Rd, ARM64Reg Rm, int shift)
|
||||
{
|
||||
ORR(Rd, Is64Bit(Rd) ? ZR : WZR, Rm, ArithOption(Rm, ST_ASR, shift));
|
||||
int bits = Is64Bit(Rd) ? 64 : 32;
|
||||
SBFM(Rd, Rm, shift, bits - 1);
|
||||
}
|
||||
void ARM64XEmitter::ROR(ARM64Reg Rd, ARM64Reg Rm, int shift)
|
||||
{
|
||||
ORR(Rd, Is64Bit(Rd) ? ZR : WZR, Rm, ArithOption(Rm, ST_ROR, shift));
|
||||
EXTR(Rd, Rm, Rm, shift);
|
||||
}
|
||||
|
||||
// Logical (immediate)
|
||||
|
|
|
@ -721,7 +721,7 @@ public:
|
|||
void MOV(ARM64Reg Rd, ARM64Reg Rm);
|
||||
void MVN(ARM64Reg Rd, ARM64Reg Rm);
|
||||
|
||||
// TODO: These are "slow" as they use arith+shift, should be replaced with UBFM/EXTR variants.
|
||||
// Convenience wrappers around UBFM/EXTR.
|
||||
void LSR(ARM64Reg Rd, ARM64Reg Rm, int shift);
|
||||
void LSL(ARM64Reg Rd, ARM64Reg Rm, int shift);
|
||||
void ASR(ARM64Reg Rd, ARM64Reg Rm, int shift);
|
||||
|
|
Loading…
Reference in New Issue