mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2024-11-14 21:37:52 -07:00
2580837c60
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 |
||
---|---|---|
.. | ||
AudioCommon | ||
Common | ||
Core | ||
DiscIO | ||
DolphinNoGUI | ||
DolphinQt | ||
DolphinTool | ||
InputCommon | ||
MacUpdater | ||
UICommon | ||
UpdaterCommon | ||
VideoBackends | ||
VideoCommon | ||
WinUpdater | ||
CMakeLists.txt | ||
DolphinLib.ARM64.props | ||
DolphinLib.props | ||
DolphinLib.vcxproj | ||
DolphinLib.vcxproj.user | ||
DolphinLib.x64.props |