From b2a8d270663a8a7dc15932f8dc51043ab49fd63f Mon Sep 17 00:00:00 2001 From: Luca Colagrande Date: Fri, 11 Aug 2023 14:27:00 +0200 Subject: [PATCH] musl: Patch to build math library for Snitch --- sw/math/.gitignore | 1 + sw/math/Makefile | 17 +++++++++++++++++ sw/math/include/math.h | 2 ++ 3 files changed, 20 insertions(+) create mode 100644 sw/math/.gitignore create mode 100644 sw/math/Makefile diff --git a/sw/math/.gitignore b/sw/math/.gitignore new file mode 100644 index 0000000000..b8fcd70872 --- /dev/null +++ b/sw/math/.gitignore @@ -0,0 +1 @@ +include/bits/ \ No newline at end of file diff --git a/sw/math/Makefile b/sw/math/Makefile new file mode 100644 index 0000000000..8358ab76b5 --- /dev/null +++ b/sw/math/Makefile @@ -0,0 +1,17 @@ +BITS_DIR = include/bits +ALLTYPES_H = $(BITS_DIR)/alltypes.h + + +.PHONY: all clean + +all: $(ALLTYPES_H) + +clean: + rm -rf $(BITS_DIR) + rm -f $(ALLTYPES_H) + +$(BITS_DIR): + mkdir -p $@ + +$(ALLTYPES_H): | $(BITS_DIR) + sed -f tools/mkalltypes.sed arch/riscv64/bits/alltypes.h.in > $@ \ No newline at end of file diff --git a/sw/math/include/math.h b/sw/math/include/math.h index 14f28ec8c6..79ef21c185 100644 --- a/sw/math/include/math.h +++ b/sw/math/include/math.h @@ -435,6 +435,8 @@ float pow10f(float); long double pow10l(long double); #endif +#include "../src/math/tanh.c" + #ifdef __cplusplus } #endif