Skip to content
This repository was archived by the owner on May 28, 2025. It is now read-only.

Commit d372714

Browse files
committed
support for mips32r6 as a target_arch value
1 parent a132b3e commit d372714

File tree

16 files changed

+29
-14
lines changed

16 files changed

+29
-14
lines changed

compiler/rustc_codegen_gcc/example/alloc_system.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
#[cfg(any(target_arch = "x86",
1111
target_arch = "arm",
1212
target_arch = "mips",
13+
target_arch = "mips32r6",
1314
target_arch = "powerpc",
1415
target_arch = "powerpc64"))]
1516
const MIN_ALIGN: usize = 8;

compiler/rustc_codegen_ssa/src/back/metadata.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ pub(crate) fn create_object_file(sess: &Session) -> Option<write::Object<'static
193193
}
194194
"x86" => Architecture::I386,
195195
"s390x" => Architecture::S390x,
196-
"mips" => Architecture::Mips,
196+
"mips" | "mips32r6" => Architecture::Mips,
197197
"mips64" | "mips64r6" => Architecture::Mips64,
198198
"x86_64" => {
199199
if sess.target.pointer_width == 32 {

compiler/rustc_codegen_ssa/src/target_features.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -321,7 +321,7 @@ pub fn supported_target_features(sess: &Session) -> &'static [(&'static str, Opt
321321
"aarch64" => AARCH64_ALLOWED_FEATURES,
322322
"x86" | "x86_64" => X86_ALLOWED_FEATURES,
323323
"hexagon" => HEXAGON_ALLOWED_FEATURES,
324-
"mips" | "mips64" | "mips64r6" => MIPS_ALLOWED_FEATURES,
324+
"mips" | "mips32r6" | "mips64" | "mips64r6" => MIPS_ALLOWED_FEATURES,
325325
"powerpc" | "powerpc64" => POWERPC_ALLOWED_FEATURES,
326326
"riscv32" | "riscv64" => RISCV_ALLOWED_FEATURES,
327327
"wasm32" | "wasm64" => WASM_ALLOWED_FEATURES,

compiler/rustc_target/src/abi/call/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -693,7 +693,7 @@ impl<'a, Ty> FnAbi<'a, Ty> {
693693
"avr" => avr::compute_abi_info(self),
694694
"loongarch64" => loongarch::compute_abi_info(cx, self),
695695
"m68k" => m68k::compute_abi_info(self),
696-
"mips" => mips::compute_abi_info(cx, self),
696+
"mips" | "mips32r6" => mips::compute_abi_info(cx, self),
697697
"mips64" | "mips64r6" => mips64::compute_abi_info(cx, self),
698698
"powerpc" => powerpc::compute_abi_info(self),
699699
"powerpc64" => powerpc64::compute_abi_info(cx, self),

compiler/rustc_target/src/asm/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,7 @@ impl FromStr for InlineAsmArch {
238238
"powerpc64" => Ok(Self::PowerPC64),
239239
"hexagon" => Ok(Self::Hexagon),
240240
"loongarch64" => Ok(Self::LoongArch64),
241-
"mips" => Ok(Self::Mips),
241+
"mips" | "mips32r6" => Ok(Self::Mips),
242242
"mips64" | "mips64r6" => Ok(Self::Mips64),
243243
"s390x" => Ok(Self::S390x),
244244
"spirv" => Ok(Self::SpirV),

compiler/rustc_target/src/spec/mipsisa32r6_unknown_linux_gnu.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ pub fn target() -> Target {
66
llvm_target: "mipsisa32r6-unknown-linux-gnu".into(),
77
pointer_width: 32,
88
data_layout: "E-m:m-p:32:32-i8:8:32-i16:16:32-i64:64-n32-S64".into(),
9-
arch: "mips".into(),
9+
arch: "mips32r6".into(),
1010
options: TargetOptions {
1111
endian: Endian::Big,
1212
cpu: "mips32r6".into(),

compiler/rustc_target/src/spec/mipsisa32r6el_unknown_linux_gnu.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ pub fn target() -> Target {
55
llvm_target: "mipsisa32r6el-unknown-linux-gnu".into(),
66
pointer_width: 32,
77
data_layout: "e-m:m-p:32:32-i8:8:32-i16:16:32-i64:64-n32-S64".into(),
8-
arch: "mips".into(),
8+
arch: "mips32r6".into(),
99

1010
options: TargetOptions {
1111
cpu: "mips32r6".into(),

library/std/src/os/linux/raw.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ mod arch {
9494
}
9595
}
9696

97-
#[cfg(target_arch = "mips")]
97+
#[cfg(any(target_arch = "mips", target_arch = "mips32r6"))]
9898
mod arch {
9999
use crate::os::raw::{c_long, c_ulong};
100100

library/std/src/sync/mpmc/utils.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ use crate::ops::{Deref, DerefMut};
3535
any(
3636
target_arch = "arm",
3737
target_arch = "mips",
38+
target_arch = "mips32r6",
3839
target_arch = "mips64",
3940
target_arch = "mips64r6",
4041
target_arch = "riscv64",
@@ -60,6 +61,7 @@ use crate::ops::{Deref, DerefMut};
6061
target_arch = "powerpc64",
6162
target_arch = "arm",
6263
target_arch = "mips",
64+
target_arch = "mips32r6",
6365
target_arch = "mips64",
6466
target_arch = "mips64r6",
6567
target_arch = "riscv64",

library/std/src/sys/common/alloc.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ use crate::ptr;
99
target_arch = "arm",
1010
target_arch = "m68k",
1111
target_arch = "mips",
12+
target_arch = "mips32r6",
1213
target_arch = "powerpc",
1314
target_arch = "powerpc64",
1415
target_arch = "sparc",

0 commit comments

Comments
 (0)