Skip to content
Snippets Groups Projects
Commit 0ae7bb29 authored by ch's avatar ch
Browse files

Add li and b macros. These are two of the ``synthesized'' instructions

described in the R2000 book.
parent 174719d4
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.3 1990/02/03 20:54:21 wlott Exp $
;;; $Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/compiler/mips/macros.lisp,v 1.4 1990/02/06 02:49:14 ch Exp $
;;;
;;; This file contains various useful macros for generating MIPS code.
;;;
......@@ -16,13 +16,10 @@
(in-package "C")
(defmacro nop ()
"Emit a nop."
'(inst or zero-tn zero-tn zero-tn))
(defmacro move (dst src)
"Move SRC into DST (unless they are already the same)."
(once-only ((n-dst dst)
......@@ -30,6 +27,17 @@
`(unless (location= ,n-dst ,n-src)
(inst or ,n-dst ,n-src zero-tn))))
(defmacro li (dst immed)
"Load Immediate"
(cond ((minusp immed)
`(inst addi ,dst zero-tn ,immed))
(t
`(inst addiu ,dst zero-tn ,immed))))
(defmacro b (label)
"Unconditional branch"
`(inst beq zero-tn zero-tn ,label))
(defmacro def-mem-op (op inst shift load)
`(defmacro ,op (object base &optional (offset 0) (lowtag 0))
......
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