renamed RustcAbi::X86Softfloat to Softfloat an made an alias to the old string

This commit is contained in:
Eddy (Eduard) Stefes 2026-01-22 13:20:52 +01:00
parent 7c3d096b0d
commit 83dba5b430
7 changed files with 13 additions and 21 deletions

View file

@ -28,7 +28,7 @@ where
BackendRepr::ScalableVector { .. } => panic!("scalable vectors are unsupported"),
BackendRepr::Scalar(scalar) => {
if is_ret && matches!(scalar.primitive(), Primitive::Int(Integer::I128, _)) {
if cx.target_spec().rustc_abi == Some(RustcAbi::X86Softfloat) {
if cx.target_spec().rustc_abi == Some(RustcAbi::Softfloat) {
// Use the native `i128` LLVM type for the softfloat ABI -- in other words, adjust nothing.
} else {
// `i128` is returned in xmm0 by Clang and GCC

View file

@ -1005,10 +1005,8 @@ crate::target_spec_enum! {
pub enum RustcAbi {
/// On x86-32 only: make use of SSE and SSE2 for ABI purposes.
X86Sse2 = "x86-sse2",
/// On x86-32/64 only: do not use any FPU or SIMD registers for the ABI.
X86Softfloat = "x86-softfloat",
// On S390x only: do not use any FPU or Vector registers for the ABI.
S390xSoftFloat = "s390x-softfloat",
/// On x86-32/64 and S390x: do not use any FPU or SIMD registers for the ABI.
Softfloat = "softfloat", "x86-softfloat",
}
parse_error_type = "rustc abi";
@ -3207,15 +3205,10 @@ impl Target {
Arch::X86,
"`x86-sse2` ABI is only valid for x86-32 targets"
),
RustcAbi::X86Softfloat => check_matches!(
RustcAbi::Softfloat => check_matches!(
self.arch,
Arch::X86 | Arch::X86_64,
"`x86-softfloat` ABI is only valid for x86 targets"
),
RustcAbi::S390xSoftFloat => check_matches!(
self.arch,
Arch::S390x,
"`s390x-softfloat` ABI is only valid for s390x targets"
Arch::X86 | Arch::X86_64 | Arch::S390x,
"`softfloat` ABI is only valid for x86 and s390x targets"
),
}
}

View file

@ -22,7 +22,7 @@ pub(crate) fn target() -> Target {
// If you initialize FP units yourself, you can override these flags with custom linker
// arguments, thus giving you access to full MMX/SSE acceleration.
base.features = "-mmx,-sse,+soft-float".into();
base.rustc_abi = Some(RustcAbi::X86Softfloat);
base.rustc_abi = Some(RustcAbi::Softfloat);
// Turn off DWARF. This fixes an lld warning, "section name .debug_frame is longer than 8
// characters and will use a non-standard string table". That section will not be created if

View file

@ -17,7 +17,7 @@ pub(crate) fn target() -> Target {
min_global_align: Some(Align::from_bits(16).unwrap()),
panic_strategy: PanicStrategy::Abort,
relocation_model: RelocModel::Static,
rustc_abi: Some(RustcAbi::S390xSoftFloat),
rustc_abi: Some(RustcAbi::Softfloat),
stack_probes: StackProbeType::Inline,
supported_sanitizers: SanitizerSet::KERNELADDRESS,
..Default::default()

View file

@ -20,7 +20,7 @@ pub(crate) fn target() -> Target {
relro_level: RelroLevel::Full,
linker_flavor: LinkerFlavor::Gnu(Cc::No, Lld::Yes),
linker: Some("rust-lld".into()),
rustc_abi: Some(RustcAbi::X86Softfloat),
rustc_abi: Some(RustcAbi::Softfloat),
features: "-mmx,-sse,-sse2,-sse3,-ssse3,-sse4.1,-sse4.2,-avx,-avx2,+soft-float".into(),
supported_sanitizers: SanitizerSet::KCFI | SanitizerSet::KERNELADDRESS,
disable_redzone: true,

View file

@ -27,7 +27,7 @@ pub(crate) fn target() -> Target {
// If you initialize FP units yourself, you can override these flags with custom linker
// arguments, thus giving you access to full MMX/SSE acceleration.
base.features = "-mmx,-sse,+soft-float".into();
base.rustc_abi = Some(RustcAbi::X86Softfloat);
base.rustc_abi = Some(RustcAbi::Softfloat);
Target {
llvm_target: "x86_64-unknown-windows".into(),

View file

@ -1098,14 +1098,13 @@ impl Target {
incompatible: &["soft-float"],
}
}
Some(RustcAbi::X86Softfloat) => {
Some(RustcAbi::Softfloat) => {
// Softfloat ABI, requires corresponding target feature. That feature trumps
// `x87` and all other FPU features so those do not matter.
// Note that this one requirement is the entire implementation of the ABI!
// LLVM handles the rest.
FeatureConstraints { required: &["soft-float"], incompatible: &[] }
}
Some(r) => panic!("invalid Rust ABI for x86: {r:?}"),
}
}
Arch::X86_64 => {
@ -1119,7 +1118,7 @@ impl Target {
incompatible: &["soft-float"],
}
}
Some(RustcAbi::X86Softfloat) => {
Some(RustcAbi::Softfloat) => {
// Softfloat ABI, requires corresponding target feature. That feature trumps
// `x87` and all other FPU features so those do not matter.
// Note that this one requirement is the entire implementation of the ABI!
@ -1231,7 +1230,7 @@ impl Target {
// Default hardfloat ABI.
FeatureConstraints { required: &[], incompatible: &["soft-float"] }
}
Some(RustcAbi::S390xSoftFloat) => {
Some(RustcAbi::Softfloat) => {
// Softfloat ABI, requires corresponding target feature.
// llvm will switch to soft-float ABI just based on this feature.
FeatureConstraints { required: &["soft-float"], incompatible: &["vector"] }