mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-06-06 04:00:26 +02:00
* include/lightning.h, include/lightning/jit_private.h, lib/lightning.c: Implement the new jit_set_data() interface, and the new jit_get_data() helper. Like jit_set_code(), jit_realize() should be called before jit_set_data(). The most common usage should be jit_set_data(JIT_DISABLE_DATA | JIT_DISABLE_NOTE), to force synthesize any float/double constant in the stack and not generate any debug information. * lib/jit_note.c: Minor change to debug note generation as now it uses an alternate temporary data buffer during constants and debug generation to accommodate the possibility of the user setting an alternate data buffer. * lib/jit_hppa-fpu.c, lib/jit_s390x.c, lib/jit_s390x-cpu.c, lib/jit_s390x-fpu.c, lib/jit_sparc.c, lib/jit_sparc-fpu.c, lib/jit_x86-sse.c, lib/jit_x86-x87.c: Implement jit_set_data. * lib/jit_hppa-sz.c, lib/jit_sparc-sz.c, lib/jit_x86-sz.c, lib/jit_s390x-sz.c: Update for several instructions that now have a different maximum length due to jit_set_data. * lib/jit_mips-fpu.c: Implement jit_set_data, but missing validation on n32 and n64 abis (and/or big endian). * lib/jit_mips-sz.c: Update for changes in o32. * lib/jit_ppc-fpu.c: Implement jit_set_data, but missing validation on Darwin PPC. * lib/jit_ppc-sz.c: Update for changes in powerpc 32 and 64 bit. * lib/jit_ia64-fpu.c: Implement untested jit_set_data. * TODO: Add note to list ports that were not tested for the new jit_set_data() feature, due to no longer having access to them. * check/nodata.c: New file implementing a simple test exercising several different conditions created by jit_set_data(). * check/check.nodata.sh: New file implementing a wrapper over the existing *.tst files, that runs all tests without using a data buffer for constants; only meaningful (and enabled) on architectures that used to store float/double constants on a read only data buffer. * configure.ac, check/Makefile.am: Update for the new test cases. * check/lightning.c: Implement the new "-d" option that sets an internal flag to call jit_set_data() disable constants and debug, that is, using only a pure code buffer.
239 lines
6.7 KiB
Text
239 lines
6.7 KiB
Text
dnl
|
|
dnl Copyright 2000, 2001, 2002, 2012, 2013 Free Software Foundation, Inc.
|
|
dnl
|
|
dnl This file is part of GNU lightning.
|
|
dnl
|
|
dnl GNU lightning is free software; you can redistribute it and/or modify it
|
|
dnl under the terms of the GNU Lesser General Public License as published
|
|
dnl by the Free Software Foundation; either version 3, or (at your option)
|
|
dnl any later version.
|
|
dnl
|
|
dnl GNU lightning is distributed in the hope that it will be useful, but
|
|
dnl WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
|
dnl or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
|
|
dnl License for more details.
|
|
dnl
|
|
|
|
AC_PREREQ(2.57)
|
|
AC_INIT([GNU lightning], 2.0.3, pcpa@gnu.org, lightning)
|
|
AC_CANONICAL_TARGET
|
|
AC_CONFIG_SRCDIR([Makefile.am])
|
|
AM_INIT_AUTOMAKE([dist-bzip2])
|
|
AC_CONFIG_MACRO_DIR(m4)
|
|
|
|
AC_CONFIG_HEADERS(config.h)
|
|
|
|
case "$target_cpu" in
|
|
ia64)
|
|
case "$host_os" in
|
|
# Only supported mode
|
|
*hpux*)
|
|
LIGHTNING_CFLAGS="$LIGHTNING_CFLAGS -mlp64" ;;
|
|
*) ;;
|
|
esac ;;
|
|
*mips*)
|
|
case "$host_os" in
|
|
# (Hack) Flags to pass configure with gcc 3.x
|
|
# Should not set LIGHTNINT_CFLAGS
|
|
*irix*)
|
|
CFLAGS="$CFLAGS -D__c99 -Drestrict=";;
|
|
*) ;;
|
|
esac ;;
|
|
*) ;;
|
|
esac
|
|
|
|
AC_PROG_CC
|
|
AC_PROG_INSTALL
|
|
AC_PROG_LIBTOOL
|
|
|
|
AC_CHECK_FUNCS(mremap ffsl getopt_long_only isnan isinf,,)
|
|
|
|
AC_CHECK_HEADERS([getopt.h],,,)
|
|
|
|
AC_ARG_ENABLE(disassembler,
|
|
AS_HELP_STRING([--enable-disassembler],
|
|
[Enable jit disassembler using binutils]),
|
|
[DISASSEMBLER=$enableval], [DISASSEMBLER=auto])
|
|
if test "x$DISASSEMBLER" != "xno"; then
|
|
# FIXME need to check for libiberty first or will fail to link
|
|
AC_CHECK_LIB(iberty, htab_try_create, ,
|
|
[HAVE_IBERTY="no"])
|
|
AC_CHECK_LIB(bfd, bfd_init, ,
|
|
[HAVE_BFD="no"])
|
|
AC_CHECK_LIB(z, compressBound, ,
|
|
[HAVE_Z="no"])
|
|
AC_CHECK_LIB(opcodes, init_disassemble_info, ,
|
|
[HAVE_OPCODES="no"])
|
|
if test "x$HAVE_IBERTY" = "xno" -o \
|
|
"x$HAVE_BFD" = "xno" -o \
|
|
"x$HAVE_Z" = "xno" -o \
|
|
"x$HAVE_OPCODES" = "xno"; then
|
|
if test "x$DISASSEMBLER" != "xauto"; then
|
|
AC_MSG_ERROR([binutils not found, see http://www.gnu.org/software/binutils/])
|
|
else
|
|
AC_MSG_WARN([binutils not found, see http://www.gnu.org/software/binutils/])
|
|
DISASSEMBLER="no"
|
|
fi
|
|
fi
|
|
fi
|
|
AM_CONDITIONAL(with_disassembler, [test "x$DISASSEMBLER" != "xno"])
|
|
if test "x$DISASSEMBLER" != "xno"; then
|
|
LIGHTNING_CFLAGS="$LIGHTNING_CFLAGS -DDISASSEMBLER=1"
|
|
fi
|
|
|
|
AC_ARG_ENABLE(assertions,
|
|
AS_HELP_STRING([--enable-assertions],
|
|
[Enable runtime code generation assertions]),
|
|
[DEBUG=$enableval], [DEBUG=auto])
|
|
if test "x$DEBUG" = xyes; then
|
|
LIGHTNING_CFLAGS="$LIGHTNING_CFLAGS -DDEBUG=1"
|
|
else
|
|
LIGHTNING_CFLAGS="$LIGHTNING_CFLAGS -DNDEBUG"
|
|
DEBUG=no
|
|
fi
|
|
|
|
# This option is only useful during development.
|
|
AC_ARG_ENABLE(devel-get-jit-size,
|
|
AS_HELP_STRING([--enable-devel-get-jit-size],
|
|
[Devel mode to regenerate jit size information]),
|
|
[GET_JIT_SIZE=$enableval], [GET_JIT_SIZE=no])
|
|
AM_CONDITIONAL(get_jit_size, [test $GET_JIT_SIZE = yes])
|
|
|
|
case "$host_os" in
|
|
*bsd*) SHLIB="" ;;
|
|
*hpux*) SHLIB="-ldld" ;;
|
|
*) SHLIB="-ldl" ;;
|
|
esac
|
|
AC_SUBST(SHLIB)
|
|
|
|
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 ;;
|
|
s390x) cpu=s390x ;;
|
|
*) ;;
|
|
esac
|
|
AM_CONDITIONAL(cpu_arm, [test cpu-$cpu = cpu-arm])
|
|
AM_CONDITIONAL(cpu_mips, [test cpu-$cpu = cpu-mips])
|
|
AM_CONDITIONAL(cpu_ppc, [test cpu-$cpu = cpu-ppc])
|
|
AM_CONDITIONAL(cpu_sparc, [test cpu-$cpu = cpu-sparc])
|
|
AM_CONDITIONAL(cpu_x86, [test cpu-$cpu = cpu-x86])
|
|
AM_CONDITIONAL(cpu_ia64, [test cpu-$cpu = cpu-ia64])
|
|
AM_CONDITIONAL(cpu_hppa, [test cpu-$cpu = cpu-hppa])
|
|
AM_CONDITIONAL(cpu_aarch64, [test cpu-$cpu = cpu-aarch64])
|
|
AM_CONDITIONAL(cpu_s390x, [test cpu-$cpu = cpu-s390x])
|
|
|
|
# Test x87 if both, x87 and sse2 available
|
|
ac_cv_test_x86_x87=
|
|
# Test arm instruction set if thumb instruction set available
|
|
ac_cv_test_arm_arm=
|
|
# Test sofware float if vfp available and not using hard float abi
|
|
ac_cv_test_arm_swf=
|
|
|
|
save_CFLAGS=$CFLAGS
|
|
CFLAGS="$CFLAGS -I$PWD/include -D_GNU_SOURCE"
|
|
if test x$cpu = x; then
|
|
AC_MSG_ERROR([cpu $target_cpu not supported])
|
|
elif test $cpu = x86; then
|
|
AC_RUN_IFELSE([AC_LANG_SOURCE([[
|
|
#include <lightning.h>
|
|
int main(void) {
|
|
int ac, flags;
|
|
unsigned int eax, ebx, ecx, edx;
|
|
if (__WORDSIZE == 64)
|
|
return 1;
|
|
__asm__ volatile ("pushfl;\n\t"
|
|
"popl %0;\n\t"
|
|
"movl \$0x240000, %1;\n\t"
|
|
"xorl %0, %1;\n\t"
|
|
"pushl %1;\n\t"
|
|
"popfl;\n\t"
|
|
"pushfl;\n\t"
|
|
"popl %1;\n\t"
|
|
"xorl %0, %1;\n\t"
|
|
"pushl %0;\n\t"
|
|
"popfl"
|
|
: "=r" (flags), "=r" (ac));
|
|
if ((ac & (1 << 21)) == 0)
|
|
return 1;
|
|
__asm__ volatile ("xchgl %%ebx, %1; cpuid; xchgl %%ebx, %1"
|
|
: "=a" (eax), "=r" (ebx),
|
|
"=c" (ecx), "=d" (edx)
|
|
: "0" (1));
|
|
return (edx & 1 << 26) ? 0 : 1;
|
|
}
|
|
]])],[ac_cv_test_x86_x87=yes],[][])
|
|
elif test $cpu = arm; then
|
|
AC_RUN_IFELSE([AC_LANG_SOURCE([[
|
|
#include <stdio.h>
|
|
int main(void) {
|
|
#if defined(__linux__)
|
|
FILE *fp;
|
|
char buf[128];
|
|
if ((fp = fopen("/proc/cpuinfo", "r")) == NULL)
|
|
return 1;
|
|
while (fgets(buf, sizeof(buf), fp)) {
|
|
if (strncmp(buf, "Features\t:", 10) == 0 &&
|
|
strstr(buf + 10, "thumb")) {
|
|
fclose(fp);
|
|
return 0;
|
|
}
|
|
}
|
|
fclose(fp);
|
|
#elif defined(__thumb2__)
|
|
return 0;
|
|
#endif
|
|
return 1;
|
|
}
|
|
]])],[ac_cv_test_arm_arm=yes],[][])
|
|
AC_RUN_IFELSE([AC_LANG_SOURCE([[
|
|
#include <stdio.h>
|
|
int main(void) {
|
|
#if defined(__linux__)
|
|
FILE *fp;
|
|
char buf[128];
|
|
# if !defined(__ARM_PCS_VFP)
|
|
if ((fp = fopen("/proc/cpuinfo", "r")) == NULL)
|
|
return 1;
|
|
while (fgets(buf, sizeof(buf), fp)) {
|
|
if (strncmp(buf, "Features\t:", 10) == 0 &&
|
|
strstr(buf + 10, "vfp")) {
|
|
fclose(fp);
|
|
return 0;
|
|
}
|
|
}
|
|
fclose(fp);
|
|
# endif
|
|
#endif
|
|
return 1;
|
|
}
|
|
]])],[ac_cv_test_arm_swf=yes],[][])
|
|
fi
|
|
CFLAGS=$save_CFLAGS
|
|
|
|
AM_CONDITIONAL(test_x86_x87, [test x$ac_cv_test_x86_x87 = xyes])
|
|
AM_CONDITIONAL(test_arm_arm, [test x$ac_cv_test_arm_arm = xyes])
|
|
AM_CONDITIONAL(test_arm_swf, [test x$ac_cv_test_arm_swf = xyes])
|
|
|
|
AM_CONDITIONAL(test_nodata, [test cpu-$cpu = cpu-mips -o cpu-$cpu = cpu-ppc -o cpu-$cpu = cpu-sparc -o cpu-$cpu = cpu-x86 -o cpu-$cpu = cpu-ia64 -o cpu-$cpu = cpu-hppa -o cpu-$cpu = cpu-s390x])
|
|
|
|
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])
|
|
|
|
AC_OUTPUT([Makefile
|
|
doc/Makefile
|
|
include/Makefile
|
|
include/lightning/Makefile
|
|
lib/Makefile
|
|
check/Makefile])
|