summaryrefslogtreecommitdiff
path: root/configure
diff options
context:
space:
mode:
authorStefan Krah <skrah@bytereef.org>2012-03-21 18:25:23 +0100
committerStefan Krah <skrah@bytereef.org>2012-03-21 18:25:23 +0100
commit0b13265a655bff4236fb68012cfdc0c0739ead26 (patch)
tree08b3ea158bf6ce1c0cf26db34e3733f165167779 /configure
parent592d76f03d3d348bc9d5f9daa8790428d2d3f885 (diff)
downloadcpython-0b13265a655bff4236fb68012cfdc0c0739ead26.tar.gz
Issue #7652: Integrate the decimal floating point libmpdec library to speed
up the decimal module. Performance gains of the new C implementation are between 12x and 80x, depending on the application.
Diffstat (limited to 'configure')
-rwxr-xr-xconfigure171
1 files changed, 171 insertions, 0 deletions
diff --git a/configure b/configure
index be7684a89d..7c1113db43 100755
--- a/configure
+++ b/configure
@@ -6863,6 +6863,13 @@ $as_echo "#define HAVE_SSIZE_T 1" >>confdefs.h
fi
+ac_fn_c_check_type "$LINENO" "__uint128_t" "ac_cv_type___uint128_t" "$ac_includes_default"
+if test "x$ac_cv_type___uint128_t" = xyes; then :
+
+$as_echo "#define HAVE_GCC_UINT128_T 1" >>confdefs.h
+
+fi
+
# Sizes of various common basic types
# ANSI C requires sizeof(char) == 1, so no need to check it
@@ -12034,6 +12041,40 @@ $as_echo "default LIBC=\"$LIBC\"" >&6; }
fi
+# **************************************
+# * Check for gcc x64 inline assembler *
+# **************************************
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for x64 gcc inline assembler" >&5
+$as_echo_n "checking for x64 gcc inline assembler... " >&6; }
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ __asm__ __volatile__ ("movq %rcx, %rax");
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ have_gcc_asm_for_x64=yes
+else
+ have_gcc_asm_for_x64=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $have_gcc_asm_for_x64" >&5
+$as_echo "$have_gcc_asm_for_x64" >&6; }
+if test "$have_gcc_asm_for_x64" = yes
+then
+
+$as_echo "#define HAVE_GCC_ASM_FOR_X64 1" >>confdefs.h
+
+fi
+
# **************************************************
# * Check for various properties of floating point *
# **************************************************
@@ -14228,6 +14269,136 @@ done
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: done" >&5
$as_echo "done" >&6; }
+# Availability of -O2:
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for -O2" >&5
+$as_echo_n "checking for -O2... " >&6; }
+saved_cflags="$CFLAGS"
+CFLAGS="-O2"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ have_O2=yes
+else
+ have_O2=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $have_O2" >&5
+$as_echo "$have_O2" >&6; }
+CFLAGS="$saved_cflags"
+
+# _FORTIFY_SOURCE wrappers for memmove and bcopy are incorrect:
+# http://sourceware.org/ml/libc-alpha/2010-12/msg00009.html
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for glibc _FORTIFY_SOURCE/memmove bug" >&5
+$as_echo_n "checking for glibc _FORTIFY_SOURCE/memmove bug... " >&6; }
+saved_cflags="$CFLAGS"
+CFLAGS="-O2 -D_FORTIFY_SOURCE=2"
+if test "$have_O2" = no; then
+ CFLAGS=""
+fi
+if test "$cross_compiling" = yes; then :
+ have_glibc_memmove_bug=undefined
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+void foo(void *p, void *q) { memmove(p, q, 19); }
+int main() {
+ char a[32] = "123456789000000000";
+ foo(&a[9], a);
+ if (strcmp(a, "123456789123456789000000000") != 0)
+ return 1;
+ foo(a, &a[9]);
+ if (strcmp(a, "123456789000000000") != 0)
+ return 1;
+ return 0;
+}
+
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+ have_glibc_memmove_bug=no
+else
+ have_glibc_memmove_bug=yes
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+CFLAGS="$saved_cflags"
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $have_glibc_memmove_bug" >&5
+$as_echo "$have_glibc_memmove_bug" >&6; }
+if test "$have_glibc_memmove_bug" = yes; then
+
+$as_echo "#define HAVE_GLIBC_MEMMOVE_BUG 1" >>confdefs.h
+
+fi
+
+if test "$have_gcc_asm_for_x87" = yes; then
+ # Some versions of gcc miscompile inline asm:
+ # http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46491
+ # http://gcc.gnu.org/ml/gcc/2010-11/msg00366.html
+ case $CC in
+ *gcc*)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gcc ipa-pure-const bug" >&5
+$as_echo_n "checking for gcc ipa-pure-const bug... " >&6; }
+ saved_cflags="$CFLAGS"
+ CFLAGS="-O2"
+ if test "$cross_compiling" = yes; then :
+ have_ipa_pure_const_bug=undefined
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+ __attribute__((noinline)) int
+ foo(int *p) {
+ int r;
+ asm ( "movl \$6, (%1)\n\t"
+ "xorl %0, %0\n\t"
+ : "=r" (r) : "r" (p) : "memory"
+ );
+ return r;
+ }
+ int main() {
+ int p = 8;
+ if ((foo(&p) ? : p) != 6)
+ return 1;
+ return 0;
+ }
+
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+ have_ipa_pure_const_bug=no
+else
+ have_ipa_pure_const_bug=yes
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+ CFLAGS="$saved_cflags"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $have_ipa_pure_const_bug" >&5
+$as_echo "$have_ipa_pure_const_bug" >&6; }
+ if test "$have_ipa_pure_const_bug" = yes; then
+
+$as_echo "#define HAVE_IPA_PURE_CONST_BUG 1" >>confdefs.h
+
+ fi
+ ;;
+ esac
+fi
+
# generate output files
ac_config_files="$ac_config_files Makefile.pre Modules/Setup.config Misc/python.pc"