From c3244b0148ed352808779b07b25c3edddf9d7349 Mon Sep 17 00:00:00 2001 From: Daniel Kochmanski Date: Sun, 29 Apr 2018 13:54:38 +0200 Subject: [PATCH] Remove deprecated 8-bit opcodes --- CHANGELOG | 1 + msvc/ecl/config-internal.h.msvc6 | 3 --- src/c/compiler.d | 25 --------------------- src/configure | 37 +++++++++++++++----------------- src/configure.ac | 12 ----------- src/ecl/configpre.h | 3 --- src/h/bytecodes.h | 21 ++---------------- src/h/config-internal.h.in | 3 --- 8 files changed, 20 insertions(+), 85 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index 45a4bc07a..c45a377f0 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -67,6 +67,7 @@ - buildsystem parallel builds work (i.e make -j999) - ECL builds on consoles with unusual encodings on Windows (i.e cp936) ** API changes +- deprecated configure option ~--enable-opcode8~ has been removed - mk-defsystem is not build by default (enable by ~--with-defsystem=yes~) - asdf:make-build accepts ~:init-name~ argument for libraries this allows specifying human-memorable initialization function name to call diff --git a/msvc/ecl/config-internal.h.msvc6 b/msvc/ecl/config-internal.h.msvc6 index 438c8b30d..18694fcef 100644 --- a/msvc/ecl/config-internal.h.msvc6 +++ b/msvc/ecl/config-internal.h.msvc6 @@ -23,9 +23,6 @@ /* Use CMU Common-Lisp's FORMAT routine */ #define ECL_CMU_FORMAT 1 -/* Bytecodes and arguments are 8 and 16 bits large, respectively */ -/* #undef ECL_SMALL_BYTECODES */ - /* Assembler implementation of APPLY and friends */ /* #undef ECL_ASM_APPLY */ diff --git a/src/c/compiler.d b/src/c/compiler.d index ca30f2e5f..7523ca193 100644 --- a/src/c/compiler.d +++ b/src/c/compiler.d @@ -189,20 +189,7 @@ asm_end(cl_env_ptr env, cl_index beginning, cl_object definition) { return bytecodes; } -#if defined(ECL_SMALL_BYTECODES) -static void -asm_arg(cl_env_ptr env, int n) { -#ifdef WORDS_BIGENDIAN - asm_op(env, (n >> 8) & 0xFF); - asm_op(env, n & 0xFF); -#else - asm_op(env, n & 0xFF); - asm_op(env, (n >> 8) & 0xFF); -#endif -} -#else #define asm_arg(env,n) asm_op(env,n) -#endif static void asm_op(cl_env_ptr env, cl_fixnum code) { @@ -249,19 +236,7 @@ asm_complete(cl_env_ptr env, int op, cl_index pc) { else if (ecl_unlikely(delta < -MAX_OPARG || delta > MAX_OPARG)) FEprogram_error("Too large jump", 0); else { -#ifdef ECL_SMALL_BYTECODES - unsigned char low = delta & 0xFF; - char high = delta >> 8; -# ifdef WORDS_BIGENDIAN - env->stack[pc] = (cl_object)(cl_fixnum)high; - env->stack[pc+1] = (cl_object)(cl_fixnum)low; -# else - env->stack[pc] = (cl_object)(cl_fixnum)low; - env->stack[pc+1] = (cl_object)(cl_fixnum)high; -# endif -#else env->stack[pc] = (cl_object)(cl_fixnum)delta; -#endif } } diff --git a/src/configure b/src/configure index dd8e00a65..3afe601b1 100755 --- a/src/configure +++ b/src/configure @@ -737,6 +737,7 @@ infodir docdir oldincludedir includedir +runstatedir localstatedir sharedstatedir sysconfdir @@ -781,7 +782,6 @@ with_libgc_prefix with_libgc_incdir with_libgc_libdir with___thread -enable_opcode8 with_cxx with_tcp with_serve_event @@ -866,6 +866,7 @@ datadir='${datarootdir}' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' +runstatedir='${localstatedir}/run' includedir='${prefix}/include' oldincludedir='/usr/include' docdir='${datarootdir}/doc/${PACKAGE_TARNAME}' @@ -1118,6 +1119,15 @@ do | -silent | --silent | --silen | --sile | --sil) silent=yes ;; + -runstatedir | --runstatedir | --runstatedi | --runstated \ + | --runstate | --runstat | --runsta | --runst | --runs \ + | --run | --ru | --r) + ac_prev=runstatedir ;; + -runstatedir=* | --runstatedir=* | --runstatedi=* | --runstated=* \ + | --runstate=* | --runstat=* | --runsta=* | --runst=* | --runs=* \ + | --run=* | --ru=* | --r=*) + runstatedir=$ac_optarg ;; + -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) ac_prev=sbindir ;; -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ @@ -1255,7 +1265,7 @@ fi for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ datadir sysconfdir sharedstatedir localstatedir includedir \ oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ - libdir localedir mandir + libdir localedir mandir runstatedir do eval ac_val=\$$ac_var # Remove trailing slashes. @@ -1408,6 +1418,7 @@ Fine tuning of the installation directories: --sysconfdir=DIR read-only single-machine data [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] --localstatedir=DIR modifiable single-machine data [PREFIX/var] + --runstatedir=DIR modifiable per-process data [LOCALSTATEDIR/run] --libdir=DIR object code libraries [EPREFIX/lib] --includedir=DIR C header files [PREFIX/include] --oldincludedir=DIR C header files for non-gcc [/usr/include] @@ -1458,8 +1469,6 @@ Optional Features: (no|yes, default=yes) --enable-gmp version of the GMP library (portable|included|system|auto, default=auto) - --enable-opcode8 Deprecated! interpreter uses 8-bit codes - (default=NO, only works on Intel) --enable-unicode={yes|no|32} enable support for unicode (default=YES) --enable-longdouble include support for long double (yes|no|auto, @@ -2771,14 +2780,6 @@ else fi -# Check whether --enable-opcode8 was given. -if test "${enable_opcode8+set}" = set; then : - enableval=$enable_opcode8; opcode8=${enableval} -else - opcode8=no -fi - - # Check whether --with-cxx was given. if test "${with_cxx+set}" = set; then : @@ -8940,6 +8941,8 @@ main () if (*(data + i) != *(data3 + i)) return 14; close (fd); + free (data); + free (data3); return 0; } _ACEOF @@ -9393,8 +9396,8 @@ if test "x$ac_cv_func_feenableexcept" = xyes; then : $as_echo "#define HAVE_FEENABLEEXCEPT /**/" >>confdefs.h else - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: feenableexcept not declared: disabling floating point exceptions" >&5 -$as_echo "$as_me: WARNING: feenableexcept not declared: disabling floating point exceptions" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: feenableexcept not provided: disabling floating point exceptions" >&5 +$as_echo "$as_me: WARNING: feenableexcept not provided: disabling floating point exceptions" >&2;} fi @@ -9493,12 +9496,6 @@ $as_echo "#define ECL_CXX_CORE 1" >>confdefs.h boehm_configure_flags="${boehm_configure_flags} --enable-cplusplus" fi -if test ! ${opcode8} = "no" ; then - -$as_echo "#define ECL_SMALL_BYTECODES 1" >>confdefs.h - -fi - if test "x${cross_compiling}" != "xyes"; then if test "$cross_compiling" = yes; then : diff --git a/src/configure.ac b/src/configure.ac index b97d4e953..79e695b35 100644 --- a/src/configure.ac +++ b/src/configure.ac @@ -143,11 +143,6 @@ AC_ARG_WITH(__thread, [(supported by NPTL-aware glibc and maybe Windows)] ), [], [with___thread=no]) -AC_ARG_ENABLE(opcode8, - AS_HELP_STRING( [--enable-opcode8], - [Deprecated! interpreter uses 8-bit codes (default=NO, only works on Intel)]), - [opcode8=${enableval}], [opcode8=no]) - AC_ARG_WITH(cxx, AS_HELP_STRING( [--with-cxx], [build ECL using C++ compiler (default=NO)]), @@ -787,13 +782,6 @@ else boehm_configure_flags="${boehm_configure_flags} --enable-cplusplus" fi -dnl ---------------------------------------------------------------------- -dnl Do we need to have 8-bit opcodes? -if test ! ${opcode8} = "no" ; then - AC_DEFINE( ECL_SMALL_BYTECODES, [1], - [Bytecodes and arguments are 8 and 16 bits large, respectively]) -fi - ECL_GCC_BACKTRACE ECL_LIBATOMIC_OPS diff --git a/src/ecl/configpre.h b/src/ecl/configpre.h index b035be7e5..8a52be027 100644 --- a/src/ecl/configpre.h +++ b/src/ecl/configpre.h @@ -45,9 +45,6 @@ /* ECL_SIGNED_ZERO */ #undef ECL_SIGNED_ZERO -/* Bytecodes and arguments are 8 and 16 bits large, respectively */ -#undef ECL_SMALL_BYTECODES - /* ECL_SMALL_CONS */ #undef ECL_SMALL_CONS diff --git a/src/h/bytecodes.h b/src/h/bytecodes.h index 8b9197941..8b106ea73 100644 --- a/src/h/bytecodes.h +++ b/src/h/bytecodes.h @@ -101,30 +101,13 @@ enum { #define MAX_OPARG 0x7FFF typedef int16_t cl_oparg; -/* - * Note that in the small bytecodes case, we have to recompose a signed - * small integer out of its pieces. We have to be careful because the - * least significant byte has to be interpreted as unsigned, while the - * most significant byte carries a sign. - */ -#ifdef ECL_SMALL_BYTECODES - typedef signed char cl_opcode; -# define OPCODE_SIZE 1 -# define OPARG_SIZE 2 -# ifdef WORDS_BIGENDIAN -# define READ_OPARG(v) ((cl_fixnum)v[0] << 8) + (unsigned char)v[1] -# else -# define READ_OPARG(v) ((cl_fixnum)v[1] << 8) + (unsigned char)v[0] -# endif -# define GET_OPARG(r,v) { r = READ_OPARG(v); v += 2; } -#else - typedef int16_t cl_opcode; +typedef int16_t cl_opcode; # define OPCODE_SIZE 1 # define OPARG_SIZE 1 # define READ_OPCODE(v) v[0] # define READ_OPARG(v) v[0] # define GET_OPARG(r,v) { r = *(v++); } -#endif + #define GET_OPCODE(v) *((v)++) #define GET_DATA(r,v,data) { \ cl_oparg ndx; \ diff --git a/src/h/config-internal.h.in b/src/h/config-internal.h.in index 5073e5898..edffb87f3 100644 --- a/src/h/config-internal.h.in +++ b/src/h/config-internal.h.in @@ -31,9 +31,6 @@ /* Undefine this if you do not want ECL to check for circular lists */ #define ECL_SAFE -/* Bytecodes and arguments are 8 and 16 bits large, respectively */ -#undef ECL_SMALL_BYTECODES - /* Assembler implementation of APPLY and friends */ #undef ECL_ASM_APPLY