(Note that register "Y" is essentially just ASR0).
Also added some test cases for divide and multiply, which had none before.
Paths
| Differential D8670
Add support for the Sparc implementation-defined "ASR" registers. ClosedPublic Authored by jyknight on Mar 27 2015, 1:35 PM.
Details Summary (Note that register "Y" is essentially just ASR0). Also added some test cases for divide and multiply, which had none before.
Diff Detail Event TimelineComment Actions
I'd love to, but I couldn't find any tests that test anything like this to copy. (I might be just blind). Can you point me to something I can riff off of? Comment Actions This looks like something that comes from inline assembly, perhaps write some inline assembly in clang, emit llvm IR, copy it to test/CodeGen/Sparc, and make sure we can assemble it? Otherwise if you just want plain assembly you can look at the tests in test/MC/. -eric Comment Actions Thanks for the hint, added a test now. Somehow I completely missed the "test" directory. I'd seen "unittest", and looked in there (where of course there's not anything related to this), and never went back up to find another dir. :) Comment Actions Can you also test 'rd %asr15, %g0' instruction? This instruction aliases the 'stbar' instruction. Comment Actions Added test as requested. Also added some Disassembler tests, including ensuring that stbar is still preferred for disassembly instead of the equivalent rd. Comment Actions
Thanks! This is my first submission, so I do not have a commit account yet. I understand the thing to do now is ask if you could please commit it for me? Comment Actions Actually don't commit yet...this seems to cause a new segfault when compiling some programs, and I need to track down why that'd be... Comment Actions
I had not correctly updated SparcISelDAGToDAG.cpp, so div simply did not work at all. It was this patch of my patch: --- a/lib/Target/Sparc/SparcISelDAGToDAG.cpp +++ b/lib/Target/Sparc/SparcISelDAGToDAG.cpp @@ -166,10 +166,10 @@ SDNode *SparcDAGToDAGISel::Select(SDNode *N) { } else { TopPart = CurDAG->getRegister(SP::G0, MVT::i32); } - TopPart = SDValue(CurDAG->getMachineNode(SP::WRASRrr, dl, MVT::Glue, - CurDAG->getRegister(SP::Y, MVT::i32), + TopPart = SDValue(CurDAG->getMachineNode(SP::WRASRrr, dl, MVT::i32, TopPart, CurDAG->getRegister(SP::G0, MVT::i32)), 0); + TopPart = CurDAG->getCopyToReg(TopPart, dl, SP::Y, TopPart, SDValue()).getValue(1); Comment Actions Since it's just a bug fix on top of the existing code that already was LGTM'd this is fine. Sorry for the delay. Thanks! -eric This revision is now accepted and ready to land.May 13 2015, 2:57 PM Closed by commit rL237580: Add support for the Sparc implementation-defined "ASR" registers. (authored by jyknight). · Explain WhyMay 18 2015, 9:33 AM This revision was automatically updated to reflect the committed changes.
Revision Contents
Diff 23395 lib/Target/Sparc/AsmParser/SparcAsmParser.cpp
lib/Target/Sparc/Disassembler/SparcDisassembler.cpp
lib/Target/Sparc/SparcISelDAGToDAG.cpp
lib/Target/Sparc/SparcInstrInfo.td
lib/Target/Sparc/SparcRegisterInfo.td
test/CodeGen/SPARC/basictest.ll
test/MC/Disassembler/Sparc/sparc.txt
test/MC/Sparc/sparc-special-registers.s
|