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

Jian Cai via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue May 19 12:37:07 PDT 2020


jcai19 added a comment.

Thank you for the comments! Please find my replies inlined.

In D80028#2044356 <https://reviews.llvm.org/D80028#2044356>, @ostannard wrote:

> - Testing that the expression is the subtraction of two SymbolRefs seems needlessly restrictive, could we accept any expression, and reject it in the AsmBackend if it can't be fully resolved or converted to a relocation?


Sounds good. I have relaxed the restriction, but the patch still can't seem to deal with cases like mov reg, label. Will take a look at that.

> - Does this check that the value fits into a 16 bit immediate? The GNU assembler also seems to accept expressions which fit into a MOVZ/MOVN with a shift, though I can't see that being very useful for expressions involving symbol addresses.

I mistakenly thought the bound has been checked. Double checking it again though it seemed the check was missing. I have added it.

> - This needs tests.

Added. Will add more cases once the patch supports more label-based expressions as an immediate operand.


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