[PATCHv2] soft-fp: Automatically create KF files from TF ones
Tulio Magno Quites Machado Filho
tuliom@linux.vnet.ibm.com
Mon Oct 26 20:01:00 GMT 2015
Joseph Myers <joseph@codesourcery.com> writes:
> Even in GCC, creating generated files like that in the source directory
> would be wrong. If you can create them with a sed script, you can do so
> at build time and put the files in the build directory, not the source
> directory (which should be able to be on a read-only filesystem).
Ack. What about this new version?
----8<----
Use a sed script to automatically generate KF files based on their
respective TF.
2015-10-26 Tulio Magno Quites Machado Filho <tuliom@linux.vnet.ibm.com>
Michael Meissner <meissner@linux.vnet.ibm.com>
* soft-fp/Makefile: Generate KF files from TF.
---
soft-fp/Makefile | 18 ++++++++++++++++++
1 file changed, 18 insertions(+)
diff --git a/soft-fp/Makefile b/soft-fp/Makefile
index 28f9f0c..f5ea630 100644
--- a/soft-fp/Makefile
+++ b/soft-fp/Makefile
@@ -37,4 +37,22 @@ gcc-quad-routines := negtf2 addtf3 subtf3 multf3 divtf3 eqtf2 \
fixunstfdi floatditf extendsftf2 trunctfsf2 extenddftf2 \
trunctfdf2 sqrttf2 floatunsitf floatunditf
+# Auto-generate KF routines list, removing unused files.
+gcc-kf-routines-auto := $(subst tf,kf,\
+ $(filter-out sqrttf2,$(gcc-quad-routines)))
+gcc-kf-routines-auto-files := $(addprefix $(objpfx),\
+ $(addsuffix .c,\
+ $(gcc-kf-routines-auto)))
+
+generate-routines: $(gcc-kf-routines-auto-files)
+
+clean:
+ -rm -f $(gcc-kf-routines-auto-files)
+
include ../Rules
+
+.SECONDEXPANSION:
+$(gcc-kf-routines-auto-files): $$(subst kf,tf,$$(@F))
+ @mkdir -p $(objpfx)
+ @sed -e 's/\(__[a-z]\+\)tf\([a-z0-9]*\)/\1kf\2/g' \
+ -e 's/quad[.]h/quad-float128.h/g' $< > $@
--
2.1.0
More information about the Libc-alpha
mailing list