Skip to content
Merged
Show file tree
Hide file tree
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
9 changes: 3 additions & 6 deletions compiler/rustc_target/src/asm/powerpc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use rustc_data_structures::fx::FxIndexSet;
use rustc_span::Symbol;

use super::{InlineAsmArch, InlineAsmType, ModifierInfo};
use crate::spec::{CfgAbi, RelocModel, RustcAbi, Target};
use crate::spec::{RelocModel, RustcAbi, Target};

def_reg_class! {
PowerPC PowerPCInlineAsmRegClass {
Expand Down Expand Up @@ -107,11 +107,8 @@ fn reserved_v20to31(
_is_clobber: bool,
) -> Result<(), &'static str> {
if target.is_like_aix {
match &target.options.cfg_abi {
CfgAbi::VecDefault => Err("v20-v31 (vs52-vs63) are reserved on vec-default ABI"),
CfgAbi::VecExtAbi => Ok(()),
abi => unreachable!("unrecognized AIX ABI: {abi}"),
}
// We do not support the vec-extabi at the moment.
Err("v20-v31 (vs52-vs63) are reserved on vec-default ABI")
} else {
Ok(())
}
Expand Down
8 changes: 7 additions & 1 deletion compiler/rustc_target/src/spec/base/aix.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,13 @@ use crate::spec::{

pub(crate) fn opts() -> TargetOptions {
TargetOptions {
cfg_abi: CfgAbi::VecExtAbi,
// It makes no sense to set "vec-extabi" here without also actually configuring LLVM to use
// that ABI. Since https://github.com/llvm/llvm-project/pull/221670 this probably just needs
// `llvm_abiname` to be set properly. If you are doing that, make sure to also:
// - adjust the logic in `reserved_v20to31` in `asm/powerpc.rs` to allow the extra registers
// to be used depending on `llvm_abiname`.
// - adjust the logic in `spec/consistency.rs` to correlate `llvm_abiname` with `cfg_abi`.
cfg_abi: CfgAbi::VecDefault,
code_model: Some(CodeModel::Large),
cpu: "pwr7".into(),
os: Os::Aix,
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_target/src/spec/consistency.rs
Original file line number Diff line number Diff line change
Expand Up @@ -484,7 +484,7 @@ impl Target {
// (vec-default vs vec-ext).
check_matches!(
(&self.llvm_abiname, &self.cfg_abi),
(LlvmAbi::Unspecified, CfgAbi::VecDefault | CfgAbi::VecExtAbi),
(LlvmAbi::Unspecified, CfgAbi::VecDefault),
"invalid PowerPC64 AIX ABI name and `cfg(target_abi)` combination:\n\
ABI name: {}\n\
cfg(target_abi): {}",
Expand Down
1 change: 0 additions & 1 deletion compiler/rustc_target/src/spec/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1950,7 +1950,6 @@ crate::target_spec_enum! {
Spe = "spe",
Uwp = "uwp",
VecDefault = "vec-default",
VecExtAbi = "vec-extabi",
X32 = "x32",
V8Plus = "v8plus",
Unspecified = "",
Expand Down
Loading
Loading