aboutsummaryrefslogtreecommitdiff
path: root/utils/genmovecode.sh
diff options
context:
space:
mode:
authorSebastiano Tronto <sebastiano@tronto.net>2023-11-19 10:40:49 +0100
committerSebastiano Tronto <sebastiano@tronto.net>2023-11-19 10:40:49 +0100
commit13275a4bb8696e730a4fffdd05b8e1d046e489c6 (patch)
tree4db3ed3ada41158c451188c98e74fdde5ea296b2 /utils/genmovecode.sh
parentd6fdf14d5c320bdca455f910d58d652c5a7827da (diff)
downloadnissy-core-13275a4bb8696e730a4fffdd05b8e1d046e489c6.tar.gz
nissy-core-13275a4bb8696e730a4fffdd05b8e1d046e489c6.zip
Simplified cube definition for move and transformations even more
Diffstat (limited to 'utils/genmovecode.sh')
-rwxr-xr-xutils/genmovecode.sh16
1 files changed, 5 insertions, 11 deletions
diff --git a/utils/genmovecode.sh b/utils/genmovecode.sh
index 9d5fa7a..d6440e5 100755
--- a/utils/genmovecode.sh
+++ b/utils/genmovecode.sh
@@ -1,21 +1,15 @@
1#!/bin/sh 1#!/bin/sh
2 2
3type="${1:-src}" 3gcc -DDEBUG h48_to_lst.c ../cube.c -o h48_to_lst
4
5gcc -DDEBUG h48_to_"$type".c ../cube.c -o h48_to_"$type"
6
7lineavx() { printf '#define _move_cube_%s ' "$1"; }
8linesrc() { printf '_static cube_fast_t _move_cube_%s = ' "$1"; }
9sedavx() { sed '1,2s/$/ \\/ ; 3s/$/)/ ; 3q'; }
10sedsrc() { sed '3s/$/ };/ ; 3q'; }
11 4
12gen() { 5gen() {
13 for f in move_??_*.txt; do 6 for f in move_??_*.txt; do
14 move="$(echo $f | sed 's/.*_// ; s/\.txt//')" 7 move="$(echo $f | sed 's/.*_// ; s/\.txt//')"
15 line$type "$move" 8 printf '#define _move_cube_%s fastcube( \\\n ' "$move"
16 ./h48_to_"$type" <"$f" | sed$type 9 ./h48_to_lst <"$f"
10 printf ')\n'
17 done 11 done
18} 12}
19 13
20gen 14gen
21rm -f h48_to_"$type" invert 15rm -f h48_to_lst invert

Generated with cgit - Back to sebastiano.tronto.net