From: Guillermo J. Rozas Date: Sun, 8 Nov 1992 04:12:22 +0000 (+0000) Subject: Conditionalization for the C back end. X-Git-Tag: 20090517-FFI~8794 X-Git-Url: https://birchwood-abbey.net/git?a=commitdiff_plain;h=03b1eec2a6047663ae232fdc6bc77a1517645e05;p=mit-scheme.git Conditionalization for the C back end. --- diff --git a/v7/src/compiler/machines/alpha/machin.scm b/v7/src/compiler/machines/alpha/machin.scm index a34b0e7c2..2c0532ed5 100644 --- a/v7/src/compiler/machines/alpha/machin.scm +++ b/v7/src/compiler/machines/alpha/machin.scm @@ -1,6 +1,6 @@ #| -*-Scheme-*- -$Id: machin.scm,v 1.1 1992/08/29 13:51:27 jinx Exp $ +$Id: machin.scm,v 1.2 1992/11/08 04:12:22 jinx Exp $ Copyright (c) 1992 Digital Equipment Corporation (D.E.C.) @@ -119,6 +119,12 @@ case. (define (closure-environment-adjustment nentries entry) nentries entry ; ignored 0) + +(define-integrable (byte-offset:zero? obj) + (zero? obj)) + +(define-integrable (byte-offset:- x y) + (- x y)) ;;;; Machine Registers diff --git a/v7/src/compiler/machines/bobcat/machin.scm b/v7/src/compiler/machines/bobcat/machin.scm index f2ddd94ad..8f5e38d4e 100644 --- a/v7/src/compiler/machines/bobcat/machin.scm +++ b/v7/src/compiler/machines/bobcat/machin.scm @@ -1,8 +1,8 @@ #| -*-Scheme-*- -$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/compiler/machines/bobcat/machin.scm,v 4.26 1991/10/25 06:49:34 cph Exp $ +$Id: machin.scm,v 4.27 1992/11/08 04:10:31 jinx Exp $ -Copyright (c) 1988-91 Massachusetts Institute of Technology +Copyright (c) 1988-1992 Massachusetts Institute of Technology This material was developed by the Scheme project at the Massachusetts Institute of Technology, Department of Electrical Engineering and @@ -213,6 +213,12 @@ MIT in each case. |# (define/format-dependent closure-environment-adjustment) ) + +(define-integrable (byte-offset:zero? obj) + (zero? obj)) + +(define-integrable (byte-offset:- x y) + (- x y)) (define-integrable d0 0) (define-integrable d1 1) diff --git a/v7/src/compiler/machines/i386/machin.scm b/v7/src/compiler/machines/i386/machin.scm index 0cef124a6..189f1d154 100644 --- a/v7/src/compiler/machines/i386/machin.scm +++ b/v7/src/compiler/machines/i386/machin.scm @@ -1,7 +1,6 @@ #| -*-Scheme-*- -$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/compiler/machines/i386/machin.scm,v 1.13 1992/08/17 16:35:58 jinx Exp $ -$MC68020-Header: /scheme/src/compiler/machines/bobcat/RCS/machin.scm,v 4.26 1991/10/25 06:49:34 cph Exp $ +$Id: machin.scm,v 1.14 1992/11/08 04:12:02 jinx Exp $ Copyright (c) 1992 Massachusetts Institute of Technology @@ -121,7 +120,15 @@ MIT in each case. |# (define (closure-environment-adjustment nentries entry) (declare (integrate-operator closure-entry-distance)) (closure-entry-distance nentries entry 0)) + +(define-integrable (byte-offset:zero? obj) + (zero? obj)) + +(define-integrable (byte-offset:- x y) + (- x y)) +;;;; Machine registers + (define eax 0) ; acumulator (define ecx 1) ; counter register (define edx 2) ; multiplication high-half target diff --git a/v7/src/compiler/machines/mips/machin.scm b/v7/src/compiler/machines/mips/machin.scm index 9e4a18e41..810c57ef4 100644 --- a/v7/src/compiler/machines/mips/machin.scm +++ b/v7/src/compiler/machines/mips/machin.scm @@ -1,6 +1,6 @@ #| -*-Scheme-*- -$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/compiler/machines/mips/machin.scm,v 1.7 1992/08/20 01:25:15 jinx Exp $ +$Id: machin.scm,v 1.8 1992/11/08 04:11:28 jinx Exp $ Copyright (c) 1988-1992 Massachusetts Institute of Technology @@ -115,6 +115,12 @@ MIT in each case. |# (define (closure-environment-adjustment nentries entry) nentries entry ; ignored 0) + +(define-integrable (byte-offset:zero? obj) + (zero? obj)) + +(define-integrable (byte-offset:- x y) + (- x y)) ;;;; Machine Registers diff --git a/v7/src/compiler/machines/spectrum/machin.scm b/v7/src/compiler/machines/spectrum/machin.scm index e8e68e30e..df7f9f92b 100644 --- a/v7/src/compiler/machines/spectrum/machin.scm +++ b/v7/src/compiler/machines/spectrum/machin.scm @@ -1,8 +1,8 @@ #| -*-Scheme-*- -$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/compiler/machines/spectrum/machin.scm,v 4.24 1991/10/25 12:29:51 cph Exp $ +$Id: machin.scm,v 4.25 1992/11/08 04:09:47 jinx Exp $ -Copyright (c) 1988-91 Massachusetts Institute of Technology +Copyright (c) 1988-1992 Massachusetts Institute of Technology This material was developed by the Scheme project at the Massachusetts Institute of Technology, Department of Electrical Engineering and @@ -147,6 +147,12 @@ MIT in each case. |# (define (closure-environment-adjustment nentries entry) nentries entry ; ignored 0) + +(define-integrable (byte-offset:zero? obj) + (zero? obj)) + +(define-integrable (byte-offset:- x y) + (- x y)) ;;;; Machine Registers diff --git a/v7/src/compiler/machines/vax/machin.scm b/v7/src/compiler/machines/vax/machin.scm index a85a0ea0d..b8739cad2 100644 --- a/v7/src/compiler/machines/vax/machin.scm +++ b/v7/src/compiler/machines/vax/machin.scm @@ -1,8 +1,8 @@ #| -*-Scheme-*- -$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/compiler/machines/vax/machin.scm,v 4.8 1991/10/25 12:57:26 cph Exp $ +$Id: machin.scm,v 4.9 1992/11/08 04:11:05 jinx Exp $ -Copyright (c) 1987-91 Massachusetts Institute of Technology +Copyright (c) 1987-1992 Massachusetts Institute of Technology This material was developed by the Scheme project at the Massachusetts Institute of Technology, Department of Electrical Engineering and @@ -120,6 +120,12 @@ MIT in each case. |# (declare (integrate-operator closure-entry-distance)) (closure-entry-distance nentries entry 0)) +(define-integrable (byte-offset:zero? obj) + (zero? obj)) + +(define-integrable (byte-offset:- x y) + (- x y)) + (define-integrable r0 0) ; return value (define-integrable r1 1) (define-integrable r2 2) diff --git a/v7/src/compiler/rtlgen/rgrval.scm b/v7/src/compiler/rtlgen/rgrval.scm index b9e4d4dcc..67c2d6251 100644 --- a/v7/src/compiler/rtlgen/rgrval.scm +++ b/v7/src/compiler/rtlgen/rgrval.scm @@ -1,8 +1,8 @@ #| -*-Scheme-*- -$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/compiler/rtlgen/rgrval.scm,v 4.17 1990/08/24 20:19:59 jinx Rel $ +$Id: rgrval.scm,v 4.18 1992/11/08 04:07:53 jinx Exp $ -Copyright (c) 1988, 1990 Massachusetts Institute of Technology +Copyright (c) 1988-1992 Massachusetts Institute of Technology This material was developed by the Scheme project at the Massachusetts Institute of Technology, Department of Electrical Engineering and @@ -267,9 +267,10 @@ MIT in each case. |# (entry (closure-block-entry-number block)) (entry* (closure-block-entry-number block*))) (let ((distance - (- (closure-entry-distance nentries entry entry*) - (closure-environment-adjustment nentries entry)))) - (if (zero? distance) + (byte-offset:- + (closure-entry-distance nentries entry entry*) + (closure-environment-adjustment nentries entry)))) + (if (byte-offset:zero? distance) expression ;; This is cheaper than the obvious thing with object->address, ;; etc. @@ -399,6 +400,7 @@ MIT in each case. |# ;; is always the canonical entry point. (let* ((closure-block (procedure-closing-block procedure)) (shared-block (block-shared-block closure-block))) - (zero? (closure-environment-adjustment - (block-number-of-entries shared-block) - (closure-block-entry-number closure-block))))) \ No newline at end of file + (byte-offset:zero? + (closure-environment-adjustment + (block-number-of-entries shared-block) + (closure-block-entry-number closure-block))))) \ No newline at end of file