Skip to content

Commit 7da562d

Browse files
committed
math: Enabled floating point intrinsics for RISCV32 microcontrollers
1 parent 7275359 commit 7da562d

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/math.rs

+5-2
Original file line numberDiff line numberDiff line change
@@ -118,8 +118,11 @@ no_mangle! {
118118
fn truncf(x: f32) -> f32;
119119
}
120120

121-
// only for the thumb*-none-eabi* targets
122-
#[cfg(all(target_arch = "arm", target_os = "none"))]
121+
// only for the thumb*-none-eabi* targets and riscv32*-none-elf targets that lack the floating point instruction set
122+
#[cfg(any(
123+
all(target_arch = "arm", target_os = "none"),
124+
all(target_arch = "riscv32", not(target_feature = "f"), target_os = "none")
125+
))]
123126
no_mangle! {
124127
fn fmin(x: f64, y: f64) -> f64;
125128
fn fminf(x: f32, y: f32) -> f32;

0 commit comments

Comments
 (0)