[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Guile-commits] 435/437: Add GUILE_ENABLE_JIT macro
From: |
Andy Wingo |
Subject: |
[Guile-commits] 435/437: Add GUILE_ENABLE_JIT macro |
Date: |
Mon, 2 Jul 2018 05:15:12 -0400 (EDT) |
wingo pushed a commit to branch lightning
in repository guile.
commit 0593a9aed7a3805ef2853932b32ae092046bed3e
Author: Andy Wingo <address@hidden>
Date: Mon Jul 2 10:34:18 2018 +0200
Add GUILE_ENABLE_JIT macro
* acinclude.m4 (GUILE_ENABLE_JIT): New macro.
* libguile/lightning/configure.ac: Remove now-unused file.
---
acinclude.m4 | 59 +++++++++++++++++++++++++++++++++++++++--
libguile/lightning/configure.ac | 26 ------------------
2 files changed, 57 insertions(+), 28 deletions(-)
diff --git a/acinclude.m4 b/acinclude.m4
index 70cb247..0de1739 100644
--- a/acinclude.m4
+++ b/acinclude.m4
@@ -1,7 +1,7 @@
dnl -*- Autoconf -*-
-dnl Copyright (C) 1997, 1999, 2000, 2001, 2002, 2004, 2006,
-dnl 2007, 2008, 2009, 2010, 2011, 2013 Free Software Foundation, Inc.
+dnl Copyright (C) 1997,1999-2002,2004,2006-2011,2013,2018
+dnl Free Software Foundation, Inc.
dnl
dnl This file is part of GUILE
dnl
@@ -578,3 +578,58 @@ AC_DEFUN([GUILE_CHECK_GUILE_FOR_BUILD], [
dnl Declare file $1 to be a script that needs configuring,
dnl and arrange to make it executable in the process.
AC_DEFUN([GUILE_CONFIG_SCRIPT],[AC_CONFIG_FILES([$1],[chmod +x $1])])
+
+AC_DEFUN([GUILE_ENABLE_JIT], [
+ JIT_AVAILABLE=no
+ AC_MSG_CHECKING([if JIT code generation supported for target CPU])
+ case "$target_cpu" in
+ i?86|x86_64|amd64) JIT_AVAILABLE=yes ;;
+ *arm*) JIT_AVAILABLE=yes ;;
+ *mips*) JIT_AVAILABLE=yes ;;
+ *powerpc*) JIT_AVAILABLE=yes ;;
+ *sparc*) JIT_AVAILABLE=yes ;;
+ ia64) JIT_AVAILABLE=yes ;;
+ hppa*) JIT_AVAILABLE=yes ;;
+ aarch64) JIT_AVAILABLE=yes ;;
+ s390*) JIT_AVAILABLE=yes ;;
+ alpha*) JIT_AVAILABLE=yes ;;
+ *) ;;
+ esac
+ AC_MSG_RESULT($JIT_AVAILABLE)
+
+ case "$target_cpu" in
+ *arm*)
+ AC_CHECK_LIB(m, sqrtf, , [
+ JIT_AVAILABLE=no;
+ AC_MSG_WARN([JIT on ARM unavailable due to missing sqrtf])
+ ])
+ ;;
+ esac
+
+ AC_ARG_ENABLE(jit,
+ [AS_HELP_STRING([--enable-jit[=yes/no/auto]],
+ [enable just-in-time code generation [default=auto]])])
+
+ enable_jit=auto
+ AC_MSG_CHECKING([whether to enable JIT code generation])
+ case "$enable_jit" in
+ y*) enable_jit=yes ;;
+ n*) enable_jit=no ;;
+ a*) enable_jit=$JIT_AVAILABLE ;;
+ *) AC_MSG_ERROR(bad value $enable_jit for --enable-jit) ;;
+ esac
+ AC_MSG_RESULT($enable_jit)
+
+ if test $enable_jit = yes; then
+ if test $JIT_AVAILABLE = no; then
+ AC_MSG_ERROR(
+ [JIT explicitly enabled with --enable-jit but not supported on
$target_cpu])
+ fi
+ AC_CHECK_FUNCS(mremap ffsl isnan isinf,,)
+ fi
+
+ AM_CONDITIONAL([ENABLE_JIT], [test "$enable_jit" = "yes"])
+ ENABLE_JIT_VAL=$(if test "$enable_jit" = "yes"; then echo 1; else echo 0; fi)
+ AC_DEFINE_UNQUOTED([ENABLE_JIT], [$ENABLE_JIT_VAL],
+ [Define to 1 if JIT compilation is enabled, or 0 otherwise.])
+])
diff --git a/libguile/lightning/configure.ac b/libguile/lightning/configure.ac
deleted file mode 100644
index bf50558..0000000
--- a/libguile/lightning/configure.ac
+++ /dev/null
@@ -1,26 +0,0 @@
-LIGHTNING_CFLAGS=
-
-AC_CHECK_FUNCS(mremap ffsl isnan isinf,,)
-
-cpu=
-case "$target_cpu" in
- i?86|x86_64|amd64) cpu=x86 ;;
- *arm*) cpu=arm ;;
- *mips*) cpu=mips ;;
- *powerpc*) cpu=ppc ;;
- *sparc*) cpu=sparc ;;
- ia64) cpu=ia64 ;;
- hppa*) cpu=hppa ;;
- aarch64) cpu=aarch64 ;;
- s390*) cpu=s390 ;;
- alpha*) cpu=alpha ;;
- *) ;;
-esac
-
-if test $cpu = arm; then
- AC_CHECK_LIB(m, sqrtf, ,
- [AC_MSG_ERROR([sqrtf required but not available])])
-fi
-AC_SUBST(cpu)
-
-AC_SUBST([LIGHTNING_CFLAGS])
- [Guile-commits] 363/437: Correct typo, (continued)
- [Guile-commits] 363/437: Correct typo, Andy Wingo, 2018/07/02
- [Guile-commits] 383/437: ia64: Implement cache flush., Andy Wingo, 2018/07/02
- [Guile-commits] 371/437: Correct read of freed memory, Andy Wingo, 2018/07/02
- [Guile-commits] 342/437: x86: Implement support for the x32 abi, Andy Wingo, 2018/07/02
- [Guile-commits] 416/437: Build and pass all tests on 32 and 64 bit sparc, Andy Wingo, 2018/07/02
- [Guile-commits] 400/437: Correct missing jit_unget_reg calls, Andy Wingo, 2018/07/02
- [Guile-commits] 418/437: Correct typo and values in jit_sparc-sz.c, Andy Wingo, 2018/07/02
- [Guile-commits] 359/437: ARM: Regenerate size table for hard float armv7 or newer., Andy Wingo, 2018/07/02
- [Guile-commits] 396/437: Move definition of jit_va_ codes, cosmetic change., Andy Wingo, 2018/07/02
- [Guile-commits] 407/437: Update copyright year, Andy Wingo, 2018/07/02
- [Guile-commits] 435/437: Add GUILE_ENABLE_JIT macro,
Andy Wingo <=
- [Guile-commits] 367/437: X86: No longer make st7 available as a temporary, Andy Wingo, 2018/07/02
- [Guile-commits] 406/437: Adapt for binutils 2.29, Andy Wingo, 2018/07/02
- [Guile-commits] 395/437: Use an actual, invalid code, as last jit code., Andy Wingo, 2018/07/02
- [Guile-commits] 344/437: ARM: Better check for constants offset overflow, Andy Wingo, 2018/07/02
- [Guile-commits] 351/437: PPC: Only call binutils function if it is available, Andy Wingo, 2018/07/02
- [Guile-commits] 278/437: x86_64: Change x86_64 to also save/restore %rbx in inline asm., Andy Wingo, 2018/07/02
- [Guile-commits] 427/437: Remove some more of the lightning build machinery, Andy Wingo, 2018/07/02
- [Guile-commits] 328/437: Update THANKS file, Andy Wingo, 2018/07/02
- [Guile-commits] 129/437: Remove previous macro files as they are no longer used., Andy Wingo, 2018/07/02
- [Guile-commits] 09/437: add autotools-generated files, Andy Wingo, 2018/07/02