#| -*-Scheme-*-
-$Id: lapgn2.scm,v 1.23 2003/02/14 18:28:00 cph Exp $
+$Id: lapgn2.scm,v 1.24 2004/07/01 01:19:57 cph Exp $
-Copyright (c) 1987-1999 Massachusetts Institute of Technology
+Copyright 1987,1988,1989,1990,1991,1993 Massachusetts Institute of Technology
+Copyright 1994,2004 Massachusetts Institute of Technology
This file is part of MIT/GNU Scheme.
(and (register-type? register type) register)
(maybe-need-register!
(pseudo-register-alias *register-map* type register))))
+
+(define (guarantee-registers-compatible r1 r2)
+ (if (not (registers-compatible? r1 r2))
+ (error "Incompatible register types:" source target)))
+
+(define (registers-compatible? r1 r2)
+ (register-types-compatible? (register-type r1) (register-type r2)))
+
+(define (register-types-compatible? type1 type2)
+ (boolean=? (eq? type1 'FLOAT) (eq? type2 'FLOAT)))
\f
(define (load-alias-register! register type)
;; Returns an alias for `register', of the given `type'. If no such
#| -*-Scheme-*-
-$Id: lapgen.scm,v 1.16 2003/02/14 18:28:02 cph Exp $
+$Id: lapgen.scm,v 1.17 2004/07/01 01:19:57 cph Exp $
-Copyright (c) 1992-1999, 2001, 2002 Massachusetts Institute of Technology
+Copyright 1993,1998,2001,2002,2004 Massachusetts Institute of Technology
This file is part of MIT/GNU Scheme.
(define-integrable (word-register? reg)
(eq? (register-type reg) 'WORD))
-(define (register-types-compatible? type1 type2)
- (boolean=? (eq? type1 'FLOAT) (eq? type2 'FLOAT)))
-
(define (register-reference num)
(comp-internal-error "Should not be using register allocator"
'REGISTER-REFERENCE num))
#| -*-Scheme-*-
-$Id: lapgen.scm,v 1.11 2003/02/14 18:28:02 cph Exp $
+$Id: lapgen.scm,v 1.12 2004/07/01 01:19:57 cph Exp $
-Copyright (c) 1992-1999, 2001, 2002 Massachusetts Institute of Technology
+Copyright 1992,1993,1998,2001,2002,2004 Massachusetts Institute of Technology
This file is part of MIT/GNU Scheme.
;;;; Register-Allocator Interface
(define (register->register-transfer source target)
- (if (not (register-types-compatible? source target))
- (error "Moving between incompatible register types" source target))
+ (guarantee-registers-compatible source target)
(case (register-type source)
((GENERAL) (copy source target))
((FLOAT) (fp-copy source target))
(define-integrable (word-register? register)
(eq? (register-type register) 'GENERAL))
-
-(define (register-types-compatible? type1 type2)
- (boolean=? (eq? type1 'FLOAT) (eq? type2 'FLOAT)))
(define (register-type register)
(cond ((machine-register? register)
#| -*-Scheme-*-
-$Id: lapgen.scm,v 4.55 2003/02/14 18:28:02 cph Exp $
+$Id: lapgen.scm,v 4.56 2004/07/01 01:19:58 cph Exp $
-Copyright (c) 1988-1999, 2001, 2002 Massachusetts Institute of Technology
+Copyright 1986,1987,1988,1989,1990,1991 Massachusetts Institute of Technology
+Copyright 1992,1993,1998,2001,2002,2004 Massachusetts Institute of Technology
This file is part of MIT/GNU Scheme.
a0 a1 a2 a3
fp0 fp1 fp2 fp3 fp4 fp5 fp6 fp7))
-(define (register-types-compatible? type1 type2)
- (boolean=? (eq? type1 'FLOAT) (eq? type2 'FLOAT)))
-
(define (register-type register)
(cond ((machine-register? register)
(vector-ref
(value-class=word? (pseudo-register-value-class register))))
(define (machine->machine-register source target)
- (if (not (register-types-compatible? source target))
- (error "Moving between incompatible register types" source target))
+ (guarantee-registers-compatible source target)
(if (float-register? source)
(LAP (FMOVE ,(register-reference source)
,(register-reference target)))
#| -*-Scheme-*-
-$Id: lapgen.scm,v 1.34 2003/02/14 18:28:03 cph Exp $
+$Id: lapgen.scm,v 1.35 2004/07/01 01:19:58 cph Exp $
Copyright 1992,1993,1998,2001,2002,2003 Massachusetts Institute of Technology
+Copyright 2004 Massachusetts Institute of Technology
This file is part of MIT/GNU Scheme.
(else
(error "unable to determine register type" register))))
-(define (register-types-compatible? type1 type2)
- (boolean=? (eq? type1 'FLOAT) (eq? type2 'FLOAT)))
-
(define register-reference
(let ((references (make-vector number-of-machine-registers)))
(let loop ((i 0))
;;;; Utilities for the register allocator interface
(define-integrable (machine->machine-register source target)
- (if (not (register-types-compatible? source target))
- (error "Moving between incompatible register types" source target))
+ (guarantee-registers-compatible source target)
(if (not (float-register? source))
(LAP (MOV W ,(register-reference target) ,(register-reference source)))
(let ((ssti (floreg->sti source))
#| -*-Scheme-*-
-$Id: lapgen.scm,v 1.20 2003/02/14 18:28:03 cph Exp $
+$Id: lapgen.scm,v 1.21 2004/07/01 01:19:58 cph Exp $
-Copyright (c) 1988-1999, 2001, 2002 Massachusetts Institute of Technology
+Copyright 1990,1991,1992,1993,1997,1998 Massachusetts Institute of Technology
+Copyright 2001,2002,2004 Massachusetts Institute of Technology
This file is part of MIT/GNU Scheme.
;;;; Register-Allocator Interface
(define (register->register-transfer source target)
- (if (not (register-types-compatible? source target))
- (error "Moving between incompatible register types" source target))
+ (guarantee-registers-compatible source target)
(case (register-type source)
((GENERAL) (copy source target))
((FLOAT) (fp-copy source target))
(define-integrable (word-register? register)
(eq? (register-type register) 'GENERAL))
-
-(define (register-types-compatible? type1 type2)
- (boolean=? (eq? type1 'FLOAT) (eq? type2 'FLOAT)))
(define (register-type register)
(cond ((machine-register? register)
#| -*-Scheme-*-
-$Id: lapgen.scm,v 1.7 2003/02/14 18:28:06 cph Exp $
+$Id: lapgen.scm,v 1.8 2004/07/01 01:19:59 cph Exp $
-Copyright (c) 1988-1999, 2001, 2002 Massachusetts Institute of Technology
+Copyright 1993,1998,2001,2002,2004 Massachusetts Institute of Technology
This file is part of MIT/GNU Scheme.
;;;; Register-Allocator Interface
(define (register->register-transfer source target)
- (if (not (register-types-compatible? source target))
- (error "Moving between incompatible register types" source target))
+ (guarantee-registers-compatible source target)
(case (register-type source)
((GENERAL) (copy source target))
((FLOAT) (fp-copy source target))
(define-integrable (word-register? register)
(eq? (register-type register) 'GENERAL))
-
-(define (register-types-compatible? type1 type2)
- (boolean=? (eq? type1 'FLOAT) (eq? type2 'FLOAT)))
(define (register-type register)
(cond ((machine-register? register)
#| -*-Scheme-*-
-$Id: lapgen.scm,v 4.52 2003/02/14 18:28:07 cph Exp $
+$Id: lapgen.scm,v 4.53 2004/07/01 01:19:59 cph Exp $
-Copyright (c) 1988-1999, 2001, 2002 Massachusetts Institute of Technology
+Copyright 1986,1987,1990,1991,1992,1993 Massachusetts Institute of Technology
+Copyright 1994,1998,2001,2002,2004 Massachusetts Institute of Technology
This file is part of MIT/GNU Scheme.
;;;; Register-Allocator Interface
(define (register->register-transfer source target)
- (if (not (register-types-compatible? source target))
- (error "Moving between incompatible register types" source target))
+ (guarantee-registers-compatible source target)
(case (register-type source)
((GENERAL) (copy source target))
((FLOAT) (fp-copy source target))
(define-integrable (word-register? register)
(eq? (register-type register) 'GENERAL))
-
-(define (register-types-compatible? type1 type2)
- (boolean=? (eq? type1 'FLOAT) (eq? type2 'FLOAT)))
(define (register-type register)
(cond ((machine-register? register)
#| -*-Scheme-*-
-$Id: lapgen.scm,v 4.20 2003/02/14 18:28:07 cph Exp $
+$Id: lapgen.scm,v 4.21 2004/07/01 01:19:59 cph Exp $
-Copyright (c) 1987-1999, 2001, 2002 Massachusetts Institute of Technology
+Copyright 1988,1989,1991,1992,1998,2002 Massachusetts Institute of Technology
+Copyright 2004 Massachusetts Institute of Technology
This file is part of MIT/GNU Scheme.
;; r14 is sp and r15 is pc.
(list r0 r1 r2 r3 r4 r5 r6 r7 r8))
-(define (register-types-compatible? type1 type2)
- (boolean=? (eq? type1 'FLOAT) (eq? type2 'FLOAT)))
-
(define (register-type register)
;; This will have to be changed when floating point support is added.
(if (or (machine-register? register)