aboutsummaryrefslogtreecommitdiff
path: root/utils
diff options
context:
space:
mode:
Diffstat (limited to '')
-rwxr-xr-xutils/genmovecode.sh8
-rwxr-xr-xutils/gentranscode.sh16
-rwxr-xr-xutils/gentransswitch.sh2
3 files changed, 13 insertions, 13 deletions
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"
7genfuncs() { 7genfuncs() {
8 for f in move_??_*.txt; do 8 for f in move_??_*.txt; do
9 move="$(echo $f | sed 's/.*_// ; s/\.txt//')" 9 move="$(echo $f | sed 's/.*_// ; s/\.txt//')"
10 printf 'static inline cube_t\n_move_%s' "$move" 10 printf 'static inline cube_fast_t\n_move_%s' "$move"
11 printf '(cube_t c)\n{\n' 11 printf '(cube_fast_t c)\n{\n'
12 printf '\tcube_t m = ' 12 printf '\tcube_fast_t m = '
13 ./h48_to_"$type" <"$f" | sed '2,4s/^/\t/' 13 ./h48_to_"$type" <"$f" | sed '2,4s/^/\t/'
14 printf ';\n\n\treturn _compose(c, m);\n}\n\n' 14 printf ';\n\n\treturn compose_fast(c, m);\n}\n\n'
15 done 15 done
16} 16}
17 17
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() {
22genfuncs() { 22genfuncs() {
23 for f in transform_??_???.txt; do 23 for f in transform_??_???.txt; do
24 trans="$(echo $f | sed 's/.*_// ; s/\.txt//')" 24 trans="$(echo $f | sed 's/.*_// ; s/\.txt//')"
25 printf 'static inline cube_t\n_trans_%s' "$trans" 25 printf 'static inline cube_fast_t\n_trans_%s' "$trans"
26 printf '(cube_t c)\n{\n' 26 printf '(cube_fast_t c)\n{\n'
27 printf '\tcube_t ret;\n\n' 27 printf '\tcube_fast_t ret;\n\n'
28 printf '\tcube_t tn = ' 28 printf '\tcube_fast_t tn = '
29 ./h48_to_"$type" <"$f" | sed '2,4s/^/\t/' 29 ./h48_to_"$type" <"$f" | sed '2,4s/^/\t/'
30 printf ';\n\tcube_t ti = ' 30 printf ';\n\tcube_fast_t ti = '
31 ./invert <"$f" | ./h48_to_"$type" | sed '2,4 s/^/\t/' 31 ./invert <"$f" | ./h48_to_"$type" | sed '2,4 s/^/\t/'
32 printf ';\n\n\tret = compose(tn, c);\n' 32 printf ';\n\n\tret = compose_fast(tn, c);\n'
33 printf '\tret = compose(ret, ti);\n' 33 printf '\tret = compose_fast(ret, ti);\n'
34 if [ -n "$(echo "$trans" | grep "m")" ]; then 34 if [ -n "$(echo "$trans" | grep "m")" ]; then
35 printf '\tret = _invertco(ret);\n' 35 printf '\tret = invertco_fast(ret);\n'
36 fi 36 fi
37 printf '\n\treturn ret;\n}\n\n' 37 printf '\n\treturn ret;\n}\n\n'
38 done 38 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 @@
3printf '\tswitch (t) {\n' 3printf '\tswitch (t) {\n'
4for f in transform_??_???.txt; do 4for f in transform_??_???.txt; do
5 t="$(echo $f | sed 's/.*_// ; s/\.txt//')" 5 t="$(echo $f | sed 's/.*_// ; s/\.txt//')"
6 printf '\tcase %s:\n\t\treturn inline_trans_%s(c);\n' "$t" "$t" 6 printf '\tcase %s:\n\t\treturn _trans_%s(c);\n' "$t" "$t"
7done 7done
8printf '\t}\n' 8printf '\t}\n'

Generated with cgit - Back to sebastiano.tronto.net