Skip to content

Combine cast => negate => compare on ARM64 #112944

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

Merged
merged 1 commit into from
Feb 28, 2025

Conversation

snickolls-arm
Copy link
Contributor

For example a == -(sbyte)b,

sxtb w0, w0
neg w0, w0
cmp w1, w0

becomes

cmn w1, w0, SXTB

Contributes towards #68028

For example `a == -(sbyte)b`,
```
sxtb w0, w0
neg w0, w0
cmp w1, w0
```
becomes
```
cmn w1, w0, SXTB
```

Contributes towards dotnet#68028
@ghost ghost added the area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI label Feb 26, 2025
Copy link
Contributor

Tagging subscribers to this area: @JulieLeeMSFT, @jakobbotsch
See info in area-owners.md if you want to be subscribed.

@snickolls-arm
Copy link
Contributor Author

@a74nh @kunalspathak

Copy link
Member

@kunalspathak kunalspathak left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Interestingly, there are no asmdiffs so seems this pattern is uncommon.

@kunalspathak kunalspathak merged commit e575397 into dotnet:main Feb 28, 2025
119 of 122 checks passed
@github-actions github-actions bot locked and limited conversation to collaborators Mar 30, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants