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

[LoongArch64] Fix the arithmetic shift right in CodeGen::genSaveCalleeSavedRegistersHelp. #105676

Merged
merged 2 commits into from
Aug 1, 2024

Conversation

sunlijun-610
Copy link
Contributor

No description provided.

@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 Jul 30, 2024
@dotnet-policy-service dotnet-policy-service bot added the community-contribution Indicates that the PR has been added by a community member label Jul 30, 2024
Copy link
Contributor

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

@sunlijun-610
Copy link
Contributor Author

@shushanhf Could you please review this change?
Thanks!

@huoyaoyuan
Copy link
Member

Is this also applicable to other archs?

int64_t maskSaveRegs = (int64_t)regsMask.getLow() >> FIRST_INT_CALLEE_SAVED;

@sunlijun-610
Copy link
Contributor Author

Is this also applicable to other archs?

For loongarch64, callee saved float registers are F24-F31.
But for riscv64, callee saved float registers are F8, F9, F18-F27, so maskSaveRegs here cannot be a negative number. So I didn't apply to riscv64.

Copy link
Contributor

@shushanhf shushanhf left a comment

Choose a reason for hiding this comment

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

LGTM
Thanks

@huoyaoyuan
Copy link
Member

But for riscv64, callee saved float registers are F8, F9, F18-F27, so maskSaveRegs here cannot be a negative number. So I didn't apply to riscv64.

It doesn't have real impact here, but using unsigned right shift will make the code more correct for all archs.

@sunlijun-610
Copy link
Contributor Author

It doesn't have real impact here, but using unsigned right shift will make the code more correct for all archs.

OK, thanks! I've applied it to riscv64 too.
Thanks a lot!

@sunlijun-610
Copy link
Contributor Author

@jakobbotsch Could you please review this PR?
Thanks a lot!

@jakobbotsch jakobbotsch merged commit 74460dd into dotnet:main Aug 1, 2024
101 of 108 checks passed
@github-actions github-actions bot locked and limited conversation to collaborators Sep 1, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
arch-loongarch64 area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI community-contribution Indicates that the PR has been added by a community member
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants