[2/2] libm/riscv: Use common fma code when necessary

Message ID 20200903205433.2108717-3-keithp@keithp.com
State New
Headers show
Series
  • libm/riscv: Fixing machine-specific fma/sqrt
Related show

Commit Message

Corinna Vinschen via Newlib Sept. 3, 2020, 8:54 p.m.
For RISC-V targets without hardware FMA support, include the
common fma implementation to provide that API.

Signed-off-by: Keith Packard <keithp@keithp.com>

---
 newlib/libm/machine/riscv/s_fma.c  | 2 ++
 newlib/libm/machine/riscv/sf_fma.c | 2 ++
 2 files changed, 4 insertions(+)

-- 
2.28.0

Patch

diff --git a/newlib/libm/machine/riscv/s_fma.c b/newlib/libm/machine/riscv/s_fma.c
index b7f378071..2d9ebfc99 100644
--- a/newlib/libm/machine/riscv/s_fma.c
+++ b/newlib/libm/machine/riscv/s_fma.c
@@ -46,4 +46,6 @@  fma (double x, double y, double z)
 	return result;
 }
 
+#else
+#include "../../common/s_fma.c"
 #endif
diff --git a/newlib/libm/machine/riscv/sf_fma.c b/newlib/libm/machine/riscv/sf_fma.c
index 8061a8abb..285c54883 100644
--- a/newlib/libm/machine/riscv/sf_fma.c
+++ b/newlib/libm/machine/riscv/sf_fma.c
@@ -46,4 +46,6 @@  fmaf (float x, float y, float z)
 	return result;
 }
 
+#else
+#include "../../common/sf_fma.c"
 #endif