1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-21 03:53:04 +02:00
Commit Graph

299 Commits

Author SHA1 Message Date
Chris Lattner
86a339dc34 add support for an associative marker
llvm-svn: 23502
2005-09-28 20:58:06 +00:00
Chris Lattner
0231f57a46 Emit an error if instructions or patterns are defined but can never match.
Currently we check that immediate values live on the RHS of commutative
operators.  Defining ORI like this, for example:

def ORI   : DForm_4<24, (ops GPRC:$dst, GPRC:$src1, u16imm:$src2),
                    "ori $dst, $src1, $src2",
                    [(set GPRC:$dst, (or immZExt16:$src2, GPRC:$src1))]>;

results in:

tblgen: In ORI: Instruction can never match: Immediate values must be on the RHS of commutative operators!
llvm-svn: 23501
2005-09-28 19:27:25 +00:00
Chris Lattner
18ccb532b5 collect commutativity information
llvm-svn: 23499
2005-09-28 18:28:29 +00:00
Chris Lattner
5dae8ab260 Prefer cheaper patterns to more expensive ones. Print the costs to the generated
file

llvm-svn: 23492
2005-09-28 17:57:56 +00:00
Chris Lattner
eeead91a84 Select Constant nodes to TargetConstant nodes
llvm-svn: 23488
2005-09-28 16:58:06 +00:00
Chris Lattner
cdeed56e4e memoize the assert results
llvm-svn: 23457
2005-09-26 22:10:24 +00:00
Chris Lattner
5c061685a2 Emit the switch stmt cases in alphabetical order instead of pointer order,
which is not stable.

llvm-svn: 23456
2005-09-26 21:59:35 +00:00
Chris Lattner
ad79bd3f47 implement a fixme: only select values once, even if used multiple times.
llvm-svn: 23454
2005-09-26 21:53:26 +00:00
Jeff Cohen
a5c4ff5a96 Fix VC++ build errors.
llvm-svn: 23431
2005-09-25 19:04:43 +00:00
Chris Lattner
fc89cbf740 memoize translations
llvm-svn: 23419
2005-09-24 00:50:51 +00:00
Chris Lattner
9e2188cf4e Teach the DAG isel generator to emit code that creates nodes.
Fix a few corner cases parsing things like (i32 imm:$foo)

llvm-svn: 23417
2005-09-24 00:40:24 +00:00
Chris Lattner
7c7fbdc7e1 Emit better code (no more copies for var references), and support DAG patterns
(e.g. things like rotates).

llvm-svn: 23416
2005-09-23 23:16:51 +00:00
Chris Lattner
8c19aa13c8 Fix a fixme by passing around SDOperand's instead of SDNode*'s
llvm-svn: 23415
2005-09-23 21:53:45 +00:00
Chris Lattner
6c5dfefcb3 Emit code that matches the incoming DAG pattern and checks predicates.
This does not check that types match yet, but PPC only has one integer type
;-).

This also doesn't have the code to build the resultant dag.

llvm-svn: 23414
2005-09-23 21:33:23 +00:00
Chris Lattner
9949ef9748 emit information about the order patterns are to be matched.
llvm-svn: 23413
2005-09-23 20:52:47 +00:00
Chris Lattner
d9b4002bac start filling in the switch stmt
llvm-svn: 23412
2005-09-23 19:36:15 +00:00
Chris Lattner
2e3569b604 Fix a minor bug, add comments
llvm-svn: 23370
2005-09-16 00:29:46 +00:00
Chris Lattner
4c1ec1c784 teach the type inference code how to infer types for instructions and node
xforms.  Run type inference on result patterns, so we always have fully typed
results (and to catch errors in .td files).

llvm-svn: 23369
2005-09-15 22:23:50 +00:00
Chris Lattner
07b63eafa1 put instructions into a map instead of a vector for quick lookup
llvm-svn: 23368
2005-09-15 21:57:35 +00:00
Chris Lattner
335614b54a when parsing instructions remember information about the types taken and
returned.

llvm-svn: 23367
2005-09-15 21:51:12 +00:00
Chris Lattner
66c08682d9 Start parsing "Pattern" nodes
llvm-svn: 23365
2005-09-15 21:42:00 +00:00
Chris Lattner
fe7a70834b rename a couple of methods, add structure for pattern parsing
llvm-svn: 23364
2005-09-15 02:38:02 +00:00
Chris Lattner
ab6886a31d Verify that xform functions only occur in logical places
llvm-svn: 23363
2005-09-14 23:05:13 +00:00
Chris Lattner
6f94c802a2 Promote xform fns to be explicit nodes in result patterns, and clean off
predicates since they will have already matched at this point.

llvm-svn: 23362
2005-09-14 23:01:59 +00:00
Chris Lattner
57cae81b5e start building the instruction dest pattern correctly. Change the xform
functions to preserve the Record for the xform instead of making it into a
function name.

llvm-svn: 23361
2005-09-14 22:55:26 +00:00
Chris Lattner
a6a0d51065 catch unnamed inputs
llvm-svn: 23360
2005-09-14 22:06:36 +00:00
Chris Lattner
f749a0ef7c check that there are no unexpected operands
llvm-svn: 23359
2005-09-14 21:59:34 +00:00
Chris Lattner
9c196b02fa force all instruction operands to be named.
llvm-svn: 23358
2005-09-14 21:13:50 +00:00
Chris Lattner
c19f24f3d7 Check that operands have unique names. REJECT instructions with broken operand
lists: only don't parse them if they are entirely missing (sparcv9).

llvm-svn: 23355
2005-09-14 21:05:02 +00:00
Chris Lattner
3cbcb9f5d6 fix a broke range check
llvm-svn: 23354
2005-09-14 21:04:12 +00:00
Chris Lattner
a5ba887c02 Parse significantly more of the instruction pattern, now collecting and
verifying information about the operands.

llvm-svn: 23353
2005-09-14 20:53:42 +00:00
Chris Lattner
901ddab7b1 Verify that set destinations occur first in the instruction operand list.
llvm-svn: 23351
2005-09-14 18:19:25 +00:00
Chris Lattner
76f1dae1af add an accessor
llvm-svn: 23349
2005-09-14 18:02:53 +00:00
Chris Lattner
72cfebc71b remove some code that isn't ready for prime time
llvm-svn: 23346
2005-09-14 06:03:10 +00:00
Chris Lattner
c4ae94aa32 Switch to a slightly more structured representation for instructions
llvm-svn: 23345
2005-09-14 04:03:16 +00:00
Chris Lattner
77cc161bd5 Add some more checking/verification code
llvm-svn: 23344
2005-09-14 02:11:12 +00:00
Chris Lattner
9ab561788e start parsing instructions into patterns, start doing many more checks of
'set's.

llvm-svn: 23343
2005-09-14 00:09:24 +00:00
Chris Lattner
e2591652a2 don't emit the namespace inside the class!
llvm-svn: 23341
2005-09-13 22:05:02 +00:00
Chris Lattner
1da656efd4 Emit code suitable for emission into the ISel class, allowing us to use/define
methods.

llvm-svn: 23340
2005-09-13 22:03:37 +00:00
Chris Lattner
9bb7fff501 continue xform function parsing
llvm-svn: 23338
2005-09-13 21:59:15 +00:00
Chris Lattner
abc740453c Start parsing node transformation information
llvm-svn: 23337
2005-09-13 21:51:00 +00:00
Chris Lattner
0dd99c9aaf Add a new Record::getValueAsCode method to mirror the other getValueAs*
methods.  Use it to simplify some code.

llvm-svn: 23336
2005-09-13 21:44:28 +00:00
Chris Lattner
4e59482982 completely eliminate TreePattern::PatternType
llvm-svn: 23335
2005-09-13 21:20:49 +00:00
Chris Lattner
773456a944 Regenerate
llvm-svn: 23311
2005-09-12 05:30:06 +00:00
Chris Lattner
8b34f3d20d Rearrange two rules, which apparently makes some versions of bison happier.
llvm-svn: 23310
2005-09-12 05:29:43 +00:00
Jeff Cohen
7e6b5c60fc Fix miscellaneous Visual Studio build problems.
llvm-svn: 23307
2005-09-10 02:00:02 +00:00
Chris Lattner
ada7ac14a1 add an accessor to provide more checking
llvm-svn: 23289
2005-09-09 01:15:01 +00:00
Chris Lattner
2490f8f606 use new accessors to simplify code. Add checking to make sure top-level instr
definitions are void

