From 125c0e6e7516d138e6764b4d3b079e139067c104 Mon Sep 17 00:00:00 2001 From: Chris Hanson Date: Thu, 18 Jun 2009 03:26:58 -0700 Subject: [PATCH] Add new SVM instruction to support closures. --- src/compiler/machines/svm/assembler-rules.scm | 4 + .../machines/svm/compile-assembler.scm | 41 ++ src/compiler/machines/svm/machine.scm | 234 +++++++++++ src/microcode/cmpintmd/svm1.c | 218 +++++----- src/microcode/cmpintmd/svm1.h | 8 +- src/microcode/svm1-defns.h | 374 +++++++++--------- src/microcode/svm1-interp.c | 29 +- 7 files changed, 605 insertions(+), 303 deletions(-) create mode 100644 src/compiler/machines/svm/compile-assembler.scm create mode 100644 src/compiler/machines/svm/machine.scm diff --git a/src/compiler/machines/svm/assembler-rules.scm b/src/compiler/machines/svm/assembler-rules.scm index f66f122c8..f1026ee43 100644 --- a/src/compiler/machines/svm/assembler-rules.scm +++ b/src/compiler/machines/svm/assembler-rules.scm @@ -281,6 +281,10 @@ USA. (indirect-call (pc-relative (_ offset unsigned-integer))) offset) +(define-code-sequence instruction + (enter-closure (_ index unsigned-16)) + index) + (define-code-sequence instruction (conditional-jump (_ condition word-condition-1) (_ source1 word-register) diff --git a/src/compiler/machines/svm/compile-assembler.scm b/src/compiler/machines/svm/compile-assembler.scm new file mode 100644 index 000000000..516817aa1 --- /dev/null +++ b/src/compiler/machines/svm/compile-assembler.scm @@ -0,0 +1,41 @@ +#| -*-Scheme-*- + +$Id$ + +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 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. + +|# + +(with-working-directory-pathname (directory-pathname (current-load-pathname)) + (lambda () + (let ((environment (make-top-level-environment))) + #; + (environment-define-macro environment 'LAP + (rsc-macro-transformer + (lambda (form environment) + (if (syntax-match? '(* DATUM) (cdr form)) + `(,(close-syntax 'QUASIQUOTE environment) ,(cdr form)) + (ill-formed-syntax form))))) + (load "machine" environment) + (load "assembler-runtime" environment) + (load "assembler-compiler" environment) + ((access compile-assembler-rules environment) "assembler-rules.scm")))) \ No newline at end of file diff --git a/src/compiler/machines/svm/machine.scm b/src/compiler/machines/svm/machine.scm new file mode 100644 index 000000000..12488c188 --- /dev/null +++ b/src/compiler/machines/svm/machine.scm @@ -0,0 +1,234 @@ +#| -*-Scheme-*- + +$Id$ + +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 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 +;;; package: (compiler) + +(declare (usual-integrations)) + +(define use-pre/post-increment? #t) +(define-integrable scheme-type-width 6) +(define-integrable scheme-type-limit #x40) +(define-integrable scheme-object-width 32) ;could be 64 too +(define-integrable float-width 64) +(define-integrable float-alignment scheme-object-width) +(define-integrable addressing-granularity 8) + +(define-integrable address-units-per-float + (quotient float-width addressing-granularity)) + +(define-integrable address-units-per-object + (quotient scheme-object-width addressing-granularity)) + +(define-integrable (stack->memory-offset offset) offset) +(define-integrable ic-block-first-parameter-offset 2) + +(define-integrable (machine-register-known-value register) + register + #f) + +(define (machine-register-value-class register) + (guarantee-limited-index-fixnum register + number-of-machine-registers + 'MACHINE-REGISTER-VALUE-CLASS) + (cond ((or (fix:= register regnum:stack-pointer) + (fix:= register regnum:dynamic-link) + (fix:= register regnum:free-pointer)) + value-class=address) + ((fix:< register regnum:float-0) value-class=object) + (else value-class=float))) + +;;;; RTL Generator Interface + +(define-syntax define-machine-register + (sc-macro-transformer + (lambda (form environment) + (if (syntax-match? '(symbol identifier) (cdr form)) + (let ((name (symbol-append 'INTERPRETER- (cadr form))) + (offset (close-syntax (caddr form) environment))) + `(BEGIN + (DEFINE (,(close-syntax name environment)) + (RTL:MAKE-MACHINE-REGISTER ,offset)) + (DEFINE (,(close-syntax (symbol-append name '?) environment) + EXPRESSION) + (AND (RTL:REGISTER? EXPRESSION) + (FIX:= (RTL:REGISTER-NUMBER EXPRESSION) ,offset))))) + (ill-formed-syntax form))))) + +(define-machine-register stack-pointer regnum:stack-pointer) +(define-machine-register dynamic-link regnum:dynamic-link) +(define-machine-register free-pointer regnum:free-pointer) +(define-machine-register value-register regnum:value) + +(define (rtl:machine-register? rtl-register) + (case rtl-register + ((STACK-POINTER) (interpreter-stack-pointer)) + ((FREE) (interpreter-free-pointer)) + ((VALUE) (interpreter-value-register)) + (else #f))) + +(define (rtl:interpreter-register->offset locative) + (error "Unknown register type:" locative)) + +(define (rtl:constant-cost expression) + (let ((if-integer + (lambda (value) + value + ;; Can this be done in fewer bytes for suitably small values? + 1)) ; MOV immediate + (get-pc-cost + (+ 3 ; CALL + 4)) ; POP + (based-reference-cost + 1) ; MOV r/m + (address-offset-cost + 1)) ; LEA instruction + + (define (if-synthesized-constant type datum) + (if-integer (make-non-pointer-literal type datum))) + + (case (rtl:expression-type expression) + ((CONSTANT) + (let ((value (rtl:constant-value expression))) + (if (object-non-pointer? value) + (if-synthesized-constant (object-type value) (object-datum value)) + (+ get-pc-cost based-reference-cost)))) + ((MACHINE-CONSTANT) + (if-integer (rtl:machine-constant-value expression))) + ((ENTRY:PROCEDURE ENTRY:CONTINUATION) + (+ get-pc-cost address-offset-cost)) + ((ASSIGNMENT-CACHE VARIABLE-CACHE) + (+ get-pc-cost based-reference-cost)) + ((OFFSET-ADDRESS BYTE-OFFSET-ADDRESS FLOAT-OFFSET-ADDRESS) + address-offset-cost) + ((CONS-POINTER) + (and (rtl:machine-constant? (rtl:cons-pointer-type expression)) + (rtl:machine-constant? (rtl:cons-pointer-datum expression)) + (if-synthesized-constant + (rtl:machine-constant-value (rtl:cons-pointer-type expression)) + (rtl:machine-constant-value + (rtl:cons-pointer-datum expression))))) + (else + #f)))) + +(define compiler:open-code-floating-point-arithmetic? + #t) + +(define compiler:primitives-with-no-open-coding + '(DIVIDE-FIXNUM GCD-FIXNUM &/ + VECTOR-CONS STRING-ALLOCATE FLOATING-VECTOR-CONS)) + +;;;; Closure format + +;; See microcode/cmpintmd/svm1.c for a description of the layout. + +;; Offset of the first object in the closure from the address of the +;; first closure entry point, in words. + +(define (closure-first-offset count entry) + entry + (if (= count 0) + 1 + ;; This returns the offset in bytes, it isn't necessarily in words. + (receive (entries entries-size padding-size) (make-closure-entries count) + entries-size padding-size + (+ 2 (car (car entries)))))) + +;; Offset of the first object in the closure from the address of the +;; manifest-closure header word, in words. + +(define (closure-object-first-offset count) + (if (= count 0) + 1 + (receive (entries entries-size padding-size) (make-closure-entries count) + entries + (quotient (+ 2 entries-size padding-size) + address-units-per-object)))) + +;; Increment from one closure entry address to another, in bytes. + +(define (closure-entry-distance count entry entry*) + (* 10 (- entry* entry))) + +;; Increment from a given closure address to the first closure +;; address, in bytes. Usually negative. + +(define (closure-environment-adjustment count entry) + (closure-entry-distance count entry 0)) + + +;; This could get stuck toggling between two states. It's probably +;; not worth running the ITERATION loop more than a couple of times. +(define (make-closure-entries count) + (let ((last (- count 1)) + (initial-padding (padding-size (* count 9)))) + (let ((entries + (reverse! + (make-initialized-list count + (lambda (i) + (cons (+ (* (- last i) 9) + initial-padding + (* i 4)) + 9)))))) + (let iteration ((padding initial-padding)) + (let loop ((entries entries)) + (if (pair? entries) + (let ((entry (car entries)) + (entries (cdr entries))) + (let ((size* (offset->entry-size (car entry))) + (size (cdr entry))) + (if (not (= size* size)) + (begin + (set-cdr! entry size*) + (adjust-entries! entries (- size size*))))) + (loop entries)))) + (let ((entries-size (entries-size entries))) + (let ((padding* (padding-size entries-size))) + (if (not (= padding* padding)) + (begin + (adjust-entries! entries (- padding padding*)) + (iteration padding*)) + (values (map car (reverse! entries)) + entries-size + padding)))))))) + +(define (entries-size entries) + (reduce + 0 (map cdr entries))) + +(define (padding-size entries-size) + (let ((entries-size (+ entries-size 2))) + (- (* (integer-ceiling entries-size 4) 4) entries-size))) + +(define (offset->entry-size offset) + (cond ((< offset #x100) 6) + ((< offset #x10000) 7) + (else 9))) + +(define (adjust-entries! entries delta) + (for-each (lambda (entry) + (set-car! entry (- (car entry) delta))) + entries)) \ No newline at end of file diff --git a/src/microcode/cmpintmd/svm1.c b/src/microcode/cmpintmd/svm1.c index 8623db2f7..1f101f663 100644 --- a/src/microcode/cmpintmd/svm1.c +++ b/src/microcode/cmpintmd/svm1.c @@ -32,14 +32,20 @@ USA. #include "errors.h" #include "svm1-defns.h" -static unsigned int cc_entry_reference_offset (insn_t *); +static unsigned int read_u16 (insn_t *); +static void write_u16 (unsigned int, insn_t *); bool read_cc_entry_type (cc_entry_type_t * cet, insn_t * address) { - unsigned int n - = ((((unsigned int) (address[-3])) << 8) - | ((unsigned int) (address[-4]))); + unsigned int n; + + if ((*address) == SVM1_INST_ENTER_CLOSURE) + { + make_cc_entry_type (cet, CET_CLOSURE); + return (false); + } + n = (read_u16 (address - 4)); if (n < 0x8000) make_compiled_procedure_type (cet, @@ -51,28 +57,24 @@ read_cc_entry_type (cc_entry_type_t * cet, insn_t * address) else switch (n - 0xFFF8) { - case 7: - make_cc_entry_type (cet, CET_EXPRESSION); - break; - case 6: - make_cc_entry_type (cet, CET_INTERNAL_PROCEDURE); + make_cc_entry_type (cet, CET_EXPRESSION); break; case 5: - make_cc_entry_type (cet, CET_INTERNAL_CONTINUATION); + make_cc_entry_type (cet, CET_INTERNAL_PROCEDURE); break; case 4: - make_cc_entry_type (cet, CET_TRAMPOLINE); + make_cc_entry_type (cet, CET_INTERNAL_CONTINUATION); break; case 3: - make_cc_entry_type (cet, CET_RETURN_TO_INTERPRETER); + make_cc_entry_type (cet, CET_TRAMPOLINE); break; case 2: - make_cc_entry_type (cet, CET_CLOSURE); + make_cc_entry_type (cet, CET_RETURN_TO_INTERPRETER); break; default: @@ -81,6 +83,8 @@ read_cc_entry_type (cc_entry_type_t * cet, insn_t * address) return (false); } +/* This is used only for creating trampolines. */ + bool write_cc_entry_type (cc_entry_type_t * cet, insn_t * address) { @@ -104,69 +108,84 @@ write_cc_entry_type (cc_entry_type_t * cet, insn_t * address) break; case CET_EXPRESSION: - n = (0xFFF8 + 7); + n = (0xFFF8 + 6); break; case CET_INTERNAL_PROCEDURE: - n = (0xFFF8 + 6); + n = (0xFFF8 + 5); break; case CET_INTERNAL_CONTINUATION: - n = (0xFFF8 + 5); + n = (0xFFF8 + 4); break; case CET_TRAMPOLINE: - n = (0xFFF8 + 4); + n = (0xFFF8 + 3); break; case CET_RETURN_TO_INTERPRETER: - n = (0xFFF8 + 3); + n = (0xFFF8 + 2); break; case CET_CLOSURE: - n = (0xFFF8 + 2); - break; + return ((*address) != SVM1_INST_ENTER_CLOSURE); default: return (true); } - (address[-4]) = (n & 0x00FF); - (address[-3]) = (n >> 8); + write_u16 (n, (address - 4)); return (false); } /* The offset is encoded as two bytes. It's relative to its own - address, _not_ relative to the entry address. In the case of a - closure, the offset points to the start of the first entry in the - block. For other entry types, it points to the first non-marked - word in the block. */ + address, _not_ relative to the entry address, and points to the + first non-marked word in the block. */ + +#define CC_ENTRY_REFERENCE_OFFSET \ + (CC_ENTRY_OFFSET_SIZE + (2 * (sizeof (SCHEME_OBJECT)))) bool read_cc_entry_offset (cc_entry_offset_t * ceo, insn_t * address) { - unsigned int n - = ((((unsigned int) (address[-1])) << 8) - | ((unsigned int) (address[-2]))); - if (n < 0x8000) + if ((*address) == SVM1_INST_ENTER_CLOSURE) { - (ceo->offset) = (n + (cc_entry_reference_offset (address))); + unsigned int index = (read_u16 (address + 1)); + (ceo->offset) + = ((sizeof (SCHEME_OBJECT)) + + CLOSURE_COUNT_SIZE + + (index * CLOSURE_ENTRY_SIZE)); (ceo->continued_p) = false; } else { - (ceo->offset) = (n - 0x8000); - (ceo->continued_p) = true; + unsigned int n = (read_u16 (address - 2)); + if (n < 0x8000) + { + (ceo->offset) = (n + CC_ENTRY_REFERENCE_OFFSET); + (ceo->continued_p) = false; + } + else + { + (ceo->offset) = (n - 0x8000); + (ceo->continued_p) = true; + } } return (false); } +/* This is used only for creating trampolines. */ + bool write_cc_entry_offset (cc_entry_offset_t * ceo, insn_t * address) { - unsigned long offset = (ceo->offset); + unsigned long offset; + + if ((*address) == SVM1_INST_ENTER_CLOSURE) + return (true); /* not supported */ + offset = (ceo->offset); if (ceo->continued_p) { - offset -= (cc_entry_reference_offset (address)); + offset -= CC_ENTRY_REFERENCE_OFFSET; if (! (offset < 0x8000)) return (true); } @@ -176,52 +195,52 @@ write_cc_entry_offset (cc_entry_offset_t * ceo, insn_t * address) return (true); offset += 0x8000; } - (address[-2]) = (offset & 0x00FF); - (address[-1]) = (offset >> 8); + write_u16 (offset, (address - 2)); return (false); } static unsigned int -cc_entry_reference_offset (insn_t * address) +read_u16 (insn_t * address) { - cc_entry_type_t cet; -#ifdef ENABLE_DEBUGGING_TOOLS - bool fail_p = (read_cc_entry_type ((&cet), address)); - assert (!fail_p); -#else - read_cc_entry_type ((&cet), address); -#endif return - (CC_ENTRY_OFFSET_SIZE - + (((cet.marker) == CET_CLOSURE) - ? ((sizeof (SCHEME_OBJECT)) + 2) - : (2 * (sizeof (SCHEME_OBJECT))))); + ((((unsigned int) (address[1])) << 8) + | ((unsigned int) (address[0]))); +} + +static void +write_u16 (unsigned int n, insn_t * address) +{ + (address[0]) = (n & 0x00FF); + (address[1]) = (n >> 8); } /* Compiled closures A compiled-closure block starts with a single GC header - (TC_MANIFEST_CLOSURE), followed by a 2-byte positive count, - followed by the closure entries (as specified by the count). For - example, on a 32-bit machine with count == 2 and 4 value cells: + (TC_MANIFEST_CLOSURE), followed by a 2-byte count, followed by the + closure entries (as specified by the count). The closure entries + refer to their targets indirectly: the targets appear in sequence + after all of the entries and are stored as Scheme objects. + + For example, on a 32-bit machine with count == 3 and 4 value cells: - 0x00 TC_MANIFEST_CLOSURE | n_words == 10 - 0x04 (count - 1) == 1 + 0x00 TC_MANIFEST_CLOSURE | n_words == 11 + 0x04 count == 3 - 0x06 type == CET_CLOSURE - 0x08 (offset - 6) == 2 - 0x0A SVM1_INST_ICALL_U8 - 0x0B offset == 8 + 0x06 SVM1_INST_ENTER_CLOSURE + 0x07 index == 0 - 0x0C type == CET_CLOSURE - 0x0E (offset - 6) == 8 - 0x10 SVM1_INST_ICALL_U8 - 0x11 offset == 6 + 0x09 SVM1_INST_ENTER_CLOSURE + 0x0A index == 1 - 0x12 2 padding bytes + 0x0C SVM1_INST_ENTER_CLOSURE + 0x0D index == 2 - 0x14 code entry 0 - 0x18 code entry 1 + 0x0F 1 padding byte + + 0x10 target 0 + 0x14 target 1 + 0x18 target 2 0x1C value cell 0 0x20 value cell 1 @@ -233,37 +252,25 @@ cc_entry_reference_offset (insn_t * address) unsigned long compiled_closure_count (SCHEME_OBJECT * block) { - return - (((((unsigned long) (((byte_t *) block) [1])) << 8) - | ((unsigned long) (((byte_t *) block) [0]))) - + 1); + return (read_u16 ((insn_t *) block)); } insn_t * compiled_closure_start (SCHEME_OBJECT * block) { - return (((insn_t *) block) + 2); + return (((insn_t *) block) + CLOSURE_COUNT_SIZE); } insn_t * compiled_closure_entry (insn_t * start) { - return (start + CC_ENTRY_HEADER_SIZE); + return start; } insn_t * compiled_closure_next (insn_t * start) { - insn_t * entry = (compiled_closure_entry (start)); - switch (*entry) - { - case SVM1_INST_ICALL_U8: return (entry + 2); - case SVM1_INST_ICALL_U16: return (entry + 3); - case SVM1_INST_ICALL_U32: return (entry + 5); - default: - Microcode_Termination (TERM_COMPILER_DEATH); - return (0); - } + return (start + CLOSURE_ENTRY_SIZE); } SCHEME_OBJECT * @@ -278,34 +285,14 @@ skip_compiled_closure_padding (insn_t * start) SCHEME_OBJECT compiled_closure_entry_to_target (insn_t * entry) { - unsigned long offset; - switch (entry[0]) - { - case SVM1_INST_ICALL_U8: - offset = (((unsigned long) (entry[1])) + 2); - break; - - case SVM1_INST_ICALL_U16: - offset - = (((((unsigned long) (entry[2])) << 8) - | ((unsigned long) (entry[1]))) - + 3); - break; - - case SVM1_INST_ICALL_U32: - offset - = (((((unsigned long) (entry[4])) << 24) - | (((unsigned long) (entry[3])) << 16) - | (((unsigned long) (entry[2])) << 8) - | ((unsigned long) (entry[1]))) - + 5); - break; - - default: - Microcode_Termination (TERM_COMPILER_DEATH); - return (0); - } - return (* ((SCHEME_OBJECT *) (entry + offset))); + unsigned int index = (read_u16 (entry + 1)); + insn_t * block + = (entry + ((index * CLOSURE_ENTRY_SIZE) + CLOSURE_COUNT_SIZE)); + unsigned int count = (read_u16 (block)); + SCHEME_OBJECT * targets + = (skip_compiled_closure_padding + (block + CLOSURE_COUNT_SIZE + (count * CLOSURE_ENTRY_SIZE))); + return (targets[index]); } /* Execution caches (UUO links) @@ -345,10 +332,13 @@ compiled_closure_entry_to_target (insn_t * entry) unsigned int read_uuo_frame_size (SCHEME_OBJECT * saddr) { - insn_t * address = ((insn_t *) saddr); - return - ((((unsigned int) (address[1])) << 8) - | ((unsigned int) (address[0]))); + return (read_u16 ((insn_t *) saddr)); +} + +SCHEME_OBJECT +read_uuo_symbol (SCHEME_OBJECT * saddr) +{ + return (saddr[1]); } insn_t * @@ -362,7 +352,7 @@ read_uuo_target (SCHEME_OBJECT * saddr) { eaddr |= (*--addr); if (addr == end) - return (eaddr); + return ((insn_t *) eaddr); eaddr <<= 8; } } diff --git a/src/microcode/cmpintmd/svm1.h b/src/microcode/cmpintmd/svm1.h index 7c7f1bc85..4ddf04cf7 100644 --- a/src/microcode/cmpintmd/svm1.h +++ b/src/microcode/cmpintmd/svm1.h @@ -1,6 +1,6 @@ /* -*-C-*- -$Id: svm1.h,v 1.3 2008/01/30 20:02:24 cph Exp $ +$Id$ Copyright (C) 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, @@ -46,6 +46,12 @@ typedef byte_t insn_t; instructions are stored. */ #define CC_ENTRY_GC_TRAP_SIZE 0 +/* Size of closure count in insn_t units. */ +#define CLOSURE_COUNT_SIZE 2 + +/* Size of closure entry in insn_t units. */ +#define CLOSURE_ENTRY_SIZE 3 + /* Size of execution cache in SCHEME_OBJECTS. */ #define UUO_LINK_SIZE 2 #define READ_UUO_TARGET(a, r) read_uuo_target (a) diff --git a/src/microcode/svm1-defns.h b/src/microcode/svm1-defns.h index 77acaf2eb..3d4fd922a 100644 --- a/src/microcode/svm1-defns.h +++ b/src/microcode/svm1-defns.h @@ -2,28 +2,27 @@ DO NOT EDIT: this file was generated by a program. -$Id: svm1-defns.h,v 11.2 2008/01/30 20:02:20 cph Exp $ +$Id$ -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 Massachusetts Institute of Technology +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 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 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. +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. +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. */ @@ -205,7 +204,7 @@ USA. DECODE_SIGNED_32 (value) #define SVM1_INST_START_CODE 0x01 -#define SVM1_INST_END_CODE 0xce +#define SVM1_INST_END_CODE 0xcf #define SVM1_INST_BINDINGS(binder) \ binder (SVM1_INST_STORE_B_WR_ADDR, store_b_wr_addr); \ @@ -244,6 +243,7 @@ USA. binder (SVM1_INST_ICALL_U8, icall_u8); \ binder (SVM1_INST_ICALL_U16, icall_u16); \ binder (SVM1_INST_ICALL_U32, icall_u32); \ + binder (SVM1_INST_ENTER_CLOSURE, enter_closure); \ binder (SVM1_INST_CJUMP_EQ_WR_WR_PCR_S8, cjump_eq_wr_wr_pcr_s8); \ binder (SVM1_INST_CJUMP_NEQ_WR_WR_PCR_S8, cjump_neq_wr_wr_pcr_s8); \ binder (SVM1_INST_CJUMP_LT_WR_WR_PCR_S8, cjump_lt_wr_wr_pcr_s8); \ @@ -596,904 +596,908 @@ USA. #define DECODE_SVM1_INST_ICALL_U32(value) \ DECODE_UNSIGNED_32 (value) -#define SVM1_INST_CJUMP_EQ_WR_WR_PCR_S8 0x25 +#define SVM1_INST_ENTER_CLOSURE 0x25 +#define DECODE_SVM1_INST_ENTER_CLOSURE(index) \ + DECODE_UNSIGNED_16 (index) + +#define SVM1_INST_CJUMP_EQ_WR_WR_PCR_S8 0x26 #define DECODE_SVM1_INST_CJUMP_EQ_WR_WR_PCR_S8(source1, source2, value) \ DECODE_WORD_REGISTER (source1); \ DECODE_WORD_REGISTER (source2); \ DECODE_SIGNED_8 (value) -#define SVM1_INST_CJUMP_NEQ_WR_WR_PCR_S8 0x26 +#define SVM1_INST_CJUMP_NEQ_WR_WR_PCR_S8 0x27 #define DECODE_SVM1_INST_CJUMP_NEQ_WR_WR_PCR_S8(source1, source2, value) \ DECODE_WORD_REGISTER (source1); \ DECODE_WORD_REGISTER (source2); \ DECODE_SIGNED_8 (value) -#define SVM1_INST_CJUMP_LT_WR_WR_PCR_S8 0x27 +#define SVM1_INST_CJUMP_LT_WR_WR_PCR_S8 0x28 #define DECODE_SVM1_INST_CJUMP_LT_WR_WR_PCR_S8(source1, source2, value) \ DECODE_WORD_REGISTER (source1); \ DECODE_WORD_REGISTER (source2); \ DECODE_SIGNED_8 (value) -#define SVM1_INST_CJUMP_GE_WR_WR_PCR_S8 0x28 +#define SVM1_INST_CJUMP_GE_WR_WR_PCR_S8 0x29 #define DECODE_SVM1_INST_CJUMP_GE_WR_WR_PCR_S8(source1, source2, value) \ DECODE_WORD_REGISTER (source1); \ DECODE_WORD_REGISTER (source2); \ DECODE_SIGNED_8 (value) -#define SVM1_INST_CJUMP_GT_WR_WR_PCR_S8 0x29 +#define SVM1_INST_CJUMP_GT_WR_WR_PCR_S8 0x2a #define DECODE_SVM1_INST_CJUMP_GT_WR_WR_PCR_S8(source1, source2, value) \ DECODE_WORD_REGISTER (source1); \ DECODE_WORD_REGISTER (source2); \ DECODE_SIGNED_8 (value) -#define SVM1_INST_CJUMP_LE_WR_WR_PCR_S8 0x2a +#define SVM1_INST_CJUMP_LE_WR_WR_PCR_S8 0x2b #define DECODE_SVM1_INST_CJUMP_LE_WR_WR_PCR_S8(source1, source2, value) \ DECODE_WORD_REGISTER (source1); \ DECODE_WORD_REGISTER (source2); \ DECODE_SIGNED_8 (value) -#define SVM1_INST_CJUMP_SLT_WR_WR_PCR_S8 0x2b +#define SVM1_INST_CJUMP_SLT_WR_WR_PCR_S8 0x2c #define DECODE_SVM1_INST_CJUMP_SLT_WR_WR_PCR_S8(source1, source2, value) \ DECODE_WORD_REGISTER (source1); \ DECODE_WORD_REGISTER (source2); \ DECODE_SIGNED_8 (value) -#define SVM1_INST_CJUMP_SGE_WR_WR_PCR_S8 0x2c +#define SVM1_INST_CJUMP_SGE_WR_WR_PCR_S8 0x2d #define DECODE_SVM1_INST_CJUMP_SGE_WR_WR_PCR_S8(source1, source2, value) \ DECODE_WORD_REGISTER (source1); \ DECODE_WORD_REGISTER (source2); \ DECODE_SIGNED_8 (value) -#define SVM1_INST_CJUMP_SGT_WR_WR_PCR_S8 0x2d +#define SVM1_INST_CJUMP_SGT_WR_WR_PCR_S8 0x2e #define DECODE_SVM1_INST_CJUMP_SGT_WR_WR_PCR_S8(source1, source2, value) \ DECODE_WORD_REGISTER (source1); \ DECODE_WORD_REGISTER (source2); \ DECODE_SIGNED_8 (value) -#define SVM1_INST_CJUMP_SLE_WR_WR_PCR_S8 0x2e +#define SVM1_INST_CJUMP_SLE_WR_WR_PCR_S8 0x2f #define DECODE_SVM1_INST_CJUMP_SLE_WR_WR_PCR_S8(source1, source2, value) \ DECODE_WORD_REGISTER (source1); \ DECODE_WORD_REGISTER (source2); \ DECODE_SIGNED_8 (value) -#define SVM1_INST_CJUMP_EQ_WR_WR_PCR_S16 0x2f +#define SVM1_INST_CJUMP_EQ_WR_WR_PCR_S16 0x30 #define DECODE_SVM1_INST_CJUMP_EQ_WR_WR_PCR_S16(source1, source2, value) \ DECODE_WORD_REGISTER (source1); \ DECODE_WORD_REGISTER (source2); \ DECODE_SIGNED_16 (value) -#define SVM1_INST_CJUMP_NEQ_WR_WR_PCR_S16 0x30 +#define SVM1_INST_CJUMP_NEQ_WR_WR_PCR_S16 0x31 #define DECODE_SVM1_INST_CJUMP_NEQ_WR_WR_PCR_S16(source1, source2, value) \ DECODE_WORD_REGISTER (source1); \ DECODE_WORD_REGISTER (source2); \ DECODE_SIGNED_16 (value) -#define SVM1_INST_CJUMP_LT_WR_WR_PCR_S16 0x31 +#define SVM1_INST_CJUMP_LT_WR_WR_PCR_S16 0x32 #define DECODE_SVM1_INST_CJUMP_LT_WR_WR_PCR_S16(source1, source2, value) \ DECODE_WORD_REGISTER (source1); \ DECODE_WORD_REGISTER (source2); \ DECODE_SIGNED_16 (value) -#define SVM1_INST_CJUMP_GE_WR_WR_PCR_S16 0x32 +#define SVM1_INST_CJUMP_GE_WR_WR_PCR_S16 0x33 #define DECODE_SVM1_INST_CJUMP_GE_WR_WR_PCR_S16(source1, source2, value) \ DECODE_WORD_REGISTER (source1); \ DECODE_WORD_REGISTER (source2); \ DECODE_SIGNED_16 (value) -#define SVM1_INST_CJUMP_GT_WR_WR_PCR_S16 0x33 +#define SVM1_INST_CJUMP_GT_WR_WR_PCR_S16 0x34 #define DECODE_SVM1_INST_CJUMP_GT_WR_WR_PCR_S16(source1, source2, value) \ DECODE_WORD_REGISTER (source1); \ DECODE_WORD_REGISTER (source2); \ DECODE_SIGNED_16 (value) -#define SVM1_INST_CJUMP_LE_WR_WR_PCR_S16 0x34 +#define SVM1_INST_CJUMP_LE_WR_WR_PCR_S16 0x35 #define DECODE_SVM1_INST_CJUMP_LE_WR_WR_PCR_S16(source1, source2, value) \ DECODE_WORD_REGISTER (source1); \ DECODE_WORD_REGISTER (source2); \ DECODE_SIGNED_16 (value) -#define SVM1_INST_CJUMP_SLT_WR_WR_PCR_S16 0x35 +#define SVM1_INST_CJUMP_SLT_WR_WR_PCR_S16 0x36 #define DECODE_SVM1_INST_CJUMP_SLT_WR_WR_PCR_S16(source1, source2, value) \ DECODE_WORD_REGISTER (source1); \ DECODE_WORD_REGISTER (source2); \ DECODE_SIGNED_16 (value) -#define SVM1_INST_CJUMP_SGE_WR_WR_PCR_S16 0x36 +#define SVM1_INST_CJUMP_SGE_WR_WR_PCR_S16 0x37 #define DECODE_SVM1_INST_CJUMP_SGE_WR_WR_PCR_S16(source1, source2, value) \ DECODE_WORD_REGISTER (source1); \ DECODE_WORD_REGISTER (source2); \ DECODE_SIGNED_16 (value) -#define SVM1_INST_CJUMP_SGT_WR_WR_PCR_S16 0x37 +#define SVM1_INST_CJUMP_SGT_WR_WR_PCR_S16 0x38 #define DECODE_SVM1_INST_CJUMP_SGT_WR_WR_PCR_S16(source1, source2, value) \ DECODE_WORD_REGISTER (source1); \ DECODE_WORD_REGISTER (source2); \ DECODE_SIGNED_16 (value) -#define SVM1_INST_CJUMP_SLE_WR_WR_PCR_S16 0x38 +#define SVM1_INST_CJUMP_SLE_WR_WR_PCR_S16 0x39 #define DECODE_SVM1_INST_CJUMP_SLE_WR_WR_PCR_S16(source1, source2, value) \ DECODE_WORD_REGISTER (source1); \ DECODE_WORD_REGISTER (source2); \ DECODE_SIGNED_16 (value) -#define SVM1_INST_CJUMP_EQ_WR_WR_PCR_S32 0x39 +#define SVM1_INST_CJUMP_EQ_WR_WR_PCR_S32 0x3a #define DECODE_SVM1_INST_CJUMP_EQ_WR_WR_PCR_S32(source1, source2, value) \ DECODE_WORD_REGISTER (source1); \ DECODE_WORD_REGISTER (source2); \ DECODE_SIGNED_32 (value) -#define SVM1_INST_CJUMP_NEQ_WR_WR_PCR_S32 0x3a +#define SVM1_INST_CJUMP_NEQ_WR_WR_PCR_S32 0x3b #define DECODE_SVM1_INST_CJUMP_NEQ_WR_WR_PCR_S32(source1, source2, value) \ DECODE_WORD_REGISTER (source1); \ DECODE_WORD_REGISTER (source2); \ DECODE_SIGNED_32 (value) -#define SVM1_INST_CJUMP_LT_WR_WR_PCR_S32 0x3b +#define SVM1_INST_CJUMP_LT_WR_WR_PCR_S32 0x3c #define DECODE_SVM1_INST_CJUMP_LT_WR_WR_PCR_S32(source1, source2, value) \ DECODE_WORD_REGISTER (source1); \ DECODE_WORD_REGISTER (source2); \ DECODE_SIGNED_32 (value) -#define SVM1_INST_CJUMP_GE_WR_WR_PCR_S32 0x3c +#define SVM1_INST_CJUMP_GE_WR_WR_PCR_S32 0x3d #define DECODE_SVM1_INST_CJUMP_GE_WR_WR_PCR_S32(source1, source2, value) \ DECODE_WORD_REGISTER (source1); \ DECODE_WORD_REGISTER (source2); \ DECODE_SIGNED_32 (value) -#define SVM1_INST_CJUMP_GT_WR_WR_PCR_S32 0x3d +#define SVM1_INST_CJUMP_GT_WR_WR_PCR_S32 0x3e #define DECODE_SVM1_INST_CJUMP_GT_WR_WR_PCR_S32(source1, source2, value) \ DECODE_WORD_REGISTER (source1); \ DECODE_WORD_REGISTER (source2); \ DECODE_SIGNED_32 (value) -#define SVM1_INST_CJUMP_LE_WR_WR_PCR_S32 0x3e +#define SVM1_INST_CJUMP_LE_WR_WR_PCR_S32 0x3f #define DECODE_SVM1_INST_CJUMP_LE_WR_WR_PCR_S32(source1, source2, value) \ DECODE_WORD_REGISTER (source1); \ DECODE_WORD_REGISTER (source2); \ DECODE_SIGNED_32 (value) -#define SVM1_INST_CJUMP_SLT_WR_WR_PCR_S32 0x3f +#define SVM1_INST_CJUMP_SLT_WR_WR_PCR_S32 0x40 #define DECODE_SVM1_INST_CJUMP_SLT_WR_WR_PCR_S32(source1, source2, value) \ DECODE_WORD_REGISTER (source1); \ DECODE_WORD_REGISTER (source2); \ DECODE_SIGNED_32 (value) -#define SVM1_INST_CJUMP_SGE_WR_WR_PCR_S32 0x40 +#define SVM1_INST_CJUMP_SGE_WR_WR_PCR_S32 0x41 #define DECODE_SVM1_INST_CJUMP_SGE_WR_WR_PCR_S32(source1, source2, value) \ DECODE_WORD_REGISTER (source1); \ DECODE_WORD_REGISTER (source2); \ DECODE_SIGNED_32 (value) -#define SVM1_INST_CJUMP_SGT_WR_WR_PCR_S32 0x41 +#define SVM1_INST_CJUMP_SGT_WR_WR_PCR_S32 0x42 #define DECODE_SVM1_INST_CJUMP_SGT_WR_WR_PCR_S32(source1, source2, value) \ DECODE_WORD_REGISTER (source1); \ DECODE_WORD_REGISTER (source2); \ DECODE_SIGNED_32 (value) -#define SVM1_INST_CJUMP_SLE_WR_WR_PCR_S32 0x42 +#define SVM1_INST_CJUMP_SLE_WR_WR_PCR_S32 0x43 #define DECODE_SVM1_INST_CJUMP_SLE_WR_WR_PCR_S32(source1, source2, value) \ DECODE_WORD_REGISTER (source1); \ DECODE_WORD_REGISTER (source2); \ DECODE_SIGNED_32 (value) -#define SVM1_INST_CJUMP_EQ_WR_PCR_S8 0x43 +#define SVM1_INST_CJUMP_EQ_WR_PCR_S8 0x44 #define DECODE_SVM1_INST_CJUMP_EQ_WR_PCR_S8(source, value) \ DECODE_WORD_REGISTER (source); \ DECODE_SIGNED_8 (value) -#define SVM1_INST_CJUMP_NEQ_WR_PCR_S8 0x44 +#define SVM1_INST_CJUMP_NEQ_WR_PCR_S8 0x45 #define DECODE_SVM1_INST_CJUMP_NEQ_WR_PCR_S8(source, value) \ DECODE_WORD_REGISTER (source); \ DECODE_SIGNED_8 (value) -#define SVM1_INST_CJUMP_SLT_WR_PCR_S8 0x45 +#define SVM1_INST_CJUMP_SLT_WR_PCR_S8 0x46 #define DECODE_SVM1_INST_CJUMP_SLT_WR_PCR_S8(source, value) \ DECODE_WORD_REGISTER (source); \ DECODE_SIGNED_8 (value) -#define SVM1_INST_CJUMP_SGE_WR_PCR_S8 0x46 +#define SVM1_INST_CJUMP_SGE_WR_PCR_S8 0x47 #define DECODE_SVM1_INST_CJUMP_SGE_WR_PCR_S8(source, value) \ DECODE_WORD_REGISTER (source); \ DECODE_SIGNED_8 (value) -#define SVM1_INST_CJUMP_SGT_WR_PCR_S8 0x47 +#define SVM1_INST_CJUMP_SGT_WR_PCR_S8 0x48 #define DECODE_SVM1_INST_CJUMP_SGT_WR_PCR_S8(source, value) \ DECODE_WORD_REGISTER (source); \ DECODE_SIGNED_8 (value) -#define SVM1_INST_CJUMP_SLE_WR_PCR_S8 0x48 +#define SVM1_INST_CJUMP_SLE_WR_PCR_S8 0x49 #define DECODE_SVM1_INST_CJUMP_SLE_WR_PCR_S8(source, value) \ DECODE_WORD_REGISTER (source); \ DECODE_SIGNED_8 (value) -#define SVM1_INST_CJUMP_EQ_WR_PCR_S16 0x49 +#define SVM1_INST_CJUMP_EQ_WR_PCR_S16 0x4a #define DECODE_SVM1_INST_CJUMP_EQ_WR_PCR_S16(source, value) \ DECODE_WORD_REGISTER (source); \ DECODE_SIGNED_16 (value) -#define SVM1_INST_CJUMP_NEQ_WR_PCR_S16 0x4a +#define SVM1_INST_CJUMP_NEQ_WR_PCR_S16 0x4b #define DECODE_SVM1_INST_CJUMP_NEQ_WR_PCR_S16(source, value) \ DECODE_WORD_REGISTER (source); \ DECODE_SIGNED_16 (value) -#define SVM1_INST_CJUMP_SLT_WR_PCR_S16 0x4b +#define SVM1_INST_CJUMP_SLT_WR_PCR_S16 0x4c #define DECODE_SVM1_INST_CJUMP_SLT_WR_PCR_S16(source, value) \ DECODE_WORD_REGISTER (source); \ DECODE_SIGNED_16 (value) -#define SVM1_INST_CJUMP_SGE_WR_PCR_S16 0x4c +#define SVM1_INST_CJUMP_SGE_WR_PCR_S16 0x4d #define DECODE_SVM1_INST_CJUMP_SGE_WR_PCR_S16(source, value) \ DECODE_WORD_REGISTER (source); \ DECODE_SIGNED_16 (value) -#define SVM1_INST_CJUMP_SGT_WR_PCR_S16 0x4d +#define SVM1_INST_CJUMP_SGT_WR_PCR_S16 0x4e #define DECODE_SVM1_INST_CJUMP_SGT_WR_PCR_S16(source, value) \ DECODE_WORD_REGISTER (source); \ DECODE_SIGNED_16 (value) -#define SVM1_INST_CJUMP_SLE_WR_PCR_S16 0x4e +#define SVM1_INST_CJUMP_SLE_WR_PCR_S16 0x4f #define DECODE_SVM1_INST_CJUMP_SLE_WR_PCR_S16(source, value) \ DECODE_WORD_REGISTER (source); \ DECODE_SIGNED_16 (value) -#define SVM1_INST_CJUMP_EQ_WR_PCR_S32 0x4f +#define SVM1_INST_CJUMP_EQ_WR_PCR_S32 0x50 #define DECODE_SVM1_INST_CJUMP_EQ_WR_PCR_S32(source, value) \ DECODE_WORD_REGISTER (source); \ DECODE_SIGNED_32 (value) -#define SVM1_INST_CJUMP_NEQ_WR_PCR_S32 0x50 +#define SVM1_INST_CJUMP_NEQ_WR_PCR_S32 0x51 #define DECODE_SVM1_INST_CJUMP_NEQ_WR_PCR_S32(source, value) \ DECODE_WORD_REGISTER (source); \ DECODE_SIGNED_32 (value) -#define SVM1_INST_CJUMP_SLT_WR_PCR_S32 0x51 +#define SVM1_INST_CJUMP_SLT_WR_PCR_S32 0x52 #define DECODE_SVM1_INST_CJUMP_SLT_WR_PCR_S32(source, value) \ DECODE_WORD_REGISTER (source); \ DECODE_SIGNED_32 (value) -#define SVM1_INST_CJUMP_SGE_WR_PCR_S32 0x52 +#define SVM1_INST_CJUMP_SGE_WR_PCR_S32 0x53 #define DECODE_SVM1_INST_CJUMP_SGE_WR_PCR_S32(source, value) \ DECODE_WORD_REGISTER (source); \ DECODE_SIGNED_32 (value) -#define SVM1_INST_CJUMP_SGT_WR_PCR_S32 0x53 +#define SVM1_INST_CJUMP_SGT_WR_PCR_S32 0x54 #define DECODE_SVM1_INST_CJUMP_SGT_WR_PCR_S32(source, value) \ DECODE_WORD_REGISTER (source); \ DECODE_SIGNED_32 (value) -#define SVM1_INST_CJUMP_SLE_WR_PCR_S32 0x54 +#define SVM1_INST_CJUMP_SLE_WR_PCR_S32 0x55 #define DECODE_SVM1_INST_CJUMP_SLE_WR_PCR_S32(source, value) \ DECODE_WORD_REGISTER (source); \ DECODE_SIGNED_32 (value) -#define SVM1_INST_CJUMP_FIX_WR_PCR_S8 0x55 +#define SVM1_INST_CJUMP_FIX_WR_PCR_S8 0x56 #define DECODE_SVM1_INST_CJUMP_FIX_WR_PCR_S8(source, value) \ DECODE_WORD_REGISTER (source); \ DECODE_SIGNED_8 (value) -#define SVM1_INST_CJUMP_NFIX_WR_PCR_S8 0x56 +#define SVM1_INST_CJUMP_NFIX_WR_PCR_S8 0x57 #define DECODE_SVM1_INST_CJUMP_NFIX_WR_PCR_S8(source, value) \ DECODE_WORD_REGISTER (source); \ DECODE_SIGNED_8 (value) -#define SVM1_INST_CJUMP_IFIX_WR_PCR_S8 0x57 +#define SVM1_INST_CJUMP_IFIX_WR_PCR_S8 0x58 #define DECODE_SVM1_INST_CJUMP_IFIX_WR_PCR_S8(source, value) \ DECODE_WORD_REGISTER (source); \ DECODE_SIGNED_8 (value) -#define SVM1_INST_CJUMP_NIFIX_WR_PCR_S8 0x58 +#define SVM1_INST_CJUMP_NIFIX_WR_PCR_S8 0x59 #define DECODE_SVM1_INST_CJUMP_NIFIX_WR_PCR_S8(source, value) \ DECODE_WORD_REGISTER (source); \ DECODE_SIGNED_8 (value) -#define SVM1_INST_CJUMP_FIX_WR_PCR_S16 0x59 +#define SVM1_INST_CJUMP_FIX_WR_PCR_S16 0x5a #define DECODE_SVM1_INST_CJUMP_FIX_WR_PCR_S16(source, value) \ DECODE_WORD_REGISTER (source); \ DECODE_SIGNED_16 (value) -#define SVM1_INST_CJUMP_NFIX_WR_PCR_S16 0x5a +#define SVM1_INST_CJUMP_NFIX_WR_PCR_S16 0x5b #define DECODE_SVM1_INST_CJUMP_NFIX_WR_PCR_S16(source, value) \ DECODE_WORD_REGISTER (source); \ DECODE_SIGNED_16 (value) -#define SVM1_INST_CJUMP_IFIX_WR_PCR_S16 0x5b +#define SVM1_INST_CJUMP_IFIX_WR_PCR_S16 0x5c #define DECODE_SVM1_INST_CJUMP_IFIX_WR_PCR_S16(source, value) \ DECODE_WORD_REGISTER (source); \ DECODE_SIGNED_16 (value) -#define SVM1_INST_CJUMP_NIFIX_WR_PCR_S16 0x5c +#define SVM1_INST_CJUMP_NIFIX_WR_PCR_S16 0x5d #define DECODE_SVM1_INST_CJUMP_NIFIX_WR_PCR_S16(source, value) \ DECODE_WORD_REGISTER (source); \ DECODE_SIGNED_16 (value) -#define SVM1_INST_CJUMP_FIX_WR_PCR_S32 0x5d +#define SVM1_INST_CJUMP_FIX_WR_PCR_S32 0x5e #define DECODE_SVM1_INST_CJUMP_FIX_WR_PCR_S32(source, value) \ DECODE_WORD_REGISTER (source); \ DECODE_SIGNED_32 (value) -#define SVM1_INST_CJUMP_NFIX_WR_PCR_S32 0x5e +#define SVM1_INST_CJUMP_NFIX_WR_PCR_S32 0x5f #define DECODE_SVM1_INST_CJUMP_NFIX_WR_PCR_S32(source, value) \ DECODE_WORD_REGISTER (source); \ DECODE_SIGNED_32 (value) -#define SVM1_INST_CJUMP_IFIX_WR_PCR_S32 0x5f +#define SVM1_INST_CJUMP_IFIX_WR_PCR_S32 0x60 #define DECODE_SVM1_INST_CJUMP_IFIX_WR_PCR_S32(source, value) \ DECODE_WORD_REGISTER (source); \ DECODE_SIGNED_32 (value) -#define SVM1_INST_CJUMP_NIFIX_WR_PCR_S32 0x60 +#define SVM1_INST_CJUMP_NIFIX_WR_PCR_S32 0x61 #define DECODE_SVM1_INST_CJUMP_NIFIX_WR_PCR_S32(source, value) \ DECODE_WORD_REGISTER (source); \ DECODE_SIGNED_32 (value) -#define SVM1_INST_CJUMP_EQ_FR_FR_PCR_S8 0x61 +#define SVM1_INST_CJUMP_EQ_FR_FR_PCR_S8 0x62 #define DECODE_SVM1_INST_CJUMP_EQ_FR_FR_PCR_S8(source1, source2, value) \ DECODE_FLOAT_REGISTER (source1); \ DECODE_FLOAT_REGISTER (source2); \ DECODE_SIGNED_8 (value) -#define SVM1_INST_CJUMP_NEQ_FR_FR_PCR_S8 0x62 +#define SVM1_INST_CJUMP_NEQ_FR_FR_PCR_S8 0x63 #define DECODE_SVM1_INST_CJUMP_NEQ_FR_FR_PCR_S8(source1, source2, value) \ DECODE_FLOAT_REGISTER (source1); \ DECODE_FLOAT_REGISTER (source2); \ DECODE_SIGNED_8 (value) -#define SVM1_INST_CJUMP_LT_FR_FR_PCR_S8 0x63 +#define SVM1_INST_CJUMP_LT_FR_FR_PCR_S8 0x64 #define DECODE_SVM1_INST_CJUMP_LT_FR_FR_PCR_S8(source1, source2, value) \ DECODE_FLOAT_REGISTER (source1); \ DECODE_FLOAT_REGISTER (source2); \ DECODE_SIGNED_8 (value) -#define SVM1_INST_CJUMP_GT_FR_FR_PCR_S8 0x64 +#define SVM1_INST_CJUMP_GT_FR_FR_PCR_S8 0x65 #define DECODE_SVM1_INST_CJUMP_GT_FR_FR_PCR_S8(source1, source2, value) \ DECODE_FLOAT_REGISTER (source1); \ DECODE_FLOAT_REGISTER (source2); \ DECODE_SIGNED_8 (value) -#define SVM1_INST_CJUMP_LE_FR_FR_PCR_S8 0x65 +#define SVM1_INST_CJUMP_LE_FR_FR_PCR_S8 0x66 #define DECODE_SVM1_INST_CJUMP_LE_FR_FR_PCR_S8(source1, source2, value) \ DECODE_FLOAT_REGISTER (source1); \ DECODE_FLOAT_REGISTER (source2); \ DECODE_SIGNED_8 (value) -#define SVM1_INST_CJUMP_GE_FR_FR_PCR_S8 0x66 +#define SVM1_INST_CJUMP_GE_FR_FR_PCR_S8 0x67 #define DECODE_SVM1_INST_CJUMP_GE_FR_FR_PCR_S8(source1, source2, value) \ DECODE_FLOAT_REGISTER (source1); \ DECODE_FLOAT_REGISTER (source2); \ DECODE_SIGNED_8 (value) -#define SVM1_INST_CJUMP_CMP_FR_FR_PCR_S8 0x67 +#define SVM1_INST_CJUMP_CMP_FR_FR_PCR_S8 0x68 #define DECODE_SVM1_INST_CJUMP_CMP_FR_FR_PCR_S8(source1, source2, value) \ DECODE_FLOAT_REGISTER (source1); \ DECODE_FLOAT_REGISTER (source2); \ DECODE_SIGNED_8 (value) -#define SVM1_INST_CJUMP_NCMP_FR_FR_PCR_S8 0x68 +#define SVM1_INST_CJUMP_NCMP_FR_FR_PCR_S8 0x69 #define DECODE_SVM1_INST_CJUMP_NCMP_FR_FR_PCR_S8(source1, source2, value) \ DECODE_FLOAT_REGISTER (source1); \ DECODE_FLOAT_REGISTER (source2); \ DECODE_SIGNED_8 (value) -#define SVM1_INST_CJUMP_EQ_FR_FR_PCR_S16 0x69 +#define SVM1_INST_CJUMP_EQ_FR_FR_PCR_S16 0x6a #define DECODE_SVM1_INST_CJUMP_EQ_FR_FR_PCR_S16(source1, source2, value) \ DECODE_FLOAT_REGISTER (source1); \ DECODE_FLOAT_REGISTER (source2); \ DECODE_SIGNED_16 (value) -#define SVM1_INST_CJUMP_NEQ_FR_FR_PCR_S16 0x6a +#define SVM1_INST_CJUMP_NEQ_FR_FR_PCR_S16 0x6b #define DECODE_SVM1_INST_CJUMP_NEQ_FR_FR_PCR_S16(source1, source2, value) \ DECODE_FLOAT_REGISTER (source1); \ DECODE_FLOAT_REGISTER (source2); \ DECODE_SIGNED_16 (value) -#define SVM1_INST_CJUMP_LT_FR_FR_PCR_S16 0x6b +#define SVM1_INST_CJUMP_LT_FR_FR_PCR_S16 0x6c #define DECODE_SVM1_INST_CJUMP_LT_FR_FR_PCR_S16(source1, source2, value) \ DECODE_FLOAT_REGISTER (source1); \ DECODE_FLOAT_REGISTER (source2); \ DECODE_SIGNED_16 (value) -#define SVM1_INST_CJUMP_GT_FR_FR_PCR_S16 0x6c +#define SVM1_INST_CJUMP_GT_FR_FR_PCR_S16 0x6d #define DECODE_SVM1_INST_CJUMP_GT_FR_FR_PCR_S16(source1, source2, value) \ DECODE_FLOAT_REGISTER (source1); \ DECODE_FLOAT_REGISTER (source2); \ DECODE_SIGNED_16 (value) -#define SVM1_INST_CJUMP_LE_FR_FR_PCR_S16 0x6d +#define SVM1_INST_CJUMP_LE_FR_FR_PCR_S16 0x6e #define DECODE_SVM1_INST_CJUMP_LE_FR_FR_PCR_S16(source1, source2, value) \ DECODE_FLOAT_REGISTER (source1); \ DECODE_FLOAT_REGISTER (source2); \ DECODE_SIGNED_16 (value) -#define SVM1_INST_CJUMP_GE_FR_FR_PCR_S16 0x6e +#define SVM1_INST_CJUMP_GE_FR_FR_PCR_S16 0x6f #define DECODE_SVM1_INST_CJUMP_GE_FR_FR_PCR_S16(source1, source2, value) \ DECODE_FLOAT_REGISTER (source1); \ DECODE_FLOAT_REGISTER (source2); \ DECODE_SIGNED_16 (value) -#define SVM1_INST_CJUMP_CMP_FR_FR_PCR_S16 0x6f +#define SVM1_INST_CJUMP_CMP_FR_FR_PCR_S16 0x70 #define DECODE_SVM1_INST_CJUMP_CMP_FR_FR_PCR_S16(source1, source2, value) \ DECODE_FLOAT_REGISTER (source1); \ DECODE_FLOAT_REGISTER (source2); \ DECODE_SIGNED_16 (value) -#define SVM1_INST_CJUMP_NCMP_FR_FR_PCR_S16 0x70 +#define SVM1_INST_CJUMP_NCMP_FR_FR_PCR_S16 0x71 #define DECODE_SVM1_INST_CJUMP_NCMP_FR_FR_PCR_S16(source1, source2, value) \ DECODE_FLOAT_REGISTER (source1); \ DECODE_FLOAT_REGISTER (source2); \ DECODE_SIGNED_16 (value) -#define SVM1_INST_CJUMP_EQ_FR_FR_PCR_S32 0x71 +#define SVM1_INST_CJUMP_EQ_FR_FR_PCR_S32 0x72 #define DECODE_SVM1_INST_CJUMP_EQ_FR_FR_PCR_S32(source1, source2, value) \ DECODE_FLOAT_REGISTER (source1); \ DECODE_FLOAT_REGISTER (source2); \ DECODE_SIGNED_32 (value) -#define SVM1_INST_CJUMP_NEQ_FR_FR_PCR_S32 0x72 +#define SVM1_INST_CJUMP_NEQ_FR_FR_PCR_S32 0x73 #define DECODE_SVM1_INST_CJUMP_NEQ_FR_FR_PCR_S32(source1, source2, value) \ DECODE_FLOAT_REGISTER (source1); \ DECODE_FLOAT_REGISTER (source2); \ DECODE_SIGNED_32 (value) -#define SVM1_INST_CJUMP_LT_FR_FR_PCR_S32 0x73 +#define SVM1_INST_CJUMP_LT_FR_FR_PCR_S32 0x74 #define DECODE_SVM1_INST_CJUMP_LT_FR_FR_PCR_S32(source1, source2, value) \ DECODE_FLOAT_REGISTER (source1); \ DECODE_FLOAT_REGISTER (source2); \ DECODE_SIGNED_32 (value) -#define SVM1_INST_CJUMP_GT_FR_FR_PCR_S32 0x74 +#define SVM1_INST_CJUMP_GT_FR_FR_PCR_S32 0x75 #define DECODE_SVM1_INST_CJUMP_GT_FR_FR_PCR_S32(source1, source2, value) \ DECODE_FLOAT_REGISTER (source1); \ DECODE_FLOAT_REGISTER (source2); \ DECODE_SIGNED_32 (value) -#define SVM1_INST_CJUMP_LE_FR_FR_PCR_S32 0x75 +#define SVM1_INST_CJUMP_LE_FR_FR_PCR_S32 0x76 #define DECODE_SVM1_INST_CJUMP_LE_FR_FR_PCR_S32(source1, source2, value) \ DECODE_FLOAT_REGISTER (source1); \ DECODE_FLOAT_REGISTER (source2); \ DECODE_SIGNED_32 (value) -#define SVM1_INST_CJUMP_GE_FR_FR_PCR_S32 0x76 +#define SVM1_INST_CJUMP_GE_FR_FR_PCR_S32 0x77 #define DECODE_SVM1_INST_CJUMP_GE_FR_FR_PCR_S32(source1, source2, value) \ DECODE_FLOAT_REGISTER (source1); \ DECODE_FLOAT_REGISTER (source2); \ DECODE_SIGNED_32 (value) -#define SVM1_INST_CJUMP_CMP_FR_FR_PCR_S32 0x77 +#define SVM1_INST_CJUMP_CMP_FR_FR_PCR_S32 0x78 #define DECODE_SVM1_INST_CJUMP_CMP_FR_FR_PCR_S32(source1, source2, value) \ DECODE_FLOAT_REGISTER (source1); \ DECODE_FLOAT_REGISTER (source2); \ DECODE_SIGNED_32 (value) -#define SVM1_INST_CJUMP_NCMP_FR_FR_PCR_S32 0x78 +#define SVM1_INST_CJUMP_NCMP_FR_FR_PCR_S32 0x79 #define DECODE_SVM1_INST_CJUMP_NCMP_FR_FR_PCR_S32(source1, source2, value) \ DECODE_FLOAT_REGISTER (source1); \ DECODE_FLOAT_REGISTER (source2); \ DECODE_SIGNED_32 (value) -#define SVM1_INST_CJUMP_EQ_FR_PCR_S8 0x79 +#define SVM1_INST_CJUMP_EQ_FR_PCR_S8 0x7a #define DECODE_SVM1_INST_CJUMP_EQ_FR_PCR_S8(source, value) \ DECODE_FLOAT_REGISTER (source); \ DECODE_SIGNED_8 (value) -#define SVM1_INST_CJUMP_NEQ_FR_PCR_S8 0x7a +#define SVM1_INST_CJUMP_NEQ_FR_PCR_S8 0x7b #define DECODE_SVM1_INST_CJUMP_NEQ_FR_PCR_S8(source, value) \ DECODE_FLOAT_REGISTER (source); \ DECODE_SIGNED_8 (value) -#define SVM1_INST_CJUMP_LT_FR_PCR_S8 0x7b +#define SVM1_INST_CJUMP_LT_FR_PCR_S8 0x7c #define DECODE_SVM1_INST_CJUMP_LT_FR_PCR_S8(source, value) \ DECODE_FLOAT_REGISTER (source); \ DECODE_SIGNED_8 (value) -#define SVM1_INST_CJUMP_GT_FR_PCR_S8 0x7c +#define SVM1_INST_CJUMP_GT_FR_PCR_S8 0x7d #define DECODE_SVM1_INST_CJUMP_GT_FR_PCR_S8(source, value) \ DECODE_FLOAT_REGISTER (source); \ DECODE_SIGNED_8 (value) -#define SVM1_INST_CJUMP_LE_FR_PCR_S8 0x7d +#define SVM1_INST_CJUMP_LE_FR_PCR_S8 0x7e #define DECODE_SVM1_INST_CJUMP_LE_FR_PCR_S8(source, value) \ DECODE_FLOAT_REGISTER (source); \ DECODE_SIGNED_8 (value) -#define SVM1_INST_CJUMP_GE_FR_PCR_S8 0x7e +#define SVM1_INST_CJUMP_GE_FR_PCR_S8 0x7f #define DECODE_SVM1_INST_CJUMP_GE_FR_PCR_S8(source, value) \ DECODE_FLOAT_REGISTER (source); \ DECODE_SIGNED_8 (value) -#define SVM1_INST_CJUMP_CMP_FR_PCR_S8 0x7f +#define SVM1_INST_CJUMP_CMP_FR_PCR_S8 0x80 #define DECODE_SVM1_INST_CJUMP_CMP_FR_PCR_S8(source, value) \ DECODE_FLOAT_REGISTER (source); \ DECODE_SIGNED_8 (value) -#define SVM1_INST_CJUMP_NCMP_FR_PCR_S8 0x80 +#define SVM1_INST_CJUMP_NCMP_FR_PCR_S8 0x81 #define DECODE_SVM1_INST_CJUMP_NCMP_FR_PCR_S8(source, value) \ DECODE_FLOAT_REGISTER (source); \ DECODE_SIGNED_8 (value) -#define SVM1_INST_CJUMP_EQ_FR_PCR_S16 0x81 +#define SVM1_INST_CJUMP_EQ_FR_PCR_S16 0x82 #define DECODE_SVM1_INST_CJUMP_EQ_FR_PCR_S16(source, value) \ DECODE_FLOAT_REGISTER (source); \ DECODE_SIGNED_16 (value) -#define SVM1_INST_CJUMP_NEQ_FR_PCR_S16 0x82 +#define SVM1_INST_CJUMP_NEQ_FR_PCR_S16 0x83 #define DECODE_SVM1_INST_CJUMP_NEQ_FR_PCR_S16(source, value) \ DECODE_FLOAT_REGISTER (source); \ DECODE_SIGNED_16 (value) -#define SVM1_INST_CJUMP_LT_FR_PCR_S16 0x83 +#define SVM1_INST_CJUMP_LT_FR_PCR_S16 0x84 #define DECODE_SVM1_INST_CJUMP_LT_FR_PCR_S16(source, value) \ DECODE_FLOAT_REGISTER (source); \ DECODE_SIGNED_16 (value) -#define SVM1_INST_CJUMP_GT_FR_PCR_S16 0x84 +#define SVM1_INST_CJUMP_GT_FR_PCR_S16 0x85 #define DECODE_SVM1_INST_CJUMP_GT_FR_PCR_S16(source, value) \ DECODE_FLOAT_REGISTER (source); \ DECODE_SIGNED_16 (value) -#define SVM1_INST_CJUMP_LE_FR_PCR_S16 0x85 +#define SVM1_INST_CJUMP_LE_FR_PCR_S16 0x86 #define DECODE_SVM1_INST_CJUMP_LE_FR_PCR_S16(source, value) \ DECODE_FLOAT_REGISTER (source); \ DECODE_SIGNED_16 (value) -#define SVM1_INST_CJUMP_GE_FR_PCR_S16 0x86 +#define SVM1_INST_CJUMP_GE_FR_PCR_S16 0x87 #define DECODE_SVM1_INST_CJUMP_GE_FR_PCR_S16(source, value) \ DECODE_FLOAT_REGISTER (source); \ DECODE_SIGNED_16 (value) -#define SVM1_INST_CJUMP_CMP_FR_PCR_S16 0x87 +#define SVM1_INST_CJUMP_CMP_FR_PCR_S16 0x88 #define DECODE_SVM1_INST_CJUMP_CMP_FR_PCR_S16(source, value) \ DECODE_FLOAT_REGISTER (source); \ DECODE_SIGNED_16 (value) -#define SVM1_INST_CJUMP_NCMP_FR_PCR_S16 0x88 +#define SVM1_INST_CJUMP_NCMP_FR_PCR_S16 0x89 #define DECODE_SVM1_INST_CJUMP_NCMP_FR_PCR_S16(source, value) \ DECODE_FLOAT_REGISTER (source); \ DECODE_SIGNED_16 (value) -#define SVM1_INST_CJUMP_EQ_FR_PCR_S32 0x89 +#define SVM1_INST_CJUMP_EQ_FR_PCR_S32 0x8a #define DECODE_SVM1_INST_CJUMP_EQ_FR_PCR_S32(source, value) \ DECODE_FLOAT_REGISTER (source); \ DECODE_SIGNED_32 (value) -#define SVM1_INST_CJUMP_NEQ_FR_PCR_S32 0x8a +#define SVM1_INST_CJUMP_NEQ_FR_PCR_S32 0x8b #define DECODE_SVM1_INST_CJUMP_NEQ_FR_PCR_S32(source, value) \ DECODE_FLOAT_REGISTER (source); \ DECODE_SIGNED_32 (value) -#define SVM1_INST_CJUMP_LT_FR_PCR_S32 0x8b +#define SVM1_INST_CJUMP_LT_FR_PCR_S32 0x8c #define DECODE_SVM1_INST_CJUMP_LT_FR_PCR_S32(source, value) \ DECODE_FLOAT_REGISTER (source); \ DECODE_SIGNED_32 (value) -#define SVM1_INST_CJUMP_GT_FR_PCR_S32 0x8c +#define SVM1_INST_CJUMP_GT_FR_PCR_S32 0x8d #define DECODE_SVM1_INST_CJUMP_GT_FR_PCR_S32(source, value) \ DECODE_FLOAT_REGISTER (source); \ DECODE_SIGNED_32 (value) -#define SVM1_INST_CJUMP_LE_FR_PCR_S32 0x8d +#define SVM1_INST_CJUMP_LE_FR_PCR_S32 0x8e #define DECODE_SVM1_INST_CJUMP_LE_FR_PCR_S32(source, value) \ DECODE_FLOAT_REGISTER (source); \ DECODE_SIGNED_32 (value) -#define SVM1_INST_CJUMP_GE_FR_PCR_S32 0x8e +#define SVM1_INST_CJUMP_GE_FR_PCR_S32 0x8f #define DECODE_SVM1_INST_CJUMP_GE_FR_PCR_S32(source, value) \ DECODE_FLOAT_REGISTER (source); \ DECODE_SIGNED_32 (value) -#define SVM1_INST_CJUMP_CMP_FR_PCR_S32 0x8f +#define SVM1_INST_CJUMP_CMP_FR_PCR_S32 0x90 #define DECODE_SVM1_INST_CJUMP_CMP_FR_PCR_S32(source, value) \ DECODE_FLOAT_REGISTER (source); \ DECODE_SIGNED_32 (value) -#define SVM1_INST_CJUMP_NCMP_FR_PCR_S32 0x90 +#define SVM1_INST_CJUMP_NCMP_FR_PCR_S32 0x91 #define DECODE_SVM1_INST_CJUMP_NCMP_FR_PCR_S32(source, value) \ DECODE_FLOAT_REGISTER (source); \ DECODE_SIGNED_32 (value) -#define SVM1_INST_TRAP_TRAP_0 0x91 +#define SVM1_INST_TRAP_TRAP_0 0x92 #define DECODE_SVM1_INST_TRAP_TRAP_0(code) \ DECODE_TRAP_0 (code) -#define SVM1_INST_TRAP_TRAP_1_WR 0x92 +#define SVM1_INST_TRAP_TRAP_1_WR 0x93 #define DECODE_SVM1_INST_TRAP_TRAP_1_WR(code, arg0) \ DECODE_TRAP_1 (code); \ DECODE_WORD_REGISTER (arg0) -#define SVM1_INST_TRAP_TRAP_2_WR 0x93 +#define SVM1_INST_TRAP_TRAP_2_WR 0x94 #define DECODE_SVM1_INST_TRAP_TRAP_2_WR(code, arg0, arg1) \ DECODE_TRAP_2 (code); \ DECODE_WORD_REGISTER (arg0); \ DECODE_WORD_REGISTER (arg1) -#define SVM1_INST_TRAP_TRAP_3_WR 0x94 +#define SVM1_INST_TRAP_TRAP_3_WR 0x95 #define DECODE_SVM1_INST_TRAP_TRAP_3_WR(code, arg0, arg1, arg2) \ DECODE_TRAP_3 (code); \ DECODE_WORD_REGISTER (arg0); \ DECODE_WORD_REGISTER (arg1); \ DECODE_WORD_REGISTER (arg2) -#define SVM1_INST_INTERRUPT_TEST_PROCEDURE 0x95 +#define SVM1_INST_INTERRUPT_TEST_PROCEDURE 0x96 -#define SVM1_INST_INTERRUPT_TEST_DYNAMIC_LINK 0x96 +#define SVM1_INST_INTERRUPT_TEST_DYNAMIC_LINK 0x97 -#define SVM1_INST_INTERRUPT_TEST_CLOSURE 0x97 +#define SVM1_INST_INTERRUPT_TEST_CLOSURE 0x98 -#define SVM1_INST_INTERRUPT_TEST_IC_PROCEDURE 0x98 +#define SVM1_INST_INTERRUPT_TEST_IC_PROCEDURE 0x99 -#define SVM1_INST_INTERRUPT_TEST_CONTINUATION 0x99 +#define SVM1_INST_INTERRUPT_TEST_CONTINUATION 0x9a -#define SVM1_INST_FLONUM_HEADER_U8 0x9a +#define SVM1_INST_FLONUM_HEADER_U8 0x9b #define DECODE_SVM1_INST_FLONUM_HEADER_U8(target, value) \ DECODE_WORD_REGISTER (target); \ DECODE_UNSIGNED_8 (value) -#define SVM1_INST_FLONUM_HEADER_U16 0x9b +#define SVM1_INST_FLONUM_HEADER_U16 0x9c #define DECODE_SVM1_INST_FLONUM_HEADER_U16(target, value) \ DECODE_WORD_REGISTER (target); \ DECODE_UNSIGNED_16 (value) -#define SVM1_INST_FLONUM_HEADER_U32 0x9c +#define SVM1_INST_FLONUM_HEADER_U32 0x9d #define DECODE_SVM1_INST_FLONUM_HEADER_U32(target, value) \ DECODE_WORD_REGISTER (target); \ DECODE_UNSIGNED_32 (value) -#define SVM1_INST_FLONUM_HEADER 0x9d +#define SVM1_INST_FLONUM_HEADER 0x9e #define DECODE_SVM1_INST_FLONUM_HEADER(target, n_elts) \ DECODE_WORD_REGISTER (target); \ DECODE_WORD_REGISTER (n_elts) -#define SVM1_INST_COPY_WR 0x9e +#define SVM1_INST_COPY_WR 0x9f #define DECODE_SVM1_INST_COPY_WR(target, source) \ DECODE_WORD_REGISTER (target); \ DECODE_WORD_REGISTER (source) -#define SVM1_INST_COPY_FR 0x9f +#define SVM1_INST_COPY_FR 0xa0 #define DECODE_SVM1_INST_COPY_FR(target, source) \ DECODE_FLOAT_REGISTER (target); \ DECODE_FLOAT_REGISTER (source) -#define SVM1_INST_NEGATE_WR 0xa0 +#define SVM1_INST_NEGATE_WR 0xa1 #define DECODE_SVM1_INST_NEGATE_WR(target, source) \ DECODE_WORD_REGISTER (target); \ DECODE_WORD_REGISTER (source) -#define SVM1_INST_NEGATE_FR 0xa1 +#define SVM1_INST_NEGATE_FR 0xa2 #define DECODE_SVM1_INST_NEGATE_FR(target, source) \ DECODE_FLOAT_REGISTER (target); \ DECODE_FLOAT_REGISTER (source) -#define SVM1_INST_INCREMENT_WR 0xa2 +#define SVM1_INST_INCREMENT_WR 0xa3 #define DECODE_SVM1_INST_INCREMENT_WR(target, source) \ DECODE_WORD_REGISTER (target); \ DECODE_WORD_REGISTER (source) -#define SVM1_INST_INCREMENT_FR 0xa3 +#define SVM1_INST_INCREMENT_FR 0xa4 #define DECODE_SVM1_INST_INCREMENT_FR(target, source) \ DECODE_FLOAT_REGISTER (target); \ DECODE_FLOAT_REGISTER (source) -#define SVM1_INST_DECREMENT_WR 0xa4 +#define SVM1_INST_DECREMENT_WR 0xa5 #define DECODE_SVM1_INST_DECREMENT_WR(target, source) \ DECODE_WORD_REGISTER (target); \ DECODE_WORD_REGISTER (source) -#define SVM1_INST_DECREMENT_FR 0xa5 +#define SVM1_INST_DECREMENT_FR 0xa6 #define DECODE_SVM1_INST_DECREMENT_FR(target, source) \ DECODE_FLOAT_REGISTER (target); \ DECODE_FLOAT_REGISTER (source) -#define SVM1_INST_ABS_WR 0xa6 +#define SVM1_INST_ABS_WR 0xa7 #define DECODE_SVM1_INST_ABS_WR(target, source) \ DECODE_WORD_REGISTER (target); \ DECODE_WORD_REGISTER (source) -#define SVM1_INST_ABS_FR 0xa7 +#define SVM1_INST_ABS_FR 0xa8 #define DECODE_SVM1_INST_ABS_FR(target, source) \ DECODE_FLOAT_REGISTER (target); \ DECODE_FLOAT_REGISTER (source) -#define SVM1_INST_OBJECT_TYPE 0xa8 +#define SVM1_INST_OBJECT_TYPE 0xa9 #define DECODE_SVM1_INST_OBJECT_TYPE(target, source) \ DECODE_WORD_REGISTER (target); \ DECODE_WORD_REGISTER (source) -#define SVM1_INST_OBJECT_DATUM 0xa9 +#define SVM1_INST_OBJECT_DATUM 0xaa #define DECODE_SVM1_INST_OBJECT_DATUM(target, source) \ DECODE_WORD_REGISTER (target); \ DECODE_WORD_REGISTER (source) -#define SVM1_INST_OBJECT_ADDRESS 0xaa +#define SVM1_INST_OBJECT_ADDRESS 0xab #define DECODE_SVM1_INST_OBJECT_ADDRESS(target, source) \ DECODE_WORD_REGISTER (target); \ DECODE_WORD_REGISTER (source) -#define SVM1_INST_FIXNUM_TO_INTEGER 0xab +#define SVM1_INST_FIXNUM_TO_INTEGER 0xac #define DECODE_SVM1_INST_FIXNUM_TO_INTEGER(target, source) \ DECODE_WORD_REGISTER (target); \ DECODE_WORD_REGISTER (source) -#define SVM1_INST_INTEGER_TO_FIXNUM 0xac +#define SVM1_INST_INTEGER_TO_FIXNUM 0xad #define DECODE_SVM1_INST_INTEGER_TO_FIXNUM(target, source) \ DECODE_WORD_REGISTER (target); \ DECODE_WORD_REGISTER (source) -#define SVM1_INST_NOT 0xad +#define SVM1_INST_NOT 0xae #define DECODE_SVM1_INST_NOT(target, source) \ DECODE_WORD_REGISTER (target); \ DECODE_WORD_REGISTER (source) -#define SVM1_INST_FLONUM_ALIGN 0xae +#define SVM1_INST_FLONUM_ALIGN 0xaf #define DECODE_SVM1_INST_FLONUM_ALIGN(target, source) \ DECODE_WORD_REGISTER (target); \ DECODE_WORD_REGISTER (source) -#define SVM1_INST_FLONUM_LENGTH 0xaf +#define SVM1_INST_FLONUM_LENGTH 0xb0 #define DECODE_SVM1_INST_FLONUM_LENGTH(target, source) \ DECODE_WORD_REGISTER (target); \ DECODE_WORD_REGISTER (source) -#define SVM1_INST_SQRT 0xb0 +#define SVM1_INST_SQRT 0xb1 #define DECODE_SVM1_INST_SQRT(target, source) \ DECODE_FLOAT_REGISTER (target); \ DECODE_FLOAT_REGISTER (source) -#define SVM1_INST_ROUND 0xb1 +#define SVM1_INST_ROUND 0xb2 #define DECODE_SVM1_INST_ROUND(target, source) \ DECODE_FLOAT_REGISTER (target); \ DECODE_FLOAT_REGISTER (source) -#define SVM1_INST_CEILING 0xb2 +#define SVM1_INST_CEILING 0xb3 #define DECODE_SVM1_INST_CEILING(target, source) \ DECODE_FLOAT_REGISTER (target); \ DECODE_FLOAT_REGISTER (source) -#define SVM1_INST_FLOOR 0xb3 +#define SVM1_INST_FLOOR 0xb4 #define DECODE_SVM1_INST_FLOOR(target, source) \ DECODE_FLOAT_REGISTER (target); \ DECODE_FLOAT_REGISTER (source) -#define SVM1_INST_TRUNCATE 0xb4 +#define SVM1_INST_TRUNCATE 0xb5 #define DECODE_SVM1_INST_TRUNCATE(target, source) \ DECODE_FLOAT_REGISTER (target); \ DECODE_FLOAT_REGISTER (source) -#define SVM1_INST_LOG 0xb5 +#define SVM1_INST_LOG 0xb6 #define DECODE_SVM1_INST_LOG(target, source) \ DECODE_FLOAT_REGISTER (target); \ DECODE_FLOAT_REGISTER (source) -#define SVM1_INST_EXP 0xb6 +#define SVM1_INST_EXP 0xb7 #define DECODE_SVM1_INST_EXP(target, source) \ DECODE_FLOAT_REGISTER (target); \ DECODE_FLOAT_REGISTER (source) -#define SVM1_INST_COS 0xb7 +#define SVM1_INST_COS 0xb8 #define DECODE_SVM1_INST_COS(target, source) \ DECODE_FLOAT_REGISTER (target); \ DECODE_FLOAT_REGISTER (source) -#define SVM1_INST_SIN 0xb8 +#define SVM1_INST_SIN 0xb9 #define DECODE_SVM1_INST_SIN(target, source) \ DECODE_FLOAT_REGISTER (target); \ DECODE_FLOAT_REGISTER (source) -#define SVM1_INST_TAN 0xb9 +#define SVM1_INST_TAN 0xba #define DECODE_SVM1_INST_TAN(target, source) \ DECODE_FLOAT_REGISTER (target); \ DECODE_FLOAT_REGISTER (source) -#define SVM1_INST_ACOS 0xba +#define SVM1_INST_ACOS 0xbb #define DECODE_SVM1_INST_ACOS(target, source) \ DECODE_FLOAT_REGISTER (target); \ DECODE_FLOAT_REGISTER (source) -#define SVM1_INST_ASIN 0xbb +#define SVM1_INST_ASIN 0xbc #define DECODE_SVM1_INST_ASIN(target, source) \ DECODE_FLOAT_REGISTER (target); \ DECODE_FLOAT_REGISTER (source) -#define SVM1_INST_ATAN 0xbc +#define SVM1_INST_ATAN 0xbd #define DECODE_SVM1_INST_ATAN(target, source) \ DECODE_FLOAT_REGISTER (target); \ DECODE_FLOAT_REGISTER (source) -#define SVM1_INST_ADD_WR 0xbd +#define SVM1_INST_ADD_WR 0xbe #define DECODE_SVM1_INST_ADD_WR(target, source1, source2) \ DECODE_WORD_REGISTER (target); \ DECODE_WORD_REGISTER (source1); \ DECODE_WORD_REGISTER (source2) -#define SVM1_INST_ADD_FR 0xbe +#define SVM1_INST_ADD_FR 0xbf #define DECODE_SVM1_INST_ADD_FR(target, source1, source2) \ DECODE_FLOAT_REGISTER (target); \ DECODE_FLOAT_REGISTER (source1); \ DECODE_FLOAT_REGISTER (source2) -#define SVM1_INST_SUBTRACT_WR 0xbf +#define SVM1_INST_SUBTRACT_WR 0xc0 #define DECODE_SVM1_INST_SUBTRACT_WR(target, source1, source2) \ DECODE_WORD_REGISTER (target); \ DECODE_WORD_REGISTER (source1); \ DECODE_WORD_REGISTER (source2) -#define SVM1_INST_SUBTRACT_FR 0xc0 +#define SVM1_INST_SUBTRACT_FR 0xc1 #define DECODE_SVM1_INST_SUBTRACT_FR(target, source1, source2) \ DECODE_FLOAT_REGISTER (target); \ DECODE_FLOAT_REGISTER (source1); \ DECODE_FLOAT_REGISTER (source2) -#define SVM1_INST_MULTIPLY_WR 0xc1 +#define SVM1_INST_MULTIPLY_WR 0xc2 #define DECODE_SVM1_INST_MULTIPLY_WR(target, source1, source2) \ DECODE_WORD_REGISTER (target); \ DECODE_WORD_REGISTER (source1); \ DECODE_WORD_REGISTER (source2) -#define SVM1_INST_MULTIPLY_FR 0xc2 +#define SVM1_INST_MULTIPLY_FR 0xc3 #define DECODE_SVM1_INST_MULTIPLY_FR(target, source1, source2) \ DECODE_FLOAT_REGISTER (target); \ DECODE_FLOAT_REGISTER (source1); \ DECODE_FLOAT_REGISTER (source2) -#define SVM1_INST_QUOTIENT 0xc3 +#define SVM1_INST_QUOTIENT 0xc4 #define DECODE_SVM1_INST_QUOTIENT(target, source1, source2) \ DECODE_WORD_REGISTER (target); \ DECODE_WORD_REGISTER (source1); \ DECODE_WORD_REGISTER (source2) -#define SVM1_INST_REMAINDER 0xc4 +#define SVM1_INST_REMAINDER 0xc5 #define DECODE_SVM1_INST_REMAINDER(target, source1, source2) \ DECODE_WORD_REGISTER (target); \ DECODE_WORD_REGISTER (source1); \ DECODE_WORD_REGISTER (source2) -#define SVM1_INST_LSH 0xc5 +#define SVM1_INST_LSH 0xc6 #define DECODE_SVM1_INST_LSH(target, source1, source2) \ DECODE_WORD_REGISTER (target); \ DECODE_WORD_REGISTER (source1); \ DECODE_WORD_REGISTER (source2) -#define SVM1_INST_AND 0xc6 +#define SVM1_INST_AND 0xc7 #define DECODE_SVM1_INST_AND(target, source1, source2) \ DECODE_WORD_REGISTER (target); \ DECODE_WORD_REGISTER (source1); \ DECODE_WORD_REGISTER (source2) -#define SVM1_INST_ANDC 0xc7 +#define SVM1_INST_ANDC 0xc8 #define DECODE_SVM1_INST_ANDC(target, source1, source2) \ DECODE_WORD_REGISTER (target); \ DECODE_WORD_REGISTER (source1); \ DECODE_WORD_REGISTER (source2) -#define SVM1_INST_OR 0xc8 +#define SVM1_INST_OR 0xc9 #define DECODE_SVM1_INST_OR(target, source1, source2) \ DECODE_WORD_REGISTER (target); \ DECODE_WORD_REGISTER (source1); \ DECODE_WORD_REGISTER (source2) -#define SVM1_INST_XOR 0xc9 +#define SVM1_INST_XOR 0xca #define DECODE_SVM1_INST_XOR(target, source1, source2) \ DECODE_WORD_REGISTER (target); \ DECODE_WORD_REGISTER (source1); \ DECODE_WORD_REGISTER (source2) -#define SVM1_INST_MAX_UNSIGNED 0xca +#define SVM1_INST_MAX_UNSIGNED 0xcb #define DECODE_SVM1_INST_MAX_UNSIGNED(target, source1, source2) \ DECODE_WORD_REGISTER (target); \ DECODE_WORD_REGISTER (source1); \ DECODE_WORD_REGISTER (source2) -#define SVM1_INST_MIN_UNSIGNED 0xcb +#define SVM1_INST_MIN_UNSIGNED 0xcc #define DECODE_SVM1_INST_MIN_UNSIGNED(target, source1, source2) \ DECODE_WORD_REGISTER (target); \ DECODE_WORD_REGISTER (source1); \ DECODE_WORD_REGISTER (source2) -#define SVM1_INST_DIVIDE 0xcc +#define SVM1_INST_DIVIDE 0xcd #define DECODE_SVM1_INST_DIVIDE(target, source1, source2) \ DECODE_FLOAT_REGISTER (target); \ DECODE_FLOAT_REGISTER (source1); \ DECODE_FLOAT_REGISTER (source2) -#define SVM1_INST_ATAN2 0xcd +#define SVM1_INST_ATAN2 0xce #define DECODE_SVM1_INST_ATAN2(target, source1, source2) \ DECODE_FLOAT_REGISTER (target); \ DECODE_FLOAT_REGISTER (source1); \ diff --git a/src/microcode/svm1-interp.c b/src/microcode/svm1-interp.c index d0859cb80..d1a2fbd65 100644 --- a/src/microcode/svm1-interp.c +++ b/src/microcode/svm1-interp.c @@ -1,6 +1,6 @@ /* -*-C-*- -$Id: svm1-interp.c,v 11.2 2008/01/30 20:02:20 cph Exp $ +$Id$ Copyright (C) 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, @@ -627,13 +627,19 @@ DEFINE_INST (ijump_u32) } static void -push_icall_entry (void * entry) +push_object (SCHEME_OBJECT object) { stack_pointer = ((SCHEME_OBJECT *) (WREG_REF (SVM1_REG_STACK_POINTER))); - STACK_PUSH (MAKE_POINTER_OBJECT (TC_COMPILED_ENTRY, entry)); + STACK_PUSH (object); WREG_SET (SVM1_REG_STACK_POINTER, ((SCHEME_OBJECT) stack_pointer)); } +static void +push_icall_entry (void * entry) +{ + push_object (MAKE_CC_BLOCK (entry)); +} + DEFINE_INST (icall_u8) { DECODE_SVM1_INST_ICALL_U8 (offset); @@ -654,6 +660,23 @@ DEFINE_INST (icall_u32) push_icall_entry (PC - 5); IJUMP (offset); } + +DEFINE_INST (enter_closure) +{ + DECODE_SVM1_INST_ENTER_CLOSURE (index); + { + byte_t * block = (PC - (((index + 1) * 3) + 2)); + unsigned int count + = ((((unsigned int) (block[1])) << 8) + | ((unsigned int) (block[0]))); + SCHEME_OBJECT * targets + = (((SCHEME_OBJECT *) block) + + (((2 + (count * 3)) + ((sizeof (SCHEME_OBJECT)) - 1)) + / (sizeof (SCHEME_OBJECT)))); + push_object (MAKE_CC_BLOCK (((SCHEME_OBJECT *) block) - 1)); + NEW_PC (BYTE_ADDR (OBJECT_ADDRESS (targets[index]))); + } +} /* Conditional jumps */ -- 2.25.1