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

[JIT] ARM64 - Optimize x < 0 and x >= 0 #83176

Merged
merged 20 commits into from
Mar 16, 2023
Merged

[JIT] ARM64 - Optimize x < 0 and x >= 0 #83176

merged 20 commits into from
Mar 16, 2023

Conversation

TIHan
Copy link
Contributor

@TIHan TIHan commented Mar 9, 2023

Description

#43440

As for handling GT_GE, I do not think it is worth doing the optimization in the non-conditional case. It would require neg and a lsr which I believe would be slower than just the cmp and cset. According to A78, the pair of cmp and cset instructions are accelerated through instruction fusion - so it's probably only worth replacing them if we can do it in just one instruction.

Acceptance Criteria

@ghost ghost assigned TIHan Mar 9, 2023
@dotnet-issue-labeler dotnet-issue-labeler bot added the area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI label Mar 9, 2023
@ghost
Copy link

ghost commented Mar 9, 2023

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

Issue Details

Addresses the first case of #43440

As for handling GT_GE, I do not think it is worth it. It would require neg and a lsr which I believe would be slower than just the cmp and cset. According to A78, the pair of cmp and cset instructions are accelerated through instruction fusion - so it's probably only worth replacing them if we can do it in just one.

Author: TIHan
Assignees: TIHan
Labels:

area-CodeGen-coreclr

Milestone: -

@TIHan TIHan changed the title [JIT] ARM64 - Optimize 'x < 0' [JIT] ARM64 - Optimize x < 0 and x >= 0 Mar 10, 2023
TIHan and others added 2 commits March 14, 2023 05:15
Co-authored-by: Jakob Botsch Nielsen <Jakob.botsch.nielsen@gmail.com>
Copy link
Member

@jakobbotsch jakobbotsch left a comment

Choose a reason for hiding this comment

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

LGTM with one fix

@TIHan
Copy link
Contributor Author

TIHan commented Mar 16, 2023

I'm going to do another round for this optimization, filed #83562 to track it.

Therefore, I will go ahead and merge this one.

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.

3 participants