diff options
| author | Sebastiano Tronto <sebastiano@tronto.net> | 2023-11-19 11:19:14 +0100 |
|---|---|---|
| committer | Sebastiano Tronto <sebastiano@tronto.net> | 2023-11-19 11:19:14 +0100 |
| commit | a9ce50120b68db3669aaadeac348db8926bc15c4 (patch) | |
| tree | 33cd118de37634970503553197370776564bce10 /cube.c | |
| parent | c5fb4d1c0f0ecc30673a46e517dc82c5af2af5ef (diff) | |
| download | nissy-core-a9ce50120b68db3669aaadeac348db8926bc15c4.tar.gz nissy-core-a9ce50120b68db3669aaadeac348db8926bc15c4.zip | |
Improved architecture detection
Diffstat (limited to '')
| -rw-r--r-- | cube.c | 8 |
1 files changed, 3 insertions, 5 deletions
| @@ -2,9 +2,7 @@ | |||
| 2 | #include <stdbool.h> | 2 | #include <stdbool.h> |
| 3 | #include <string.h> | 3 | #include <string.h> |
| 4 | 4 | ||
| 5 | #ifdef CUBE_AVX2 | 5 | #include "cube.h" |
| 6 | #include <immintrin.h> | ||
| 7 | #endif | ||
| 8 | 6 | ||
| 9 | #ifdef DEBUG | 7 | #ifdef DEBUG |
| 10 | #include <stdio.h> | 8 | #include <stdio.h> |
| @@ -25,8 +23,6 @@ | |||
| 25 | #define DBG_ASSERT(condition, retval, ...) | 23 | #define DBG_ASSERT(condition, retval, ...) |
| 26 | #endif | 24 | #endif |
| 27 | 25 | ||
| 28 | #include "cube.h" | ||
| 29 | |||
| 30 | /****************************************************************************** | 26 | /****************************************************************************** |
| 31 | Section: constants, strings and other stuff | 27 | Section: constants, strings and other stuff |
| 32 | ******************************************************************************/ | 28 | ******************************************************************************/ |
| @@ -495,6 +491,8 @@ Note: the #ifdef below is closed in the next section. | |||
| 495 | 491 | ||
| 496 | #ifdef CUBE_AVX2 | 492 | #ifdef CUBE_AVX2 |
| 497 | 493 | ||
| 494 | #include <immintrin.h> | ||
| 495 | |||
| 498 | typedef __m256i cube_fast_t; | 496 | typedef __m256i cube_fast_t; |
| 499 | 497 | ||
| 500 | #define _co2_avx2 _mm256_set_epi64x(0, 0, 0, 0x6060606060606060) | 498 | #define _co2_avx2 _mm256_set_epi64x(0, 0, 0, 0x6060606060606060) |
