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 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100755 utils/genmovecode.sh (limited to 'utils/genmovecode.sh') 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 -- cgit v1.3