Page MenuHomePhabricator

[Sparc] Fixes for the internal assembler
Needs ReviewPublic

Authored by LemonBoy on Apr 15 2020, 4:15 AM.

Details

Summary
  • 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

Diff Detail

Event Timeline

LemonBoy created this revision.Apr 15 2020, 4:15 AM
LemonBoy updated this revision to Diff 257743.Apr 15 2020, 8:57 AM
brad added a comment.Thu, Oct 22, 10:16 PM

Any chance of seeing review on this?

I will try and review it next week.