1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-20 03:23:01 +02:00
llvm-mirror/utils/TableGen
Chris Lattner a030a47a51 Implement factoring of instruction pattern strings. In particular, instead of
emitting code like this:

  case PPC::ADD: O  << "add ";  printOperand(MI, 0, MVT::i64); O  << ", ";  prin
tOperand(MI, 1, MVT::i64); O  << ", ";  printOperand(MI, 2, MVT::i64); O  << '\n
'; break;
  case PPC::ADDC: O  << "addc ";  printOperand(MI, 0, MVT::i64); O  << ", ";  pr
intOperand(MI, 1, MVT::i64); O  << ", ";  printOperand(MI, 2, MVT::i64); O  << '
\n'; break;
  case PPC::ADDE: O  << "adde ";  printOperand(MI, 0, MVT::i64); O  << ", ";  pr
intOperand(MI, 1, MVT::i64); O  << ", ";  printOperand(MI, 2, MVT::i64); O  << '
\n'; break;
...

Emit code like this:

  case PPC::ADD:
  case PPC::ADDC:
  case PPC::ADDE:
  ...
    switch (MI->getOpcode()) {
    case PPC::ADD: O << "add "; break;
    case PPC::ADDC: O << "addc "; break;
    case PPC::ADDE: O << "adde "; break;
    ...
    }
    printOperand(MI, 0, MVT::i64);
    O << ", ";
    printOperand(MI, 1, MVT::i64);
    O << ", ";
    printOperand(MI, 2, MVT::i64);
    O << "\n";
    break;

This shrinks the PPC asm writer from 24785->15205 bytes (even though the new
asmwriter has much more whitespace than the old one), and the X86 printers shrink
quite a bit too.  The important implication of this is that GCC no longer hits swap
when building the PPC backend in optimized mode.  Thus this fixes PR448.

-Chris

llvm-svn: 19755
2005-01-22 18:38:13 +00:00
..
AsmWriterEmitter.cpp Implement factoring of instruction pattern strings. In particular, instead of 2005-01-22 18:38:13 +00:00
AsmWriterEmitter.h Initial cut at an asm writer emitter. So far, this only handles emission of 2004-08-01 05:59:33 +00:00
CodeEmitterGen.cpp * Factor out (into new fn) a loop emitting operand shifts into the instruction 2004-10-14 05:53:01 +00:00
CodeEmitterGen.h * Factor out (into new fn) a loop emitting operand shifts into the instruction 2004-10-14 05:53:01 +00:00
CodeGenInstruction.h Expose isConvertibleToThreeAddress and isCommutable bits to the code generator. 2005-01-02 02:29:04 +00:00
CodeGenRegisters.h Support "Methods" in register classes in CodgeGenRegisterClass 2004-08-21 19:21:21 +00:00
CodeGenTarget.cpp Expose isConvertibleToThreeAddress and isCommutable bits to the code generator. 2005-01-02 02:29:04 +00:00
CodeGenTarget.h Convert 'struct' to 'class' in various places to adhere to the coding standards 2004-10-27 16:14:51 +00:00
FileLexer.l Patch to make VS happier, thanks to Morten Ofstad for pointing this out. 2004-10-13 15:25:46 +00:00
FileParser.y Changes For Bug 352 2004-09-01 22:55:40 +00:00
InstrInfoEmitter.cpp Expose isConvertibleToThreeAddress and isCommutable bits to the code generator. 2005-01-02 02:29:04 +00:00
InstrInfoEmitter.h Convert 'struct' to 'class' in various places to adhere to the coding standards 2004-10-27 16:14:51 +00:00
InstrSelectorEmitter.cpp Quiet VC++ warnings 2004-11-05 04:50:59 +00:00
InstrSelectorEmitter.h Convert 'struct' to 'class' in various places to adhere to the coding standards 2004-10-27 16:14:51 +00:00
Makefile Internalize variable names to prevent recursive assignment. Cleanup docs. 2004-10-30 09:19:36 +00:00
Record.cpp Quiet VC++ warnings 2004-11-05 04:50:59 +00:00
Record.h For PR387: 2004-12-06 23:42:37 +00:00
RegisterInfoEmitter.cpp Revamp the Register class, and allow the use of the RegisterGroup class to 2004-09-14 04:17:02 +00:00
RegisterInfoEmitter.h Put all LLVM code into the llvm namespace, as per bug 109. 2003-11-11 22:41:34 +00:00
TableGen.cpp Fix usage of changed function prototype 2004-11-14 22:30:54 +00:00
TableGenBackend.cpp Do not #include files into the llvm namespace 2004-08-17 03:08:28 +00:00
TableGenBackend.h Do not #include files into the llvm namespace 2004-08-17 03:08:28 +00:00