From 06624a0ff2fffb8ff3022697fe0c48c7995dd033 Mon Sep 17 00:00:00 2001 From: Jay D Dee Date: Sun, 8 Dec 2024 11:14:08 -0500 Subject: [PATCH] v24.6 --- RELEASE_NOTES | 8 + algo/hamsi/hamsi-hash-4way.c | 192 +++- algo/simd/simd-hash-2way.c | 68 +- build-allarch.sh | 51 +- clean-all.sh | 2 +- configure | 20 +- configure.ac | 2 +- configure~ | 1597 +++++++++++++++------------------- cpu-miner.c | 74 +- miner.h | 2 +- simd-utils.h | 62 +- simd-utils/intrlv.h | 441 +++++++--- simd-utils/simd-128.h | 6 +- simd-utils/simd-256.h | 11 +- simd-utils/simd-int.h | 6 +- simd-utils/simd-neon.h | 49 +- simd-utils/simd-sve.h | 159 +++- sysinfos.c | 4 +- 18 files changed, 1570 insertions(+), 1184 deletions(-) diff --git a/RELEASE_NOTES b/RELEASE_NOTES index 41d1afcc..048d9b97 100644 --- a/RELEASE_NOTES +++ b/RELEASE_NOTES @@ -75,6 +75,14 @@ If not what makes it happen or not happen? Change Log ---------- +v24.6 + +ARM: Fixed scryptn2, x16*, broken in v24.2. +ARM: Small improvement to interleaving. +Eliminated some potential compile errors in code that was dependent on +compiler optimisations. +x86_64: improved support for AVX10 compilation, needs GCC-14 or higher. + v24.5 Fix MinGW compile error after MSys2 upgrade to GCC-14.2. diff --git a/algo/hamsi/hamsi-hash-4way.c b/algo/hamsi/hamsi-hash-4way.c index f21f27bf..a3c5bfe4 100644 --- a/algo/hamsi/hamsi-hash-4way.c +++ b/algo/hamsi/hamsi-hash-4way.c @@ -387,7 +387,7 @@ static const uint32_t T512[64][16] __attribute__ ((aligned (32))) = // Hamsi 8 way AVX512 // Intel docs say _mm512_movepi64_mask & _mm512_cmplt_epi64_mask have same -// timig. However, when tested hashing X13 on i9-9940x using cmplt with zero +// timing. However, testing hashing X13 on i9-9940x using cmplt with zero // had a 3% faster overall hashrate than than using movepi. #define INPUT_BIG8 \ @@ -418,13 +418,11 @@ static const uint32_t T512[64][16] __attribute__ ((aligned (32))) = tb = mm512_xoror( b, d, a ); \ a = _mm512_xor_si512( a, c ); \ b = mm512_xoror( td, tb, a ); \ - td = mm512_xorand( a, td, tb ); \ + d = _mm512_ternarylogic_epi64( a, td, tb, 0x87 );/* not( xorand( a, td, tb ) ); */ \ a = c; \ - c = mm512_xor3( tb, b, td ); \ - d = mm512_not( td ); \ + c = _mm512_ternarylogic_epi64( tb, b, d, 0x69 ); /* not( xor3( tb, b, d ) ); */ \ } - /* #define SBOX8( a, b, c, d ) \ do { \ @@ -1155,11 +1153,99 @@ do { \ b = mm256_xoror( td, tb, a ); \ d = _mm256_ternarylogic_epi64( a, td, tb, 0x87 );/* mm256_not( mm256_xorand( a, td, tb ) ); */ \ a = c; \ - c = _mm256_ternarylogic_epi64( tb, b, d, 0x69 ); /*mm256_not( mm256_xor3( tb, b, d ) );*/ \ + c = _mm256_ternarylogic_epi64( tb, b, d, 0x69 ); /* mm256_not( mm256_xor3( tb, b, d ) ); */ \ } #else +#define INPUT_BIG_sub( db_i ) \ +{ \ + const __m256i dm = _mm256_cmpgt_epi64( zero, db_i ); \ + m0 = _mm256_xor_si256( m0, _mm256_and_si256( dm, v256_64( tp[0] ) ) ); \ + m1 = _mm256_xor_si256( m1, _mm256_and_si256( dm, v256_64( tp[1] ) ) ); \ + m2 = _mm256_xor_si256( m2, _mm256_and_si256( dm, v256_64( tp[2] ) ) ); \ + m3 = _mm256_xor_si256( m3, _mm256_and_si256( dm, v256_64( tp[3] ) ) ); \ + m4 = _mm256_xor_si256( m4, _mm256_and_si256( dm, v256_64( tp[4] ) ) ); \ + m5 = _mm256_xor_si256( m5, _mm256_and_si256( dm, v256_64( tp[5] ) ) ); \ + m6 = _mm256_xor_si256( m6, _mm256_and_si256( dm, v256_64( tp[6] ) ) ); \ + m7 = _mm256_xor_si256( m7, _mm256_and_si256( dm, v256_64( tp[7] ) ) ); \ + tp += 8; \ +} + +#define INPUT_BIG \ +{ \ + const __m256i db = *buf; \ + const __m256i zero = m256_zero; \ + const uint64_t *tp = (const uint64_t*)T512; \ + m0 = m1 = m2 = m3 = m4 = m5 = m6 = m7 = zero; \ + INPUT_BIG_sub( _mm256_slli_epi64( db,63 ) ); \ + INPUT_BIG_sub( _mm256_slli_epi64( db,62 ) ); \ + INPUT_BIG_sub( _mm256_slli_epi64( db,61 ) ); \ + INPUT_BIG_sub( _mm256_slli_epi64( db,60 ) ); \ + INPUT_BIG_sub( _mm256_slli_epi64( db,59 ) ); \ + INPUT_BIG_sub( _mm256_slli_epi64( db,58 ) ); \ + INPUT_BIG_sub( _mm256_slli_epi64( db,57 ) ); \ + INPUT_BIG_sub( _mm256_slli_epi64( db,56 ) ); \ + INPUT_BIG_sub( _mm256_slli_epi64( db,55 ) ); \ + INPUT_BIG_sub( _mm256_slli_epi64( db,54 ) ); \ + INPUT_BIG_sub( _mm256_slli_epi64( db,53 ) ); \ + INPUT_BIG_sub( _mm256_slli_epi64( db,52 ) ); \ + INPUT_BIG_sub( _mm256_slli_epi64( db,51 ) ); \ + INPUT_BIG_sub( _mm256_slli_epi64( db,50 ) ); \ + INPUT_BIG_sub( _mm256_slli_epi64( db,49 ) ); \ + INPUT_BIG_sub( _mm256_slli_epi64( db,48 ) ); \ + INPUT_BIG_sub( _mm256_slli_epi64( db,47 ) ); \ + INPUT_BIG_sub( _mm256_slli_epi64( db,46 ) ); \ + INPUT_BIG_sub( _mm256_slli_epi64( db,45 ) ); \ + INPUT_BIG_sub( _mm256_slli_epi64( db,44 ) ); \ + INPUT_BIG_sub( _mm256_slli_epi64( db,43 ) ); \ + INPUT_BIG_sub( _mm256_slli_epi64( db,42 ) ); \ + INPUT_BIG_sub( _mm256_slli_epi64( db,41 ) ); \ + INPUT_BIG_sub( _mm256_slli_epi64( db,40 ) ); \ + INPUT_BIG_sub( _mm256_slli_epi64( db,39 ) ); \ + INPUT_BIG_sub( _mm256_slli_epi64( db,38 ) ); \ + INPUT_BIG_sub( _mm256_slli_epi64( db,37 ) ); \ + INPUT_BIG_sub( _mm256_slli_epi64( db,36 ) ); \ + INPUT_BIG_sub( _mm256_slli_epi64( db,35 ) ); \ + INPUT_BIG_sub( _mm256_slli_epi64( db,34 ) ); \ + INPUT_BIG_sub( _mm256_slli_epi64( db,33 ) ); \ + INPUT_BIG_sub( _mm256_slli_epi64( db,32 ) ); \ + INPUT_BIG_sub( _mm256_slli_epi64( db,31 ) ); \ + INPUT_BIG_sub( _mm256_slli_epi64( db,30 ) ); \ + INPUT_BIG_sub( _mm256_slli_epi64( db,29 ) ); \ + INPUT_BIG_sub( _mm256_slli_epi64( db,28 ) ); \ + INPUT_BIG_sub( _mm256_slli_epi64( db,27 ) ); \ + INPUT_BIG_sub( _mm256_slli_epi64( db,26 ) ); \ + INPUT_BIG_sub( _mm256_slli_epi64( db,25 ) ); \ + INPUT_BIG_sub( _mm256_slli_epi64( db,24 ) ); \ + INPUT_BIG_sub( _mm256_slli_epi64( db,23 ) ); \ + INPUT_BIG_sub( _mm256_slli_epi64( db,22 ) ); \ + INPUT_BIG_sub( _mm256_slli_epi64( db,21 ) ); \ + INPUT_BIG_sub( _mm256_slli_epi64( db,20 ) ); \ + INPUT_BIG_sub( _mm256_slli_epi64( db,19 ) ); \ + INPUT_BIG_sub( _mm256_slli_epi64( db,18 ) ); \ + INPUT_BIG_sub( _mm256_slli_epi64( db,17 ) ); \ + INPUT_BIG_sub( _mm256_slli_epi64( db,16 ) ); \ + INPUT_BIG_sub( _mm256_slli_epi64( db,15 ) ); \ + INPUT_BIG_sub( _mm256_slli_epi64( db,14 ) ); \ + INPUT_BIG_sub( _mm256_slli_epi64( db,13 ) ); \ + INPUT_BIG_sub( _mm256_slli_epi64( db,12 ) ); \ + INPUT_BIG_sub( _mm256_slli_epi64( db,11 ) ); \ + INPUT_BIG_sub( _mm256_slli_epi64( db,10 ) ); \ + INPUT_BIG_sub( _mm256_slli_epi64( db, 9 ) ); \ + INPUT_BIG_sub( _mm256_slli_epi64( db, 8 ) ); \ + INPUT_BIG_sub( _mm256_slli_epi64( db, 7 ) ); \ + INPUT_BIG_sub( _mm256_slli_epi64( db, 6 ) ); \ + INPUT_BIG_sub( _mm256_slli_epi64( db, 5 ) ); \ + INPUT_BIG_sub( _mm256_slli_epi64( db, 4 ) ); \ + INPUT_BIG_sub( _mm256_slli_epi64( db, 3 ) ); \ + INPUT_BIG_sub( _mm256_slli_epi64( db, 2 ) ); \ + INPUT_BIG_sub( _mm256_slli_epi64( db, 1 ) ); \ + INPUT_BIG_sub( db ); \ +} + +#if 0 +// dependent on the compiler unrolling the loop #define INPUT_BIG \ do { \ __m256i db = *buf; \ @@ -1180,6 +1266,7 @@ do { \ tp += 8; \ } \ } while (0) +#endif // v3 no ternary logic, 15 instructions, 9 TL equivalent instructions #define SBOX( a, b, c, d ) \ @@ -1219,7 +1306,7 @@ do { \ do { \ a = mm256_rol_32( a, 13 ); \ c = mm256_rol_32( c, 3 ); \ - b = mm256_xor3( a, b, c ); \ + b = mm256_xor3( b, a, c ); \ d = mm256_xor3( d, c, _mm256_slli_epi32( a, 3 ) ); \ b = mm256_rol_32( b, 1 ); \ d = mm256_rol_32( d, 7 ); \ @@ -1961,6 +2048,94 @@ void hamsi512_4way_close( hamsi_4way_big_context *sc, void *dst ) sc->h[6] = c6; \ sc->h[7] = c7; +#define INPUT_2x64_sub( db_i ) \ +{ \ + const v128u64_t dm = v128_cmpgt64( zero, db_i ); \ + m0 = v128_xor( m0, v128_and( dm, v128_64( tp[0] ) ) ); \ + m1 = v128_xor( m1, v128_and( dm, v128_64( tp[1] ) ) ); \ + m2 = v128_xor( m2, v128_and( dm, v128_64( tp[2] ) ) ); \ + m3 = v128_xor( m3, v128_and( dm, v128_64( tp[3] ) ) ); \ + m4 = v128_xor( m4, v128_and( dm, v128_64( tp[4] ) ) ); \ + m5 = v128_xor( m5, v128_and( dm, v128_64( tp[5] ) ) ); \ + m6 = v128_xor( m6, v128_and( dm, v128_64( tp[6] ) ) ); \ + m7 = v128_xor( m7, v128_and( dm, v128_64( tp[7] ) ) ); \ + tp += 8; \ +} + +#define INPUT_2x64 \ +{ \ + const v128u64_t db = *buf; \ + const v128u64_t zero = v128_zero; \ + const uint64_t *tp = (const uint64_t*)T512; \ + m0 = m1 = m2 = m3 = m4 = m5 = m6 = m7 = zero; \ + INPUT_2x64_sub( v128_sl64( db,63 ) ); \ + INPUT_2x64_sub( v128_sl64( db,62 ) ); \ + INPUT_2x64_sub( v128_sl64( db,61 ) ); \ + INPUT_2x64_sub( v128_sl64( db,60 ) ); \ + INPUT_2x64_sub( v128_sl64( db,59 ) ); \ + INPUT_2x64_sub( v128_sl64( db,58 ) ); \ + INPUT_2x64_sub( v128_sl64( db,57 ) ); \ + INPUT_2x64_sub( v128_sl64( db,56 ) ); \ + INPUT_2x64_sub( v128_sl64( db,55 ) ); \ + INPUT_2x64_sub( v128_sl64( db,54 ) ); \ + INPUT_2x64_sub( v128_sl64( db,53 ) ); \ + INPUT_2x64_sub( v128_sl64( db,52 ) ); \ + INPUT_2x64_sub( v128_sl64( db,51 ) ); \ + INPUT_2x64_sub( v128_sl64( db,50 ) ); \ + INPUT_2x64_sub( v128_sl64( db,49 ) ); \ + INPUT_2x64_sub( v128_sl64( db,48 ) ); \ + INPUT_2x64_sub( v128_sl64( db,47 ) ); \ + INPUT_2x64_sub( v128_sl64( db,46 ) ); \ + INPUT_2x64_sub( v128_sl64( db,45 ) ); \ + INPUT_2x64_sub( v128_sl64( db,44 ) ); \ + INPUT_2x64_sub( v128_sl64( db,43 ) ); \ + INPUT_2x64_sub( v128_sl64( db,42 ) ); \ + INPUT_2x64_sub( v128_sl64( db,41 ) ); \ + INPUT_2x64_sub( v128_sl64( db,40 ) ); \ + INPUT_2x64_sub( v128_sl64( db,39 ) ); \ + INPUT_2x64_sub( v128_sl64( db,38 ) ); \ + INPUT_2x64_sub( v128_sl64( db,37 ) ); \ + INPUT_2x64_sub( v128_sl64( db,36 ) ); \ + INPUT_2x64_sub( v128_sl64( db,35 ) ); \ + INPUT_2x64_sub( v128_sl64( db,34 ) ); \ + INPUT_2x64_sub( v128_sl64( db,33 ) ); \ + INPUT_2x64_sub( v128_sl64( db,32 ) ); \ + INPUT_2x64_sub( v128_sl64( db,31 ) ); \ + INPUT_2x64_sub( v128_sl64( db,30 ) ); \ + INPUT_2x64_sub( v128_sl64( db,29 ) ); \ + INPUT_2x64_sub( v128_sl64( db,28 ) ); \ + INPUT_2x64_sub( v128_sl64( db,27 ) ); \ + INPUT_2x64_sub( v128_sl64( db,26 ) ); \ + INPUT_2x64_sub( v128_sl64( db,25 ) ); \ + INPUT_2x64_sub( v128_sl64( db,24 ) ); \ + INPUT_2x64_sub( v128_sl64( db,23 ) ); \ + INPUT_2x64_sub( v128_sl64( db,22 ) ); \ + INPUT_2x64_sub( v128_sl64( db,21 ) ); \ + INPUT_2x64_sub( v128_sl64( db,20 ) ); \ + INPUT_2x64_sub( v128_sl64( db,19 ) ); \ + INPUT_2x64_sub( v128_sl64( db,18 ) ); \ + INPUT_2x64_sub( v128_sl64( db,17 ) ); \ + INPUT_2x64_sub( v128_sl64( db,16 ) ); \ + INPUT_2x64_sub( v128_sl64( db,15 ) ); \ + INPUT_2x64_sub( v128_sl64( db,14 ) ); \ + INPUT_2x64_sub( v128_sl64( db,13 ) ); \ + INPUT_2x64_sub( v128_sl64( db,12 ) ); \ + INPUT_2x64_sub( v128_sl64( db,11 ) ); \ + INPUT_2x64_sub( v128_sl64( db,10 ) ); \ + INPUT_2x64_sub( v128_sl64( db, 9 ) ); \ + INPUT_2x64_sub( v128_sl64( db, 8 ) ); \ + INPUT_2x64_sub( v128_sl64( db, 7 ) ); \ + INPUT_2x64_sub( v128_sl64( db, 6 ) ); \ + INPUT_2x64_sub( v128_sl64( db, 5 ) ); \ + INPUT_2x64_sub( v128_sl64( db, 4 ) ); \ + INPUT_2x64_sub( v128_sl64( db, 3 ) ); \ + INPUT_2x64_sub( v128_sl64( db, 2 ) ); \ + INPUT_2x64_sub( v128_sl64( db, 1 ) ); \ + INPUT_2x64_sub( db ); \ +} + +#if 0 +// Dependent on the compiler unrolling the loop. #define INPUT_2x64 \ { \ v128u64_t db = *buf; \ @@ -1981,6 +2156,7 @@ void hamsi512_4way_close( hamsi_4way_big_context *sc, void *dst ) tp += 8; \ } \ } +#endif // v3 no ternary logic, 15 instructions, 9 TL equivalent instructions #define SBOX_2x64( a, b, c, d ) \ @@ -2001,7 +2177,7 @@ void hamsi512_4way_close( hamsi_4way_big_context *sc, void *dst ) { \ a = v128_rol32( a, 13 ); \ c = v128_rol32( c, 3 ); \ - b = v128_xor3( a, b, c ); \ + b = v128_xor3( c, a, b ); \ d = v128_xor3( d, c, v128_sl32( a, 3 ) ); \ b = v128_rol32( b, 1 ); \ d = v128_rol32( d, 7 ); \ diff --git a/algo/simd/simd-hash-2way.c b/algo/simd/simd-hash-2way.c index a4f9d4ff..e3e32cb1 100644 --- a/algo/simd/simd-hash-2way.c +++ b/algo/simd/simd-hash-2way.c @@ -231,7 +231,7 @@ static void FFT64( void *a ) // Unrolled decimation in frequency (DIF) radix-2 NTT. // Output data is in revbin_permuted order. - static const int w[] = {0, 2, 4, 6}; +// static const int w[] = {0, 2, 4, 6}; #define BUTTERFLY_0( i,j ) \ do { \ @@ -240,25 +240,25 @@ do { \ X(i) = v128_sub16( X(i), v ); \ } while(0) -#define BUTTERFLY_N( i,j,n ) \ +#define BUTTERFLY_N( i, j, w_n ) \ do { \ v128u16_t v = X(j); \ X(j) = v128_add16( X(i), X(j) ); \ - X(i) = v128_sl16( v128_sub16( X(i), v ), w[n] ); \ + X(i) = v128_sl16( v128_sub16( X(i), v ), w_n ); \ } while(0) BUTTERFLY_0( 0, 4 ); - BUTTERFLY_N( 1, 5, 1 ); - BUTTERFLY_N( 2, 6, 2 ); - BUTTERFLY_N( 3, 7, 3 ); + BUTTERFLY_N( 1, 5, 2 ); + BUTTERFLY_N( 2, 6, 4 ); + BUTTERFLY_N( 3, 7, 6 ); DO_REDUCE( 2 ); DO_REDUCE( 3 ); BUTTERFLY_0( 0, 2 ); BUTTERFLY_0( 4, 6 ); - BUTTERFLY_N( 1, 3, 2 ); - BUTTERFLY_N( 5, 7, 2 ); + BUTTERFLY_N( 1, 3, 4 ); + BUTTERFLY_N( 5, 7, 4 ); DO_REDUCE( 1 ); @@ -329,10 +329,10 @@ do { \ } while(0) -#define BUTTERFLY_N( i,j,n ) \ +#define BUTTERFLY_N( i, j, w_n ) \ do { \ v128u16_t u = X(j); \ - X(i) = v128_sl16( X(i), w[n] ); \ + X(i) = v128_sl16( X(i), w_n ); \ X(j) = v128_sub16( X(j), X(i) ); \ X(i) = v128_add16( u, X(i) ); \ } while(0) @@ -353,15 +353,15 @@ do { \ BUTTERFLY_0( 0, 2 ); BUTTERFLY_0( 4, 6 ); - BUTTERFLY_N( 1, 3, 2 ); - BUTTERFLY_N( 5, 7, 2 ); + BUTTERFLY_N( 1, 3, 4 ); + BUTTERFLY_N( 5, 7, 4 ); DO_REDUCE( 3 ); BUTTERFLY_0( 0, 4 ); - BUTTERFLY_N( 1, 5, 1 ); - BUTTERFLY_N( 2, 6, 2 ); - BUTTERFLY_N( 3, 7, 3 ); + BUTTERFLY_N( 1, 5, 2 ); + BUTTERFLY_N( 2, 6, 4 ); + BUTTERFLY_N( 3, 7, 6 ); DO_REDUCE_FULL_S( 0 ); DO_REDUCE_FULL_S( 1 ); @@ -853,7 +853,7 @@ static void fft64_2way( void *a ) // Unrolled decimation in frequency (DIF) radix-2 NTT. // Output data is in revbin_permuted order. - static const int w[] = {0, 2, 4, 6}; +// static const int w[] = {0, 2, 4, 6}; // __m256i *Twiddle = (__m256i*)FFT64_Twiddle; @@ -864,25 +864,25 @@ do { \ X(i) = _mm256_sub_epi16( X(i), v ); \ } while(0) -#define BUTTERFLY_N( i,j,n ) \ +#define BUTTERFLY_N( i, j, w_n ) \ do { \ __m256i v = X(j); \ X(j) = _mm256_add_epi16( X(i), X(j) ); \ - X(i) = _mm256_slli_epi16( _mm256_sub_epi16( X(i), v ), w[n] ); \ + X(i) = _mm256_slli_epi16( _mm256_sub_epi16( X(i), v ), w_n ); \ } while(0) BUTTERFLY_0( 0, 4 ); - BUTTERFLY_N( 1, 5, 1 ); - BUTTERFLY_N( 2, 6, 2 ); - BUTTERFLY_N( 3, 7, 3 ); + BUTTERFLY_N( 1, 5, 2 ); + BUTTERFLY_N( 2, 6, 4 ); + BUTTERFLY_N( 3, 7, 6 ); DO_REDUCE( 2 ); DO_REDUCE( 3 ); BUTTERFLY_0( 0, 2 ); BUTTERFLY_0( 4, 6 ); - BUTTERFLY_N( 1, 3, 2 ); - BUTTERFLY_N( 5, 7, 2 ); + BUTTERFLY_N( 1, 3, 4 ); + BUTTERFLY_N( 5, 7, 4 ); DO_REDUCE( 1 ); @@ -953,10 +953,10 @@ do { \ } while(0) -#define BUTTERFLY_N( i,j,n ) \ +#define BUTTERFLY_N( i, j, w_n ) \ do { \ __m256i u = X(j); \ - X(i) = _mm256_slli_epi16( X(i), w[n] ); \ + X(i) = _mm256_slli_epi16( X(i), w_n ); \ X(j) = _mm256_sub_epi16( X(j), X(i) ); \ X(i) = _mm256_add_epi16( u, X(i) ); \ } while(0) @@ -977,15 +977,15 @@ do { \ BUTTERFLY_0( 0, 2 ); BUTTERFLY_0( 4, 6 ); - BUTTERFLY_N( 1, 3, 2 ); - BUTTERFLY_N( 5, 7, 2 ); + BUTTERFLY_N( 1, 3, 4 ); + BUTTERFLY_N( 5, 7, 4 ); DO_REDUCE( 3 ); BUTTERFLY_0( 0, 4 ); - BUTTERFLY_N( 1, 5, 1 ); - BUTTERFLY_N( 2, 6, 2 ); - BUTTERFLY_N( 3, 7, 3 ); + BUTTERFLY_N( 1, 5, 2 ); + BUTTERFLY_N( 2, 6, 4 ); + BUTTERFLY_N( 3, 7, 6 ); DO_REDUCE_FULL_S( 0 ); DO_REDUCE_FULL_S( 1 ); @@ -1709,11 +1709,11 @@ do { \ X(i) = _mm512_sub_epi16( X(i), v ); \ } while(0) -#define BUTTERFLY_N( i, j, w ) \ +#define BUTTERFLY_N( i, j, w_n ) \ do { \ __m512i v = X(j); \ X(j) = _mm512_add_epi16( X(i), X(j) ); \ - X(i) = _mm512_slli_epi16( _mm512_sub_epi16( X(i), v ), w ); \ + X(i) = _mm512_slli_epi16( _mm512_sub_epi16( X(i), v ), w_n ); \ } while(0) BUTTERFLY_0( 0, 4 ); @@ -1792,10 +1792,10 @@ do { \ } while(0) -#define BUTTERFLY_N( i, j, w ) \ +#define BUTTERFLY_N( i, j, w_n ) \ do { \ __m512i u = X(j); \ - X(i) = _mm512_slli_epi16( X(i), w ); \ + X(i) = _mm512_slli_epi16( X(i), w_n ); \ X(j) = _mm512_sub_epi16( X(j), X(i) ); \ X(i) = _mm512_add_epi16( u, X(i) ); \ } while(0) diff --git a/build-allarch.sh b/build-allarch.sh index 28f66ba9..9911d4fb 100755 --- a/build-allarch.sh +++ b/build-allarch.sh @@ -4,7 +4,7 @@ # during develpment. However the information contained may provide compilation # tips to users. -rm cpuminer-avx512-sha-vaes cpuminer-avx512 cpuminer-avx2 cpuminer-avx cpuminer-aes-sse42 cpuminer-sse42 cpuminer-ssse3 cpuminer-sse2 cpuminer-zen cpuminer-zen3 cpuminer-zen4 cpuminer-zen5 cpuminer-alderlake cpuminer-x64 cpuminer-armv8 cpuminer-armv8-aes cpuminer-armv8-sha2 cpuminer-armv8-aes-sha2 > /dev/null +rm cpuminer-arrowlake* cpuminer-graniterapids* cpuminer-avx512-sha-vaes cpuminer-avx512 cpuminer-avx2 cpuminer-avx cpuminer-aes-sse42 cpuminer-sse42 cpuminer-ssse3 cpuminer-sse2 cpuminer-zen cpuminer-zen3 cpuminer-zen4 cpuminer-zen5 cpuminer-alderlake cpuminer-x64 cpuminer-armv8 cpuminer-armv8-aes cpuminer-armv8-sha2 cpuminer-armv8-aes-sha2 > /dev/null # AVX512 SHA VAES: Intel Core Icelake, Rocketlake make distclean || echo clean @@ -18,28 +18,55 @@ strip -s cpuminer mv cpuminer cpuminer-avx512-sha-vaes # Intel Core Alderlake: AVX2 SHA VAES, needs gcc-12 -make clean || echo clean -rm -f config.status -CFLAGS="-O3 -march=alderlake -Wall" ./configure --with-curl -make -j 8 -strip -s cpuminer -mv cpuminer cpuminer-alderlake +#make clean || echo clean +#rm -f config.status +#CFLAGS="-O3 -march=alderlake -Wall" ./configure --with-curl +#make -j 8 +#strip -s cpuminer +#mv cpuminer cpuminer-alderlake -# Intel Core Arrowlake: AVX2 SHA512 VAES, needs gcc-14 +# Intel Core Arrowlake-s: AVX2 SHA512 VAES, needs gcc-14 +# Arrowlake-s includes SHA512, Arrowlake does not? #make clean || echo clean #rm -f config.status #CFLAGS="-O3 -march=arrowlake-s -Wall" ./configure --with-curl #make -j 8 #strip -s cpuminer -#mv cpuminer cpuminer-arrowlake +#mv cpuminer cpuminer-arrowlake-s + +# Intel Core Graniterapids: AVX512, SHA256, VAES, needs gcc-14 +# Apparently Granitrapids will not include AVX10, SHA512 or APX, +# wait for Diamondrapids & gcc-15. +#make clean || echo clean +#rm -f config.status +#CFLAGS="-O3 -march=graniterapids -Wall" ./configure --with-curl +#make -j 8 +#strip -s cpuminer +#mv cpuminer cpuminer-graniterapids + +# Force AVX10-256 +#make clean || echo clean +#rm -f config.status +#CFLAGS="-O3 -march=arrowlake-s -mavx10.1-256 -Wall" ./configure --with-curl +#make -j 8 +#strip -s cpuminer +#mv cpuminer cpuminer-avx10-256 + +# Force SHA512 AVX10-512 +#make clean || echo clean +#rm -f config.status +#CFLAGS="-O3 -march=graniterapids -msha512 -mavx10.1-512 -Wall" ./configure --with-curl +#make -j 8 +#strip -s cpuminer +#mv cpuminer cpuminer-avx10-512 # Zen5: AVX512 SHA VAES, requires gcc-14. #make clean || echo clean #rm -f config.status -#CFLAGS="-O3 -march=znver5" ./configure --with-curl +#CFLAGS="-O3 -march=znver5 -Wall" ./configure --with-curl #make -j $(nproc) #strip -s cpuminer -#mv cpuminer cpuminer-zen4 +#mv cpuminer cpuminer-zen5 # Zen4: AVX512 SHA VAES make clean || echo clean @@ -70,7 +97,7 @@ make -j $(nproc) strip -s cpuminer mv cpuminer cpuminer-avx512 -# AVX2 SHA VAES: generic +# AVX2 SHA VAES: generic, zen3, alderlake...arrowlake make clean || echo done rm -f config.status # vaes doesn't include aes diff --git a/clean-all.sh b/clean-all.sh index 4ad165d7..2b44b5a3 100755 --- a/clean-all.sh +++ b/clean-all.sh @@ -2,7 +2,7 @@ # # make clean and rm all the targetted executables. -rm cpuminer-avx512-sha-vaes cpuminer-alderlake cpuminer-avx512 cpuminer-avx2 cpuminer-avx cpuminer-aes-sse42 cpuminer-sse2 cpuminer-avx2-sha cpuminer-sse42 cpuminer-ssse3 cpuminer-avx2-sha-vaes cpuminer-zen3 cpuminer-zen4 cpuminer-x64 cpuminer-armv9 cpuminer-armv9-crypto cpuminer-armv9-crypto-sha3 cpuminer-armv8.4-crypto-sha3 cpuminer-armv8.5-aes-sha3-sve2 cpuminer-armv8-crypto cpuminer-armv8 > /dev/null +rm cpuminer-avx10* cpuminer-arrowlake* cpuminer-graniterapids* cpuminer-avx512-sha-vaes cpuminer-alderlake cpuminer-avx512 cpuminer-avx2 cpuminer-avx cpuminer-aes-sse42 cpuminer-sse2 cpuminer-avx2-sha cpuminer-sse42 cpuminer-ssse3 cpuminer-avx2-sha-vaes cpuminer-zen3 cpuminer-zen4 cpuminer-x64 cpuminer-armv9 cpuminer-armv9-crypto cpuminer-armv9-crypto-sha3 cpuminer-armv8.4-crypto-sha3 cpuminer-armv8.5-crypto-sha3-sve2 cpuminer-armv8-crypto cpuminer-armv8 > /dev/null rm cpuminer-avx512-sha-vaes.exe cpuminer-avx512-sha.exe cpuminer-avx512.exe cpuminer-avx2.exe cpuminer-avx.exe cpuminer-aes-sse42.exe cpuminer-sse2.exe cpuminer-avx2-sha.exe cpuminer-sse42.exe cpuminer-ssse3.exe cpuminer-avx2-sha-vaes.exe cpuminer-zen3.exe cpuminer-zen4.exe cpuminer-x64.exe > /dev/null diff --git a/configure b/configure index c20066f7..007f2d6e 100755 --- a/configure +++ b/configure @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.71 for cpuminer-opt 24.5. +# Generated by GNU Autoconf 2.71 for cpuminer-opt 24.6. # # # Copyright (C) 1992-1996, 1998-2017, 2020-2021 Free Software Foundation, @@ -608,8 +608,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='cpuminer-opt' PACKAGE_TARNAME='cpuminer-opt' -PACKAGE_VERSION='24.5' -PACKAGE_STRING='cpuminer-opt 24.5' +PACKAGE_VERSION='24.6' +PACKAGE_STRING='cpuminer-opt 24.6' PACKAGE_BUGREPORT='' PACKAGE_URL='' @@ -1360,7 +1360,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures cpuminer-opt 24.5 to adapt to many kinds of systems. +\`configure' configures cpuminer-opt 24.6 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1432,7 +1432,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of cpuminer-opt 24.5:";; + short | recursive ) echo "Configuration of cpuminer-opt 24.6:";; esac cat <<\_ACEOF @@ -1538,7 +1538,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -cpuminer-opt configure 24.5 +cpuminer-opt configure 24.6 generated by GNU Autoconf 2.71 Copyright (C) 2021 Free Software Foundation, Inc. @@ -1985,7 +1985,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by cpuminer-opt $as_me 24.5, which was +It was created by cpuminer-opt $as_me 24.6, which was generated by GNU Autoconf 2.71. Invocation command line was $ $0$ac_configure_args_raw @@ -3593,7 +3593,7 @@ fi # Define the identity of the package. PACKAGE='cpuminer-opt' - VERSION='24.5' + VERSION='24.6' printf "%s\n" "#define PACKAGE \"$PACKAGE\"" >>confdefs.h @@ -7508,7 +7508,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by cpuminer-opt $as_me 24.5, which was +This file was extended by cpuminer-opt $as_me 24.6, which was generated by GNU Autoconf 2.71. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -7576,7 +7576,7 @@ ac_cs_config_escaped=`printf "%s\n" "$ac_cs_config" | sed "s/^ //; s/'/'\\\\\\\\ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config='$ac_cs_config_escaped' ac_cs_version="\\ -cpuminer-opt config.status 24.5 +cpuminer-opt config.status 24.6 configured by $0, generated by GNU Autoconf 2.71, with options \\"\$ac_cs_config\\" diff --git a/configure.ac b/configure.ac index e6b0807a..db75565e 100644 --- a/configure.ac +++ b/configure.ac @@ -1,4 +1,4 @@ -AC_INIT([cpuminer-opt], [24.5]) +AC_INIT([cpuminer-opt], [24.6]) AC_PREREQ([2.59c]) AC_CANONICAL_SYSTEM diff --git a/configure~ b/configure~ index 859346d4..c240468c 100755 --- a/configure~ +++ b/configure~ @@ -1,9 +1,9 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.71 for cpuminer-opt 24.4. +# Generated by GNU Autoconf 2.72 for cpuminer-opt 24.6. # # -# Copyright (C) 1992-1996, 1998-2017, 2020-2021 Free Software Foundation, +# Copyright (C) 1992-1996, 1998-2017, 2020-2023 Free Software Foundation, # Inc. # # @@ -15,7 +15,6 @@ # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh -as_nop=: if test ${ZSH_VERSION+y} && (emulate sh) >/dev/null 2>&1 then : emulate sh @@ -24,12 +23,13 @@ then : # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST -else $as_nop - case `(set -o) 2>/dev/null` in #( +else case e in #( + e) case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( *) : ;; +esac ;; esac fi @@ -101,7 +101,7 @@ IFS=$as_save_IFS ;; esac -# We did not find ourselves, most probably we were run as `sh COMMAND' +# We did not find ourselves, most probably we were run as 'sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 @@ -131,15 +131,14 @@ case $- in # (((( esac exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} # Admittedly, this is quite paranoid, since all the known shells bail -# out after a failed `exec'. +# out after a failed 'exec'. printf "%s\n" "$0: could not re-execute with $CONFIG_SHELL" >&2 exit 255 fi # We don't want this to propagate to other subprocesses. { _as_can_reexec=; unset _as_can_reexec;} if test "x$CONFIG_SHELL" = x; then - as_bourne_compatible="as_nop=: -if test \${ZSH_VERSION+y} && (emulate sh) >/dev/null 2>&1 + as_bourne_compatible="if test \${ZSH_VERSION+y} && (emulate sh) >/dev/null 2>&1 then : emulate sh NULLCMD=: @@ -147,12 +146,13 @@ then : # is contrary to our usage. Disable this feature. alias -g '\${1+\"\$@\"}'='\"\$@\"' setopt NO_GLOB_SUBST -else \$as_nop - case \`(set -o) 2>/dev/null\` in #( +else case e in #( + e) case \`(set -o) 2>/dev/null\` in #( *posix*) : set -o posix ;; #( *) : ;; +esac ;; esac fi " @@ -170,8 +170,9 @@ as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; } if ( set x; as_fn_ret_success y && test x = \"\$1\" ) then : -else \$as_nop - exitcode=1; echo positional parameters were not saved. +else case e in #( + e) exitcode=1; echo positional parameters were not saved. ;; +esac fi test x\$exitcode = x0 || exit 1 blah=\$(echo \$(echo blah)) @@ -185,14 +186,15 @@ test \$(( 1 + 1 )) = 2 || exit 1" if (eval "$as_required") 2>/dev/null then : as_have_required=yes -else $as_nop - as_have_required=no +else case e in #( + e) as_have_required=no ;; +esac fi if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null then : -else $as_nop - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +else case e in #( + e) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR as_found=false for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do @@ -225,12 +227,13 @@ IFS=$as_save_IFS if $as_found then : -else $as_nop - if { test -f "$SHELL" || test -f "$SHELL.exe"; } && +else case e in #( + e) if { test -f "$SHELL" || test -f "$SHELL.exe"; } && as_run=a "$SHELL" -c "$as_bourne_compatible""$as_required" 2>/dev/null then : CONFIG_SHELL=$SHELL as_have_required=yes -fi +fi ;; +esac fi @@ -252,7 +255,7 @@ case $- in # (((( esac exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} # Admittedly, this is quite paranoid, since all the known shells bail -# out after a failed `exec'. +# out after a failed 'exec'. printf "%s\n" "$0: could not re-execute with $CONFIG_SHELL" >&2 exit 255 fi @@ -271,7 +274,8 @@ $0: message. Then install a modern shell, or manually run $0: the script under such a shell if you do have one." fi exit 1 -fi +fi ;; +esac fi fi SHELL=${CONFIG_SHELL-/bin/sh} @@ -310,14 +314,6 @@ as_fn_exit () as_fn_set_status $1 exit $1 } # as_fn_exit -# as_fn_nop -# --------- -# Do nothing but, unlike ":", preserve the value of $?. -as_fn_nop () -{ - return $? -} -as_nop=as_fn_nop # as_fn_mkdir_p # ------------- @@ -386,11 +382,12 @@ then : { eval $1+=\$2 }' -else $as_nop - as_fn_append () +else case e in #( + e) as_fn_append () { eval $1=\$$1\$2 - } + } ;; +esac fi # as_fn_append # as_fn_arith ARG... @@ -404,21 +401,14 @@ then : { as_val=$(( $* )) }' -else $as_nop - as_fn_arith () +else case e in #( + e) as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` - } + } ;; +esac fi # as_fn_arith -# as_fn_nop -# --------- -# Do nothing but, unlike ":", preserve the value of $?. -as_fn_nop () -{ - return $? -} -as_nop=as_fn_nop # as_fn_error STATUS ERROR [LINENO LOG_FD] # ---------------------------------------- @@ -492,6 +482,8 @@ as_cr_alnum=$as_cr_Letters$as_cr_digits /[$]LINENO/= ' <$as_myself | sed ' + t clear + :clear s/[$]LINENO.*/&-/ t lineno b @@ -540,7 +532,6 @@ esac as_echo='printf %s\n' as_echo_n='printf %s' - rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file @@ -552,9 +543,9 @@ if (echo >conf$$.file) 2>/dev/null; then if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: - # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. - # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. - # In both cases, we have to default to `cp -pR'. + # 1) On MSYS, both 'ln -s file dir' and 'ln file dir' fail. + # 2) DJGPP < 2.04 has no symlinks; 'ln -s' creates a wrapper executable. + # In both cases, we have to default to 'cp -pR'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then @@ -579,10 +570,12 @@ as_test_x='test -x' as_executable_p=as_fn_executable_p # Sed expression to map a string onto a valid CPP name. -as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" +as_sed_cpp="y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g" +as_tr_cpp="eval sed '$as_sed_cpp'" # deprecated # Sed expression to map a string onto a valid variable name. -as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" +as_sed_sh="y%*+%pp%;s%[^_$as_cr_alnum]%_%g" +as_tr_sh="eval sed '$as_sed_sh'" # deprecated test -n "$DJDIR" || exec 7<&0 /dev/null && - as_fn_error $? "invalid feature name: \`$ac_useropt'" + as_fn_error $? "invalid feature name: '$ac_useropt'" ac_useropt_orig=$ac_useropt ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in @@ -946,7 +937,7 @@ do ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - as_fn_error $? "invalid feature name: \`$ac_useropt'" + as_fn_error $? "invalid feature name: '$ac_useropt'" ac_useropt_orig=$ac_useropt ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in @@ -1159,7 +1150,7 @@ do ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - as_fn_error $? "invalid package name: \`$ac_useropt'" + as_fn_error $? "invalid package name: '$ac_useropt'" ac_useropt_orig=$ac_useropt ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in @@ -1175,7 +1166,7 @@ do ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - as_fn_error $? "invalid package name: \`$ac_useropt'" + as_fn_error $? "invalid package name: '$ac_useropt'" ac_useropt_orig=$ac_useropt ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in @@ -1205,8 +1196,8 @@ do | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) x_libraries=$ac_optarg ;; - -*) as_fn_error $? "unrecognized option: \`$ac_option' -Try \`$0 --help' for more information" + -*) as_fn_error $? "unrecognized option: '$ac_option' +Try '$0 --help' for more information" ;; *=*) @@ -1214,7 +1205,7 @@ Try \`$0 --help' for more information" # Reject names that are not valid shell variable names. case $ac_envvar in #( '' | [0-9]* | *[!_$as_cr_alnum]* ) - as_fn_error $? "invalid variable name: \`$ac_envvar'" ;; + as_fn_error $? "invalid variable name: '$ac_envvar'" ;; esac eval $ac_envvar=\$ac_optarg export $ac_envvar ;; @@ -1264,7 +1255,7 @@ do as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val" done -# There might be people who depend on the old broken behavior: `$host' +# There might be people who depend on the old broken behavior: '$host' # used to hold the argument of --host etc. # FIXME: To remove some day. build=$build_alias @@ -1332,7 +1323,7 @@ if test ! -r "$srcdir/$ac_unique_file"; then test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir" fi -ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" +ac_msg="sources are in $srcdir, but 'cd $srcdir' does not work" ac_abs_confdir=`( cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg" pwd)` @@ -1360,7 +1351,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures cpuminer-opt 24.4 to adapt to many kinds of systems. +'configure' configures cpuminer-opt 24.6 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1374,11 +1365,11 @@ Configuration: --help=short display options specific to this package --help=recursive display the short help of all the included packages -V, --version display version information and exit - -q, --quiet, --silent do not print \`checking ...' messages + -q, --quiet, --silent do not print 'checking ...' messages --cache-file=FILE cache test results in FILE [disabled] - -C, --config-cache alias for \`--cache-file=config.cache' + -C, --config-cache alias for '--cache-file=config.cache' -n, --no-create do not create output files - --srcdir=DIR find the sources in DIR [configure dir or \`..'] + --srcdir=DIR find the sources in DIR [configure dir or '..'] Installation directories: --prefix=PREFIX install architecture-independent files in PREFIX @@ -1386,10 +1377,10 @@ Installation directories: --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX [PREFIX] -By default, \`make install' will install all the files in -\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify -an installation prefix other than \`$ac_default_prefix' using \`--prefix', -for instance \`--prefix=\$HOME'. +By default, 'make install' will install all the files in +'$ac_default_prefix/bin', '$ac_default_prefix/lib' etc. You can specify +an installation prefix other than '$ac_default_prefix' using '--prefix', +for instance '--prefix=\$HOME'. For better control, use the options below. @@ -1432,7 +1423,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of cpuminer-opt 24.4:";; + short | recursive ) echo "Configuration of cpuminer-opt 24.6:";; esac cat <<\_ACEOF @@ -1465,13 +1456,12 @@ Some influential environment variables: LIBS libraries to pass to the linker, e.g. -l CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I if you have headers in a nonstandard directory - CPP C preprocessor CCAS assembler compiler command (defaults to CC) CCASFLAGS assembler compiler flags (defaults to CFLAGS) CXX C++ compiler command CXXFLAGS C++ compiler flags -Use these variables to override the choices made by `configure' or to help +Use these variables to override the choices made by 'configure' or to help it to find libraries and programs with nonstandard names/locations. Report bugs to the package provider. @@ -1538,10 +1528,10 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -cpuminer-opt configure 24.4 -generated by GNU Autoconf 2.71 +cpuminer-opt configure 24.6 +generated by GNU Autoconf 2.72 -Copyright (C) 2021 Free Software Foundation, Inc. +Copyright (C) 2023 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. _ACEOF @@ -1580,54 +1570,17 @@ printf "%s\n" "$ac_try_echo"; } >&5 } && test -s conftest.$ac_objext then : ac_retval=0 -else $as_nop - printf "%s\n" "$as_me: failed program was:" >&5 +else case e in #( + e) printf "%s\n" "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_retval=1 -fi - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno - as_fn_set_status $ac_retval - -} # ac_fn_c_try_compile - -# ac_fn_c_try_cpp LINENO -# ---------------------- -# Try to preprocess conftest.$ac_ext, and return whether this succeeded. -ac_fn_c_try_cpp () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - if { { ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; + ac_retval=1 ;; esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -printf "%s\n" "$ac_try_echo"; } >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err - ac_status=$? - if test -s conftest.err; then - grep -v '^ *+' conftest.err >conftest.er1 - cat conftest.er1 >&5 - mv -f conftest.er1 conftest.err - fi - printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } > conftest.i && { - test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || - test ! -s conftest.err - } -then : - ac_retval=0 -else $as_nop - printf "%s\n" "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_retval=1 fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval -} # ac_fn_c_try_cpp +} # ac_fn_c_try_compile # ac_fn_cxx_try_compile LINENO # ---------------------------- @@ -1657,11 +1610,12 @@ printf "%s\n" "$ac_try_echo"; } >&5 } && test -s conftest.$ac_objext then : ac_retval=0 -else $as_nop - printf "%s\n" "$as_me: failed program was:" >&5 +else case e in #( + e) printf "%s\n" "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_retval=1 + ac_retval=1 ;; +esac fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval @@ -1680,8 +1634,8 @@ printf %s "checking for $2... " >&6; } if eval test \${$3+y} then : printf %s "(cached) " >&6 -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 #include <$2> @@ -1689,10 +1643,12 @@ _ACEOF if ac_fn_c_try_compile "$LINENO" then : eval "$3=yes" -else $as_nop - eval "$3=no" +else case e in #( + e) eval "$3=no" ;; +esac fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac fi eval ac_res=\$$3 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 @@ -1714,8 +1670,8 @@ printf %s "checking whether $as_decl_name is declared... " >&6; } if eval test \${$3+y} then : printf %s "(cached) " >&6 -else $as_nop - as_decl_use=`echo $2|sed -e 's/(/((/' -e 's/)/) 0&/' -e 's/,/) 0& (/g'` +else case e in #( + e) as_decl_use=`echo $2|sed -e 's/(/((/' -e 's/)/) 0&/' -e 's/,/) 0& (/g'` eval ac_save_FLAGS=\$$6 as_fn_append $6 " $5" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -1739,12 +1695,14 @@ _ACEOF if ac_fn_c_try_compile "$LINENO" then : eval "$3=yes" -else $as_nop - eval "$3=no" +else case e in #( + e) eval "$3=no" ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext eval $6=\$ac_save_FLAGS - + ;; +esac fi eval ac_res=\$$3 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 @@ -1765,8 +1723,8 @@ printf %s "checking for $2... " >&6; } if eval test \${$3+y} then : printf %s "(cached) " >&6 -else $as_nop - eval "$3=no" +else case e in #( + e) eval "$3=no" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 @@ -1796,12 +1754,14 @@ _ACEOF if ac_fn_c_try_compile "$LINENO" then : -else $as_nop - eval "$3=yes" +else case e in #( + e) eval "$3=yes" ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac fi eval ac_res=\$$3 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 @@ -1841,11 +1801,12 @@ printf "%s\n" "$ac_try_echo"; } >&5 } then : ac_retval=0 -else $as_nop - printf "%s\n" "$as_me: failed program was:" >&5 +else case e in #( + e) printf "%s\n" "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_retval=1 + ac_retval=1 ;; +esac fi # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would @@ -1887,12 +1848,13 @@ printf "%s\n" "$ac_try_echo"; } >&5 test $ac_status = 0; }; } then : ac_retval=0 -else $as_nop - printf "%s\n" "$as_me: program exited with status $ac_status" >&5 +else case e in #( + e) printf "%s\n" "$as_me: program exited with status $ac_status" >&5 printf "%s\n" "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_retval=$ac_status + ac_retval=$ac_status ;; +esac fi rm -rf conftest.dSYM conftest_ipa8_conftest.oo eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno @@ -1911,15 +1873,15 @@ printf %s "checking for $2... " >&6; } if eval test \${$3+y} then : printf %s "(cached) " >&6 -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Define $2 to an innocuous variant, in case declares $2. For example, HP-UX 11i declares gettimeofday. */ #define $2 innocuous_$2 /* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $2 (); below. */ + which can conflict with char $2 (void); below. */ #include #undef $2 @@ -1930,7 +1892,7 @@ else $as_nop #ifdef __cplusplus extern "C" #endif -char $2 (); +char $2 (void); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ @@ -1949,11 +1911,13 @@ _ACEOF if ac_fn_c_try_link "$LINENO" then : eval "$3=yes" -else $as_nop - eval "$3=no" +else case e in #( + e) eval "$3=no" ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext + conftest$ac_exeext conftest.$ac_ext ;; +esac fi eval ac_res=\$$3 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 @@ -1985,8 +1949,8 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by cpuminer-opt $as_me 24.4, which was -generated by GNU Autoconf 2.71. Invocation command line was +It was created by cpuminer-opt $as_me 24.6, which was +generated by GNU Autoconf 2.72. Invocation command line was $ $0$ac_configure_args_raw @@ -2232,10 +2196,10 @@ esac printf "%s\n" "$as_me: loading site script $ac_site_file" >&6;} sed 's/^/| /' "$ac_site_file" >&5 . "$ac_site_file" \ - || { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} + || { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} as_fn_error $? "failed to load site script $ac_site_file -See \`config.log' for more details" "$LINENO" 5; } +See 'config.log' for more details" "$LINENO" 5; } fi done @@ -2271,9 +2235,7 @@ struct stat; /* Most of the following tests are stolen from RCS 5.7 src/conf.sh. */ struct buf { int x; }; struct buf * (*rcsopen) (struct buf *, struct stat *, int); -static char *e (p, i) - char **p; - int i; +static char *e (char **p, int i) { return p[i]; } @@ -2287,6 +2249,21 @@ static char *f (char * (*g) (char **, int), char **p, ...) return s; } +/* C89 style stringification. */ +#define noexpand_stringify(a) #a +const char *stringified = noexpand_stringify(arbitrary+token=sequence); + +/* C89 style token pasting. Exercises some of the corner cases that + e.g. old MSVC gets wrong, but not very hard. */ +#define noexpand_concat(a,b) a##b +#define expand_concat(a,b) noexpand_concat(a,b) +extern int vA; +extern int vbee; +#define aye A +#define bee B +int *pvA = &expand_concat(v,aye); +int *pvbee = &noexpand_concat(v,bee); + /* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has function prototypes and stuff, but not \xHH hex character constants. These do not provoke an error unfortunately, instead are silently treated @@ -2314,16 +2291,19 @@ ok |= (argc == 0 || f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]); # Test code for whether the C compiler supports C99 (global declarations) ac_c_conftest_c99_globals=' -// Does the compiler advertise C99 conformance? +/* Does the compiler advertise C99 conformance? */ #if !defined __STDC_VERSION__ || __STDC_VERSION__ < 199901L # error "Compiler does not advertise C99 conformance" #endif +// See if C++-style comments work. + #include extern int puts (const char *); extern int printf (const char *, ...); extern int dprintf (int, const char *, ...); extern void *malloc (size_t); +extern void free (void *); // Check varargs macros. These examples are taken from C99 6.10.3.5. // dprintf is used instead of fprintf to avoid needing to declare @@ -2373,7 +2353,6 @@ typedef const char *ccp; static inline int test_restrict (ccp restrict text) { - // See if C++-style comments work. // Iterate through items via the restricted pointer. // Also check for declarations in for loops. for (unsigned int i = 0; *(text+i) != '\''\0'\''; ++i) @@ -2439,6 +2418,8 @@ ac_c_conftest_c99_main=' ia->datasize = 10; for (int i = 0; i < ia->datasize; ++i) ia->data[i] = i * 1.234; + // Work around memory leak warnings. + free (ia); // Check named initializers. struct named_init ni = { @@ -2460,7 +2441,7 @@ ac_c_conftest_c99_main=' # Test code for whether the C compiler supports C11 (global declarations) ac_c_conftest_c11_globals=' -// Does the compiler advertise C11 conformance? +/* Does the compiler advertise C11 conformance? */ #if !defined __STDC_VERSION__ || __STDC_VERSION__ < 201112L # error "Compiler does not advertise C11 conformance" #endif @@ -2868,8 +2849,9 @@ IFS=$as_save_IFS if $as_found then : -else $as_nop - as_fn_error $? "cannot find required auxiliary files:$ac_missing_aux_files" "$LINENO" 5 +else case e in #( + e) as_fn_error $? "cannot find required auxiliary files:$ac_missing_aux_files" "$LINENO" 5 ;; +esac fi @@ -2897,12 +2879,12 @@ for ac_var in $ac_precious_vars; do eval ac_new_val=\$ac_env_${ac_var}_value case $ac_old_set,$ac_new_set in set,) - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 -printf "%s\n" "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: '$ac_var' was set to '$ac_old_val' in the previous run" >&5 +printf "%s\n" "$as_me: error: '$ac_var' was set to '$ac_old_val' in the previous run" >&2;} ac_cache_corrupted=: ;; ,set) - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5 -printf "%s\n" "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: '$ac_var' was not set in the previous run" >&5 +printf "%s\n" "$as_me: error: '$ac_var' was not set in the previous run" >&2;} ac_cache_corrupted=: ;; ,);; *) @@ -2911,18 +2893,18 @@ printf "%s\n" "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} ac_old_val_w=`echo x $ac_old_val` ac_new_val_w=`echo x $ac_new_val` if test "$ac_old_val_w" != "$ac_new_val_w"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5 -printf "%s\n" "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: '$ac_var' has changed since the previous run:" >&5 +printf "%s\n" "$as_me: error: '$ac_var' has changed since the previous run:" >&2;} ac_cache_corrupted=: else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 -printf "%s\n" "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in '$ac_var' since the previous run:" >&5 +printf "%s\n" "$as_me: warning: ignoring whitespace changes in '$ac_var' since the previous run:" >&2;} eval $ac_var=\$ac_old_val fi - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5 -printf "%s\n" "$as_me: former value: \`$ac_old_val'" >&2;} - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5 -printf "%s\n" "$as_me: current value: \`$ac_new_val'" >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: former value: '$ac_old_val'" >&5 +printf "%s\n" "$as_me: former value: '$ac_old_val'" >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: current value: '$ac_new_val'" >&5 +printf "%s\n" "$as_me: current value: '$ac_new_val'" >&2;} fi;; esac # Pass precious variables to config.status. @@ -2938,11 +2920,11 @@ printf "%s\n" "$as_me: current value: \`$ac_new_val'" >&2;} fi done if $ac_cache_corrupted; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 printf "%s\n" "$as_me: error: changes in the environment can compromise the build" >&2;} - as_fn_error $? "run \`${MAKE-make} distclean' and/or \`rm $cache_file' + as_fn_error $? "run '${MAKE-make} distclean' and/or 'rm $cache_file' and start over" "$LINENO" 5 fi ## -------------------- ## @@ -2970,15 +2952,16 @@ printf %s "checking build system type... " >&6; } if test ${ac_cv_build+y} then : printf %s "(cached) " >&6 -else $as_nop - ac_build_alias=$build_alias +else case e in #( + e) ac_build_alias=$build_alias test "x$ac_build_alias" = x && ac_build_alias=`$SHELL "${ac_aux_dir}config.guess"` test "x$ac_build_alias" = x && as_fn_error $? "cannot guess build type; you must specify one" "$LINENO" 5 ac_cv_build=`$SHELL "${ac_aux_dir}config.sub" $ac_build_alias` || as_fn_error $? "$SHELL ${ac_aux_dir}config.sub $ac_build_alias failed" "$LINENO" 5 - + ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5 printf "%s\n" "$ac_cv_build" >&6; } @@ -3005,14 +2988,15 @@ printf %s "checking host system type... " >&6; } if test ${ac_cv_host+y} then : printf %s "(cached) " >&6 -else $as_nop - if test "x$host_alias" = x; then +else case e in #( + e) if test "x$host_alias" = x; then ac_cv_host=$ac_cv_build else ac_cv_host=`$SHELL "${ac_aux_dir}config.sub" $host_alias` || as_fn_error $? "$SHELL ${ac_aux_dir}config.sub $host_alias failed" "$LINENO" 5 fi - + ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5 printf "%s\n" "$ac_cv_host" >&6; } @@ -3039,14 +3023,15 @@ printf %s "checking target system type... " >&6; } if test ${ac_cv_target+y} then : printf %s "(cached) " >&6 -else $as_nop - if test "x$target_alias" = x; then +else case e in #( + e) if test "x$target_alias" = x; then ac_cv_target=$ac_cv_host else ac_cv_target=`$SHELL "${ac_aux_dir}config.sub" $target_alias` || as_fn_error $? "$SHELL ${ac_aux_dir}config.sub $target_alias failed" "$LINENO" 5 fi - + ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_target" >&5 printf "%s\n" "$ac_cv_target" >&6; } @@ -3103,8 +3088,8 @@ if test -z "$INSTALL"; then if test ${ac_cv_path_install+y} then : printf %s "(cached) " >&6 -else $as_nop - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +else case e in #( + e) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS @@ -3158,7 +3143,8 @@ esac IFS=$as_save_IFS rm -rf conftest.one conftest.two conftest.dir - + ;; +esac fi if test ${ac_cv_path_install+y}; then INSTALL=$ac_cv_path_install @@ -3254,7 +3240,7 @@ test "$program_prefix" != NONE && test "$program_suffix" != NONE && program_transform_name="s&\$&$program_suffix&;$program_transform_name" # Double any \ or $. -# By default was `s,x,x', remove it if useless. +# By default was 's,x,x', remove it if useless. ac_script='s/[\\$]/&&/g;s/;s,x,x,$//' program_transform_name=`printf "%s\n" "$program_transform_name" | sed "$ac_script"` @@ -3297,8 +3283,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_STRIP+y} then : printf %s "(cached) " >&6 -else $as_nop - if test -n "$STRIP"; then +else case e in #( + e) if test -n "$STRIP"; then ac_cv_prog_STRIP="$STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -3320,7 +3306,8 @@ done done IFS=$as_save_IFS -fi +fi ;; +esac fi STRIP=$ac_cv_prog_STRIP if test -n "$STRIP"; then @@ -3342,8 +3329,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_STRIP+y} then : printf %s "(cached) " >&6 -else $as_nop - if test -n "$ac_ct_STRIP"; then +else case e in #( + e) if test -n "$ac_ct_STRIP"; then ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -3365,7 +3352,8 @@ done done IFS=$as_save_IFS -fi +fi ;; +esac fi ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP if test -n "$ac_ct_STRIP"; then @@ -3401,8 +3389,8 @@ if test -z "$MKDIR_P"; then if test ${ac_cv_path_mkdir+y} then : printf %s "(cached) " >&6 -else $as_nop - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +else case e in #( + e) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin do IFS=$as_save_IFS @@ -3416,7 +3404,7 @@ do as_fn_executable_p "$as_dir$ac_prog$ac_exec_ext" || continue case `"$as_dir$ac_prog$ac_exec_ext" --version 2>&1` in #( 'mkdir ('*'coreutils) '* | \ - 'BusyBox '* | \ + *'BusyBox '* | \ 'mkdir (fileutils) '4.1*) ac_cv_path_mkdir=$as_dir$ac_prog$ac_exec_ext break 3;; @@ -3425,18 +3413,17 @@ do done done IFS=$as_save_IFS - + ;; +esac fi test -d ./--version && rmdir ./--version if test ${ac_cv_path_mkdir+y}; then MKDIR_P="$ac_cv_path_mkdir -p" else - # As a last resort, use the slow shell script. Don't cache a - # value for MKDIR_P within a source directory, because that will - # break other packages using the cache if that directory is - # removed, or if the value is a relative name. - MKDIR_P="$ac_install_sh -d" + # As a last resort, use plain mkdir -p, + # in the hope it doesn't have the bugs of ancient mkdir. + MKDIR_P='mkdir -p' fi fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5 @@ -3451,8 +3438,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_AWK+y} then : printf %s "(cached) " >&6 -else $as_nop - if test -n "$AWK"; then +else case e in #( + e) if test -n "$AWK"; then ac_cv_prog_AWK="$AWK" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -3474,7 +3461,8 @@ done done IFS=$as_save_IFS -fi +fi ;; +esac fi AWK=$ac_cv_prog_AWK if test -n "$AWK"; then @@ -3496,8 +3484,8 @@ ac_make=`printf "%s\n" "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` if eval test \${ac_cv_prog_make_${ac_make}_set+y} then : printf %s "(cached) " >&6 -else $as_nop - cat >conftest.make <<\_ACEOF +else case e in #( + e) cat >conftest.make <<\_ACEOF SHELL = /bin/sh all: @echo '@@@%%%=$(MAKE)=@@@%%%' @@ -3509,7 +3497,8 @@ case `${MAKE-make} -f conftest.make 2>/dev/null` in *) eval ac_cv_prog_make_${ac_make}_set=no;; esac -rm -f conftest.make +rm -f conftest.make ;; +esac fi if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 @@ -3547,8 +3536,8 @@ printf %s "checking whether $am_make supports nested variables... " >&6; } if test ${am_cv_make_support_nested_variables+y} then : printf %s "(cached) " >&6 -else $as_nop - if printf "%s\n" 'TRUE=$(BAR$(V)) +else case e in #( + e) if printf "%s\n" 'TRUE=$(BAR$(V)) BAR0=false BAR1=true V=1 @@ -3558,7 +3547,8 @@ am__doit: am_cv_make_support_nested_variables=yes else am_cv_make_support_nested_variables=no -fi +fi ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_make_support_nested_variables" >&5 printf "%s\n" "$am_cv_make_support_nested_variables" >&6; } @@ -3593,7 +3583,7 @@ fi # Define the identity of the package. PACKAGE='cpuminer-opt' - VERSION='24.4' + VERSION='24.6' printf "%s\n" "#define PACKAGE \"$PACKAGE\"" >>confdefs.h @@ -3704,8 +3694,9 @@ printf %s "checking whether to enable maintainer-specific portions of Makefiles. if test ${enable_maintainer_mode+y} then : enableval=$enable_maintainer_mode; USE_MAINTAINER_MODE=$enableval -else $as_nop - USE_MAINTAINER_MODE=no +else case e in #( + e) USE_MAINTAINER_MODE=no ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $USE_MAINTAINER_MODE" >&5 @@ -3808,8 +3799,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_CC+y} then : printf %s "(cached) " >&6 -else $as_nop - if test -n "$CC"; then +else case e in #( + e) if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -3831,7 +3822,8 @@ done done IFS=$as_save_IFS -fi +fi ;; +esac fi CC=$ac_cv_prog_CC if test -n "$CC"; then @@ -3853,8 +3845,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_CC+y} then : printf %s "(cached) " >&6 -else $as_nop - if test -n "$ac_ct_CC"; then +else case e in #( + e) if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -3876,7 +3868,8 @@ done done IFS=$as_save_IFS -fi +fi ;; +esac fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then @@ -3911,8 +3904,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_CC+y} then : printf %s "(cached) " >&6 -else $as_nop - if test -n "$CC"; then +else case e in #( + e) if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -3934,7 +3927,8 @@ done done IFS=$as_save_IFS -fi +fi ;; +esac fi CC=$ac_cv_prog_CC if test -n "$CC"; then @@ -3956,8 +3950,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_CC+y} then : printf %s "(cached) " >&6 -else $as_nop - if test -n "$CC"; then +else case e in #( + e) if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else ac_prog_rejected=no @@ -3996,7 +3990,8 @@ if test $ac_prog_rejected = yes; then ac_cv_prog_CC="$as_dir$ac_word${1+' '}$@" fi fi -fi +fi ;; +esac fi CC=$ac_cv_prog_CC if test -n "$CC"; then @@ -4020,8 +4015,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_CC+y} then : printf %s "(cached) " >&6 -else $as_nop - if test -n "$CC"; then +else case e in #( + e) if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -4043,7 +4038,8 @@ done done IFS=$as_save_IFS -fi +fi ;; +esac fi CC=$ac_cv_prog_CC if test -n "$CC"; then @@ -4069,8 +4065,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_CC+y} then : printf %s "(cached) " >&6 -else $as_nop - if test -n "$ac_ct_CC"; then +else case e in #( + e) if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -4092,7 +4088,8 @@ done done IFS=$as_save_IFS -fi +fi ;; +esac fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then @@ -4130,8 +4127,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_CC+y} then : printf %s "(cached) " >&6 -else $as_nop - if test -n "$CC"; then +else case e in #( + e) if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -4153,7 +4150,8 @@ done done IFS=$as_save_IFS -fi +fi ;; +esac fi CC=$ac_cv_prog_CC if test -n "$CC"; then @@ -4175,8 +4173,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_CC+y} then : printf %s "(cached) " >&6 -else $as_nop - if test -n "$ac_ct_CC"; then +else case e in #( + e) if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -4198,7 +4196,8 @@ done done IFS=$as_save_IFS -fi +fi ;; +esac fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then @@ -4227,10 +4226,10 @@ fi fi -test -z "$CC" && { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} +test -z "$CC" && { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} as_fn_error $? "no acceptable C compiler found in \$PATH -See \`config.log' for more details" "$LINENO" 5; } +See 'config.log' for more details" "$LINENO" 5; } # Provide some information about the compiler. printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 @@ -4302,8 +4301,8 @@ printf "%s\n" "$ac_try_echo"; } >&5 printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } then : - # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. -# So ignore a value of `no', otherwise this would lead to `EXEEXT = no' + # Autoconf-2.13 could set the ac_cv_exeext variable to 'no'. +# So ignore a value of 'no', otherwise this would lead to 'EXEEXT = no' # in a Makefile. We should not override ac_cv_exeext if it was cached, # so that the user can short-circuit this test for compilers unknown to # Autoconf. @@ -4323,7 +4322,7 @@ do ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` fi # We set ac_cv_exeext here because the later test for it is not - # safe: cross compilers may not add the suffix if given an `-o' + # safe: cross compilers may not add the suffix if given an '-o' # argument, so we may need to know it at that point already. # Even if this section looks crufty: it has the advantage of # actually working. @@ -4334,8 +4333,9 @@ do done test "$ac_cv_exeext" = no && ac_cv_exeext= -else $as_nop - ac_file='' +else case e in #( + e) ac_file='' ;; +esac fi if test -z "$ac_file" then : @@ -4344,13 +4344,14 @@ printf "%s\n" "no" >&6; } printf "%s\n" "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -{ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} +{ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} as_fn_error 77 "C compiler cannot create executables -See \`config.log' for more details" "$LINENO" 5; } -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -printf "%s\n" "yes" >&6; } +See 'config.log' for more details" "$LINENO" 5; } +else case e in #( + e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5 printf %s "checking for C compiler default output file name... " >&6; } @@ -4374,10 +4375,10 @@ printf "%s\n" "$ac_try_echo"; } >&5 printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } then : - # If both `conftest.exe' and `conftest' are `present' (well, observable) -# catch `conftest.exe'. For instance with Cygwin, `ls conftest' will -# work properly (i.e., refer to `conftest.exe'), while it won't with -# `rm'. + # If both 'conftest.exe' and 'conftest' are 'present' (well, observable) +# catch 'conftest.exe'. For instance with Cygwin, 'ls conftest' will +# work properly (i.e., refer to 'conftest.exe'), while it won't with +# 'rm'. for ac_file in conftest.exe conftest conftest.*; do test -f "$ac_file" || continue case $ac_file in @@ -4387,11 +4388,12 @@ for ac_file in conftest.exe conftest conftest.*; do * ) break;; esac done -else $as_nop - { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} +else case e in #( + e) { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} as_fn_error $? "cannot compute suffix of executables: cannot compile and link -See \`config.log' for more details" "$LINENO" 5; } +See 'config.log' for more details" "$LINENO" 5; } ;; +esac fi rm -f conftest conftest$ac_cv_exeext { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 @@ -4407,6 +4409,8 @@ int main (void) { FILE *f = fopen ("conftest.out", "w"); + if (!f) + return 1; return ferror (f) || fclose (f) != 0; ; @@ -4446,26 +4450,27 @@ printf "%s\n" "$ac_try_echo"; } >&5 if test "$cross_compiling" = maybe; then cross_compiling=yes else - { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} as_fn_error 77 "cannot run C compiled programs. -If you meant to cross compile, use \`--host'. -See \`config.log' for more details" "$LINENO" 5; } +If you meant to cross compile, use '--host'. +See 'config.log' for more details" "$LINENO" 5; } fi fi fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 printf "%s\n" "$cross_compiling" >&6; } -rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out +rm -f conftest.$ac_ext conftest$ac_cv_exeext \ + conftest.o conftest.obj conftest.out ac_clean_files=$ac_clean_files_save { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 printf %s "checking for suffix of object files... " >&6; } if test ${ac_cv_objext+y} then : printf %s "(cached) " >&6 -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int @@ -4497,16 +4502,18 @@ then : break;; esac done -else $as_nop - printf "%s\n" "$as_me: failed program was:" >&5 +else case e in #( + e) printf "%s\n" "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -{ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} +{ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} as_fn_error $? "cannot compute suffix of object files: cannot compile -See \`config.log' for more details" "$LINENO" 5; } +See 'config.log' for more details" "$LINENO" 5; } ;; +esac fi -rm -f conftest.$ac_cv_objext conftest.$ac_ext +rm -f conftest.$ac_cv_objext conftest.$ac_ext ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5 printf "%s\n" "$ac_cv_objext" >&6; } @@ -4517,8 +4524,8 @@ printf %s "checking whether the compiler supports GNU C... " >&6; } if test ${ac_cv_c_compiler_gnu+y} then : printf %s "(cached) " >&6 -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int @@ -4535,12 +4542,14 @@ _ACEOF if ac_fn_c_try_compile "$LINENO" then : ac_compiler_gnu=yes -else $as_nop - ac_compiler_gnu=no +else case e in #( + e) ac_compiler_gnu=no ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu - + ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 printf "%s\n" "$ac_cv_c_compiler_gnu" >&6; } @@ -4558,8 +4567,8 @@ printf %s "checking whether $CC accepts -g... " >&6; } if test ${ac_cv_prog_cc_g+y} then : printf %s "(cached) " >&6 -else $as_nop - ac_save_c_werror_flag=$ac_c_werror_flag +else case e in #( + e) ac_save_c_werror_flag=$ac_c_werror_flag ac_c_werror_flag=yes ac_cv_prog_cc_g=no CFLAGS="-g" @@ -4577,8 +4586,8 @@ _ACEOF if ac_fn_c_try_compile "$LINENO" then : ac_cv_prog_cc_g=yes -else $as_nop - CFLAGS="" +else case e in #( + e) CFLAGS="" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -4593,8 +4602,8 @@ _ACEOF if ac_fn_c_try_compile "$LINENO" then : -else $as_nop - ac_c_werror_flag=$ac_save_c_werror_flag +else case e in #( + e) ac_c_werror_flag=$ac_save_c_werror_flag CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -4611,12 +4620,15 @@ if ac_fn_c_try_compile "$LINENO" then : ac_cv_prog_cc_g=yes fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext - ac_c_werror_flag=$ac_save_c_werror_flag + ac_c_werror_flag=$ac_save_c_werror_flag ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 printf "%s\n" "$ac_cv_prog_cc_g" >&6; } @@ -4643,8 +4655,8 @@ printf %s "checking for $CC option to enable C11 features... " >&6; } if test ${ac_cv_prog_cc_c11+y} then : printf %s "(cached) " >&6 -else $as_nop - ac_cv_prog_cc_c11=no +else case e in #( + e) ac_cv_prog_cc_c11=no ac_save_CC=$CC cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -4661,25 +4673,28 @@ rm -f core conftest.err conftest.$ac_objext conftest.beam test "x$ac_cv_prog_cc_c11" != "xno" && break done rm -f conftest.$ac_ext -CC=$ac_save_CC +CC=$ac_save_CC ;; +esac fi if test "x$ac_cv_prog_cc_c11" = xno then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 printf "%s\n" "unsupported" >&6; } -else $as_nop - if test "x$ac_cv_prog_cc_c11" = x +else case e in #( + e) if test "x$ac_cv_prog_cc_c11" = x then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 printf "%s\n" "none needed" >&6; } -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c11" >&5 +else case e in #( + e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c11" >&5 printf "%s\n" "$ac_cv_prog_cc_c11" >&6; } - CC="$CC $ac_cv_prog_cc_c11" + CC="$CC $ac_cv_prog_cc_c11" ;; +esac fi ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c11 - ac_prog_cc_stdc=c11 + ac_prog_cc_stdc=c11 ;; +esac fi fi if test x$ac_prog_cc_stdc = xno @@ -4689,8 +4704,8 @@ printf %s "checking for $CC option to enable C99 features... " >&6; } if test ${ac_cv_prog_cc_c99+y} then : printf %s "(cached) " >&6 -else $as_nop - ac_cv_prog_cc_c99=no +else case e in #( + e) ac_cv_prog_cc_c99=no ac_save_CC=$CC cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -4707,25 +4722,28 @@ rm -f core conftest.err conftest.$ac_objext conftest.beam test "x$ac_cv_prog_cc_c99" != "xno" && break done rm -f conftest.$ac_ext -CC=$ac_save_CC +CC=$ac_save_CC ;; +esac fi if test "x$ac_cv_prog_cc_c99" = xno then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 printf "%s\n" "unsupported" >&6; } -else $as_nop - if test "x$ac_cv_prog_cc_c99" = x +else case e in #( + e) if test "x$ac_cv_prog_cc_c99" = x then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 printf "%s\n" "none needed" >&6; } -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c99" >&5 +else case e in #( + e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c99" >&5 printf "%s\n" "$ac_cv_prog_cc_c99" >&6; } - CC="$CC $ac_cv_prog_cc_c99" + CC="$CC $ac_cv_prog_cc_c99" ;; +esac fi ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c99 - ac_prog_cc_stdc=c99 + ac_prog_cc_stdc=c99 ;; +esac fi fi if test x$ac_prog_cc_stdc = xno @@ -4735,8 +4753,8 @@ printf %s "checking for $CC option to enable C89 features... " >&6; } if test ${ac_cv_prog_cc_c89+y} then : printf %s "(cached) " >&6 -else $as_nop - ac_cv_prog_cc_c89=no +else case e in #( + e) ac_cv_prog_cc_c89=no ac_save_CC=$CC cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -4753,25 +4771,28 @@ rm -f core conftest.err conftest.$ac_objext conftest.beam test "x$ac_cv_prog_cc_c89" != "xno" && break done rm -f conftest.$ac_ext -CC=$ac_save_CC +CC=$ac_save_CC ;; +esac fi if test "x$ac_cv_prog_cc_c89" = xno then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 printf "%s\n" "unsupported" >&6; } -else $as_nop - if test "x$ac_cv_prog_cc_c89" = x +else case e in #( + e) if test "x$ac_cv_prog_cc_c89" = x then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 printf "%s\n" "none needed" >&6; } -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 +else case e in #( + e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 printf "%s\n" "$ac_cv_prog_cc_c89" >&6; } - CC="$CC $ac_cv_prog_cc_c89" + CC="$CC $ac_cv_prog_cc_c89" ;; +esac fi ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c89 - ac_prog_cc_stdc=c89 + ac_prog_cc_stdc=c89 ;; +esac fi fi @@ -4792,8 +4813,8 @@ printf %s "checking whether $CC understands -c and -o together... " >&6; } if test ${am_cv_prog_cc_c_o+y} then : printf %s "(cached) " >&6 -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int @@ -4823,7 +4844,8 @@ _ACEOF fi done rm -f core conftest* - unset am_i + unset am_i ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_prog_cc_c_o" >&5 printf "%s\n" "$am_cv_prog_cc_c_o" >&6; } @@ -4849,8 +4871,8 @@ printf %s "checking dependency style of $depcc... " >&6; } if test ${am_cv_CC_dependencies_compiler_type+y} then : printf %s "(cached) " >&6 -else $as_nop - if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then +else case e in #( + e) if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up @@ -4954,7 +4976,8 @@ else $as_nop else am_cv_CC_dependencies_compiler_type=none fi - + ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5 printf "%s\n" "$am_cv_CC_dependencies_compiler_type" >&6; } @@ -4973,385 +4996,65 @@ fi -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5 -printf %s "checking how to run the C preprocessor... " >&6; } -# On Suns, sometimes $CPP names a directory. -if test -n "$CPP" && test -d "$CPP"; then - CPP= -fi -if test -z "$CPP"; then - if test ${ac_cv_prog_CPP+y} -then : - printf %s "(cached) " >&6 -else $as_nop - # Double quotes because $CC needs to be expanded - for CPP in "$CC -E" "$CC -E -traditional-cpp" cpp /lib/cpp - do - ac_preproc_ok=false -for ac_c_preproc_warn_flag in '' yes -do - # Use a header file that comes with gcc, so configuring glibc - # with a fresh cross-compiler works. - # On the NeXT, cc -E runs the code through the compiler's parser, - # not just through cpp. "Syntax error" is here to catch this case. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include - Syntax error -_ACEOF -if ac_fn_c_try_cpp "$LINENO" -then : - -else $as_nop - # Broken: fails on valid input. -continue -fi -rm -f conftest.err conftest.i conftest.$ac_ext - - # OK, works on sane cases. Now check whether nonexistent headers - # can be detected and how. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -_ACEOF -if ac_fn_c_try_cpp "$LINENO" -then : - # Broken: success on invalid input. -continue -else $as_nop - # Passes both tests. -ac_preproc_ok=: -break -fi -rm -f conftest.err conftest.i conftest.$ac_ext -done -# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. -rm -f conftest.i conftest.err conftest.$ac_ext -if $ac_preproc_ok -then : - break -fi +# By default we simply use the C compiler to build assembly code. - done - ac_cv_prog_CPP=$CPP +test "${CCAS+set}" = set || CCAS=$CC +test "${CCASFLAGS+set}" = set || CCASFLAGS=$CFLAGS -fi - CPP=$ac_cv_prog_CPP -else - ac_cv_prog_CPP=$CPP -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5 -printf "%s\n" "$CPP" >&6; } -ac_preproc_ok=false -for ac_c_preproc_warn_flag in '' yes -do - # Use a header file that comes with gcc, so configuring glibc - # with a fresh cross-compiler works. - # On the NeXT, cc -E runs the code through the compiler's parser, - # not just through cpp. "Syntax error" is here to catch this case. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include - Syntax error -_ACEOF -if ac_fn_c_try_cpp "$LINENO" -then : -else $as_nop - # Broken: fails on valid input. -continue -fi -rm -f conftest.err conftest.i conftest.$ac_ext - # OK, works on sane cases. Now check whether nonexistent headers - # can be detected and how. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -_ACEOF -if ac_fn_c_try_cpp "$LINENO" -then : - # Broken: success on invalid input. -continue -else $as_nop - # Passes both tests. -ac_preproc_ok=: -break -fi -rm -f conftest.err conftest.i conftest.$ac_ext +depcc="$CCAS" am_compiler_list= -done -# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. -rm -f conftest.i conftest.err conftest.$ac_ext -if $ac_preproc_ok +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 +printf %s "checking dependency style of $depcc... " >&6; } +if test ${am_cv_CCAS_dependencies_compiler_type+y} then : + printf %s "(cached) " >&6 +else case e in #( + e) if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then + # We make a subdir and do the tests there. Otherwise we can end up + # making bogus files that we don't know about and never remove. For + # instance it was reported that on HP-UX the gcc test will end up + # making a dummy file named 'D' -- because '-MD' means "put the output + # in D". + rm -rf conftest.dir + mkdir conftest.dir + # Copy depcomp to subdir because otherwise we won't find it if we're + # using a relative directory. + cp "$am_depcomp" conftest.dir + cd conftest.dir + # We will build objects and dependencies in a subdirectory because + # it helps to detect inapplicable dependency modes. For instance + # both Tru64's cc and ICC support -MD to output dependencies as a + # side effect of compilation, but ICC will put the dependencies in + # the current directory while Tru64 will put them in the object + # directory. + mkdir sub -else $as_nop - { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "C preprocessor \"$CPP\" fails sanity check -See \`config.log' for more details" "$LINENO" 5; } -fi + am_cv_CCAS_dependencies_compiler_type=none + if test "$am_compiler_list" = ""; then + am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` + fi + am__universal=false -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 -printf %s "checking for grep that handles long lines and -e... " >&6; } -if test ${ac_cv_path_GREP+y} -then : - printf %s "(cached) " >&6 -else $as_nop - if test -z "$GREP"; then - ac_path_GREP_found=false - # Loop through the user's path and test for each of PROGNAME-LIST - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin -do - IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - for ac_prog in grep ggrep - do - for ac_exec_ext in '' $ac_executable_extensions; do - ac_path_GREP="$as_dir$ac_prog$ac_exec_ext" - as_fn_executable_p "$ac_path_GREP" || continue -# Check for GNU ac_path_GREP and select it if it is found. - # Check for GNU $ac_path_GREP -case `"$ac_path_GREP" --version 2>&1` in -*GNU*) - ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; -*) - ac_count=0 - printf %s 0123456789 >"conftest.in" - while : - do - cat "conftest.in" "conftest.in" >"conftest.tmp" - mv "conftest.tmp" "conftest.in" - cp "conftest.in" "conftest.nl" - printf "%s\n" 'GREP' >> "conftest.nl" - "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break - diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break - as_fn_arith $ac_count + 1 && ac_count=$as_val - if test $ac_count -gt ${ac_path_GREP_max-0}; then - # Best one so far, save it but keep looking for a better one - ac_cv_path_GREP="$ac_path_GREP" - ac_path_GREP_max=$ac_count - fi - # 10*(2^10) chars as input seems more than enough - test $ac_count -gt 10 && break - done - rm -f conftest.in conftest.tmp conftest.nl conftest.out;; -esac - - $ac_path_GREP_found && break 3 - done - done - done -IFS=$as_save_IFS - if test -z "$ac_cv_path_GREP"; then - as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 - fi -else - ac_cv_path_GREP=$GREP -fi - -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5 -printf "%s\n" "$ac_cv_path_GREP" >&6; } - GREP="$ac_cv_path_GREP" - - -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 -printf %s "checking for egrep... " >&6; } -if test ${ac_cv_path_EGREP+y} -then : - printf %s "(cached) " >&6 -else $as_nop - if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 - then ac_cv_path_EGREP="$GREP -E" - else - if test -z "$EGREP"; then - ac_path_EGREP_found=false - # Loop through the user's path and test for each of PROGNAME-LIST - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin -do - IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - for ac_prog in egrep - do - for ac_exec_ext in '' $ac_executable_extensions; do - ac_path_EGREP="$as_dir$ac_prog$ac_exec_ext" - as_fn_executable_p "$ac_path_EGREP" || continue -# Check for GNU ac_path_EGREP and select it if it is found. - # Check for GNU $ac_path_EGREP -case `"$ac_path_EGREP" --version 2>&1` in -*GNU*) - ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; -*) - ac_count=0 - printf %s 0123456789 >"conftest.in" - while : - do - cat "conftest.in" "conftest.in" >"conftest.tmp" - mv "conftest.tmp" "conftest.in" - cp "conftest.in" "conftest.nl" - printf "%s\n" 'EGREP' >> "conftest.nl" - "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break - diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break - as_fn_arith $ac_count + 1 && ac_count=$as_val - if test $ac_count -gt ${ac_path_EGREP_max-0}; then - # Best one so far, save it but keep looking for a better one - ac_cv_path_EGREP="$ac_path_EGREP" - ac_path_EGREP_max=$ac_count - fi - # 10*(2^10) chars as input seems more than enough - test $ac_count -gt 10 && break - done - rm -f conftest.in conftest.tmp conftest.nl conftest.out;; -esac - - $ac_path_EGREP_found && break 3 - done - done - done -IFS=$as_save_IFS - if test -z "$ac_cv_path_EGREP"; then - as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 - fi -else - ac_cv_path_EGREP=$EGREP -fi - - fi -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5 -printf "%s\n" "$ac_cv_path_EGREP" >&6; } - EGREP="$ac_cv_path_EGREP" - - -if test $ac_cv_c_compiler_gnu = yes; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CC needs -traditional" >&5 -printf %s "checking whether $CC needs -traditional... " >&6; } -if test ${ac_cv_prog_gcc_traditional+y} -then : - printf %s "(cached) " >&6 -else $as_nop - ac_pattern="Autoconf.*'x'" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -Autoconf TIOCGETP -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "$ac_pattern" >/dev/null 2>&1 -then : - ac_cv_prog_gcc_traditional=yes -else $as_nop - ac_cv_prog_gcc_traditional=no -fi -rm -rf conftest* - - - if test $ac_cv_prog_gcc_traditional = no; then - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -Autoconf TCGETA -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "$ac_pattern" >/dev/null 2>&1 -then : - ac_cv_prog_gcc_traditional=yes -fi -rm -rf conftest* - - fi -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_gcc_traditional" >&5 -printf "%s\n" "$ac_cv_prog_gcc_traditional" >&6; } - if test $ac_cv_prog_gcc_traditional = yes; then - CC="$CC -traditional" - fi -fi - - -# By default we simply use the C compiler to build assembly code. - -test "${CCAS+set}" = set || CCAS=$CC -test "${CCASFLAGS+set}" = set || CCASFLAGS=$CFLAGS - - - -depcc="$CCAS" am_compiler_list= - -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 -printf %s "checking dependency style of $depcc... " >&6; } -if test ${am_cv_CCAS_dependencies_compiler_type+y} -then : - printf %s "(cached) " >&6 -else $as_nop - if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then - # We make a subdir and do the tests there. Otherwise we can end up - # making bogus files that we don't know about and never remove. For - # instance it was reported that on HP-UX the gcc test will end up - # making a dummy file named 'D' -- because '-MD' means "put the output - # in D". - rm -rf conftest.dir - mkdir conftest.dir - # Copy depcomp to subdir because otherwise we won't find it if we're - # using a relative directory. - cp "$am_depcomp" conftest.dir - cd conftest.dir - # We will build objects and dependencies in a subdirectory because - # it helps to detect inapplicable dependency modes. For instance - # both Tru64's cc and ICC support -MD to output dependencies as a - # side effect of compilation, but ICC will put the dependencies in - # the current directory while Tru64 will put them in the object - # directory. - mkdir sub - - am_cv_CCAS_dependencies_compiler_type=none - if test "$am_compiler_list" = ""; then - am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` - fi - am__universal=false - - - for depmode in $am_compiler_list; do - # Setup a source with many dependencies, because some compilers - # like to wrap large dependency lists on column 80 (with \), and - # we should not choose a depcomp mode which is confused by this. - # - # We need to recreate these files for each test, as the compiler may - # overwrite some of them when testing with obscure command lines. - # This happens at least with the AIX C compiler. - : > sub/conftest.c - for i in 1 2 3 4 5 6; do - echo '#include "conftst'$i'.h"' >> sub/conftest.c - # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with - # Solaris 10 /bin/sh. - echo '/* dummy */' > sub/conftst$i.h - done - echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf + for depmode in $am_compiler_list; do + # Setup a source with many dependencies, because some compilers + # like to wrap large dependency lists on column 80 (with \), and + # we should not choose a depcomp mode which is confused by this. + # + # We need to recreate these files for each test, as the compiler may + # overwrite some of them when testing with obscure command lines. + # This happens at least with the AIX C compiler. + : > sub/conftest.c + for i in 1 2 3 4 5 6; do + echo '#include "conftst'$i'.h"' >> sub/conftest.c + # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with + # Solaris 10 /bin/sh. + echo '/* dummy */' > sub/conftst$i.h + done + echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf # We check with '-c' and '-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly @@ -5411,7 +5114,8 @@ else $as_nop else am_cv_CCAS_dependencies_compiler_type=none fi - + ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_CCAS_dependencies_compiler_type" >&5 printf "%s\n" "$am_cv_CCAS_dependencies_compiler_type" >&6; } @@ -5436,8 +5140,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_RANLIB+y} then : printf %s "(cached) " >&6 -else $as_nop - if test -n "$RANLIB"; then +else case e in #( + e) if test -n "$RANLIB"; then ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -5459,7 +5163,8 @@ done done IFS=$as_save_IFS -fi +fi ;; +esac fi RANLIB=$ac_cv_prog_RANLIB if test -n "$RANLIB"; then @@ -5481,8 +5186,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_RANLIB+y} then : printf %s "(cached) " >&6 -else $as_nop - if test -n "$ac_ct_RANLIB"; then +else case e in #( + e) if test -n "$ac_ct_RANLIB"; then ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -5504,7 +5209,8 @@ done done IFS=$as_save_IFS -fi +fi ;; +esac fi ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB if test -n "$ac_ct_RANLIB"; then @@ -5555,8 +5261,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_CXX+y} then : printf %s "(cached) " >&6 -else $as_nop - if test -n "$CXX"; then +else case e in #( + e) if test -n "$CXX"; then ac_cv_prog_CXX="$CXX" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -5578,7 +5284,8 @@ done done IFS=$as_save_IFS -fi +fi ;; +esac fi CXX=$ac_cv_prog_CXX if test -n "$CXX"; then @@ -5604,8 +5311,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_CXX+y} then : printf %s "(cached) " >&6 -else $as_nop - if test -n "$ac_ct_CXX"; then +else case e in #( + e) if test -n "$ac_ct_CXX"; then ac_cv_prog_ac_ct_CXX="$ac_ct_CXX" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -5627,7 +5334,8 @@ done done IFS=$as_save_IFS -fi +fi ;; +esac fi ac_ct_CXX=$ac_cv_prog_ac_ct_CXX if test -n "$ac_ct_CXX"; then @@ -5687,8 +5395,8 @@ printf %s "checking whether the compiler supports GNU C++... " >&6; } if test ${ac_cv_cxx_compiler_gnu+y} then : printf %s "(cached) " >&6 -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int @@ -5705,12 +5413,14 @@ _ACEOF if ac_fn_cxx_try_compile "$LINENO" then : ac_compiler_gnu=yes -else $as_nop - ac_compiler_gnu=no +else case e in #( + e) ac_compiler_gnu=no ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ac_cv_cxx_compiler_gnu=$ac_compiler_gnu - + ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cxx_compiler_gnu" >&5 printf "%s\n" "$ac_cv_cxx_compiler_gnu" >&6; } @@ -5728,8 +5438,8 @@ printf %s "checking whether $CXX accepts -g... " >&6; } if test ${ac_cv_prog_cxx_g+y} then : printf %s "(cached) " >&6 -else $as_nop - ac_save_cxx_werror_flag=$ac_cxx_werror_flag +else case e in #( + e) ac_save_cxx_werror_flag=$ac_cxx_werror_flag ac_cxx_werror_flag=yes ac_cv_prog_cxx_g=no CXXFLAGS="-g" @@ -5747,8 +5457,8 @@ _ACEOF if ac_fn_cxx_try_compile "$LINENO" then : ac_cv_prog_cxx_g=yes -else $as_nop - CXXFLAGS="" +else case e in #( + e) CXXFLAGS="" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -5763,8 +5473,8 @@ _ACEOF if ac_fn_cxx_try_compile "$LINENO" then : -else $as_nop - ac_cxx_werror_flag=$ac_save_cxx_werror_flag +else case e in #( + e) ac_cxx_werror_flag=$ac_save_cxx_werror_flag CXXFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -5781,12 +5491,15 @@ if ac_fn_cxx_try_compile "$LINENO" then : ac_cv_prog_cxx_g=yes fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext - ac_cxx_werror_flag=$ac_save_cxx_werror_flag + ac_cxx_werror_flag=$ac_save_cxx_werror_flag ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cxx_g" >&5 printf "%s\n" "$ac_cv_prog_cxx_g" >&6; } @@ -5810,11 +5523,11 @@ if test x$ac_prog_cxx_stdcxx = xno then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CXX option to enable C++11 features" >&5 printf %s "checking for $CXX option to enable C++11 features... " >&6; } -if test ${ac_cv_prog_cxx_11+y} +if test ${ac_cv_prog_cxx_cxx11+y} then : printf %s "(cached) " >&6 -else $as_nop - ac_cv_prog_cxx_11=no +else case e in #( + e) ac_cv_prog_cxx_cxx11=no ac_save_CXX=$CXX cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -5831,36 +5544,39 @@ rm -f core conftest.err conftest.$ac_objext conftest.beam test "x$ac_cv_prog_cxx_cxx11" != "xno" && break done rm -f conftest.$ac_ext -CXX=$ac_save_CXX +CXX=$ac_save_CXX ;; +esac fi if test "x$ac_cv_prog_cxx_cxx11" = xno then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 printf "%s\n" "unsupported" >&6; } -else $as_nop - if test "x$ac_cv_prog_cxx_cxx11" = x +else case e in #( + e) if test "x$ac_cv_prog_cxx_cxx11" = x then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 printf "%s\n" "none needed" >&6; } -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cxx_cxx11" >&5 +else case e in #( + e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cxx_cxx11" >&5 printf "%s\n" "$ac_cv_prog_cxx_cxx11" >&6; } - CXX="$CXX $ac_cv_prog_cxx_cxx11" + CXX="$CXX $ac_cv_prog_cxx_cxx11" ;; +esac fi ac_cv_prog_cxx_stdcxx=$ac_cv_prog_cxx_cxx11 - ac_prog_cxx_stdcxx=cxx11 + ac_prog_cxx_stdcxx=cxx11 ;; +esac fi fi if test x$ac_prog_cxx_stdcxx = xno then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CXX option to enable C++98 features" >&5 printf %s "checking for $CXX option to enable C++98 features... " >&6; } -if test ${ac_cv_prog_cxx_98+y} +if test ${ac_cv_prog_cxx_cxx98+y} then : printf %s "(cached) " >&6 -else $as_nop - ac_cv_prog_cxx_98=no +else case e in #( + e) ac_cv_prog_cxx_cxx98=no ac_save_CXX=$CXX cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -5877,25 +5593,28 @@ rm -f core conftest.err conftest.$ac_objext conftest.beam test "x$ac_cv_prog_cxx_cxx98" != "xno" && break done rm -f conftest.$ac_ext -CXX=$ac_save_CXX +CXX=$ac_save_CXX ;; +esac fi if test "x$ac_cv_prog_cxx_cxx98" = xno then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 printf "%s\n" "unsupported" >&6; } -else $as_nop - if test "x$ac_cv_prog_cxx_cxx98" = x +else case e in #( + e) if test "x$ac_cv_prog_cxx_cxx98" = x then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 printf "%s\n" "none needed" >&6; } -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cxx_cxx98" >&5 +else case e in #( + e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cxx_cxx98" >&5 printf "%s\n" "$ac_cv_prog_cxx_cxx98" >&6; } - CXX="$CXX $ac_cv_prog_cxx_cxx98" + CXX="$CXX $ac_cv_prog_cxx_cxx98" ;; +esac fi ac_cv_prog_cxx_stdcxx=$ac_cv_prog_cxx_cxx98 - ac_prog_cxx_stdcxx=cxx98 + ac_prog_cxx_stdcxx=cxx98 ;; +esac fi fi @@ -5912,8 +5631,8 @@ printf %s "checking dependency style of $depcc... " >&6; } if test ${am_cv_CXX_dependencies_compiler_type+y} then : printf %s "(cached) " >&6 -else $as_nop - if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then +else case e in #( + e) if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up @@ -6017,7 +5736,8 @@ else $as_nop else am_cv_CXX_dependencies_compiler_type=none fi - + ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_CXX_dependencies_compiler_type" >&5 printf "%s\n" "$am_cv_CXX_dependencies_compiler_type" >&6; } @@ -6035,6 +5755,7 @@ fi + ac_header= ac_cache= for ac_item in $ac_header_c_list do @@ -6064,6 +5785,77 @@ then : printf "%s\n" "#define STDC_HEADERS 1" >>confdefs.h fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 +printf %s "checking for grep that handles long lines and -e... " >&6; } +if test ${ac_cv_path_GREP+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) if test -z "$GREP"; then + ac_path_GREP_found=false + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_prog in grep ggrep + do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_GREP="$as_dir$ac_prog$ac_exec_ext" + as_fn_executable_p "$ac_path_GREP" || continue +# Check for GNU ac_path_GREP and select it if it is found. + # Check for GNU $ac_path_GREP +case `"$ac_path_GREP" --version 2>&1` in #( +*GNU*) + ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; +#( +*) + ac_count=0 + printf %s 0123456789 >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + printf "%s\n" 'GREP' >> "conftest.nl" + "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + as_fn_arith $ac_count + 1 && ac_count=$as_val + if test $ac_count -gt ${ac_path_GREP_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_GREP="$ac_path_GREP" + ac_path_GREP_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + + $ac_path_GREP_found && break 3 + done + done + done +IFS=$as_save_IFS + if test -z "$ac_cv_path_GREP"; then + as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 + fi +else + ac_cv_path_GREP=$GREP +fi + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5 +printf "%s\n" "$ac_cv_path_GREP" >&6; } + GREP="$ac_cv_path_GREP" + + # Autoupdate added the next two lines to ensure that your configure # script's behavior did not change. They are probably safe to remove. @@ -6072,8 +5864,8 @@ printf %s "checking for egrep... " >&6; } if test ${ac_cv_path_EGREP+y} then : printf %s "(cached) " >&6 -else $as_nop - if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 +else case e in #( + e) if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 then ac_cv_path_EGREP="$GREP -E" else if test -z "$EGREP"; then @@ -6095,9 +5887,10 @@ do as_fn_executable_p "$ac_path_EGREP" || continue # Check for GNU ac_path_EGREP and select it if it is found. # Check for GNU $ac_path_EGREP -case `"$ac_path_EGREP" --version 2>&1` in +case `"$ac_path_EGREP" --version 2>&1` in #( *GNU*) ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; +#( *) ac_count=0 printf %s 0123456789 >"conftest.in" @@ -6133,12 +5926,15 @@ else ac_cv_path_EGREP=$EGREP fi - fi + fi ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5 printf "%s\n" "$ac_cv_path_EGREP" >&6; } EGREP="$ac_cv_path_EGREP" + EGREP_TRADITIONAL=$EGREP + ac_cv_path_EGREP_TRADITIONAL=$EGREP ac_fn_c_check_header_compile "$LINENO" "sys/endian.h" "ac_cv_header_sys_endian_h" "$ac_includes_default" @@ -6180,8 +5976,8 @@ printf %s "checking for $CC options needed to detect all undeclared functions... if test ${ac_cv_c_undeclared_builtin_options+y} then : printf %s "(cached) " >&6 -else $as_nop - ac_save_CFLAGS=$CFLAGS +else case e in #( + e) ac_save_CFLAGS=$CFLAGS ac_cv_c_undeclared_builtin_options='cannot detect' for ac_arg in '' -fno-builtin; do CFLAGS="$ac_save_CFLAGS $ac_arg" @@ -6200,8 +5996,8 @@ _ACEOF if ac_fn_c_try_compile "$LINENO" then : -else $as_nop - # This test program should compile successfully. +else case e in #( + e) # This test program should compile successfully. # No library function is consistently available on # freestanding implementations, so test against a dummy # declaration. Include always-available headers on the @@ -6229,26 +6025,29 @@ then : if test x"$ac_arg" = x then : ac_cv_c_undeclared_builtin_options='none needed' -else $as_nop - ac_cv_c_undeclared_builtin_options=$ac_arg +else case e in #( + e) ac_cv_c_undeclared_builtin_options=$ac_arg ;; +esac fi break fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext done CFLAGS=$ac_save_CFLAGS - + ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_undeclared_builtin_options" >&5 printf "%s\n" "$ac_cv_c_undeclared_builtin_options" >&6; } case $ac_cv_c_undeclared_builtin_options in #( 'cannot detect') : - { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} as_fn_error $? "cannot make $CC report undeclared builtins -See \`config.log' for more details" "$LINENO" 5; } ;; #( +See 'config.log' for more details" "$LINENO" 5; } ;; #( 'none needed') : ac_c_undeclared_builtin_options='' ;; #( *) : @@ -6264,8 +6063,9 @@ ac_fn_check_decl "$LINENO" "be32dec" "ac_cv_have_decl_be32dec" "$ac_includes_def if test "x$ac_cv_have_decl_be32dec" = xyes then : ac_have_decl=1 -else $as_nop - ac_have_decl=0 +else case e in #( + e) ac_have_decl=0 ;; +esac fi printf "%s\n" "#define HAVE_DECL_BE32DEC $ac_have_decl" >>confdefs.h ac_fn_check_decl "$LINENO" "le32dec" "ac_cv_have_decl_le32dec" "$ac_includes_default @@ -6277,8 +6077,9 @@ ac_fn_check_decl "$LINENO" "le32dec" "ac_cv_have_decl_le32dec" "$ac_includes_def if test "x$ac_cv_have_decl_le32dec" = xyes then : ac_have_decl=1 -else $as_nop - ac_have_decl=0 +else case e in #( + e) ac_have_decl=0 ;; +esac fi printf "%s\n" "#define HAVE_DECL_LE32DEC $ac_have_decl" >>confdefs.h ac_fn_check_decl "$LINENO" "be32enc" "ac_cv_have_decl_be32enc" "$ac_includes_default @@ -6290,8 +6091,9 @@ ac_fn_check_decl "$LINENO" "be32enc" "ac_cv_have_decl_be32enc" "$ac_includes_def if test "x$ac_cv_have_decl_be32enc" = xyes then : ac_have_decl=1 -else $as_nop - ac_have_decl=0 +else case e in #( + e) ac_have_decl=0 ;; +esac fi printf "%s\n" "#define HAVE_DECL_BE32ENC $ac_have_decl" >>confdefs.h ac_fn_check_decl "$LINENO" "le32enc" "ac_cv_have_decl_le32enc" "$ac_includes_default @@ -6303,8 +6105,9 @@ ac_fn_check_decl "$LINENO" "le32enc" "ac_cv_have_decl_le32enc" "$ac_includes_def if test "x$ac_cv_have_decl_le32enc" = xyes then : ac_have_decl=1 -else $as_nop - ac_have_decl=0 +else case e in #( + e) ac_have_decl=0 ;; +esac fi printf "%s\n" "#define HAVE_DECL_LE32ENC $ac_have_decl" >>confdefs.h ac_fn_check_decl "$LINENO" "le16dec" "ac_cv_have_decl_le16dec" "$ac_includes_default @@ -6316,8 +6119,9 @@ ac_fn_check_decl "$LINENO" "le16dec" "ac_cv_have_decl_le16dec" "$ac_includes_def if test "x$ac_cv_have_decl_le16dec" = xyes then : ac_have_decl=1 -else $as_nop - ac_have_decl=0 +else case e in #( + e) ac_have_decl=0 ;; +esac fi printf "%s\n" "#define HAVE_DECL_LE16DEC $ac_have_decl" >>confdefs.h ac_fn_check_decl "$LINENO" "le16enc" "ac_cv_have_decl_le16enc" "$ac_includes_default @@ -6329,8 +6133,9 @@ ac_fn_check_decl "$LINENO" "le16enc" "ac_cv_have_decl_le16enc" "$ac_includes_def if test "x$ac_cv_have_decl_le16enc" = xyes then : ac_have_decl=1 -else $as_nop - ac_have_decl=0 +else case e in #( + e) ac_have_decl=0 ;; +esac fi printf "%s\n" "#define HAVE_DECL_LE16ENC $ac_have_decl" >>confdefs.h @@ -6339,10 +6144,11 @@ ac_fn_c_check_type "$LINENO" "size_t" "ac_cv_type_size_t" "$ac_includes_default" if test "x$ac_cv_type_size_t" = xyes then : -else $as_nop - +else case e in #( + e) printf "%s\n" "#define size_t unsigned int" >>confdefs.h - + ;; +esac fi # The Ultrix 4.2 mips builtin alloca declared by alloca.h only works @@ -6352,8 +6158,8 @@ printf %s "checking for working alloca.h... " >&6; } if test ${ac_cv_working_alloca_h+y} then : printf %s "(cached) " >&6 -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int @@ -6368,11 +6174,13 @@ _ACEOF if ac_fn_c_try_link "$LINENO" then : ac_cv_working_alloca_h=yes -else $as_nop - ac_cv_working_alloca_h=no +else case e in #( + e) ac_cv_working_alloca_h=no ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext + conftest$ac_exeext conftest.$ac_ext ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_working_alloca_h" >&5 printf "%s\n" "$ac_cv_working_alloca_h" >&6; } @@ -6387,10 +6195,10 @@ printf %s "checking for alloca... " >&6; } if test ${ac_cv_func_alloca_works+y} then : printf %s "(cached) " >&6 -else $as_nop - if test $ac_cv_working_alloca_h = yes; then - ac_cv_func_alloca_works=yes -else +else case e in #( + e) ac_cv_func_alloca_works=$ac_cv_working_alloca_h +if test "$ac_cv_func_alloca_works" != yes +then : cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include @@ -6421,15 +6229,14 @@ _ACEOF if ac_fn_c_try_link "$LINENO" then : ac_cv_func_alloca_works=yes -else $as_nop - ac_cv_func_alloca_works=no fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext +fi ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_alloca_works" >&5 printf "%s\n" "$ac_cv_func_alloca_works" >&6; } -fi if test $ac_cv_func_alloca_works = yes; then @@ -6451,12 +6258,12 @@ printf %s "checking stack direction for C alloca... " >&6; } if test ${ac_cv_c_stack_direction+y} then : printf %s "(cached) " >&6 -else $as_nop - if test "$cross_compiling" = yes +else case e in #( + e) if test "$cross_compiling" = yes then : ac_cv_c_stack_direction=0 -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_includes_default int @@ -6479,13 +6286,16 @@ _ACEOF if ac_fn_c_try_run "$LINENO" then : ac_cv_c_stack_direction=1 -else $as_nop - ac_cv_c_stack_direction=-1 +else case e in #( + e) ac_cv_c_stack_direction=-1 ;; +esac fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac fi - + ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_stack_direction" >&5 printf "%s\n" "$ac_cv_c_stack_direction" >&6; } @@ -6585,12 +6395,13 @@ printf "%s\n" "#define USE_XOP 1" >>confdefs.h { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +else case e in #( + e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: The assembler does not support the XOP instruction set." >&5 printf "%s\n" "$as_me: WARNING: The assembler does not support the XOP instruction set." >&2;} - + ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether we can compile AVX2 code" >&5 @@ -6634,30 +6445,33 @@ printf "%s\n" "#define USE_AVX512 1" >>confdefs.h { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +else case e in #( + e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: The assembler does not support the AVX512 instruction set." >&5 printf "%s\n" "$as_me: WARNING: The assembler does not support the AVX512 instruction set." >&2;} - + ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +else case e in #( + e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: The assembler does not support the AVX2 instruction set." >&5 printf "%s\n" "$as_me: WARNING: The assembler does not support the AVX2 instruction set." >&2;} - + ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +else case e in #( + e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: The assembler does not support the AVX instruction set." >&5 printf "%s\n" "$as_me: WARNING: The assembler does not support the AVX instruction set." >&2;} - + ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi @@ -6667,16 +6481,22 @@ printf %s "checking for json_loads in -ljansson... " >&6; } if test ${ac_cv_lib_jansson_json_loads+y} then : printf %s "(cached) " >&6 -else $as_nop - ac_check_lib_save_LIBS=$LIBS +else case e in #( + e) ac_check_lib_save_LIBS=$LIBS LIBS="-ljansson $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -char json_loads (); + builtin and then its argument prototype would still apply. + The 'extern "C"' is for builds by C++ compilers; + although this is not generally supported in C code supporting it here + has little cost and some practical benefit (sr 110532). */ +#ifdef __cplusplus +extern "C" +#endif +char json_loads (void); int main (void) { @@ -6688,20 +6508,23 @@ _ACEOF if ac_fn_c_try_link "$LINENO" then : ac_cv_lib_jansson_json_loads=yes -else $as_nop - ac_cv_lib_jansson_json_loads=no +else case e in #( + e) ac_cv_lib_jansson_json_loads=no ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS +LIBS=$ac_check_lib_save_LIBS ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_jansson_json_loads" >&5 printf "%s\n" "$ac_cv_lib_jansson_json_loads" >&6; } if test "x$ac_cv_lib_jansson_json_loads" = xyes then : request_jansson=false -else $as_nop - request_jansson=true +else case e in #( + e) request_jansson=true ;; +esac fi @@ -6713,16 +6536,22 @@ printf %s "checking for pthread_create in -lpthread... " >&6; } if test ${ac_cv_lib_pthread_pthread_create+y} then : printf %s "(cached) " >&6 -else $as_nop - ac_check_lib_save_LIBS=$LIBS +else case e in #( + e) ac_check_lib_save_LIBS=$LIBS LIBS="-lpthread $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -char pthread_create (); + builtin and then its argument prototype would still apply. + The 'extern "C"' is for builds by C++ compilers; + although this is not generally supported in C code supporting it here + has little cost and some practical benefit (sr 110532). */ +#ifdef __cplusplus +extern "C" +#endif +char pthread_create (void); int main (void) { @@ -6734,12 +6563,14 @@ _ACEOF if ac_fn_c_try_link "$LINENO" then : ac_cv_lib_pthread_pthread_create=yes -else $as_nop - ac_cv_lib_pthread_pthread_create=no +else case e in #( + e) ac_cv_lib_pthread_pthread_create=no ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS +LIBS=$ac_check_lib_save_LIBS ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pthread_pthread_create" >&5 printf "%s\n" "$ac_cv_lib_pthread_pthread_create" >&6; } @@ -6754,16 +6585,22 @@ printf %s "checking for pthread_create in -lpthread... " >&6; } if test ${ac_cv_lib_pthread_pthread_create+y} then : printf %s "(cached) " >&6 -else $as_nop - ac_check_lib_save_LIBS=$LIBS +else case e in #( + e) ac_check_lib_save_LIBS=$LIBS LIBS="-lpthread $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -char pthread_create (); + builtin and then its argument prototype would still apply. + The 'extern "C"' is for builds by C++ compilers; + although this is not generally supported in C code supporting it here + has little cost and some practical benefit (sr 110532). */ +#ifdef __cplusplus +extern "C" +#endif +char pthread_create (void); int main (void) { @@ -6775,12 +6612,14 @@ _ACEOF if ac_fn_c_try_link "$LINENO" then : ac_cv_lib_pthread_pthread_create=yes -else $as_nop - ac_cv_lib_pthread_pthread_create=no +else case e in #( + e) ac_cv_lib_pthread_pthread_create=no ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS +LIBS=$ac_check_lib_save_LIBS ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pthread_pthread_create" >&5 printf "%s\n" "$ac_cv_lib_pthread_pthread_create" >&6; } @@ -6815,10 +6654,11 @@ printf "%s\n" "#define USE_INT128 1" >>confdefs.h { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +else case e in #( + e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } - + ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext @@ -6955,8 +6795,8 @@ cat >confcache <<\_ACEOF # config.status only pays attention to the cache file if you give it # the --recheck option to rerun configure. # -# `ac_cv_env_foo' variables (set or unset) will be overridden when -# loading this file, other *unset* `ac_cv_foo' will be assigned the +# 'ac_cv_env_foo' variables (set or unset) will be overridden when +# loading this file, other *unset* 'ac_cv_foo' will be assigned the # following values. _ACEOF @@ -6986,14 +6826,14 @@ printf "%s\n" "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} (set) 2>&1 | case $as_nl`(ac_space=' '; set) 2>&1` in #( *${as_nl}ac_space=\ *) - # `set' does not quote correctly, so add quotes: double-quote + # 'set' does not quote correctly, so add quotes: double-quote # substitution turns \\\\ into \\, and sed turns \\ into \. sed -n \ "s/'/'\\\\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" ;; #( *) - # `set' quotes correctly as required by POSIX, so do not add quotes. + # 'set' quotes correctly as required by POSIX, so do not add quotes. sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | @@ -7147,7 +6987,6 @@ cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1 # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh -as_nop=: if test ${ZSH_VERSION+y} && (emulate sh) >/dev/null 2>&1 then : emulate sh @@ -7156,12 +6995,13 @@ then : # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST -else $as_nop - case `(set -o) 2>/dev/null` in #( +else case e in #( + e) case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( *) : ;; +esac ;; esac fi @@ -7233,7 +7073,7 @@ IFS=$as_save_IFS ;; esac -# We did not find ourselves, most probably we were run as `sh COMMAND' +# We did not find ourselves, most probably we were run as 'sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 @@ -7262,7 +7102,6 @@ as_fn_error () } # as_fn_error - # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. @@ -7302,11 +7141,12 @@ then : { eval $1+=\$2 }' -else $as_nop - as_fn_append () +else case e in #( + e) as_fn_append () { eval $1=\$$1\$2 - } + } ;; +esac fi # as_fn_append # as_fn_arith ARG... @@ -7320,11 +7160,12 @@ then : { as_val=$(( $* )) }' -else $as_nop - as_fn_arith () +else case e in #( + e) as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` - } + } ;; +esac fi # as_fn_arith @@ -7407,9 +7248,9 @@ if (echo >conf$$.file) 2>/dev/null; then if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: - # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. - # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. - # In both cases, we have to default to `cp -pR'. + # 1) On MSYS, both 'ln -s file dir' and 'ln file dir' fail. + # 2) DJGPP < 2.04 has no symlinks; 'ln -s' creates a wrapper executable. + # In both cases, we have to default to 'cp -pR'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then @@ -7490,10 +7331,12 @@ as_test_x='test -x' as_executable_p=as_fn_executable_p # Sed expression to map a string onto a valid CPP name. -as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" +as_sed_cpp="y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g" +as_tr_cpp="eval sed '$as_sed_cpp'" # deprecated # Sed expression to map a string onto a valid variable name. -as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" +as_sed_sh="y%*+%pp%;s%[^_$as_cr_alnum]%_%g" +as_tr_sh="eval sed '$as_sed_sh'" # deprecated exec 6>&1 @@ -7508,8 +7351,8 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by cpuminer-opt $as_me 24.4, which was -generated by GNU Autoconf 2.71. Invocation command line was +This file was extended by cpuminer-opt $as_me 24.6, which was +generated by GNU Autoconf 2.72. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS @@ -7541,7 +7384,7 @@ _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 ac_cs_usage="\ -\`$as_me' instantiates files and other configuration actions +'$as_me' instantiates files and other configuration actions from templates according to the current configuration. Unless the files and actions are specified as TAGs, all are instantiated by default. @@ -7576,11 +7419,11 @@ ac_cs_config_escaped=`printf "%s\n" "$ac_cs_config" | sed "s/^ //; s/'/'\\\\\\\\ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config='$ac_cs_config_escaped' ac_cs_version="\\ -cpuminer-opt config.status 24.4 -configured by $0, generated by GNU Autoconf 2.71, +cpuminer-opt config.status 24.6 +configured by $0, generated by GNU Autoconf 2.72, with options \\"\$ac_cs_config\\" -Copyright (C) 2021 Free Software Foundation, Inc. +Copyright (C) 2023 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." @@ -7642,8 +7485,8 @@ do ac_need_defaults=false;; --he | --h) # Conflict between --help and --header - as_fn_error $? "ambiguous option: \`$1' -Try \`$0 --help' for more information.";; + as_fn_error $? "ambiguous option: '$1' +Try '$0 --help' for more information.";; --help | --hel | -h ) printf "%s\n" "$ac_cs_usage"; exit ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ @@ -7651,8 +7494,8 @@ Try \`$0 --help' for more information.";; ac_cs_silent=: ;; # This is an error. - -*) as_fn_error $? "unrecognized option: \`$1' -Try \`$0 --help' for more information." ;; + -*) as_fn_error $? "unrecognized option: '$1' +Try '$0 --help' for more information." ;; *) as_fn_append ac_config_targets " $1" ac_need_defaults=false ;; @@ -7711,7 +7554,7 @@ do "compat/Makefile") CONFIG_FILES="$CONFIG_FILES compat/Makefile" ;; "compat/jansson/Makefile") CONFIG_FILES="$CONFIG_FILES compat/jansson/Makefile" ;; - *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; + *) as_fn_error $? "invalid argument: '$ac_config_target'" "$LINENO" 5;; esac done @@ -7731,7 +7574,7 @@ fi # creating and moving files from /tmp can sometimes cause problems. # Hook for its removal unless debugging. # Note that there is a small window in which the directory will not be cleaned: -# after its creation but before its name has been assigned to `$tmp'. +# after its creation but before its name has been assigned to '$tmp'. $debug || { tmp= ac_tmp= @@ -7755,7 +7598,7 @@ ac_tmp=$tmp # Set up the scripts for CONFIG_FILES section. # No need to generate them if there are no CONFIG_FILES. -# This happens for instance with `./config.status config.h'. +# This happens for instance with './config.status config.h'. if test -n "$CONFIG_FILES"; then @@ -7913,13 +7756,13 @@ fi # test -n "$CONFIG_FILES" # Set up the scripts for CONFIG_HEADERS section. # No need to generate them if there are no CONFIG_HEADERS. -# This happens for instance with `./config.status Makefile'. +# This happens for instance with './config.status Makefile'. if test -n "$CONFIG_HEADERS"; then cat >"$ac_tmp/defines.awk" <<\_ACAWK || BEGIN { _ACEOF -# Transform confdefs.h into an awk script `defines.awk', embedded as +# Transform confdefs.h into an awk script 'defines.awk', embedded as # here-document in config.status, that substitutes the proper values into # config.h.in to produce config.h. @@ -8029,7 +7872,7 @@ do esac case $ac_mode$ac_tag in :[FHL]*:*);; - :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;; + :L* | :C*:*) as_fn_error $? "invalid tag '$ac_tag'" "$LINENO" 5;; :[FH]-) ac_tag=-:-;; :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; esac @@ -8051,19 +7894,19 @@ do -) ac_f="$ac_tmp/stdin";; *) # Look for the file first in the build tree, then in the source tree # (if the path is not absolute). The absolute path cannot be DOS-style, - # because $ac_f cannot contain `:'. + # because $ac_f cannot contain ':'. test -f "$ac_f" || case $ac_f in [\\/$]*) false;; *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; esac || - as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;; + as_fn_error 1 "cannot find input file: '$ac_f'" "$LINENO" 5;; esac case $ac_f in *\'*) ac_f=`printf "%s\n" "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac as_fn_append ac_file_inputs " '$ac_f'" done - # Let's still pretend it is `configure' which instantiates (i.e., don't + # Let's still pretend it is 'configure' which instantiates (i.e., don't # use $as_me), people would be surprised to read: # /* config.h. Generated by config.status. */ configure_input='Generated from '` @@ -8196,7 +8039,7 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 esac _ACEOF -# Neutralize VPATH when `$srcdir' = `.'. +# Neutralize VPATH when '$srcdir' = '.'. # Shell code in configure.ac might set extrasub. # FIXME: do we really want to maintain this feature? cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 @@ -8227,9 +8070,9 @@ test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } && { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \ "$ac_tmp/out"`; test -z "$ac_out"; } && - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable 'datarootdir' which seems to be undefined. Please make sure it is defined" >&5 -printf "%s\n" "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' +printf "%s\n" "$as_me: WARNING: $ac_file contains a reference to the variable 'datarootdir' which seems to be undefined. Please make sure it is defined" >&2;} rm -f "$ac_tmp/stdin" @@ -8384,15 +8227,15 @@ printf "%s\n" X/"$am_mf" | (exit $ac_status); } || am_rc=$? done if test $am_rc -ne 0; then - { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} as_fn_error $? "Something went wrong bootstrapping makefile fragments for automatic dependency tracking. If GNU make was not used, consider re-running the configure script with MAKE=\"gmake\" (or whatever is necessary). You can also try re-running configure with the '--disable-dependency-tracking' option to at least be able to build the package (albeit without support for automatic dependency tracking). -See \`config.log' for more details" "$LINENO" 5; } +See 'config.log' for more details" "$LINENO" 5; } fi { am_dirpart=; unset am_dirpart;} { am_filepart=; unset am_filepart;} diff --git a/cpu-miner.c b/cpu-miner.c index b524e2df..2a3eac0e 100644 --- a/cpu-miner.c +++ b/cpu-miner.c @@ -2840,8 +2840,6 @@ static void show_credits() static bool cpu_capability( bool display_only ) { char cpu_brand[0x40]; - bool cpu_has_aarch64 = cpu_arch_aarch64(); - bool cpu_has_x86_64 = cpu_arch_x86_64(); bool cpu_has_sse2 = has_sse2(); // X86_64 only bool cpu_has_ssse3 = has_ssse3(); // X86_64 only bool cpu_has_sse41 = has_sse41(); // X86_64 only @@ -2914,7 +2912,7 @@ static bool cpu_capability( bool display_only ) sw_arm_arch = __ARM_ARCH; #endif #endif - // x86_64_only + // x86_64 only #if defined(__SSE2__) sw_has_sse2 = true; #endif @@ -2998,57 +2996,57 @@ static bool cpu_capability( bool display_only ) #endif printf("CPU features: "); - if ( cpu_has_x86_64 ) + if ( cpu_arch_x86_64() ) { - if ( cpu_has_avx512 ) printf( " AVX512" ); - else if ( cpu_has_avx2 ) printf( " AVX2 " ); - else if ( cpu_has_avx ) printf( " AVX " ); - else if ( cpu_has_sse42 ) printf( " SSE4.2" ); - else if ( cpu_has_sse41 ) printf( " SSE4.1" ); - else if ( cpu_has_ssse3 ) printf( " SSSE3 " ); - else if ( cpu_has_sse2 ) printf( " SSE2 " ); + if ( cpu_has_avx10 ) printf( " AVX10.%d-%d", avx10_version(), + avx10_vector_length() ); + if ( cpu_has_avx512 ) printf( " AVX512" ); + else if ( cpu_has_avx2 ) printf( " AVX2 " ); + else if ( cpu_has_avx ) printf( " AVX " ); + else if ( cpu_has_sse42 ) printf( " SSE4.2" ); + else if ( cpu_has_sse41 ) printf( " SSE4.1" ); + else if ( cpu_has_ssse3 ) printf( " SSSE3 " ); + else if ( cpu_has_sse2 ) printf( " SSE2 " ); } - else if ( cpu_has_aarch64 ) + else if ( cpu_arch_aarch64() ) { if ( cpu_has_neon ) printf( " NEON" ); if ( cpu_has_sve2 ) printf( " SVE2-%d", sve_vector_length() ); - else if ( cpu_has_sve ) printf( " SVE" ); - if ( cpu_has_sme2 ) printf( " SME2" ); - else if ( cpu_has_sme ) printf( " SME" ); - } - if ( cpu_has_vaes ) printf( " VAES" ); - else if ( cpu_has_aes ) printf( " AES" ); - if ( cpu_has_sha512 ) printf( " SHA512" ); - else if ( cpu_has_sha256 ) printf( " SHA256" ); - if ( cpu_has_avx10 ) printf( " AVX10.%d-%d", - avx10_version(), avx10_vector_length() ); + else if ( cpu_has_sve ) printf( " SVE" ); + if ( cpu_has_sme2 ) printf( " SME2" ); + else if ( cpu_has_sme ) printf( " SME" ); + } + if ( cpu_has_vaes ) printf( " VAES" ); + else if ( cpu_has_aes ) printf( " AES" ); + if ( cpu_has_sha512 ) printf( " SHA512" ); + else if ( cpu_has_sha256 ) printf( " SHA256" ); printf("\nSW features: "); if ( sw_has_x86_64 ) { - if ( sw_has_avx512 ) printf( " AVX512" ); - else if ( sw_has_avx2 ) printf( " AVX2 " ); - else if ( sw_has_avx ) printf( " AVX " ); - else if ( sw_has_sse42 ) printf( " SSE4.2" ); - else if ( sw_has_sse41 ) printf( " SSE4.1" ); - else if ( sw_has_ssse3 ) printf( " SSSE3 " ); - else if ( sw_has_sse2 ) printf( " SSE2 " ); if ( sw_has_avx10_512 ) printf( " AVX10-512" ); else if ( sw_has_avx10_256 ) printf( " AVX10-256" ); + else if ( sw_has_avx512 ) printf( " AVX512" ); + else if ( sw_has_avx2 ) printf( " AVX2 " ); + else if ( sw_has_avx ) printf( " AVX " ); + else if ( sw_has_sse42 ) printf( " SSE4.2" ); + else if ( sw_has_sse41 ) printf( " SSE4.1" ); + else if ( sw_has_ssse3 ) printf( " SSSE3 " ); + else if ( sw_has_sse2 ) printf( " SSE2 " ); } else if ( sw_has_aarch64 ) { if ( sw_arm_arch ) printf( " armv%d", sw_arm_arch ); - if ( sw_has_neon ) printf( " NEON" ); - if ( sw_has_sve2 ) printf( " SVE2" ); - else if ( sw_has_sve ) printf( " SVE" ); - if ( sw_has_sme2 ) printf( " SME2" ); - else if ( sw_has_sme ) printf( " SME" ); + if ( sw_has_neon ) printf( " NEON" ); + if ( sw_has_sve2 ) printf( " SVE2" ); + else if ( sw_has_sve ) printf( " SVE" ); + if ( sw_has_sme2 ) printf( " SME2" ); + else if ( sw_has_sme ) printf( " SME" ); } - if ( sw_has_vaes ) printf( " VAES" ); - else if ( sw_has_aes ) printf( " AES" ); - if ( sw_has_sha512 ) printf( " SHA512" ); - else if ( sw_has_sha256 ) printf( " SHA256" ); + if ( sw_has_vaes ) printf( " VAES" ); + else if ( sw_has_aes ) printf( " AES" ); + if ( sw_has_sha512 ) printf( " SHA512" ); + else if ( sw_has_sha256 ) printf( " SHA256" ); if ( !display_only ) { diff --git a/miner.h b/miner.h index d42bd79f..135bca0f 100644 --- a/miner.h +++ b/miner.h @@ -191,7 +191,7 @@ static inline uint32_t swab32(uint32_t x) return __builtin_bswap32(x); #else return ( ( (x) << 24 ) & 0xff000000u ) | ( ( (x) << 8 ) & 0x00ff0000u ) - | ( ( (x) >> 8 ) & 0x0000ff00u ) | ( ( (x) >> 24 ) & 0x000000ffu ) + | ( ( (x) >> 8 ) & 0x0000ff00u ) | ( ( (x) >> 24 ) & 0x000000ffu ); // return bswap_32(v); diff --git a/simd-utils.h b/simd-utils.h index 614eecee..f40e32c6 100644 --- a/simd-utils.h +++ b/simd-utils.h @@ -141,18 +141,15 @@ #include #include -// GCC-14.1: the AVX512 macros are defined even when compiled with only -// -mavx10.1-256, causing compile errors in AVX512 code. Only with -// -mavx10.1-512 does it compile successfully. -// __EVEX512__ is set only when compiled with -mavx10.1-512. -// Adding -fno-evex512 doesn't help. -// Building with -mapxf fails on a CPU without APX because configure can't -// run its test program. +// AVX512 macros are not a reliable indicator of 512 bit vector capability +// because they get defined with AVX10_1_256 which doesn't support 512 bit. +// EVEX512 is also unreliable as it can also be defined when 512b is not +// available. +// Use AVX10_1_512 for 512b & AVX10_1_256 for 256b whenever AVX10 is present. +// Use AVX512 macros only whithout AVX10. + /* // Test for macros -#ifdef __AVX10__ -#warning "__AVX10__" -#endif #ifdef __AVX10_1__ #warning "__AVX10_1__" #endif @@ -162,39 +159,38 @@ #ifdef __AVX10_1_512__ #warning "__AVX10_1_512__" #endif +#ifdef __EVEX256__ +#warning "__EVEX256__" +#endif #ifdef __EVEX512__ #warning "__EVEX512__" #endif +#if defined(__AVX512F__) && defined(__AVX512VL__) && defined(__AVX512DQ__) && defined(__AVX512BW__) +#warning "AVX512" +#endif */ -// AVX10 complicates vector support by adding AVX512 features to CPUs without 512 bit -// vector support. AVX10.1 is just a renaming of AVX512 and is only available for -// Intel P-core only CPUs. AVX10.2 adds support for E-cores that don't support 512 bit -// vectors. The following macros simplify things. -// SIMD512: Use 512, 256 & 128 bit vectors, AVX512VBMI is not included and must be -// tested seperately. +// SIMD512: Use 512, 256 & 128 bit vectors, AVX512VBMI is not included and +// must be tested seperately. // VL256: Include AVX512VL instructions for 256 & 128 bit vectors. // VBMI: Include AVX512VBMI instructions for supported vector lengths. -// AVX10 can exist without support for 512 bit vectors. -#if defined(__AVX10_1_512__) - #define SIMD512 1 -#elif !defined(__AVX10_1__) && defined(__AVX512F__) && defined(__AVX512VL__) && defined(__AVX512DQ__) && defined(__AVX512BW__) - #define SIMD512 1 -#endif +#if defined(__AVX10_1__) -// AVX512VL instructions applied to 256 & 128 bit vectors is supported with -// either AVX512VL or AVX10. Support for CPUs without 512 bit vectors is available -// with AVX10.2. -#if defined(__AVX10_2__) || defined(__AVX10_1_512__) #define VL256 1 -#elif defined(__AVX512VL__) + #define VBMI 1 + #if defined(__AVX10_1_512__) + #define SIMD512 1 + #endif + +#elif defined(__AVX512F__) && defined(__AVX512VL__) && defined(__AVX512DQ__) && defined(__AVX512BW__) + #define VL256 1 -#endif + #define SIMD512 1 + #if defined(__AVX512VBMI__) + #define VBMI 1 + #endif -// VBMI does not exist on early versions of AVX512 -#if defined(__AVX10_1__) || defined(__AVX512VBMI__) - #define VBMI 1 #endif /* @@ -233,10 +229,6 @@ // x86_64 AVX512 512 bit vectors #include "simd-utils/simd-512.h" -// move up after cleaning -// CPU architectire abstraction -//#include "simd-utils/simd-portable.h" - // aarch64 neon 128 bit vectors #include "simd-utils/simd-neon.h" diff --git a/simd-utils/intrlv.h b/simd-utils/intrlv.h index 36343a8d..5ea55070 100644 --- a/simd-utils/intrlv.h +++ b/simd-utils/intrlv.h @@ -86,7 +86,7 @@ static inline void extr_lane_2x32( void *dst, const void *src, // 4x32 -#if ( defined(__x86_64__) && defined(__SSE2__) ) || ( defined(__aarch64__) && defined(__ARM_NEON) ) +#if defined(__x86_64__) && defined(__SSE2__) #define ILEAVE_4x32( D0, D1, D2, D3, S0, S1, S2, S3 ) \ { \ @@ -174,6 +174,7 @@ static inline void intrlv_4x32_512( void *dst, const void *src0, STOR_DEST_4x32( D0, D1, D2, D3, dst, 12, dst, 13, dst, 14, dst, 15 ); } + static inline void dintrlv_4x32( void *dst0, void *dst1, void *dst2, void *dst3, const void *src, const int bit_len ) { @@ -235,6 +236,190 @@ static inline void dintrlv_4x32_512( void *dst0, void *dst1, void *dst2, STOR_DEST_4x32( D0, D1, D2, D3, dst0, 3, dst1, 3, dst2, 3, dst3, 3 ); } +#elif defined(__aarch64__) && defined(__ARM_NEON) + +static inline void intrlv_4x32( void *dst, const void *src0, const void *src1, + const void *src2, const void *src3, const int bit_len ) +{ + uint32x4x4_t s; + + s.val[0] = casti_v128u32( src0, 0 ); + s.val[1] = casti_v128u32( src1, 0 ); + s.val[2] = casti_v128u32( src2, 0 ); + s.val[3] = casti_v128u32( src3, 0 ); + vst4q_u32( dst, s ); + + s.val[0] = casti_v128u32( src0, 1 ); + s.val[1] = casti_v128u32( src1, 1 ); + s.val[2] = casti_v128u32( src2, 1 ); + s.val[3] = casti_v128u32( src3, 1 ); + vst4q_u32( dst + 64, s ); + + if ( bit_len <= 256 ) return; + + s.val[0] = casti_v128u32( src0, 2 ); + s.val[1] = casti_v128u32( src1, 2 ); + s.val[2] = casti_v128u32( src2, 2 ); + s.val[3] = casti_v128u32( src3, 2 ); + vst4q_u32( dst + 128, s ); + + s.val[0] = casti_v128u32( src0, 3 ); + s.val[1] = casti_v128u32( src1, 3 ); + s.val[2] = casti_v128u32( src2, 3 ); + s.val[3] = casti_v128u32( src3, 3 ); + vst4q_u32( dst + 192, s ); + + if ( bit_len <= 512 ) return; + + s.val[0] = casti_v128u32( src0, 4 ); + s.val[1] = casti_v128u32( src1, 4 ); + s.val[2] = casti_v128u32( src2, 4 ); + s.val[3] = casti_v128u32( src3, 4 ); + vst4q_u32( dst + 256, s ); + + if ( bit_len <= 640 ) return; + + s.val[0] = casti_v128u32( src0, 5 ); + s.val[1] = casti_v128u32( src1, 5 ); + s.val[2] = casti_v128u32( src2, 5 ); + s.val[3] = casti_v128u32( src3, 5 ); + vst4q_u32( dst + 320, s ); + + s.val[0] = casti_v128u32( src0, 6 ); + s.val[1] = casti_v128u32( src1, 6 ); + s.val[2] = casti_v128u32( src2, 6 ); + s.val[3] = casti_v128u32( src3, 6 ); + vst4q_u32( dst + 384, s ); + + s.val[0] = casti_v128u32( src0, 7 ); + s.val[1] = casti_v128u32( src1, 7 ); + s.val[2] = casti_v128u32( src2, 7 ); + s.val[3] = casti_v128u32( src3, 7 ); + vst4q_u32( dst + 448, s ); + +// if ( bit_len <= 1024 return; +} + +static inline void intrlv_4x32_512( void *dst, const void *src0, + const void *src1, const void *src2, const void *src3 ) +{ + uint32x4x4_t s; + + s.val[0] = casti_v128u32( src0, 0 ); + s.val[1] = casti_v128u32( src1, 0 ); + s.val[2] = casti_v128u32( src2, 0 ); + s.val[3] = casti_v128u32( src3, 0 ); + vst4q_u32( dst, s ); + + s.val[0] = casti_v128u32( src0, 1 ); + s.val[1] = casti_v128u32( src1, 1 ); + s.val[2] = casti_v128u32( src2, 1 ); + s.val[3] = casti_v128u32( src3, 1 ); + vst4q_u32( dst + 64, s ); + + s.val[0] = casti_v128u32( src0, 2 ); + s.val[1] = casti_v128u32( src1, 2 ); + s.val[2] = casti_v128u32( src2, 2 ); + s.val[3] = casti_v128u32( src3, 2 ); + vst4q_u32( dst + 128, s ); + + s.val[0] = casti_v128u32( src0, 3 ); + s.val[1] = casti_v128u32( src1, 3 ); + s.val[2] = casti_v128u32( src2, 3 ); + s.val[3] = casti_v128u32( src3, 3 ); + vst4q_u32( dst + 192, s ); +} + +static inline void dintrlv_4x32( void *dst0, void *dst1, void *dst2, + void *dst3, const void *src, int bit_len ) +{ + uint32x4x4_t s = vld4q_u32( src ); + + casti_v128( dst0, 0 ) = s.val[0]; + casti_v128( dst1, 0 ) = s.val[1]; + casti_v128( dst2, 0 ) = s.val[2]; + casti_v128( dst3, 0 ) = s.val[3]; + + s = vld4q_u32( src + 64 ); + casti_v128( dst0, 1 ) = s.val[0]; + casti_v128( dst1, 1 ) = s.val[1]; + casti_v128( dst2, 1 ) = s.val[2]; + casti_v128( dst3, 1 ) = s.val[3]; + + if ( bit_len <= 256 ) return; + + s = vld4q_u32( src + 128 ); + casti_v128( dst0, 2 ) = s.val[0]; + casti_v128( dst1, 2 ) = s.val[1]; + casti_v128( dst2, 2 ) = s.val[2]; + casti_v128( dst3, 2 ) = s.val[3]; + + s = vld4q_u32( src + 192 ); + casti_v128( dst0, 3 ) = s.val[0]; + casti_v128( dst1, 3 ) = s.val[1]; + casti_v128( dst2, 3 ) = s.val[2]; + casti_v128( dst3, 3 ) = s.val[3]; + + if ( bit_len <= 512 ) return; + + s = vld4q_u32( src + 256 ); + casti_v128( dst0, 4 ) = s.val[0]; + casti_v128( dst1, 4 ) = s.val[1]; + casti_v128( dst2, 4 ) = s.val[2]; + casti_v128( dst3, 4 ) = s.val[3]; + + if ( bit_len <= 640 ) return; + + s = vld4q_u32( src + 320 ); + casti_v128( dst0, 5 ) = s.val[0]; + casti_v128( dst1, 5 ) = s.val[1]; + casti_v128( dst2, 5 ) = s.val[2]; + casti_v128( dst3, 5 ) = s.val[3]; + + s = vld4q_u32( src + 384 ); + casti_v128( dst0, 6 ) = s.val[0]; + casti_v128( dst1, 6 ) = s.val[1]; + casti_v128( dst2, 6 ) = s.val[2]; + casti_v128( dst3, 6 ) = s.val[3]; + + s = vld4q_u32( src + 448 ); + casti_v128( dst0, 6 ) = s.val[0]; + casti_v128( dst1, 6 ) = s.val[1]; + casti_v128( dst2, 6 ) = s.val[2]; + casti_v128( dst3, 6 ) = s.val[3]; + +// if ( bit_len <= 1024 ) return; +} + +static inline void dintrlv_4x32_512( void *dst0, void *dst1, void *dst2, + void *dst3, const void *src ) +{ + uint32x4x4_t s = vld4q_u32( src ); + + casti_v128( dst0, 0 ) = s.val[0]; + casti_v128( dst1, 0 ) = s.val[1]; + casti_v128( dst2, 0 ) = s.val[2]; + casti_v128( dst3, 0 ) = s.val[3]; + + s = vld4q_u32( src + 64 ); + casti_v128( dst0, 1 ) = s.val[0]; + casti_v128( dst1, 1 ) = s.val[1]; + casti_v128( dst2, 1 ) = s.val[2]; + casti_v128( dst3, 1 ) = s.val[3]; + + s = vld4q_u32( src + 128 ); + casti_v128( dst0, 2 ) = s.val[0]; + casti_v128( dst1, 2 ) = s.val[1]; + casti_v128( dst2, 2 ) = s.val[2]; + casti_v128( dst3, 2 ) = s.val[3]; + + s = vld4q_u32( src + 192 ); + casti_v128( dst0, 3 ) = s.val[0]; + casti_v128( dst1, 3 ) = s.val[1]; + casti_v128( dst2, 3 ) = s.val[2]; + casti_v128( dst3, 3 ) = s.val[3]; +} + #else // !SSE2 && !NEON static inline void intrlv_4x32( void *dst, const void *src0, const void *src1, @@ -456,15 +641,13 @@ static inline void v128_bswap32_80( void *d, void *s ) #endif -#if defined(__SSE2__) - static inline void v128_bswap32_intrlv80_4x32( void *d, const void *src ) { - v128_t s0 = casti_v128( src,0 ); - v128_t s1 = casti_v128( src,1 ); - v128_t s2 = casti_v128( src,2 ); - v128_t s3 = casti_v128( src,3 ); - v128_t s4 = casti_v128( src,4 ); + v128u32_t s0 = casti_v128u32( src,0 ); + v128u32_t s1 = casti_v128u32( src,1 ); + v128u32_t s2 = casti_v128u32( src,2 ); + v128u32_t s3 = casti_v128u32( src,3 ); + v128u32_t s4 = casti_v128u32( src,4 ); #if defined(__SSSE3__) @@ -487,79 +670,34 @@ static inline void v128_bswap32_intrlv80_4x32( void *d, const void *src ) #endif - casti_v128( d, 0 ) = _mm_shuffle_epi32( s0, 0x00 ); - casti_v128( d, 1 ) = _mm_shuffle_epi32( s0, 0x55 ); - casti_v128( d, 2 ) = _mm_shuffle_epi32( s0, 0xaa ); - casti_v128( d, 3 ) = _mm_shuffle_epi32( s0, 0xff ); + casti_v128u32( d, 0 ) = v128_duplane32( s0, 0 ); + casti_v128u32( d, 1 ) = v128_duplane32( s0, 1 ); + casti_v128u32( d, 2 ) = v128_duplane32( s0, 2 ); + casti_v128u32( d, 3 ) = v128_duplane32( s0, 3 ); - casti_v128( d, 4 ) = _mm_shuffle_epi32( s1, 0x00 ); - casti_v128( d, 5 ) = _mm_shuffle_epi32( s1, 0x55 ); - casti_v128( d, 6 ) = _mm_shuffle_epi32( s1, 0xaa ); - casti_v128( d, 7 ) = _mm_shuffle_epi32( s1, 0xff ); + casti_v128u32( d, 4 ) = v128_duplane32( s1, 0 ); + casti_v128u32( d, 5 ) = v128_duplane32( s1, 1 ); + casti_v128u32( d, 6 ) = v128_duplane32( s1, 2 ); + casti_v128u32( d, 7 ) = v128_duplane32( s1, 3 ); - casti_v128( d, 8 ) = _mm_shuffle_epi32( s2, 0x00 ); - casti_v128( d, 9 ) = _mm_shuffle_epi32( s2, 0x55 ); - casti_v128( d,10 ) = _mm_shuffle_epi32( s2, 0xaa ); - casti_v128( d,11 ) = _mm_shuffle_epi32( s2, 0xff ); + casti_v128u32( d, 8 ) = v128_duplane32( s2, 0 ); + casti_v128u32( d, 9 ) = v128_duplane32( s2, 1 ); + casti_v128u32( d,10 ) = v128_duplane32( s2, 2 ); + casti_v128u32( d,11 ) = v128_duplane32( s2, 3 ); - casti_v128( d,12 ) = _mm_shuffle_epi32( s3, 0x00 ); - casti_v128( d,13 ) = _mm_shuffle_epi32( s3, 0x55 ); - casti_v128( d,14 ) = _mm_shuffle_epi32( s3, 0xaa ); - casti_v128( d,15 ) = _mm_shuffle_epi32( s3, 0xff ); + casti_v128u32( d,12 ) = v128_duplane32( s3, 0 ); + casti_v128u32( d,13 ) = v128_duplane32( s3, 1 ); + casti_v128u32( d,14 ) = v128_duplane32( s3, 2 ); + casti_v128u32( d,15 ) = v128_duplane32( s3, 3 ); - casti_v128( d,16 ) = _mm_shuffle_epi32( s4, 0x00 ); - casti_v128( d,17 ) = _mm_shuffle_epi32( s4, 0x55 ); - casti_v128( d,18 ) = _mm_shuffle_epi32( s4, 0xaa ); - casti_v128( d,19 ) = _mm_shuffle_epi32( s4, 0xff ); + casti_v128u32( d,16 ) = v128_duplane32( s2, 0 ); + casti_v128u32( d,17 ) = v128_duplane32( s2, 1 ); + casti_v128u32( d,18 ) = v128_duplane32( s2, 2 ); + casti_v128u32( d,19 ) = v128_duplane32( s2, 3 ); } -#elif defined(__aarch64__) && defined(__ARM_NEON) - -static inline void v128_bswap32_intrlv80_4x32( void *d, const void *src ) -{ - v128_t s0 = casti_v128( src,0 ); - v128_t s1 = casti_v128( src,1 ); - v128_t s2 = casti_v128( src,2 ); - v128_t s3 = casti_v128( src,3 ); - v128_t s4 = casti_v128( src,4 ); - - s0 = v128_bswap32( s0 ); - s1 = v128_bswap32( s1 ); - s2 = v128_bswap32( s2 ); - s3 = v128_bswap32( s3 ); - s4 = v128_bswap32( s4 ); - - casti_v128( d, 0 ) = vdupq_laneq_u32( s0, 0 ); - casti_v128( d, 1 ) = vdupq_laneq_u32( s0, 1 ); - casti_v128( d, 2 ) = vdupq_laneq_u32( s0, 2 ); - casti_v128( d, 3 ) = vdupq_laneq_u32( s0, 3 ); - - casti_v128( d, 4 ) = vdupq_laneq_u32( s1, 0 ); - casti_v128( d, 5 ) = vdupq_laneq_u32( s1, 1 ); - casti_v128( d, 6 ) = vdupq_laneq_u32( s1, 2 ); - casti_v128( d, 7 ) = vdupq_laneq_u32( s1, 3 ); - - casti_v128( d, 8 ) = vdupq_laneq_u32( s2, 0 ); - casti_v128( d, 9 ) = vdupq_laneq_u32( s2, 1 ); - casti_v128( d,10 ) = vdupq_laneq_u32( s2, 2 ); - casti_v128( d,11 ) = vdupq_laneq_u32( s2, 3 ); - - casti_v128( d,12 ) = vdupq_laneq_u32( s3, 0 ); - casti_v128( d,13 ) = vdupq_laneq_u32( s3, 1 ); - casti_v128( d,14 ) = vdupq_laneq_u32( s3, 2 ); - casti_v128( d,15 ) = vdupq_laneq_u32( s3, 3 ); - - casti_v128( d,16 ) = vdupq_laneq_u32( s2, 0 ); - casti_v128( d,17 ) = vdupq_laneq_u32( s2, 1 ); - casti_v128( d,18 ) = vdupq_laneq_u32( s2, 2 ); - casti_v128( d,19 ) = vdupq_laneq_u32( s2, 3 ); -} - -#endif - // 8x32 - #if defined(__AVX2__) #define ILEAVE_8x32( D0, D1, D2, D3, D4, D5, D6, D7, \ @@ -1544,7 +1682,9 @@ static inline void mm512_bswap32_intrlv80_16x32( void *d, const void *src ) // // 64 bit data -// 2x64 SSE2, NEON +// 2x64 + +#if defined(__x86_64__) && defined(__SSE2__) static inline void intrlv_2x64( void *dst, const void *src0, const void *src1, const int bit_len ) @@ -1602,7 +1742,101 @@ static inline void dintrlv_2x64( void *dst0, void *dst1, d1[7] = v128_unpackhi64( s[14], s[15] ); } -/* +#elif defined(__aarch64__) && defined(__ARM_NEON) + +static inline void intrlv_2x64( void *dst, const void *src0, + const void *src1, const int bit_len ) +{ + uint64x2x2_t s; + + s.val[0] = casti_v128u64( src0, 0 ); + s.val[1] = casti_v128u64( src1, 0 ); + vst2q_u64( dst, s ); + + s.val[0] = casti_v128u64( src0, 1 ); + s.val[1] = casti_v128u64( src1, 1 ); + vst2q_u64( dst + 32, s ); + + if ( bit_len <= 256 ) return; + + s.val[0] = casti_v128u64( src0, 2 ); + s.val[1] = casti_v128u64( src1, 2 ); + vst2q_u64( dst + 64, s ); + + s.val[0] = casti_v128u64( src0, 3 ); + s.val[1] = casti_v128u64( src1, 3 ); + vst2q_u64( dst + 96, s ); + + if ( bit_len <= 512 ) return; + + s.val[0] = casti_v128u64( src0, 4 ); + s.val[1] = casti_v128u64( src1, 4 ); + vst2q_u64( dst + 128, s ); + + if ( bit_len <= 640 ) return; + + s.val[0] = casti_v128u64( src0, 5 ); + s.val[1] = casti_v128u64( src1, 5 ); + vst2q_u64( dst + 160, s ); + + s.val[0] = casti_v128u64( src0, 6 ); + s.val[1] = casti_v128u64( src1, 6 ); + vst2q_u64( dst + 192, s ); + + s.val[0] = casti_v128u64( src0, 7 ); + s.val[1] = casti_v128u64( src1, 7 ); + vst2q_u64( dst + 224, s ); + +// if ( bit_len <= 1024 ) return; +} + +static inline void dintrlv_2x64( void *dst0, void *dst1, + const void *src, const int bit_len ) +{ + uint64x2x2_t s = vld2q_u64( src ); + + casti_v128u64( dst0, 0 ) = s.val[0]; + casti_v128u64( dst1, 0 ) = s.val[1]; + + s = vld2q_u64( src + 32 ); + casti_v128u64( dst0, 1 ) = s.val[0]; + casti_v128u64( dst1, 1 ) = s.val[1]; + + if ( bit_len <= 256 ) return; + + s = vld2q_u64( src + 64 ); + casti_v128u64( dst0, 2 ) = s.val[0]; + casti_v128u64( dst1, 2 ) = s.val[1]; + + s = vld2q_u64( src + 96 ); + casti_v128u64( dst0, 3 ) = s.val[0]; + casti_v128u64( dst1, 3 ) = s.val[1]; + + if ( bit_len <= 512 ) return; + + s = vld2q_u64( src + 128 ); + casti_v128u64( dst0, 4 ) = s.val[0]; + casti_v128u64( dst1, 4 ) = s.val[1]; + + if ( bit_len <= 640 ) return; + + s = vld2q_u64( src + 160 ); + casti_v128u64( dst0, 5 ) = s.val[0]; + casti_v128u64( dst1, 5 ) = s.val[1]; + + s = vld2q_u64( src + 192 ); + casti_v128u64( dst0, 6 ) = s.val[0]; + casti_v128u64( dst1, 6 ) = s.val[1]; + + s = vld2q_u64( src + 224 ); + casti_v128u64( dst0, 7 ) = s.val[0]; + casti_v128u64( dst1, 7 ) = s.val[1]; + +// if ( bit_len <= 1024 ) return; +} + +#else + static inline void intrlv_2x64( void *dst, const void *src0, const void *src1, const int bit_len ) { @@ -1621,8 +1855,7 @@ static inline void intrlv_2x64( void *dst, const void *src0, d[24] = s0[12]; d[25] = s1[12]; d[26] = s0[13]; d[27] = s1[13]; d[28] = s0[14]; d[29] = s1[14]; d[30] = s0[15]; d[31] = s1[15]; } -*/ -/* + static inline void dintrlv_2x64( void *dst0, void *dst1, const void *src, const int bit_len ) { @@ -1642,15 +1875,16 @@ static inline void dintrlv_2x64( void *dst0, void *dst1, d0[12] = s[24]; d1[12] = s[25]; d0[13] = s[26]; d1[13] = s[27]; d0[14] = s[28]; d1[14] = s[29]; d0[15] = s[30]; d1[15] = s[31]; } -*/ + +#endif static inline void v128_bswap32_intrlv80_2x64( void *d, const void *src ) { - v128_t s0 = casti_v128( src,0 ); - v128_t s1 = casti_v128( src,1 ); - v128_t s2 = casti_v128( src,2 ); - v128_t s3 = casti_v128( src,3 ); - v128_t s4 = casti_v128( src,4 ); + v128u64_t s0 = casti_v128u64( src,0 ); + v128u64_t s1 = casti_v128u64( src,1 ); + v128u64_t s2 = casti_v128u64( src,2 ); + v128u64_t s3 = casti_v128u64( src,3 ); + v128u64_t s4 = casti_v128u64( src,4 ); #if defined(__SSSE3__) @@ -1673,41 +1907,20 @@ static inline void v128_bswap32_intrlv80_2x64( void *d, const void *src ) #endif -#if defined(__SSE2__) + casti_v128u64( d,0 ) = v128_duplane64( s0, 0 ); + casti_v128u64( d,1 ) = v128_duplane64( s0, 1 ); - casti_v128( d,0 ) = _mm_shuffle_epi32( s0, 0x44 ); - casti_v128( d,1 ) = _mm_shuffle_epi32( s0, 0xee ); + casti_v128u64( d,2 ) = v128_duplane64( s1, 0 ); + casti_v128u64( d,3 ) = v128_duplane64( s1, 1 ); - casti_v128( d,2 ) = _mm_shuffle_epi32( s1, 0x44 ); - casti_v128( d,3 ) = _mm_shuffle_epi32( s1, 0xee ); + casti_v128u64( d,4 ) = v128_duplane64( s2, 0 ); + casti_v128u64( d,5 ) = v128_duplane64( s2, 1 ); - casti_v128( d,4 ) = _mm_shuffle_epi32( s2, 0x44 ); - casti_v128( d,5 ) = _mm_shuffle_epi32( s2, 0xee ); + casti_v128u64( d,6 ) = v128_duplane64( s3, 0 ); + casti_v128u64( d,7 ) = v128_duplane64( s3, 1 ); - casti_v128( d,6 ) = _mm_shuffle_epi32( s3, 0x44 ); - casti_v128( d,7 ) = _mm_shuffle_epi32( s3, 0xee ); - - casti_v128( d,8 ) = _mm_shuffle_epi32( s4, 0x44 ); - casti_v128( d,9 ) = _mm_shuffle_epi32( s4, 0xee ); - -#elif defined(__ARM_NEON) - - casti_v128u64( d,0 ) = vdupq_laneq_u64( (uint64x2_t)s0, 0 ); - casti_v128u64( d,1 ) = vdupq_laneq_u64( (uint64x2_t)s0, 1 ); - - casti_v128u64( d,2 ) = vdupq_laneq_u64( (uint64x2_t)s1, 0 ); - casti_v128u64( d,3 ) = vdupq_laneq_u64( (uint64x2_t)s1, 1 ); - - casti_v128u64( d,4 ) = vdupq_laneq_u64( (uint64x2_t)s2, 0 ); - casti_v128u64( d,5 ) = vdupq_laneq_u64( (uint64x2_t)s2, 1 ); - - casti_v128u64( d,6 ) = vdupq_laneq_u64( (uint64x2_t)s3, 0 ); - casti_v128u64( d,7 ) = vdupq_laneq_u64( (uint64x2_t)s3, 1 ); - - casti_v128u64( d,8 ) = vdupq_laneq_u64( (uint64x2_t)s4, 0 ); - casti_v128u64( d,9 ) = vdupq_laneq_u64( (uint64x2_t)s4, 1 ); - -#endif + casti_v128u64( d,8 ) = v128_duplane64( s4, 0 ); + casti_v128u64( d,9 ) = v128_duplane64( s4, 1 ); } static inline void extr_lane_2x64( void *dst, const void *src, diff --git a/simd-utils/simd-128.h b/simd-utils/simd-128.h index d0c63ac5..07748385 100644 --- a/simd-utils/simd-128.h +++ b/simd-utils/simd-128.h @@ -439,11 +439,11 @@ static inline void v128_memcpy( v128_t *dst, const v128_t *src, const int n ) #define v128_ornot( v1, v0 ) _mm_or_si128( v128_not( v1 ), v0 ) -#define v128_xor3( a, b, c ) _mm_xor_si128( a, _mm_xor_si128( b, c ) ) +#define v128_xor3( a, b, c ) _mm_xor_si128( _mm_xor_si128( a, b ), c ) -#define v128_and3( a, b, c ) _mm_and_si128( a, _mm_and_si128( b, c ) ) +#define v128_and3( a, b, c ) _mm_and_si128( _mm_and_si128( a, b ), c ) -#define v128_or3( a, b, c ) _mm_or_si128( a, _mm_or_si128( b, c ) ) +#define v128_or3( a, b, c ) _mm_or_si128( _mm_or_si128( a, b ), c ) #define v128_xorand( a, b, c ) _mm_xor_si128( a, _mm_and_si128( b, c ) ) diff --git a/simd-utils/simd-256.h b/simd-utils/simd-256.h index 07e69b28..8646dbea 100644 --- a/simd-utils/simd-256.h +++ b/simd-utils/simd-256.h @@ -174,17 +174,22 @@ static inline __m256i mm256_not( const __m256i v ) #define mm256_ornot( v1, v0 ) _mm256_or_si256( mm256_not( v1 ), v0 ) +// usage hints to improve performance when ternary logic is not avalable: +// If overwriting an input arg put that arg first so the intermediate +// result can be stored in the dest. +// Put an arg with the nearest dependency last so independant args can be +// processed first. #define mm256_xor3( a, b, c ) \ - _mm256_xor_si256( a, _mm256_xor_si256( b, c ) ) + _mm256_xor_si256( _mm256_xor_si256( a, b ), c ) #define mm256_xor4( a, b, c, d ) \ _mm256_xor_si256( _mm256_xor_si256( a, b ), _mm256_xor_si256( c, d ) ) #define mm256_and3( a, b, c ) \ - _mm256_and_si256( a, _mm256_and_si256( b, c ) ) + _mm256_and_si256( _mm256_and_si256( a, b ), c ) #define mm256_or3( a, b, c ) \ - _mm256_or_si256( a, _mm256_or_si256( b, c ) ) + _mm256_or_si256( _mm256_or_si256( a, b ), c ) #define mm256_xorand( a, b, c ) \ _mm256_xor_si256( a, _mm256_and_si256( b, c ) ) diff --git a/simd-utils/simd-int.h b/simd-utils/simd-int.h index 035d527f..e4bdff86 100644 --- a/simd-utils/simd-int.h +++ b/simd-utils/simd-int.h @@ -2,7 +2,7 @@ #define SIMD_INT_H__ 1 //TODO compile time test for byte order -// be64 etc using HW bowap. +// be64 etc using HW bswap. // // Endian byte swap #if defined(__x86_64__) @@ -94,7 +94,7 @@ static inline uint16_t be16( const uint16_t u16 ) return ( (uint16_t)(p[3]) ) + ( (uint16_t)(p[2]) << 8 ); } -static inline uint32_t le162( const uint16_t u16 ) +static inline uint32_t le16( const uint16_t u16 ) { const uint8_t *p = (uint8_t const *)&u16; return ( (uint16_t)(p[0]) ) + ( (uint16_t)(p[1]) << 8 ); @@ -112,7 +112,7 @@ static inline uint32_t le162( const uint16_t u16 ) #elif defined(__aarch64__) // Documentation is vague, ror exists but is ambiguous. Docs say it can -// do 32 or 64 registers. Assuming that is architecture specific andcan +// do 32 or 64 bit registers. Assuming that is architecture specific and can // only do 32 bit on 32 bit arch. Rarely used so not a big issue. static inline uint64_t ror64( uint64_t a, const int c ) { diff --git a/simd-utils/simd-neon.h b/simd-utils/simd-neon.h index 1e7302f3..97e74ece 100644 --- a/simd-utils/simd-neon.h +++ b/simd-utils/simd-neon.h @@ -93,6 +93,8 @@ #define v128_cmplt16( v1, v0 ) vcltq_s16( (int16x8_t)v1, (int16x8_t)(v0) ) #define v128_cmplt8( v1, v0 ) vcltq_s8( (int8x16_t)v1, (int8x16_t)(v0) ) +#define v128_cmpeq_zero vceqzq_u64 + // Logical bit shift #define v128_sl64 vshlq_n_u64 #define v128_sl32 vshlq_n_u32 @@ -135,14 +137,14 @@ #if defined(__ARM_FEATURE_SHA3) #define v128_xor3 veor3q_u32 #else - #define v128_xor3( v2, v1, v0 ) veorq_u32( v2, veorq_u32( v1, v0 ) ) + #define v128_xor3( v2, v1, v0 ) veorq_u32( veorq_u32( v2, v1 ), v0 ) #endif // v2 & v1 & v0 -#define v128_and3( v2, v1, v0 ) v128_and( v2, v128_and( v1, v0 ) ) +#define v128_and3( v2, v1, v0 ) v128_and( v128_and( v2, v1 ), v0 ) // v2 | v1 | v0 -#define v128_or3( v2, v1, v0 ) v128_or( v2, v128_or( v1, v0 ) ) +#define v128_or3( v2, v1, v0 ) v128_or( v128_or( v2, v1 ), v0 ) // v2 ^ ( ~v1 & v0 ) #if defined(__ARM_FEATURE_SHA3) @@ -178,6 +180,7 @@ #define v128_unpacklo8( v1, v0 ) vzip1q_u8( v1, v0 ) #define v128_unpackhi8( v1, v0 ) vzip2q_u8( v1, v0 ) +// vzipq_u32 can do hi & lo and return uint32x4x2, no 64 bit version. // AES // consistent with Intel AES intrinsics, break up for optimizing @@ -237,18 +240,15 @@ typedef union #define cast_v128u32( p ) (*((uint32x4_t*)(p))) #define castp_v128u32( p ) ((uint32x4_t*)(p)) -#define v128_zero v128_64( 0ull ) - -#define v128_cmpeq_zero vceqzq_u64 - -#define v128_neg1 v128_64( 0xffffffffffffffffull ) - // set1 #define v128_64 vmovq_n_u64 #define v128_32 vmovq_n_u32 #define v128_16 vmovq_n_u16 #define v128_8 vmovq_n_u8 +#define v128_zero v128_64( 0ull ) +#define v128_neg1 v128_64( 0xffffffffffffffffull ) + #define v64_set32( u32_1, u32_0 ) \ vcreate_u32( ( (uint64_t)(u32_1) << 32 ) | (uint64_t)(u32_0) ) @@ -357,28 +357,23 @@ static inline void v128_memcpy( void *dst, const void *src, const int n ) ((uint16x8_t)(v)), c ) #define v128_rol16( v, c ) \ - ( (c) == 8 ) ? (uint16x8_t)vrev16q_u8( ((uint8x16_t)v) ) \ + ( (c) == 8 ) ? (uint16x8_t)vrev16q_u8( ((uint8x16_t)(v)) ) \ : vsliq_n_u16( vshrq_n_u16( ((uint16x8_t)(v)), 16-(c) ), \ ((uint16x8_t)(v)), c ) #define v128_ror8( v, c ) \ - vsriq_n_u8( vshlq_n_u8( ((uint8x16_t)(v)), 8-(c) ), \ + vsriq_n_u8( vshlq_n_u8( ((uint8x16_t)(v)), 8-(c) ), \ ((uint8x16_t)(v)), c ) #define v128_rol8( v, c ) \ - vsliq_n_u8( vshrq_n_u8( ((uint8x16_t)(v)), 8-(c) ), \ + vsliq_n_u8( vshrq_n_u8( ((uint8x16_t)(v)), 8-(c) ), \ ((uint8x16_t)(v)), c ) - -// ( v1 ^ v0 ) >>> n +// ( v1 ^ v0 ) >>> c #if defined(__ARM_FEATURE_SHA3) - -#define v128_ror64xor( v1, v0, n ) vxarq_u64( v1, v0, n ) - + #define v128_ror64xor( v1, v0, c ) vxarq_u64( v1, v0, c ) #else - -#define v128_ror64xor( v1, v0, n ) v128_ror64( v128_xor( v1, v0 ), n ) - + #define v128_ror64xor( v1, v0, c ) v128_ror64( v128_xor( v1, v0 ), c ) #endif #define v128_2ror64( v1, v0, c ) \ @@ -411,7 +406,7 @@ static inline void v128_memcpy( void *dst, const void *src, const int n ) v1 = vorrq_u32( v1, t1 ); \ } -#define v128_2rorx32( v1, v0, c ) \ +#define v128_2ror32( v1, v0, c ) \ { \ uint32x4_t t0 = vshlq_n_u32( v0, c ); \ uint32x4_t t1 = vshlq_n_u32( v1, c ); \ @@ -444,9 +439,9 @@ static inline void v128_memcpy( void *dst, const void *src, const int n ) #define v128_lrev16 vrev32q_u16 // aka bswap -#define v128_qrev8 vrev64q_u8 -#define v128_lrev8 vrev32q_u8 -#define v128_wrev8 vrev16q_u8 +// #define v128_qrev8 vrev64q_u8 +// #define v128_lrev8 vrev32q_u8 +// #define v128_wrev8 vrev16q_u8 // full vector rotation @@ -471,9 +466,9 @@ static inline uint32x4_t v128_shufll32( uint32x4_t v ) #define v128_bswap16(v) (uint16x8_t)vrev16q_u8( (uint8x16_t)(v) ) #define v128_bswap32(v) (uint32x4_t)vrev32q_u8( (uint8x16_t)(v) ) #define v128_bswap64(v) (uint64x2_t)vrev64q_u8( (uint8x16_t)(v) ) -#define v128_bswap128(v) (uint32x4_t)v128_swap64( v128_bswap64(v) ) +#define v128_bswap128(v) (uint32x4_t)v128_rev64( v128_bswap64(v) ) -// Usefull for x86_64 but does nothing for ARM +// Useful for x86_64 but does nothing for ARM #define v128_block_bswap32( dst, src ) \ { \ casti_v128u32( dst,0 ) = v128_bswap32( casti_v128u32( src,0 ) ); \ @@ -542,7 +537,7 @@ static inline uint32x4_t v128_shufll32( uint32x4_t v ) // Bitwise blend using vector mask, use only bytewise for compatibility // with x86_64. -#define v128_blendv( v1, v0, mask ) vbslq_u32( mask, v1, v0 ) +#define v128_blendv( v1, v0, mask ) vbslq_u32( mask, v0, v1 ) #endif // __ARM_NEON #endif // SIMD_NEON_H__ diff --git a/simd-utils/simd-sve.h b/simd-utils/simd-sve.h index 7fabfe3a..eea231da 100644 --- a/simd-utils/simd-sve.h +++ b/simd-utils/simd-sve.h @@ -1,25 +1,152 @@ // Placeholder for now. // -// This file will hold AArch64 SVE code, a replecement for NEON that uses vector length -// agnostic instructions. This means the same code can be used on CPUs with different -// SVE vector register lengths. This is not good for vectorized hashing. +// This file will hold AArch64 SVE code, a replecement for NEON that uses +// vector length agnostic instructions. This means the same code can be used +// on CPUs with different SVE vector register lengths. This is not good for +// vectorized hashing. // Optimum hash is sensitive to the vector register length with different code -// used for different register sizes. On X86_64 the vector length is tied to the CPU -// feature making it simple and efficient to handle different lengths although it -// results in multiple executables. Theoretically SVE could use a single executable for -// any vector length. +// used for different register sizes. On X86_64 the vector length is tied to +// the CPU feature making it simple and efficient to handle different lengths +// although it results in multiple executables. Theoretically SVE could use a +// single executable for any vector length. // -// With the SVE vector length only known at run time it resultis in run time overhead -// to test the vector length. Theoretically it could be tested at program loading and -// appropriate libraries loaded. However I don't know if this can be done and if so -// how to do it. +// With the SVE vector length only known at run time it results in run time +// overhead to test the vector length. Theoretically it could be tested at +// program loading and appropriate libraries loaded. However I don't know if +// this can be done and if specified how to do it. // // SVE is not expected to be used for 128 bit vectors as it does not provide any // advantages over NEON. However, it may be implemented for testing purposes -// because CPU with registers larger than 128 bits are currently very rare and very -// expensive server class CPUs. +// because CPU with registers larger than 128 bits are currently very rare and +// very expensive server class CPUs. // -// N-way parallel hashing could be the best use of SVE, usimg the same code for all -// vector lengths with the only variable being the number of lanes. This will still -// require run time checking but should be lighter than substituting functions. +// However, 128 bit vectors also need to be supported with 256 bit registers. +// This could be a challenge for un-predicated functions. +// +// N-way parallel hashing could be the best use of SVE, usimg the same code +// for all vector lengths with the only variable being the number of lanes. +// This will still require run time checking but should be lighter than +// substituting functions. + +// Current approach is to hard code the length in these intrinsics and called +// by existing length specific code. +// define with sv_ prefix for generic use predicate provided by caller, +// use sv_ with hard coded predicate. +// v_ only if and when it's compatible with SSE & NEON + +// Many instructions have no predicate operand, how is VVL handled? +// How does the CPU know how long the vector is and whether it spans +// multiple registers without the predicate? + +// Also how does the predicate define the vector size? How to tell if inactive +// high lanes are part of the vector or beyond its range. +// +// Some intructions may have an implied predicate by other arguments. +// TBL for example will only have shuffle indexes for active lanes. +// However this is dependant on software being aware of register size. + + + +#if 0 +// #if defined USE_SV128 +// NEON needs to be disabled + +#define PRED128 0xffff +#define PRED256 0xffffffff + +// Types should be transparent + + +#define sv128u32_t svuint32_t +#define sv256u32_t svuint32_t + + +// load1 + + +// arithmetic + +// _z zero inactive elements, _x undefined inactive elements, _m inactive +// elements from first arg. arg order only matters when _m used. Use _x. + +#define sv_add32( p, v1, v0 ) svadd_u32_x( p, v1, v0 ) + +#define sv128_add32( v1, v0 ) svadd_u32_x( PRED128, v1, v0 ) +#define sv256_add32( v1, v0 ) svadd_u32_x( PRED256, v1, v0 ) + +// Add integer to each element +#define sv_addi32( p, v, i ) svadd_n_u32_x( p, v, i ) + + + +// compare + +#define sv_cmpeq32( p, v1, v0 ) svcmpeq_u32( p, v1, v0 ) + +#define sv128_cmpeq32( v1, v0 ) svcmpeq_u32( PRED128, v1, v0 ) +#define sv256_cmpeq32( v1, v0 ) svcmpeq_u32( PRED256, v1, v0 ) + + +// bit shift + +#define sv_sl32( v, c ) svlsl_n_u32_x( p, v, c ) + +#define sv128_sl32( v, c ) svlsl_n_u32_x( PRED128, v, c ) +#define sv256_sl32( v, c ) svlsl_n_u32_x( PRED256, v, c ) + + +// logic + +#define sv_or( p, v1, v0 ) svorr_u32_x( p, v1, v0 ) + +#define sv128_or( v1, v0 ) svorr_u32_x( PRED128, v1, v0 ) +#define sv256_or( v1, v0 ) svorr_u32_x( PRED256, v1, v0 ) + +// ext used for alignr, and zip used for unpack have no predicate arg. +// How is vector length determined? How are register sizes handled? +// How are part registers handled? + +// alignr (ext) + +// unpack + + +// AES + +// AES uses fixed 128 bit vectors, how does this work with larger registers? + +// set1 + +#define sv128_32( n ) svdup_n_u32_x( PRED128, n ) +#define sv256_32( n ) svdup_n_u32_x( PRED256, n ) + +// broadcast + +// svdup_lane has no predicate + +// constants + + +// pointer cast + + +// Bit rotation + +// No predication for shift instructions + +// Cross lane shuffles + +// Very limited shuffling, mostly svtbl which has no predicate and uses +// vector for the index. + + +// endian byte swap + + +#define sv128_bswap32(v) svrevb_u32_x( p, v ) + + +// blend + +#enfif diff --git a/sysinfos.c b/sysinfos.c index de7f4c0a..220e3014 100644 --- a/sysinfos.c +++ b/sysinfos.c @@ -316,6 +316,7 @@ static inline void cpuid( unsigned int leaf, unsigned int subleaf, // included in the compile. // This can occur if compiling with an old kernel and a new CPU and could // result in a suboptimal build. +// leaf and subleaf arguments are ignored. static inline void cpuid( unsigned int leaf, unsigned int subleaf, unsigned int output[4] ) @@ -365,7 +366,8 @@ static inline void cpuid( unsigned int leaf, unsigned int subleaf, } #else -#define cpuid(leaf, subleaf, out) out[0] = 0; +#define cpuid( leaf, subleaf, output ) \ + output[0] = output[1] = output[2] = output[3] = 0; #endif static inline void cpu_getname(char *outbuf, size_t maxsz)