This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [WIP PATCH] Add int128 detection
- From: OndÅej BÃlka <neleai at seznam dot cz>
- To: Roland McGrath <roland at hack dot frob dot com>
- Cc: libc-alpha at sourceware dot org
- Date: Mon, 24 Feb 2014 16:01:22 +0100
- Subject: Re: [WIP PATCH] Add int128 detection
- Authentication-results: sourceware.org; auth=none
- References: <20140221143228 dot GA11081 at domone dot podge> <20140221175706 dot DB67E7449E at topped-with-meat dot com>
On Fri, Feb 21, 2014 at 09:57:06AM -0800, Roland McGrath wrote:
> Use AC_CACHE_CHECK.
Here.
* config.h.in (HAVE_INT128): New macro.
* configure.ac: Add HAVE_INT128 check.
diff --git a/config.h.in b/config.h.in
index 40797e7..efb8f19 100644
--- a/config.h.in
+++ b/config.h.in
@@ -192,6 +192,10 @@
/* Define if STT_GNU_IFUNC support actually works. */
#undef HAVE_IFUNC
+/* Define if int128 type is usable. */
+#undef HAVE_INT128
+
+
/* Define if linux/fanotify.h is available. */
#undef HAVE_LINUX_FANOTIFY_H
diff --git a/configure.ac b/configure.ac
index f3dd87d..b49c586 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2114,6 +2114,19 @@ if test "x$build_nscd" = xdefault; then
build_nscd=$use_nscd
fi
+
+AC_CACHE_CHECK(if compiler supports __int128,libc_cv_have_int128,[dnl,
+ AC_TRY_COMPILE([#include <stdint.h>],
+ [ __int128 a = 0;
+ unsigned __int128 b = 1;
+ a = a + b;
+ a = a * b;
+ return 0;], libc_cv_have_int128=yes, libc_cv_have_int128=no)])
+
+if test "x$libc_cv_have_int128" = xyes; then
+ AC_DEFINE([HAVE_INT128])
+fi
+
# Test for old glibc 2.0.x headers so that they can be removed properly
# Search only in includedir.
AC_MSG_CHECKING(for old glibc 2.0.x headers)