diff options
author | Evan Cheng <evan.cheng@apple.com> | 2005-12-14 22:02:59 +0000 |
---|---|---|
committer | Evan Cheng <evan.cheng@apple.com> | 2005-12-14 22:02:59 +0000 |
commit | 58e84a69f5d24ca7804bbbd5ee9c29df8584acb6 (patch) | |
tree | b43aff3bc3565ebaff8917a5e2980bd822d0bbbe /lib/Target | |
parent | 3bd5fac76f4fcc229d054ef46d5040de9abaa9f4 (diff) |
Added support to specify predicates.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24715 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target')
-rw-r--r-- | lib/Target/Target.td | 14 | ||||
-rw-r--r-- | lib/Target/TargetSelectionDAG.td | 5 |
2 files changed, 17 insertions, 2 deletions
diff --git a/lib/Target/Target.td b/lib/Target/Target.td index d4b83f4020..69b6baf28e 100644 --- a/lib/Target/Target.td +++ b/lib/Target/Target.td @@ -127,6 +127,7 @@ class RegisterClass<string namespace, list<ValueType> regTypes, int alignment, // include "../TargetSchedule.td" +class Predicate; // Forward def //===----------------------------------------------------------------------===// // Instruction set description - These classes correspond to the C++ classes in @@ -149,6 +150,10 @@ class Instruction { list<Register> Uses = []; // Default to using no non-operand registers list<Register> Defs = []; // Default to modifying no non-operand registers + // Predicates - List of predicates which will be turned into isel matching + // code. + list<Predicate> Predicates = []; + // These bits capture information about the high-level semantics of the // instruction. bit isReturn = 0; // Is this instruction a return instruction? @@ -168,6 +173,15 @@ class Instruction { InstrItinClass Itinerary; // Execution steps used for scheduling. } +/// Predicates - These are extra conditionals which are turned into instruction +/// selector matching code. Currently each predicate is just a string. +class Predicate<string cond> { + string CondString = cond; +} + +class Requires<list<Predicate> preds> { + list<Predicate> Predicates = preds; +} /// ops definition - This is just a simple marker used to identify the operands /// list for an instruction. This should be used like this: diff --git a/lib/Target/TargetSelectionDAG.td b/lib/Target/TargetSelectionDAG.td index 0a81078915..46fbd9f58a 100644 --- a/lib/Target/TargetSelectionDAG.td +++ b/lib/Target/TargetSelectionDAG.td @@ -382,8 +382,9 @@ def setne : PatFrag<(ops node:$lhs, node:$rhs), // class Pattern<dag patternToMatch, list<dag> resultInstrs> { - dag PatternToMatch = patternToMatch; - list<dag> ResultInstrs = resultInstrs; + dag PatternToMatch = patternToMatch; + list<dag> ResultInstrs = resultInstrs; + list<Predicate> Predicates = []; // See class Instruction in Target.td. } // Pat - A simple (but common) form of a pattern, which produces a simple result |