diff --git a/compiler/mips/c-call.lisp b/compiler/mips/c-call.lisp index e93632ba86589db6a086f92462e4d2d5881ba4a4..b227b908a5645e81456dcf6a60e8d0d9e6d02401 100644 --- a/compiler/mips/c-call.lisp +++ b/compiler/mips/c-call.lisp @@ -7,7 +7,7 @@ ;;; Lisp, please contact Scott Fahlman (Scott.Fahlman@CS.CMU.EDU) ;;; ********************************************************************** ;;; -;;; $Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/compiler/mips/c-call.lisp,v 1.1 1990/11/03 03:23:55 wlott Exp $ +;;; $Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/compiler/mips/c-call.lisp,v 1.2 1990/11/03 18:13:36 wlott Exp $ ;;; ;;; This file contains the VOPs and other necessary machine specific support ;;; routines for call-out to C. @@ -129,6 +129,9 @@ (:save-p t) (:info function) (:temporary (:sc any-reg :offset 2 :to (:result 0)) v0) + (:temporary (:sc any-reg :offset lra-offset) lra) + (:temporary (:sc any-reg :offset code-offset) code) + (:temporary (:scs (non-descriptor-reg)) temp) (:temporary (:sc control-stack :offset nfp-save-offset) nfp-save) (:vop-var vop) (:generator 0 @@ -136,8 +139,27 @@ (cur-nfp (current-nfp-tn vop))) (when cur-nfp (store-stack-tn nfp-save cur-nfp)) + (inst compute-lra-from-code lra code lra-label temp) (inst li v0 (make-fixup function :foreign)) - (inst jal (make-fixup "call_into_c" :foreign)) + (inst li temp (make-fixup "call_into_c" :foreign)) + (inst j temp) (inst nop) + + (align vm:lowtag-bits) + (emit-label lra-label) + (inst lra-header-word) (when cur-nfp (load-stack-tn cur-nfp nfp-save))))) + +(define-vop (alloc-number-stack-space) + (:info amount) + (:results (result :scs (sap-reg any-reg))) + (:generator 0 + (inst addu nsp-tn nsp-tn (- (logandc2 (+ amount 7) 7))) + (move result nsp-tn))) + +(define-vop (dealloc-number-stack-space) + (:info amount) + (:policy :fast-safe) + (:generator 0 + (inst addu nsp-tn nsp-tn (logandc2 (+ amount 7) 7)))) diff --git a/compiler/mips/subprim.lisp b/compiler/mips/subprim.lisp index 308390e7c38a233cbca337b0c4461de3590fcebb..342c5fe4a889ce12dc47a294ae3fb305138c73d9 100644 --- a/compiler/mips/subprim.lisp +++ b/compiler/mips/subprim.lisp @@ -1,4 +1,4 @@ -;;; -*- Package: C; Log: C.Log -*- +;;; -*- Package: MIPS; Log: C.Log -*- ;;; ;;; ********************************************************************** ;;; This code was written as part of the Spice Lisp project at @@ -7,7 +7,7 @@ ;;; Scott Fahlman (FAHLMAN@CMUC). ;;; ********************************************************************** ;;; -;;; $Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/compiler/mips/subprim.lisp,v 1.18 1990/11/03 03:25:54 wlott Exp $ +;;; $Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/compiler/mips/subprim.lisp,v 1.19 1990/11/03 18:13:51 wlott Exp $ ;;; ;;; Linkage information for standard static functions, and random vops. ;;; @@ -59,54 +59,3 @@ - -;;;; Foreign function call interfaces. - -(define-vop (foreign-symbol-address) - (:info foreign-symbol) - (:results (res :scs (sap-reg))) - (:generator 2 - (inst li res (make-fixup foreign-symbol :foreign)))) - -(define-vop (call-out) - (:args (args :more t)) - (:results (results :more t)) - (:ignore args results) - (:save-p t) - (:info function) - (:temporary (:sc any-reg :offset 2 :to (:result 0)) v0) - (:temporary (:sc any-reg :offset lra-offset) lra) - (:temporary (:sc any-reg :offset code-offset) code) - (:temporary (:scs (non-descriptor-reg)) temp) - (:temporary (:sc control-stack :offset nfp-save-offset) nfp-save) - (:vop-var vop) - (:generator 0 - (let ((lra-label (gen-label)) - (cur-nfp (current-nfp-tn vop))) - (when cur-nfp - (store-stack-tn nfp-save cur-nfp)) - (inst compute-lra-from-code lra code lra-label temp) - (inst li v0 (make-fixup function :foreign)) - (inst li temp (make-fixup "call_into_c" :foreign)) - (inst j temp) - (inst nop) - - (align vm:lowtag-bits) - (emit-label lra-label) - (inst lra-header-word) - (when cur-nfp - (load-stack-tn cur-nfp nfp-save))))) - - -(define-vop (alloc-number-stack-space) - (:info amount) - (:results (result :scs (sap-reg any-reg))) - (:generator 0 - (inst addu nsp-tn nsp-tn (- (logandc2 (+ amount 7) 7))) - (move result nsp-tn))) - -(define-vop (dealloc-number-stack-space) - (:info amount) - (:policy :fast-safe) - (:generator 0 - (inst addu nsp-tn nsp-tn (logandc2 (+ amount 7) 7))))