summaryrefslogtreecommitdiff
path: root/utils/TableGen/Record.h
Commit message (Collapse)AuthorAge
* Add StringRef::compare_numeric and use it to sort TableGen register records.Jakob Stoklund Olesen2010-05-26
| | | | | | | This means that our Registers are now ordered R7, R8, R9, R10, R12, ... Not R1, R10, R11, R12, R2, R3, ... git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@104745 91177308-0d34-0410-b5e6-96231b3b80d8
* If all the bit positions are not specified; do not decode the instructions.Johnny Chen2010-04-09
| | | | | | | | | | | We are bound to fail! For proper disassembly, the well-known encoding bits of the instruction must be fully specified. This also removes pseudo instructions from considerations of disassembly, which is a better design and less fragile than the name matchings. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100899 91177308-0d34-0410-b5e6-96231b3b80d8
* Replace TSFlagsFields and TSFlagsShifts with a simpler TSFlags field.Jakob Stoklund Olesen2010-04-05
| | | | | | | | | | | | | | | | | | | When a target instruction wants to set target-specific flags, it should simply set bits in the TSFlags bit vector defined in the Instruction TableGen class. This works well because TableGen resolves member references late: class I : Instruction { AddrMode AM = AddrModeNone; let TSFlags{3-0} = AM.Value; } let AM = AddrMode4 in def ADD : I; TSFlags gets the expected bits from AddrMode4 in this example. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100384 91177308-0d34-0410-b5e6-96231b3b80d8
* Teach TableGen to understand X.Y notation in the TSFlagsFields strings.Jakob Stoklund Olesen2010-03-25
| | | | | | | Remove much horribleness from X86InstrFormats as a result. Similar simplifications are probably possible for other targets. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99539 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix evil TableGen bug in template parameters with defaults.Jakob Stoklund Olesen2010-03-25
| | | | | | | | | | If a TableGen class has an initializer expression containing an X.Y subexpression, AND X depends on template parameters, AND those template parameters have defaults, AND some parameters with defaults are beyond position 1, THEN parts of the initializer expression are evaluated prematurely with the default values when the first explicit template parameter is substituted, before the remaining explicit template parameters have been substituted. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99492 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix PR2590 by making PatternSortingPredicate actually be Chris Lattner2010-03-01
| | | | | | | | | | | | | | | | | ordered correctly. Previously it would get in trouble when two patterns were too similar and give them nondet ordering. We force this by using the record ID order as a fallback. The testsuite diff is due to alpha patterns being ordered slightly differently, the change is a semantic noop afaict: < lda $0,-100($16) --- > subq $16,100,$0 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97509 91177308-0d34-0410-b5e6-96231b3b80d8
* Add an !eq() operator to TableGen. It operates on strings only.David Greene2010-01-05
| | | | | | | Use !cast<string>() to compare other types of objects. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92754 91177308-0d34-0410-b5e6-96231b3b80d8
* Delete some dead and non-obvious code.Dan Gohman2009-11-24
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89729 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix whitespace.Bob Wilson2009-11-22
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89582 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix some spelling in comments.Bob Wilson2009-11-21
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89566 91177308-0d34-0410-b5e6-96231b3b80d8
* Avoid a redundant assertion.Bob Wilson2009-11-21
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89565 91177308-0d34-0410-b5e6-96231b3b80d8
* Move DataTypes.h to include/llvm/System, update all users. This breaks the lastChandler Carruth2009-10-26
| | | | | | | direct inclusion edge from System to Support. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85086 91177308-0d34-0410-b5e6-96231b3b80d8
* convert some stuff to StringRef to avoid temporary std::strings.Chris Lattner2009-09-18
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82244 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix non-determinism in DAGISel emitter.Daniel Dunbar2009-08-23
| | | | | | | | | | | | | | | | | | | | | | | - 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 - -- git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79846 91177308-0d34-0410-b5e6-96231b3b80d8
* This void is implicit in C++.Dan Gohman2009-08-12
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78848 91177308-0d34-0410-b5e6-96231b3b80d8
* Replace std::iostreams with raw_ostream in TableGen.Daniel Dunbar2009-07-03
| | | | | | | | | - Sorry, I can't help myself. - No intended functionality change. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@74742 91177308-0d34-0410-b5e6-96231b3b80d8
* Implement !cast<string>.David Greene2009-06-29
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@74444 91177308-0d34-0410-b5e6-96231b3b80d8
* rename TGLoc -> SMLoc.Chris Lattner2009-06-21
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73843 91177308-0d34-0410-b5e6-96231b3b80d8
* move TGSourceMgr class out of TableGen into libsupport.Chris Lattner2009-06-21
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73842 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert 73074 and 73099 because Windows doesn't have POSIXDavid Greene2009-06-09
| | | | | | | | regular expressions. We will add an OpenBSD implementation and re-apply ASAP. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73138 91177308-0d34-0410-b5e6-96231b3b80d8
* Add a !patsubst operator. Use on string types.David Greene2009-06-08
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73099 91177308-0d34-0410-b5e6-96231b3b80d8
* Make IntInits and ListInits typed. This helps deduce types of !if andDavid Greene2009-06-08
| | | | | | | | | other operators. For the rare cases where a list type cannot be deduced, provide a []<type> syntax, where <type> is the list element type. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73078 91177308-0d34-0410-b5e6-96231b3b80d8
* Add a !regmatch operator to do pattern matching in TableGen.David Greene2009-06-08
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73074 91177308-0d34-0410-b5e6-96231b3b80d8
* Add extra parenthesis around || statements to pacify compiler.Nick Lewycky2009-05-15
| | | | | | | Also fix up some 80col violations while I'm there. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@71833 91177308-0d34-0410-b5e6-96231b3b80d8
* Implement !if, analogous to $(if) in GNU make.David Greene2009-05-14
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@71815 91177308-0d34-0410-b5e6-96231b3b80d8
* Graduate LLVM to the big leagues by embedding a LISP processor into TableGen.David Greene2009-05-14
| | | | | | | | | | | Ok, not really, but do support some common LISP functions: * car * cdr * null git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@71805 91177308-0d34-0410-b5e6-96231b3b80d8
* Implement a !foreach operator analogous to GNU make's $(foreach).David Greene2009-05-14
| | | | | | | | | | | | | | | 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."))>; git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@71803 91177308-0d34-0410-b5e6-96231b3b80d8
* Implement a !subst operation simmilar to $(subst) in GNU make to doDavid Greene2009-05-14
| | | | | | | | | | | | | | | | | 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>; git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@71801 91177308-0d34-0410-b5e6-96231b3b80d8
* Implement !cast.David Greene2009-05-14
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@71794 91177308-0d34-0410-b5e6-96231b3b80d8
* Operation EnhancementsDavid Greene2009-05-14
| | | | | | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@71789 91177308-0d34-0410-b5e6-96231b3b80d8
* Change forward declaration of MultiClass to use the "struct" keyword insteadBob Wilson2009-04-30
| | | | | | | of "class", so that it matches the subsequent definition. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@70498 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix multiclass inheritance to limit value resolution to new defs addedDavid Greene2009-04-24
| | | | | | | | by base multiclasses. Do not attempt to alter defs from previous base multiclasses. This fixes multiple multiclass inheritance. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@69974 91177308-0d34-0410-b5e6-96231b3b80d8
* Make BinOps typed and require a type specifier for !nameconcat. ThisDavid Greene2009-04-23
| | | | | | | | allows binops to be used in typed contexts such as when passing arguments to classes. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@69921 91177308-0d34-0410-b5e6-96231b3b80d8
* Implement !nameconcat to concatenate strings and look up the resultingDavid Greene2009-04-22
| | | | | | | name in the symbol table, returning an object. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@69822 91177308-0d34-0410-b5e6-96231b3b80d8
* Add support to tablegen for naming the nodes themselves, not just the operands, Nate Begeman2009-03-19
| | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@67286 91177308-0d34-0410-b5e6-96231b3b80d8
* Further constify Record::isSubClassOf.Ted Kremenek2009-03-13
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@66970 91177308-0d34-0410-b5e6-96231b3b80d8
* add a new TGError class and use it to propagate location info withChris Lattner2009-03-13
| | | | | | | | | | | | | | | | | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@66898 91177308-0d34-0410-b5e6-96231b3b80d8
* give each Record a location.Chris Lattner2009-03-13
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@66897 91177308-0d34-0410-b5e6-96231b3b80d8
* Unbreak LLVM on the MSVC compiler:Argyrios Kyrtzidis2008-10-22
| | | | | | | -Bring in int64_t for TableGen/Record.h and TableGen/TGLexer.h -Define strtoull git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@57970 91177308-0d34-0410-b5e6-96231b3b80d8
* Fun x86 encoding tricks: when adding an immediate value of 128,Dan Gohman2008-10-17
| | | | | | | | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@57663 91177308-0d34-0410-b5e6-96231b3b80d8
* lib/Target/SubtargetFeature.cpp asserts that the FeatureKV[] table be sorted Jim Grosbach2008-09-11
| | | | | | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56106 91177308-0d34-0410-b5e6-96231b3b80d8
* Stabilize 'getDwarfRegNumFull' output to not depend on random memory Chris Lattner2008-08-26
| | | | | | | orders, part of PR2590 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55359 91177308-0d34-0410-b5e6-96231b3b80d8
* Add explicit keywords.Dan Gohman2008-07-07
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53179 91177308-0d34-0410-b5e6-96231b3b80d8
* Add explicit keywords.Dan Gohman2008-03-25
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@48801 91177308-0d34-0410-b5e6-96231b3b80d8
* Add interator interface to DAGInit alsoAnton Korobeynikov2008-01-22
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46250 91177308-0d34-0410-b5e6-96231b3b80d8
* Provide iterator access to ListInit contentsAnton Korobeynikov2008-01-21
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46223 91177308-0d34-0410-b5e6-96231b3b80d8
* remove attributions from utils.Chris Lattner2007-12-29
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45419 91177308-0d34-0410-b5e6-96231b3b80d8
* change the Init print methods to return strings, and implement Chris Lattner2007-11-22
| | | | | | | print in terms of that. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44276 91177308-0d34-0410-b5e6-96231b3b80d8
* eliminate a bunch of print methods that are duplicate with the getAsString() ↵Chris Lattner2007-11-22
| | | | | | method. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44275 91177308-0d34-0410-b5e6-96231b3b80d8
* Add the ability to convert a tblgen type to a string.Chris Lattner2007-11-20
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44257 91177308-0d34-0410-b5e6-96231b3b80d8