From 9b1c9371333e20611ec5422e660ebec7e66c4261 Mon Sep 17 00:00:00 2001 From: Sebastiano Tronto Date: Thu, 2 Nov 2023 22:17:14 +0100 Subject: Added avx2 moves --- utils/genmovecode.sh | 19 +++++++++++++++++++ utils/gentranscode.sh | 1 - 2 files changed, 19 insertions(+), 1 deletion(-) create mode 100755 utils/genmovecode.sh (limited to 'utils') diff --git a/utils/genmovecode.sh b/utils/genmovecode.sh new file mode 100755 index 0000000..c389ea8 --- /dev/null +++ b/utils/genmovecode.sh @@ -0,0 +1,19 @@ +#!/bin/sh + +type="${1:-src}" + +gcc -DDEBUG h48_to_"$type".c ../src/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\ninline_move_%s' "$move" + printf '(cube_t c)\n{\n' + printf '\tcube_t m = ' + ./h48_to_"$type" <"$f" | sed '2,4s/^/\t/' + printf ';\n\n\treturn compose(c, m);\n}\n\n' + done +} + +genfuncs +rm -f h48_to_"$type" invert diff --git a/utils/gentranscode.sh b/utils/gentranscode.sh index e874ad4..7749ba7 100755 --- a/utils/gentranscode.sh +++ b/utils/gentranscode.sh @@ -23,7 +23,6 @@ genfuncs() { for f in transform_??_???.txt; do trans="$(echo $f | sed 's/.*_// ; s/\.txt//')" printf 'static inline cube_t\ninline_trans_%s' "$trans" - [ "$1" = "-i" ] && printf '_inverse' printf '(cube_t c)\n{\n' printf '\tcube_t ret;\n\n' printf '\tcube_t tn = ' -- cgit v1.3