about summary refs log tree commit diff
path: root/compiler/rustc_target/src
diff options
context:
space:
mode:
authorbeetrees <b@beetr.ee>2024-07-30 12:38:06 +0100
committerbeetrees <b@beetr.ee>2024-07-30 20:23:33 +0100
commitfe6478cc539cfe17b4f5fc10f46928c6b16e6ef0 (patch)
treef7d76bf79284d922407118a62199b4b03f332e04 /compiler/rustc_target/src
parente69c19ea0b8cf29ab8188a0eb5e899655464a1ff (diff)
downloadrust-fe6478cc539cfe17b4f5fc10f46928c6b16e6ef0.tar.gz
rust-fe6478cc539cfe17b4f5fc10f46928c6b16e6ef0.zip
Match LLVM ABI in `extern "C"` functions for `f128` on Windows
Diffstat (limited to 'compiler/rustc_target/src')
-rw-r--r--compiler/rustc_target/src/abi/call/x86_win64.rs10
1 files changed, 7 insertions, 3 deletions
diff --git a/compiler/rustc_target/src/abi/call/x86_win64.rs b/compiler/rustc_target/src/abi/call/x86_win64.rs
index 90de1a42bc0..4e19460bd28 100644
--- a/compiler/rustc_target/src/abi/call/x86_win64.rs
+++ b/compiler/rustc_target/src/abi/call/x86_win64.rs
@@ -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
 
@@ -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);