-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
Handle more than 64 registers - Part 5 #103188
Conversation
Tagging subscribers to this area: @JulieLeeMSFT, @jakobbotsch |
@dotnet/jit-contrib @jakobbotsch PTAL |
@@ -9851,7 +9851,8 @@ class Compiler | |||
// On these platforms we assume the register that the target is | |||
// passed in is preserved by the validator and take care to get the | |||
// target from the register for the call (even in debug mode). | |||
static_assert_no_msg((RBM_VALIDATE_INDIRECT_CALL_TRASH & (1 << REG_VALIDATE_INDIRECT_CALL_ADDR)) == 0); | |||
static_assert_no_msg((RBM_VALIDATE_INDIRECT_CALL_TRASH & regMaskTP(1 << REG_VALIDATE_INDIRECT_CALL_ADDR)) == |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can make IsRegNumInMask
constexpr
to make this a bit more natural (feel free to do as part of a follow-up).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tried doing that, but as a cascade effect I need to make genSingleTypeRegSet
, getRegForType()
, etc. as constexpr
which I am not sure is worth doing for just an assert. Will pass this on for now.
hasPC = (imm & SRBM_PC) != 0; | ||
hasLR = (imm & SRBM_LR) != 0; | ||
imm &= ~(SRBM_PC | SRBM_LR); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess this means there is (and was) an invariant on the exact indices defined for these registers?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
probably.
static constexpr regMaskTP CreateFromRegNum(regNumber reg, regMaskSmall mask) | ||
{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is mask
needed as a parameter? Can't we compute it here as 1 << reg
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
predicate registers starts from 64 thru 80 and the mask of them start with 0x0
. I can make it work, but just want to rely on the mask
that we already have in register files and how we use them currently.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For predicate registers it would just be (1 << (reg - 64))
under the if, I suppose.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, I don't have much preference on which way or the other, but will keep this in mind during follow up.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice, this looks great to me. Most changes look mechanical.
/rerun |
@dotnet-policy-service rerun |
1 similar comment
@dotnet-policy-service rerun |
RBM_REG*
toregMaskTP
SRBM_REG*
that can be used at places where we just needSingleTypeRegSet
regMaskTP
for registers at killRefPosition