llvm-svn: 23288
2005-09-09 01:11:44 +00:00
Chris Lattner
2b656c6102 add some accessors
llvm-svn: 23287
2005-09-09 01:11:17 +00:00
Chris Lattner
334e21eb98 Fix incorrect comment
llvm-svn: 23285
2005-09-08 23:26:30 +00:00
Chris Lattner
a6d21c974c Implement a complete type inference system for dag patterns, based on the
constraints defined in the DAG node definitions in the .td files.  This
allows us to infer (and check!) the types for all nodes in the current
ppc .td file.  For example, instead of:

Inst pattern EQV:       (set GPRC:i32:$rT, (xor (xor GPRC:i32:$rA, GPRC:i32:$rB), (imm)<<Predicate_immAllOnes>>))

we now fully infer:

Inst pattern EQV:       (set:void GPRC:i32:$rT, (xor:i32 (xor:i32 GPRC:i32:$rA, GPRC:i32:$rB), (imm:i32)<<Predicate_immAllOnes>>))

from:  (set GPRC:$rT, (not (xor GPRC:$rA, GPRC:$rB)))
llvm-svn: 23284
2005-09-08 23:22:48 +00:00
Chris Lattner
e2fb8f3a77 Compute the value types that are natively supported by a target.
llvm-svn: 23282
2005-09-08 21:43:21 +00:00
Chris Lattner
152a72de2c Parse information about type constraints on SDNodes
llvm-svn: 23281
2005-09-08 21:27:15 +00:00
Chris Lattner
ef07fffe37 use node info in the one place we currently use it
llvm-svn: 23280
2005-09-08 21:04:46 +00:00
Chris Lattner
d9930002aa start parsing SDNode info records
llvm-svn: 23279
2005-09-08 21:03:01 +00:00
Chris Lattner
515c19f56d Fix indentation
llvm-svn: 23276
2005-09-08 19:47:28 +00:00
Chris Lattner
b07d2cc2eb regenerate
llvm-svn: 23275
2005-09-08 18:48:47 +00:00
Chris Lattner
df9876cdb7 Add support for automatically created anonymous definitions.
This implements Regression/TableGen/AnonDefinitionOnDemand.td

llvm-svn: 23274
2005-09-08 18:48:23 +00:00
Chris Lattner
9e7e8d43e8 regenerate
llvm-svn: 23271
2005-09-08 18:22:57 +00:00
Chris Lattner
2e3ed074d8 Tabs to spaces.
llvm-svn: 23270
2005-09-08 18:22:35 +00:00
Chris Lattner
03637c7200 Keep names even when inlining. This allows us to realize that ADDI is:
(set GPRC:i32:$rD, (add GPRC:i32:$rA, (imm)<<Predicate_immSExt16>>:$imm))

not:

(set GPRC:i32:$rD, (add GPRC:i32:$rA, (imm)<<Predicate_immSExt16>>))

(we keep the ":$imm")

llvm-svn: 23269
2005-09-08 17:45:12 +00:00
Chris Lattner
65c98b6441 Initial cut of the dag isel generator. This is still very much a work in
progress.  It correctly parses instructions and pattern fragments and glues
together pattern fragments into instructions.

The only code it generates currently is some boilerplate code for things
like the EntryNode.

llvm-svn: 23261
2005-09-07 23:44:43 +00:00
Chris Lattner
b529b1bdbd Rename a class. These files are being migrated to the new isel and I want to
reuse the names

llvm-svn: 23252
2005-09-06 22:51:34 +00:00
Chris Lattner
f12074e8f6 regenerate
llvm-svn: 23249
2005-09-06 21:23:27 +00:00
Chris Lattner
5cd3a27513 Tighten up the specification to allow TableGen/nested-comment.td to pass
(fixing a bug where / in a /* */ comment would cause it to not close).

