Change implementation of INVOCATION:APPLY to use the new
authorChris Hanson <org/chris-hanson/cph>
Mon, 28 Dec 1992 22:03:26 +0000 (22:03 +0000)
committerChris Hanson <org/chris-hanson/cph>
Mon, 28 Dec 1992 22:03:26 +0000 (22:03 +0000)
shortcircuit_apply code in the microcode interface.  This change
requires version 11.124 of the microcode.

v7/src/compiler/base/make.scm
v7/src/compiler/machines/mips/rules3.scm

index 99e159772a16183db8761841de9e2b1755dfe2a7..54759f834583384bd1fb23be0211cbc038c9b175 100644 (file)
@@ -1,6 +1,6 @@
 #| -*-Scheme-*-
 
-$Id: make.scm,v 4.95 1992/12/02 19:35:10 cph Exp $
+$Id: make.scm,v 4.96 1992/12/28 22:03:26 cph Exp $
 
 Copyright (c) 1988-1992 Massachusetts Institute of Technology
 
@@ -46,5 +46,5 @@ MIT in each case. |#
     (initialize-package! '(COMPILER DECLARATIONS)))
   (add-system!
    (make-system (string-append "Liar (" architecture-name ")")
-               4 95
+               4 96
                '())))
\ No newline at end of file
index d3182036c6683d846f07e37835c6b7cec7a5b9c6..afb342440a03ecbb6b96f37787e1ea0c44e98c8e 100644 (file)
@@ -1,6 +1,6 @@
 #| -*-Scheme-*-
 
-$Id: rules3.scm,v 1.14 1992/09/30 21:05:57 cph Exp $
+$Id: rules3.scm,v 1.15 1992/12/28 22:02:50 cph Exp $
 
 Copyright (c) 1988-1992 Massachusetts Institute of Technology
 
@@ -56,10 +56,28 @@ MIT in each case. |#
   (INVOCATION:APPLY (? frame-size) (? continuation))
   continuation                         ;ignore
   (LAP ,@(clear-map!)
-       ,@(load-immediate regnum:third-arg frame-size #F)
-       (LW ,regnum:second-arg (OFFSET 0 ,regnum:stack-pointer))
-       (ADDI ,regnum:stack-pointer ,regnum:stack-pointer 4)
-       ,@(invoke-interface code:compiler-apply)))
+       (ADDI ,regnum:second-arg ,regnum:scheme-to-interface -56)
+       ,@(let ((regs (get-immediate-aliases frame-size)))
+          (cond ((not (null? regs))
+                 (LAP (JR ,regnum:second-arg)
+                      ,@(if (memv regnum:third-arg regs)
+                            (LAP (NOP))
+                            (LAP (ADD ,regnum:third-arg 0 ,(car regs))))))
+                ((fits-in-16-bits-signed? frame-size)
+                 (LAP (JR ,regnum:second-arg)
+                      (ADDIU ,regnum:third-arg 0 ,frame-size)))
+                ((fits-in-16-bits-unsigned? frame-size)
+                 (LAP (JR ,regnum:second-arg)
+                      (ORI ,regnum:third-arg 0 ,frame-size)))
+                ((top-16-bits-only? frame-size)
+                 (LAP (JR ,regnum:second-arg)
+                      (LUI ,regnum:third-arg ,(top-16-bits frame-size))))
+                (else
+                 (LAP (LUI ,regnum:third-arg ,(top-16-bits frame-size))
+                      (JR ,regnum:second-arg)
+                      (ORI ,regnum:third-arg
+                           ,regnum:third-arg
+                           ,(bottom-16-bits frame-size))))))))
 
 (define-rule statement
   (INVOCATION:JUMP (? frame-size) (? continuation) (? label))