Skip to content

Commit c6e03cd

Browse files
committed
support for mips64r6 as a target_arch value
1 parent c44324a commit c6e03cd

File tree

18 files changed

+20
-10
lines changed

18 files changed

+20
-10
lines changed

compiler/rustc_codegen_cranelift/example/float-minmax-pass.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ fn main() {
2222

2323
#[cfg(not(any(target_arch = "mips", target_arch = "mips64")))]
2424
let nan = f32::NAN;
25-
// MIPS hardware treats f32::NAN as SNAN. Clear the signaling bit.
25+
// MIPS hardware except MIPS R6 treats f32::NAN as SNAN. Clear the signaling bit.
2626
// See https://github.com/rust-lang/rust/issues/52746.
2727
#[cfg(any(target_arch = "mips", target_arch = "mips64"))]
2828
let nan = f32::from_bits(f32::NAN.to_bits() - 1);

compiler/rustc_codegen_gcc/example/alloc_system.rs

+1
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ const MIN_ALIGN: usize = 8;
1717
target_arch = "aarch64",
1818
target_arch = "loongarch64",
1919
target_arch = "mips64",
20+
target_arch = "mips64r6",
2021
target_arch = "s390x",
2122
target_arch = "sparc64"))]
2223
const MIN_ALIGN: usize = 16;

compiler/rustc_codegen_ssa/src/back/metadata.rs

