Commit Graph

156 Commits

Author SHA1 Message Date
David Greene
5f9f9ba00b 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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@71805 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-14 22:38:31 +00:00
David Greene
beb31a51f6 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."))>;


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@71803 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-14 22:23:47 +00:00
David Greene
4afc509b7f 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>;


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@71801 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-14 21:54:42 +00:00
David Greene
e6c27de069 Implement !cast.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@71794 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-14 21:22:49 +00:00
Dan Gohman
099672beef Use .td for tablegen files, not .ll.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@71277 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-08 23:01:28 +00:00
David Greene
065f259ff5 Allow multiclass def names to contain "#NAME"" where TableGen replaces
#NAME# with the name of the defm instantiating the multiclass.  This is
useful for AVX instruction naming where a "V" prefix is standard
throughout the ISA.  For example:

multiclass SSE_AVX_Inst<...> {
   def SS : Instr<...>;
   def SD : Instr<...>;
   def PS : Instr<...>;
   def PD : Instr<...>;

   def V#NAME#SS : Instr<...>;
   def V#NAME#SD : Instr<...>;
   def V#NAME#PS : Instr<...>;
   def V#NAME#PD : Instr<...>;
}

defm ADD : SSE_AVX_Inst<...>;

Results in 

ADDSS
ADDSD
ADDPS
ADDPD

VADDSS
VADDSD
VADDPS
VADDPD


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@70979 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-05 16:28:25 +00:00
David Greene
d34a73b3b7 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@69974 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-24 16:55:41 +00:00
David Greene
e8cf21e8e3 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@69921 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-23 21:25:15 +00:00
David Greene
5654613a01 Allow defm to inherit from multiple multiclasses.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@69832 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-22 22:17:51 +00:00
David Greene
c7cafcd815 Implement !nameconcat to concatenate strings and look up the resulting
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
2009-04-22 20:18:10 +00:00
David Greene
de444af6bb Implement multiclass inheritance.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@69810 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-22 16:42:54 +00:00
Chris Lattner
ea9f4df616 add support for a few simple escape characters in tblgen strings.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@66949 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-13 21:03:27 +00:00
Chris Lattner
d7a50cf28c implement support for C-style string literal concatenation in td files.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@66663 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-11 17:08:13 +00:00
Dan Gohman
63f97201dc 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@57663 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-17 01:33:43 +00:00
Matthijs Kooijman
1cd8f11cc0 For all RUN lines starting with "not", redirect stderr to /dev/null so tests
don't fail when (expected) error output is produced. This fixes 17 tests.

