llvm-6502/utils
Chris Lattner 38c0751a12 This is the final big of factoring. This shares cases in suboperand
differences, which means that identical instructions (after stripping off
the first literal string) do not run any different code at all.  On the X86,
this turns this code:

    switch (MI->getOpcode()) {
    case X86::ADC32mi: printOperand(MI, 4, MVT::i32); break;
    case X86::ADC32mi8: printOperand(MI, 4, MVT::i8); break;
    case X86::ADC32mr: printOperand(MI, 4, MVT::i32); break;
    case X86::ADD32mi: printOperand(MI, 4, MVT::i32); break;
    case X86::ADD32mi8: printOperand(MI, 4, MVT::i8); break;
    case X86::ADD32mr: printOperand(MI, 4, MVT::i32); break;
    case X86::AND32mi: printOperand(MI, 4, MVT::i32); break;
    case X86::AND32mi8: printOperand(MI, 4, MVT::i8); break;
    case X86::AND32mr: printOperand(MI, 4, MVT::i32); break;
    case X86::CMP32mi: printOperand(MI, 4, MVT::i32); break;
    case X86::CMP32mr: printOperand(MI, 4, MVT::i32); break;
    case X86::MOV32mi: printOperand(MI, 4, MVT::i32); break;
    case X86::MOV32mr: printOperand(MI, 4, MVT::i32); break;
    case X86::OR32mi: printOperand(MI, 4, MVT::i32); break;
    case X86::OR32mi8: printOperand(MI, 4, MVT::i8); break;
    case X86::OR32mr: printOperand(MI, 4, MVT::i32); break;
    case X86::ROL32mi: printOperand(MI, 4, MVT::i8); break;
    case X86::ROR32mi: printOperand(MI, 4, MVT::i8); break;
    case X86::SAR32mi: printOperand(MI, 4, MVT::i8); break;
    case X86::SBB32mi: printOperand(MI, 4, MVT::i32); break;
    case X86::SBB32mi8: printOperand(MI, 4, MVT::i8); break;
    case X86::SBB32mr: printOperand(MI, 4, MVT::i32); break;
    case X86::SHL32mi: printOperand(MI, 4, MVT::i8); break;
    case X86::SHLD32mrCL: printOperand(MI, 4, MVT::i32); break;
    case X86::SHR32mi: printOperand(MI, 4, MVT::i8); break;
    case X86::SHRD32mrCL: printOperand(MI, 4, MVT::i32); break;
    case X86::SUB32mi: printOperand(MI, 4, MVT::i32); break;
    case X86::SUB32mi8: printOperand(MI, 4, MVT::i8); break;
    case X86::SUB32mr: printOperand(MI, 4, MVT::i32); break;
    case X86::TEST32mi: printOperand(MI, 4, MVT::i32); break;
    case X86::TEST32mr: printOperand(MI, 4, MVT::i32); break;
    case X86::TEST8mi: printOperand(MI, 4, MVT::i8); break;
    case X86::XCHG32mr: printOperand(MI, 4, MVT::i32); break;
    case X86::XOR32mi: printOperand(MI, 4, MVT::i32); break;
    case X86::XOR32mi8: printOperand(MI, 4, MVT::i8); break;
    case X86::XOR32mr: printOperand(MI, 4, MVT::i32); break;
    }

into this:

    switch (MI->getOpcode()) {
    case X86::ADC32mi:
    case X86::ADC32mr:
    case X86::ADD32mi:
    case X86::ADD32mr:
    case X86::AND32mi:
    case X86::AND32mr:
    case X86::CMP32mi:
    case X86::CMP32mr:
    case X86::MOV32mi:
    case X86::MOV32mr:
    case X86::OR32mi:
    case X86::OR32mr:
    case X86::SBB32mi:
    case X86::SBB32mr:
    case X86::SHLD32mrCL:
    case X86::SHRD32mrCL:
    case X86::SUB32mi:
    case X86::SUB32mr:
    case X86::TEST32mi:
    case X86::TEST32mr:
    case X86::XCHG32mr:
    case X86::XOR32mi:
    case X86::XOR32mr: printOperand(MI, 4, MVT::i32); break;
    case X86::ADC32mi8:
    case X86::ADD32mi8:
    case X86::AND32mi8:
    case X86::OR32mi8:
    case X86::ROL32mi:
    case X86::ROR32mi:
    case X86::SAR32mi:
    case X86::SBB32mi8:
    case X86::SHL32mi:
    case X86::SHR32mi:
    case X86::SUB32mi8:
    case X86::TEST8mi:
    case X86::XOR32mi8: printOperand(MI, 4, MVT::i8); break;
    }

After this, the generated asmwriters look pretty much as though they were
generated by hand.  This shrinks the X86 asmwriter.inc files from 55101->39669
and 55429->39551 bytes each, and PPC from 16766->12859 bytes.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19760 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-22 20:31:17 +00:00
..
Burg Portability fix, thanks to Markus F.X.J. Oberhumer. 2004-12-16 04:56:34 +00:00
emacs Add support for undef and unreachable 2004-10-16 18:24:35 +00:00
fpcmp For PR351: 2004-12-13 17:41:13 +00:00
TableGen This is the final big of factoring. This shares cases in suboperand 2005-01-22 20:31:17 +00:00
vim Test commit 2004-12-09 05:46:48 +00:00
check-each-file Added support for C++ compilation. 2004-02-26 23:02:25 +00:00
codegen-diff Add debug variable. 2003-10-16 23:46:01 +00:00
countloc.sh Documentation upgrade. 2004-09-20 08:09:36 +00:00
cvsupdate Fix patterns to match only one-char words. 2004-10-30 23:11:26 +00:00
GenLibDeps.pl 1. Make sure that "dot" can be found in the path 2005-01-05 17:29:29 +00:00
getsrcs.sh Documentation upgrade. 2004-09-20 08:09:36 +00:00
llvm-native-gcc Added EH support. 2004-03-02 15:54:25 +00:00
llvm-native-gxx C++ version of llvm-native-gcc. 2004-02-26 23:01:21 +00:00
llvmdo Remove unused variable. 2004-10-08 18:01:31 +00:00
llvmgrep Make these scripts work on SunOS too. 2004-10-07 16:03:21 +00:00
Makefile New Makefile Features: 2004-10-25 08:27:37 +00:00
makellvm Really use a search path as described in the log message for the last 2003-09-15 11:18:36 +00:00
NightlyTest.gnuplot Change formats, as suggested by Duraid 2004-11-23 06:51:14 +00:00
NightlyTest.pl Update the documentation about -enable-llcbeta vs. -enable-linscan 2005-01-13 18:02:40 +00:00
NightlyTestTemplate.html Use and print out BuildStatus, we don't always have build errors. 2005-01-12 03:31:38 +00:00
profile.pl Fix the path from ../lib/Debug to ../Debug/lib per changes to Makefiles. 2005-01-14 16:32:39 +00:00
RegressionFinder.pl Squash /usr/dcs path; use a 'require <version>' instead. 2004-03-03 17:38:51 +00:00