Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions compiler/rustc_codegen_llvm/src/llvm_util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -369,7 +369,8 @@ fn update_target_reliable_float_cfg(sess: &Session, cfg: &mut TargetConfig) {
cfg.has_reliable_f16 = match (target_arch, target_os) {
// Unsupported <https://github.com/llvm/llvm-project/issues/94434> (fixed in llvm22)
(Arch::Arm64EC, _) if major < 22 => false,
// MinGW ABI bugs <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115054>
// MinGW ABI bugs <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115054> resolved in GCC 16
// but our toolchain hasn't been updated.
(Arch::X86_64, Os::Windows) if *target_env == Env::Gnu && *target_abi != CfgAbi::Llvm => {
false
}
Expand Down Expand Up @@ -397,8 +398,10 @@ fn update_target_reliable_float_cfg(sess: &Session, cfg: &mut TargetConfig) {
(Arch::PowerPC | Arch::PowerPC64, _) => false,
// ABI unsupported <https://github.com/llvm/llvm-project/issues/41838> (fixed in llvm22)
(Arch::Sparc, _) if major < 22 => false,
// MinGW ABI bugs <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115054>
(Arch::X86_64, Os::Windows) if *target_env == Env::Gnu && *target_abi != CfgAbi::Llvm => {
// MinGW ABI bugs <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115054> (fixed in llvm23)
(Arch::X86_64, Os::Windows)
if *target_env == Env::Gnu && *target_abi != CfgAbi::Llvm && major < 23 =>
{
false
}
// There are no known problems on other platforms, so the only requirement is that symbols
Expand Down
8 changes: 2 additions & 6 deletions compiler/rustc_target/src/callconv/x86_win64.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use rustc_abi::{BackendRepr, Float, Integer, Primitive, Size, TyAbiInterface};
use rustc_abi::{BackendRepr, Integer, Primitive, Size, TyAbiInterface};

use crate::callconv::{ArgAbi, FnAbi, Reg};
use crate::spec::{HasTargetSpec, RustcAbi};
Expand Down Expand Up @@ -35,11 +35,7 @@ where
// FIXME(#134288): This may change for the `-msvc` targets in the future.
a.cast_to(Reg::opaque_vector(Size::from_bits(128)));
}
} else if a.layout.size.bytes() > 8
&& !matches!(scalar.primitive(), Primitive::Float(Float::F128))
{
// Match what LLVM does for `f128` so that `compiler-builtins` builtins match up
// with what LLVM expects.
} else if a.layout.size.bytes() > 8 {
a.make_indirect();
} else {
a.extend_integer_width_to(32);
Expand Down
4 changes: 3 additions & 1 deletion tests/assembly-llvm/x86_64-windows-float-abi.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,9 @@ pub extern "C" fn second_f64(_: f64, x: f64) -> f64 {
}

// CHECK-LABEL: second_f128
// CHECK: movaps (%rdx), %xmm0
// CHECK: movq %rcx, %rax
// CHECK-NEXT: movaps (%r8), %xmm0
// CHECK-NEXT: movaps %xmm0, (%rcx)
// CHECK-NEXT: retq
#[no_mangle]
pub extern "C" fn second_f128(_: f128, x: f128) -> f128 {
Expand Down
Loading