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

Wrote maybe-load-stack-tn, which will either load the value off the stack

or move it from a register depending on where it is.
parent c1c658b2
No related branches found
No related tags found
No related merge requests found
......@@ -7,7 +7,7 @@
;;; Scott Fahlman (FAHLMAN@CMUC).
;;; **********************************************************************
;;;
;;; $Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/compiler/mips/macros.lisp,v 1.38 1990/08/12 00:45:51 wlott Exp $
;;; $Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/compiler/mips/macros.lisp,v 1.39 1990/08/23 18:51:37 wlott Exp $
;;;
;;; This file contains various useful macros for generating MIPS code.
;;;
......@@ -147,6 +147,21 @@
((control-stack)
(storew reg fp-tn offset))))))
;;; MAYBE-LOAD-STACK-TN -- Interface
;;;
(defmacro maybe-load-stack-tn (reg reg-or-stack)
"Move the TN Reg-Or-Stack into Reg if it isn't already there."
(once-only ((n-reg reg)
(n-stack reg-or-stack))
`(sc-case ,n-reg
((any-reg descriptor-reg)
(sc-case ,n-stack
((any-reg descriptor-reg)
(move ,n-reg ,n-stack))
((control-stack)
(loadw ,n-reg fp-tn (tn-offset ,n-stack))))))))
;;;; Storage allocation:
......
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