[PATCH] D80028: [AArch64] Support expression results as immediate values in mov

Eli Friedman via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu May 28 17:38:26 PDT 2020


efriedma added inline comments.


================
Comment at: llvm/lib/Target/AArch64/AsmParser/AArch64AsmParser.cpp:979
+    }
+    return !Shift && E;
   }
----------------
E can't be null here?

Maybe worth briefly explaining here what this allows.


================
Comment at: llvm/lib/Target/AArch64/MCTargetDesc/AArch64AsmBackend.cpp:246
         AArch64MCExpr::getSymbolLoc(RefKind) != AArch64MCExpr::VK_SABS) {
-      // VK_GOTTPREL, VK_TPREL, VK_DTPREL are movw fixups, but they can't
-      // ever be resolved in the assembler.
-      Ctx.reportError(Fixup.getLoc(),
-                      "relocation for a thread-local variable points to an "
-                      "absolute symbol");
+      // The fixup is an expression
+      if (!RefKind) {
----------------
Put the comment inside the if?


================
Comment at: llvm/lib/Target/AArch64/MCTargetDesc/AArch64AsmBackend.cpp:249
+        if (SignedValue > 0xFFFF || SignedValue < -0xFFFF)
+          Ctx.reportError(Fixup.getLoc(), "fixup value out of range");
+
----------------
Can you make the error message specify the range we're looking for?


================
Comment at: llvm/lib/Target/AArch64/MCTargetDesc/AArch64AsmBackend.cpp:455
+  if (AArch64MCExpr::getSymbolLoc(RefKind) == AArch64MCExpr::VK_SABS ||
+      !RefKind && Fixup.getTargetKind() == AArch64::fixup_aarch64_movw) {
     // If the immediate is negative, generate MOVN else MOVZ.
----------------
Please put parentheses around the "&&".


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D80028/new/

https://reviews.llvm.org/D80028





More information about the llvm-commits mailing list