diff options
| author | Bram Speeckaert <bram.speeckaert@guardsquare.com> | 2024-03-23 13:08:35 +0100 |
|---|---|---|
| committer | Bram Speeckaert <bram.speeckaert@guardsquare.com> | 2024-03-23 20:13:15 +0100 |
| commit | 2580837c60b991ae34e7f7ae4b562e382857c4de (patch) | |
| tree | 520ff3c272aeb8f75ad92f67fc21eec8972ea90c /Source/Core/VideoCommon/TextureCacheBase.cpp | |
| parent | 749ee2ff5e0d80ea260160403c1a2d33491d1100 (diff) | |
JitArm64: Optimize divwux
When the divisor is a constant value, we can emit more efficient code.
For powers of two, we can use bit shifts. For other values, we can
instead use a multiplication by magic constant method.
- Example 1 - Division by 16 (power of two)
Before:
mov w24, #0x10 ; =16
udiv w27, w25, w24
After:
lsr w27, w25, #4
- Example 2 - Division by 10 (fast)
Before:
mov w25, #0xa ; =10
udiv w27, w26, w25
After:
mov w27, #0xcccd ; =52429
movk w27, #0xcccc, lsl #16
umull x27, w26, w27
lsr x27, x27, #35
- Example 3 - Division by 127 (slow)
Before:
mov w26, #0x7f ; =127
udiv w27, w27, w26
After:
mov w26, #0x408 ; =1032
movk w26, #0x8102, lsl #16
umaddl x27, w27, w26, x26
lsr x27, x27, #38
Diffstat (limited to 'Source/Core/VideoCommon/TextureCacheBase.cpp')
0 files changed, 0 insertions, 0 deletions
