This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [WIP PATCH] Add int128 detection


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)


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]