The patch adds missing registers and instructions to complete all the registers supported by the Sparc v8 manual. These are all co-processor registers, with the exception of the floating-point deferred-trap queue register.
Diff Detail
Event Timeline
I'd like for the change that adds the instructions that use these registers to be merged with this change; this is not actually useful standing by itself.
lib/Target/Sparc/SparcRegisterInfo.td | ||
---|---|---|
214 | You can't just make up Dwarf reg numbers, these have to match with other tools like gdb and gcc. And, there aren't any defined for coproc registers, so just leave the DwarfRegNum out. | |
385 | This should probably be marked isAllocatable = 0. |
Made modifications to code per comments from jyknight.
Added instruction implementations and tests verifying the new instructions are encoded correctly. Note: These instructions are expected to be used exclusively in inline assembler and no automatic lowering for the instructions is defined.
Overall looks good, just a couple minor tweaks.
There should be some MC/Disassembler tests added as well. (One might hope that the same tests would be shared for assembly and disassembly, but that's not actually the case, unfortunately.)
lib/Target/Sparc/AsmParser/SparcAsmParser.cpp | ||
---|---|---|
153 | "CoPro" seems an unusual shortening of Coprocessor. "Coproc" seems better. | |
test/MC/Sparc/sparc-copro.s | ||
3 | Seems an odd selection of tests: %c4/%i1 %c4/%i7 %c19/%i1 all test the same instruction definition, so I don't really see the point of including all of them. I'd include, instead a reg+reg and a reg+imm for each of these new instructions. | |
58 | Last 3 tests misplaced? %fq doesn't go with coprocessor tests, and %y already had tests. |
Made amendments following feedback: (1) Added disassembler tests. (2) Moved new FP instruction to correct test file (3) Changed "CoPro" to "Coproc" in both code and filenames. (4) Small white-space formatting changes.
"CoPro" seems an unusual shortening of Coprocessor. "Coproc" seems better.