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

73 Commits

Author SHA1 Message Date
David Greene
19324a5b81 Add an !eq() operator to TableGen. It operates on strings only.
Use !cast<string>() to compare other types of objects.

llvm-svn: 92754
2010-01-05 19:11:42 +00:00
Dan Gohman
7c41aa00c0 Delete some dead and non-obvious code.
llvm-svn: 89729
2009-11-24 01:48:15 +00:00
Bob Wilson
f8f20e67a3 Fix whitespace.
llvm-svn: 89582
2009-11-22 04:24:42 +00:00
Bob Wilson
ca49051ec8 Fix some spelling in comments.
llvm-svn: 89566
2009-11-21 22:44:20 +00:00
Bob Wilson
35c5b307d6 Avoid a redundant assertion.
llvm-svn: 89565
2009-11-21 22:39:27 +00:00
Chandler Carruth
766362c707 Move DataTypes.h to include/llvm/System, update all users. This breaks the last
direct inclusion edge from System to Support.

llvm-svn: 85086
2009-10-26 01:35:46 +00:00
Chris Lattner
194391ddb7 convert some stuff to StringRef to avoid temporary std::strings.
llvm-svn: 82244
2009-09-18 18:31:37 +00:00
Daniel Dunbar
55ef0b87d7 Fix non-determinism in DAGISel emitter.
- This manifested as non-determinism in the .inc output in rare cases (when two
   distinct patterns ended up being equivalent, which is rather rare). That
   meant the pattern matching was non-deterministic, which could eventually mean
   the code generator selected different instructions based on the arch.

 - It's probably worth making the DAGISel ensure a total ordering (or force the
   user to), but the simple fix here is to totally order the Record* maps based
   on a unique ID.

 - PR4672, PR4711.

Yay:
--
ddunbar@giles:~$ cat ~/llvm.obj.64/lib/Target/*/*.inc | shasum
d1099ff34b21459a5a3e7021c225c080e6017ece  -
ddunbar@giles:~$ cat ~/llvm.obj.ppc/lib/Target/*/*.inc | shasum
d1099ff34b21459a5a3e7021c225c080e6017ece  -
--

llvm-svn: 79846
2009-08-23 09:47:37 +00:00
Dan Gohman
bc6b14ba00 This void is implicit in C++.
llvm-svn: 78848
2009-08-12 22:10:57 +00:00
Daniel Dunbar
95f6034ab6 Replace std::iostreams with raw_ostream in TableGen.
- Sorry, I can't help myself.

 - No intended functionality change.

llvm-svn: 74742
2009-07-03 00:10:29 +00:00
David Greene
7fcd1a3f35 Implement !cast<string>.
llvm-svn: 74444
2009-06-29 20:05:29 +00:00
Chris Lattner
4ff2620742 rename TGLoc -> SMLoc.
llvm-svn: 73843
2009-06-21 03:39:35 +00:00
Chris Lattner
4ed87b8790 move TGSourceMgr class out of TableGen into libsupport.
llvm-svn: 73842
2009-06-21 03:36:54 +00:00
David Greene
a51f014e59 Revert 73074 and 73099 because Windows doesn't have POSIX
regular expressions.  We will add an OpenBSD implementation
and re-apply ASAP.

llvm-svn: 73138
2009-06-09 18:31:17 +00:00
David Greene
e3c4370a47 Add a !patsubst operator. Use on string types.
llvm-svn: 73099
2009-06-08 23:05:37 +00:00
David Greene
62a2f2fb97 Make IntInits and ListInits typed. This helps deduce types of !if and
other operators.  For the rare cases where a list type cannot be
deduced, provide a []<type> syntax, where <type> is the list element
type.

llvm-svn: 73078
2009-06-08 20:23:18 +00:00
David Greene
21ba6012b2 Add a !regmatch operator to do pattern matching in TableGen.
llvm-svn: 73074
2009-06-08 17:00:34 +00:00
Nick Lewycky
d4466ebdda Add extra parenthesis around || statements to pacify compiler.
Also fix up some 80col violations while I'm there.

