aboutsummaryrefslogtreecommitdiff
path: root/old/moves_trans/gentranscode.sh
diff options
context:
space:
mode:
Diffstat (limited to 'old/moves_trans/gentranscode.sh')
-rwxr-xr-xold/moves_trans/gentranscode.sh42
1 files changed, 0 insertions, 42 deletions
diff --git a/old/moves_trans/gentranscode.sh b/old/moves_trans/gentranscode.sh
deleted file mode 100755
index 198ac93..0000000
--- a/old/moves_trans/gentranscode.sh
+++ /dev/null
@@ -1,42 +0,0 @@
1#!/bin/sh
2
3type="${1:-src}"
4
5gcc -DDEBUG h48_to_"$type".c ../cube.c -o h48_to_"$type"
6gcc -DDEBUG invert.c ../cube.c -o invert
7
8# Old version
9genarray() {
10 for f in transform_??_???.txt; do
11 trans="$(echo $f | sed 's/.*_// ; s/\.txt//')"
12 printf '[%s] = ' "$trans"
13 if [ "$1" = "-i" ]; then
14 ./invert <"$f" | ./h48_to_"$type"
15 else
16 ./h48_to_"$type" <"$f"
17 fi
18 printf ',\n'
19 done
20}
21
22genfuncs() {
23 for f in transform_??_???.txt; do
24 trans="$(echo $f | sed 's/.*_// ; s/\.txt//')"
25 printf 'static inline cube_fast_t\n_trans_%s' "$trans"
26 printf '(cube_fast_t c)\n{\n'
27 printf '\tcube_fast_t ret;\n\n'
28 printf '\tcube_fast_t tn = '
29 ./h48_to_"$type" <"$f" | sed '2,4s/^/\t/'
30 printf ';\n\tcube_fast_t ti = '
31 ./invert <"$f" | ./h48_to_"$type" | sed '2,4 s/^/\t/'
32 printf ';\n\n\tret = compose_fast(tn, c);\n'
33 printf '\tret = compose_fast(ret, ti);\n'
34 if [ -n "$(echo "$trans" | grep "m")" ]; then
35 printf '\tret = invertco_fast(ret);\n'
36 fi
37 printf '\n\treturn ret;\n}\n\n'
38 done
39}
40
41genfuncs
42rm -f h48_to_"$type" invert

Generated with cgit - Back to sebastiano.tronto.net