From: Taylor R Campbell Date: Fri, 25 Jan 2019 04:21:09 +0000 (+0000) Subject: Add note on ughbletchness of ADRP. X-Git-Tag: mit-scheme-pucked-10.1.20~11^2~66^2~19 X-Git-Url: https://birchwood-abbey.net/git?a=commitdiff_plain;h=85202ca21ec7fc8bc184fdc09305b83af1aba0e9;p=mit-scheme.git Add note on ughbletchness of ADRP. --- diff --git a/src/compiler/machines/aarch64/instr1.scm b/src/compiler/machines/aarch64/instr1.scm index 7a2cda8f2..f55a1ad5e 100644 --- a/src/compiler/machines/aarch64/instr1.scm +++ b/src/compiler/machines/aarch64/instr1.scm @@ -1297,6 +1297,14 @@ USA. ;; Macro used for assembling variable-width instructions which can't ;; just defer to the variable-width ADR because we prohibit variable ;; width within variable width. +;; +;; XXX OOPS! This doesn't actually work, because ADRP actually +;; computes PC - (PC mod 2^12) + 2^12*offset, not PC + 2^12*offset. +;; Either we need to know where we are in a page (which can change from +;; GC to GC because compiled blocks are only float-aligned, not +;; page-aligned), or we need to generate extra code to find and add PC +;; mod 2^12, which looks like it'll require another temporary register. +;; Ugh! (define-instruction ADRP-ADD ((X (? Rd) (@PCO (? offset signed-33)))