llvm-svn: 23248
2005-09-06 21:23:09 +00:00
Chris Lattner
12c57505bf Add an option and stuff implementation of a dag isel emitter
llvm-svn: 23236
2005-09-03 01:14:03 +00:00
Reid Spencer
46a7fdeb66 Implement PR614:
These changes modify the makefiles so that the output of flex and bison are
placed in the SRC directory, not the OBJ directory. It is intended that they
be checked in as any other LLVM source so that platforms without convenient
access to flex/bison can be compiled. From now on, if you change a .y or
.l file you *must* also commit the generated .cpp and .h files.

llvm-svn: 23115
2005-08-27 18:50:39 +00:00
Chris Lattner
497c012e54 spell this right
llvm-svn: 23099
2005-08-26 20:55:40 +00:00
Chris Lattner
6c4ea26961 spell this variable right
llvm-svn: 23095
2005-08-26 20:42:52 +00:00
Chris Lattner
b474a0ab06 Expose a new flag to TargetInstrInfo
llvm-svn: 23094
2005-08-26 20:40:46 +00:00
Chris Lattner
17f0f9beae add a marker at the end of the instruction enum list
llvm-svn: 23090
2005-08-26 20:17:00 +00:00
Chris Lattner
9ceee53f9a Emit this:
static const TargetOperandInfo OperandInfo6[] = { { &PPC32::CRRCRegClass }, { 0 }, };

instead of this:

static const TargetOperandInfo OperandInfo6[] = { { PPC32::CRRCRegisterClass }, { 0 }, };

For operand information, which does not require dynamic (startup-time)
initialization.

llvm-svn: 22931
2005-08-19 20:29:14 +00:00
Chris Lattner
916e016ac1 Expose the derived register classes to the public header, allowing them
to be accessed.

llvm-svn: 22930
2005-08-19 20:23:42 +00:00
Chris Lattner
20c1c4cf07 Split register class "Methods" into MethodProtos and MethodBodies
llvm-svn: 22928
2005-08-19 19:12:51 +00:00
Chris Lattner
cef54bfd28 Refactor to use Target.getRegisterClasses consistently, which provides
anonymous regclass definition renaming.

Change the generated code to emit register classes as properly namespace
qualified entities like everything else.

expose the actual class definition as an object, though this isn't quite
usable yet.

llvm-svn: 22920
2005-08-19 18:47:59 +00:00
Chris Lattner
077a4e87c4 Emit real operand info for instructions. This currently works but is bad
in one way: the generated tables require dynamic initialization for the
register classes.  This will be fixed in a future patch.

llvm-svn: 22919
2005-08-19 18:46:26 +00:00
Chris Lattner
341308dc6b Read the namespace field from register classes
llvm-svn: 22918
2005-08-19 18:45:20 +00:00
Chris Lattner
bf7633b73b add a setName method to record
llvm-svn: 22912
2005-08-19 17:58:49 +00:00
Chris Lattner
1344e9cf9c Add a setName method to Record.
llvm-svn: 22911
2005-08-19 17:58:11 +00:00
Chris Lattner
36f99a1374 For now, just emit empty operand info structures.
llvm-svn: 22910
2005-08-19 16:57:28 +00:00
Chris Lattner
5ac318c67b Fix a problem jeffc noticed
llvm-svn: 22903
2005-08-19 06:16:04 +00:00
Chris Lattner
1685432a06 The code emitter generator only supports targets with 32-bit instruction
words.  There is no way for one of these targets to have a > 32-bit immediate!

llvm-svn: 22897
2005-08-19 01:04:33 +00:00
Chris Lattner
7ab998463c now that all of the targets are clean w.r.t. the number of operands for each
instruction defined, actually emit this to the InstrInfoDescriptor, which
allows an assert in the machineinstrbuilder to do some checking for us,
and is required by the dag->dag emitter

llvm-svn: 22895
2005-08-19 00:59:49 +00:00
Chris Lattner
d03fa09ce7 Figure out how many operands each instruction has, keep track of whether
or not it's variable.

llvm-svn: 22885
2005-08-18 23:38:41 +00:00
Chris Lattner
1f718aa8b5 revert this change, which causes breakage, temporarily
llvm-svn: 22880
2005-08-18 22:12:31 +00:00
Chris Lattner
b312f4d374 When emitting implicit use/def lists, only emit each unique list once. Though
LLVM is able to merge identical static const globals, GCC isn't, and this caused
some bloat in the generated data.  This has a marginal effect on PPC, shrinking
the implicit sets from 10->4, but shrinks X86 from 179 to 23, a much bigger
reduction.

