Skip to content

Commit f692ded

Browse files
committed
Add support for ppc64le clobber_abi
1 parent 3ae715c commit f692ded

File tree

1 file changed

+15
-1
lines changed
  • compiler/rustc_target/src/asm

1 file changed

+15
-1
lines changed

compiler/rustc_target/src/asm/mod.rs

+15-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ use rustc_data_structures::fx::{FxHashMap, FxIndexSet};
55
use rustc_macros::{Decodable, Encodable, HashStable_Generic};
66
use rustc_span::Symbol;
77

8-
use crate::abi::Size;
8+
use crate::abi::{Endian, Size};
99
use crate::spec::{RelocModel, Target};
1010

1111
pub struct ModifierInfo {
@@ -893,6 +893,7 @@ pub enum InlineAsmClobberAbi {
893893
RiscV,
894894
LoongArch,
895895
S390x,
896+
PowerPC64ElfV2,
896897
}
897898

898899
impl InlineAsmClobberAbi {
@@ -946,6 +947,12 @@ impl InlineAsmClobberAbi {
946947
"C" | "system" => Ok(InlineAsmClobberAbi::S390x),
947948
_ => Err(&["C", "system"]),
948949
},
950+
InlineAsmArch::PowerPC64 => match name {
951+
"C" | "system" if target.endian == Endian::Little => {
952+
Ok(InlineAsmClobberAbi::PowerPC64ElfV2)
953+
}
954+
_ => Err(&["C", "system"]),
955+
},
949956
_ => Err(&[]),
950957
}
951958
}
@@ -1125,6 +1132,13 @@ impl InlineAsmClobberAbi {
11251132
a8, a9, a10, a11, a12, a13, a14, a15,
11261133
}
11271134
},
1135+
InlineAsmClobberAbi::PowerPC64ElfV2 => clobbered_regs! {
1136+
PowerPC PowerPCInlineAsmReg {
1137+
r0, r3, r4, r5, r6, r7, r8, r9, r10, r11, r12,
1138+
xer, cr0, cr1, cr5, cr6, cr7,
1139+
f0, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, f13,
1140+
}
1141+
},
11281142
}
11291143
}
11301144
}

0 commit comments

Comments
 (0)