h48

A prototype for an optimal Rubik's cube solver, work in progress.
git clone https://git.tronto.net/h48
Download | Log | Files | Refs | README | LICENSE

commit 861a8a5fc4b62e5f70081f8e72b0854889a6cec6
parent 8c281789799a3954e94c7eeb10fb09e526005e1f
Author: Sebastiano Tronto <sebastiano@tronto.net>
Date:   Tue, 26 Dec 2023 16:46:01 +0100

Merge branch 'master' of tronto.net:h48

Diffstat:
Mconfigure.sh | 9++++++---
Mcube.c | 19++++++++++++++++---
2 files changed, 22 insertions(+), 6 deletions(-)

diff --git a/configure.sh b/configure.sh @@ -1,9 +1,12 @@ #!/bin/sh -detectarch() { cc -march=native -dM -E - </dev/null | grep "$1"; } -detectsan() { cc -fsanitize=$1 -dM -E -x c - </dev/null | grep "SANITIZE"; } +cc=${CC:-cc} + +detectarch() { ${cc} -march=native -dM -E - </dev/null | grep "$1"; } +detectsan() { ${cc} -fsanitize=$1 -dM -E -x c - </dev/null | grep "SANITIZE"; } [ -n "$(detectarch __AVX2__)" ] && detected="AVX2" +[ -n "$(detectarch __ARM_NEON)" ] && detected="NEON" TYPE=${TYPE-"$detected"} @@ -26,5 +29,5 @@ echo ""; echo "CFLAGS = $CFLAGS"; echo "DBGFLAGS = $DBGFLAGS"; echo ""; -echo "CC = ${CC:-cc}" +echo "CC = ${cc}" } > config.mk diff --git a/cube.c b/cube.c @@ -485,11 +485,9 @@ Section: AVX2 fast methods This section contains performance-critical methods that rely on AVX2 intructions such as routines for moving or transforming the cube. - -Note: the #ifdef below is closed in the next section. ******************************************************************************/ -#ifdef CUBE_AVX2 +#if defined(CUBE_AVX2) #include <immintrin.h> @@ -651,6 +649,21 @@ coord_fast_eo(cube_fast_t c) return mask >> 17; } +/****************************************************************************** +Section: ARM NEON fast methods + +This section contains performance-critical methods that rely on ARM NEON +intructions such as routines for moving or transforming the cube. +******************************************************************************/ + +#elif defined(CUBE_NEON) + +typedef struct { + uint8x16_t corner; + uint8x16_t edge; +} cube_fast_t; + +/* TODO! */ /****************************************************************************** Section: portable fast methods