Skip to content

Commit

Permalink
Don't check for popcount, clz, ctz or __builtin_constant_p
Browse files Browse the repository at this point in the history
flint_clz and flint_ctz will be set during configuration based on which
longlong file to use. __builtin_constant_p will be defined only if
__GNUC__ is defined.
  • Loading branch information
albinahlback committed Nov 19, 2023
1 parent 5a7bc0e commit 71e3311
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 43 deletions.
9 changes: 0 additions & 9 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -175,15 +175,6 @@ check_c_compiler_flag("-funroll-loops" HAS_FLAG_UNROLL_LOOPS)
if(HAS_FLAG_MPOPCNT)
set(CMAKE_REQUIRED_FLAGS "-mpopcnt")
endif()
# Testing __builtin_popcountl...
check_c_source_runs([[int main(int argc, char ** argv) {
#if defined(_WIN64)
return __builtin_popcountll(argc) == 100;
#else
return __builtin_popcountl(argc) == 100;
#endif
}]] FLINT_USES_POPCNT)
unset(CMAKE_REQUIRED_FLAGS)

# fenv configuration
check_c_source_compiles([[#include <fenv.h>
Expand Down
34 changes: 0 additions & 34 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -848,40 +848,6 @@ AC_MSG_ERROR([Couldn't find alloca, which is required for FLINT. Please submit a
report to <https://github.com/flintlib/flint/issues/> and specify your
operating system.])])

AC_MSG_CHECKING([if $CC has CLZ intrinsics])
AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM([],[long int x = __builtin_clzl(3);])],
[AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM([],[long long int x = __builtin_clzll(3);])],
[AC_MSG_RESULT([yes])
has_clz="yes"
AC_DEFINE(FLINT_HAS_CLZ,1,[Define if compiler has CLZ intrinsics])],
[AC_MSG_RESULT([no])]
)],
[AC_MSG_RESULT([no])]
)

AC_MSG_CHECKING([if $CC has CTZ intrinsics])
AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM([],[long int x = __builtin_ctzl(3);])],
[AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM([],[long long int x = __builtin_ctzll(3);])],
[AC_MSG_RESULT([yes])
has_ctz="yes"
AC_DEFINE(FLINT_HAS_CTZ,1,[Define if compiler has CTZ intrinsics])],
[AC_MSG_RESULT([no])]
)],
[AC_MSG_RESULT([no])]
)

AC_MSG_CHECKING([if $CC has __builtin_constant_p])
AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM([], [int a = __builtin_constant_p(0 == 1);])],
[AC_MSG_RESULT([yes])
AC_DEFINE(FLINT_HAVE_CONSTANT_P,1,[Define if compiler has __builtin_constant_p])],
[AC_MSG_RESULT([no])]
)

################################################################################
# CFLAGS
################################################################################
Expand Down

0 comments on commit 71e3311

Please sign in to comment.