Skip to content

Commit 29579c3

Browse files
authored
Unrolled build for rust-lang#134329
Rollup merge of rust-lang#134329 - taiki-e:m68k-target-feature, r=workingjubilee Add m68k_target_feature This adds the following unstable target features (tracking issue: rust-lang#134328): - isa-68000 - isa-68010 - isa-68020 - isa-68030 - isa-68040 - isa-68060 - isa-68881 - isa-68882 The feature names and implied features are match with [definitions in LLVM](https://github.com/llvm/llvm-project/blob/llvmorg-19.1.0/llvm/lib/Target/M68k/M68k.td#L21-L57). isa-68881 and isa-68882 are FPU ISA features. isa-68881 is needed to support input/output in floating-point regs in inline assembly. isa-68020 is needed to implement taiki-e/atomic-maybe-uninit#28 more robustly. cc `@glaubitz` `@ricky26` (designated developers of [m68k-unknown-linux-gnu](https://doc.rust-lang.org/nightly/rustc/platform-support/m68k-unknown-linux-gnu.html#designated-developers)) r? workingjubilee `@rustbot` label +O-motorola68k +A-target-feature
2 parents d185062 + 56b8e66 commit 29579c3

File tree

6 files changed

+29
-2
lines changed

6 files changed

+29
-2
lines changed

Diff for: compiler/rustc_feature/src/unstable.rs

+1
Original file line numberDiff line numberDiff line change
@@ -332,6 +332,7 @@ declare_features! (
332332
(unstable, hexagon_target_feature, "1.27.0", Some(44839)),
333333
(unstable, lahfsahf_target_feature, "1.78.0", Some(44839)),
334334
(unstable, loongarch_target_feature, "1.73.0", Some(44839)),
335+
(unstable, m68k_target_feature, "CURRENT_RUSTC_VERSION", Some(134328)),
335336
(unstable, mips_target_feature, "1.27.0", Some(44839)),
336337
(unstable, powerpc_target_feature, "1.27.0", Some(44839)),
337338
(unstable, prfchw_target_feature, "1.78.0", Some(44839)),

Diff for: compiler/rustc_span/src/symbol.rs

+1
Original file line numberDiff line numberDiff line change
@@ -1190,6 +1190,7 @@ symbols! {
11901190
loongarch_target_feature,
11911191
loop_break_value,
11921192
lt,
1193+
m68k_target_feature,
11931194
macro_at_most_once_rep,
11941195
macro_attributes_in_derive_output,
11951196
macro_escape,

Diff for: compiler/rustc_target/src/target_features.rs

+17-1
Original file line numberDiff line numberDiff line change
@@ -723,6 +723,20 @@ const SPARC_FEATURES: &[(&str, StabilityUncomputed, ImpliedFeatures)] = &[
723723
// tidy-alphabetical-end
724724
];
725725

726+
const M68K_FEATURES: &[(&str, StabilityUncomputed, ImpliedFeatures)] = &[
727+
// tidy-alphabetical-start
728+
("isa-68000", unstable(sym::m68k_target_feature), &[]),
729+
("isa-68010", unstable(sym::m68k_target_feature), &["isa-68000"]),
730+
("isa-68020", unstable(sym::m68k_target_feature), &["isa-68010"]),
731+
("isa-68030", unstable(sym::m68k_target_feature), &["isa-68020"]),
732+
("isa-68040", unstable(sym::m68k_target_feature), &["isa-68030", "isa-68882"]),
733+
("isa-68060", unstable(sym::m68k_target_feature), &["isa-68040"]),
734+
// FPU
735+
("isa-68881", unstable(sym::m68k_target_feature), &[]),
736+
("isa-68882", unstable(sym::m68k_target_feature), &["isa-68881"]),
737+
// tidy-alphabetical-end
738+
];
739+
726740
/// When rustdoc is running, provide a list of all known features so that all their respective
727741
/// primitives may be documented.
728742
///
@@ -742,6 +756,7 @@ pub fn all_rust_features() -> impl Iterator<Item = (&'static str, StabilityUncom
742756
.chain(LOONGARCH_FEATURES)
743757
.chain(IBMZ_FEATURES)
744758
.chain(SPARC_FEATURES)
759+
.chain(M68K_FEATURES)
745760
.cloned()
746761
.map(|(f, s, _)| (f, s))
747762
}
@@ -789,6 +804,7 @@ impl Target {
789804
"loongarch64" => LOONGARCH_FEATURES,
790805
"s390x" => IBMZ_FEATURES,
791806
"sparc" | "sparc64" => SPARC_FEATURES,
807+
"m68k" => M68K_FEATURES,
792808
_ => &[],
793809
}
794810
}
@@ -806,7 +822,7 @@ impl Target {
806822
"sparc" | "sparc64" => SPARC_FEATURES_FOR_CORRECT_VECTOR_ABI,
807823
"hexagon" => HEXAGON_FEATURES_FOR_CORRECT_VECTOR_ABI,
808824
"mips" | "mips32r6" | "mips64" | "mips64r6" => MIPS_FEATURES_FOR_CORRECT_VECTOR_ABI,
809-
"bpf" => &[], // no vector ABI
825+
"bpf" | "m68k" => &[], // no vector ABI
810826
"csky" => CSKY_FEATURES_FOR_CORRECT_VECTOR_ABI,
811827
// FIXME: for some tier3 targets, we are overly cautious and always give warnings
812828
// when passing args in vector registers.

Diff for: tests/ui/check-cfg/target_feature.stderr

+8
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,14 @@ LL | cfg!(target_feature = "_UNEXPECTED_VALUE");
118118
`hvx-length128b`
119119
`hwdiv`
120120
`i8mm`
121+
`isa-68000`
122+
`isa-68010`
123+
`isa-68020`
124+
`isa-68030`
125+
`isa-68040`
126+
`isa-68060`
127+
`isa-68881`
128+
`isa-68882`
121129
`jsconv`
122130
`lahfsahf`
123131
`lasx`

Diff for: tests/ui/target-feature/gate.rs

+1
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
// gate-test-s390x_target_feature
2626
// gate-test-sparc_target_feature
2727
// gate-test-x87_target_feature
28+
// gate-test-m68k_target_feature
2829

2930
#[target_feature(enable = "avx512bw")]
3031
//~^ ERROR: currently unstable

Diff for: tests/ui/target-feature/gate.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error[E0658]: the target feature `avx512bw` is currently unstable
2-
--> $DIR/gate.rs:29:18
2+
--> $DIR/gate.rs:30:18
33
|
44
LL | #[target_feature(enable = "avx512bw")]
55
| ^^^^^^^^^^^^^^^^^^^

0 commit comments

Comments
 (0)