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]

[WIP PATCH] Add int128 detection


Hi, as best implementation of saturated arithmetic looks by using a type
with double size and letting gcc optimize that away we need to add a
detection for that.

I have technical problem with this as debian ships only autoconfs 2.67
and 2.69 while required version is 2.68 and my aclocal does not generate
aclocal.m4. Is that known problem or could somebody regenerate configure
for this patch?



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..4fd2e0e 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2114,6 +2114,19 @@ if test "x$build_nscd" = xdefault; then
   build_nscd=$use_nscd
 fi
 
+# Check if int128 is usable.
+
+ AC_TRY_COMPILE([#include <stdint.h>],
+                [ __int128 a = 0;
+                  unsigned __int128 b = 1;
+                  a = a + b;
+                  a = a * b;
+                  return 0;], have_int128=yes, have_int128=no)
+
+if test "x$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]