+1
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,7 @@ pub(crate) fn create_object_file(sess: &Session) -> Option<write::Object<'static
195195
"s390x" => Architecture::S390x,
196196
"mips" => Architecture::Mips,
197197
"mips64" => Architecture::Mips64,
198+
"mips64r6" => Architecture::Mips64,
198199
"x86_64" => {
199200
if sess.target.pointer_width == 32 {
200201
Architecture::X86_64_X32

compiler/rustc_codegen_ssa/src/target_features.rs

+1-1
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" => MIPS_ALLOWED_FEATURES,
324+
"mips" | "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

+1
Original file line numberDiff line numberDiff line change
@@ -695,6 +695,7 @@ impl<'a, Ty> FnAbi<'a, Ty> {
695695
"m68k" => m68k::compute_abi_info(self),
696696
"mips" => mips::compute_abi_info(cx, self),
697697
"mips64" => mips64::compute_abi_info(cx, self),
698+
"mips64r6" => mips64::compute_abi_info(cx, self),
698699
"powerpc" => powerpc::compute_abi_info(self),
699700
"powerpc64" => powerpc64::compute_abi_info(cx, self),
700701
"s390x" => s390x::compute_abi_info(cx, self),

compiler/rustc_target/src/asm/mod.rs

+1
Original file line numberDiff line numberDiff line change
@@ -240,6 +240,7 @@ impl FromStr for InlineAsmArch {
240240
"loongarch64" => Ok(Self::LoongArch64),
241241
"mips" => Ok(Self::Mips),
242242
"mips64" => Ok(Self::Mips64),
243+
"mips64r6" => Ok(Self::Mips64),
243244
"s390x" => Ok(Self::S390x),
244245
"spirv" => Ok(Self::SpirV),
245246
"wasm32" => Ok(Self::Wasm32),

compiler/rustc_target/src/spec/mipsisa64r6_unknown_linux_gnuabi64.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ pub fn target() -> Target {
66
llvm_target: "mipsisa64r6-unknown-linux-gnuabi64".into(),
77
pointer_width: 64,
88
data_layout: "E-m:e-i8:8:32-i16:16:32-i64:64-n32:64-S128".into(),
9-
arch: "mips64".into(),
9+
arch: "mips64r6".into(),
1010
options: TargetOptions {
1111
abi: "abi64".into(),
1212
endian: Endian::Big,

compiler/rustc_target/src/spec/mipsisa64r6el_unknown_linux_gnuabi64.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ pub fn target() -> Target {
55
llvm_target: "mipsisa64r6el-unknown-linux-gnuabi64".into(),
66
pointer_width: 64,
77
data_layout: "e-m:e-i8:8:32-i16:16:32-i64:64-n32:64-S128".into(),
8-
arch: "mips64".into(),
8+
arch: "mips64r6".into(),
99
options: TargetOptions {
1010
abi: "abi64".into(),
1111
// NOTE(mips64r6) matches C toolchain

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

+1
Original file line numberDiff line numberDiff line change
@@ -233,6 +233,7 @@ mod arch {
233233
#[cfg(any(
234234
target_arch = "loongarch64",
235235
target_arch = "mips64",
236+
target_arch = "mips64r6",
236237
target_arch = "s390x",
237238
target_arch = "sparc64",
238239
target_arch = "riscv64",

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

+2
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ use crate::ops::{Deref, DerefMut};
3636
target_arch = "arm",
3737
target_arch = "mips",
3838
target_arch = "mips64",
39+
target_arch = "mips64r6",
3940
target_arch = "riscv64",
4041
),
4142
repr(align(32))
@@ -60,6 +61,7 @@ use crate::ops::{Deref, DerefMut};
6061
target_arch = "arm",
6162
target_arch = "mips",
6263
target_arch = "mips64",
64+
target_arch = "mips64r6",
6365
target_arch = "riscv64",
6466
target_arch = "s390x",
6567
)),

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

+1
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ pub const MIN_ALIGN: usize = 8;
2424
target_arch = "aarch64",
2525
target_arch = "loongarch64",
2626
target_arch = "mips64",
27+
target_arch = "mips64r6",
2728
target_arch = "s390x",
2829
target_arch = "sparc64",
2930
target_arch = "riscv64",

library/std/src/sys/personality/gcc.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ const UNWIND_DATA_REG: (i32, i32) = (0, 1); // R0, R1 / X0, X1
5959
#[cfg(target_arch = "m68k")]
6060
const UNWIND_DATA_REG: (i32, i32) = (0, 1); // D0, D1
6161

62-
#[cfg(any(target_arch = "mips", target_arch = "mips64"))]
62+
#[cfg(any(target_arch = "mips", target_arch = "mips64", target_arch = "mips64r6"))]
6363
const UNWIND_DATA_REG: (i32, i32) = (4, 5); // A0, A1
6464

6565
#[cfg(any(target_arch = "powerpc", target_arch = "powerpc64"))]

library/unwind/src/libunwind.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ pub const unwinder_private_data_size: usize = 2;
5454
#[cfg(target_arch = "mips")]
5555
pub const unwinder_private_data_size: usize = 2;
5656

57-
#[cfg(target_arch = "mips64")]
57+
#[cfg(any(target_arch = "mips64", target_arch = "mips64r6"))]
5858
pub const unwinder_private_data_size: usize = 2;
5959

6060
#[cfg(any(target_arch = "powerpc", target_arch = "powerpc64"))]

src/bootstrap/lib.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,8 @@ const EXTRA_CHECK_CFGS: &[(Option<Mode>, &'static str, Option<&[&'static str]>)]
133133
/* Extra values not defined in the built-in targets yet, but used in std */
134134
(Some(Mode::Std), "target_env", Some(&["libnx"])),
135135
// (Some(Mode::Std), "target_os", Some(&[])),
136-
(Some(Mode::Std), "target_arch", Some(&["asmjs", "spirv", "nvptx", "xtensa"])),
136+
// #[cfg(bootstrap)] mips64r6
137+
(Some(Mode::Std), "target_arch", Some(&["asmjs", "spirv", "nvptx", "xtensa", "mips64r6"])),
137138
/* Extra names used by dependencies */
138139
// FIXME: Used by serde_json, but we should not be triggering on external dependencies.
139140
(Some(Mode::Rustc), "no_btreemap_remove_entry", None),

src/librustdoc/clean/cfg.rs

+1
Original file line numberDiff line numberDiff line change
@@ -521,6 +521,7 @@ impl<'a> fmt::Display for Display<'a> {
521521
"m68k" => "M68k",
522522
"mips" => "MIPS",
523523
"mips64" => "MIPS-64",
524+
"mips64r6" => "MIPS-64 Release 6",
524525
"msp430" => "MSP430",
525526
"powerpc" => "PowerPC",
526527
"powerpc64" => "PowerPC-64",

src/tools/miri/src/shims/foreign_items.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriInterpCxExt<'mir, 'tcx> {
4646
// This list should be kept in sync with the one from libstd.
4747
let min_align = match this.tcx.sess.target.arch.as_ref() {
4848
"x86" | "arm" | "mips" | "powerpc" | "powerpc64" | "asmjs" | "wasm32" => 8,
49-
"x86_64" | "aarch64" | "mips64" | "s390x" | "sparc64" | "loongarch64" => 16,
49+
"x86_64" | "aarch64" | "mips64" | "mips64r6" | "s390x" | "sparc64" | "loongarch64" => 16,
5050
arch => bug!("unsupported target architecture for malloc: `{}`", arch),
5151
};
5252
// Windows always aligns, even small allocations.

tests/ui/check-cfg/compact-values.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ warning: unexpected `cfg` condition value
44
LL | #[cfg(target(os = "linux", arch = "X"))]
55
| ^^^^^^^^^^
66
|
7-
= note: expected values for `target_arch` are: `aarch64`, `arm`, `avr`, `bpf`, `hexagon`, `loongarch64`, `m68k`, `mips`, `mips64`, `msp430`, `nvptx64`, `powerpc`, `powerpc64`, `riscv32`, `riscv64`, `s390x`, `sparc`, `sparc64`, `wasm32`, `wasm64`, `x86`, `x86_64`
7+
= note: expected values for `target_arch` are: `aarch64`, `arm`, `avr`, `bpf`, `hexagon`, `loongarch64`, `m68k`, `mips`, `mips64`, `mips64r6`, `msp430`, `nvptx64`, `powerpc`, `powerpc64`, `riscv32`, `riscv64`, `s390x`, `sparc`, `sparc64`, `wasm32`, `wasm64`, `x86`, `x86_64`
88
= note: `#[warn(unexpected_cfgs)]` on by default
99

1010
warning: 1 warning emitted

tests/ui/simd/intrinsic/float-minmax-pass.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ fn main() {
2121

2222
#[cfg(not(any(target_arch = "mips", target_arch = "mips64")))]
2323
let nan = f32::NAN;
24-
// MIPS hardware treats f32::NAN as SNAN. Clear the signaling bit.
24+
// MIPS hardware except MIPS R6 treats f32::NAN as SNAN. Clear the signaling bit.
2525
// See https://github.com/rust-lang/rust/issues/52746.
2626
#[cfg(any(target_arch = "mips", target_arch = "mips64"))]
2727
let nan = f32::from_bits(f32::NAN.to_bits() - 1);

0 commit comments

Comments
 (0)