* Introduce new RTL expression type CONS-NON-POINTER and change
authorChris Hanson <org/chris-hanson/cph>
Fri, 25 Oct 1991 06:50:06 +0000 (06:50 +0000)
committerChris Hanson <org/chris-hanson/cph>
Fri, 25 Oct 1991 06:50:06 +0000 (06:50 +0000)
  appropriate instances of CONS-POINTER to use the new type.

* Replace RTL expression type @ADDRESS->FLOAT with new type
  OBJECT->FLOAT.

* Introduce new internal switch USE-PRE/POST-INCREMENT?.  Change code
  generation of in-line consing to pay attention to this switch.

* Merge common parts of "machine/make" into new file "base/make".

On MIPS:

* Change code sequence that assigns type codes to assume that the type
  field has a known value.  This eliminates one instruction in every
  type-code assignment.  It assumes that the data segment bits have a
  certain value, but the microcode already does this.

* Cache immediate constants in registers, and remember which registers
  contain which constants.  (This should be improved by noticing when
  arithmetic operations are done on known constants and cacheing the
  results.)

* Set USE-PRE/POST-INCREMENT? to false, saving one instruction in
  every CONS, and multiple instructions in each call to VECTOR.

v7/src/compiler/machines/bobcat/compiler.pkg
v7/src/compiler/machines/bobcat/machin.scm
v7/src/compiler/machines/bobcat/make.scm-68020
v7/src/compiler/machines/bobcat/make.scm-68040
v7/src/compiler/machines/bobcat/mc68ktgl.scm
v7/src/compiler/machines/bobcat/rules1.scm
v7/src/compiler/machines/bobcat/rulrew.scm

index d7b9c3e8a0270d44d9300d49fe4dd4e990df4be7..f41be302b4e132d5b8e011e86a54998f632768ca 100644 (file)
@@ -1,8 +1,8 @@
 #| -*-Scheme-*-
 
-$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/compiler/machines/bobcat/compiler.pkg,v 1.33 1991/07/25 02:34:14 cph Exp $
+$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/compiler/machines/bobcat/compiler.pkg,v 1.34 1991/10/25 06:49:28 cph Exp $
 
-Copyright (c) 1988-1991 Massachusetts Institute of Technology
+Copyright (c) 1988-91 Massachusetts Institute of Technology
 
 This material was developed by the Scheme project at the Massachusetts
 Institute of Technology, Department of Electrical Engineering and
@@ -590,6 +590,7 @@ MIT in each case. |#
         "machines/bobcat/instr4"       ;  "        "
         "machines/bobcat/flinstr1"     ;68881 Floating Point Instructions
         "machines/bobcat/flinstr2"     ;  "        "     "        "
