]> birchwood-abbey.net Git - mit-scheme.git/commitdiff
aarch64: Fix logical-immediate-unsigned when period=64 and phase=0.
authorTaylor R Campbell <campbell+mit-scheme@mumble.net>
Fri, 30 Oct 2020 03:25:53 +0000 (03:25 +0000)
committerTaylor R Campbell <campbell+mit-scheme@mumble.net>
Thu, 31 Dec 2020 18:32:22 +0000 (18:32 +0000)
(cherry picked from commit 927ccba3568f3aa6fe3ce920cc1887bd929a9030)

src/compiler/machines/aarch64/insutl.scm

index 7169030e4405865809429814c9c095c347f706a5..8616b1a7afc9da01424a254bc3a2fb1f0c1a075e 100644 (file)
@@ -324,7 +324,7 @@ USA.
     ;; Given the period, phase, and count of bits, compute and encode
     ;; the n, immr, and imms representation.
     (assert (< phase period))
-    (let* ((immr (- period phase))
+    (let* ((immr (modulo (- period phase) width))
            (nimms (bitwise-ior (shift-left (- period) 1) (- count 1)))
            (n (bitwise-xor 1 (bitwise-and 1 (shift-right nimms 6))))
            (imms (bitwise-and nimms #x3f)))