Fix clobber_abi in RV32E and RV64E inline assembly

This commit is contained in:
Taiki Endo
2024-11-25 00:36:22 +09:00
parent ab3cf268b5
commit 736c397f41
5 changed files with 95 additions and 6 deletions

View File

@@ -54,6 +54,10 @@ impl RiscVInlineAsmRegClass {
}
}
pub(crate) fn is_e(target_features: &FxIndexSet<Symbol>) -> bool {
target_features.contains(&sym::e)
}
fn not_e(
_arch: InlineAsmArch,
_reloc_model: RelocModel,
@@ -61,7 +65,7 @@ fn not_e(
_target: &Target,
_is_clobber: bool,
) -> Result<(), &'static str> {
if target_features.contains(&sym::e) {
if is_e(target_features) {
Err("register can't be used with the `e` target feature")
} else {
Ok(())