From 961c51881478af8bd86cc5d0717d35a08452383f Mon Sep 17 00:00:00 2001 From: Jed Brown Date: Tue, 7 May 2024 22:27:12 -0600 Subject: [PATCH] Apply suggestions from code review Co-authored-by: Jubilee <46493976+workingjubilee@users.noreply.github.com> --- compiler/rustc_codegen_cranelift/src/intrinsics/mod.rs | 4 ++-- library/std/src/f32/tests.rs | 1 + library/std/src/f64/tests.rs | 1 + src/tools/miri/src/lib.rs | 2 +- 4 files changed, 5 insertions(+), 3 deletions(-) diff --git a/compiler/rustc_codegen_cranelift/src/intrinsics/mod.rs b/compiler/rustc_codegen_cranelift/src/intrinsics/mod.rs index 84877711a176..ae67c7171a9a 100644 --- a/compiler/rustc_codegen_cranelift/src/intrinsics/mod.rs +++ b/compiler/rustc_codegen_cranelift/src/intrinsics/mod.rs @@ -328,8 +328,8 @@ fn codegen_float_intrinsic_call<'tcx>( sym::fabsf64 => ("fabs", 1, fx.tcx.types.f64, types::F64), sym::fmaf32 => ("fmaf", 3, fx.tcx.types.f32, types::F32), sym::fmaf64 => ("fma", 3, fx.tcx.types.f64, types::F64), - sym::fmuladdf32 => ("fmaf", 3, fx.tcx.types.f32, types::F32), // NOTE: pessimal without FMA target feature - sym::fmuladdf64 => ("fma", 3, fx.tcx.types.f64, types::F64), // NOTE: pessimal without FMA target feature + sym::fmuladdf32 => ("fmaf", 3, fx.tcx.types.f32, types::F32), // NOTE: software emulation without FMA target feature + sym::fmuladdf64 => ("fma", 3, fx.tcx.types.f64, types::F64), // NOTE: software emulation without FMA target feature sym::copysignf32 => ("copysignf", 2, fx.tcx.types.f32, types::F32), sym::copysignf64 => ("copysign", 2, fx.tcx.types.f64, types::F64), sym::floorf32 => ("floorf", 1, fx.tcx.types.f32, types::F32), diff --git a/library/std/src/f32/tests.rs b/library/std/src/f32/tests.rs index 601da01a4590..957e3a0d375d 100644 --- a/library/std/src/f32/tests.rs +++ b/library/std/src/f32/tests.rs @@ -409,6 +409,7 @@ fn test_mul_add() { assert_eq!((-3.2f32).mul_add(2.4, neg_inf), neg_inf); } +#[cfg(not(bootstrap))] #[test] fn test_mul_add_fast() { let nan: f32 = f32::NAN; diff --git a/library/std/src/f64/tests.rs b/library/std/src/f64/tests.rs index 0d06cb8920a1..fb3b0846f87f 100644 --- a/library/std/src/f64/tests.rs +++ b/library/std/src/f64/tests.rs @@ -397,6 +397,7 @@ fn test_mul_add() { assert_eq!((-3.2f64).mul_add(2.4, neg_inf), neg_inf); } +#[cfg(not(bootstrap))] #[test] fn test_mul_add_fast() { let nan: f64 = f64::NAN; diff --git a/src/tools/miri/src/lib.rs b/src/tools/miri/src/lib.rs index df792237ed43..6eff33b9a6f9 100644 --- a/src/tools/miri/src/lib.rs +++ b/src/tools/miri/src/lib.rs @@ -2,7 +2,7 @@ #![feature(cell_update)] #![feature(const_option)] #![feature(float_gamma)] -#![feature(float_mul_add_fast)] +#![cfg_attr(not(bootstrap), feature(float_mul_add_fast))] #![feature(map_try_insert)] #![feature(never_type)] #![feature(try_blocks)]