From e147ceb2fa377edb14c7977f16c92e2815ff25aa Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Sat, 3 Sep 2005 01:28:40 +0000 Subject: [PATCH] explicitly specify an operands list for patterns with inputs (e.g. neg) git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23240 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Target/PowerPC/PPCInstrInfo.td | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/lib/Target/PowerPC/PPCInstrInfo.td b/lib/Target/PowerPC/PPCInstrInfo.td index 3c82fd4b63a..30167698fb6 100644 --- a/lib/Target/PowerPC/PPCInstrInfo.td +++ b/lib/Target/PowerPC/PPCInstrInfo.td @@ -20,7 +20,7 @@ class SDNode { } def set; -def input; +def node; def imm : SDNode<"ISD::Constant", "ConstantSDNode">; def vt : SDNode<"ISD::VALUETYPE", "VTSDNode">; @@ -40,23 +40,28 @@ def ctlz : SDNode<"ISD::CTLZ">; /// PatFrag - Represents a pattern fragment. This can match something on the /// DAG, frame a single node to multiply nested other fragments. /// -class PatFrag { +class PatFrag { + dag Operands = ops; dag Fragment = frag; code Predicate = pred; } +class PatLeaf : PatFrag<(ops), frag, pred>; // Leaf fragments. -def immAllOnes : PatFrag<(imm), [{ return N->isAllOnesValue(); }]>; -def immZero : PatFrag<(imm), [{ return N->isNullValue(); }]>; +def immAllOnes : PatLeaf<(imm), [{ return N->isAllOnesValue(); }]>; +def immZero : PatLeaf<(imm), [{ return N->isNullValue(); }]>; -def vtInt : PatFrag<(vt), [{ return MVT::isInteger(N->getVT()); }]>; -def vtFP : PatFrag<(vt), [{ return MVT::isFloatingPoint(N->getVT()); }]>; +def vtInt : PatLeaf<(vt), [{ return MVT::isInteger(N->getVT()); }]>; +def vtFP : PatLeaf<(vt), [{ return MVT::isFloatingPoint(N->getVT()); }]>; // Other helper fragments. -def not : PatFrag<(xor input:$in, immAllOnes)>; -def ineg : PatFrag<(sub immZero, input:$in)>; +def not : PatFrag<(ops node:$in), (xor node:$in, immAllOnes)>; +def ineg : PatFrag<(ops node:$in), (sub immZero, node:$in)>; + + + class isPPC64 { bit PPC64 = 1; }