@@ -38,60 +38,6 @@ ac_c_werror_flag=$ac_save_c_werror_flag
38
38
] ) # PGAC_TEST_PRINTF_ARCHETYPE
39
39
40
40
41
- # PGAC_TYPE_64BIT_INT(TYPE)
42
- # -------------------------
43
- # Check if TYPE is a working 64 bit integer type. Set HAVE_TYPE_64 to
44
- # yes or no respectively, and define HAVE_TYPE_64 if yes.
45
- AC_DEFUN ( [ PGAC_TYPE_64BIT_INT] ,
46
- [ define ( [ Ac_define] , [ translit ( [ have_$1 _64] , [ a-z *] , [ A-Z_P] ) ] ) dnl
47
- define ( [ Ac_cachevar] , [ translit ( [ pgac_cv_type_$1 _64] , [ *] , [ _p] ) ] ) dnl
48
- AC_CACHE_CHECK ( [ whether $1 is 64 bits] , [ Ac_cachevar] ,
49
- [ AC_RUN_IFELSE ( [ AC_LANG_SOURCE (
50
- [ typedef $1 ac_int64;
51
-
52
- /*
53
- * These are globals to discourage the compiler from folding all the
54
- * arithmetic tests down to compile-time constants.
55
- */
56
- ac_int64 a = 20000001;
57
- ac_int64 b = 40000005;
58
-
59
- int does_int64_work()
60
- {
61
- ac_int64 c,d;
62
-
63
- if (sizeof(ac_int64) != 8)
64
- return 0; /* definitely not the right size */
65
-
66
- /* Do perfunctory checks to see if 64-bit arithmetic seems to work */
67
- c = a * b;
68
- d = (c + b) / b;
69
- if (d != a+1)
70
- return 0;
71
- return 1;
72
- }
73
-
74
- int
75
- main() {
76
- return (! does_int64_work());
77
- }] ) ] ,
78
- [ Ac_cachevar=yes] ,
79
- [ Ac_cachevar=no] ,
80
- [ # If cross-compiling, check the size reported by the compiler and
81
- # trust that the arithmetic works.
82
- AC_COMPILE_IFELSE ( [ AC_LANG_BOOL_COMPILE_TRY([ ] , [ sizeof($1 ) == 8] )] ,
83
- Ac_cachevar=yes ,
84
- Ac_cachevar=no ) ] ) ] )
85
-
86
- Ac_define=$Ac_cachevar
87
- if test x"$Ac_cachevar" = xyes ; then
88
- AC_DEFINE ( Ac_define , 1 , [ Define to 1 if `] $1 [ ' works and is 64 bits.] )
89
- fi
90
- undefine ( [ Ac_define] ) dnl
91
- undefine ( [ Ac_cachevar] ) dnl
92
- ] ) # PGAC_TYPE_64BIT_INT
93
-
94
-
95
41
# PGAC_TYPE_128BIT_INT
96
42
# --------------------
97
43
# Check if __int128 is a working 128 bit integer type, and if so
@@ -270,9 +216,10 @@ fi])# PGAC_C_BUILTIN_CONSTANT_P
270
216
AC_DEFUN ( [ PGAC_C_BUILTIN_OP_OVERFLOW] ,
271
217
[ AC_CACHE_CHECK ( for __builtin_mul_overflow , pgac_cv__builtin_op_overflow ,
272
218
[ AC_LINK_IFELSE ( [ AC_LANG_PROGRAM ( [
273
- PG_INT64_TYPE a = 1;
274
- PG_INT64_TYPE b = 1;
275
- PG_INT64_TYPE result;
219
+ #include <stdint.h>
220
+ int64_t a = 1;
221
+ int64_t b = 1;
222
+ int64_t result;
276
223
int oflo;
277
224
] ,
278
225
[ oflo = __builtin_mul_overflow(a, b, &result);] ) ] ,
@@ -557,13 +504,13 @@ fi])# PGAC_HAVE_GCC__SYNC_INT32_CAS
557
504
# types, and define HAVE_GCC__SYNC_INT64_CAS if so.
558
505
AC_DEFUN ( [ PGAC_HAVE_GCC__SYNC_INT64_CAS] ,
559
506
[ AC_CACHE_CHECK ( for builtin __sync int64 atomic operations , pgac_cv_gcc_sync_int64_cas ,
560
- [ AC_LINK_IFELSE ( [ AC_LANG_PROGRAM ( [ ] ,
561
- [ PG_INT64_TYPE lock = 0;
562
- __sync_val_compare_and_swap(&lock, 0, (PG_INT64_TYPE ) 37);] ) ] ,
507
+ [ AC_LINK_IFELSE ( [ AC_LANG_PROGRAM ( [ #include <stdint.h> ] ,
508
+ [ int64_t lock = 0;
509
+ __sync_val_compare_and_swap(&lock, 0, (int64_t ) 37);] ) ] ,
563
510
[ pgac_cv_gcc_sync_int64_cas="yes"] ,
564
511
[ pgac_cv_gcc_sync_int64_cas="no"] ) ] )
565
512
if test x"$pgac_cv_gcc_sync_int64_cas" = x"yes"; then
566
- AC_DEFINE ( HAVE_GCC__SYNC_INT64_CAS , 1 , [ Define to 1 if you have __sync_val_compare_and_swap(int64 *, int64, int64 ).] )
513
+ AC_DEFINE ( HAVE_GCC__SYNC_INT64_CAS , 1 , [ Define to 1 if you have __sync_val_compare_and_swap(int64_t *, int64_t, int64_t ).] )
567
514
fi] ) # PGAC_HAVE_GCC__SYNC_INT64_CAS
568
515
569
516
# PGAC_HAVE_GCC__ATOMIC_INT32_CAS
@@ -588,9 +535,9 @@ fi])# PGAC_HAVE_GCC__ATOMIC_INT32_CAS
588
535
# types, and define HAVE_GCC__ATOMIC_INT64_CAS if so.
589
536
AC_DEFUN ( [ PGAC_HAVE_GCC__ATOMIC_INT64_CAS] ,
590
537
[ AC_CACHE_CHECK ( for builtin __atomic int64 atomic operations , pgac_cv_gcc_atomic_int64_cas ,
591
- [ AC_LINK_IFELSE ( [ AC_LANG_PROGRAM ( [ ] ,
592
- [ PG_INT64_TYPE val = 0;
593
- PG_INT64_TYPE expect = 0;
538
+ [ AC_LINK_IFELSE ( [ AC_LANG_PROGRAM ( [ #include <stdint.h> ] ,
539
+ [ int64_t val = 0;
540
+ int64_t expect = 0;
594
541
__atomic_compare_exchange_n(&val, &expect, 37, 0, __ATOMIC_SEQ_CST, __ATOMIC_RELAXED);] ) ] ,
595
542
[ pgac_cv_gcc_atomic_int64_cas="yes"] ,
596
543
[ pgac_cv_gcc_atomic_int64_cas="no"] ) ] )
@@ -734,13 +681,14 @@ AC_DEFUN([PGAC_AVX512_POPCNT_INTRINSICS],
734
681
[ define ( [ Ac_cachevar] , [ AS_TR_SH ( [ pgac_cv_avx512_popcnt_intrinsics] ) ] ) dnl
735
682
AC_CACHE_CHECK ( [ for _mm512_popcnt_epi64] , [ Ac_cachevar] ,
736
683
[ AC_LINK_IFELSE ( [ AC_LANG_PROGRAM ( [ #include <immintrin.h>
684
+ #include <stdint.h>
737
685
#if defined(__has_attribute) && __has_attribute (target)
738
686
__attribute__((target("avx512vpopcntdq,avx512bw")))
739
687
#endif
740
688
static int popcount_test(void)
741
689
{
742
690
const char buf@<:@ sizeof(__m512i)@:>@ ;
743
- PG_INT64_TYPE popcnt = 0;
691
+ int64_t popcnt = 0;
744
692
__m512i accum = _mm512_setzero_si512();
745
693
const __m512i val = _mm512_maskz_loadu_epi8((__mmask64) 0xf0f0f0f0f0f0f0f0, (const __m512i *) buf);
746
694
const __m512i cnt = _mm512_popcnt_epi64(val);
0 commit comments