--with-cross-target must specify exactly which one to use for now.
--enable-native-code=svm1 or svm1-le or svm1-64 will fill in the
remaining parameters (word size, byte order) from the host system
characteristics.
(define fasl-format:aarch64le (make-std64le-fasl-format 25))
(define fasl-format:aarch64be (make-std64be-fasl-format 25))
+(define fasl-format:svm1-32be (make-std32be-fasl-format 26))
+(define fasl-format:svm1-32le (make-std32le-fasl-format 27))
+(define fasl-format:svm1-64be (make-std64be-fasl-format 28))
+(define fasl-format:svm1-64le (make-std64le-fasl-format 29))
+
#;
(define fasl-format:pdp10
(make-fasl-format
exit 0
fi
-if test x"${TARGET_ARCH}" = xsvm1; then
+case ${TARGET_ARCH} in
+svm1-32be|svm1-32le|svm1-64be|svm1-64le)
echo svm
exit 0
-fi
+esac
if test -d "${HERE}/machines/${TARGET_ARCH}"; then
echo "${TARGET_ARCH}"
CMDS="rm -f ${FN} && ln -s machine/${FN} ${FN}"
echo "${CMDS}"; eval "${CMDS}"
done
+
+case ${TARGET_ARCH} in
+svm1-32be|svm1-32le)
+ ln -sf wordsize-32.scm machine/wordsize.scm
+ ;;
+svm1-64be|svm1-64le)
+ ln -sf wordsize-64.scm machine/wordsize.scm
+ ;;
+esac
+
+case ${TARGET_ARCH} in
+svm1-32be|svm1-64be)
+ ln -sf big-endian.scm machine/endian.scm
+ ;;
+svm1-32le|svm1-64le)
+ ln -sf little-endian.scm machine/endian.scm
+ ;;
+esac
+
fasl-format:mips32le
fasl-format:ppc32
fasl-format:sparc32
+ fasl-format:svm1-32be
+ fasl-format:svm1-32le
+ fasl-format:svm1-64be
+ fasl-format:svm1-64le
portable-fasdump))
(define-package (compiler constraints)
fasl-format:mips32le
fasl-format:ppc32
fasl-format:sparc32
+ fasl-format:svm1-32be
+ fasl-format:svm1-32le
+ fasl-format:svm1-64be
+ fasl-format:svm1-64le
portable-fasdump))
(define-package (compiler constraints)
assembler-db.scm
assembler-rules.exp
+endian.scm
svm1-defns.h
svm1-opcodes.scm
+wordsize.scm
--- /dev/null
+#| -*-Scheme-*-
+
+Copyright (C) 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994,
+ 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
+ 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016,
+ 2017, 2018 Massachusetts Institute of Technology
+
+This file is part of MIT/GNU Scheme.
+
+MIT/GNU Scheme is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or (at
+your option) any later version.
+
+MIT/GNU Scheme is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with MIT/GNU Scheme; if not, write to the Free Software
+Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301,
+USA.
+
+|#
+
+;;;; Machine Model for SVM: Byte Order
+;;; package: (compiler)
+
+(declare (usual-integrations))
+\f
+(define-integrable endianness 'BIG)
\ No newline at end of file
(lambda ()
(let ((environment (make-top-level-environment)))
(load "../../base/macros" environment)
+ (load "endian" environment)
+ (load "wordsize" environment)
(load "machine" environment)
;; Load assembler-compiler before -runtime.
;; It needs to create RULE-MATCHER anti-syntax.
"base/sets" ;set abstraction
"base/mvalue" ;multiple-value support
"base/scode" ;SCode abstraction
+ "machines/svm/endian" ;byte order
+ "machines/svm/wordsize" ;word size
"machines/svm/machine" ;machine dependent stuff
"back/asutl" ;back-end odds and ends
"base/utils" ;odds and ends
fasl-format:mips32le
fasl-format:ppc32
fasl-format:sparc32
+ fasl-format:svm1-32be
+ fasl-format:svm1-32le
+ fasl-format:svm1-64be
+ fasl-format:svm1-64le
portable-fasdump))
(define-package (compiler constraints)
((access initialize-package! environment)))
(sf-and-load "base/pmlook")
(sf-and-load "base/pmpars")
+ (sf-and-load "machines/svm/endian")
+ (sf-and-load "machines/svm/wordsize")
(sf-and-load "machines/svm/machine")
(sf-and-load "back/syntax")
(sf-and-load "base/scode")
"object" "proced" "rvalue"
"scode" "subprb" "utils"))
(machine-base
- (append (filename/append "machines/svm" "machine")
+ (append (filename/append "machines/svm" "endian" "wordsize"
+ "machine")
(filename/append "back" "asutl")))
(rtl-base
(filename/append "rtlbase"
--- /dev/null
+#| -*-Scheme-*-
+
+Copyright (C) 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994,
+ 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
+ 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016,
+ 2017, 2018 Massachusetts Institute of Technology
+
+This file is part of MIT/GNU Scheme.
+
+MIT/GNU Scheme is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or (at
+your option) any later version.
+
+MIT/GNU Scheme is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with MIT/GNU Scheme; if not, write to the Free Software
+Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301,
+USA.
+
+|#
+
+;;;; Machine Model for SVM: Byte Order
+;;; package: (compiler)
+
+(declare (usual-integrations))
+\f
+(define-integrable endianness 'LITTLE)
\ No newline at end of file
\f
;;;; Architecture Parameters
-;; XXX Invent an svm1 fasdump format.
-(define (target-fasl-format) fasl-format:amd64) ;XXX
+(define (target-fasl-format)
+ (cond ((and (eq? endianness 'BIG) (= scheme-object-width 32))
+ fasl-format:svm1-32be)
+ ((and (eq? endianness 'LITTLE) (= scheme-object-width 32))
+ fasl-format:svm1-32le)
+ ((and (eq? endianness 'BIG) (= scheme-object-width 64))
+ fasl-format:svm1-64be)
+ ((and (eq? endianness 'LITTLE) (= scheme-object-width 64))
+ fasl-format:svm1-64le)
+ (else
+ (error "Unknown byte order and object width:"
+ `(,endianness ENDIAN)
+ `(,scheme-object-width BITS)))))
(define use-pre/post-increment? #t)
-(define-integrable endianness 'LITTLE)
(define-integrable addressing-granularity 8)
(define-integrable scheme-type-width 6)
(define-integrable scheme-type-limit #x40)
-(define-integrable scheme-object-width (if (fix:fixnum? #x100000000) 64 32))
(define-integrable scheme-datum-width
(- scheme-object-width scheme-type-width))
--- /dev/null
+#| -*-Scheme-*-
+
+Copyright (C) 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994,
+ 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
+ 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016,
+ 2017, 2018 Massachusetts Institute of Technology
+
+This file is part of MIT/GNU Scheme.
+
+MIT/GNU Scheme is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or (at
+your option) any later version.
+
+MIT/GNU Scheme is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with MIT/GNU Scheme; if not, write to the Free Software
+Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301,
+USA.
+
+|#
+
+;;;; Machine Model for SVM: Word Size
+;;; package: (compiler)
+
+(declare (usual-integrations))
+\f
+(define-integrable scheme-object-width 32)
\ No newline at end of file
--- /dev/null
+#| -*-Scheme-*-
+
+Copyright (C) 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994,
+ 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
+ 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016,
+ 2017, 2018 Massachusetts Institute of Technology
+
+This file is part of MIT/GNU Scheme.
+
+MIT/GNU Scheme is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or (at
+your option) any later version.
+
+MIT/GNU Scheme is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with MIT/GNU Scheme; if not, write to the Free Software
+Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301,
+USA.
+
+|#
+
+;;;; Machine Model for SVM: Word Size
+;;; package: (compiler)
+
+(declare (usual-integrations))
+\f
+(define-integrable scheme-object-width 64)
\ No newline at end of file
fasl-format:mips32le
fasl-format:ppc32
fasl-format:sparc32
+ fasl-format:svm1-32be
+ fasl-format:svm1-32le
+ fasl-format:svm1-64be
+ fasl-format:svm1-64le
portable-fasdump))
(define-package (compiler constraints)
INSTALL_LIARC_BUNDLES=install-liarc-bundles
IF_LIARC=
;;
-svm1)
+svm1-32be|svm1-32le|svm1-64be|svm1-64le)
IF_SVM=
;;
esac
MIT_SCHEME_COMPILER_TARGET([${with_compiler_target}])
-if test x"${mit_scheme_compiler_target}" = xsvm1; then
+case ${mit_scheme_compiler_target} in
+svm1-32be|svm1-32le|svm1-64be|svm1-64le)
IF_SVM_COMPILER=
-else
+ ;;
+*)
IF_SVM_COMPILER='#!svm compiler: '
-fi
+ ;;
+esac
AUXDIR_NAME=mit-scheme-${mit_scheme_native_code}
AUXDIR='$(libdir)'/${AUXDIR_NAME}
fi
# A 32bit host running LIAR/svm needs a large heap.
-if test x"${mit_scheme_native_code}" = xsvm1; then
- AC_CHECK_SIZEOF([unsigned long])
- if test ${ac_cv_sizeof_unsigned_long} -eq 4; then
- HOST_COMPILER_HEAP="--heap 10000"
- fi
-fi
+case ${mit_scheme_native_code} in
+svm1-32be|svm1-32le)
+ HOST_COMPILER_HEAP="--heap 10000"
+ ;;
+esac
if test x"${enable_x11}" = x && test x"${enable_default_plugins}" = xyes; then
AC_PATH_X
_mit_scheme_native_code_spec=$1
_mit_scheme_native_code_host_cpu=$2
+AC_CHECK_SIZEOF([unsigned long])
+AC_C_BIGENDIAN(
+ [mit_scheme_host_byteorder=be],
+ [mit_scheme_host_byteorder=le],
+ [AC_MSG_ERROR([unknown host byte order])])
+
AC_MSG_CHECKING([for native-code support])
MIT_SCHEME_ARCHITECTURE([${_mit_scheme_native_code_spec}])
c)
AC_MSG_RESULT([yes, using portable C code])
;;
-svm1)
+svm1|svm1-32|svm1-64|svm1-be|svm1-le|svm1-32be|svm1-32le|svm1-64be|svm1-64le)
+ case ${mit_scheme_native_code} in
+ svm1|svm1-be|svm1-le)
+ case ${ac_cv_sizeof_unsigned_long} in
+ 4)
+ mit_scheme_svm_wordsize=32
+ ;;
+ 8)
+ mit_scheme_svm_wordsize=64
+ ;;
+ *)
+ AC_MSG_ERROR([Unknown host word size])
+ ;;
+ esac
+ ;;
+ svm1-32le|svm1-32be)
+ mit_scheme_svm_wordsize=32
+ ;;
+ svm1-64le|svm1-64be)
+ mit_scheme_svm_wordsize=64
+ ;;
+ esac
+ case ${mit_scheme_native_code} in
+ svm1|svm1-32|svm1-64)
+ mit_scheme_svm_byteorder="${mit_scheme_host_byteorder}"
+ ;;
+ svm1-32be|svm1-64be)
+ mit_scheme_svm_byteorder=be
+ ;;
+ svm1-32le|svm1-64le)
+ mit_scheme_svm_byteorder=le
+ ;;
+ esac
+ mit_scheme_native_code=svm1-${mit_scheme_svm_wordsize}${mit_scheme_svm_byteorder}
AC_MSG_RESULT([yes, using portable SVM code])
;;
*)
c|C)
mit_scheme_architecture=c
;;
-svm|svm1)
- mit_scheme_architecture=svm1
+svm1-32be|svm1-32le|svm1-64be|svm1-64le)
+ mit_scheme_architecture=${_mit_scheme_architecture_spec}
;;
no|NO|none|NONE|n|N)
mit_scheme_architecture=none
#define CC_IS_SVM 1
#define CC_IS_GENERIC 1
+extern const fasl_arch_t svm_fasl_arch;
+
#endif /* !SCM_CMPINTMD_CONFIG_H_INCLUDED */
AUX_PROGRAMS="gen-nonce extract-liarc-decls"
INSTALL_INCLUDE=install-include
;;
-svm1)
+svm1-32be|svm1-32le|svm1-64be|svm1-64le)
OPTIONAL_BASES="${OPTIONAL_BASES} svm1-interp"
;;
*)
AC_CONFIG_FILES([liarc-ld], [chmod +x liarc-ld])
fi
+case ${mit_scheme_native_code} in
+svm1-32be|svm1-32le|svm1-64be|svm1-64le)
+ cmpintmd=svm1
+ ;;
+*)
+ cmpintmd=${mit_scheme_native_code}
+ ;;
+esac
AC_CONFIG_LINKS([
- cmpintmd.h:cmpintmd/${mit_scheme_native_code}.h
- cmpintmd.c:cmpintmd/${mit_scheme_native_code}.c
- cmpintmd-config.h:cmpintmd/${mit_scheme_native_code}-config.h
+ cmpintmd.h:cmpintmd/${cmpintmd}.h
+ cmpintmd.c:cmpintmd/${cmpintmd}.c
+ cmpintmd-config.h:cmpintmd/${cmpintmd}-config.h
])
for base in ${OPTIONAL_BASES}; do
FASL_IA64,
FASL_ARM,
FASL_AARCH64,
+ FASL_SVM1_32BE,
+ FASL_SVM1_32LE,
+ FASL_SVM1_64BE,
+ FASL_SVM1_64LE,
} fasl_arch_t;
/* Possible values for COMPILER_PROCESSOR_TYPE. This identifies the
# define HEAP_FREE(address)
#endif
+#ifdef CC_IS_SVM
+# undef CURRENT_FASL_ARCH
+# define CURRENT_FASL_ARCH svm_fasl_arch
+#endif
+
#endif /* SCM_CONFSHARED_H */
\f
typedef SCHEME_OBJECT word_t; /* convenience abbreviation */
+#if (SIZEOF_UNSIGNED_LONG == 4)
+# ifdef WORDS_BIGENDIAN
+const fasl_arch_t svm_fasl_arch = FASL_SVM1_32BE;
+# else
+const fasl_arch_t svm_fasl_arch = FASL_SVM1_32LE;
+# endif
+#elif (SIZEOF_UNSIGNED_LONG == 8)
+# ifdef WORDS_BIGENDIAN
+const fasl_arch_t svm_fasl_arch = FASL_SVM1_64BE;
+# else
+const fasl_arch_t svm_fasl_arch = FASL_SVM1_64LE;
+# endif
+#else
+#error Neither 32-bit nor 64-bit, what is this, a PDP-10?
+#endif
+
#define N_WORD_REGISTERS 0x100
#define N_FLOAT_REGISTERS 0x100