Skip to content

Commit

Permalink
math: Do not copy math-tools headers
Browse files Browse the repository at this point in the history
This was a small hack introduced to allow PL to override math's version
of the wrapper and func map headers. This does not completely fix issue
#53 but is at least a small simplification.
  • Loading branch information
joeramsay committed Dec 18, 2024
1 parent 81ac58f commit 9a2e719
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 15 deletions.
19 changes: 7 additions & 12 deletions math/Dir.mk
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@ math-test-srcs := \
math-test-host-srcs := $(wildcard $(math-src-dir)/test/rtest/*.[cS])

math-includes := $(patsubst $(math-src-dir)/%,build/%,$(wildcard $(math-src-dir)/include/*.h))
math-test-includes := $(patsubst $(math-src-dir)/%,build/include/%,$(wildcard $(math-src-dir)/test/*.h))

math-libs := \
build/lib/libmathlib.so \
Expand All @@ -91,12 +90,11 @@ math-files := \
$(math-libs) \
$(math-tools) \
$(math-host-tools) \
$(math-includes) \
$(math-test-includes) \
$(math-includes)

all-math: $(math-libs) $(math-tools) $(math-includes) $(math-test-includes)
all-math: $(math-libs) $(math-tools) $(math-includes)

$(math-objs): $(math-includes) $(math-test-includes)
$(math-objs): $(math-includes)
$(math-objs): CFLAGS_ALL += $(math-cflags)
$(math-build-dir)/test/mathtest.o: CFLAGS_ALL += -fmath-errno
$(math-host-objs): CC = $(HOST_CC)
Expand All @@ -114,7 +112,7 @@ ulp-funcs-dir = build/test/ulp-funcs/
ulp-wrappers-dir = build/test/ulp-wrappers/
mathbench-funcs-dir = build/test/mathbench-funcs/
test-sig-dirs = $(ulp-funcs-dir) $(ulp-wrappers-dir) $(mathbench-funcs-dir)
$(test-sig-dirs) $(addsuffix /$(ARCH),$(test-sig-dirs)) $(addsuffix /aarch64/experimental,$(test-sig-dirs)) \
build/include/test $(test-sig-dirs) $(addsuffix /$(ARCH),$(test-sig-dirs)) $(addsuffix /aarch64/experimental,$(test-sig-dirs)) \
$(addsuffix /aarch64/experimental/advsimd,$(test-sig-dirs)) $(addsuffix /aarch64/experimental/sve,$(test-sig-dirs)) \
$(addsuffix /aarch64/advsimd,$(test-sig-dirs)) $(addsuffix /aarch64/sve,$(test-sig-dirs)):
mkdir -p $@
Expand All @@ -141,9 +139,9 @@ ulp-wrappers-gen = build/include/test/ulp_wrappers_gen.h
mathbench-funcs-gen = build/include/test/mathbench_funcs_gen.h
math-tools-autogen-headers = $(ulp-funcs-gen) $(ulp-wrappers-gen) $(mathbench-funcs-gen)

$(ulp-funcs-gen): $(ulp-funcs)
$(ulp-wrappers-gen): $(ulp-wrappers)
$(mathbench-funcs-gen): $(mathbench-funcs)
$(ulp-funcs-gen): $(ulp-funcs) | $$(@D)
$(ulp-wrappers-gen): $(ulp-wrappers) | $$(@D)
$(mathbench-funcs-gen): $(mathbench-funcs) | $$(@D)

$(math-tools-autogen-headers): | $$(@D)
cat $^ | sort -u > $@
Expand Down Expand Up @@ -187,9 +185,6 @@ build/bin/ulp: $(math-build-dir)/test/ulp.o build/lib/libmathlib.a
build/include/%.h: $(math-src-dir)/include/%.h
cp $< $@

build/include/test/%.h: $(math-src-dir)/test/%.h
cp $< $@

build/bin/%.sh: $(math-src-dir)/test/%.sh
cp $< $@

Expand Down
2 changes: 1 addition & 1 deletion math/test/mathbench_funcs.h
Original file line number Diff line number Diff line change
Expand Up @@ -118,4 +118,4 @@ SVD (_ZGVsMxv_tanpi, -0.9, 0.9)
#define _ZSVF2(...)
#define _ZSVD2(...)

#include "mathbench_funcs_gen.h"
#include "test/mathbench_funcs_gen.h"
2 changes: 1 addition & 1 deletion math/test/ulp_funcs.h
Original file line number Diff line number Diff line change
Expand Up @@ -106,4 +106,4 @@ SVF (_ZGVsMxvv_powi, Z_sv_powi, ref_powif, mpfr_powi, 2, 1, f2, 0)
#define _ZSVD1(f) ZSVD1 (f)
#define _ZSVD2(f) ZSVD2 (f)

#include "ulp_funcs_gen.h"
#include "test/ulp_funcs_gen.h"
2 changes: 1 addition & 1 deletion math/test/ulp_wrappers.h
Original file line number Diff line number Diff line change
Expand Up @@ -426,4 +426,4 @@ Z_sv_powk (svbool_t pg, double x, double y)
# endif // WANT_EXPERIMENTAL_MATH
#endif // WANT_SVE_MATH

#include "ulp_wrappers_gen.h"
#include "test/ulp_wrappers_gen.h"

0 comments on commit 9a2e719

Please sign in to comment.