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
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.
See this mail for context: http://lists.llvm.org/pipermail/llvm-dev/2016-September/104579.html
lib/Target/Sparc/AsmParser/SparcAsmParser.cpp | ||
---|---|---|
299 | "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. | |
1401–1402 | Mark intended fall-through after code with LLVM_FALLTHROUGH | |
1420–1421 | 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? | |
203 | You used a different name here (fixup_sparc_pc32 vs fixup_sparc_disp32). | |
lib/Target/Sparc/MCTargetDesc/SparcMCCodeEmitter.cpp | ||
201–202 | Why the change here? | |
251 | 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? |
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.
"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.