This is an archive of the discontinued LLVM Phabricator instance.

[SPARC] Add assembler for the REX instruction set extension
AbandonedPublic

Authored by dcederman on Sep 6 2016, 4:29 AM.

Details

Reviewers
jyknight
venkatra
Summary

This patch adds the assembler part of the REX instruction set extension. A full description of the REX instruction set can be downloaded at http://www.gaisler.com/doc/antn/GRLIB-TN-0001.pdf.

Diff Detail

Event Timeline

dcederman updated this revision to Diff 70378.Sep 6 2016, 4:29 AM
dcederman retitled this revision from to [SPARC] Add assembler for the REX instruction set extension.
dcederman updated this object.
dcederman added a reviewer: jyknight.
dcederman added a subscriber: llvm-commits.
dcederman updated this revision to Diff 79064.Nov 23 2016, 6:30 AM
dcederman updated this object.
dcederman added a reviewer: venkatra.

This update contains some small fixes and has been rebased relative the latest master.

Let me know if the patch is too big. I can divide it into smaller parts if that will simplify the review process.

jyknight added inline comments.May 12 2017, 11:07 AM
lib/Target/Sparc/AsmParser/SparcAsmParser.cpp
278

"fi" doesn't mean anything to me. I see what from the REX spec this is implementing, but it could use a better name, and a comment about what it's for.

1383–1384

Mark intended fall-through after code with LLVM_FALLTHROUGH

1401–1402

Same here.

lib/Target/Sparc/MCTargetDesc/SparcAsmBackend.cpp
26

Why do we need this, vs using FK_Data_4?

27

And isn't this the same as FK_PCRel_4?

206

You used a different name here (fixup_sparc_pc32 vs fixup_sparc_disp32).

lib/Target/Sparc/MCTargetDesc/SparcMCCodeEmitter.cpp
196–199

Why the change here?

248

Should probably have Rex in its name.

lib/Target/Sparc/Sparc.td
41

I think this needs to also be controlled by an AssemblerPredicate.

And we'll want to have many of the standard instructions (e.g. those that aren't format-3) with a predicate that disables them in rex mode too, right?

dcederman updated this revision to Diff 99266.May 17 2017, 4:00 AM

Thank you James for reviewing the patch!

In this updated version I have tried to address your comments and done the following changes:

  • Expanded the fi suffix to say RexFixedRegImm and added a comment describing its use.
  • Simplified the RexFR class as the imm field was always 0.
  • Marked the case entries that are supposed to fall through with LLVM_FALLTHROUGH.
  • Added assembler predicates to prevent REX instructions from being used when not compiling for REX and the other way around for Format 2 and coprocessor instructions.
  • Switched from introducing new relocations to use already existing equivalent relocations (FK_Data_4 and FK_PCRel_4).
  • I extracted the change to getCallTargetOpValue to its own patch as it is a generic bug fix and not related to the REX patch. This has the effect that one of the tests in this patch fails if the other patch is not applied.
dcederman abandoned this revision.Jun 28 2022, 12:43 AM
Herald added a project: Restricted Project. · View Herald TranscriptJun 28 2022, 12:43 AM