HomePhabricator

[Sparc] Fixes for the internal assembler

Authored by LemonBoy on Jan 4 2021, 12:41 AM.

Description

[Sparc] Fixes for the internal assembler

  • 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

Reviewed By: dcederman

Differential Revision: https://reviews.llvm.org/D78193

Details

Committed
dcedermanJan 4 2021, 4:25 AM
Reviewer
dcederman
Differential Revision
D78193: [Sparc] Fixes for the internal assembler
Parents
rG975b64b29375: [docs] Release notes for IsDecl in DIModule.
Branches
Unknown
Tags
Unknown