diff options
| author | Sintendo <bram.speeckaert@gmail.com> | 2021-03-04 22:16:52 +0100 |
|---|---|---|
| committer | Sintendo <bram.speeckaert@gmail.com> | 2021-03-07 18:29:12 +0100 |
| commit | 0637a7ec597d6b96ac9b6274f390bf2ee22807fd (patch) | |
| tree | e7be1230a32d3278144d135ba79eae3c2edff65a /Source/Core/InputCommon/ControllerInterface/ControllerInterface.cpp | |
| parent | 530475dce8d3c4e94e0737be0dc48757a78bc475 (diff) | |
Jit64: divwx - Optimize power-of-two divisors
Power-of-two divisors can be done more elegantly, so handle them
separately.
- Division by 4
Before:
41 BD 04 00 00 00 mov r13d,4
41 8B C0 mov eax,r8d
45 85 ED test r13d,r13d
74 0D je overflow
3D 00 00 00 80 cmp eax,80000000h
75 0E jne normal_path
41 83 FD FF cmp r13d,0FFFFFFFFh
75 08 jne normal_path
overflow:
C1 F8 1F sar eax,1Fh
44 8B E8 mov r13d,eax
EB 07 jmp done
normal_path:
99 cdq
41 F7 FD idiv eax,r13d
44 8B E8 mov r13d,eax
done:
After:
45 85 C0 test r8d,r8d
45 8D 68 03 lea r13d,[r8+3]
45 0F 49 E8 cmovns r13d,r8d
41 C1 FD 02 sar r13d,2
Diffstat (limited to 'Source/Core/InputCommon/ControllerInterface/ControllerInterface.cpp')
0 files changed, 0 insertions, 0 deletions
