diff options
| author | Sintendo <bram.speeckaert@gmail.com> | 2021-03-04 22:45:45 +0100 |
|---|---|---|
| committer | Sintendo <bram.speeckaert@gmail.com> | 2021-03-07 18:29:12 +0100 |
| commit | 83f38388a1657a9572d667ed384ee033768f836d (patch) | |
| tree | 17260d06f08eac8ff2bb049afee5b4ebf221f656 /Source/Core | |
| parent | 18650357988c54727bb9eb9f8de864b6b2e528a2 (diff) | |
Jit64: divwx - Micro-optimize default case
Both the normal path and the overflow path end with the same
instruction, so their tails can be merged.
Before:
41 8B C7 mov eax,r15d
45 85 C0 test r8d,r8d
74 0D je overflow
3D 00 00 00 80 cmp eax,80000000h
75 0E jne normal_path
41 83 F8 FF cmp r8d,0FFFFFFFFh
75 08 jne normal_path
overflow:
C1 F8 1F sar eax,1Fh
44 8B F0 mov r14d,eax
EB 07 jmp done
normal_path:
99 cdq
41 F7 F8 idiv eax,r8d
44 8B F0 mov r14d,eax
done:
After:
41 8B C7 mov eax,r15d
45 85 C0 test r8d,r8d
74 0D je overflow
3D 00 00 00 80 cmp eax,80000000h
75 0B jne normal_path
41 83 F8 FF cmp r8d,0FFFFFFFFh
75 05 jne normal_path
overflow:
C1 F8 1F sar eax,1Fh
EB 04 jmp done
normal_path:
99 cdq
41 F7 F8 idiv eax,r8d
done:
44 8B F0 mov r14d,eax
Diffstat (limited to 'Source/Core')
| -rw-r--r-- | Source/Core/Core/PowerPC/Jit64/Jit_Integer.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Source/Core/Core/PowerPC/Jit64/Jit_Integer.cpp b/Source/Core/Core/PowerPC/Jit64/Jit_Integer.cpp index 464bcb4521..1db3836dab 100644 --- a/Source/Core/Core/PowerPC/Jit64/Jit_Integer.cpp +++ b/Source/Core/Core/PowerPC/Jit64/Jit_Integer.cpp @@ -1566,7 +1566,6 @@ void Jit64::divwx(UGeckoInstruction inst) SetJumpTarget(overflow); SAR(32, eax, Imm8(31)); - MOV(32, Rd, eax); if (inst.OE) { GenerateConstantOverflow(true); @@ -1578,12 +1577,13 @@ void Jit64::divwx(UGeckoInstruction inst) CDQ(); IDIV(32, Rb); - MOV(32, Rd, eax); if (inst.OE) { GenerateConstantOverflow(false); } + SetJumpTarget(done); + MOV(32, Rd, eax); } if (inst.Rc) ComputeRC(d); |
