From 1d5b9521002e6b8c6a3beba995d767f29ec82ff9 Mon Sep 17 00:00:00 2001 From: D1plo1d Date: Sat, 17 Sep 2022 11:47:21 -0400 Subject: [PATCH] math: Enabled floating point intrinsics for RISCV32 microcontrollers --- library/compiler-builtins/src/math.rs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/library/compiler-builtins/src/math.rs b/library/compiler-builtins/src/math.rs index fa983618695c..3fc33b127382 100644 --- a/library/compiler-builtins/src/math.rs +++ b/library/compiler-builtins/src/math.rs @@ -118,8 +118,11 @@ no_mangle! { fn truncf(x: f32) -> f32; } -// only for the thumb*-none-eabi* targets -#[cfg(all(target_arch = "arm", target_os = "none"))] +// only for the thumb*-none-eabi* targets and riscv32*-none-elf targets that lack the floating point instruction set +#[cfg(any( + all(target_arch = "arm", target_os = "none"), + all(target_arch = "riscv32", not(target_feature = "f"), target_os = "none") +))] no_mangle! { fn fmin(x: f64, y: f64) -> f64; fn fminf(x: f32, y: f32) -> f32;