This should speed up the register allocator as well by reducing the dcache
footprint for this static data.

llvm-svn: 22879
2005-08-18 21:36:47 +00:00
Chris Lattner
d3814ff064 Fill in the numOperands field of the TargetInstrDescriptor struct from the
.td file.

llvm-svn: 22873
2005-08-18 19:45:37 +00:00
Jeff Cohen
bd51ec7461 Eliminate all remaining tabs and trailing spaces.
llvm-svn: 22523
2005-07-27 06:12:32 +00:00
Chris Lattner
bee317e9b0 Fix PR595: These error messages should not be looking at CGI.Name, they
should be looking at CGI.TheDef->getName().

llvm-svn: 22445
2005-07-15 22:43:04 +00:00
Nate Begeman
c871411c9d Add support for a TODO; instructions in .td files can now have arguments
printed as part of the opcode.  This allows something like
cmp${cc}ss in the x86 backed to be printed as cmpltss, cmpless, etc.
depending on what the value of $cc is.

llvm-svn: 22439
2005-07-14 22:50:30 +00:00
Jeff Cohen
4d31aeb9df Eliminate tabs and trailing spaces
llvm-svn: 21441
2005-04-22 04:13:13 +00:00
Misha Brukman
960a8d47d7 Remove trailing whitespace
llvm-svn: 21428
2005-04-22 00:00:37 +00:00
Chris Lattner
070188a856 ignore generated files
llvm-svn: 21362
2005-04-19 15:34:36 +00:00
Chris Lattner
0c97ef0c04 fix bogus warning
llvm-svn: 21361
2005-04-19 15:32:30 +00:00
Chris Lattner
c2f7fcfbba Major change to tblgen: instead of resolving values every time a class is
finished up, only resolve fully when the def is defined.  This allows things
to be changed and all uses to be propagated through.  This implements
TableGen/LazyChange.td and fixes TemplateArgRename.td in the process.

None of the .td files used in LLVM backends are changed at all by this
patch.

llvm-svn: 21344
2005-04-19 03:36:21 +00:00
Chris Lattner
57b0bbfcbd implementing shifting of literal integers
llvm-svn: 21336
2005-04-19 01:17:35 +00:00
Chris Lattner
414d27b765 Add initial lexer and parser support for shifting values. Every use of this
will lead to it being rejected though.

llvm-svn: 21335
2005-04-19 01:11:03 +00:00
Chris Lattner
fb921a5722 Minor fix.
llvm-svn: 19761
2005-01-22 20:59:38 +00:00
Chris Lattner
078cda0bb3 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.

llvm-svn: 19760
2005-01-22 20:31:17 +00:00
Chris Lattner
eee6c31449 Implement *even more* factoring. In particular, if all of the instruction
strings starts out with a constant string, we emit the string first, using
a table lookup (instead of a switch statement).

Because this is usually the opcode portion of the asm string, the differences
between the instructions have now been greatly reduced.  This allows many
more case statements to be grouped together.

This patch also allows instruction cases to be grouped together when the
instruction patterns are exactly identical (common after the opcode string
has been ripped off), and when the differing operand is a MachineInstr
operand that needs to be formatted.

The end result of this is a mean and lean generated AsmPrinter!

llvm-svn: 19759
2005-01-22 19:22:23 +00:00
Chris Lattner
f78580dcec Refactor code for numbering instructions into CodeGenTarget.
llvm-svn: 19758
2005-01-22 18:58:51 +00:00
Jeff Cohen
50c819634d Fix VC++ compilation error
llvm-svn: 19757
2005-01-22 18:50:10 +00:00
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
Chris Lattner
3e855b097c Fix the ::: problem
llvm-svn: 19754
2005-01-22 18:18:59 +00:00
Chris Lattner
cc09d8ac1e Minor refactoring, no functionality change.
llvm-svn: 19753
2005-01-22 17:40:38 +00:00
Chris Lattner
67cbd23ad5 Seperate asmstring parsing from emission. This allows the code to be simpler
and more understandable.  It also allows us to do simple things like fold
consequtive literal strings together.  For example, instead of emitting this
for the X86 backend:

  O  << "adc" << "l" << " ";

