[PATCH] D23568: [RISCV 10/10] Add common fixups and relocations

Alex Bradbury via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 23 06:44:51 PDT 2017


asb updated this revision to Diff 112352.
asb marked 3 inline comments as done.
asb added a comment.

Previous versions of this patch were too accepting of invalid inputs, e.g. accepting `addi a0, a0, %hi(1)`. Previously there was logic that would try to evaluate a RISCVMCExpr as a constant in createImm (i.e. as early as possible). This throws away information about any operand modifier that was parsed. Therefore, move to evaluating the constant in in the `isFoo()` predicate arguments, which also checks whether any operand modifiers were allowed. rv32i-invalid.s has been expanded to systematically test these issues. As suggested by Dylan, I've also added a helper function to factor out the commonality between the isSImmNNLsb0 functions.


https://reviews.llvm.org/D23568

Files:
  lib/Target/RISCV/AsmParser/RISCVAsmParser.cpp
  lib/Target/RISCV/MCTargetDesc/CMakeLists.txt
  lib/Target/RISCV/MCTargetDesc/RISCVAsmBackend.cpp
  lib/Target/RISCV/MCTargetDesc/RISCVBaseInfo.h
  lib/Target/RISCV/MCTargetDesc/RISCVELFObjectWriter.cpp
  lib/Target/RISCV/MCTargetDesc/RISCVFixupKinds.h
  lib/Target/RISCV/MCTargetDesc/RISCVMCCodeEmitter.cpp
  lib/Target/RISCV/MCTargetDesc/RISCVMCExpr.cpp
  lib/Target/RISCV/MCTargetDesc/RISCVMCExpr.h
  lib/Target/RISCV/RISCVInstrFormats.td
  lib/Target/RISCV/RISCVInstrInfo.td
  test/MC/RISCV/fixups-diagnostics.s
  test/MC/RISCV/fixups.s
  test/MC/RISCV/hilo-constaddr.s
  test/MC/RISCV/relocations.s
  test/MC/RISCV/rv32i-invalid.s
  test/MC/RISCV/rv32i-valid.s

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D23568.112352.patch
Type: text/x-patch
Size: 50203 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170823/9740ebd7/attachment.bin>


More information about the llvm-commits mailing list