From 13275a4bb8696e730a4fffdd05b8e1d046e489c6 Mon Sep 17 00:00:00 2001 From: Sebastiano Tronto Date: Sun, 19 Nov 2023 10:40:49 +0100 Subject: Simplified cube definition for move and transformations even more --- utils/genmovecode.sh | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) (limited to 'utils/genmovecode.sh') 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 @@ #!/bin/sh -type="${1:-src}" - -gcc -DDEBUG h48_to_"$type".c ../cube.c -o h48_to_"$type" - -lineavx() { printf '#define _move_cube_%s ' "$1"; } -linesrc() { printf '_static cube_fast_t _move_cube_%s = ' "$1"; } -sedavx() { sed '1,2s/$/ \\/ ; 3s/$/)/ ; 3q'; } -sedsrc() { sed '3s/$/ };/ ; 3q'; } +gcc -DDEBUG h48_to_lst.c ../cube.c -o h48_to_lst gen() { for f in move_??_*.txt; do move="$(echo $f | sed 's/.*_// ; s/\.txt//')" - line$type "$move" - ./h48_to_"$type" <"$f" | sed$type + printf '#define _move_cube_%s fastcube( \\\n ' "$move" + ./h48_to_lst <"$f" + printf ')\n' done } gen -rm -f h48_to_"$type" invert +rm -f h48_to_lst invert -- cgit v1.3