we now generate this:

  O << "adcl ";

*whoa* :)

This shrinks the X86 asmwriters from 62729->58267 and 65176->58644 bytes
for the intel/att asm writers respectively.

llvm-svn: 19749
2005-01-22 17:32:42 +00:00
Andrew Lenharth
e3d81200bc make double-dollar properly escape asmstrings
llvm-svn: 19740
2005-01-22 00:35:22 +00:00
Chris Lattner
2aef5783b0 Expose isConvertibleToThreeAddress and isCommutable bits to the code generator.
llvm-svn: 19243
2005-01-02 02:29:04 +00:00
Reid Spencer
7b0596782a For PR387:
Make this compile without warning when -Woverloaded-virtual is used.

llvm-svn: 18588
2004-12-06 23:42:37 +00:00
Reid Spencer
bbdeb2181d Fix usage of changed function prototype
llvm-svn: 17798
2004-11-14 22:30:54 +00:00
Chris Lattner
499e1b16a7 Quiet VC++ warnings
llvm-svn: 17484
2004-11-05 04:50:59 +00:00
Reid Spencer
acb1305e99 Internalize variable names to prevent recursive assignment. Cleanup docs.
llvm-svn: 17359
2004-10-30 09:19:36 +00:00
Reid Spencer
d3f7233495 Change Library Names Not To Conflict With Others When Installed
llvm-svn: 17286
2004-10-27 23:18:45 +00:00
Chris Lattner
dd0094e4ed Convert 'struct' to 'class' in various places to adhere to the coding standards
and work better with VC++.  Patch contributed by Morten Ofstad!

llvm-svn: 17281
2004-10-27 16:14:51 +00:00
Chris Lattner
0566f4f4ce Make VC happier, patch contributed by Morten Ofstad
llvm-svn: 17179
2004-10-23 04:58:50 +00:00
Reid Spencer
5574857063 We're not doing automake any more
llvm-svn: 17168
2004-10-22 21:02:23 +00:00
Reid Spencer
e48ba34fd4 We won't use automake
llvm-svn: 17155
2004-10-22 03:35:04 +00:00
Reid Spencer
ce514b1c2c Initial automake generated Makefile template
llvm-svn: 17136
2004-10-18 23:55:41 +00:00
Misha Brukman
4e252ebfa0 * Factor out (into new fn) a loop emitting operand shifts into the instruction
* Reverse instruction bit components for a LittleEndian-style encoding
* Fix some comments and spacing

llvm-svn: 16975
2004-10-14 05:53:01 +00:00
Misha Brukman
a87a2029e4 * Add option to read isLittleEndianEncoding for InstrInfo classes
* Doxygen-ify some function comments

