-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
[RISC-V] Fix initReg usage in genPushCalleeSavedRegisters #99353
Conversation
Tagging subscribers to this area: @JulieLeeMSFT, @jakobbotsch Issue DetailsThis PR is the result of a discussion in #99156 and #99313 Tests fixed by this PR:
After a brief discussion in #99313, we decided to mimic runtime/src/coreclr/jit/codegenarmarch.cpp Lines 4883 to 4892 in 50d6e5d
Why there was a problem in the first place?runtime/src/coreclr/jit/codegencommon.cpp Lines 5881 to 5892 in 50d6e5d
As you can see Part of #84834
|
cc @shushanhf @LuckyXu-HF IMO, LOONGARCH64 also need to fix it. |
I think the reason it didn't fail on the |
Thanks for your reminder. |
@sirntar @shushanhf Oh, I was wrong. Thanks for the comments. :) |
Thanks for your reminder. |
This PR is the result of a discussion in #99156 and #99313
Tests fixed by this PR:
JIT/jit64/hfa/main/testC/hfa_nd2C_d
JIT/jit64/hfa/main/testC/hfa_sd2C_d
After a brief discussion in #99313, we decided to mimic
arm64
approach:runtime/src/coreclr/jit/codegenarmarch.cpp
Lines 4883 to 4892 in 50d6e5d
Why there was a problem in the first place?
runtime/src/coreclr/jit/codegencommon.cpp
Lines 5881 to 5892 in 50d6e5d
As you can see
initReg
is created fromRBM_ALLINT
, whereRBM_ALLINT
isRBM_INT_CALLEE_SAVED | RBM_INT_CALLEE_TRASH
, so in fact what matters here is which register have lowerrnum
.If
T0
,T1
andT2
are excluded or reserved for some unknown reason, the next lowest register isS1
, notT3
, becauseS1
mask is0x0200
andT3
is0x10000000
.Part of #84834
cc @dotnet/samsung