Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JitArm64: boolX constant optimizations #11096

Merged
merged 1 commit into from Sep 28, 2022

Conversation

Sintendo
Copy link
Member

A (partial) port of #9481 to ARM64. This commit adds special cases for immediate values equal to 0 or 0xFFFFFFFF, allowing for more efficient or no code to be generated.

The 'after' examples showcase the generated code after applying both this PR and #11094.


and

Special case 0

Before:

0x52800017   mov    w23, #0x0
0x0a170319   and    w25, w24, w23

After:
Nothing, register is set to constant zero.

Special case 0xFFFFFFFF

Before:

0x1280001a   mov    w26, #-0x1
0x0a1a033a   and    w26, w25, w26

After:

0x2a1903fa   mov    w26, w25

or

Special case 0 (a != j)

Before:

0x52800004   mov    w4, #0x0
0x2a0a0084   orr    w4, w4, w10

After:

0x2a0a03e4   mov    w4, w10
Special case 0 (a == j)

Before:

0x52800017   mov    w23, #0x0
0x2a17037b   orr    w27, w27, w23

After:
Nothing.


xor

Special case 0 (a != j)

Before:

0x52800013   mov    w19, #0x0
0x4a130355   eor    w21, w26, w19

After:

0x2a1a03f5   mov    w21, w26
Special case 0 (a == j)

Before:

0x52800017   mov    w23, #0x0
0x4a17037b   eor    w27, w27, w23

After:
Nothing.

A (partial) port of dolphin-emu#9481 to ARM64. This commit adds special cases for
immediate values equal to 0 or 0xFFFFFFFF, allowing for more efficient
or no code to be generated.
@AdmiralCurtiss AdmiralCurtiss merged commit 95615ab into dolphin-emu:master Sep 28, 2022
11 checks passed
@Sintendo Sintendo deleted the arm64boolx branch October 1, 2022 16:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
3 participants