diff options
| -rwxr-xr-x | configure.sh | 9 | ||||
| -rw-r--r-- | cube.c | 19 |
2 files changed, 22 insertions, 6 deletions
diff --git a/configure.sh b/configure.sh index fdebf27..c297623 100755 --- a/configure.sh +++ b/configure.sh | |||
| @@ -1,9 +1,12 @@ | |||
| 1 | #!/bin/sh | 1 | #!/bin/sh |
| 2 | 2 | ||
| 3 | detectarch() { cc -march=native -dM -E - </dev/null | grep "$1"; } | 3 | cc=${CC:-cc} |
| 4 | detectsan() { cc -fsanitize=$1 -dM -E -x c - </dev/null | grep "SANITIZE"; } | 4 | |
| 5 | detectarch() { ${cc} -march=native -dM -E - </dev/null | grep "$1"; } | ||
| 6 | detectsan() { ${cc} -fsanitize=$1 -dM -E -x c - </dev/null | grep "SANITIZE"; } | ||
| 5 | 7 | ||
| 6 | [ -n "$(detectarch __AVX2__)" ] && detected="AVX2" | 8 | [ -n "$(detectarch __AVX2__)" ] && detected="AVX2" |
| 9 | [ -n "$(detectarch __ARM_NEON)" ] && detected="NEON" | ||
| 7 | 10 | ||
| 8 | TYPE=${TYPE-"$detected"} | 11 | TYPE=${TYPE-"$detected"} |
| 9 | 12 | ||
| @@ -26,5 +29,5 @@ echo ""; | |||
| 26 | echo "CFLAGS = $CFLAGS"; | 29 | echo "CFLAGS = $CFLAGS"; |
| 27 | echo "DBGFLAGS = $DBGFLAGS"; | 30 | echo "DBGFLAGS = $DBGFLAGS"; |
| 28 | echo ""; | 31 | echo ""; |
| 29 | echo "CC = ${CC:-cc}" | 32 | echo "CC = ${cc}" |
| 30 | } > config.mk | 33 | } > config.mk |
| @@ -485,11 +485,9 @@ Section: AVX2 fast methods | |||
| 485 | 485 | ||
| 486 | This section contains performance-critical methods that rely on AVX2 | 486 | This section contains performance-critical methods that rely on AVX2 |
| 487 | intructions such as routines for moving or transforming the cube. | 487 | intructions such as routines for moving or transforming the cube. |
| 488 | |||
| 489 | Note: the #ifdef below is closed in the next section. | ||
| 490 | ******************************************************************************/ | 488 | ******************************************************************************/ |
| 491 | 489 | ||
| 492 | #ifdef CUBE_AVX2 | 490 | #if defined(CUBE_AVX2) |
| 493 | 491 | ||
| 494 | #include <immintrin.h> | 492 | #include <immintrin.h> |
| 495 | 493 | ||
| @@ -651,6 +649,21 @@ coord_fast_eo(cube_fast_t c) | |||
| 651 | return mask >> 17; | 649 | return mask >> 17; |
| 652 | } | 650 | } |
| 653 | 651 | ||
| 652 | /****************************************************************************** | ||
| 653 | Section: ARM NEON fast methods | ||
| 654 | |||
| 655 | This section contains performance-critical methods that rely on ARM NEON | ||
| 656 | intructions such as routines for moving or transforming the cube. | ||
| 657 | ******************************************************************************/ | ||
| 658 | |||
| 659 | #elif defined(CUBE_NEON) | ||
| 660 | |||
| 661 | typedef struct { | ||
| 662 | uint8x16_t corner; | ||
| 663 | uint8x16_t edge; | ||
| 664 | } cube_fast_t; | ||
| 665 | |||
| 666 | /* TODO! */ | ||
| 654 | 667 | ||
| 655 | /****************************************************************************** | 668 | /****************************************************************************** |
| 656 | Section: portable fast methods | 669 | Section: portable fast methods |
