From c5a445397e78b5cb294f8ca781785dd0087cd48c Mon Sep 17 00:00:00 2001 From: Taylor R Campbell Date: Wed, 23 Jan 2019 03:02:16 +0000 Subject: [PATCH] Fix loading complemented immediates. --- src/compiler/machines/aarch64/lapgen.scm | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/compiler/machines/aarch64/lapgen.scm b/src/compiler/machines/aarch64/lapgen.scm index c5bebdaf9..a7da67a02 100644 --- a/src/compiler/machines/aarch64/lapgen.scm +++ b/src/compiler/machines/aarch64/lapgen.scm @@ -333,9 +333,11 @@ USA. => (lambda (shift) (LAP (MOVZ X ,target (LSL (&U ,(shift-right imm shift)) ,shift))))) - ((find-shift (bitwise-not imm)) + ((find-shift (bitwise-andc1 imm #xffffffffffffffff)) => (lambda (shift) - (LAP (MOVN X ,target (LSL (&U ,(bitwise-not imm)) ,shift))))) + (let ((imm (bitwise-andc1 imm #xffffffffffffffff))) + (LAP (MOVN X ,target + (LSL (&U ,(shift-right imm shift)) ,shift)))))) ((logical-immediate? imm) (LAP (ORR X ,target Z (&U ,imm)))) ;; XXX try splitting in halves, quarters @@ -346,8 +348,6 @@ USA. (hi-shift (find-shift hi))) (and lo-shift hi-shift (cons lo-shift hi-shift)))) => (lambda)) - ((fits-in-unsigned-16? (bitwise-not imm)) - (LAP (MOVN X ,target (&U ,(bitwise-not imm))))) (else ;; XXX give up (LAP (MOVZ X ,target (&U ,(chunk16 0))) -- 2.25.1