mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-03-12 22:56:52 +01:00
Jit: Move cntlzwx to ConstantPropagation
This commit is contained in:
parent
b14c799100
commit
9949da4c58
@ -2649,14 +2649,9 @@ void Jit64::cntlzwx(UGeckoInstruction inst)
|
||||
int s = inst.RS;
|
||||
bool needs_test = false;
|
||||
|
||||
if (gpr.IsImm(s))
|
||||
{
|
||||
gpr.SetImmediate32(a, static_cast<u32>(std::countl_zero(gpr.Imm32(s))));
|
||||
}
|
||||
else
|
||||
{
|
||||
RCX64Reg Ra = gpr.Bind(a, RCMode::Write);
|
||||
RCOpArg Rs = gpr.Use(s, RCMode::Read);
|
||||
RCOpArg Rs = gpr.UseNoImm(s, RCMode::Read);
|
||||
RegCache::Realize(Ra, Rs);
|
||||
|
||||
if (cpu_info.bLZCNT)
|
||||
|
@ -523,19 +523,10 @@ void JitArm64::cntlzwx(UGeckoInstruction inst)
|
||||
int a = inst.RA;
|
||||
int s = inst.RS;
|
||||
|
||||
if (gpr.IsImm(s))
|
||||
{
|
||||
gpr.SetImmediate(a, static_cast<u32>(std::countl_zero(gpr.GetImm(s))));
|
||||
if (inst.Rc)
|
||||
ComputeRC0(gpr.GetImm(a));
|
||||
}
|
||||
else
|
||||
{
|
||||
gpr.BindToRegister(a, a == s);
|
||||
CLZ(gpr.R(a), gpr.R(s));
|
||||
if (inst.Rc)
|
||||
ComputeRC0(gpr.R(a));
|
||||
}
|
||||
gpr.BindToRegister(a, a == s);
|
||||
CLZ(gpr.R(a), gpr.R(s));
|
||||
if (inst.Rc)
|
||||
ComputeRC0(gpr.R(a));
|
||||
}
|
||||
|
||||
void JitArm64::negx(UGeckoInstruction inst)
|
||||
|
@ -3,6 +3,8 @@
|
||||
|
||||
#include "Core/PowerPC/JitCommon/ConstantPropagation.h"
|
||||
|
||||
#include <bit>
|
||||
|
||||
#include "Core/PowerPC/PPCTables.h"
|
||||
|
||||
namespace JitCommon
|
||||
@ -107,6 +109,9 @@ ConstantPropagationResult ConstantPropagation::EvaluateTable31S(UGeckoInstructio
|
||||
|
||||
switch (inst.SUBOP10)
|
||||
{
|
||||
case 26: // cntlzwx
|
||||
a = std::countl_zero(s);
|
||||
break;
|
||||
case 922: // extshx
|
||||
a = s32(s16(s));
|
||||
break;
|
||||
|
Loading…
x
Reference in New Issue
Block a user