+        "machines/bobcat/mc68ktgl"     ;68020/68040 selection
         )
   (parent (compiler))
   (export (compiler)
index 10e52eab06b84f99e99a7251550b85c26ce4fff1..f2ddd94adbedc36093c8e01d072a9b73168ecb83 100644 (file)
@@ -1,8 +1,8 @@
 #| -*-Scheme-*-
 
-$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/compiler/machines/bobcat/machin.scm,v 4.25 1991/05/28 19:14:36 jinx Exp $
+$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 $
 
-Copyright (c) 1988-1991 Massachusetts Institute of Technology
+Copyright (c) 1988-91 Massachusetts Institute of Technology
 
 This material was developed by the Scheme project at the Massachusetts
 Institute of Technology, Department of Electrical Engineering and
@@ -39,6 +39,7 @@ MIT in each case. |#
 \f
 ;;;; Architecture Parameters
 
+(define use-pre/post-increment? true)
 (define-integrable endianness 'BIG)
 (define-integrable addressing-granularity 8)
 (define-integrable scheme-object-width 32)
index 72750dd2a0b84f60e3f7d966629667ff9febb0ec..c59c15e96f3daca7fe9fb1f60bf96876255bbe30 100644 (file)
@@ -1,6 +1,6 @@
 #| -*-Scheme-*-
 
-$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/compiler/machines/bobcat/make.scm-68020,v 4.87 1991/07/25 07:24:04 cph Exp $
+$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/compiler/machines/bobcat/make.scm-68020,v 4.88 1991/10/25 06:49:41 cph Exp $
 
 Copyright (c) 1991 Massachusetts Institute of Technology
 
@@ -36,13 +36,7 @@ MIT in each case. |#
 
 (declare (usual-integrations))
 
-(package/system-loader "comp" '() 'QUERY)
-(for-each (lambda (name)
-           ((package/reference (find-package name) 'INITIALIZE-PACKAGE!)))
-         '((COMPILER MACROS)
-           (COMPILER DECLARATIONS)))
-(load "machines/bobcat/mc68ktgl")
-((package/reference (find-package '(COMPILER LAP-SYNTAXER))
-                   'MC68K/toggle-closure-format)
- 'MC68020)
-(add-system! (make-system "Liar (Motorola MC68020)" 4 87 '()))
\ No newline at end of file
+((load "base/make") "Motorola MC68020")
+((environment-lookup (->environment '(COMPILER LAP-SYNTAXER))
+                    'MC68K/TOGGLE-CLOSURE-FORMAT)
+ 'MC68020)
\ No newline at end of file
index 5b2f838248771d0a59cec740a9daf21b39440ac0..f3c360b35fd998fd8775714a5e502d0894148c39 100644 (file)
@@ -1,8 +1,8 @@
 #| -*-Scheme-*-
 
-$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/compiler/machines/bobcat/make.scm-68040,v 4.87 1991/07/25 02:34:28 cph Exp $
+$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/compiler/machines/bobcat/make.scm-68040,v 4.88 1991/10/25 06:49:46 cph Exp $
 
-Copyright (c) 1988-91 Massachusetts Institute of Technology
+Copyright (c) 1991 Massachusetts Institute of Technology
 
 This material was developed by the Scheme project at the Massachusetts
 Institute of Technology, Department of Electrical Engineering and
@@ -36,9 +36,7 @@ MIT in each case. |#
 
 (declare (usual-integrations))
 
-(package/system-loader "comp" '() 'QUERY)
-(for-each (lambda (name)
-           ((package/reference (find-package name) 'INITIALIZE-PACKAGE!)))
-         '((COMPILER MACROS)
-           (COMPILER DECLARATIONS)))
-(add-system! (make-system "Liar (Motorola MC68040)" 4 87 '()))
\ No newline at end of file
+((load "base/make") "Motorola MC68040")
+((environment-lookup (->environment '(COMPILER LAP-SYNTAXER))
+                    'MC68K/TOGGLE-CLOSURE-FORMAT)
+ 'MC68040)
\ No newline at end of file
index 77446c5107352ff5bd2c082ee7d5524461b2dd3d..242f2b1e907bf27aa4514cca9d60179e77d181d6 100644 (file)
@@ -1,6 +1,6 @@
 #| -*- Scheme -*-
 
-$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/compiler/machines/bobcat/mc68ktgl.scm,v 1.1 1991/03/24 23:53:02 jinx Exp $
+$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/compiler/machines/bobcat/mc68ktgl.scm,v 1.2 1991/10/25 06:49:53 cph Exp $
 
 Copyright (c) 1991 Massachusetts Institute of Technology
 
@@ -33,58 +33,33 @@ promotional, or sales literature without prior written consent from
 MIT in each case. |#
 
 (declare (usual-integrations))
-\f
-(in-package (->environment '(compiler lap-syntaxer))
-  
-;; This procedure toggles the closure format for the mc68k back end.
 
 (define (mc68k/toggle-closure-format #!optional new-format)
-  (let ((new-format
-        (cond ((not (default-object? new-format))
-               new-format)
-              ((eq? MC68K/closure-format 'MC68020)
-               'MC68040)
-              (else
-               'MC68020))))
-    (if (not (eq? new-format MC68K/closure-format))
-       (case new-format
-         ((MC68020)
-          (set! mc68k/closure-format
-                'MC68020)
-          (set! closure-first-offset
-                MC68020/closure-first-offset)
-          (set! closure-object-first-offset
-                MC68020/closure-object-first-offset)
-          (set! closure-entry-distance
-                MC68020/closure-entry-distance)
-          (set! closure-environment-adjustment
-                MC68020/closure-environment-adjustment)
-          (set! generate/closure-header
-                MC68020/closure-header)
-          (set! generate/cons-closure
-                MC68020/cons-closure)
-          (set! generate/cons-multiclosure
-                MC68020/cons-multiclosure))
-         ((MC68040)
-          (set! mc68k/closure-format
-                'MC68040)
-          (set! closure-first-offset
-                MC68040/closure-first-offset)
-          (set! closure-object-first-offset
-                MC68040/closure-object-first-offset)
-          (set! closure-entry-distance
-                MC68040/closure-entry-distance)
-          (set! closure-environment-adjustment
-                MC68040/closure-environment-adjustment)
-          (set! generate/closure-header
-                MC68040/closure-header)
-          (set! generate/cons-closure
-                MC68040/cons-closure)
-          (set! generate/cons-multiclosure
-                MC68040/cons-multiclosure))
-         (error "MC68K/toggle-closure-format: Unknown format"
-                new-format)))
-    (warn "MC68K/closure-format is now" MC68K/closure-format)
-    MC68K/closure-format))
-
-) ;; End of in-package.
+  (case (if (default-object? new-format)
+           (if (eq? MC68K/closure-format 'MC68020)
+               'MC68040
+               'MC68020)
+           new-format)
+    ((MC68020)
+     (set! closure-first-offset MC68020/closure-first-offset)
+     (set! closure-object-first-offset MC68020/closure-object-first-offset)
+     (set! closure-entry-distance MC68020/closure-entry-distance)
+     (set! closure-environment-adjustment
+          MC68020/closure-environment-adjustment)
+     (set! generate/closure-header MC68020/closure-header)
+     (set! generate/cons-closure MC68020/cons-closure)
+     (set! generate/cons-multiclosure MC68020/cons-multiclosure)
+     (set! mc68k/closure-format 'MC68020))
+    ((MC68040)
+     (set! closure-first-offset MC68040/closure-first-offset)
+     (set! closure-object-first-offset MC68040/closure-object-first-offset)
+     (set! closure-entry-distance MC68040/closure-entry-distance)
+     (set! closure-environment-adjustment
+          MC68040/closure-environment-adjustment)
+     (set! generate/closure-header MC68040/closure-header)
+     (set! generate/cons-closure MC68040/cons-closure)
+     (set! generate/cons-multiclosure MC68040/cons-multiclosure)
+     (set! mc68k/closure-format 'MC68040))
+    (else
+     (error "Unknown closure format:" new-format)))
+  MC68K/closure-format)
\ No newline at end of file
index a60048ece451c0da81c690b3e01cce377b7384a6..b4b11e2da0bff64fbdd893dfda2868c46ebfcc9b 100644 (file)
@@ -1,8 +1,8 @@
 #| -*-Scheme-*-
 
-$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/compiler/machines/bobcat/rules1.scm,v 4.35 1991/05/28 19:14:47 jinx Exp $
+$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/compiler/machines/bobcat/rules1.scm,v 4.36 1991/10/25 06:49:58 cph Exp $
 
-Copyright (c) 1988, 1989, 1990 Massachusetts Institute of Technology
+Copyright (c) 1988-91 Massachusetts Institute of Technology
 
 This material was developed by the Scheme project at the Massachusetts
 Institute of Technology, Department of Electrical Engineering and
@@ -703,11 +703,15 @@ MIT in each case. |#
           (FMOVE D ,source (@A+ 5))))))
 
 (define-rule statement
-  (ASSIGN (REGISTER (? target))
-         (@ADDRESS->FLOAT (REGISTER (? source))))
-  (let ((source (indirect-reference! source 1)))
+  (ASSIGN (REGISTER (? target)) (OBJECT->FLOAT (REGISTER (? source))))
+  (let ((source (standard-move-to-temporary! source 'DATA))
+       (temp (allocate-temporary-register! 'ADDRESS)))
     (delete-dead-registers!)
-    (LAP (FMOVE D ,source ,(reference-target-alias! target 'FLOAT)))))
+    (LAP ,@(object->address source)
+        (MOV L ,source ,(register-reference temp))
+        (FMOVE D
+               ,(offset-reference temp 1)
+               ,(reference-target-alias! target 'FLOAT)))))
 
 (define-rule statement
   (ASSIGN (? target)
index e89bbce804ca704f4378a7ca9946468ab3949bfe..2cfe828829e2aed1f820bb001d56ca99bc5a50a2 100644 (file)
@@ -1,8 +1,8 @@
 #| -*-Scheme-*-
 
-$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/compiler/machines/bobcat/rulrew.scm,v 1.3 1990/05/03 15:17:42 jinx Rel $
+$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/compiler/machines/bobcat/rulrew.scm,v 1.4 1991/10/25 06:50:06 cph Exp $
 
-Copyright (c) 1990 Massachusetts Institute of Technology
+Copyright (c) 1990-91 Massachusetts Institute of Technology
 
 This material was developed by the Scheme project at the Massachusetts
 Institute of Technology, Department of Electrical Engineering and
@@ -39,6 +39,13 @@ MIT in each case. |#
 \f
 ;;;; Synthesized Data
 
+(define-rule rewriting
+  (CONS-NON-POINTER (? type) (? datum))
+  ;; On 68000, there's no difference between an address and a datum,
+  ;; so the rules for constructing non-pointer objects are the same as
+  ;; those for pointer objects.
+  (rtl:make-cons-pointer type datum))
+
 (define-rule rewriting
   (CONS-POINTER (REGISTER (? type register-known-value)) (? datum))
   (QUALIFIER (rtl:machine-constant? type))