Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rollup of 9 pull requests #128435

Merged
merged 21 commits into from
Jul 31, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
e0af3c6
When an archive fails to build, print the path
tgross35 Jul 16, 2024
b61570a
Structured suggestion for `extern crate foo` when `foo` isn't resolve…
estebank Jul 24, 2024
918cdcc
More detailed note to deprecate ONCE_INIT
liigo Jul 30, 2024
67a08b5
Attribute checking simplifications
oli-obk Jul 30, 2024
e7f89a7
derive(SmartPointer): rewrite bounds in where and generic bounds
dingxiangfei2009 Jul 13, 2024
fe6478c
Match LLVM ABI in `extern "C"` functions for `f128` on Windows
beetrees Jul 30, 2024
e657773
Remove crate_level_only from ELIDED_LIFETIMES_IN_PATHS
compiler-errors Jul 30, 2024
3659d9d
bump-stage0: use IndexMap for determinism
cuviper Jun 14, 2024
2e9298b
Bump src/stage0 with determinism
cuviper Jul 30, 2024
a2b3256
Print `thir::PatRange`, not its surrounding `thir::Pat`
Zalathar Jul 30, 2024
a9ea85e
Revert "Make `thir::Pat` not implement `fmt::Display` directly"
Zalathar Jul 30, 2024
dd5a8d7
Use a separate pattern type for `rustc_pattern_analysis` diagnostics
Zalathar Jul 30, 2024
579eb68
Rollup merge of #126454 - cuviper:deterministic-bump, r=Kobzol
matthiaskrgr Jul 31, 2024
563f938
Rollup merge of #127681 - dingxiangfei2009:smart-ptr-bounds, r=compil…
matthiaskrgr Jul 31, 2024
75dfe1e
Rollup merge of #127830 - tgross35:archive-failure-message, r=BoxyUwU
matthiaskrgr Jul 31, 2024
336a378
Rollup merge of #128151 - estebank:missing-extern-crate, r=petrochenkov
matthiaskrgr Jul 31, 2024
22dbf88
Rollup merge of #128387 - liigo:patch-14, r=tgross35
matthiaskrgr Jul 31, 2024
5c63363
Rollup merge of #128388 - beetrees:f16-f128-slightly-improve-windows-…
matthiaskrgr Jul 31, 2024
e2d8f1a
Rollup merge of #128402 - oli-obk:checked_attrs, r=compiler-errors
matthiaskrgr Jul 31, 2024
06b8372
Rollup merge of #128412 - compiler-errors:crate-level-only, r=cjgillot
matthiaskrgr Jul 31, 2024
031093f
Rollup merge of #128430 - Zalathar:print-pat, r=Nadrieril
matthiaskrgr Jul 31, 2024
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
Prev Previous commit
Next Next commit
Match LLVM ABI in extern "C" functions for f128 on Windows
  • Loading branch information
beetrees committed Jul 30, 2024
commit fe6478cc539cfe17b4f5fc10f46928c6b16e6ef0
10 changes: 7 additions & 3 deletions compiler/rustc_target/src/abi/call/x86_win64.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use crate::abi::call::{ArgAbi, FnAbi, Reg};
use crate::abi::Abi;
use crate::abi::{Abi, Float, Primitive};

// Win64 ABI: https://docs.microsoft.com/en-us/cpp/build/parameter-passing

Expand All @@ -18,8 +18,12 @@ pub fn compute_abi_info<Ty>(fn_abi: &mut FnAbi<'_, Ty>) {
// FIXME(eddyb) there should be a size cap here
// (probably what clang calls "illegal vectors").
}
Abi::Scalar(_) => {
if a.layout.size.bytes() > 8 {
Abi::Scalar(scalar) => {
// Match what LLVM does for `f128` so that `compiler-builtins` builtins match up
// with what LLVM expects.
if a.layout.size.bytes() > 8
&& !matches!(scalar.primitive(), Primitive::Float(Float::F128))
{
a.make_indirect();
} else {
a.extend_integer_width_to(32);
Expand Down
4 changes: 3 additions & 1 deletion library/std/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ fn main() {
// Unsupported <https://github.com/llvm/llvm-project/issues/94434>
("arm64ec", _) => false,
// MinGW ABI bugs <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115054>
("x86", "windows") => false,
("x86_64", "windows") => false,
// x86 has ABI bugs that show up with optimizations. This should be partially fixed with
// the compiler-builtins update. <https://github.com/rust-lang/rust/issues/123885>
("x86" | "x86_64", _) => false,
Expand Down Expand Up @@ -122,6 +122,8 @@ fn main() {
("nvptx64", _) => false,
// ABI unsupported <https://github.com/llvm/llvm-project/issues/41838>
("sparc", _) => false,
// MinGW ABI bugs <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115054>
("x86_64", "windows") => false,
// 64-bit Linux is about the only platform to have f128 symbols by default
(_, "linux") if target_pointer_width == 64 => true,
// Same as for f16, except MacOS is also missing f128 symbols.
Expand Down
39 changes: 39 additions & 0 deletions tests/assembly/x86_64-windows-float-abi.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
//@ assembly-output: emit-asm
//@ compile-flags: -O
//@ only-windows
//@ only-x86_64

#![feature(f16, f128)]
#![crate_type = "lib"]

// CHECK-LABEL: second_f16
// CHECK: movaps %xmm1, %xmm0
// CHECK-NEXT: retq
#[no_mangle]
pub extern "C" fn second_f16(_: f16, x: f16) -> f16 {
x
}

// CHECK-LABEL: second_f32
// CHECK: movaps %xmm1, %xmm0
// CHECK-NEXT: retq
#[no_mangle]
pub extern "C" fn second_f32(_: f32, x: f32) -> f32 {
x
}

// CHECK-LABEL: second_f64
// CHECK: movaps %xmm1, %xmm0
// CHECK-NEXT: retq
#[no_mangle]
pub extern "C" fn second_f64(_: f64, x: f64) -> f64 {
x
}

// CHECK-LABEL: second_f128
// CHECK: movaps %xmm1, %xmm0
// CHECK-NEXT: retq
#[no_mangle]
pub extern "C" fn second_f128(_: f128, x: f128) -> f128 {
x
}
Loading