Commit Graph

576 Commits

Author SHA1 Message Date
Chris Lattner
9fff8919ee Finish the register info emitter
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7506 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-03 13:52:02 +00:00
Chris Lattner
dbb295bd0d Add new method
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7502 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-02 01:27:37 +00:00
Chris Lattner
c648dabf65 DEBUG got moved to Debug.h
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7491 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-01 22:13:59 +00:00
Chris Lattner
e79c72d4cd Tablegen should only replace the output if it changes
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7486 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-01 20:35:01 +00:00
Chris Lattner
f1e366acff Make sure to delete the output file if there is an error
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7481 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-01 19:21:43 +00:00
Chris Lattner
c7d58024f8 add support for emitting register classes
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7473 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-01 06:27:59 +00:00
Chris Lattner
58c5de1692 Add new getValueAsListInit and getValueAsInt methods
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7472 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-01 06:15:10 +00:00
Chris Lattner
54d156d333 Add the ability to emit register file enums
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7471 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-01 05:59:20 +00:00
Chris Lattner
24151a6888 Fix the way field bit references are resolved, also allow resolution of field references overall!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7470 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-01 05:58:58 +00:00
Chris Lattner
accd8abeeb Dead code elimination
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7468 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-01 04:47:20 +00:00
Chris Lattner
6f334ad8f5 Add new getValueAsBitsInit 'high-level' method
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7467 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-01 04:46:24 +00:00
Chris Lattner
1d1adea493 Add file comment
Add register info emitter
Simplify code by using "high-level" methods.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7466 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-01 04:39:05 +00:00
Chris Lattner
3112326c88 Initial checkin of register info emitter
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7465 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-01 04:38:38 +00:00
Chris Lattner
048c00db1c Simplify code to match new interfaces
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7464 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-01 04:38:18 +00:00
Chris Lattner
5c737ad4d6 Switch over to an exception handling model for "high-level" requests.
Add new getValueAsString method.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7463 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-01 04:37:57 +00:00
Chris Lattner
cf1b585312 Minor cleanups
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7462 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-01 04:15:25 +00:00
Chris Lattner
ab47ae3381 Factor code out into a new getAllDerivedDefinitions method, which is generally useful
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7461 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-01 04:09:58 +00:00
Chris Lattner
c9670ef17d More minor cleanups of the interface
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7446 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-31 04:43:49 +00:00
Chris Lattner
f745a20deb Rename createEmitter to run because eventually all tablegen backends will
be subclasses of a common interface.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7445 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-31 04:38:26 +00:00
Chris Lattner
14d7c59491 Add file comment
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7444 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-31 04:37:57 +00:00
Chris Lattner
aaa3939476 Tighten up interface
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7443 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-31 04:32:37 +00:00
Chris Lattner
e3a1d05448 Add support for code fragments
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7440 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-30 22:15:58 +00:00
Chris Lattner
f05760de76 Initial support for the 'code' type.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7439 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-30 21:47:42 +00:00
Chris Lattner
7dff053540 Move err() to the lexer, implement file inclusion capabilities directly in tblgen
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7436 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-30 20:56:47 +00:00
Chris Lattner
e623fe3d0a Minor reorganization, move ParseFile to the lexer
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7432 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-30 19:55:10 +00:00
Chris Lattner
90523906fa Make tablegen take an input filename to parse if one is specified, otherwise
use stdin.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7431 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-30 19:48:02 +00:00
Chris Lattner
d33b8db415 Directly support C style comments in tblgen, but allow them to actually nest
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7429 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-30 19:39:36 +00:00
Chris Lattner
18226e0cf1 Fix coredump for when an ID is used illegally outside a record
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7411 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-30 05:17:35 +00:00
Chris Lattner
bfce056ea8 Don't pollute the namespace with template arguments after they have been resolved
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7410 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-30 04:56:05 +00:00
Chris Lattner
554af5cd62 Implement TODO: disallow 'def's with template arguments.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7409 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-30 04:31:17 +00:00
Chris Lattner
fc06bf0eaa Allow specification of anonymous definitions
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7408 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-30 04:26:44 +00:00
Chris Lattner
f1b36f9a71 Allow passing lists through variables
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7407 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-30 04:16:52 +00:00
Chris Lattner
9b929aa749 Implement resolution of variables to the value of the variable once it gets a value
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7406 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-30 04:05:07 +00:00
Chris Lattner
30709543d2 Don't crash if there is no Inst class in the tablegen file!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7402 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-29 23:00:08 +00:00
Chris Lattner
2e724541ff Add support for Set statements without {}'s. Now we can just say
set Foo = bar in
  def blah: blahclass {}


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7355 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-28 03:49:40 +00:00
Chris Lattner
ce3d64025b Allow initializing variable initializers with variables
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7354 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-28 03:39:57 +00:00
Chris Lattner
b5b3c6fc01 Use C++ headers, not C headers
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7308 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-25 17:32:51 +00:00
Misha Brukman
c86516f35c Added a DEBUG() guard to a debug information printout.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7203 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-18 18:03:45 +00:00
Misha Brukman
f6e5217b54 Fixed a bug: outputting name of variable instead of its value.
Also, placed DEBUG() guards around debug information so that the generated file
is much smaller and hence should be faster to preprocess/compile.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7180 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-15 21:26:09 +00:00
Misha Brukman
7eac4766b1 This optimization greatly enhances efficiency of creating new instructions by
masking and shifting operands directly into their place in the instruction,
instead of the old-fashioned way of ORing in each bit separately.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7179 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-15 21:00:32 +00:00
Misha Brukman
48aa824279 Stop using the `Offset' variable, as we are cycling through the bits of a field
initializer and the loop index variable already carries the offset information
that we need.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7123 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-07 22:30:44 +00:00
John Criswell
7a73b80b90 Merged in autoconf branch. This provides configuration via the autoconf
system.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7014 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-30 21:59:07 +00:00
John Criswell
028936ada1 Added assert.h so that it compiles under newer versions of GCC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6683 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-11 14:17:21 +00:00
Chris Lattner
1cb65f2d62 Old versions of GCC doesn't have <ostream> :(
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6661 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-06 23:06:20 +00:00
Misha Brukman
f4ef4c881f All debug print statements are now output with the DEBUG() guard to make
output clean so that tests can automatically diff the output.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6643 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-06 00:27:02 +00:00
Misha Brukman
3d194ac26b * Stop ignoring cc registers, since we actually use them in branches.
* Added comment as to why we are still ignoring predict and annul bits.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6636 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-05 23:15:25 +00:00
Chris Lattner
85df22568d Spiff up options a bit
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6573 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-03 05:07:28 +00:00
Chris Lattner
9a886386a4 Add -o support for TableGen
I figure that misha has done a lot of things on my todo list, the least I
can do is reciprocate a bit.  :)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6571 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-03 05:04:42 +00:00
Chris Lattner
bc52013e30 Make tablegen use more structured command line options
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6570 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-03 04:56:29 +00:00
Misha Brukman
9ced1671a6 Stop ignoring the `cc' field, we actually use it now (e.g. conditional move)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6555 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-03 00:07:17 +00:00
Misha Brukman
e7800b5458 getValueOp() now takes a MachineInstr as well as a MachineOperand.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6450 91177308-0d34-0410-b5e6-96231b3b80d8
2003-05-30 20:32:01 +00:00
Misha Brukman
ecc7fd3c56 Output the opcode name of the instruction being emitted to cerr.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6386 91177308-0d34-0410-b5e6-96231b3b80d8
2003-05-28 18:29:10 +00:00
Misha Brukman
b9dd8154b6 Cannot output `static' in generated cpp code: results in error. It's already
specified as a static member in class definition.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6370 91177308-0d34-0410-b5e6-96231b3b80d8
2003-05-27 22:29:02 +00:00
Misha Brukman
cbfde0a612 * Now outputting a static function getBinaryCodeForInstr() (JIT-accessible)
* For debugging purposes:
  + output the predefined bit pattern of the instruction
* Fixed inefficiency: only load an operand from MachineInstr once
* Bug fix: did not advance bit index when seeing named bit-fields "annul", "cc"
  and "predict"
* Added a catch-all for non-supported instructions at the end of switch stmt.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6368 91177308-0d34-0410-b5e6-96231b3b80d8
2003-05-27 22:19:58 +00:00
Misha Brukman
f00ce8bc29 Add ability to utilize the code emitter generator (CodeEmitterGen).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6322 91177308-0d34-0410-b5e6-96231b3b80d8
2003-05-24 00:17:12 +00:00
Misha Brukman
9fff7e194a First cut at the Code Generator using the TableGen methodology.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6321 91177308-0d34-0410-b5e6-96231b3b80d8
2003-05-24 00:15:53 +00:00
Misha Brukman
e3d333edd1 I fixed that ``thang'', yo.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6252 91177308-0d34-0410-b5e6-96231b3b80d8
2003-05-20 23:45:36 +00:00
Chris Lattner
28c2d409a5 Fix bug
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4942 91177308-0d34-0410-b5e6-96231b3b80d8
2002-12-06 04:42:16 +00:00
Chris Lattner
23ffa4a488 Allow printing partially constructed bitsets
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4941 91177308-0d34-0410-b5e6-96231b3b80d8
2002-12-06 04:42:10 +00:00
Chris Lattner
cdbfa422cd Don't delete values that may still be referenced!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4940 91177308-0d34-0410-b5e6-96231b3b80d8
2002-12-06 04:02:48 +00:00
Chris Lattner
ade0de9123 Tighten up assertion checking
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4939 91177308-0d34-0410-b5e6-96231b3b80d8
2002-12-06 03:55:39 +00:00
Chris Lattner
7b1d49b61d Add code that can be used for debugging
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4888 91177308-0d34-0410-b5e6-96231b3b80d8
2002-12-03 20:01:04 +00:00
Chris Lattner
b1ed0fc630 Continue implementing field initializers
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4879 91177308-0d34-0410-b5e6-96231b3b80d8
2002-12-03 06:00:33 +00:00
Chris Lattner
4767a0c1b6 Don't delete temporary files
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4878 91177308-0d34-0410-b5e6-96231b3b80d8
2002-12-03 06:00:11 +00:00
Chris Lattner
b45b3b3cd1 Continued support for field intitializers
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4855 91177308-0d34-0410-b5e6-96231b3b80d8
2002-12-02 17:53:54 +00:00
Chris Lattner
db1b766fe6 Continued support for field initializer
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4854 91177308-0d34-0410-b5e6-96231b3b80d8
2002-12-02 17:44:35 +00:00
Chris Lattner
7331ab9d56 Continued support for Field Initializer
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4853 91177308-0d34-0410-b5e6-96231b3b80d8
2002-12-02 17:43:58 +00:00
Chris Lattner
9833493bae Adjustments due to new FieldInit stuff
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4852 91177308-0d34-0410-b5e6-96231b3b80d8
2002-12-02 17:43:43 +00:00
Chris Lattner
f1e37d9d03 Add comments, factor out common code
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4851 91177308-0d34-0410-b5e6-96231b3b80d8
2002-12-02 16:57:01 +00:00
Chris Lattner
34a7769b0b Add support for field exprs
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4850 91177308-0d34-0410-b5e6-96231b3b80d8
2002-12-02 16:43:43 +00:00
Chris Lattner
28520c4b61 * Move BitsInit::resolveReferences up with the rest of BitsInit code
* Initial support for field expressions


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4849 91177308-0d34-0410-b5e6-96231b3b80d8
2002-12-02 16:43:30 +00:00
Chris Lattner
a1651900e1 Initial support for Field Expressions
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4848 91177308-0d34-0410-b5e6-96231b3b80d8
2002-12-02 16:42:52 +00:00
Chris Lattner
d00e8f1f83 Add correct dependency
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4847 91177308-0d34-0410-b5e6-96231b3b80d8
2002-12-02 16:31:46 +00:00
Chris Lattner
24e79094f9 Split up targets
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4846 91177308-0d34-0410-b5e6-96231b3b80d8
2002-12-02 16:13:42 +00:00
Chris Lattner
07278e48dc Add comments
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4845 91177308-0d34-0410-b5e6-96231b3b80d8
2002-12-02 16:13:23 +00:00
Chris Lattner
e62c1185be Initial checkin of TableGen utility
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4843 91177308-0d34-0410-b5e6-96231b3b80d8
2002-12-02 01:23:04 +00:00