llvm-svn: 16974
2004-10-14 05:50:43 +00:00
Chris Lattner
8dd656b17b Patch to make VS happier, thanks to Morten Ofstad for pointing this out.
llvm-svn: 16956
2004-10-13 15:25:46 +00:00
Reid Spencer
1b27f66b76 Updates for changes in Makefile rules.
llvm-svn: 16951
2004-10-13 11:48:50 +00:00
Chris Lattner
dc7da6c655 Don't emit the method into the llvm namespace, let the #includer decide where it goes
llvm-svn: 16934
2004-10-12 16:21:18 +00:00
Reid Spencer
7d9cba7a0f Initial version of automake Makefile.am file.
llvm-svn: 16885
2004-10-10 20:43:57 +00:00
Misha Brukman
7fee34176a Properly `quote' names, and don't forget to add the ending quote!
llvm-svn: 16838
2004-10-08 14:59:05 +00:00
Chris Lattner
de7199b94f Correctly parse variant notation
llvm-svn: 16637
2004-10-03 20:19:02 +00:00
Chris Lattner
9a649a5c05 Add initial support for variants. This just parses the new format, no
functionality is added

llvm-svn: 16636
2004-10-03 19:34:31 +00:00
Misha Brukman
bf7a239716 #include DataTypes.h to compile on MinGW, patch by Henrik Bach.
llvm-svn: 16616
2004-09-30 18:27:39 +00:00
Nate Begeman
bbf7945b61 Add support for the isLoad and isStore flags, needed by the instruction scheduler
llvm-svn: 16554
2004-09-28 21:01:45 +00:00
Chris Lattner
7a941d7691 Turn the hasDelaySlot flag into the M_DELAY_SLOT_FLAG
llvm-svn: 16553
2004-09-28 18:38:01 +00:00
Chris Lattner
aee36bb527 Revamp the Register class, and allow the use of the RegisterGroup class to
specify aliases directly in register definitions.

Patch contributed by Jason Eckhardt!

llvm-svn: 16330
2004-09-14 04:17:02 +00:00
Reid Spencer
d5b1443205 Clean up some "clean:" targets so they use $(VERB) and don't print anything
by default, like every other "clean" target in LLVM.

llvm-svn: 16161
2004-09-03 23:19:53 +00:00
Reid Spencer
7f1b5ae07e Make tblgen's exception handling a little more robust by printing the
program name and also catching ...

llvm-svn: 16160
2004-09-03 23:17:54 +00:00
Reid Spencer
c4abcbefb1 Changes For Bug 352
Move include/Config and include/Support into include/llvm/Config,
include/llvm/ADT and include/llvm/Support. From here on out, all LLVM
public header files must be under include/llvm/.

llvm-svn: 16137
2004-09-01 22:55:40 +00:00
Reid Spencer
a6733ed360 Link with LLVMsystem.a for operating system independence.
llvm-svn: 16094
2004-08-29 19:31:19 +00:00
Reid Spencer
7ddb3950e4 RemoveFileOnErrorSignal is now in the llvm::sys namespace. Adjust
accordingly.

llvm-svn: 16093
2004-08-29 19:30:41 +00:00
Chris Lattner
e35741184e Alignment is now in bits.
llvm-svn: 15976
2004-08-21 20:15:25 +00:00
Chris Lattner
e88b8e3471 Make alignment be in bits, just like size is
llvm-svn: 15969
2004-08-21 20:00:36 +00:00
Chris Lattner
d4ec8aeb62 Infer the spillsize/alignment of a register based on the register classes
it is embedded into.

llvm-svn: 15966
2004-08-21 19:42:03 +00:00
Chris Lattner
75ca702833 Support "Methods" in register classes in CodgeGenRegisterClass
llvm-svn: 15965
2004-08-21 19:21:21 +00:00
Chris Lattner
c33c1c8dca Start parsing register classes into a more structured form
llvm-svn: 15961
2004-08-21 04:05:00 +00:00
Chris Lattner
820f674293 Read in declared reg sizes
llvm-svn: 15960
2004-08-21 02:24:57 +00:00
Chris Lattner
89ebd84bc2 Do not #include files into the llvm namespace
llvm-svn: 15849
2004-08-17 03:08:28 +00:00
Chris Lattner
892fc12546 Use CodeGenRegister class to make reading in of register information more
systematic.

llvm-svn: 15805
2004-08-16 01:10:21 +00:00
Chris Lattner
c07542698b Add initial support for register and register class representation.
Obviously this is not done.

llvm-svn: 15804
2004-08-16 01:09:52 +00:00
Chris Lattner
7a514bf631 Remove awareness of isDummyClass
llvm-svn: 15789
2004-08-15 23:04:13 +00:00
Chris Lattner
d7240cdb18 Make the AsmWriter a first-class tblgen object. Allow targets to specify
name of the generated asmwriter class, and the name of the format string.

llvm-svn: 15747
2004-08-14 22:50:53 +00:00
Chris Lattner
a86411806a Fix minor bug in previous checkin
llvm-svn: 15649
2004-08-11 04:08:36 +00:00
Chris Lattner
0f301f495b change how we invoke the printer. Instead of passing in the MO directly,
pass in the MI, operand number, and the type of the operand.

llvm-svn: 15645
2004-08-11 02:23:23 +00:00
Chris Lattner
a88aec6972 Start parsing more information from the Operand information
llvm-svn: 15644
2004-08-11 02:22:39 +00:00