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

Add support for ppc64le clobber_abi #124279

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 15 additions & 1 deletion compiler/rustc_target/src/asm/mod.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use crate::spec::Target;
use crate::{abi::Size, spec::RelocModel};
use crate::{abi::Endian, abi::Size, spec::RelocModel};
use rustc_data_structures::fx::{FxHashMap, FxIndexSet};
use rustc_macros::HashStable_Generic;
use rustc_span::Symbol;
Expand Down Expand Up @@ -878,6 +878,7 @@ pub enum InlineAsmClobberAbi {
AArch64NoX18,
RiscV,
LoongArch,
PowerPC64ElfV2,
}

impl InlineAsmClobberAbi {
Expand Down Expand Up @@ -927,6 +928,12 @@ impl InlineAsmClobberAbi {
"C" | "system" => Ok(InlineAsmClobberAbi::LoongArch),
_ => Err(&["C", "system"]),
},
InlineAsmArch::PowerPC64 => match name {
"C" | "system" if target.endian == Endian::Little => {
Copy link
Contributor

Choose a reason for hiding this comment

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

The list as-is would be fine for both endiannesses.

Ok(InlineAsmClobberAbi::PowerPC64ElfV2)
}
_ => Err(&["C", "system"]),
},
_ => Err(&[]),
}
}
Expand Down Expand Up @@ -1084,6 +1091,13 @@ impl InlineAsmClobberAbi {
f16, f17, f18, f19, f20, f21, f22, f23,
}
},
InlineAsmClobberAbi::PowerPC64ElfV2 => clobbered_regs! {
PowerPC PowerPCInlineAsmReg {
r0, r3, r4, r5, r6, r7, r8, r9, r10, r11, r12,
xer, cr0, cr1, cr5, cr6, cr7,
f0, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, f13,
}
Copy link
Contributor

Choose a reason for hiding this comment

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

What about the vector registers?

},
}
}
}
Loading