Block offset units are instructions, not bytes, so we get two more bits.
authorTaylor R Campbell <campbell@mumble.net>
Tue, 15 Jan 2019 03:09:58 +0000 (03:09 +0000)
committerTaylor R Campbell <campbell@mumble.net>
Wed, 21 Aug 2019 21:34:01 +0000 (21:34 +0000)
src/compiler/machines/aarch64/assmd.scm

index aedb360427e711141413cdabd6f69fe90d5731e4..7aa3ea8f25471dd97ba7f4e7be61d9e9c7e5b73c 100644 (file)
@@ -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