Rules that perform index->fixnum conversions must use arithmetic left
authorChris Hanson <org/chris-hanson/cph>
Wed, 15 Nov 1989 02:40:21 +0000 (02:40 +0000)
committerChris Hanson <org/chris-hanson/cph>
Wed, 15 Nov 1989 02:40:21 +0000 (02:40 +0000)
shift so that proper testing for overflow can occur.  The reason:
these rules also get invoked by generic arithmetic because the code
compressor sees them and combines instruction pairs to use them.

v7/src/compiler/machines/bobcat/rules1.scm

index 89d1e4b4ed0759819b77b2c2e1e638f341ca9495..5e2918707cb6c8bae473451303ffaf894db0a9b6 100644 (file)
@@ -1,6 +1,6 @@
 #| -*-Scheme-*-
 
-$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/compiler/machines/bobcat/rules1.scm,v 4.28 1989/11/02 08:08:36 cph Exp $
+$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/compiler/machines/bobcat/rules1.scm,v 4.29 1989/11/15 02:40:21 cph Exp $
 
 Copyright (c) 1988, 1989 Massachusetts Institute of Technology
 
@@ -600,14 +600,15 @@ MIT in each case. |#
 (define (convert-index->fixnum/register target source)
   (reuse-and-load-machine-target! 'DATA target source
     (lambda (target)
-      (LAP (LS L L (& ,(+ scheme-type-width 2)) ,target)))))
+      (LAP (AS L L (& ,(+ scheme-type-width 2)) ,target)))))
 
 (define (convert-index->fixnum/offset target address offset)
   (let ((source (indirect-reference! address offset)))
     (reuse-and-operate-on-machine-target! 'DATA target
       (lambda (target)
        (LAP (MOV L ,source ,target)
-            (LS L L (& ,(+ scheme-type-width 2)) ,target))))))\f
+            (AS L L (& ,(+ scheme-type-width 2)) ,target))))))
+\f
 ;;;; Flonum Operations
 
 (define-rule statement