llvm-svn: 71833
2009-05-15 03:03:14 +00:00
David Greene
9a1e15d0d0 Implement !if, analogous to $(if) in GNU make.
llvm-svn: 71815
2009-05-14 23:26:46 +00:00
David Greene
70881bc6ae Graduate LLVM to the big leagues by embedding a LISP processor into TableGen.
Ok, not really, but do support some common LISP functions:

* car
* cdr
* null

llvm-svn: 71805
2009-05-14 22:38:31 +00:00
David Greene
fab0ee79db Implement a !foreach operator analogous to GNU make's $(foreach).
Use it on dags and lists like this:

class decls {
  string name;
}

def Decls : decls;

class B<list<string> names> : A<!foreach(Decls.name, names, !strconcat(Decls.name, ", Sr."))>;

llvm-svn: 71803
2009-05-14 22:23:47 +00:00
David Greene
26054a566e Implement a !subst operation simmilar to $(subst) in GNU make to do
def/var/string substitution on generic pattern templates.  For example:

def Type;
def v4f32 : Type;
def TYPE : Type;

class GenType<Type t> {
  let type = !(subst TYPE, v4f32, t);
}

def TheType : GenType<TYPE>;

llvm-svn: 71801
2009-05-14 21:54:42 +00:00
David Greene
e2871b8c65 Implement !cast.
llvm-svn: 71794
2009-05-14 21:22:49 +00:00
David Greene
5cc13bb60b Operation Enhancements
Create an OpInit class to serve as a base for all operation Inits.

Move parsing of operation constructs to separate functions and reference
from multiple places.

Add some commented out new operations.  Coming soon.

llvm-svn: 71789
2009-05-14 20:54:48 +00:00
Bob Wilson
dd9b184c19 Change forward declaration of MultiClass to use the "struct" keyword instead
of "class", so that it matches the subsequent definition.

llvm-svn: 70498
2009-04-30 17:35:11 +00:00
David Greene
a28b42f818 Fix multiclass inheritance to limit value resolution to new defs added
by base multiclasses.  Do not attempt to alter defs from previous base
multiclasses.  This fixes multiple multiclass inheritance.

llvm-svn: 69974
2009-04-24 16:55:41 +00:00
David Greene
a92a50c7c2 Make BinOps typed and require a type specifier for !nameconcat. This
allows binops to be used in typed contexts such as when passing
arguments to classes.

llvm-svn: 69921
2009-04-23 21:25:15 +00:00
David Greene
0698602922 Implement !nameconcat to concatenate strings and look up the resulting
name in the symbol table, returning an object.

llvm-svn: 69822
2009-04-22 20:18:10 +00:00
Nate Begeman
0eed59a7df Add support to tablegen for naming the nodes themselves, not just the operands,
in selectiondag patterns.  This is required for the upcoming shuffle_vector rewrite,
and as it turns out, cleans up a hack in the Alpha instruction info.

llvm-svn: 67286
2009-03-19 05:21:56 +00:00
Ted Kremenek
68e7aca3cb Further constify Record::isSubClassOf.
llvm-svn: 66970
2009-03-13 22:20:10 +00:00
Chris Lattner
7af521bd0c add a new TGError class and use it to propagate location info with
errors when thrown.  This gets us nice errors like this from tblgen:

CMOVL32rr: 	(set GR32:i32:$dst, (X86cmov GR32:$src1, GR32:$src2))
/Users/sabre/llvm/Debug/bin/tblgen: error:
Included from X86.td:116:
Parsing X86InstrInfo.td:922: In CMOVL32rr: X86cmov node requires exactly 4 operands!
def CMOVL32rr : I<0x4C, MRMSrcReg,       // if <s, GR32 = GR32
^

instead of just:

CMOVL32rr: 	(set GR32:i32:$dst, (X86cmov GR32:$src1, GR32:$src2))
/Users/sabre/llvm/Debug/bin/tblgen: In CMOVL32rr: X86cmov node requires exactly 4 operands!

