Skip to content
Snippets Groups Projects
Commit e8171c3c authored by wlott's avatar wlott
Browse files

Fixed {alloc,dealloc}-number-stack-space to work with large amounts.

parent 0744d40d
No related branches found
No related tags found
No related merge requests found
...@@ -7,11 +7,11 @@ ...@@ -7,11 +7,11 @@
;;; Scott Fahlman or slisp-group@cs.cmu.edu. ;;; Scott Fahlman or slisp-group@cs.cmu.edu.
;;; ;;;
(ext:file-comment (ext:file-comment
"$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/compiler/mips/c-call.lisp,v 1.10 1992/03/22 17:30:01 wlott Exp $") "$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/compiler/mips/c-call.lisp,v 1.11 1992/03/27 23:25:38 wlott Exp $")
;;; ;;;
;;; ********************************************************************** ;;; **********************************************************************
;;; ;;;
;;; $Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/compiler/mips/c-call.lisp,v 1.10 1992/03/22 17:30:01 wlott Exp $ ;;; $Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/compiler/mips/c-call.lisp,v 1.11 1992/03/27 23:25:38 wlott Exp $
;;; ;;;
;;; This file contains the VOPs and other necessary machine specific support ;;; This file contains the VOPs and other necessary machine specific support
;;; routines for call-out to C. ;;; routines for call-out to C.
...@@ -186,14 +186,26 @@ ...@@ -186,14 +186,26 @@
(define-vop (alloc-number-stack-space) (define-vop (alloc-number-stack-space)
(:info amount) (:info amount)
(:results (result :scs (sap-reg any-reg))) (:results (result :scs (sap-reg any-reg)))
(:temporary (:scs (unsigned-reg) :to (:result 0)) temp)
(:generator 0 (:generator 0
(unless (zerop amount) (unless (zerop amount)
(inst addu nsp-tn nsp-tn (- (logandc2 (+ amount 7) 7)))) (let ((delta (logandc2 (+ amount 7) 7)))
(cond ((< delta (ash 1 15))
(inst subu nsp-tn delta))
(t
(inst li temp delta)
(inst subu nsp-tn temp)))))
(move result nsp-tn))) (move result nsp-tn)))
(define-vop (dealloc-number-stack-space) (define-vop (dealloc-number-stack-space)
(:info amount) (:info amount)
(:policy :fast-safe) (:policy :fast-safe)
(:temporary (:scs (unsigned-reg) :to (:result 0)) temp)
(:generator 0 (:generator 0
(unless (zerop amount) (unless (zerop amount)
(inst addu nsp-tn nsp-tn (logandc2 (+ amount 7) 7))))) (let ((delta (logandc2 (+ amount 7) 7)))
(cond ((< delta (ash 1 15))
(inst addu nsp-tn delta))
(t
(inst li temp delta)
(inst addu nsp-tn temp)))))))
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
;;; Scott Fahlman or slisp-group@cs.cmu.edu. ;;; Scott Fahlman or slisp-group@cs.cmu.edu.
;;; ;;;
(ext:file-comment (ext:file-comment
"$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/compiler/sparc/c-call.lisp,v 1.7 1992/03/22 17:30:14 wlott Exp $") "$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/compiler/sparc/c-call.lisp,v 1.8 1992/03/27 23:26:05 wlott Exp $")
;;; ;;;
;;; ********************************************************************** ;;; **********************************************************************
;;; ;;;
...@@ -148,15 +148,26 @@ ...@@ -148,15 +148,26 @@
(define-vop (alloc-number-stack-space) (define-vop (alloc-number-stack-space)
(:info amount) (:info amount)
(:results (result :scs (sap-reg any-reg))) (:results (result :scs (sap-reg any-reg)))
(:temporary (:scs (unsigned-reg) :to (:result 0)) temp)
(:generator 0 (:generator 0
(unless (zerop amount) (unless (zerop amount)
(inst add nsp-tn nsp-tn (- (logandc2 (+ amount 7) 7)))) (let ((delta (logandc2 (+ amount 7) 7)))
(unless (location= nsp-tn result) (cond ((< delta (ash 1 12))
(inst add result nsp-tn number-stack-displacement)))) (inst sub nsp-tn delta))
(t
(inst li temp delta)
(inst sub nsp-tn temp)))))
(inst add result nsp-tn number-stack-displacement)))
(define-vop (dealloc-number-stack-space) (define-vop (dealloc-number-stack-space)
(:info amount) (:info amount)
(:policy :fast-safe) (:policy :fast-safe)
(:temporary (:scs (unsigned-reg) :to (:result 0)) temp)
(:generator 0 (:generator 0
(unless (zerop amount) (unless (zerop amount)
(inst add nsp-tn nsp-tn (logandc2 (+ amount 7) 7))))) (let ((delta (logandc2 (+ amount 7) 7)))
(cond ((< delta (ash 1 12))
(inst add nsp-tn delta))
(t
(inst li temp delta)
(inst add nsp-tn temp)))))))
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment