[PATCH] D78193: [Sparc] Fixes for the internal assembler

l via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 15 04:20:37 PDT 2020


LemonBoy created this revision.
LemonBoy added reviewers: venkatra, jyknight, joerg, dcederman.
Herald added subscribers: llvm-commits, jrtc27, fedor.sergeev, hiraditya.
Herald added a project: LLVM.

- Prevent the generation of invalid shift instructions by constraining the immediate field. I've limited the shift field to constant values only, adding the `R_SPARC_5`/`R_SPARC_6` relocations is trivial if needed (but I can't really think of a use case for those).
- Fix the generation of PC-relative `call`
- Fix the transformation of `jmp sym` into `jmpl`
- Emit fixups for simm13 operands

I moved the choice of the correct relocation into the code emitter as I've seen the other backends do, it can be definitely cleaner but the aim was to reduce the scope of the patch as much as possible.

Fixes the problems raised by joerg in L254199


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D78193

Files:
  llvm/lib/Target/Sparc/AsmParser/SparcAsmParser.cpp
  llvm/lib/Target/Sparc/MCTargetDesc/SparcInstPrinter.cpp
  llvm/lib/Target/Sparc/MCTargetDesc/SparcMCCodeEmitter.cpp
  llvm/lib/Target/Sparc/MCTargetDesc/SparcMCExpr.h
  llvm/lib/Target/Sparc/SparcInstr64Bit.td
  llvm/lib/Target/Sparc/SparcInstrFormats.td
  llvm/lib/Target/Sparc/SparcInstrInfo.td
  llvm/test/MC/Sparc/sparc-asm-errors.s
  llvm/test/MC/Sparc/sparc-ctrl-instructions.s
  llvm/test/MC/Sparc/sparc-relocations.s

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D78193.257666.patch
Type: text/x-patch
Size: 19661 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200415/01224a97/attachment.bin>


More information about the llvm-commits mailing list