OSDN Git Service

Add properties to ComplexPattern.
authorEvan Cheng <evan.cheng@apple.com>
Wed, 11 Oct 2006 21:03:53 +0000 (21:03 +0000)
committerEvan Cheng <evan.cheng@apple.com>
Wed, 11 Oct 2006 21:03:53 +0000 (21:03 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30891 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/ARM/ARMInstrInfo.td
lib/Target/PowerPC/PPCInstrInfo.td
lib/Target/Sparc/SparcInstrInfo.td
lib/Target/TargetSelectionDAG.td
lib/Target/X86/X86InstrInfo.td
lib/Target/X86/X86InstrX86-64.td

index 3281e97..9873e44 100644 (file)
@@ -27,12 +27,13 @@ def memri : Operand<iPTR> {
 
 // Define ARM specific addressing mode.
 //Addressing Mode 1: data processing operands
-def addr_mode1 : ComplexPattern<iPTR, 3, "SelectAddrMode1", [imm, sra, shl, srl]>;
+def addr_mode1 : ComplexPattern<iPTR, 3, "SelectAddrMode1", [imm, sra, shl, srl],
+                                []>;
 
 //register plus/minus 12 bit offset
-def iaddr  : ComplexPattern<iPTR, 2, "SelectAddrRegImm", [frameindex]>;
+def iaddr  : ComplexPattern<iPTR, 2, "SelectAddrRegImm", [frameindex], []>;
 //register plus scaled register
-//def raddr  : ComplexPattern<iPTR, 2, "SelectAddrRegReg", []>;
+//def raddr  : ComplexPattern<iPTR, 2, "SelectAddrRegReg", [], []>;
 
 //===----------------------------------------------------------------------===//
 // Instructions
index f346717..b044d77 100644 (file)
@@ -259,10 +259,10 @@ def memrix : Operand<iPTR> {   // memri where the imm is shifted 2 bits.
 }
 
 // Define PowerPC specific addressing mode.
-def iaddr  : ComplexPattern<iPTR, 2, "SelectAddrImm",    []>;
-def xaddr  : ComplexPattern<iPTR, 2, "SelectAddrIdx",    []>;
-def xoaddr : ComplexPattern<iPTR, 2, "SelectAddrIdxOnly",[]>;
-def ixaddr : ComplexPattern<iPTR, 2, "SelectAddrImmShift", []>; // "std"
+def iaddr  : ComplexPattern<iPTR, 2, "SelectAddrImm",    [], []>;
+def xaddr  : ComplexPattern<iPTR, 2, "SelectAddrIdx",    [], []>;
+def xoaddr : ComplexPattern<iPTR, 2, "SelectAddrIdxOnly",[], []>;
+def ixaddr : ComplexPattern<iPTR, 2, "SelectAddrImmShift", [], []>; // "std"
 
 //===----------------------------------------------------------------------===//
 // PowerPC Instruction Predicate Definitions.
index 6fc4481..713f0e5 100644 (file)
@@ -67,8 +67,8 @@ def SETHIimm : PatLeaf<(imm), [{
 }], HI22>;
 
 // Addressing modes.
-def ADDRrr : ComplexPattern<i32, 2, "SelectADDRrr", []>;
-def ADDRri : ComplexPattern<i32, 2, "SelectADDRri", [frameindex]>;
+def ADDRrr : ComplexPattern<i32, 2, "SelectADDRrr", [], []>;
+def ADDRri : ComplexPattern<i32, 2, "SelectADDRri", [frameindex], []>;
 
 // Address operands
 def MEMrr : Operand<i32> {
index bd2b2e5..778212e 100644 (file)
@@ -554,11 +554,13 @@ class Pat<dag pattern, dag result> : Pattern<pattern, [result]>;
 // RootNodes are the list of possible root nodes of the sub-dags to match.
 // e.g. X86 addressing mode - def addr : ComplexPattern<4, "SelectAddr", [add]>;
 //
-class ComplexPattern<ValueType ty, int numops, string fn, list<SDNode> roots = []> {
+class ComplexPattern<ValueType ty, int numops, string fn,
+                     list<SDNode> roots = [], list<SDNodeProperty> props = []> {
   ValueType Ty = ty;
   int NumOperands = numops;
   string SelectFunc = fn;
   list<SDNode> RootNodes = roots;
+  list<SDNodeProperty> Properties = props;
 }
 
 //===----------------------------------------------------------------------===//
index 27c8434..11c67bf 100644 (file)
@@ -135,9 +135,9 @@ def brtarget : Operand<OtherVT>;
 //
 
 // Define X86 specific addressing mode.
-def addr      : ComplexPattern<iPTR, 4, "SelectAddr", []>;
+def addr      : ComplexPattern<iPTR, 4, "SelectAddr", [], []>;
 def lea32addr : ComplexPattern<i32, 4, "SelectLEAAddr",
-                               [add, mul, shl, or, frameindex]>;
+                               [add, mul, shl, or, frameindex], []>;
 
 //===----------------------------------------------------------------------===//
 // X86 Instruction Format Definitions.
index db060e6..cd6ac5e 100644 (file)
@@ -38,7 +38,7 @@ def lea64_32mem : Operand<i32> {
 // Complex Pattern Definitions...
 //
 def lea64addr : ComplexPattern<i64, 4, "SelectLEAAddr",
-                               [add, mul, shl, or, frameindex, X86Wrapper]>;
+                               [add, mul, shl, or, frameindex, X86Wrapper], []>;
 
 //===----------------------------------------------------------------------===//
 // Instruction templates...