about summary refs log tree commit diff
path: root/compiler/rustc_codegen_gcc
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2025-05-11 03:05:38 +0000
committerbors <bors@rust-lang.org>2025-05-11 03:05:38 +0000
commitfd6626d7b8dfb04df3b7117d8977a22a1453f1c8 (patch)
treee82e85883479dbbf8de305b3627103d9f4202bdb /compiler/rustc_codegen_gcc
parent7b84c9e9ca4b9c68c888b77762c31e180ee7af45 (diff)
parent615b4479741e6e5b182ea1f3dd7486511c681654 (diff)
downloadrust-fd6626d7b8dfb04df3b7117d8977a22a1453f1c8.tar.gz
rust-fd6626d7b8dfb04df3b7117d8977a22a1453f1c8.zip
Auto merge of #140912 - fmease:rollup-rwtn31e, r=fmease
Rollup of 7 pull requests

Successful merges:

 - #140792 (Use intrinsics for `{f16,f32,f64,f128}::{minimum,maximum}` operations)
 - #140795 (Prefer to suggest stable candidates rather than unstable ones)
 - #140865 (Make t letter looks like lowercase rather than uppercase)
 - #140878 (Two expand-related cleanups)
 - #140882 (Split duration_constructors to get non-controversial constructors out)
 - #140886 (Update deps of bootstrap for Cygwin)
 - #140903 (test intrinsic fallback bodies with Miri)

r? `@ghost`
`@rustbot` modify labels: rollup
Diffstat (limited to 'compiler/rustc_codegen_gcc')
-rw-r--r--compiler/rustc_codegen_gcc/src/intrinsic/mod.rs36
1 files changed, 36 insertions, 0 deletions
diff --git a/compiler/rustc_codegen_gcc/src/intrinsic/mod.rs b/compiler/rustc_codegen_gcc/src/intrinsic/mod.rs
index 2ed5ec4381e..9caceca9295 100644
--- a/compiler/rustc_codegen_gcc/src/intrinsic/mod.rs
+++ b/compiler/rustc_codegen_gcc/src/intrinsic/mod.rs
@@ -74,8 +74,44 @@ fn get_simple_intrinsic<'gcc, 'tcx>(
         sym::fabsf64 => "fabs",
         sym::minnumf32 => "fminf",
         sym::minnumf64 => "fmin",
+        sym::minimumf32 => "fminimumf",
+        sym::minimumf64 => "fminimum",
+        sym::minimumf128 => {
+            // GCC doesn't have the intrinsic we want so we use the compiler-builtins one
+            // https://docs.rs/compiler_builtins/latest/compiler_builtins/math/full_availability/fn.fminimumf128.html
+            let f128_type = cx.type_f128();
+            return Some(cx.context.new_function(
+                None,
+                FunctionType::Extern,
+                f128_type,
+                &[
+                    cx.context.new_parameter(None, f128_type, "a"),
+                    cx.context.new_parameter(None, f128_type, "b"),
+                ],
+                "fminimumf128",
+                false,
+            ));
+        }
         sym::maxnumf32 => "fmaxf",
         sym::maxnumf64 => "fmax",
+        sym::maximumf32 => "fmaximumf",
+        sym::maximumf64 => "fmaximum",
+        sym::maximumf128 => {
+            // GCC doesn't have the intrinsic we want so we use the compiler-builtins one
+            // https://docs.rs/compiler_builtins/latest/compiler_builtins/math/full_availability/fn.fmaximumf128.html
+            let f128_type = cx.type_f128();
+            return Some(cx.context.new_function(
+                None,
+                FunctionType::Extern,
+                f128_type,
+                &[
+                    cx.context.new_parameter(None, f128_type, "a"),
+                    cx.context.new_parameter(None, f128_type, "b"),
+                ],
+                "fmaximumf128",
+                false,
+            ));
+        }
         sym::copysignf32 => "copysignf",
         sym::copysignf64 => "copysign",
         sym::copysignf128 => "copysignl",