From fb9ae9e41eaf01b3651395fdd450ac1a4743e592 Mon Sep 17 00:00:00 2001 From: Sebastiano Tronto Date: Fri, 10 Nov 2023 14:44:48 +0100 Subject: Big changes to the interface --- utils/genmovecode.sh | 8 ++++---- utils/gentranscode.sh | 16 ++++++++-------- utils/gentransswitch.sh | 2 +- 3 files changed, 13 insertions(+), 13 deletions(-) (limited to 'utils') diff --git a/utils/genmovecode.sh b/utils/genmovecode.sh index 688ee39..0857f31 100755 --- a/utils/genmovecode.sh +++ b/utils/genmovecode.sh @@ -7,11 +7,11 @@ gcc -DDEBUG h48_to_"$type".c ../cube.c -o h48_to_"$type" genfuncs() { for f in move_??_*.txt; do move="$(echo $f | sed 's/.*_// ; s/\.txt//')" - printf 'static inline cube_t\n_move_%s' "$move" - printf '(cube_t c)\n{\n' - printf '\tcube_t m = ' + printf 'static inline cube_fast_t\n_move_%s' "$move" + printf '(cube_fast_t c)\n{\n' + printf '\tcube_fast_t m = ' ./h48_to_"$type" <"$f" | sed '2,4s/^/\t/' - printf ';\n\n\treturn _compose(c, m);\n}\n\n' + printf ';\n\n\treturn compose_fast(c, m);\n}\n\n' done } diff --git a/utils/gentranscode.sh b/utils/gentranscode.sh index 2f73df7..198ac93 100755 --- a/utils/gentranscode.sh +++ b/utils/gentranscode.sh @@ -22,17 +22,17 @@ genarray() { genfuncs() { for f in transform_??_???.txt; do trans="$(echo $f | sed 's/.*_// ; s/\.txt//')" - printf 'static inline cube_t\n_trans_%s' "$trans" - printf '(cube_t c)\n{\n' - printf '\tcube_t ret;\n\n' - printf '\tcube_t tn = ' + printf 'static inline cube_fast_t\n_trans_%s' "$trans" + printf '(cube_fast_t c)\n{\n' + printf '\tcube_fast_t ret;\n\n' + printf '\tcube_fast_t tn = ' ./h48_to_"$type" <"$f" | sed '2,4s/^/\t/' - printf ';\n\tcube_t ti = ' + printf ';\n\tcube_fast_t ti = ' ./invert <"$f" | ./h48_to_"$type" | sed '2,4 s/^/\t/' - printf ';\n\n\tret = compose(tn, c);\n' - printf '\tret = compose(ret, ti);\n' + printf ';\n\n\tret = compose_fast(tn, c);\n' + printf '\tret = compose_fast(ret, ti);\n' if [ -n "$(echo "$trans" | grep "m")" ]; then - printf '\tret = _invertco(ret);\n' + printf '\tret = invertco_fast(ret);\n' fi printf '\n\treturn ret;\n}\n\n' done diff --git a/utils/gentransswitch.sh b/utils/gentransswitch.sh index 6883973..a08dff9 100755 --- a/utils/gentransswitch.sh +++ b/utils/gentransswitch.sh @@ -3,6 +3,6 @@ printf '\tswitch (t) {\n' for f in transform_??_???.txt; do t="$(echo $f | sed 's/.*_// ; s/\.txt//')" - printf '\tcase %s:\n\t\treturn inline_trans_%s(c);\n' "$t" "$t" + printf '\tcase %s:\n\t\treturn _trans_%s(c);\n' "$t" "$t" done printf '\t}\n' -- cgit v1.3