From b4f7b2ca350ccaa6f58ecec72ac46b7aef22d1c3 Mon Sep 17 00:00:00 2001 From: Stefan O'Rear Date: Thu, 3 Sep 2020 05:45:44 -0400 Subject: riscv32: add fenv and math These are identical to riscv64. --- src/math/riscv32/fabsf.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 src/math/riscv32/fabsf.c (limited to 'src/math/riscv32/fabsf.c') diff --git a/src/math/riscv32/fabsf.c b/src/math/riscv32/fabsf.c new file mode 100644 index 00000000..f5032e35 --- /dev/null +++ b/src/math/riscv32/fabsf.c @@ -0,0 +1,15 @@ +#include + +#if __riscv_flen >= 32 + +float fabsf(float x) +{ + __asm__ ("fabs.s %0, %1" : "=f"(x) : "f"(x)); + return x; +} + +#else + +#include "../fabsf.c" + +#endif -- cgit v1.2.1