diff options
| author | Sintendo <bram.speeckaert@gmail.com> | 2021-01-26 22:16:00 +0100 |
|---|---|---|
| committer | Sintendo <bram.speeckaert@gmail.com> | 2021-01-28 23:16:48 +0100 |
| commit | 34dbfd92db681bb5ec826df65260e65a79d6593d (patch) | |
| tree | b539526dc716803a1d8a4e91c65a41e298ba5fd9 /Source/Core | |
| parent | 131163d33b0f9014bc3d190f0defab1a70184b0f (diff) | |
Jit64: boolX - Special case and with 0
Bitwise and with zero is always zero.
Before:
45 8B F8 mov r15d,r8d
41 83 E7 00 and r15d,0
After:
Nothing, register a is set to constant 0.
Diffstat (limited to 'Source/Core')
| -rw-r--r-- | Source/Core/Core/PowerPC/Jit64/Jit_Integer.cpp | 42 |
1 files changed, 24 insertions, 18 deletions
diff --git a/Source/Core/Core/PowerPC/Jit64/Jit_Integer.cpp b/Source/Core/Core/PowerPC/Jit64/Jit_Integer.cpp index 5c33e3e8b6..def501d988 100644 --- a/Source/Core/Core/PowerPC/Jit64/Jit_Integer.cpp +++ b/Source/Core/Core/PowerPC/Jit64/Jit_Integer.cpp @@ -714,27 +714,33 @@ void Jit64::boolX(UGeckoInstruction inst) } else if (is_and) { - RCOpArg Rj = gpr.Use(j, RCMode::Read); - RCX64Reg Ra = gpr.Bind(a, RCMode::Write); - RegCache::Realize(Rj, Ra); - - if (complement_b) - { - if (a != j) - MOV(32, Ra, Rj); - NOT(32, Ra); - AND(32, Ra, Imm32(imm)); - } + if (imm == 0) + gpr.SetImmediate32(a, final_not ? 0xFFFFFFFF : 0); else { - if (a != j) - MOV(32, Ra, Rj); - AND(32, Ra, Imm32(imm)); - } + RCOpArg Rj = gpr.Use(j, RCMode::Read); + RCX64Reg Ra = gpr.Bind(a, RCMode::Write); + RegCache::Realize(Rj, Ra); - if (final_not) { - NOT(32, Ra); - needs_test = true; + if (complement_b) + { + if (a != j) + MOV(32, Ra, Rj); + NOT(32, Ra); + AND(32, Ra, Imm32(imm)); + } + else + { + if (a != j) + MOV(32, Ra, Rj); + AND(32, Ra, Imm32(imm)); + } + + if (final_not) + { + NOT(32, Ra); + needs_test = true; + } } } else if (is_or) |
