From: Guillermo J. Rozas Date: Thu, 30 Jul 1987 21:44:51 +0000 (+0000) Subject: Reimplement 32 bit offsets in compiled code blocks. They are now X-Git-Tag: 20090517-FFI~13200 X-Git-Url: https://birchwood-abbey.net/git?a=commitdiff_plain;h=59f8c0624beecd394417308401dfea09e1897952;p=mit-scheme.git Reimplement 32 bit offsets in compiled code blocks. They are now implemented as a chain of 16 bit offsets, since parts of the system depend on the fact that any given offset is only 16 bits long. --- diff --git a/v7/src/compiler/machines/bobcat/assmd.scm b/v7/src/compiler/machines/bobcat/assmd.scm index 6d358dc04..0317cad20 100644 --- a/v7/src/compiler/machines/bobcat/assmd.scm +++ b/v7/src/compiler/machines/bobcat/assmd.scm @@ -1,6 +1,6 @@ #| -*-Scheme-*- -$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/compiler/machines/bobcat/assmd.scm,v 1.30 1987/07/13 22:04:47 jinx Exp $ +$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/compiler/machines/bobcat/assmd.scm,v 1.31 1987/07/30 21:43:32 jinx Exp $ Copyright (c) 1987 Massachusetts Institute of Technology @@ -36,11 +36,20 @@ MIT in each case. |# (declare (usual-integrations)) +(declare (integrate addressing-granularity scheme-object-width + maximum-padding-length + maximum-block-offset block-offset-width)) + (define addressing-granularity 8) (define scheme-object-width 32) + ;; Instruction length is always a multiple of 16 (define maximum-padding-length 16) +;; Block offsets are always words +(define maximum-block-offset (- (expt 2 16) 2)) +(define block-offset-width 16) + (define make-nmv-header) (let () @@ -57,4 +66,8 @@ MIT in each case. |# (define (object->bit-string object) (bit-string-append (unsigned-integer->bit-string 24 (primitive-datum object)) - (unsigned-integer->bit-string 8 (primitive-type object)))) \ No newline at end of file + (unsigned-integer->bit-string 8 (primitive-type object)))) + +(define (block-offset->bit-string offset start?) + (unsigned-integer->bit-string block-offset-width + (if start? offset (1+ offset)))) \ No newline at end of file diff --git a/v7/src/compiler/machines/bobcat/instr2.scm b/v7/src/compiler/machines/bobcat/instr2.scm index 0e85d3e79..96750af4d 100644 --- a/v7/src/compiler/machines/bobcat/instr2.scm +++ b/v7/src/compiler/machines/bobcat/instr2.scm @@ -1,6 +1,6 @@ #| -*-Scheme-*- -$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/compiler/machines/bobcat/instr2.scm,v 1.12 1987/07/30 07:09:32 jinx Exp $ +$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/compiler/machines/bobcat/instr2.scm,v 1.13 1987/07/30 21:44:02 jinx Exp $ Copyright (c) 1987 Massachusetts Institute of Technology @@ -44,16 +44,7 @@ MIT in each case. |# (WORD (16 expression SIGNED))) ((L (? expression)) - (WORD (32 expression SIGNED))) - - ((O (? expression)) - (GROWING-WORD - (offset expression) - ((0 65535) - (WORD (16 offset))) - ;; Always non-negative - ((0 ()) - (WORD (32 (1+ offset))))))) + (WORD (32 expression SIGNED)))) ;;;; BCD Arithmetic diff --git a/v7/src/compiler/machines/bobcat/lapgen.scm b/v7/src/compiler/machines/bobcat/lapgen.scm index 00e6925b1..2c83cf0e4 100644 --- a/v7/src/compiler/machines/bobcat/lapgen.scm +++ b/v7/src/compiler/machines/bobcat/lapgen.scm @@ -1,6 +1,6 @@ #| -*-Scheme-*- -$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/compiler/machines/bobcat/lapgen.scm,v 1.187 1987/07/30 07:10:24 jinx Exp $ +$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/compiler/machines/bobcat/lapgen.scm,v 1.188 1987/07/30 21:44:13 jinx Exp $ Copyright (c) 1987 Massachusetts Institute of Technology @@ -257,7 +257,7 @@ MIT in each case. |# (set! compiler:external-labels (cons label compiler:external-labels)) (LAP (ENTRY-POINT ,label) - (DC O (- ,label ,block-start-label)) + (BLOCK-OFFSET ,label) (LABEL ,label))) ;;;; Registers/Entries diff --git a/v7/src/compiler/machines/bobcat/make.scm-68040 b/v7/src/compiler/machines/bobcat/make.scm-68040 index ac83525f6..26d85d821 100644 --- a/v7/src/compiler/machines/bobcat/make.scm-68040 +++ b/v7/src/compiler/machines/bobcat/make.scm-68040 @@ -1,6 +1,6 @@ #| -*-Scheme-*- -$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/compiler/machines/bobcat/make.scm-68040,v 1.37 1987/07/30 07:10:47 jinx Exp $ +$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/compiler/machines/bobcat/make.scm-68040,v 1.38 1987/07/30 21:44:39 jinx Exp $ Copyright (c) 1987 Massachusetts Institute of Technology @@ -46,11 +46,11 @@ MIT in each case. |# (make-environment (define :name "Liar (Bobcat 68020)") (define :version 1) - (define :modification 37) + (define :modification 38) (define :files) ; (parse-rcs-header -; "$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/compiler/machines/bobcat/make.scm-68040,v 1.37 1987/07/30 07:10:47 jinx Exp $" +; "$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/compiler/machines/bobcat/make.scm-68040,v 1.38 1987/07/30 21:44:39 jinx Exp $" ; (lambda (filename version date time zone author state) ; (set! :version (car version)) ; (set! :modification (cadr version)))) diff --git a/v7/src/compiler/machines/bobcat/rules3.scm b/v7/src/compiler/machines/bobcat/rules3.scm index 5d7d57dbc..10cfe98a8 100644 --- a/v7/src/compiler/machines/bobcat/rules3.scm +++ b/v7/src/compiler/machines/bobcat/rules3.scm @@ -1,6 +1,6 @@ #| -*-Scheme-*- -$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/compiler/machines/bobcat/rules3.scm,v 1.12 1987/07/30 07:10:59 jinx Exp $ +$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/compiler/machines/bobcat/rules3.scm,v 1.13 1987/07/30 21:44:51 jinx Exp $ Copyright (c) 1987 Massachusetts Institute of Technology @@ -323,5 +323,5 @@ MIT in each case. |# (define (make-external-label label) (set! compiler:external-labels (cons label compiler:external-labels)) - (LAP (DC O (- ,label ,*block-start-label*)) + (LAP (BLOCK-OFFSET ,label) (LABEL ,label)))