Fix add/sub immediate syntax and criterion.
authorTaylor R Campbell <campbell@mumble.net>
Tue, 15 Jan 2019 17:27:45 +0000 (17:27 +0000)
committerTaylor R Campbell <campbell@mumble.net>
Wed, 21 Aug 2019 21:34:02 +0000 (21:34 +0000)
src/compiler/machines/aarch64/lapgen.scm

index 8c7354dbd8920489eb038ad911cc7074d80e4c9b..c7e1427610e70f8dbf3c0a669be91a5d0f84dcdf 100644 (file)
@@ -382,12 +382,12 @@ USA.
          (add `(&U ,imm)))
         ((and (zero? (bitwise-and imm (bit-mask 12 0)))
               (fits-in-unsigned-12? (shift-right imm 12)))
-         (add `(&U ,imm LSL 12)))
+         (add `(LSL (&U ,imm) 12)))
         ((fits-in-unsigned-12? (- imm))
          (sub `(&U ,(- imm))))
-        ((and (zero? (bitwise-and imm (bit-mask 12 0)))
+        ((and (zero? (bitwise-and (- imm) (bit-mask 12 0)))
               (fits-in-unsigned-12? (shift-right (- imm) 12)))
-         (sub `(&U ,(- imm) LSL 12)))
+         (sub `(LSL (&U ,(- imm)) 12)))
         (else
          (let ((temp (allocate-temporary-register! 'GENERAL)))
            (LAP ,@(load-unsigned-immediate temp imm)