-
Notifications
You must be signed in to change notification settings - Fork 12.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
Add clobber-only register classes for asm! #86416
Conversation
(rust-highfive has picked a reviewer for you, use r? to override) |
r? @nagisa |
@@ -199,6 +199,19 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> { | |||
} | |||
); | |||
|
|||
// Some register classes can only be used as clobbers. | |||
if reg_class.is_clobber_only(asm_arch.unwrap()) | |||
&& (!is_clobber || matches!(reg, asm::InlineAsmRegOrRegClass::RegClass(_))) |
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'm not following what purpose the matches!(reg, asm::InlineAsmRegOrRegClass::RegClass(_))
part is serving. Could you explain and/or add a comment?
v28: vreg = ["v28", "b28", "h28", "s28", "d28", "q28", "z28"], | ||
v29: vreg = ["v29", "b29", "h29", "s29", "d29", "q29", "z29"], | ||
v30: vreg = ["v30", "b30", "h30", "s30", "d30", "q30", "z30"], | ||
v31: vreg = ["v31", "b31", "h31", "s31", "d31", "q31", "z31"], |
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.
If I understand this correctly, the addition of z
registers is not strictly related to the clobber-only register classes, correct? While related to the p
registers, I don't believe p
registers are required to utilize the z
registers, right?
If that's the case, could this become a separate commit?
These are needed to properly express a function call ABI using a clobber list, even though we don't support passing actual values into/out of these registers.
5ede032
to
d2a1d04
Compare
@bors r+ Thanks! |
📌 Commit d2a1d04 has been approved by |
☀️ Test successful - checks-actions |
These are needed to properly express a function call ABI using a clobber
list, even though we don't support passing actual values into/out of
these registers.