This is all I plan to do with this, but it should be easy enough to improve if anyone 
cares (e.g. keeping more loc info in "dag" expr records in tblgen.

llvm-svn: 66898
2009-03-13 16:25:21 +00:00
Chris Lattner
11707a5c89 give each Record a location.
llvm-svn: 66897
2009-03-13 16:09:24 +00:00
Argyrios Kyrtzidis
f1de51fd9f Unbreak LLVM on the MSVC compiler:
-Bring in int64_t for TableGen/Record.h and TableGen/TGLexer.h
-Define strtoull

llvm-svn: 57970
2008-10-22 09:54:13 +00:00
Dan Gohman
268cfea6bc Fun x86 encoding tricks: when adding an immediate value of 128,
use a SUB instruction instead of an ADD, because -128 can be
encoded in an 8-bit signed immediate field, while +128 can't be.
This avoids the need for a 32-bit immediate field in this case.

A similar optimization applies to 64-bit adds with 0x80000000,
with the 32-bit signed immediate field.

To support this, teach tablegen how to handle 64-bit constants.

llvm-svn: 57663
2008-10-17 01:33:43 +00:00
Jim Grosbach
f53af44e09 lib/Target/SubtargetFeature.cpp asserts that the FeatureKV[] table be sorted
by its first field, but TableGen doesn't actually enforce creating it that 
way. TableGen sorts the records that will be used to create it by the names 
of the records, not the Name field of those records.

This patch corrects the sort to use the "Name" field of the record as the 
sort key.

llvm-svn: 56106
2008-09-11 17:05:32 +00:00
Chris Lattner
e589d360a1 Stabilize 'getDwarfRegNumFull' output to not depend on random memory
orders, part of PR2590

llvm-svn: 55359
2008-08-26 06:43:25 +00:00
Dan Gohman
955fdc7a4c Add explicit keywords.
llvm-svn: 53179
2008-07-07 18:00:37 +00:00
Dan Gohman
2b96ce84aa Add explicit keywords.
llvm-svn: 48801
2008-03-25 22:06:05 +00:00
Anton Korobeynikov
f3813b1d76 Add interator interface to DAGInit also
llvm-svn: 46250
2008-01-22 11:00:07 +00:00
Anton Korobeynikov
7aff8f1a5d Provide iterator access to ListInit contents
llvm-svn: 46223
2008-01-21 22:30:26 +00:00
Chris Lattner
c4006845a6 remove attributions from utils.
llvm-svn: 45419
2007-12-29 20:37:13 +00:00
Chris Lattner
ac95162b44 change the Init print methods to return strings, and implement
print in terms of that.

llvm-svn: 44276
2007-11-22 21:05:25 +00:00
Chris Lattner
118519d38d eliminate a bunch of print methods that are duplicate with the getAsString() method.
llvm-svn: 44275
2007-11-22 20:51:34 +00:00
Chris Lattner
7627a7d8f4 Add the ability to convert a tblgen type to a string.
llvm-svn: 44257
2007-11-20 22:25:16 +00:00
Anton Korobeynikov
cdfd2ddaa7 Add convenient helper to obtain list of ints
llvm-svn: 43993
2007-11-11 11:19:37 +00:00
Evan Cheng
f96cf9eab6 Added \!con(a,b) syntax to concatnate two dag fragments.
llvm-svn: 37063
2007-05-15 01:23:24 +00:00
Chris Lattner
35b160f990 reapply
llvm-svn: 34697
2007-02-27 22:08:27 +00:00
Evan Cheng
06b5bb9888 Backing out
CodeGenTarget.cpp updated: 1.82 -> 1.83
Record.cpp updated: 1.55 -> 1.56
Record.h updated: 1.59 -> 1.60
TableGen.cpp updated: 1.47 -> 1.48
It's missing CallingConvEmitter.h

llvm-svn: 34693
2007-02-27 21:44:08 +00:00
Chris Lattner
5e2b19c767 initial support for calling convention generation, still unfinished.
llvm-svn: 34682
2007-02-27 20:43:37 +00:00
Bill Wendling
f13d78d3b8 What should be the last unnecessary <iostream>s in the library.
llvm-svn: 32333
2006-12-07 22:21:48 +00:00