While I was there, I also made all RUN lines of the form "not llvm-as..." a bit
more consistent, they now all redirect stderr and stdout to /dev/null and use
input redirect to read their input.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52174 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-10 12:57:32 +00:00
Dan Gohman
6f0d024a53 Rename MRegisterInfo to TargetRegisterInfo.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46930 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-10 18:45:23 +00:00
Dan Gohman
28beeeac4d Convert tests using "| wc -l | grep ..." to use the count script.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@41097 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-15 13:36:28 +00:00
John Criswell
e644ef7b09 Convert .cvsignore files
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37801 91177308-0d34-0410-b5e6-96231b3b80d8
2007-06-29 16:35:07 +00:00
Reid Spencer
43b40035ba For PR1319:
Fix syntax of tests to ensure grep pattern is properly quoted.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36134 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-16 15:31:49 +00:00
Reid Spencer
a9338b6195 For PR1319: Upgrade to new test harness
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36070 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-15 10:26:05 +00:00
Reid Spencer
0f5aed5648 Make the llvm-runtest function much more amenable by eliminating all the
global variables that needed to be passed in. This makes it possible to
add new global variables with only a couple changes (Makefile and llvm-dg.exp)
instead of touching every single dg.exp file.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35918 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-11 19:56:59 +00:00
Chris Lattner
f187bab7bb add test for mdef in a let
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30886 91177308-0d34-0410-b5e6-96231b3b80d8
2006-10-11 18:12:14 +00:00
Chris Lattner
02982501a7 new testcase
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30471 91177308-0d34-0410-b5e6-96231b3b80d8
2006-09-18 22:28:07 +00:00
Chris Lattner
9595159451 Make this harder
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30036 91177308-0d34-0410-b5e6-96231b3b80d8
2006-09-01 22:07:00 +00:00
Chris Lattner
ef4e0c2827 simple multiclass example
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30028 91177308-0d34-0410-b5e6-96231b3b80d8
2006-09-01 21:14:37 +00:00
Tanya Lattner
9727555859 Added the ability to xfail based on llvmgcc version
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@27635 91177308-0d34-0410-b5e6-96231b3b80d8
2006-04-12 21:57:40 +00:00
Chris Lattner
fd2ae97ac3 new testcase
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@27311 91177308-0d34-0410-b5e6-96231b3b80d8
2006-03-31 21:53:01 +00:00
Chris Lattner
824b46f26f Dag operator should be able to be template params.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@27262 91177308-0d34-0410-b5e6-96231b3b80d8
2006-03-30 22:49:59 +00:00
Reid Spencer
2676f83776 Tired of wading through cvs's list ? files that are generated when building
with srcdir = objdir to see what's okay and what's cruft. So, in goes a
bunch of .cvsignore files to shut cvs up about known output from running
"make check".


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@27009 91177308-0d34-0410-b5e6-96231b3b80d8
2006-03-23 23:41:57 +00:00
Chris Lattner
5def058f38 new testcase
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25835 91177308-0d34-0410-b5e6-96231b3b80d8
2006-01-31 06:01:40 +00:00
Chris Lattner
46dab2cb0a Add a test that you can forward ref a class.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23547 91177308-0d34-0410-b5e6-96231b3b80d8
2005-09-30 04:52:43 +00:00
Chris Lattner
57a7db6cdb Check that we can refer to the same class we are defining.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23541 91177308-0d34-0410-b5e6-96231b3b80d8
2005-09-30 04:10:17 +00:00
Chris Lattner
d0d1d39541 x and X should be structurally identical
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23273 91177308-0d34-0410-b5e6-96231b3b80d8
2005-09-08 18:47:43 +00:00
Chris Lattner
5838b21cde new testcase: tblgen should grok this.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23247 91177308-0d34-0410-b5e6-96231b3b80d8
2005-09-06 21:22:15 +00:00
John Criswell
f13c334536 Tell tblgen exactly where to find the include file.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21822 91177308-0d34-0410-b5e6-96231b3b80d8
2005-05-09 19:32:08 +00:00
Chris Lattner
6b43c82378 New testcase for a changing values late and allowing them to propagate
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21343 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-19 03:34:58 +00:00
Chris Lattner
93fc714b1d Make this significantly harder
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21342 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-19 02:58:57 +00:00
Chris Lattner
c6f4fab8e0 Add a real run line
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21341 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-19 02:53:26 +00:00
Chris Lattner
913418a80c fix this testcase
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21340 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-19 02:52:04 +00:00
Chris Lattner
ac9196093e new testcase
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21339 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-19 02:26:23 +00:00
Chris Lattner
8287bbbb79 add a run line
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21338 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-19 01:37:24 +00:00
Chris Lattner
2347f28cf5 Tell dj to run the tests in this directory
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21337 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-19 01:36:41 +00:00
Tanya Lattner
c8c1f12778 Adding srcdir arg
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18020 91177308-0d34-0410-b5e6-96231b3b80d8
2004-11-19 22:45:25 +00:00
Tanya Lattner
28b372f1d3 Adding subdirectory dg.exp files in order to be able to use dejagnu to only run specific tests (located in some subdirectory of Regression)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17712 91177308-0d34-0410-b5e6-96231b3b80d8
2004-11-13 23:00:45 +00:00
Chris Lattner
3aa965fbf4 New testcase for list slicing
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15248 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-27 01:00:56 +00:00
Chris Lattner
002f29b0f0 Codify my thoughts on where we want to end up with the target-independent
code generator.  Comments welcome.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15205 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-25 12:13:35 +00:00
Chris Lattner
eb7d6d016e fix a bug in the testcase
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11949 91177308-0d34-0410-b5e6-96231b3b80d8
2004-02-28 17:33:21 +00:00
Chris Lattner
7b6ee7d8f1 new testcase for a tblgen bug that alkis ran into
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11947 91177308-0d34-0410-b5e6-96231b3b80d8
2004-02-28 16:43:44 +00:00
John Criswell
473741930e Removing Makefiles. Regression tests are now run by QMTest.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8548 91177308-0d34-0410-b5e6-96231b3b80d8
2003-09-15 20:21:38 +00:00
Chris Lattner
a4a53a5b93 New testcase
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7711 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-10 22:02:44 +00:00
Chris Lattner
7c1af88b8e New testcase
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7575 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-04 20:43:48 +00:00
Chris Lattner
83a913d4ef New testcase
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7560 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-04 04:53:13 +00:00
Chris Lattner
a6aff650e8 New testcase
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7525 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-03 18:28:09 +00:00
Chris Lattner
49136e123d New testcase
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7517 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-03 17:47:52 +00:00
Chris Lattner
dfe9a70c66 Add test of file inclusion capability for bugpoint
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7435 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-30 20:55:37 +00:00
Chris Lattner
35c7444e52 Initial tests for tblgen
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7430 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-30 19:40:00 +00:00