Skip to content
Closed
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
Expand Up @@ -5,7 +5,7 @@ use rustc_data_structures::fx::{FxHashMap, FxIndexSet};
use rustc_macros::{Decodable, Encodable, HashStable_Generic};
use rustc_span::Symbol;

use crate::abi::Size;
use crate::abi::{Endian, Size};
use crate::spec::{RelocModel, Target};

pub struct ModifierInfo {
Expand Down Expand Up @@ -893,6 +893,7 @@ pub enum InlineAsmClobberAbi {
RiscV,
LoongArch,
S390x,
PowerPC64ElfV2,
}

impl InlineAsmClobberAbi {
Expand Down Expand Up @@ -946,6 +947,12 @@ impl InlineAsmClobberAbi {
"C" | "system" => Ok(InlineAsmClobberAbi::S390x),
_ => 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 @@ -1125,6 +1132,13 @@ impl InlineAsmClobberAbi {
a8, a9, a10, a11, a12, a13, a14, a15,
}
},
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