From: Taylor R Campbell <campbell@mumble.net>
Date: Tue, 15 Jan 2019 03:09:58 +0000 (+0000)
Subject: Block offset units are instructions, not bytes, so we get two more bits.
X-Git-Tag: mit-scheme-pucked-10.1.20~11^2~66^2~91
X-Git-Url: https://birchwood-abbey.net/git?a=commitdiff_plain;h=7872180a6ef5f531584f49d808ce8da79081ad4f;p=mit-scheme.git

Block offset units are instructions, not bytes, so we get two more bits.
---

diff --git a/src/compiler/machines/aarch64/assmd.scm b/src/compiler/machines/aarch64/assmd.scm
index aedb36042..7aa3ea8f2 100644
--- a/src/compiler/machines/aarch64/assmd.scm
+++ b/src/compiler/machines/aarch64/assmd.scm
@@ -41,12 +41,12 @@ USA.
   16)
 
 (define-integrable maximum-block-offset
-  ;; PC always aligned on 32-bit boundary
+  ;; PC always aligned on 32-bit boundary.  Use the extra bit.
   (- (expt 2 (1+ block-offset-width)) 4))
 
 (define-integrable (block-offset->bit-string offset start?)
   (unsigned-integer->bit-string block-offset-width
-                                (+ (* 2 offset)
+                                (+ (shift-left (quotient offset 4) 1)
                                    (if start? 0 1))))
 
 ;;; Machine dependent instruction order