This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
[PATCHv2] soft-fp: Automatically create KF files from TF ones
- From: "Tulio Magno Quites Machado Filho" <tuliom at linux dot vnet dot ibm dot com>
- To: joseph at codesourcery dot com
- Cc: libc-alpha at sourceware dot org, munroesj at linux dot vnet dot ibm dot com, meissner at linux dot vnet dot ibm dot com, Ulrich dot Weigand at de dot ibm dot com, dje dot gcc at gmail dot com, jakub at redhat dot com, carlos at redhat dot com
- Date: Mon, 26 Oct 2015 18:01:00 -0200
- Subject: [PATCHv2] soft-fp: Automatically create KF files from TF ones
- Authentication-results: sourceware.org; auth=none
- References: <alpine dot DEB dot 2 dot 10 dot 1510261815450 dot 3065 at digraph dot polyomino dot org dot uk>
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