From 83eb549e3a412a224bd1605c572ee8c8d2f3247a Mon Sep 17 00:00:00 2001
From: wlott <wlott>
Date: Sat, 3 Feb 1990 18:14:59 +0000
Subject: [PATCH] Added FIXNUM function that takes a number and shifts it
 twice, after verifying that it will fit in a fixnum.  Useful with loadi
 macro.

---
 compiler/mips/parms.lisp | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

diff --git a/compiler/mips/parms.lisp b/compiler/mips/parms.lisp
index 54242958b..5cd968750 100644
--- a/compiler/mips/parms.lisp
+++ b/compiler/mips/parms.lisp
@@ -7,6 +7,8 @@
 ;;; Scott Fahlman (FAHLMAN@CMUC). 
 ;;; **********************************************************************
 ;;;
+;;; $Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/compiler/mips/parms.lisp,v 1.2 1990/02/03 18:14:59 wlott Exp $
+;;;
 ;;;    This file contains some parameterizations of various VM attributes for
 ;;; the MIPS.  This file is separate from other stuff so that it can be compiled
 ;;; and loaded earlier.
@@ -36,7 +38,7 @@
 	  complex-bit-vector-type complex-vector-type complex-array-type
 	  code-header-type function-header-type return-pc-header-type
 	  closure-header-type symbol-header-type character-type SAP-type
-	  unbound-marker-type *assembly-unit-length*
+	  unbound-marker-type fixnum *assembly-unit-length*
 	  target-fasl-code-format vm-version))
 	  
 
@@ -181,6 +183,15 @@
   SAP
   unbound-marker)
 
+;;; Handy routine for making fixnums.
+
+(defun fixnum (num)
+  "Make a fixnum out of NUM.  (i.e. shift by two bits if it will fit.)"
+  (if (<= #x-20000000 num #x1fffffff)
+      (ash num 2)
+      (error "~D is too big for a fixnum." num)))
+
+
 
 ;;;; Assembler parameters:
 
-- 
GitLab