diff options
| author | Sintendo <3380580+Sintendo@users.noreply.github.com> | 2026-10-22 21:22:28 +0200 |
|---|---|---|
| committer | Sintendo <3380580+Sintendo@users.noreply.github.com> | 2026-10-22 21:22:34 +0200 |
| commit | c54807302bd83fb1ac75523cf601c82474a309ba (patch) | |
| tree | d4a5c92d023b124b7c065b84fd2b72f71891bdbf /Source/Core/InputCommon/ControllerInterface/DualShockUDPClient | |
| parent | 2c805fee8f232d090c454381bb1b8422242345e1 (diff) | |
JitArm64_SystemRegister: mfspr - Sign extension nit
This instruction effectively performs the following computation:
```
Xresult = SXTW(slice_length) - Xresult + global_timer;
```
ARM64 has a dedicated sign extension instruction, but also allows this
sign extension to happen as part of many arithmetic operations. By
reordering the computation, we can take advantage of this:
```
Xresult = global_timer + SXTW(slice_length) - Xresult;
```
Before:
```
ldr w24, [x29, #0x2f0]
scvtf s8, w24
ldr s9, [x27, #0x20]
fmul s8, s8, s9
fcvtzs x25, s8
ldp x24, x23, [x27]
sxtw x23, w23
sub x25, x23, x25
add x25, x25, x24
ldp x24, x23, [x27, #0x10]
sub x25, x25, x23
mov x23, #-0x5555555555555556 ; =-6148914691236517206
add x23, x23, #0x1
umulh x25, x25, x23
add x25, x24, x25, lsr #3
str x25, [x29, #0x770]
```
After:
```
ldr w24, [x29, #0x2f0]
scvtf s8, w24
ldr s9, [x27, #0x20]
fmul s8, s8, s9
fcvtzs x25, s8
ldp x24, x23, [x27]
add x24, x24, w23, sxtw
sub x25, x24, x25
ldp x24, x23, [x27, #0x10]
sub x25, x25, x23
mov x23, #-0x5555555555555556 ; =-6148914691236517206
add x23, x23, #0x1
umulh x25, x25, x23
add x25, x24, x25, lsr #3
str x25, [x29, #0x770]
```
Diffstat (limited to 'Source/Core/InputCommon/ControllerInterface/DualShockUDPClient')
0 files changed, 0 insertions, 0 deletions
