From jlaskey at apple.com Mon Oct 17 07:19:27 2005 From: jlaskey at apple.com (Jim Laskey) Date: Mon, 17 Oct 2005 07:19:27 -0500 Subject: [llvm-commits] CVS: llvm/docs/CodeGenerator.html Message-ID: <200510171219.HAA20638@zion.cs.uiuc.edu> Changes in directory llvm/docs: CodeGenerator.html updated: 1.25 -> 1.26 --- Log message: As requested, a blurb on sub-targets. --- Diffs of the changes: (+6 -2) CodeGenerator.html | 8 ++++++-- 1 files changed, 6 insertions(+), 2 deletions(-) Index: llvm/docs/CodeGenerator.html diff -u llvm/docs/CodeGenerator.html:1.25 llvm/docs/CodeGenerator.html:1.26 --- llvm/docs/CodeGenerator.html:1.25 Sun Oct 16 23:18:41 2005 +++ llvm/docs/CodeGenerator.html Mon Oct 17 07:19:10 2005 @@ -444,7 +444,11 @@

- TODO +

The TargetSubtarget class is used to provide information about the + specific chip set being targeted. A sub-target informs code generation of + which instructions are supported, instruction latencies and instruction + execution itinerary; i.e., which processing units are used, in what order, and + for how long.

@@ -1293,7 +1297,7 @@ Chris Lattner
The LLVM Compiler Infrastructure
- Last modified: $Date: 2005/10/17 04:18:41 $ + Last modified: $Date: 2005/10/17 12:19:10 $ From lattner at cs.uiuc.edu Mon Oct 17 10:19:41 2005 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Mon, 17 Oct 2005 10:19:41 -0500 Subject: [llvm-commits] CVS: llvm/docs/CodeGenerator.html Message-ID: <200510171519.KAA23919@zion.cs.uiuc.edu> Changes in directory llvm/docs: CodeGenerator.html updated: 1.26 -> 1.27 --- Log message: Apparently, people object to floating pointers. Picky picky. --- Diffs of the changes: (+2 -2) CodeGenerator.html | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) Index: llvm/docs/CodeGenerator.html diff -u llvm/docs/CodeGenerator.html:1.26 llvm/docs/CodeGenerator.html:1.27 --- llvm/docs/CodeGenerator.html:1.26 Mon Oct 17 07:19:10 2005 +++ llvm/docs/CodeGenerator.html Mon Oct 17 10:19:24 2005 @@ -989,7 +989,7 @@ (fadd:f32 (fmul:f32 (fadd:f32 W, X), Y), Z) -

If a target supports floating pointer multiply-and-add (FMA) operations, one +

If a target supports floating point multiply-and-add (FMA) operations, one of the adds can be merged with the multiply. On the PowerPC, for example, the output of the instruction selector might look like this DAG:

@@ -1297,7 +1297,7 @@ Chris Lattner
The LLVM Compiler Infrastructure
- Last modified: $Date: 2005/10/17 12:19:10 $ + Last modified: $Date: 2005/10/17 15:19:24 $ From lattner at cs.uiuc.edu Mon Oct 17 12:49:44 2005 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Mon, 17 Oct 2005 12:49:44 -0500 Subject: [llvm-commits] CVS: llvm/lib/Transforms/Scalar/InstructionCombining.cpp Message-ID: <200510171749.MAA26037@zion.cs.uiuc.edu> Changes in directory llvm/lib/Transforms/Scalar: InstructionCombining.cpp updated: 1.385 -> 1.386 --- Log message: relax this a bit, as we only support the default rounding mode --- Diffs of the changes: (+4 -2) InstructionCombining.cpp | 6 ++++-- 1 files changed, 4 insertions(+), 2 deletions(-) Index: llvm/lib/Transforms/Scalar/InstructionCombining.cpp diff -u llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.385 llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.386 --- llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.385 Sun Oct 9 17:08:50 2005 +++ llvm/lib/Transforms/Scalar/InstructionCombining.cpp Mon Oct 17 12:49:32 2005 @@ -694,8 +694,10 @@ return ReplaceInstUsesWith(I, RHS); // X + 0 --> X - if (!I.getType()->isFloatingPoint() && // -0 + +0 = +0, so it's not a noop - RHSC->isNullValue()) + // NOTE: -0 + +0 = +0 in non-default rounding modes. When we support them + // we must disable this. Note that 0.0-0.0 = -0.0, so this doesn't hold + // for SUB. + if (RHSC->isNullValue()) return ReplaceInstUsesWith(I, LHS); // X + (signbit) --> X ^ signbit From lattner at cs.uiuc.edu Mon Oct 17 12:56:49 2005 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Mon, 17 Oct 2005 12:56:49 -0500 Subject: [llvm-commits] CVS: llvm/lib/Transforms/Scalar/InstructionCombining.cpp Message-ID: <200510171756.MAA26322@zion.cs.uiuc.edu> Changes in directory llvm/lib/Transforms/Scalar: InstructionCombining.cpp updated: 1.386 -> 1.387 --- Log message: Oops, X+0.0 isn't foldable, but X+-0.0 is. --- Diffs of the changes: (+5 -4) InstructionCombining.cpp | 9 +++++---- 1 files changed, 5 insertions(+), 4 deletions(-) Index: llvm/lib/Transforms/Scalar/InstructionCombining.cpp diff -u llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.386 llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.387 --- llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.386 Mon Oct 17 12:49:32 2005 +++ llvm/lib/Transforms/Scalar/InstructionCombining.cpp Mon Oct 17 12:56:38 2005 @@ -694,11 +694,12 @@ return ReplaceInstUsesWith(I, RHS); // X + 0 --> X - // NOTE: -0 + +0 = +0 in non-default rounding modes. When we support them - // we must disable this. Note that 0.0-0.0 = -0.0, so this doesn't hold - // for SUB. - if (RHSC->isNullValue()) + if (!I.getType()->isFloatingPoint()) { // NOTE: -0 + +0 = +0. + if (RHSC->isNullValue()) + return ReplaceInstUsesWith(I, LHS); + } else if (cast(RHSC)->isExactlyValue(-0.0)) { return ReplaceInstUsesWith(I, LHS); + } // X + (signbit) --> X ^ signbit if (ConstantInt *CI = dyn_cast(RHSC)) { From lattner at cs.uiuc.edu Mon Oct 17 15:18:49 2005 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Mon, 17 Oct 2005 15:18:49 -0500 Subject: [llvm-commits] CVS: llvm/lib/Transforms/Scalar/InstructionCombining.cpp Message-ID: <200510172018.PAA28240@zion.cs.uiuc.edu> Changes in directory llvm/lib/Transforms/Scalar: InstructionCombining.cpp updated: 1.387 -> 1.388 --- Log message: Make this work for FP constantexprs --- Diffs of the changes: (+3 -2) InstructionCombining.cpp | 5 +++-- 1 files changed, 3 insertions(+), 2 deletions(-) Index: llvm/lib/Transforms/Scalar/InstructionCombining.cpp diff -u llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.387 llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.388 --- llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.387 Mon Oct 17 12:56:38 2005 +++ llvm/lib/Transforms/Scalar/InstructionCombining.cpp Mon Oct 17 15:18:38 2005 @@ -697,8 +697,9 @@ if (!I.getType()->isFloatingPoint()) { // NOTE: -0 + +0 = +0. if (RHSC->isNullValue()) return ReplaceInstUsesWith(I, LHS); - } else if (cast(RHSC)->isExactlyValue(-0.0)) { - return ReplaceInstUsesWith(I, LHS); + } else if (ConstantFP *CFP = dyn_cast(RHSC)) { + if (CFP->isExactlyValue(-0.0)) + return ReplaceInstUsesWith(I, LHS); } // X + (signbit) --> X ^ signbit From natebegeman at mac.com Mon Oct 17 15:40:22 2005 From: natebegeman at mac.com (Nate Begeman) Date: Mon, 17 Oct 2005 15:40:22 -0500 Subject: [llvm-commits] CVS: llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp Message-ID: <200510172040.PAA04592@zion.cs.uiuc.edu> Changes in directory llvm/lib/CodeGen/SelectionDAG: DAGCombiner.cpp updated: 1.44 -> 1.45 --- Log message: fold fmul X, +2.0 -> fadd X, X; --- Diffs of the changes: (+17 -14) DAGCombiner.cpp | 31 +++++++++++++++++-------------- 1 files changed, 17 insertions(+), 14 deletions(-) Index: llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp diff -u llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp:1.44 llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp:1.45 --- llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp:1.44 Sun Oct 16 20:07:11 2005 +++ llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp Mon Oct 17 15:40:11 2005 @@ -1464,8 +1464,7 @@ if (ConstantFPSDNode *N0CFP = dyn_cast(N0)) if (ConstantFPSDNode *N1CFP = dyn_cast(N1)) { // fold floating point (fadd c1, c2) - return DAG.getConstantFP(N0CFP->getValue() + N1CFP->getValue(), - N->getValueType(0)); + return DAG.getConstantFP(N0CFP->getValue() + N1CFP->getValue(), VT); } // fold (A + (-B)) -> A-B if (N1.getOpcode() == ISD::FNEG) @@ -1486,8 +1485,7 @@ if (ConstantFPSDNode *N0CFP = dyn_cast(N0)) if (ConstantFPSDNode *N1CFP = dyn_cast(N1)) { // fold floating point (fsub c1, c2) - return DAG.getConstantFP(N0CFP->getValue() - N1CFP->getValue(), - N->getValueType(0)); + return DAG.getConstantFP(N0CFP->getValue() - N1CFP->getValue(), VT); } // fold (A-(-B)) -> A+B if (N1.getOpcode() == ISD::FNEG) @@ -1499,14 +1497,21 @@ SDOperand DAGCombiner::visitFMUL(SDNode *N) { SDOperand N0 = N->getOperand(0); SDOperand N1 = N->getOperand(1); + ConstantFPSDNode *N0CFP = dyn_cast(N0); + ConstantFPSDNode *N1CFP = dyn_cast(N1); MVT::ValueType VT = N->getValueType(0); - if (ConstantFPSDNode *N0CFP = dyn_cast(N0)) - if (ConstantFPSDNode *N1CFP = dyn_cast(N1)) { - // fold floating point (fmul c1, c2) - return DAG.getConstantFP(N0CFP->getValue() * N1CFP->getValue(), - N->getValueType(0)); - } + // fold (fmul c1, c2) -> c1*c2 + if (N0CFP && N1CFP) + return DAG.getConstantFP(N0CFP->getValue() * N1CFP->getValue(), VT); + // canonicalize constant to RHS + if (N0CFP && !N1CFP) { + std::swap(N0, N1); + std::swap(N0CFP, N1CFP); + } + // fold (fmul X, 2.0) -> (fadd X, X) + if (N1CFP && N1CFP->isExactlyValue(+2.0)) + return DAG.getNode(ISD::FADD, VT, N0, N0); return SDOperand(); } @@ -1518,8 +1523,7 @@ if (ConstantFPSDNode *N0CFP = dyn_cast(N0)) if (ConstantFPSDNode *N1CFP = dyn_cast(N1)) { // fold floating point (fdiv c1, c2) - return DAG.getConstantFP(N0CFP->getValue() / N1CFP->getValue(), - N->getValueType(0)); + return DAG.getConstantFP(N0CFP->getValue() / N1CFP->getValue(), VT); } return SDOperand(); } @@ -1532,8 +1536,7 @@ if (ConstantFPSDNode *N0CFP = dyn_cast(N0)) if (ConstantFPSDNode *N1CFP = dyn_cast(N1)) { // fold floating point (frem c1, c2) -> fmod(c1, c2) - return DAG.getConstantFP(fmod(N0CFP->getValue(),N1CFP->getValue()), - N->getValueType(0)); + return DAG.getConstantFP(fmod(N0CFP->getValue(),N1CFP->getValue()), VT); } return SDOperand(); } From criswell at cs.uiuc.edu Mon Oct 17 16:54:38 2005 From: criswell at cs.uiuc.edu (John Criswell) Date: Mon, 17 Oct 2005 16:54:38 -0500 Subject: [llvm-commits] CVS: llvm/test/Regression/CodeGen/PowerPC/constants.ll mulhs.ll rlwimi.ll rlwimi2.ll rlwinm.ll Message-ID: <200510172154.QAA17440@choi.cs.uiuc.edu> Changes in directory llvm/test/Regression/CodeGen/PowerPC: constants.ll updated: 1.3 -> 1.4 mulhs.ll updated: 1.1 -> 1.2 rlwimi.ll updated: 1.3 -> 1.4 rlwimi2.ll updated: 1.1 -> 1.2 rlwinm.ll updated: 1.3 -> 1.4 --- Log message: Use %s instead of hard coding the input filename. This allows the test to work when srcdir != objdir. --- Diffs of the changes: (+17 -17) constants.ll | 6 +++--- mulhs.ll | 8 ++++---- rlwimi.ll | 4 ++-- rlwimi2.ll | 6 +++--- rlwinm.ll | 10 +++++----- 5 files changed, 17 insertions(+), 17 deletions(-) Index: llvm/test/Regression/CodeGen/PowerPC/constants.ll diff -u llvm/test/Regression/CodeGen/PowerPC/constants.ll:1.3 llvm/test/Regression/CodeGen/PowerPC/constants.ll:1.4 --- llvm/test/Regression/CodeGen/PowerPC/constants.ll:1.3 Thu Aug 18 15:06:09 2005 +++ llvm/test/Regression/CodeGen/PowerPC/constants.ll Mon Oct 17 16:54:18 2005 @@ -1,7 +1,7 @@ ; All of these routines should be perform optimal load of constants. -; RUN: llvm-as < constants.ll | llc -march=ppc32 | grep lis | wc -l | grep 5 && -; RUN: llvm-as < constants.ll | llc -march=ppc32 | grep ori | wc -l | grep 3 && -; RUN: llvm-as < constants.ll | llc -march=ppc32 | grep 'li ' | wc -l | grep 4 +; RUN: llvm-as < %s | llc -march=ppc32 | grep lis | wc -l | grep 5 && +; RUN: llvm-as < %s | llc -march=ppc32 | grep ori | wc -l | grep 3 && +; RUN: llvm-as < %s | llc -march=ppc32 | grep 'li ' | wc -l | grep 4 implementation ; Functions: Index: llvm/test/Regression/CodeGen/PowerPC/mulhs.ll diff -u llvm/test/Regression/CodeGen/PowerPC/mulhs.ll:1.1 llvm/test/Regression/CodeGen/PowerPC/mulhs.ll:1.2 --- llvm/test/Regression/CodeGen/PowerPC/mulhs.ll:1.1 Wed Aug 31 19:04:03 2005 +++ llvm/test/Regression/CodeGen/PowerPC/mulhs.ll Mon Oct 17 16:54:18 2005 @@ -1,8 +1,8 @@ ; All of these ands and shifts should be folded into rlwimi's -; RUN: llvm-as < mulhs.ll | llc -march=ppc32 | not grep mulhwu && -; RUN: llvm-as < mulhs.ll | llc -march=ppc32 | not grep srawi && -; RUN: llvm-as < mulhs.ll | llc -march=ppc32 | not grep add && -; RUN: llvm-as < mulhs.ll | llc -march=ppc32 | grep mulhw | wc -l | grep 1 +; RUN: llvm-as < %s | llc -march=ppc32 | not grep mulhwu && +; RUN: llvm-as < %s | llc -march=ppc32 | not grep srawi && +; RUN: llvm-as < %s | llc -march=ppc32 | not grep add && +; RUN: llvm-as < %s | llc -march=ppc32 | grep mulhw | wc -l | grep 1 implementation ; Functions: Index: llvm/test/Regression/CodeGen/PowerPC/rlwimi.ll diff -u llvm/test/Regression/CodeGen/PowerPC/rlwimi.ll:1.3 llvm/test/Regression/CodeGen/PowerPC/rlwimi.ll:1.4 --- llvm/test/Regression/CodeGen/PowerPC/rlwimi.ll:1.3 Wed Aug 3 13:11:23 2005 +++ llvm/test/Regression/CodeGen/PowerPC/rlwimi.ll Mon Oct 17 16:54:18 2005 @@ -1,6 +1,6 @@ ; All of these ands and shifts should be folded into rlwimi's -; RUN: llvm-as < rlwimi.ll | llc -march=ppc32 | not grep and && -; RUN: llvm-as < rlwimi.ll | llc -march=ppc32 | grep rlwimi | wc -l | grep 8 +; RUN: llvm-as < %s | llc -march=ppc32 | not grep and && +; RUN: llvm-as < %s | llc -march=ppc32 | grep rlwimi | wc -l | grep 8 implementation ; Functions: Index: llvm/test/Regression/CodeGen/PowerPC/rlwimi2.ll diff -u llvm/test/Regression/CodeGen/PowerPC/rlwimi2.ll:1.1 llvm/test/Regression/CodeGen/PowerPC/rlwimi2.ll:1.2 --- llvm/test/Regression/CodeGen/PowerPC/rlwimi2.ll:1.1 Wed Aug 3 13:11:23 2005 +++ llvm/test/Regression/CodeGen/PowerPC/rlwimi2.ll Mon Oct 17 16:54:18 2005 @@ -1,7 +1,7 @@ ; All of these ands and shifts should be folded into rlwimi's -; RUN: llvm-as < rlwimi2.ll | llc -march=ppc32 | grep rlwimi | wc -l | grep 3 && -; RUN: llvm-as < rlwimi2.ll | llc -march=ppc32 | grep srwi | wc -l | grep 1 && -; RUN: llvm-as < rlwimi2.ll | llc -march=ppc32 | not grep slwi +; RUN: llvm-as < %s | llc -march=ppc32 | grep rlwimi | wc -l | grep 3 && +; RUN: llvm-as < %s | llc -march=ppc32 | grep srwi | wc -l | grep 1 && +; RUN: llvm-as < %s | llc -march=ppc32 | not grep slwi implementation ; Functions: Index: llvm/test/Regression/CodeGen/PowerPC/rlwinm.ll diff -u llvm/test/Regression/CodeGen/PowerPC/rlwinm.ll:1.3 llvm/test/Regression/CodeGen/PowerPC/rlwinm.ll:1.4 --- llvm/test/Regression/CodeGen/PowerPC/rlwinm.ll:1.3 Thu Aug 11 16:59:23 2005 +++ llvm/test/Regression/CodeGen/PowerPC/rlwinm.ll Mon Oct 17 16:54:18 2005 @@ -1,9 +1,9 @@ ; All of these ands and shifts should be folded into rlwimi's -; RUN: llvm-as < rlwinm.ll | llc -march=ppc32 | not grep and && -; RUN: llvm-as < rlwinm.ll | llc -march=ppc32 | not grep srawi && -; RUN: llvm-as < rlwinm.ll | llc -march=ppc32 | not grep srwi && -; RUN: llvm-as < rlwinm.ll | llc -march=ppc32 | not grep slwi && -; RUN: llvm-as < rlwinm.ll | llc -march=ppc32 | grep rlwinm | wc -l | grep 8 +; RUN: llvm-as < %s | llc -march=ppc32 | not grep and && +; RUN: llvm-as < %s | llc -march=ppc32 | not grep srawi && +; RUN: llvm-as < %s | llc -march=ppc32 | not grep srwi && +; RUN: llvm-as < %s | llc -march=ppc32 | not grep slwi && +; RUN: llvm-as < %s | llc -march=ppc32 | grep rlwinm | wc -l | grep 8 implementation ; Functions: From natebegeman at mac.com Mon Oct 17 19:27:53 2005 From: natebegeman at mac.com (Nate Begeman) Date: Mon, 17 Oct 2005 19:27:53 -0500 Subject: [llvm-commits] CVS: llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp Message-ID: <200510180027.TAA05500@zion.cs.uiuc.edu> Changes in directory llvm/lib/CodeGen/SelectionDAG: LegalizeDAG.cpp updated: 1.200 -> 1.201 --- Log message: Legalize BUILD_PAIR appropriately for upcoming 64 bit PowerPC work. --- Diffs of the changes: (+25 -0) LegalizeDAG.cpp | 25 +++++++++++++++++++++++++ 1 files changed, 25 insertions(+) Index: llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp diff -u llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp:1.200 llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp:1.201 --- llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp:1.200 Sat Oct 15 15:24:07 2005 +++ llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp Mon Oct 17 19:27:41 2005 @@ -1605,6 +1605,31 @@ Result = DAG.getNode(Node->getOpcode(), Node->getValueType(0), Tmp1,Tmp2); break; + case ISD::BUILD_PAIR: { + MVT::ValueType PairTy = Node->getValueType(0); + // TODO: handle the case where the Lo and Hi operands are not of legal type + Tmp1 = LegalizeOp(Node->getOperand(0)); // Lo + Tmp2 = LegalizeOp(Node->getOperand(1)); // Hi + switch (TLI.getOperationAction(ISD::BUILD_PAIR, PairTy)) { + case TargetLowering::Legal: + if (Tmp1 != Node->getOperand(0) || Tmp2 != Node->getOperand(1)) + Result = DAG.getNode(ISD::BUILD_PAIR, PairTy, Tmp1, Tmp2); + break; + case TargetLowering::Promote: + case TargetLowering::Custom: + assert(0 && "Cannot promote/custom this yet!"); + case TargetLowering::Expand: + Tmp1 = DAG.getNode(ISD::ZERO_EXTEND, PairTy, Tmp1); + Tmp2 = DAG.getNode(ISD::ANY_EXTEND, PairTy, Tmp2); + Tmp2 = DAG.getNode(ISD::SHL, PairTy, Tmp2, + DAG.getConstant(MVT::getSizeInBits(PairTy)/2, + TLI.getShiftAmountTy())); + Result = LegalizeOp(DAG.getNode(ISD::OR, PairTy, Tmp1, Tmp2)); + break; + } + break; + } + case ISD::UREM: case ISD::SREM: case ISD::FREM: From natebegeman at mac.com Mon Oct 17 19:28:24 2005 From: natebegeman at mac.com (Nate Begeman) Date: Mon, 17 Oct 2005 19:28:24 -0500 Subject: [llvm-commits] CVS: llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp Message-ID: <200510180028.TAA05516@zion.cs.uiuc.edu> Changes in directory llvm/lib/CodeGen/SelectionDAG: DAGCombiner.cpp updated: 1.45 -> 1.46 --- Log message: Implement some feedback from Chris re: constant canonicalization --- Diffs of the changes: (+27 -39) DAGCombiner.cpp | 66 ++++++++++++++++++++++---------------------------------- 1 files changed, 27 insertions(+), 39 deletions(-) Index: llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp diff -u llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp:1.45 llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp:1.46 --- llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp:1.45 Mon Oct 17 15:40:11 2005 +++ llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp Mon Oct 17 19:28:13 2005 @@ -494,10 +494,8 @@ if (N0C && N1C) return DAG.getConstant(N0C->getValue() + N1C->getValue(), VT); // canonicalize constant to RHS - if (N0C && !N1C) { - std::swap(N0, N1); - std::swap(N0C, N1C); - } + if (N0C && !N1C) + return DAG.getNode(ISD::ADD, VT, N1, N0); // fold (add x, 0) -> x if (N1C && N1C->isNullValue()) return N0; @@ -566,10 +564,8 @@ return DAG.getConstant(N0C->getValue() * N1C->getValue(), N->getValueType(0)); // canonicalize constant to RHS - if (N0C && !N1C) { - std::swap(N0, N1); - std::swap(N0C, N1C); - } + if (N0C && !N1C) + return DAG.getNode(ISD::MUL, VT, N1, N0); // fold (mul x, 0) -> 0 if (N1C && N1C->isNullValue()) return N1; @@ -714,10 +710,8 @@ if (N0C && N1C) return DAG.getConstant(N0C->getValue() & N1C->getValue(), VT); // canonicalize constant to RHS - if (N0C && !N1C) { - std::swap(N0, N1); - std::swap(N0C, N1C); - } + if (N0C && !N1C) + return DAG.getNode(ISD::AND, VT, N1, N0); // fold (and x, -1) -> x if (N1C && N1C->isAllOnesValue()) return N0; @@ -868,10 +862,8 @@ return DAG.getConstant(N0C->getValue() | N1C->getValue(), N->getValueType(0)); // canonicalize constant to RHS - if (N0C && !N1C) { - std::swap(N0, N1); - std::swap(N0C, N1C); - } + if (N0C && !N1C) + return DAG.getNode(ISD::OR, VT, N1, N0); // fold (or x, 0) -> x if (N1C && N1C->isNullValue()) return N0; @@ -953,10 +945,8 @@ if (N0C && N1C) return DAG.getConstant(N0C->getValue() ^ N1C->getValue(), VT); // canonicalize constant to RHS - if (N0C && !N1C) { - std::swap(N0, N1); - std::swap(N0C, N1C); - } + if (N0C && !N1C) + return DAG.getNode(ISD::XOR, VT, N1, N0); // fold (xor x, 0) -> x if (N1C && N1C->isNullValue()) return N0; @@ -1459,38 +1449,38 @@ SDOperand DAGCombiner::visitFADD(SDNode *N) { SDOperand N0 = N->getOperand(0); SDOperand N1 = N->getOperand(1); + ConstantFPSDNode *N0CFP = dyn_cast(N0); + ConstantFPSDNode *N1CFP = dyn_cast(N1); MVT::ValueType VT = N->getValueType(0); - - if (ConstantFPSDNode *N0CFP = dyn_cast(N0)) - if (ConstantFPSDNode *N1CFP = dyn_cast(N1)) { - // fold floating point (fadd c1, c2) - return DAG.getConstantFP(N0CFP->getValue() + N1CFP->getValue(), VT); - } + + // fold (fadd c1, c2) -> c1+c2 + if (N0CFP && N1CFP) + return DAG.getConstantFP(N0CFP->getValue() + N1CFP->getValue(), VT); + // canonicalize constant to RHS + if (N0CFP && !N1CFP) + return DAG.getNode(ISD::FADD, VT, N1, N0); // fold (A + (-B)) -> A-B if (N1.getOpcode() == ISD::FNEG) return DAG.getNode(ISD::FSUB, VT, N0, N1.getOperand(0)); - // fold ((-A) + B) -> B-A if (N0.getOpcode() == ISD::FNEG) return DAG.getNode(ISD::FSUB, VT, N1, N0.getOperand(0)); - return SDOperand(); } SDOperand DAGCombiner::visitFSUB(SDNode *N) { SDOperand N0 = N->getOperand(0); SDOperand N1 = N->getOperand(1); + ConstantFPSDNode *N0CFP = dyn_cast(N0); + ConstantFPSDNode *N1CFP = dyn_cast(N1); MVT::ValueType VT = N->getValueType(0); - - if (ConstantFPSDNode *N0CFP = dyn_cast(N0)) - if (ConstantFPSDNode *N1CFP = dyn_cast(N1)) { - // fold floating point (fsub c1, c2) - return DAG.getConstantFP(N0CFP->getValue() - N1CFP->getValue(), VT); - } + + // fold (fsub c1, c2) -> c1-c2 + if (N0CFP && N1CFP) + return DAG.getConstantFP(N0CFP->getValue() - N1CFP->getValue(), VT); // fold (A-(-B)) -> A+B if (N1.getOpcode() == ISD::FNEG) return DAG.getNode(ISD::FADD, N0.getValueType(), N0, N1.getOperand(0)); - return SDOperand(); } @@ -1505,10 +1495,8 @@ if (N0CFP && N1CFP) return DAG.getConstantFP(N0CFP->getValue() * N1CFP->getValue(), VT); // canonicalize constant to RHS - if (N0CFP && !N1CFP) { - std::swap(N0, N1); - std::swap(N0CFP, N1CFP); - } + if (N0CFP && !N1CFP) + return DAG.getNode(ISD::FMUL, VT, N1, N0); // fold (fmul X, 2.0) -> (fadd X, X) if (N1CFP && N1CFP->isExactlyValue(+2.0)) return DAG.getNode(ISD::FADD, VT, N0, N0); From natebegeman at mac.com Mon Oct 17 19:29:09 2005 From: natebegeman at mac.com (Nate Begeman) Date: Mon, 17 Oct 2005 19:29:09 -0500 Subject: [llvm-commits] CVS: llvm/lib/Target/PowerPC/PPC.h PPCISelDAGToDAG.cpp PPCISelLowering.cpp PPCISelPattern.cpp PPCInstrInfo.cpp PPCInstrInfo.td PPCRegisterInfo.cpp PPCRegisterInfo.td PPCTargetMachine.cpp Message-ID: <200510180029.TAA05544@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/PowerPC: PPC.h updated: 1.22 -> 1.23 PPCISelDAGToDAG.cpp updated: 1.107 -> 1.108 PPCISelLowering.cpp updated: 1.31 -> 1.32 PPCISelPattern.cpp updated: 1.189 -> 1.190 PPCInstrInfo.cpp updated: 1.11 -> 1.12 PPCInstrInfo.td updated: 1.122 -> 1.123 PPCRegisterInfo.cpp updated: 1.34 -> 1.35 PPCRegisterInfo.td updated: 1.17 -> 1.18 PPCTargetMachine.cpp updated: 1.74 -> 1.75 --- Log message: First bits of 64 bit PowerPC stuff, currently disabled. A lot of this is purely mechanical. --- Diffs of the changes: (+154 -88) PPC.h | 4 ++-- PPCISelDAGToDAG.cpp | 51 +++++++++++++++++++++++++++++---------------------- PPCISelLowering.cpp | 43 ++++++++++++++++++++++++++----------------- PPCISelPattern.cpp | 34 +++++++++++++++++----------------- PPCInstrInfo.cpp | 2 +- PPCInstrInfo.td | 17 +++++++++++++---- PPCRegisterInfo.cpp | 50 +++++++++++++++++++++++++++++++++----------------- PPCRegisterInfo.td | 33 +++++++++++++++++++++++++++++---- PPCTargetMachine.cpp | 8 ++++---- 9 files changed, 154 insertions(+), 88 deletions(-) Index: llvm/lib/Target/PowerPC/PPC.h diff -u llvm/lib/Target/PowerPC/PPC.h:1.22 llvm/lib/Target/PowerPC/PPC.h:1.23 --- llvm/lib/Target/PowerPC/PPC.h:1.22 Fri Oct 14 18:37:35 2005 +++ llvm/lib/Target/PowerPC/PPC.h Mon Oct 17 19:28:58 2005 @@ -27,8 +27,8 @@ }; FunctionPass *createPPCBranchSelectionPass(); -FunctionPass *createPPC32ISelPattern(TargetMachine &TM); -FunctionPass *createPPC32ISelDag(TargetMachine &TM); +FunctionPass *createPPCISelPattern(TargetMachine &TM); +FunctionPass *createPPCISelDag(TargetMachine &TM); FunctionPass *createDarwinAsmPrinter(std::ostream &OS, TargetMachine &TM); FunctionPass *createAIXAsmPrinter(std::ostream &OS, TargetMachine &TM); Index: llvm/lib/Target/PowerPC/PPCISelDAGToDAG.cpp diff -u llvm/lib/Target/PowerPC/PPCISelDAGToDAG.cpp:1.107 llvm/lib/Target/PowerPC/PPCISelDAGToDAG.cpp:1.108 --- llvm/lib/Target/PowerPC/PPCISelDAGToDAG.cpp:1.107 Sun Oct 16 00:39:50 2005 +++ llvm/lib/Target/PowerPC/PPCISelDAGToDAG.cpp Mon Oct 17 19:28:58 2005 @@ -33,14 +33,14 @@ Statistic<> FrameOff("ppc-codegen", "Number of frame idx offsets collapsed"); //===--------------------------------------------------------------------===// - /// PPC32DAGToDAGISel - PPC32 specific code to select PPC32 machine + /// PPCDAGToDAGISel - PPC specific code to select PPC machine /// instructions for SelectionDAG operations. /// - class PPC32DAGToDAGISel : public SelectionDAGISel { + class PPCDAGToDAGISel : public SelectionDAGISel { PPCTargetLowering PPCLowering; unsigned GlobalBaseReg; public: - PPC32DAGToDAGISel(TargetMachine &TM) + PPCDAGToDAGISel(TargetMachine &TM) : SelectionDAGISel(PPCLowering), PPCLowering(TM) {} virtual bool runOnFunction(Function &Fn) { @@ -99,7 +99,7 @@ /// InstructionSelectBasicBlock - This callback is invoked by /// SelectionDAGISel when it has created a SelectionDAG for us to codegen. -void PPC32DAGToDAGISel::InstructionSelectBasicBlock(SelectionDAG &DAG) { +void PPCDAGToDAGISel::InstructionSelectBasicBlock(SelectionDAG &DAG) { DEBUG(BB->dump()); // The selection process is inherently a bottom-up recursive process (users @@ -156,13 +156,15 @@ /// getGlobalBaseReg - Output the instructions required to put the /// base address to use for accessing globals into a register. /// -SDOperand PPC32DAGToDAGISel::getGlobalBaseReg() { +SDOperand PPCDAGToDAGISel::getGlobalBaseReg() { if (!GlobalBaseReg) { // Insert the set of GlobalBaseReg into the first MBB of the function MachineBasicBlock &FirstMBB = BB->getParent()->front(); MachineBasicBlock::iterator MBBI = FirstMBB.begin(); SSARegMap *RegMap = BB->getParent()->getSSARegMap(); - GlobalBaseReg = RegMap->createVirtualRegister(PPC32::GPRCRegisterClass); + // FIXME: when we get to LP64, we will need to create the appropriate + // type of register here. + GlobalBaseReg = RegMap->createVirtualRegister(PPC::GPRCRegisterClass); BuildMI(FirstMBB, MBBI, PPC::MovePCtoLR, 0, PPC::LR); BuildMI(FirstMBB, MBBI, PPC::MFLR, 1, GlobalBaseReg); } @@ -290,7 +292,7 @@ /// 2. or and, shl 6. or shl, shr /// 3. or shr, and 7. or shr, shl /// 4. or and, shr -SDNode *PPC32DAGToDAGISel::SelectBitfieldInsert(SDNode *N) { +SDNode *PPCDAGToDAGISel::SelectBitfieldInsert(SDNode *N) { bool IsRotate = false; unsigned TgtMask = 0xFFFFFFFF, InsMask = 0xFFFFFFFF, SH = 0; unsigned Value; @@ -392,8 +394,8 @@ /// SelectAddr - Given the specified address, return the two operands for a /// load/store instruction, and return true if it should be an indexed [r+r] /// operation. -bool PPC32DAGToDAGISel::SelectAddr(SDOperand Addr, SDOperand &Op1, - SDOperand &Op2) { +bool PPCDAGToDAGISel::SelectAddr(SDOperand Addr, SDOperand &Op1, + SDOperand &Op2) { unsigned imm = 0; if (Addr.getOpcode() == ISD::ADD) { if (isIntImmediate(Addr.getOperand(1), imm) && isInt16(imm)) { @@ -445,8 +447,8 @@ /// SelectCC - Select a comparison of the specified values with the specified /// condition code, returning the CR# of the expression. -SDOperand PPC32DAGToDAGISel::SelectCC(SDOperand LHS, SDOperand RHS, - ISD::CondCode CC) { +SDOperand PPCDAGToDAGISel::SelectCC(SDOperand LHS, SDOperand RHS, + ISD::CondCode CC) { // Always select the LHS. LHS = Select(LHS); @@ -604,7 +606,7 @@ /// return a DAG expression to select that will generate the same value by /// multiplying by a magic number. See: /// -SDOperand PPC32DAGToDAGISel::BuildSDIVSequence(SDNode *N) { +SDOperand PPCDAGToDAGISel::BuildSDIVSequence(SDNode *N) { int d = (int)cast(N->getOperand(1))->getValue(); ms magics = magic(d); // Multiply the numerator (operand 0) by the magic value @@ -630,7 +632,7 @@ /// return a DAG expression to select that will generate the same value by /// multiplying by a magic number. See: /// -SDOperand PPC32DAGToDAGISel::BuildUDIVSequence(SDNode *N) { +SDOperand PPCDAGToDAGISel::BuildUDIVSequence(SDNode *N) { unsigned d = (unsigned)cast(N->getOperand(1))->getValue(); mu magics = magicu(d); // Multiply the numerator (operand 0) by the magic value @@ -649,7 +651,7 @@ } } -SDOperand PPC32DAGToDAGISel::SelectDYNAMIC_STACKALLOC(SDOperand Op) { +SDOperand PPCDAGToDAGISel::SelectDYNAMIC_STACKALLOC(SDOperand Op) { SDNode *N = Op.Val; // FIXME: We are currently ignoring the requested alignment for handling @@ -686,7 +688,7 @@ return SDOperand(Result.Val, Op.ResNo); } -SDOperand PPC32DAGToDAGISel::SelectADD_PARTS(SDOperand Op) { +SDOperand PPCDAGToDAGISel::SelectADD_PARTS(SDOperand Op) { SDNode *N = Op.Val; SDOperand LHSL = Select(N->getOperand(0)); SDOperand LHSH = Select(N->getOperand(1)); @@ -729,7 +731,7 @@ CodeGenMap[Op.getValue(1)] = Result[1]; return Result[Op.ResNo]; } -SDOperand PPC32DAGToDAGISel::SelectSUB_PARTS(SDOperand Op) { +SDOperand PPCDAGToDAGISel::SelectSUB_PARTS(SDOperand Op) { SDNode *N = Op.Val; SDOperand LHSL = Select(N->getOperand(0)); SDOperand LHSH = Select(N->getOperand(1)); @@ -746,7 +748,7 @@ return Result[Op.ResNo]; } -SDOperand PPC32DAGToDAGISel::SelectSETCC(SDOperand Op) { +SDOperand PPCDAGToDAGISel::SelectSETCC(SDOperand Op) { SDNode *N = Op.Val; unsigned Imm; ISD::CondCode CC = cast(N->getOperand(2))->get(); @@ -854,7 +856,7 @@ return SDOperand(N, 0); } -SDOperand PPC32DAGToDAGISel::SelectCALL(SDOperand Op) { +SDOperand PPCDAGToDAGISel::SelectCALL(SDOperand Op) { SDNode *N = Op.Val; SDOperand Chain = Select(N->getOperand(0)); @@ -963,7 +965,7 @@ // Select - Convert the specified operand from a target-independent to a // target-specific node if it hasn't already been changed. -SDOperand PPC32DAGToDAGISel::Select(SDOperand Op) { +SDOperand PPCDAGToDAGISel::Select(SDOperand Op) { SDNode *N = Op.Val; if (N->getOpcode() >= ISD::BUILTIN_OP_END && N->getOpcode() < PPCISD::FIRST_NUMBER) @@ -1391,6 +1393,11 @@ SDOperand Val = Select(N->getOperand(1)); if (N->getOperand(1).getValueType() == MVT::i32) { Chain = CurDAG->getCopyToReg(Chain, PPC::R3, Val); + } else if (N->getOperand(1).getValueType() == MVT::i64) { + SDOperand Srl = CurDAG->getTargetNode(PPC::RLDICL, MVT::i64, Val, + getI32Imm(32), getI32Imm(32)); + Chain = CurDAG->getCopyToReg(Chain, PPC::R4, Val); + Chain = CurDAG->getCopyToReg(Chain, PPC::R3, Srl); } else { assert(MVT::isFloatingPoint(N->getOperand(1).getValueType())); Chain = CurDAG->getCopyToReg(Chain, PPC::F1, Val); @@ -1465,10 +1472,10 @@ } -/// createPPC32ISelDag - This pass converts a legalized DAG into a +/// createPPCISelDag - This pass converts a legalized DAG into a /// PowerPC-specific DAG, ready for instruction scheduling. /// -FunctionPass *llvm::createPPC32ISelDag(TargetMachine &TM) { - return new PPC32DAGToDAGISel(TM); +FunctionPass *llvm::createPPCISelDag(TargetMachine &TM) { + return new PPCDAGToDAGISel(TM); } Index: llvm/lib/Target/PowerPC/PPCISelLowering.cpp diff -u llvm/lib/Target/PowerPC/PPCISelLowering.cpp:1.31 llvm/lib/Target/PowerPC/PPCISelLowering.cpp:1.32 --- llvm/lib/Target/PowerPC/PPCISelLowering.cpp:1.31 Sun Oct 16 00:39:50 2005 +++ llvm/lib/Target/PowerPC/PPCISelLowering.cpp Mon Oct 17 19:28:58 2005 @@ -1,4 +1,4 @@ -//===-- PPCISelLowering.cpp - PPC32 DAG Lowering Implementation -----------===// +//===-- PPCISelLowering.cpp - PPC DAG Lowering Implementation -------------===// // // The LLVM Compiler Infrastructure // @@ -32,9 +32,9 @@ setUseUnderscoreSetJmpLongJmp(true); // Set up the register classes. - addRegisterClass(MVT::i32, PPC32::GPRCRegisterClass); - addRegisterClass(MVT::f32, PPC32::F4RCRegisterClass); - addRegisterClass(MVT::f64, PPC32::F8RCRegisterClass); + addRegisterClass(MVT::i32, PPC::GPRCRegisterClass); + addRegisterClass(MVT::f32, PPC::F4RCRegisterClass); + addRegisterClass(MVT::f64, PPC::F8RCRegisterClass); // PowerPC has no intrinsics for these particular operations setOperationAction(ISD::MEMMOVE, MVT::Other, Expand); @@ -76,11 +76,6 @@ setOperationAction(ISD::SELECT_CC, MVT::f32, Custom); setOperationAction(ISD::SELECT_CC, MVT::f64, Custom); - // PowerPC wants to expand i64 shifts itself. - setOperationAction(ISD::SHL, MVT::i64, Custom); - setOperationAction(ISD::SRL, MVT::i64, Custom); - setOperationAction(ISD::SRA, MVT::i64, Custom); - // PowerPC does not have BRCOND* which requires SetCC setOperationAction(ISD::BRCOND, MVT::Other, Expand); setOperationAction(ISD::BRCONDTWOWAY, MVT::Other, Expand); @@ -98,11 +93,25 @@ // PowerPC does not have truncstore for i1. setOperationAction(ISD::TRUNCSTORE, MVT::i1, Promote); - // 64 bit PowerPC implementations have instructions to facilitate conversion - // between i64 and fp. if (TM.getSubtarget().is64Bit()) { + // 64 bit PowerPC implementations can support i64 types directly + // FIXME: enable this once it works. + //addRegisterClass(MVT::i64, PPC::G8RCRegisterClass); + // They also have instructions for converting between i64 and fp. setOperationAction(ISD::FP_TO_SINT, MVT::i64, Custom); setOperationAction(ISD::SINT_TO_FP, MVT::i64, Custom); + // BUILD_PAIR can't be handled natively, and should be expanded to shl/or + setOperationAction(ISD::BUILD_PAIR, MVT::i64, Expand); + // 32 bit PowerPC wants to expand i64 shifts itself. + // FIXME: remove these once we natively handle i64 shifts. + setOperationAction(ISD::SHL, MVT::i64, Custom); + setOperationAction(ISD::SRL, MVT::i64, Custom); + setOperationAction(ISD::SRA, MVT::i64, Custom); + } else { + // 32 bit PowerPC wants to expand i64 shifts itself. + setOperationAction(ISD::SHL, MVT::i64, Custom); + setOperationAction(ISD::SRL, MVT::i64, Custom); + setOperationAction(ISD::SRA, MVT::i64, Custom); } setSetCCResultContents(ZeroOrOneSetCCResult); @@ -353,7 +362,7 @@ ObjSize = 4; if (!ArgLive) break; if (GPR_remaining > 0) { - unsigned VReg = RegMap->createVirtualRegister(&PPC32::GPRCRegClass); + unsigned VReg = RegMap->createVirtualRegister(&PPC::GPRCRegClass); MF.addLiveIn(GPR[GPR_idx], VReg); argt = newroot = DAG.getCopyFromReg(DAG.getRoot(), VReg, MVT::i32); if (ObjectVT != MVT::i32) { @@ -371,7 +380,7 @@ if (!ArgLive) break; if (GPR_remaining > 0) { SDOperand argHi, argLo; - unsigned VReg = RegMap->createVirtualRegister(&PPC32::GPRCRegClass); + unsigned VReg = RegMap->createVirtualRegister(&PPC::GPRCRegClass); MF.addLiveIn(GPR[GPR_idx], VReg); argHi = DAG.getCopyFromReg(DAG.getRoot(), VReg, MVT::i32); // If we have two or more remaining argument registers, then both halves @@ -379,7 +388,7 @@ // have to come off the stack. This can happen when an i64 is preceded // by 28 bytes of arguments. if (GPR_remaining > 1) { - unsigned VReg = RegMap->createVirtualRegister(&PPC32::GPRCRegClass); + unsigned VReg = RegMap->createVirtualRegister(&PPC::GPRCRegClass); MF.addLiveIn(GPR[GPR_idx+1], VReg); argLo = DAG.getCopyFromReg(argHi, VReg, MVT::i32); } else { @@ -402,9 +411,9 @@ if (FPR_remaining > 0) { unsigned VReg; if (ObjectVT == MVT::f32) - VReg = RegMap->createVirtualRegister(&PPC32::F4RCRegClass); + VReg = RegMap->createVirtualRegister(&PPC::F4RCRegClass); else - VReg = RegMap->createVirtualRegister(&PPC32::F8RCRegClass); + VReg = RegMap->createVirtualRegister(&PPC::F8RCRegClass); MF.addLiveIn(FPR[FPR_idx], VReg); argt = newroot = DAG.getCopyFromReg(DAG.getRoot(), VReg, ObjectVT); --FPR_remaining; @@ -453,7 +462,7 @@ // result of va_next. std::vector MemOps; for (; GPR_remaining > 0; --GPR_remaining, ++GPR_idx) { - unsigned VReg = RegMap->createVirtualRegister(&PPC32::GPRCRegClass); + unsigned VReg = RegMap->createVirtualRegister(&PPC::GPRCRegClass); MF.addLiveIn(GPR[GPR_idx], VReg); SDOperand Val = DAG.getCopyFromReg(DAG.getRoot(), VReg, MVT::i32); SDOperand Store = DAG.getNode(ISD::STORE, MVT::Other, Val.getValue(1), Index: llvm/lib/Target/PowerPC/PPCISelPattern.cpp diff -u llvm/lib/Target/PowerPC/PPCISelPattern.cpp:1.189 llvm/lib/Target/PowerPC/PPCISelPattern.cpp:1.190 --- llvm/lib/Target/PowerPC/PPCISelPattern.cpp:1.189 Sun Oct 16 00:39:50 2005 +++ llvm/lib/Target/PowerPC/PPCISelPattern.cpp Mon Oct 17 19:28:58 2005 @@ -84,7 +84,7 @@ // convenience functions for virtual register creation inline unsigned MakeIntReg() { - return RegMap->createVirtualRegister(PPC32::GPRCRegisterClass); + return RegMap->createVirtualRegister(PPC::GPRCRegisterClass); } // dag -> dag expanders for integer divide by constant @@ -591,7 +591,7 @@ bool AlreadySelected = false; // Allocate a condition register for this expression - Result = RegMap->createVirtualRegister(PPC32::CRRCRegisterClass); + Result = RegMap->createVirtualRegister(PPC::CRRCRegisterClass); // Use U to determine whether the SETCC immediate range is signed or not. bool U = ISD::isUnsignedIntSetCC(CC); @@ -866,7 +866,7 @@ // Subtract size from stack pointer, thereby allocating some space. BuildMI(BB, PPC::SUBF, 2, PPC::R1).addReg(Tmp1).addReg(PPC::R1); // Put a pointer to the space into the result register by copying the SP - BuildMI(BB, PPC::OR, 2, Result).addReg(PPC::R1).addReg(PPC::R1); + BuildMI(BB, PPC::OR4, 2, Result).addReg(PPC::R1).addReg(PPC::R1); return Result; case ISD::ConstantPool: @@ -996,7 +996,7 @@ } else { Tmp1 = SelectExpr(N.getOperand(1)); BuildMI(BB, PPC::MTCTR, 1).addReg(Tmp1); - BuildMI(BB, PPC::OR, 2, PPC::R12).addReg(Tmp1).addReg(Tmp1); + BuildMI(BB, PPC::OR4, 2, PPC::R12).addReg(Tmp1).addReg(Tmp1); CallMI = BuildMI(PPC::CALLindirect, 3).addImm(20).addImm(0) .addReg(PPC::R12); } @@ -1013,7 +1013,7 @@ case MVT::i32: assert(GPR_idx < 8 && "Too many int args"); if (N.getOperand(i+2).getOpcode() != ISD::UNDEF) { - BuildMI(BB, PPC::OR,2,GPR[GPR_idx]).addReg(ArgVR[i]).addReg(ArgVR[i]); + BuildMI(BB, PPC::OR4,2,GPR[GPR_idx]).addReg(ArgVR[i]).addReg(ArgVR[i]); CallMI->addRegOperand(GPR[GPR_idx], MachineOperand::Use); } ++GPR_idx; @@ -1037,10 +1037,10 @@ case MVT::Other: return 1; case MVT::i32: if (Node->getValueType(1) == MVT::i32) { - BuildMI(BB, PPC::OR, 2, Result+1).addReg(PPC::R3).addReg(PPC::R3); - BuildMI(BB, PPC::OR, 2, Result).addReg(PPC::R4).addReg(PPC::R4); + BuildMI(BB, PPC::OR4, 2, Result+1).addReg(PPC::R3).addReg(PPC::R3); + BuildMI(BB, PPC::OR4, 2, Result).addReg(PPC::R4).addReg(PPC::R4); } else { - BuildMI(BB, PPC::OR, 2, Result).addReg(PPC::R3).addReg(PPC::R3); + BuildMI(BB, PPC::OR4, 2, Result).addReg(PPC::R3).addReg(PPC::R3); } break; case MVT::f32: @@ -1074,7 +1074,7 @@ ExprMap[N.getValue(1)] = 1; Tmp1 = dyn_cast(Node->getOperand(1))->getReg(); if (MVT::isInteger(DestType)) - BuildMI(BB, PPC::OR, 2, Result).addReg(Tmp1).addReg(Tmp1); + BuildMI(BB, PPC::OR4, 2, Result).addReg(Tmp1).addReg(Tmp1); else if (DestType == MVT::f32) BuildMI(BB, PPC::FMRS, 1, Result).addReg(Tmp1); else @@ -1144,7 +1144,7 @@ return Result; Tmp1 = SelectExpr(N.getOperand(0)); Tmp2 = SelectExpr(N.getOperand(1)); - BuildMI(BB, PPC::ADD, 2, Result).addReg(Tmp1).addReg(Tmp2); + BuildMI(BB, PPC::ADD4, 2, Result).addReg(Tmp1).addReg(Tmp2); return Result; case ISD::FADD: @@ -1250,7 +1250,7 @@ // emit regular or Tmp1 = SelectExpr(N.getOperand(0)); Tmp2 = SelectExpr(N.getOperand(1)); - Opc = Recording ? PPC::ORo : PPC::OR; + Opc = Recording ? PPC::ORo : PPC::OR4; RecordSuccess = true; BuildMI(BB, Opc, 2, Result).addReg(Tmp1).addReg(Tmp2); return Result; @@ -1755,7 +1755,7 @@ else if (N.getOperand(2).getValueType() == MVT::f32) BuildMI(BB, PPC::FMRS, 1, Tmp2).addReg(Tmp1); else - BuildMI(BB, PPC::OR, 2, Tmp2).addReg(Tmp1).addReg(Tmp1); + BuildMI(BB, PPC::OR4, 2, Tmp2).addReg(Tmp1).addReg(Tmp1); } return; case ISD::ImplicitDef: @@ -1779,8 +1779,8 @@ Select(N.getOperand(0)); Tmp1 = SelectExpr(N.getOperand(1)); Tmp2 = SelectExpr(N.getOperand(2)); - BuildMI(BB, PPC::OR, 2, PPC::R3).addReg(Tmp2).addReg(Tmp2); - BuildMI(BB, PPC::OR, 2, PPC::R4).addReg(Tmp1).addReg(Tmp1); + BuildMI(BB, PPC::OR4, 2, PPC::R3).addReg(Tmp2).addReg(Tmp2); + BuildMI(BB, PPC::OR4, 2, PPC::R4).addReg(Tmp1).addReg(Tmp1); break; case 2: Select(N.getOperand(0)); @@ -1795,7 +1795,7 @@ BuildMI(BB, PPC::FMRS, 1, PPC::F1).addReg(Tmp1); break; case MVT::i32: - BuildMI(BB, PPC::OR, 2, PPC::R3).addReg(Tmp1).addReg(Tmp1); + BuildMI(BB, PPC::OR4, 2, PPC::R3).addReg(Tmp1).addReg(Tmp1); break; } case 1: @@ -1870,11 +1870,11 @@ } -/// createPPC32PatternInstructionSelector - This pass converts an LLVM function +/// createPPCPatternInstructionSelector - This pass converts an LLVM function /// into a machine code representation using pattern matching and a machine /// description file. /// -FunctionPass *llvm::createPPC32ISelPattern(TargetMachine &TM) { +FunctionPass *llvm::createPPCISelPattern(TargetMachine &TM) { return new ISel(TM); } Index: llvm/lib/Target/PowerPC/PPCInstrInfo.cpp diff -u llvm/lib/Target/PowerPC/PPCInstrInfo.cpp:1.11 llvm/lib/Target/PowerPC/PPCInstrInfo.cpp:1.12 --- llvm/lib/Target/PowerPC/PPCInstrInfo.cpp:1.11 Sun Oct 16 00:39:50 2005 +++ llvm/lib/Target/PowerPC/PPCInstrInfo.cpp Mon Oct 17 19:28:58 2005 @@ -25,7 +25,7 @@ unsigned& sourceReg, unsigned& destReg) const { MachineOpCode oc = MI.getOpcode(); - if (oc == PPC::OR) { // or r1, r2, r2 + if (oc == PPC::OR4 || oc == PPC::OR8) { // or r1, r2, r2 assert(MI.getNumOperands() == 3 && MI.getOperand(0).isRegister() && MI.getOperand(1).isRegister() && Index: llvm/lib/Target/PowerPC/PPCInstrInfo.td diff -u llvm/lib/Target/PowerPC/PPCInstrInfo.td:1.122 llvm/lib/Target/PowerPC/PPCInstrInfo.td:1.123 --- llvm/lib/Target/PowerPC/PPCInstrInfo.td:1.122 Sat Oct 15 16:44:15 2005 +++ llvm/lib/Target/PowerPC/PPCInstrInfo.td Mon Oct 17 19:28:58 2005 @@ -323,9 +323,12 @@ def ANDC : XForm_6<31, 60, (ops GPRC:$rA, GPRC:$rS, GPRC:$rB), "andc $rA, $rS, $rB", [(set GPRC:$rA, (and GPRC:$rS, (not GPRC:$rB)))]>; -def OR : XForm_6<31, 444, (ops GPRC:$rA, GPRC:$rS, GPRC:$rB), +def OR4 : XForm_6<31, 444, (ops GPRC:$rA, GPRC:$rS, GPRC:$rB), "or $rA, $rS, $rB", [(set GPRC:$rA, (or GPRC:$rS, GPRC:$rB))]>; +def OR8 : XForm_6<31, 444, (ops G8RC:$rA, G8RC:$rS, G8RC:$rB), + "or $rA, $rS, $rB", + [(set G8RC:$rA, (or G8RC:$rS, G8RC:$rB))]>; def NOR : XForm_6<31, 124, (ops GPRC:$rA, GPRC:$rS, GPRC:$rB), "nor $rA, $rS, $rB", [(set GPRC:$rA, (not (or GPRC:$rS, GPRC:$rB)))]>; @@ -498,9 +501,12 @@ // XO-Form instructions. Arithmetic instructions that can set overflow bit // -def ADD : XOForm_1<31, 266, 0, (ops GPRC:$rT, GPRC:$rA, GPRC:$rB), +def ADD4 : XOForm_1<31, 266, 0, (ops GPRC:$rT, GPRC:$rA, GPRC:$rB), "add $rT, $rA, $rB", [(set GPRC:$rT, (add GPRC:$rA, GPRC:$rB))]>; +def ADD8 : XOForm_1<31, 266, 0, (ops G8RC:$rT, G8RC:$rA, G8RC:$rB), + "add $rT, $rA, $rB", + [(set G8RC:$rT, (add G8RC:$rA, G8RC:$rB))]>; def ADDC : XOForm_1<31, 10, 0, (ops GPRC:$rT, GPRC:$rA, GPRC:$rB), "addc $rT, $rA, $rB", []>; @@ -648,6 +654,9 @@ def RLWIMI : MForm_2<20, (ops GPRC:$rA, GPRC:$rSi, GPRC:$rS, u5imm:$SH, u5imm:$MB, u5imm:$ME), "rlwimi $rA, $rS, $SH, $MB, $ME">; +def RLDIMI : MDForm_1<30, 3, + (ops G8RC:$rA, G8RC:$rSi, G8RC:$rS, u6imm:$SH, u6imm:$MB), + "rldimi $rA, $rS, $SH, $MB">, isPPC64; } def RLWINM : MForm_2<21, (ops GPRC:$rA, GPRC:$rS, u5imm:$SH, u5imm:$MB, u5imm:$ME), @@ -662,10 +671,10 @@ // MD-Form instructions. 64 bit rotate instructions. // def RLDICL : MDForm_1<30, 0, - (ops GPRC:$rA, GPRC:$rS, u6imm:$SH, u6imm:$MB), + (ops G8RC:$rA, G8RC:$rS, u6imm:$SH, u6imm:$MB), "rldicl $rA, $rS, $SH, $MB">, isPPC64; def RLDICR : MDForm_1<30, 1, - (ops GPRC:$rA, GPRC:$rS, u6imm:$SH, u6imm:$ME), + (ops G8RC:$rA, G8RC:$rS, u6imm:$SH, u6imm:$ME), "rldicr $rA, $rS, $SH, $ME">, isPPC64; //===----------------------------------------------------------------------===// Index: llvm/lib/Target/PowerPC/PPCRegisterInfo.cpp diff -u llvm/lib/Target/PowerPC/PPCRegisterInfo.cpp:1.34 llvm/lib/Target/PowerPC/PPCRegisterInfo.cpp:1.35 --- llvm/lib/Target/PowerPC/PPCRegisterInfo.cpp:1.34 Sun Oct 16 00:39:50 2005 +++ llvm/lib/Target/PowerPC/PPCRegisterInfo.cpp Mon Oct 17 19:28:58 2005 @@ -40,7 +40,7 @@ ImmToIdxMap[PPC::LFS] = PPC::LFSX; ImmToIdxMap[PPC::LFD] = PPC::LFDX; ImmToIdxMap[PPC::STH] = PPC::STHX; ImmToIdxMap[PPC::STW] = PPC::STWX; ImmToIdxMap[PPC::STFS] = PPC::STFSX; ImmToIdxMap[PPC::STFD] = PPC::STFDX; - ImmToIdxMap[PPC::ADDI] = PPC::ADD; + ImmToIdxMap[PPC::ADDI] = PPC::ADD4; } void @@ -51,14 +51,16 @@ if (SrcReg == PPC::LR) { BuildMI(MBB, MI, PPC::MFLR, 1, PPC::R11); addFrameReference(BuildMI(MBB, MI, PPC::STW, 3).addReg(PPC::R11), FrameIdx); - } else if (RC == PPC32::CRRCRegisterClass) { + } else if (RC == PPC::CRRCRegisterClass) { BuildMI(MBB, MI, PPC::MFCR, 0, PPC::R11); addFrameReference(BuildMI(MBB, MI, PPC::STW, 3).addReg(PPC::R11), FrameIdx); - } else if (RC == PPC32::GPRCRegisterClass) { + } else if (RC == PPC::GPRCRegisterClass) { addFrameReference(BuildMI(MBB, MI, PPC::STW, 3).addReg(SrcReg),FrameIdx); - } else if (RC == PPC32::F8RCRegisterClass) { + } else if (RC == PPC::G8RCRegisterClass) { + addFrameReference(BuildMI(MBB, MI, PPC::STD, 3).addReg(SrcReg),FrameIdx); + } else if (RC == PPC::F8RCRegisterClass) { addFrameReference(BuildMI(MBB, MI, PPC::STFD, 3).addReg(SrcReg),FrameIdx); - } else if (RC == PPC32::F4RCRegisterClass) { + } else if (RC == PPC::F4RCRegisterClass) { addFrameReference(BuildMI(MBB, MI, PPC::STFS, 3).addReg(SrcReg),FrameIdx); } else { assert(0 && "Unknown regclass!"); @@ -74,14 +76,16 @@ if (DestReg == PPC::LR) { addFrameReference(BuildMI(MBB, MI, PPC::LWZ, 2, PPC::R11), FrameIdx); BuildMI(MBB, MI, PPC::MTLR, 1).addReg(PPC::R11); - } else if (RC == PPC32::CRRCRegisterClass) { + } else if (RC == PPC::CRRCRegisterClass) { addFrameReference(BuildMI(MBB, MI, PPC::LWZ, 2, PPC::R11), FrameIdx); BuildMI(MBB, MI, PPC::MTCRF, 1, DestReg).addReg(PPC::R11); - } else if (RC == PPC32::GPRCRegisterClass) { + } else if (RC == PPC::GPRCRegisterClass) { addFrameReference(BuildMI(MBB, MI, PPC::LWZ, 2, DestReg), FrameIdx); - } else if (RC == PPC32::F8RCRegisterClass) { + } else if (RC == PPC::G8RCRegisterClass) { + addFrameReference(BuildMI(MBB, MI, PPC::LD, 2, DestReg), FrameIdx); + } else if (RC == PPC::F8RCRegisterClass) { addFrameReference(BuildMI(MBB, MI, PPC::LFD, 2, DestReg), FrameIdx); - } else if (RC == PPC32::F4RCRegisterClass) { + } else if (RC == PPC::F4RCRegisterClass) { addFrameReference(BuildMI(MBB, MI, PPC::LFS, 2, DestReg), FrameIdx); } else { assert(0 && "Unknown regclass!"); @@ -95,13 +99,15 @@ const TargetRegisterClass *RC) const { MachineInstr *I; - if (RC == PPC32::GPRCRegisterClass) { - BuildMI(MBB, MI, PPC::OR, 2, DestReg).addReg(SrcReg).addReg(SrcReg); - } else if (RC == PPC32::F4RCRegisterClass) { + if (RC == PPC::GPRCRegisterClass) { + BuildMI(MBB, MI, PPC::OR4, 2, DestReg).addReg(SrcReg).addReg(SrcReg); + } else if (RC == PPC::G8RCRegisterClass) { + BuildMI(MBB, MI, PPC::OR8, 2, DestReg).addReg(SrcReg).addReg(SrcReg); + } else if (RC == PPC::F4RCRegisterClass) { BuildMI(MBB, MI, PPC::FMRS, 1, DestReg).addReg(SrcReg); - } else if (RC == PPC32::F8RCRegisterClass) { + } else if (RC == PPC::F8RCRegisterClass) { BuildMI(MBB, MI, PPC::FMRD, 1, DestReg).addReg(SrcReg); - } else if (RC == PPC32::CRRCRegisterClass) { + } else if (RC == PPC::CRRCRegisterClass) { BuildMI(MBB, MI, PPC::MCRF, 1, DestReg).addReg(SrcReg); } else { std::cerr << "Attempt to copy register that is not GPR or FPR"; @@ -113,6 +119,7 @@ int &FrameIndex) const { switch (MI->getOpcode()) { default: break; + case PPC::LD: case PPC::LWZ: case PPC::LFS: case PPC::LFD: @@ -135,7 +142,7 @@ // it takes more than one instruction to store it. unsigned Opc = MI->getOpcode(); - if ((Opc == PPC::OR && + if ((Opc == PPC::OR4 && MI->getOperand(1).getReg() == MI->getOperand(2).getReg())) { if (OpNum == 0) { // move -> store unsigned InReg = MI->getOperand(1).getReg(); @@ -145,7 +152,16 @@ unsigned OutReg = MI->getOperand(0).getReg(); return addFrameReference(BuildMI(PPC::LWZ, 2, OutReg), FrameIndex); } - + } else if ((Opc == PPC::OR8 && + MI->getOperand(1).getReg() == MI->getOperand(2).getReg())) { + if (OpNum == 0) { // move -> store + unsigned InReg = MI->getOperand(1).getReg(); + return addFrameReference(BuildMI(PPC::STD, + 3).addReg(InReg), FrameIndex); + } else { // move -> load + unsigned OutReg = MI->getOperand(0).getReg(); + return addFrameReference(BuildMI(PPC::LD, 2, OutReg), FrameIndex); + } } else if (Opc == PPC::FMRD) { if (OpNum == 0) { // move -> store unsigned InReg = MI->getOperand(1).getReg(); @@ -315,7 +331,7 @@ if (hasFP(MF)) { MI = BuildMI(PPC::STW, 3).addReg(PPC::R31).addSImm(GPRSize).addReg(PPC::R1); MBB.insert(MBBI, MI); - MI = BuildMI(PPC::OR, 2, PPC::R31).addReg(PPC::R1).addReg(PPC::R1); + MI = BuildMI(PPC::OR4, 2, PPC::R31).addReg(PPC::R1).addReg(PPC::R1); MBB.insert(MBBI, MI); } } Index: llvm/lib/Target/PowerPC/PPCRegisterInfo.td diff -u llvm/lib/Target/PowerPC/PPCRegisterInfo.td:1.17 llvm/lib/Target/PowerPC/PPCRegisterInfo.td:1.18 --- llvm/lib/Target/PowerPC/PPCRegisterInfo.td:1.17 Fri Oct 14 13:58:46 2005 +++ llvm/lib/Target/PowerPC/PPCRegisterInfo.td Mon Oct 17 19:28:58 2005 @@ -87,7 +87,7 @@ /// Register classes // Allocate volatiles first // then nonvolatiles in reverse order since stmw/lmw save from rN to r31 -def GPRC : RegisterClass<"PPC32", i32, 32, +def GPRC : RegisterClass<"PPC", i32, 32, [R2, R3, R4, R5, R6, R7, R8, R9, R10, R11, R12, R30, R29, R28, R27, R26, R25, R24, R23, R22, R21, R20, R19, R18, R17, R16, R15, R14, R13, R31, R0, R1, LR]> @@ -110,13 +110,38 @@ } }]; } +def G8RC : RegisterClass<"PPC", i64, 64, + [R2, R3, R4, R5, R6, R7, R8, R9, R10, R11, R12, + R30, R29, R28, R27, R26, R25, R24, R23, R22, R21, R20, R19, R18, R17, + R16, R15, R14, R13, R31, R0, R1, LR]> +{ + let MethodProtos = [{ + iterator allocation_order_begin(MachineFunction &MF) const; + iterator allocation_order_end(MachineFunction &MF) const; + }]; + let MethodBodies = [{ + G8RCClass::iterator + G8RCClass::allocation_order_begin(MachineFunction &MF) const { + return begin() + ((TargetAIX == PPCTarget) ? 1 : 0); + } + G8RCClass::iterator + G8RCClass::allocation_order_end(MachineFunction &MF) const { + if (hasFP(MF)) + return end()-4; + else + return end()-3; + } + }]; +} + + -def F8RC : RegisterClass<"PPC32", f64, 64, [F0, F1, F2, F3, F4, F5, F6, F7, +def F8RC : RegisterClass<"PPC", f64, 64, [F0, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, F13, F14, F15, F16, F17, F18, F19, F20, F21, F22, F23, F24, F25, F26, F27, F28, F29, F30, F31]>; -def F4RC : RegisterClass<"PPC32", f32, 32, [F0, F1, F2, F3, F4, F5, F6, F7, +def F4RC : RegisterClass<"PPC", f32, 32, [F0, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, F13, F14, F15, F16, F17, F18, F19, F20, F21, F22, F23, F24, F25, F26, F27, F28, F29, F30, F31]>; -def CRRC : RegisterClass<"PPC32", i32, 32, [CR0, CR1, CR5, CR6, CR7, CR2, CR3, CR4]>; +def CRRC : RegisterClass<"PPC", i32, 32, [CR0, CR1, CR5, CR6, CR7, CR2, CR3, CR4]>; Index: llvm/lib/Target/PowerPC/PPCTargetMachine.cpp diff -u llvm/lib/Target/PowerPC/PPCTargetMachine.cpp:1.74 llvm/lib/Target/PowerPC/PPCTargetMachine.cpp:1.75 --- llvm/lib/Target/PowerPC/PPCTargetMachine.cpp:1.74 Sun Oct 16 00:39:50 2005 +++ llvm/lib/Target/PowerPC/PPCTargetMachine.cpp Mon Oct 17 19:28:58 2005 @@ -99,9 +99,9 @@ // Install an instruction selector. if (!DisablePPCDAGDAG) - PM.add(createPPC32ISelDag(*this)); + PM.add(createPPCISelDag(*this)); else - PM.add(createPPC32ISelPattern(*this)); + PM.add(createPPCISelPattern(*this)); if (PrintMachineCode) PM.add(createMachineFunctionPrinterPass(&std::cerr)); @@ -156,9 +156,9 @@ // Install an instruction selector. if (!DisablePPCDAGDAG) - PM.add(createPPC32ISelDag(TM)); + PM.add(createPPCISelDag(TM)); else - PM.add(createPPC32ISelPattern(TM)); + PM.add(createPPCISelPattern(TM)); PM.add(createRegisterAllocator()); PM.add(createPrologEpilogCodeInserter()); From natebegeman at mac.com Mon Oct 17 19:56:54 2005 From: natebegeman at mac.com (Nate Begeman) Date: Mon, 17 Oct 2005 19:56:54 -0500 Subject: [llvm-commits] CVS: llvm/lib/Target/PowerPC/PPCISelLowering.cpp PPCSubtarget.cpp PPCSubtarget.h Message-ID: <200510180056.TAA05628@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/PowerPC: PPCISelLowering.cpp updated: 1.32 -> 1.33 PPCSubtarget.cpp updated: 1.9 -> 1.10 PPCSubtarget.h updated: 1.7 -> 1.8 --- Log message: Do the right thing and enable 64 bit regs under the control of a subtarget option. Currently the only way to enable this is to specify the 64bitregs mattr flag. It is never enabled by default on any config yet. --- Diffs of the changes: (+10 -8) PPCISelLowering.cpp | 13 +++++-------- PPCSubtarget.cpp | 3 +++ PPCSubtarget.h | 2 ++ 3 files changed, 10 insertions(+), 8 deletions(-) Index: llvm/lib/Target/PowerPC/PPCISelLowering.cpp diff -u llvm/lib/Target/PowerPC/PPCISelLowering.cpp:1.32 llvm/lib/Target/PowerPC/PPCISelLowering.cpp:1.33 --- llvm/lib/Target/PowerPC/PPCISelLowering.cpp:1.32 Mon Oct 17 19:28:58 2005 +++ llvm/lib/Target/PowerPC/PPCISelLowering.cpp Mon Oct 17 19:56:42 2005 @@ -94,19 +94,16 @@ setOperationAction(ISD::TRUNCSTORE, MVT::i1, Promote); if (TM.getSubtarget().is64Bit()) { - // 64 bit PowerPC implementations can support i64 types directly - // FIXME: enable this once it works. - //addRegisterClass(MVT::i64, PPC::G8RCRegisterClass); // They also have instructions for converting between i64 and fp. setOperationAction(ISD::FP_TO_SINT, MVT::i64, Custom); setOperationAction(ISD::SINT_TO_FP, MVT::i64, Custom); + } + + if (TM.getSubtarget().has64BitRegs()) { + // 64 bit PowerPC implementations can support i64 types directly + addRegisterClass(MVT::i64, PPC::G8RCRegisterClass); // BUILD_PAIR can't be handled natively, and should be expanded to shl/or setOperationAction(ISD::BUILD_PAIR, MVT::i64, Expand); - // 32 bit PowerPC wants to expand i64 shifts itself. - // FIXME: remove these once we natively handle i64 shifts. - setOperationAction(ISD::SHL, MVT::i64, Custom); - setOperationAction(ISD::SRL, MVT::i64, Custom); - setOperationAction(ISD::SRA, MVT::i64, Custom); } else { // 32 bit PowerPC wants to expand i64 shifts itself. setOperationAction(ISD::SHL, MVT::i64, Custom); Index: llvm/lib/Target/PowerPC/PPCSubtarget.cpp diff -u llvm/lib/Target/PowerPC/PPCSubtarget.cpp:1.9 llvm/lib/Target/PowerPC/PPCSubtarget.cpp:1.10 --- llvm/lib/Target/PowerPC/PPCSubtarget.cpp:1.9 Fri Oct 14 18:51:18 2005 +++ llvm/lib/Target/PowerPC/PPCSubtarget.cpp Mon Oct 17 19:56:42 2005 @@ -36,6 +36,7 @@ PowerPCFeatureAltivec = 1 << 1, PowerPCFeatureFSqrt = 1 << 2, PowerPCFeatureGPUL = 1 << 3, + PowerPCFeature64BRegs = 1 << 4 }; /// Sorted (by key) array of values for CPU subtype. @@ -73,6 +74,7 @@ /// Sorted (by key) array of values for CPU features. static SubtargetFeatureKV PowerPCFeatureKV[] = { { "64bit" , "Should 64 bit instructions be used" , PowerPCFeature64Bit }, + { "64bitregs", "Should 64 bit registers be used" , PowerPCFeature64BRegs }, { "altivec", "Should Altivec instructions be used" , PowerPCFeatureAltivec }, { "fsqrt" , "Should the fsqrt instruction be used", PowerPCFeatureFSqrt }, { "gpul" , "Should GPUL instructions be used" , PowerPCFeatureGPUL } @@ -134,6 +136,7 @@ IsGigaProcessor = (Bits & PowerPCFeatureGPUL ) != 0; Is64Bit = (Bits & PowerPCFeature64Bit) != 0; HasFSQRT = (Bits & PowerPCFeatureFSqrt) != 0; + Has64BitRegs = (Bits & PowerPCFeature64BRegs) != 0; // Set the boolean corresponding to the current target triple, or the default // if one cannot be determined, to true. Index: llvm/lib/Target/PowerPC/PPCSubtarget.h diff -u llvm/lib/Target/PowerPC/PPCSubtarget.h:1.7 llvm/lib/Target/PowerPC/PPCSubtarget.h:1.8 --- llvm/lib/Target/PowerPC/PPCSubtarget.h:1.7 Sun Oct 16 00:39:50 2005 +++ llvm/lib/Target/PowerPC/PPCSubtarget.h Mon Oct 17 19:56:42 2005 @@ -30,6 +30,7 @@ /// Used by the ISel to turn in optimizations for POWER4-derived architectures bool IsGigaProcessor; bool Is64Bit; + bool Has64BitRegs; bool HasFSQRT; bool IsAIX; bool IsDarwin; @@ -49,6 +50,7 @@ bool isAIX() const { return IsAIX; } bool isDarwin() const { return IsDarwin; } bool is64Bit() const { return Is64Bit; } + bool has64BitRegs() const { return Has64BitRegs; } bool isGigaProcessor() const { return IsGigaProcessor; } }; } // End llvm namespace From lattner at cs.uiuc.edu Mon Oct 17 23:41:12 2005 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Mon, 17 Oct 2005 23:41:12 -0500 Subject: [llvm-commits] CVS: llvm/utils/TableGen/DAGISelEmitter.cpp Message-ID: <200510180441.XAA06278@zion.cs.uiuc.edu> Changes in directory llvm/utils/TableGen: DAGISelEmitter.cpp updated: 1.58 -> 1.59 --- Log message: Duraid pointed out that it is impolite to emit PPC:: into the IA64 backend --- Diffs of the changes: (+5 -1) DAGISelEmitter.cpp | 6 +++++- 1 files changed, 5 insertions(+), 1 deletion(-) Index: llvm/utils/TableGen/DAGISelEmitter.cpp diff -u llvm/utils/TableGen/DAGISelEmitter.cpp:1.58 llvm/utils/TableGen/DAGISelEmitter.cpp:1.59 --- llvm/utils/TableGen/DAGISelEmitter.cpp:1.58 Sat Oct 15 20:41:58 2005 +++ llvm/utils/TableGen/DAGISelEmitter.cpp Mon Oct 17 23:41:01 2005 @@ -1762,11 +1762,15 @@ } void DAGISelEmitter::EmitInstructionSelector(std::ostream &OS) { + std::string InstNS = Target.inst_begin()->second.Namespace; + if (!InstNS.empty()) InstNS += "::"; + // Emit boilerplate. OS << "// The main instruction selector code.\n" << "SDOperand SelectCode(SDOperand N) {\n" << " if (N.getOpcode() >= ISD::BUILTIN_OP_END &&\n" - << " N.getOpcode() < PPCISD::FIRST_NUMBER)\n" + << " N.getOpcode() < (ISD::BUILTIN_OP_END+" << InstNS + << "INSTRUCTION_LIST_END))\n" << " return N; // Already selected.\n\n" << " if (!N.Val->hasOneUse()) {\n" << " std::map::iterator CGMI = CodeGenMap.find(N);\n" From lattner at cs.uiuc.edu Tue Oct 18 01:04:36 2005 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Tue, 18 Oct 2005 01:04:36 -0500 Subject: [llvm-commits] CVS: llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp Message-ID: <200510180604.BAA06624@zion.cs.uiuc.edu> Changes in directory llvm/lib/CodeGen/SelectionDAG: DAGCombiner.cpp updated: 1.46 -> 1.47 --- Log message: Fold (select C, load A, load B) -> load (select C, A, B). This happens quite a lot throughout many programs. In particular, specfp triggers it a bunch for constant FP nodes when you have code like cond ? 1.0 : -1.0. If the PPC ISel exposed the loads implicit in pic references to external globals, we would be able to eliminate a load in cases like this as well: %X = external global int %Y = external global int int* %test4(bool %C) { %G = select bool %C, int* %X, int* %Y ret int* %G } Note that this breaks things that use SrcValue's (see the fixme), but since nothing uses them yet, this is ok. Also, simplify some code to use hasOneUse() on an SDOperand instead of hasNUsesOfValue directly. --- Diffs of the changes: (+82 -7) DAGCombiner.cpp | 89 +++++++++++++++++++++++++++++++++++++++++++++++++++----- 1 files changed, 82 insertions(+), 7 deletions(-) Index: llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp diff -u llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp:1.46 llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp:1.47 --- llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp:1.46 Mon Oct 17 19:28:13 2005 +++ llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp Tue Oct 18 01:04:22 2005 @@ -22,10 +22,8 @@ // // FIXME: select C, pow2, pow2 -> something smart // FIXME: trunc(select X, Y, Z) -> select X, trunc(Y), trunc(Z) -// FIXME: (select C, load A, load B) -> load (select C, A, B) // FIXME: Dead stores -> nuke -// FIXME: shr X, (and Y,31) -> shr X, Y -// FIXME: TRUNC (LOAD) -> EXT_LOAD/LOAD(smaller) +// FIXME: shr X, (and Y,31) -> shr X, Y (TRICKY!) // FIXME: mul (x, const) -> shifts + adds // FIXME: undef values // FIXME: make truncate see through SIGN_EXTEND and AND @@ -176,6 +174,7 @@ SDOperand visitLOAD(SDNode *N); SDOperand visitSTORE(SDNode *N); + bool SimplifySelectOps(SDNode *SELECT, SDOperand LHS, SDOperand RHS); SDOperand SimplifySelect(SDOperand N0, SDOperand N1, SDOperand N2); SDOperand SimplifySelectCC(SDOperand N0, SDOperand N1, SDOperand N2, SDOperand N3, ISD::CondCode CC); @@ -831,7 +830,7 @@ } } // fold (zext_inreg (sextload x)) -> (zextload x) iff load has one use - if (N0.getOpcode() == ISD::SEXTLOAD && N0.Val->hasNUsesOfValue(1, 0)) { + if (N0.getOpcode() == ISD::SEXTLOAD && N0.hasOneUse()) { MVT::ValueType EVT = cast(N0.getOperand(3))->getVT(); // If we zero all the possible extended bits, then we can turn this into // a zextload if we are running before legalize or the operation is legal. @@ -1209,6 +1208,11 @@ // fold X ? Y : X --> X ? Y : 0 --> X & Y if (MVT::i1 == VT && N0 == N2) return DAG.getNode(ISD::AND, VT, N0, N1); + + // If we can fold this based on the true/false value, do so. + if (SimplifySelectOps(N, N1, N2)) + return SDOperand(); + // fold selects based on a setcc into other things, such as min/max/abs if (N0.getOpcode() == ISD::SETCC) return SimplifySelect(N0, N1, N2); @@ -1233,6 +1237,11 @@ // fold select_cc lhs, rhs, x, x, cc -> x if (N2 == N3) return N2; + + // If we can fold this based on the true/false value, do so. + if (SimplifySelectOps(N, N2, N3)) + return SDOperand(); + // fold select_cc into other things, such as min/max/abs return SimplifySelectCC(N0, N1, N2, N3, CC); } @@ -1297,7 +1306,7 @@ if (N0.getOpcode() == ISD::SEXTLOAD && VT == N0.getValueType()) return N0; // fold (sext (load x)) -> (sextload x) - if (N0.getOpcode() == ISD::LOAD && N0.Val->hasNUsesOfValue(1, 0)) { + if (N0.getOpcode() == ISD::LOAD && N0.hasOneUse()) { SDOperand ExtLoad = DAG.getExtLoad(ISD::SEXTLOAD, VT, N0.getOperand(0), N0.getOperand(1), N0.getOperand(2), N0.getValueType()); @@ -1384,7 +1393,7 @@ return SDOperand(); } // fold (sext_inreg (zextload x)) -> (sextload x) iff load has one use - if (N0.getOpcode() == ISD::ZEXTLOAD && N0.Val->hasNUsesOfValue(1, 0) && + if (N0.getOpcode() == ISD::ZEXTLOAD && N0.hasOneUse() && EVT == cast(N0.getOperand(3))->getVT() && (!AfterLegalize || TLI.isOperationLegal(ISD::SEXTLOAD, EVT))) { SDOperand ExtLoad = DAG.getExtLoad(ISD::SEXTLOAD, VT, N0.getOperand(0), @@ -1425,7 +1434,7 @@ return N0.getOperand(0); } // fold (truncate (load x)) -> (smaller load x) - if (N0.getOpcode() == ISD::LOAD && N0.Val->hasNUsesOfValue(1, 0)) { + if (N0.getOpcode() == ISD::LOAD && N0.hasOneUse()) { assert(MVT::getSizeInBits(N0.getValueType()) > MVT::getSizeInBits(VT) && "Cannot truncate to larger type!"); MVT::ValueType PtrType = N0.getOperand(1).getValueType(); @@ -1778,6 +1787,72 @@ return SDOperand(); } +/// SimplifySelectOps - Given a SELECT or a SELECT_CC node, where LHS and RHS +/// are the two values being selected between, see if we can simplify the +/// select. +/// +bool DAGCombiner::SimplifySelectOps(SDNode *TheSelect, SDOperand LHS, + SDOperand RHS) { + + // If this is a select from two identical things, try to pull the operation + // through the select. + if (LHS.getOpcode() == RHS.getOpcode() && LHS.hasOneUse() && RHS.hasOneUse()){ +#if 0 + std::cerr << "SELECT: ["; LHS.Val->dump(); + std::cerr << "] ["; RHS.Val->dump(); + std::cerr << "]\n"; +#endif + + // If this is a load and the token chain is identical, replace the select + // of two loads with a load through a select of the address to load from. + // This triggers in things like "select bool X, 10.0, 123.0" after the FP + // constants have been dropped into the constant pool. + if ((LHS.getOpcode() == ISD::LOAD || + LHS.getOpcode() == ISD::EXTLOAD || + LHS.getOpcode() == ISD::ZEXTLOAD || + LHS.getOpcode() == ISD::SEXTLOAD) && + // Token chains must be identical. + LHS.getOperand(0) == RHS.getOperand(0) && + // If this is an EXTLOAD, the VT's must match. + (LHS.getOpcode() == ISD::LOAD || + LHS.getOperand(3) == RHS.getOperand(3))) { + // FIXME: this conflates two src values, discarding one. This is not + // the right thing to do, but nothing uses srcvalues now. When they do, + // turn SrcValue into a list of locations. + SDOperand Addr; + if (TheSelect->getOpcode() == ISD::SELECT) + Addr = DAG.getNode(ISD::SELECT, LHS.getOperand(1).getValueType(), + TheSelect->getOperand(0), LHS.getOperand(1), + RHS.getOperand(1)); + else + Addr = DAG.getNode(ISD::SELECT_CC, LHS.getOperand(1).getValueType(), + TheSelect->getOperand(0), + TheSelect->getOperand(1), + LHS.getOperand(1), RHS.getOperand(1), + TheSelect->getOperand(4)); + + SDOperand Load; + if (LHS.getOpcode() == ISD::LOAD) + Load = DAG.getLoad(TheSelect->getValueType(0), LHS.getOperand(0), + Addr, LHS.getOperand(2)); + else + Load = DAG.getExtLoad(LHS.getOpcode(), TheSelect->getValueType(0), + LHS.getOperand(0), Addr, LHS.getOperand(2), + cast(LHS.getOperand(3))->getVT()); + // Users of the select now use the result of the load. + CombineTo(TheSelect, Load); + + // Users of the old loads now use the new load's chain. We know the + // old-load value is dead now. + CombineTo(LHS.Val, Load.getValue(0), Load.getValue(1)); + CombineTo(RHS.Val, Load.getValue(0), Load.getValue(1)); + return true; + } + } + + return false; +} + SDOperand DAGCombiner::SimplifySelectCC(SDOperand N0, SDOperand N1, SDOperand N2, SDOperand N3, ISD::CondCode CC) { From lattner at cs.uiuc.edu Tue Oct 18 01:28:27 2005 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Tue, 18 Oct 2005 01:28:27 -0500 Subject: [llvm-commits] CVS: llvm/include/llvm/Transforms/IPO.h Message-ID: <200510180628.BAA06787@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm/Transforms: IPO.h updated: 1.43 -> 1.44 --- Log message: add an option to the internalize pass --- Diffs of the changes: (+5 -3) IPO.h | 8 +++++--- 1 files changed, 5 insertions(+), 3 deletions(-) Index: llvm/include/llvm/Transforms/IPO.h diff -u llvm/include/llvm/Transforms/IPO.h:1.43 llvm/include/llvm/Transforms/IPO.h:1.44 --- llvm/include/llvm/Transforms/IPO.h:1.43 Sun Apr 24 21:54:00 2005 +++ llvm/include/llvm/Transforms/IPO.h Tue Oct 18 01:28:16 2005 @@ -111,10 +111,12 @@ //===----------------------------------------------------------------------===// /// createInternalizePass - This pass loops over all of the functions in the -/// input module, looking for a main function. If a main function is found, all -/// other functions are marked as internal. +/// input module, looking for a main function. If a list of symbols is +/// specified with the -internalize-public-api-* command line options, those +/// symbols are internalized. Otherwise if InternalizeEverything is set and +/// the main function is found, all other globals are marked as internal. /// -ModulePass *createInternalizePass(); +ModulePass *createInternalizePass(bool InternalizeEverything); //===----------------------------------------------------------------------===// /// createDeadArgEliminationPass - This pass removes arguments from functions From lattner at cs.uiuc.edu Tue Oct 18 01:29:33 2005 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Tue, 18 Oct 2005 01:29:33 -0500 Subject: [llvm-commits] CVS: llvm/lib/Transforms/IPO/Internalize.cpp Message-ID: <200510180629.BAA06869@zion.cs.uiuc.edu> Changes in directory llvm/lib/Transforms/IPO: Internalize.cpp updated: 1.25 -> 1.26 --- Log message: Add an option to this pass. If it is set, we are allowed to internalize all but main. If it's not set, we can still internalize, but only if an explicit symbol list is provided. --- Diffs of the changes: (+10 -4) Internalize.cpp | 14 ++++++++++---- 1 files changed, 10 insertions(+), 4 deletions(-) Index: llvm/lib/Transforms/IPO/Internalize.cpp diff -u llvm/lib/Transforms/IPO/Internalize.cpp:1.25 llvm/lib/Transforms/IPO/Internalize.cpp:1.26 --- llvm/lib/Transforms/IPO/Internalize.cpp:1.25 Thu Apr 21 18:39:37 2005 +++ llvm/lib/Transforms/IPO/Internalize.cpp Tue Oct 18 01:29:22 2005 @@ -41,12 +41,16 @@ class InternalizePass : public ModulePass { std::set ExternalNames; + bool DontInternalize; public: - InternalizePass() { + InternalizePass(bool InternalizeEverything = true) : DontInternalize(false){ if (!APIFile.empty()) // If a filename is specified, use it LoadFile(APIFile.c_str()); - else // Else, if a list is specified, use it. + else if (!APIList.empty()) // Else, if a list is specified, use it. ExternalNames.insert(APIList.begin(), APIList.end()); + else if (!InternalizeEverything) + // Finally, if we're allowed to, internalize all but main. + DontInternalize = true; } void LoadFile(const char *Filename) { @@ -66,6 +70,8 @@ } virtual bool runOnModule(Module &M) { + if (DontInternalize) return false; + // If no list or file of symbols was specified, check to see if there is a // "main" symbol defined in the module. If so, use it, otherwise do not // internalize the module, it must be a library or something. @@ -117,6 +123,6 @@ RegisterOpt X("internalize", "Internalize Global Symbols"); } // end anonymous namespace -ModulePass *llvm::createInternalizePass() { - return new InternalizePass(); +ModulePass *llvm::createInternalizePass(bool InternalizeEverything) { + return new InternalizePass(InternalizeEverything); } From lattner at cs.uiuc.edu Tue Oct 18 01:29:55 2005 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Tue, 18 Oct 2005 01:29:55 -0500 Subject: [llvm-commits] CVS: llvm/tools/gccld/GenerateCode.cpp Message-ID: <200510180629.BAA06913@zion.cs.uiuc.edu> Changes in directory llvm/tools/gccld: GenerateCode.cpp updated: 1.53 -> 1.54 --- Log message: Fix PR637: http://llvm.cs.uiuc.edu/PR637 --- Diffs of the changes: (+4 -6) GenerateCode.cpp | 10 ++++------ 1 files changed, 4 insertions(+), 6 deletions(-) Index: llvm/tools/gccld/GenerateCode.cpp diff -u llvm/tools/gccld/GenerateCode.cpp:1.53 llvm/tools/gccld/GenerateCode.cpp:1.54 --- llvm/tools/gccld/GenerateCode.cpp:1.53 Fri Sep 23 01:11:24 2005 +++ llvm/tools/gccld/GenerateCode.cpp Tue Oct 18 01:29:43 2005 @@ -216,12 +216,10 @@ addPass(Passes, createFunctionResolvingPass()); if (!DisableOptimizations) { - if (Internalize) { - // Now that composite has been compiled, scan through the module, looking - // for a main function. If main is defined, mark all other functions - // internal. - addPass(Passes, createInternalizePass()); - } + // Now that composite has been compiled, scan through the module, looking + // for a main function. If main is defined, mark all other functions + // internal. + addPass(Passes, createInternalizePass(Internalize)); // Now that we internalized some globals, see if we can hack on them! addPass(Passes, createGlobalOptimizerPass()); From lattner at cs.uiuc.edu Tue Oct 18 01:29:55 2005 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Tue, 18 Oct 2005 01:29:55 -0500 Subject: [llvm-commits] CVS: llvm/tools/llvm-ld/Optimize.cpp Message-ID: <200510180629.BAA06909@zion.cs.uiuc.edu> Changes in directory llvm/tools/llvm-ld: Optimize.cpp updated: 1.5 -> 1.6 --- Log message: Fix PR637: http://llvm.cs.uiuc.edu/PR637 --- Diffs of the changes: (+4 -6) Optimize.cpp | 10 ++++------ 1 files changed, 4 insertions(+), 6 deletions(-) Index: llvm/tools/llvm-ld/Optimize.cpp diff -u llvm/tools/llvm-ld/Optimize.cpp:1.5 llvm/tools/llvm-ld/Optimize.cpp:1.6 --- llvm/tools/llvm-ld/Optimize.cpp:1.5 Thu Apr 21 18:59:38 2005 +++ llvm/tools/llvm-ld/Optimize.cpp Tue Oct 18 01:29:43 2005 @@ -111,12 +111,10 @@ addPass(Passes, createFunctionResolvingPass()); if (!DisableOptimizations) { - if (!DisableInternalize) { - // Now that composite has been compiled, scan through the module, looking - // for a main function. If main is defined, mark all other functions - // internal. - addPass(Passes, createInternalizePass()); - } + // Now that composite has been compiled, scan through the module, looking + // for a main function. If main is defined, mark all other functions + // internal. + addPass(Passes, createInternalizePass(!DisableInternalize)); // Now that we internalized some globals, see if we can hack on them! addPass(Passes, createGlobalOptimizerPass()); From lattner at cs.uiuc.edu Tue Oct 18 01:31:02 2005 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Tue, 18 Oct 2005 01:31:02 -0500 Subject: [llvm-commits] CVS: llvm/lib/Target/PowerPC/README.txt Message-ID: <200510180631.BAA07002@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/PowerPC: README.txt updated: 1.32 -> 1.33 --- Log message: add a case --- Diffs of the changes: (+3 -0) README.txt | 3 +++ 1 files changed, 3 insertions(+) Index: llvm/lib/Target/PowerPC/README.txt diff -u llvm/lib/Target/PowerPC/README.txt:1.32 llvm/lib/Target/PowerPC/README.txt:1.33 --- llvm/lib/Target/PowerPC/README.txt:1.32 Sun Oct 16 00:39:50 2005 +++ llvm/lib/Target/PowerPC/README.txt Tue Oct 18 01:30:51 2005 @@ -24,6 +24,9 @@ rlwinm r3, r2, 0, 16, 31 blr +and: + extern int X, Y; int* test(int C) { return C? &X : &Y; } +as one load when using --enable-pic. * Support 'update' load/store instructions. These are cracked on the G5, but are still a codesize win. From jlaskey at apple.com Tue Oct 18 11:23:52 2005 From: jlaskey at apple.com (Jim Laskey) Date: Tue, 18 Oct 2005 11:23:52 -0500 Subject: [llvm-commits] CVS: llvm/lib/Target/TargetSchedule.td Message-ID: <200510181623.LAA08068@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target: TargetSchedule.td added (r1.1) --- Log message: Checking in first round of scheduling tablegen files. Not tied in as yet. --- Diffs of the changes: (+74 -0) TargetSchedule.td | 74 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 74 insertions(+) Index: llvm/lib/Target/TargetSchedule.td diff -c /dev/null llvm/lib/Target/TargetSchedule.td:1.1 *** /dev/null Tue Oct 18 11:23:50 2005 --- llvm/lib/Target/TargetSchedule.td Tue Oct 18 11:23:40 2005 *************** *** 0 **** --- 1,74 ---- + //===- TargetSchedule.td - Target Independent Scheduling ---*- tablegen -*-===// + // + // The LLVM Compiler Infrastructure + // + // This file was developed by James M. Laskey and is distributed under + // the University of Illinois Open Source License. See LICENSE.TXT for details. + // + //===----------------------------------------------------------------------===// + // + // This file defines the target-independent scheduling interfaces which should + // be implemented by each target which is using TableGen based scheduling. + // + //===----------------------------------------------------------------------===// + + //===----------------------------------------------------------------------===// + // Processor chip sets - These values represent each of the chip sets supported + // by the scheduler. Each Processor definition requires corresponding + // instruction itineraries. + // + class Processor; + + //===----------------------------------------------------------------------===// + // Processor functional unit - These values represent the function units + // available across all chip sets for the target. Eg., IntUnit, FPUnit, ... + // These may be independent values for each chip set or may be shared across + // all chip sets of the target. Each functional unit is treated as a resource + // during scheduling and has an affect instruction order based on availability + // during a time interval. + // + class FuncUnit; + + //===----------------------------------------------------------------------===// + // Instruction stage - These values represent a step in the execution of an + // instruction. The latency represents the number of discrete time slots used + // need to complete the stage. Units represent the choice of functional units + // that can be used to complete the stage. Eg. IntUnit1, IntUnit2. + // + class InstrStage units> { + int Latency = latency; // length of stage in machine cycles + list Units = units; // choice of functional units + } + + //===----------------------------------------------------------------------===// + // Instruction itinerary - An itinerary represents a sequential series of steps + // required to complete an instruction. Itineraries are represented as lists of + // instruction stages. + // + + //===----------------------------------------------------------------------===// + // Instruction itinerary classes - These values represent 'named' instruction + // itinerary. Using named itineraries simplifies managing groups of + // instructions across chip sets. An instruction uses the same itinerary class + // across all chip sets. Thus a new chip set can be added without modifying + // instruction information. + // + class InstrItinClass; + + //===----------------------------------------------------------------------===// + // Instruction itinerary data - These values provide a runtime map of an + // instruction itinerary class (name) to it's itinerary data. + // + class InstrItinData stages> { + InstrItinClass TheClass = Class; + list Stages = stages; + } + + //===----------------------------------------------------------------------===// + // Processor itineraries - These values represent the set of all itinerary + // classes for a given chip set. + // + class ProcessorItineraries iid> { + Processor Proc = proc; + list IID = iid; + } From jlaskey at apple.com Tue Oct 18 11:23:52 2005 From: jlaskey at apple.com (Jim Laskey) Date: Tue, 18 Oct 2005 11:23:52 -0500 Subject: [llvm-commits] CVS: llvm/lib/Target/PowerPC/PPCSchedule.td PPCScheduleG3.td PPCScheduleG4.td PPCScheduleG4Plus.td PPCScheduleG5.td Message-ID: <200510181623.LAA08064@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/PowerPC: PPCSchedule.td added (r1.1) PPCScheduleG3.td added (r1.1) PPCScheduleG4.td added (r1.1) PPCScheduleG4Plus.td added (r1.1) PPCScheduleG5.td added (r1.1) --- Log message: Checking in first round of scheduling tablegen files. Not tied in as yet. --- Diffs of the changes: (+873 -0) PPCSchedule.td | 520 +++++++++++++++++++++++++++++++++++++++++++++++++++ PPCScheduleG3.td | 89 ++++++++ PPCScheduleG4.td | 88 ++++++++ PPCScheduleG4Plus.td | 88 ++++++++ PPCScheduleG5.td | 88 ++++++++ 5 files changed, 873 insertions(+) Index: llvm/lib/Target/PowerPC/PPCSchedule.td diff -c /dev/null llvm/lib/Target/PowerPC/PPCSchedule.td:1.1 *** /dev/null Tue Oct 18 11:23:50 2005 --- llvm/lib/Target/PowerPC/PPCSchedule.td Tue Oct 18 11:23:40 2005 *************** *** 0 **** --- 1,520 ---- + //===- PPCSchedule.td - PowerPC Scheduling Definitions -----*- tablegen -*-===// + // + // The LLVM Compiler Infrastructure + // + // This file was developed by James M. Laskey and is distributed under + // the University of Illinois Open Source License. See LICENSE.TXT for details. + // + //===----------------------------------------------------------------------===// + + #include "../TargetSchedule.td" + + //===----------------------------------------------------------------------===// + // PowerPC chips sets supported by scheduling (Apple naming) + // + def G3 : Processor; + def G4 : Processor; + def G4Plus : Processor; + def G5 : Processor; + + //===----------------------------------------------------------------------===// + // Functional units across PowerPC chips sets + // + def NoUnit : FuncUnit; // Instruction not supported on chip set + def BPU : FuncUnit; // Branch unit + def SLU : FuncUnit; // Store/load unit + def SRU : FuncUnit; // special register unit + def IU1 : FuncUnit; // integer unit 1 (simple) + def IU2 : FuncUnit; // integer unit 2 (complex) + def IU3 : FuncUnit; // integer unit 3 (7450 simple) + def IU4 : FuncUnit; // integer unit 4 (7450 simple) + def FPU1 : FuncUnit; // floating point unit 1 + def FPU2 : FuncUnit; // floating point unit 2 + def VPU : FuncUnit; // vector permutation unit + def VIU1 : FuncUnit; // vector integer unit 1 (simple) + def VIU2 : FuncUnit; // vector integer unit 2 (complex) + def VFPU : FuncUnit; // vector floating point unit + + + //===----------------------------------------------------------------------===// + // Instruction Itinerary classes used for PowerPC + // + def IntGeneral : InstrItinClass; + def IntCompare : InstrItinClass; + def IntDivD : InstrItinClass; + def IntDivW : InstrItinClass; + def IntMFFS : InstrItinClass; + def IntMFVSCR : InstrItinClass; + def IntMTFSB0 : InstrItinClass; + def IntMTSRD : InstrItinClass; + def IntMulHD : InstrItinClass; + def IntMulHW : InstrItinClass; + def IntMulHWU : InstrItinClass; + def IntMulLI : InstrItinClass; + def IntRFID : InstrItinClass; + def IntRotateD : InstrItinClass; + def IntRotate : InstrItinClass; + def IntShift : InstrItinClass; + def IntTrapD : InstrItinClass; + def IntTrapW : InstrItinClass; + def BrB : InstrItinClass; + def BrCR : InstrItinClass; + def BrMCR : InstrItinClass; + def BrMCRX : InstrItinClass; + def LdStDCBA : InstrItinClass; + def LdStDCBF : InstrItinClass; + def LdStDCBI : InstrItinClass; + def LdStDCBT : InstrItinClass; + def LdStDSS : InstrItinClass; + def LdStICBI : InstrItinClass; + def LdStLBZUX : InstrItinClass; + def LdStLD : InstrItinClass; + def LdStLDARX : InstrItinClass; + def LdStLFD : InstrItinClass; + def LdStLFDU : InstrItinClass; + def LdStLHA : InstrItinClass; + def LdStLMW : InstrItinClass; + def LdStLVEBX : InstrItinClass; + def LdStLWA : InstrItinClass; + def LdStLWARX : InstrItinClass; + def LdStSLBIA : InstrItinClass; + def LdStSLBIE : InstrItinClass; + def LdStSTD : InstrItinClass; + def LdStSTDCX : InstrItinClass; + def LdStSTVEBX : InstrItinClass; + def LdStSTWCX : InstrItinClass; + def LdStSync : InstrItinClass; + def SprISYNC : InstrItinClass; + def SprMFSR : InstrItinClass; + def SprMTMSR : InstrItinClass; + def SprMTSR : InstrItinClass; + def SprTLBSYNC : InstrItinClass; + def SprMFCR : InstrItinClass; + def SprMFMSR : InstrItinClass; + def SprMFSPR : InstrItinClass; + def SprMFTB : InstrItinClass; + def SprMTSPR : InstrItinClass; + def SprMTSRIN : InstrItinClass; + def SprRFI : InstrItinClass; + def SprSC : InstrItinClass; + def FPGeneral : InstrItinClass; + def FPCompare : InstrItinClass; + def FPDivD : InstrItinClass; + def FPDivS : InstrItinClass; + def FPFused : InstrItinClass; + def FPRes : InstrItinClass; + def FPSqrt : InstrItinClass; + def VecGeneral : InstrItinClass; + def VecFP : InstrItinClass; + def VecFPCompare : InstrItinClass; + def VecComplex : InstrItinClass; + def VecPerm : InstrItinClass; + def VecFPRound : InstrItinClass; + def VecVSL : InstrItinClass; + def VecVSR : InstrItinClass; + + //===----------------------------------------------------------------------===// + // Processor instruction itineraries. + + #include "PPCScheduleG3.td" + #include "PPCScheduleG4.td" + #include "PPCScheduleG4Plus.td" + #include "PPCScheduleG5.td" + + //===----------------------------------------------------------------------===// + // Instruction to itinerary class map - When add new opcodes to the supported + // set, refer to the following table to determine which itinerary class the + // opcode belongs. + // + // opcode itinerary class + // ====== =============== + // add IntGeneral + // addc IntGeneral + // adde IntGeneral + // addi IntGeneral + // addic IntGeneral + // addic. IntGeneral + // addis IntGeneral + // addme IntGeneral + // addze IntGeneral + // and IntGeneral + // andc IntGeneral + // andi. IntGeneral + // andis. IntGeneral + // b BrB + // bc BrB + // bcctr BrB + // bclr BrB + // cmp IntCompare + // cmpi IntCompare + // cmpl IntCompare + // cmpli IntCompare + // cntlzd IntRotateD + // cntlzw IntGeneral + // crand BrCR + // crandc BrCR + // creqv BrCR + // crnand BrCR + // crnor BrCR + // cror BrCR + // crorc BrCR + // crxor BrCR + // dcba LdStDCBA + // dcbf LdStDCBF + // dcbi LdStDCBI + // dcbst LdStDCBF + // dcbt LdStDCBT + // dcbtst LdStDCBT + // dcbz LdStDCBF + // divd IntDivD + // divdu IntDivD + // divw IntDivW + // divwu IntDivW + // dss LdStDSS + // dst LdStDSS + // dstst LdStDSS + // eciwx LdStDCBT + // ecowx LdStDCBT + // eieio LdStDCBT + // eqv IntGeneral + // extsb IntGeneral + // extsh IntGeneral + // extsw IntRotateD + // fabs FPGeneral + // fadd FPGeneral + // fadds FPGeneral + // fcfid FPGeneral + // fcmpo FPCompare + // fcmpu FPCompare + // fctid FPGeneral + // fctidz FPGeneral + // fctiw FPGeneral + // fctiwz FPGeneral + // fdiv FPDivD + // fdivs FPDivS + // fmadd FPFused + // fmadds FPGeneral + // fmr FPGeneral + // fmsub FPFused + // fmsubs FPGeneral + // fmul FPFused + // fmuls FPGeneral + // fnabs FPGeneral + // fneg FPGeneral + // fnmadd FPFused + // fnmadds FPGeneral + // fnmsub FPFused + // fnmsubs FPGeneral + // fres FPRes + // frsp FPGeneral + // frsqrte FPGeneral + // fsel FPGeneral + // fsqrt FPSqrt + // fsqrts FPSqrt + // fsub FPGeneral + // fsubs FPGeneral + // icbi LdStICBI + // isync SprISYNC + // lbz LdStDCBT + // lbzu LdStDCBT + // lbzux LdStLBZUX + // lbzx LdStDCBT + // ld LdStLD + // ldarx LdStLDARX + // ldu LdStLD + // ldux LdStLD + // ldx LdStLD + // lfd LdStLFD + // lfdu LdStLFDU + // lfdux LdStLFDU + // lfdx LdStLFDU + // lfs LdStLFDU + // lfsu LdStLFDU + // lfsux LdStLFDU + // lfsx LdStLFDU + // lha LdStLHA + // lhau LdStLHA + // lhaux LdStLHA + // lhax LdStLHA + // lhbrx LdStDCBT + // lhz LdStDCBT + // lhzu LdStDCBT + // lhzux LdStLBZUX + // lhzx LdStDCBT + // lmw LdStLMW + // lswi LdStLMW + // lswx LdStLMW + // lvebx LdStLVEBX + // lvehx LdStLVEBX + // lvewx LdStLVEBX + // lvsl LdStLVEBX + // lvsr LdStLVEBX + // lvx LdStLVEBX + // lvxl LdStLVEBX + // lwa LdStLWA + // lwarx LdStLWARX + // lwaux LdStLHA + // lwax LdStLHA + // lwbrx LdStDCBT + // lwz LdStDCBT + // lwzu LdStDCBT + // lwzux LdStLBZUX + // lwzx LdStDCBT + // mcrf BrMCR + // mcrfs FPGeneral + // mcrxr BrMCRX + // mfcr SprMFCR + // mffs IntMFFS + // mfmsr SprMFMSR + // mfspr SprMFSPR + // mfsr SprMFSR + // mfsrin SprMFSR + // mftb SprMFTB + // mfvscr IntMFVSCR + // mtcrf BrMCRX + // mtfsb0 IntMTFSB0 + // mtfsb1 IntMTFSB0 + // mtfsf IntMTFSB0 + // mtfsfi IntMTFSB0 + // mtmsr SprMTMSR + // mtmsrd LdStLD + // mtspr SprMTSPR + // mtsr SprMTSR + // mtsrd IntMTSRD + // mtsrdin IntMTSRD + // mtsrin SprMTSRIN + // mtvscr IntMFVSCR + // mulhd IntMulHD + // mulhdu IntMulHD + // mulhw IntMulHW + // mulhwu IntMulHWU + // mulld IntMulHD + // mulli IntMulLI + // mullw IntMulHW + // nand IntGeneral + // neg IntGeneral + // nor IntGeneral + // or IntGeneral + // orc IntGeneral + // ori IntGeneral + // oris IntGeneral + // rfi SprRFI + // rfid IntRFID + // rldcl IntRotateD + // rldcr IntRotateD + // rldic IntRotateD + // rldicl IntRotateD + // rldicr IntRotateD + // rldimi IntRotateD + // rlwimi IntRotate + // rlwinm IntGeneral + // rlwnm IntGeneral + // sc SprSC + // slbia LdStSLBIA + // slbie LdStSLBIE + // sld IntRotateD + // slw IntGeneral + // srad IntRotateD + // sradi IntRotateD + // sraw IntShift + // srawi IntShift + // srd IntRotateD + // srw IntGeneral + // stb LdStDCBT + // stbu LdStDCBT + // stbux LdStDCBT + // stbx LdStDCBT + // std LdStSTD + // stdcx. LdStSTDCX + // stdu LdStSTD + // stdux LdStSTD + // stdx LdStSTD + // stfd LdStLBZUX + // stfdu LdStLBZUX + // stfdux LdStLBZUX + // stfdx LdStLBZUX + // stfiwx LdStLBZUX + // stfs LdStLBZUX + // stfsu LdStLBZUX + // stfsux LdStLBZUX + // stfsx LdStLBZUX + // sth LdStDCBT + // sthbrx LdStDCBT + // sthu LdStDCBT + // sthux LdStDCBT + // sthx LdStDCBT + // stmw LdStLMW + // stswi LdStLMW + // stswx LdStLMW + // stvebx LdStSTVEBX + // stvehx LdStSTVEBX + // stvewx LdStSTVEBX + // stvx LdStSTVEBX + // stvxl LdStSTVEBX + // stw LdStDCBT + // stwbrx LdStDCBT + // stwcx. LdStSTWCX + // stwu LdStDCBT + // stwux LdStDCBT + // stwx LdStDCBT + // subf IntGeneral + // subfc IntGeneral + // subfe IntGeneral + // subfic IntGeneral + // subfme IntGeneral + // subfze IntGeneral + // sync LdStSync + // td IntTrapD + // tdi IntTrapD + // tlbia LdStSLBIA + // tlbie LdStDCBF + // tlbsync SprTLBSYNC + // tw IntTrapW + // twi IntTrapW + // vaddcuw VecGeneral + // vaddfp VecFP + // vaddsbs VecGeneral + // vaddshs VecGeneral + // vaddsws VecGeneral + // vaddubm VecGeneral + // vaddubs VecGeneral + // vadduhm VecGeneral + // vadduhs VecGeneral + // vadduwm VecGeneral + // vadduws VecGeneral + // vand VecGeneral + // vandc VecGeneral + // vavgsb VecGeneral + // vavgsh VecGeneral + // vavgsw VecGeneral + // vavgub VecGeneral + // vavguh VecGeneral + // vavguw VecGeneral + // vcfsx VecFP + // vcfux VecFP + // vcmpbfp VecFPCompare + // vcmpeqfp VecFPCompare + // vcmpequb VecGeneral + // vcmpequh VecGeneral + // vcmpequw VecGeneral + // vcmpgefp VecFPCompare + // vcmpgtfp VecFPCompare + // vcmpgtsb VecGeneral + // vcmpgtsh VecGeneral + // vcmpgtsw VecGeneral + // vcmpgtub VecGeneral + // vcmpgtuh VecGeneral + // vcmpgtuw VecGeneral + // vctsxs VecFP + // vctuxs VecFP + // vexptefp VecFP + // vlogefp VecFP + // vmaddfp VecFP + // vmaxfp VecFPCompare + // vmaxsb VecGeneral + // vmaxsh VecGeneral + // vmaxsw VecGeneral + // vmaxub VecGeneral + // vmaxuh VecGeneral + // vmaxuw VecGeneral + // vmhaddshs VecComplex + // vmhraddshs VecComplex + // vminfp VecFPCompare + // vminsb VecGeneral + // vminsh VecGeneral + // vminsw VecGeneral + // vminub VecGeneral + // vminuh VecGeneral + // vminuw VecGeneral + // vmladduhm VecComplex + // vmrghb VecPerm + // vmrghh VecPerm + // vmrghw VecPerm + // vmrglb VecPerm + // vmrglh VecPerm + // vmrglw VecPerm + // vmsubfp VecFP + // vmsummbm VecComplex + // vmsumshm VecComplex + // vmsumshs VecComplex + // vmsumubm VecComplex + // vmsumuhm VecComplex + // vmsumuhs VecComplex + // vmulesb VecComplex + // vmulesh VecComplex + // vmuleub VecComplex + // vmuleuh VecComplex + // vmulosb VecComplex + // vmulosh VecComplex + // vmuloub VecComplex + // vmulouh VecComplex + // vnor VecGeneral + // vor VecGeneral + // vperm VecPerm + // vpkpx VecPerm + // vpkshss VecPerm + // vpkshus VecPerm + // vpkswss VecPerm + // vpkswus VecPerm + // vpkuhum VecPerm + // vpkuhus VecPerm + // vpkuwum VecPerm + // vpkuwus VecPerm + // vrefp VecFPRound + // vrfim VecFPRound + // vrfin VecFPRound + // vrfip VecFPRound + // vrfiz VecFPRound + // vrlb VecGeneral + // vrlh VecGeneral + // vrlw VecGeneral + // vrsqrtefp VecFP + // vsel VecGeneral + // vsl VecVSL + // vslb VecGeneral + // vsldoi VecPerm + // vslh VecGeneral + // vslo VecPerm + // vslw VecGeneral + // vspltb VecPerm + // vsplth VecPerm + // vspltisb VecPerm + // vspltish VecPerm + // vspltisw VecPerm + // vspltw VecPerm + // vsr VecVSR + // vsrab VecGeneral + // vsrah VecGeneral + // vsraw VecGeneral + // vsrb VecGeneral + // vsrh VecGeneral + // vsro VecPerm + // vsrw VecGeneral + // vsubcuw VecGeneral + // vsubfp VecFP + // vsubsbs VecGeneral + // vsubshs VecGeneral + // vsubsws VecGeneral + // vsububm VecGeneral + // vsububs VecGeneral + // vsubuhm VecGeneral + // vsubuhs VecGeneral + // vsubuwm VecGeneral + // vsubuws VecGeneral + // vsum2sws VecComplex + // vsum4sbs VecComplex + // vsum4shs VecComplex + // vsum4ubs VecComplex + // vsumsws VecComplex + // vupkhpx VecPerm + // vupkhsb VecPerm + // vupkhsh VecPerm + // vupklpx VecPerm + // vupklsb VecPerm + // vupklsh VecPerm + // vxor VecGeneral + // xor IntGeneral + // xori IntGeneral + // xoris IntGeneral + // + Index: llvm/lib/Target/PowerPC/PPCScheduleG3.td diff -c /dev/null llvm/lib/Target/PowerPC/PPCScheduleG3.td:1.1 *** /dev/null Tue Oct 18 11:23:52 2005 --- llvm/lib/Target/PowerPC/PPCScheduleG3.td Tue Oct 18 11:23:40 2005 *************** *** 0 **** --- 1,89 ---- + //===- PPCScheduleG3.td - PPC G3 Scheduling Definitions ----*- tablegen -*-===// + // + // The LLVM Compiler Infrastructure + // + // This file was developed by James M. Laskey and is distributed under + // the University of Illinois Open Source License. See LICENSE.TXT for details. + // + //===----------------------------------------------------------------------===// + // + // This file defines the itinerary class data for the G3 (750) processor. + // + //===----------------------------------------------------------------------===// + + + def G3Itineraries : ProcessorItineraries]>, + InstrItinData]>, + InstrItinData]>, + InstrItinData]>, + InstrItinData]>, + InstrItinData]>, + InstrItinData]>, + InstrItinData]>, + InstrItinData]>, + InstrItinData]>, + InstrItinData]>, + InstrItinData]>, + InstrItinData]>, + InstrItinData]>, + InstrItinData]>, + InstrItinData]>, + InstrItinData]>, + InstrItinData]>, + InstrItinData]>, + InstrItinData]>, + InstrItinData]>, + InstrItinData]>, + InstrItinData]>, + InstrItinData]>, + InstrItinData]>, + InstrItinData]>, + InstrItinData]>, + InstrItinData]>, + InstrItinData]>, + InstrItinData]>, + InstrItinData]>, + InstrItinData]>, + InstrItinData]>, + InstrItinData]>, + InstrItinData]>, + InstrItinData]>, + InstrItinData]>, + InstrItinData]>, + InstrItinData]>, + InstrItinData]>, + InstrItinData]>, + InstrItinData]>, + InstrItinData]>, + InstrItinData]>, + InstrItinData]>, + InstrItinData]>, + InstrItinData]>, + InstrItinData]>, + InstrItinData]>, + InstrItinData]>, + InstrItinData]>, + InstrItinData]>, + InstrItinData]>, + InstrItinData]>, + InstrItinData]>, + InstrItinData]>, + InstrItinData]>, + InstrItinData]>, + InstrItinData]>, + InstrItinData]>, + InstrItinData]>, + InstrItinData]>, + InstrItinData]>, + InstrItinData]>, + InstrItinData]>, + InstrItinData]>, + InstrItinData]>, + InstrItinData]>, + InstrItinData]>, + InstrItinData]>, + InstrItinData]>, + InstrItinData]>, + InstrItinData]> + ]>; Index: llvm/lib/Target/PowerPC/PPCScheduleG4.td diff -c /dev/null llvm/lib/Target/PowerPC/PPCScheduleG4.td:1.1 *** /dev/null Tue Oct 18 11:23:52 2005 --- llvm/lib/Target/PowerPC/PPCScheduleG4.td Tue Oct 18 11:23:40 2005 *************** *** 0 **** --- 1,88 ---- + //===- PPCScheduleG4.td - PPC G4 Scheduling Definitions ----*- tablegen -*-===// + // + // The LLVM Compiler Infrastructure + // + // This file was developed by James M. Laskey and is distributed under + // the University of Illinois Open Source License. See LICENSE.TXT for details. + // + //===----------------------------------------------------------------------===// + // + // This file defines the itinerary class data for the G4 (7400) processor. + // + //===----------------------------------------------------------------------===// + + def G4Itineraries : ProcessorItineraries]>, + InstrItinData]>, + InstrItinData]>, + InstrItinData]>, + InstrItinData]>, + InstrItinData]>, + InstrItinData]>, + InstrItinData]>, + InstrItinData]>, + InstrItinData]>, + InstrItinData]>, + InstrItinData]>, + InstrItinData]>, + InstrItinData]>, + InstrItinData]>, + InstrItinData]>, + InstrItinData]>, + InstrItinData]>, + InstrItinData]>, + InstrItinData]>, + InstrItinData]>, + InstrItinData]>, + InstrItinData]>, + InstrItinData]>, + InstrItinData]>, + InstrItinData]>, + InstrItinData]>, + InstrItinData]>, + InstrItinData]>, + InstrItinData]>, + InstrItinData]>, + InstrItinData]>, + InstrItinData]>, + InstrItinData]>, + InstrItinData]>, + InstrItinData]>, + InstrItinData]>, + InstrItinData]>, + InstrItinData]>, + InstrItinData]>, + InstrItinData]>, + InstrItinData]>, + InstrItinData]>, + InstrItinData]>, + InstrItinData]>, + InstrItinData]>, + InstrItinData]>, + InstrItinData]>, + InstrItinData]>, + InstrItinData]>, + InstrItinData]>, + InstrItinData]>, + InstrItinData]>, + InstrItinData]>, + InstrItinData]>, + InstrItinData]>, + InstrItinData]>, + InstrItinData]>, + InstrItinData]>, + InstrItinData]>, + InstrItinData]>, + InstrItinData]>, + InstrItinData]>, + InstrItinData]>, + InstrItinData]>, + InstrItinData]>, + InstrItinData]>, + InstrItinData]>, + InstrItinData]>, + InstrItinData]>, + InstrItinData]>, + InstrItinData]>, + InstrItinData]> + ]>; Index: llvm/lib/Target/PowerPC/PPCScheduleG4Plus.td diff -c /dev/null llvm/lib/Target/PowerPC/PPCScheduleG4Plus.td:1.1 *** /dev/null Tue Oct 18 11:23:52 2005 --- llvm/lib/Target/PowerPC/PPCScheduleG4Plus.td Tue Oct 18 11:23:40 2005 *************** *** 0 **** --- 1,88 ---- + //===- PPCScheduleG4Plus.td - PPC G4+ Scheduling Defs. -----*- tablegen -*-===// + // + // The LLVM Compiler Infrastructure + // + // This file was developed by James M. Laskey and is distributed under + // the University of Illinois Open Source License. See LICENSE.TXT for details. + // + //===----------------------------------------------------------------------===// + // + // This file defines the itinerary class data for the G4+ (7450) processor. + // + //===----------------------------------------------------------------------===// + + def G4PlusItineraries : ProcessorItineraries]>, + InstrItinData]>, + InstrItinData]>, + InstrItinData]>, + InstrItinData]>, + InstrItinData]>, + InstrItinData]>, + InstrItinData]>, + InstrItinData]>, + InstrItinData]>, + InstrItinData]>, + InstrItinData]>, + InstrItinData]>, + InstrItinData]>, + InstrItinData]>, + InstrItinData]>, + InstrItinData]>, + InstrItinData]>, + InstrItinData]>, + InstrItinData]>, + InstrItinData]>, + InstrItinData]>, + InstrItinData]>, + InstrItinData]>, + InstrItinData]>, + InstrItinData]>, + InstrItinData]>, + InstrItinData]>, + InstrItinData]>, + InstrItinData]>, + InstrItinData]>, + InstrItinData]>, + InstrItinData]>, + InstrItinData]>, + InstrItinData]>, + InstrItinData]>, + InstrItinData]>, + InstrItinData]>, + InstrItinData]>, + InstrItinData]>, + InstrItinData]>, + InstrItinData]>, + InstrItinData]>, + InstrItinData]>, + InstrItinData]>, + InstrItinData]>, + InstrItinData]>, + InstrItinData]>, + InstrItinData]>, + InstrItinData]>, + InstrItinData]>, + InstrItinData]>, + InstrItinData]>, + InstrItinData]>, + InstrItinData]>, + InstrItinData]>, + InstrItinData]>, + InstrItinData]>, + InstrItinData]>, + InstrItinData]>, + InstrItinData]>, + InstrItinData]>, + InstrItinData]>, + InstrItinData]>, + InstrItinData]>, + InstrItinData]>, + InstrItinData]>, + InstrItinData]>, + InstrItinData]>, + InstrItinData]>, + InstrItinData]>, + InstrItinData]>, + InstrItinData]> + ]>; Index: llvm/lib/Target/PowerPC/PPCScheduleG5.td diff -c /dev/null llvm/lib/Target/PowerPC/PPCScheduleG5.td:1.1 *** /dev/null Tue Oct 18 11:23:52 2005 --- llvm/lib/Target/PowerPC/PPCScheduleG5.td Tue Oct 18 11:23:40 2005 *************** *** 0 **** --- 1,88 ---- + //===- PPCScheduleG5.td - PPC G5 Scheduling Definitions ----*- tablegen -*-===// + // + // The LLVM Compiler Infrastructure + // + // This file was developed by James M. Laskey and is distributed under + // the University of Illinois Open Source License. See LICENSE.TXT for details. + // + //===----------------------------------------------------------------------===// + // + // This file defines the itinerary class data for the G5 (970) processor. + // + //===----------------------------------------------------------------------===// + + def G5Itineraries : ProcessorItineraries]>, + InstrItinData]>, + InstrItinData]>, + InstrItinData]>, + InstrItinData]>, + InstrItinData]>, + InstrItinData]>, + InstrItinData]>, + InstrItinData]>, + InstrItinData]>, + InstrItinData]>, + InstrItinData]>, + InstrItinData]>, + InstrItinData]>, + InstrItinData]>, + InstrItinData]>, + InstrItinData]>, + InstrItinData]>, + InstrItinData]>, + InstrItinData]>, + InstrItinData]>, + InstrItinData]>, + InstrItinData]>, + InstrItinData]>, + InstrItinData]>, + InstrItinData]>, + InstrItinData]>, + InstrItinData]>, + InstrItinData]>, + InstrItinData]>, + InstrItinData]>, + InstrItinData]>, + InstrItinData]>, + InstrItinData]>, + InstrItinData]>, + InstrItinData]>, + InstrItinData]>, + InstrItinData]>, + InstrItinData]>, + InstrItinData]>, + InstrItinData]>, + InstrItinData]>, + InstrItinData]>, + InstrItinData]>, + InstrItinData]>, + InstrItinData]>, + InstrItinData]>, + InstrItinData]>, + InstrItinData]>, + InstrItinData]>, + InstrItinData]>, + InstrItinData]>, + InstrItinData]>, + InstrItinData]>, + InstrItinData]>, + InstrItinData]>, + InstrItinData]>, + InstrItinData]>, + InstrItinData]>, + InstrItinData]>, + InstrItinData]>, + InstrItinData]>, + InstrItinData]>, + InstrItinData]>, + InstrItinData]>, + InstrItinData]>, + InstrItinData]>, + InstrItinData]>, + InstrItinData]>, + InstrItinData]>, + InstrItinData]>, + InstrItinData]>, + InstrItinData]> + ]>; From lattner at cs.uiuc.edu Tue Oct 18 11:51:33 2005 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Tue, 18 Oct 2005 11:51:33 -0500 Subject: [llvm-commits] CVS: llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp PPCInstrInfo.td PPCRegisterInfo.cpp Message-ID: <200510181651.LAA09314@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/PowerPC: PPCAsmPrinter.cpp updated: 1.99 -> 1.100 PPCInstrInfo.td updated: 1.123 -> 1.124 PPCRegisterInfo.cpp updated: 1.35 -> 1.36 --- Log message: Fix the JIT encoding of LWA, LD, STD, and STDU. --- Diffs of the changes: (+20 -4) PPCAsmPrinter.cpp | 4 ++++ PPCInstrInfo.td | 11 +++++++---- PPCRegisterInfo.cpp | 9 +++++++++ 3 files changed, 20 insertions(+), 4 deletions(-) Index: llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp diff -u llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp:1.99 llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp:1.100 --- llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp:1.99 Sun Oct 16 00:39:50 2005 +++ llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp Tue Oct 18 11:51:22 2005 @@ -117,6 +117,10 @@ MVT::ValueType VT) { O << (unsigned short)MI->getOperand(OpNo).getImmedValue(); } + void printS16X4ImmOperand(const MachineInstr *MI, unsigned OpNo, + MVT::ValueType VT) { + O << (short)MI->getOperand(OpNo).getImmedValue()*4; + } void printBranchOperand(const MachineInstr *MI, unsigned OpNo, MVT::ValueType VT) { // Branches can take an immediate operand. This is used by the branch Index: llvm/lib/Target/PowerPC/PPCInstrInfo.td diff -u llvm/lib/Target/PowerPC/PPCInstrInfo.td:1.123 llvm/lib/Target/PowerPC/PPCInstrInfo.td:1.124 --- llvm/lib/Target/PowerPC/PPCInstrInfo.td:1.123 Mon Oct 17 19:28:58 2005 +++ llvm/lib/Target/PowerPC/PPCInstrInfo.td Tue Oct 18 11:51:22 2005 @@ -89,6 +89,9 @@ def u16imm : Operand { let PrintMethod = "printU16ImmOperand"; } +def s16immX4 : Operand { // Multiply imm by 4 before printing. + let PrintMethod = "printS16X4ImmOperand"; +} def target : Operand { let PrintMethod = "printBranchOperand"; } @@ -282,15 +285,15 @@ // DS-Form instructions. Load/Store instructions available in PPC-64 // let isLoad = 1 in { -def LWA : DSForm_1<58, 2, (ops GPRC:$rT, s16imm:$DS, GPRC:$rA), +def LWA : DSForm_1<58, 2, (ops GPRC:$rT, s16immX4:$DS, GPRC:$rA), "lwa $rT, $DS($rA)">, isPPC64; -def LD : DSForm_2<58, 0, (ops GPRC:$rT, s16imm:$DS, GPRC:$rA), +def LD : DSForm_2<58, 0, (ops GPRC:$rT, s16immX4:$DS, GPRC:$rA), "ld $rT, $DS($rA)">, isPPC64; } let isStore = 1 in { -def STD : DSForm_2<62, 0, (ops GPRC:$rT, s16imm:$DS, GPRC:$rA), +def STD : DSForm_2<62, 0, (ops GPRC:$rT, s16immX4:$DS, GPRC:$rA), "std $rT, $DS($rA)">, isPPC64; -def STDU : DSForm_2<62, 1, (ops GPRC:$rT, s16imm:$DS, GPRC:$rA), +def STDU : DSForm_2<62, 1, (ops GPRC:$rT, s16immX4:$DS, GPRC:$rA), "stdu $rT, $DS($rA)">, isPPC64; } Index: llvm/lib/Target/PowerPC/PPCRegisterInfo.cpp diff -u llvm/lib/Target/PowerPC/PPCRegisterInfo.cpp:1.35 llvm/lib/Target/PowerPC/PPCRegisterInfo.cpp:1.36 --- llvm/lib/Target/PowerPC/PPCRegisterInfo.cpp:1.35 Mon Oct 17 19:28:58 2005 +++ llvm/lib/Target/PowerPC/PPCRegisterInfo.cpp Tue Oct 18 11:51:22 2005 @@ -271,6 +271,15 @@ MI.SetMachineOperandReg(1, MI.getOperand(i).getReg()); MI.SetMachineOperandReg(2, PPC::R0); } else { + switch (MI.getOpcode()) { + case PPC::LWA: + case PPC::LD: + case PPC::STD: + case PPC::STDU: + assert((Offset & 3) == 0 && "Invalid frame offset!"); + Offset >>= 2; // The actual encoded value has the low two bits zero. + break; + } MI.SetMachineOperandConst(OffIdx, MachineOperand::MO_SignExtendedImmed, Offset); } From jlaskey at apple.com Tue Oct 18 11:59:34 2005 From: jlaskey at apple.com (Jim Laskey) Date: Tue, 18 Oct 2005 11:59:34 -0500 Subject: [llvm-commits] CVS: llvm/lib/Target/PowerPC/PPCScheduleG3.td PPCScheduleG4.td PPCScheduleG4Plus.td PPCScheduleG5.td Message-ID: <200510181659.LAA11548@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/PowerPC: PPCScheduleG3.td updated: 1.1 -> 1.2 PPCScheduleG4.td updated: 1.1 -> 1.2 PPCScheduleG4Plus.td updated: 1.1 -> 1.2 PPCScheduleG5.td updated: 1.1 -> 1.2 --- Log message: Simple edits; remove unimplimented cases and clarify long haul SLU cases. --- Diffs of the changes: (+3 -61) PPCScheduleG3.td | 26 -------------------------- PPCScheduleG4.td | 15 --------------- PPCScheduleG4Plus.td | 12 ------------ PPCScheduleG5.td | 11 +++-------- 4 files changed, 3 insertions(+), 61 deletions(-) Index: llvm/lib/Target/PowerPC/PPCScheduleG3.td diff -u llvm/lib/Target/PowerPC/PPCScheduleG3.td:1.1 llvm/lib/Target/PowerPC/PPCScheduleG3.td:1.2 --- llvm/lib/Target/PowerPC/PPCScheduleG3.td:1.1 Tue Oct 18 11:23:40 2005 +++ llvm/lib/Target/PowerPC/PPCScheduleG3.td Tue Oct 18 11:59:23 2005 @@ -15,21 +15,14 @@ def G3Itineraries : ProcessorItineraries]>, InstrItinData]>, - InstrItinData]>, InstrItinData]>, InstrItinData]>, - InstrItinData]>, InstrItinData]>, - InstrItinData]>, - InstrItinData]>, InstrItinData]>, InstrItinData]>, InstrItinData]>, - InstrItinData]>, - InstrItinData]>, InstrItinData]>, InstrItinData]>, - InstrItinData]>, InstrItinData]>, InstrItinData]>, InstrItinData]>, @@ -39,23 +32,13 @@ InstrItinData]>, InstrItinData]>, InstrItinData]>, - InstrItinData]>, InstrItinData]>, InstrItinData]>, - InstrItinData]>, - InstrItinData]>, InstrItinData]>, InstrItinData]>, InstrItinData]>, InstrItinData]>, - InstrItinData]>, - InstrItinData]>, InstrItinData]>, - InstrItinData]>, - InstrItinData]>, - InstrItinData]>, - InstrItinData]>, - InstrItinData]>, InstrItinData]>, InstrItinData]>, InstrItinData]>, @@ -77,13 +60,4 @@ InstrItinData]>, InstrItinData]>, InstrItinData]>, - InstrItinData]>, - InstrItinData]>, - InstrItinData]>, - InstrItinData]>, - InstrItinData]>, - InstrItinData]>, - InstrItinData]>, - InstrItinData]>, - InstrItinData]> ]>; Index: llvm/lib/Target/PowerPC/PPCScheduleG4.td diff -u llvm/lib/Target/PowerPC/PPCScheduleG4.td:1.1 llvm/lib/Target/PowerPC/PPCScheduleG4.td:1.2 --- llvm/lib/Target/PowerPC/PPCScheduleG4.td:1.1 Tue Oct 18 11:23:40 2005 +++ llvm/lib/Target/PowerPC/PPCScheduleG4.td Tue Oct 18 11:59:23 2005 @@ -14,46 +14,32 @@ def G4Itineraries : ProcessorItineraries]>, InstrItinData]>, - InstrItinData]>, InstrItinData]>, InstrItinData]>, InstrItinData]>, InstrItinData]>, - InstrItinData]>, - InstrItinData]>, InstrItinData]>, InstrItinData]>, InstrItinData]>, - InstrItinData]>, - InstrItinData]>, InstrItinData]>, InstrItinData]>, - InstrItinData]>, InstrItinData]>, InstrItinData]>, InstrItinData]>, InstrItinData]>, InstrItinData]>, - InstrItinData]>, InstrItinData]>, InstrItinData]>, InstrItinData]>, InstrItinData]>, InstrItinData]>, InstrItinData]>, - InstrItinData]>, - InstrItinData]>, InstrItinData]>, InstrItinData]>, InstrItinData]>, InstrItinData]>, InstrItinData]>, - InstrItinData]>, InstrItinData]>, - InstrItinData]>, - InstrItinData]>, - InstrItinData]>, - InstrItinData]>, InstrItinData]>, InstrItinData]>, InstrItinData]>, @@ -76,7 +62,6 @@ InstrItinData]>, InstrItinData]>, InstrItinData]>, - InstrItinData]>, InstrItinData]>, InstrItinData]>, InstrItinData]>, Index: llvm/lib/Target/PowerPC/PPCScheduleG4Plus.td diff -u llvm/lib/Target/PowerPC/PPCScheduleG4Plus.td:1.1 llvm/lib/Target/PowerPC/PPCScheduleG4Plus.td:1.2 --- llvm/lib/Target/PowerPC/PPCScheduleG4Plus.td:1.1 Tue Oct 18 11:23:40 2005 +++ llvm/lib/Target/PowerPC/PPCScheduleG4Plus.td Tue Oct 18 11:59:23 2005 @@ -14,35 +14,26 @@ def G4PlusItineraries : ProcessorItineraries]>, InstrItinData]>, - InstrItinData]>, InstrItinData]>, InstrItinData]>, InstrItinData]>, InstrItinData]>, - InstrItinData]>, - InstrItinData]>, InstrItinData]>, InstrItinData]>, InstrItinData]>, - InstrItinData]>, - InstrItinData]>, InstrItinData]>, InstrItinData]>, - InstrItinData]>, InstrItinData]>, InstrItinData]>, InstrItinData]>, InstrItinData]>, InstrItinData]>, - InstrItinData]>, InstrItinData]>, InstrItinData]>, InstrItinData]>, InstrItinData]>, InstrItinData]>, InstrItinData]>, - InstrItinData]>, - InstrItinData]>, InstrItinData]>, InstrItinData]>, InstrItinData]>, @@ -50,8 +41,6 @@ InstrItinData]>, InstrItinData]>, InstrItinData]>, - InstrItinData]>, - InstrItinData]>, InstrItinData]>, InstrItinData]>, InstrItinData]>, @@ -76,7 +65,6 @@ InstrItinData]>, InstrItinData]>, InstrItinData]>, - InstrItinData]>, InstrItinData]>, InstrItinData]>, InstrItinData]>, Index: llvm/lib/Target/PowerPC/PPCScheduleG5.td diff -u llvm/lib/Target/PowerPC/PPCScheduleG5.td:1.1 llvm/lib/Target/PowerPC/PPCScheduleG5.td:1.2 --- llvm/lib/Target/PowerPC/PPCScheduleG5.td:1.1 Tue Oct 18 11:23:40 2005 +++ llvm/lib/Target/PowerPC/PPCScheduleG5.td Tue Oct 18 11:59:23 2005 @@ -19,7 +19,6 @@ InstrItinData]>, InstrItinData]>, InstrItinData]>, - InstrItinData]>, InstrItinData]>, InstrItinData]>, InstrItinData]>, @@ -34,12 +33,10 @@ InstrItinData]>, InstrItinData]>, InstrItinData]>, - InstrItinData]>, InstrItinData]>, - InstrItinData]>, InstrItinData]>, InstrItinData]>, - InstrItinData]>, + InstrItinData]>, InstrItinData]>, InstrItinData]>, InstrItinData]>, @@ -50,14 +47,14 @@ InstrItinData]>, InstrItinData]>, InstrItinData]>, - InstrItinData]>, + InstrItinData]>, // needs work InstrItinData]>, InstrItinData]>, InstrItinData]>, InstrItinData]>, InstrItinData]>, InstrItinData]>, - InstrItinData]>, + InstrItinData]>, // needs work InstrItinData]>, InstrItinData]>, InstrItinData]>, @@ -67,8 +64,6 @@ InstrItinData]>, InstrItinData]>, InstrItinData]>, - InstrItinData]>, - InstrItinData]>, InstrItinData]>, InstrItinData]>, InstrItinData]>, From lattner at cs.uiuc.edu Tue Oct 18 13:48:41 2005 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Tue, 18 Oct 2005 13:48:41 -0500 Subject: [llvm-commits] CVS: llvm/runtime/GC/SemiSpace/Makefile Message-ID: <200510181848.NAA11061@zion.cs.uiuc.edu> Changes in directory llvm/runtime/GC/SemiSpace: Makefile updated: 1.5 -> 1.6 --- Log message: This never got updated to reflect the project makefile changes --- Diffs of the changes: (+1 -1) Makefile | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm/runtime/GC/SemiSpace/Makefile diff -u llvm/runtime/GC/SemiSpace/Makefile:1.5 llvm/runtime/GC/SemiSpace/Makefile:1.6 --- llvm/runtime/GC/SemiSpace/Makefile:1.5 Tue Dec 21 23:57:33 2004 +++ llvm/runtime/GC/SemiSpace/Makefile Tue Oct 18 13:48:30 2005 @@ -11,7 +11,7 @@ BYTECODE_LIBRARY = 1 LIBRARYNAME = gcsemispace BYTECODE_DESTINATION = $(CFERuntimeLibDir) -EXPORTED_SYMBOL_FILE = $(BUILD_SRC_DIR)/../gc_exported_symbols.lst +EXPORTED_SYMBOL_FILE = $(PROJ_SRC_DIR)/../gc_exported_symbols.lst include $(LEVEL)/Makefile.common From lattner at cs.uiuc.edu Tue Oct 18 13:49:22 2005 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Tue, 18 Oct 2005 13:49:22 -0500 Subject: [llvm-commits] CVS: llvm/runtime/libprofile/Makefile Message-ID: <200510181849.NAA11098@zion.cs.uiuc.edu> Changes in directory llvm/runtime/libprofile: Makefile updated: 1.7 -> 1.8 --- Log message: This was never updated for the project makefile changes --- Diffs of the changes: (+1 -1) Makefile | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm/runtime/libprofile/Makefile diff -u llvm/runtime/libprofile/Makefile:1.7 llvm/runtime/libprofile/Makefile:1.8 --- llvm/runtime/libprofile/Makefile:1.7 Thu Jan 13 10:53:05 2005 +++ llvm/runtime/libprofile/Makefile Tue Oct 18 13:49:11 2005 @@ -13,7 +13,7 @@ LOADABLE_MODULE = 1 LIBRARYNAME = profile_rt EXTRA_DIST = exported_symbols.lst -EXPORTED_SYMBOL_FILE = $(BUILD_SRC_DIR)/exported_symbols.lst +EXPORTED_SYMBOL_FILE = $(PROJ_SRC_DIR)/exported_symbols.lst BYTECODE_DESTINATION = $(CFERuntimeLibDir) include $(LEVEL)/Makefile.common From lattner at cs.uiuc.edu Tue Oct 18 13:50:38 2005 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Tue, 18 Oct 2005 13:50:38 -0500 Subject: [llvm-commits] CVS: llvm/runtime/GCCLibraries/crtend/Makefile Message-ID: <200510181850.NAA11165@zion.cs.uiuc.edu> Changes in directory llvm/runtime/GCCLibraries/crtend: Makefile updated: 1.28 -> 1.29 --- Log message: This was never updated for the project makefile changes --- Diffs of the changes: (+3 -3) Makefile | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) Index: llvm/runtime/GCCLibraries/crtend/Makefile diff -u llvm/runtime/GCCLibraries/crtend/Makefile:1.28 llvm/runtime/GCCLibraries/crtend/Makefile:1.29 --- llvm/runtime/GCCLibraries/crtend/Makefile:1.28 Wed Mar 23 15:14:33 2005 +++ llvm/runtime/GCCLibraries/crtend/Makefile Tue Oct 18 13:50:26 2005 @@ -47,19 +47,19 @@ $(ObjDir)/comp_main.bc: $(MainObj) $(Echo) Linking $(notdir $@) component... $(Verb) $(GCCLD) -link-as-library \ - -internalize-public-api-file=$(BUILD_SRC_DIR)/comp_main.lst \ + -internalize-public-api-file=$(PROJ_SRC_DIR)/comp_main.lst \ $(MainObj) -o $@ # Generic exception handling support runtime. $(ObjDir)/comp_genericeh.bc: $(GenericEHObj) $(Echo) Linking $(notdir $@) component... $(Verb) $(GCCLD) -link-as-library \ - -internalize-public-api-file=$(BUILD_SRC_DIR)/comp_genericeh.lst \ + -internalize-public-api-file=$(PROJ_SRC_DIR)/comp_genericeh.lst \ $(GenericEHObj) -o $@ # setjmp/longjmp exception handling support runtime. $(ObjDir)/comp_sjljeh.bc: $(SJLJEHObj) $(Echo) Linking $(notdir $@) component... $(Verb) $(GCCLD) -link-as-library \ - -internalize-public-api-file=$(BUILD_SRC_DIR)/comp_sjljeh.lst \ + -internalize-public-api-file=$(PROJ_SRC_DIR)/comp_sjljeh.lst \ $(SJLJEHObj) -o $@ From bocchino at cs.uiuc.edu Tue Oct 18 14:21:50 2005 From: bocchino at cs.uiuc.edu (Robert Bocchino) Date: Tue, 18 Oct 2005 14:21:50 -0500 Subject: [llvm-commits] [vector_llvm] CVS: llvm/Makefile Message-ID: <200510181921.OAA13186@zion.cs.uiuc.edu> Changes in directory llvm: Makefile updated: 1.51 -> 1.51.2.1 --- Log message: Initial commit of Vector LLVM. --- Diffs of the changes: (+1 -1) Makefile | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm/Makefile diff -u llvm/Makefile:1.51 llvm/Makefile:1.51.2.1 --- llvm/Makefile:1.51 Wed Aug 24 23:59:49 2005 +++ llvm/Makefile Tue Oct 18 14:21:38 2005 @@ -14,7 +14,7 @@ else ifneq ($(MAKECMDGOALS),libs-only) DIRS += tools runtime docs - OPTIONAL_DIRS = examples projects + OPTIONAL_DIRS = #projects endif endif From bocchino at cs.uiuc.edu Tue Oct 18 14:22:17 2005 From: bocchino at cs.uiuc.edu (Robert Bocchino) Date: Tue, 18 Oct 2005 14:22:17 -0500 Subject: [llvm-commits] [vector_llvm] CVS: llvm/autoconf/configure.ac Message-ID: <200510181922.OAA13331@zion.cs.uiuc.edu> Changes in directory llvm/autoconf: configure.ac updated: 1.195 -> 1.195.2.1 --- Log message: Initial commit of Vector LLVM. --- Diffs of the changes: (+2 -1) configure.ac | 3 ++- 1 files changed, 2 insertions(+), 1 deletion(-) Index: llvm/autoconf/configure.ac diff -u llvm/autoconf/configure.ac:1.195 llvm/autoconf/configure.ac:1.195.2.1 --- llvm/autoconf/configure.ac:1.195 Wed Aug 24 05:43:10 2005 +++ llvm/autoconf/configure.ac Tue Oct 18 14:21:55 2005 @@ -74,6 +74,7 @@ "llvm-gcc") AC_CONFIG_SUBDIRS([projects/llvm-gcc]) ;; "llvm-java") AC_CONFIG_SUBDIRS([projects/llvm-java]) ;; "llvm-tv") AC_CONFIG_SUBDIRS([projects/llvm-tv]) ;; + "llvm-fefw") AC_CONFIG_SUBDIRS([projects/llvm-fefw]) ;; "llvm-poolalloc") AC_CONFIG_SUBDIRS([projects/llvm-poolalloc]) ;; *) AC_MSG_WARN([Unknown project (${i}) won't be configured automatically]) @@ -248,7 +249,7 @@ [Build specific host targets: all,host-only,{target-name} (default=all)]),, enableval=all) case "$enableval" in - all) TARGETS_TO_BUILD="X86 SparcV8 SparcV9 PowerPC Alpha IA64 Skeleton" ;; + all) TARGETS_TO_BUILD="X86 SparcV8 SparcV9 PowerPC Alpha IA64 Skeleton RSVP RSVP2" ;; host-only) case "$llvm_cv_target_arch" in x86) TARGETS_TO_BUILD="X86" ;; From bocchino at cs.uiuc.edu Tue Oct 18 14:22:19 2005 From: bocchino at cs.uiuc.edu (Robert Bocchino) Date: Tue, 18 Oct 2005 14:22:19 -0500 Subject: [llvm-commits] [vector_llvm] CVS: llvm/tools/bugpoint/Makefile Message-ID: <200510181922.OAA13341@zion.cs.uiuc.edu> Changes in directory llvm/tools/bugpoint: Makefile updated: 1.12 -> 1.12.4.1 --- Log message: Initial commit of Vector LLVM. --- Diffs of the changes: (+1 -1) Makefile | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm/tools/bugpoint/Makefile diff -u llvm/tools/bugpoint/Makefile:1.12 llvm/tools/bugpoint/Makefile:1.12.4.1 --- llvm/tools/bugpoint/Makefile:1.12 Fri Apr 22 12:14:14 2005 +++ llvm/tools/bugpoint/Makefile Tue Oct 18 14:21:59 2005 @@ -16,6 +16,6 @@ USEDLIBS = LLVMipo LLVMScalarOpts LLVMAnalysis $(OPTLIBS) $(ANALIBS) \ LLVMTransformUtils \ LLVMAsmParser LLVMLinker.a LLVMBCReader LLVMBCWriter \ - LLVMCore LLVMSupport.a LLVMbzip2 LLVMSystem.a + LLVMCore LLVMSupport.a LLVMbzip2 LLVMSystem.a #LLVMVectorOpts include $(LEVEL)/Makefile.common From bocchino at cs.uiuc.edu Tue Oct 18 14:22:18 2005 From: bocchino at cs.uiuc.edu (Robert Bocchino) Date: Tue, 18 Oct 2005 14:22:18 -0500 Subject: [llvm-commits] [vector_llvm] CVS: llvm/docs/LangRef.html Message-ID: <200510181922.OAA13335@zion.cs.uiuc.edu> Changes in directory llvm/docs: LangRef.html updated: 1.112 -> 1.112.2.1 --- Log message: Initial commit of Vector LLVM. --- Diffs of the changes: (+762 -56) LangRef.html | 818 ++++++++++++++++++++++++++++++++++++++++++++++++++++++----- 1 files changed, 762 insertions(+), 56 deletions(-) Index: llvm/docs/LangRef.html diff -u llvm/docs/LangRef.html:1.112 llvm/docs/LangRef.html:1.112.2.1 --- llvm/docs/LangRef.html:1.112 Wed Jul 20 20:29:16 2005 +++ llvm/docs/LangRef.html Tue Oct 18 14:21:55 2005 @@ -1,4 +1,4 @@ - @@ -12,7 +12,7 @@ -
LLVM Language Reference Manual
+
LLVM Language Reference Manual BETA VERSION
  1. Abstract
  2. Introduction
  3. @@ -39,7 +39,8 @@
  4. Function Type
  5. Pointer Type
  6. Structure Type
  7. -
  8. Packed Type
  9. +
  10. Vector Type
  11. +
  12. Fixed Vector Type
  13. Opaque Type
@@ -74,6 +75,7 @@
  • 'div' Instruction
  • 'rem' Instruction
  • 'setcc' Instructions
  • +
  • 'vsetcc' Instructions
  • Bitwise Binary Operations @@ -92,6 +94,9 @@
  • 'alloca' Instruction
  • 'load' Instruction
  • 'store' Instruction
  • +
  • 'vgather' Instruction
  • +
  • 'vimm' Instruction
  • +
  • 'vscatter' Instruction
  • 'getelementptr' Instruction
  • @@ -100,6 +105,11 @@
  • 'phi' Instruction
  • 'cast .. to' Instruction
  • 'select' Instruction
  • +
  • 'vselect' Instruction
  • +
  • 'extract' Instruction
  • +
  • 'extractelement' Instruction
  • +
  • 'combine' Instruction
  • +
  • 'combineelement' Instruction
  • 'call' Instruction
  • 'vaarg' Instruction
  • @@ -162,6 +172,7 @@

    Written by Chris Lattner and Vikram Adve

    +

    Vector extensions by Rob Bocchino

    @@ -645,7 +656,8 @@ first class bool, ubyte, sbyte, ushort, short, uint, int, ulong, long,
    float, double, pointer, - packed
    + vector, + fixed vector @@ -825,24 +837,66 @@ +

    + + +
    + +
    Overview:
    + +

    A vector type is a simple derived type that represents a vector of +elements whose length is not necessarily known at compile time. +Vector types are used to express vector (SIMD) parallelism when the +target architecture supports variable-length vectors, or when the +vector length of the target is not known. A vector type requires an +underlying primitive data type. Unlike arrays, +vector types are first class values.

    + +
    Syntax:
    + +
    +  [ vector of <elementtype> ]
    +
    + +

    elementtype may be any integral or floating point type.

    +
    Examples:
    + + + + + + +
    + [vector of int]
    + [vector of float]
    + [vector of uint]
    +
    + Vector of integer values.
    + Vector of floating-point values.
    + Vector of unsigned integer values.
    +
    +
    +

    - +
    Overview:
    -

    A packed type is a simple derived type that represents a vector -of elements. Packed types are used when multiple primitive data -are operated in parallel using a single instruction (SIMD). -A packed type requires a size (number of -elements) and an underlying primitive data type. Packed types are -considered first class.

    +

    A fixed vector type is a simple derived type that represents a +vector of elements whose length is a compile-time constant. Fixed +vector types are used for expressing vector (SIMD) operations when the +target is a machine with fixed-length vector regsiters (such as +AltiVec or SSE), and when the target vector length is known. A fixed +vector type requires a size (number of elements) and an underlying +primitive data type. Unlike arrays, +vector types are first class values.

    Syntax:
    -  < <# elements> x <elementtype> >
    +  [ vector of <# elements> <elementtype> ]
     

    The number of elements is a constant integer value; elementtype may @@ -853,19 +907,19 @@
    - <4 x int>
    - <8 x float>
    - <2 x uint>
    + [vector of 4 int]
    + [vector of 8 float]
    + [vector of 2 uint]
    - Packed vector of 4 integer values.
    - Packed vector of 8 floating-point values.
    - Packed vector of 2 unsigned integer values.
    + Fixed-length vector of 4 integer values.
    + Fixed-length vector of 8 floating-point values.
    + Fixed-length vector of 2 unsigned integer values.

    - +

    @@ -982,15 +1036,15 @@ types of elements must match those specified by the type. -
    Packed constants
    +
    Fixed-length vector constants
    -
    Packed constants are represented with notation similar to packed type - definitions (a comma separated list of elements, surrounded by - less-than/greater-than's (<>)). For example: "< int 42, - int 11, int 74, int 100 >". Packed constants must have packed type, and the number and types of elements must - match those specified by the type. -
    +
    Fixed-length vector constants are represented as a + comma-separated list of elements surrounded by + less-than/greater-than's (<>). For example: + "< int 42, int 11, int 74, int 100 >". Fixed-length + vector constants must have fixed vector + type, and the number and types of elements must match those + specified by the type.
    Zero initialization
    @@ -1366,7 +1420,7 @@

    Binary operators are used to do most of the computation in a program. They require two operands, execute an operation on them, and produce a single value. The operands might represent -multiple data, as is the case with the packed data type. +multiple data, as is the case with the fixed vector data type. The result value of a binary operator is not necessarily the same type as its operands.

    There are several different binary operators:

    @@ -1383,7 +1437,7 @@
    Arguments:

    The two arguments to the 'add' instruction must be either integer or floating point values. - This instruction can also take packed versions of the values. + This instruction can also take vector or fixed vector versions of the values. Both arguments must have identical types.

    Semantics:

    The value produced is the integer or floating point sum of the two @@ -1408,7 +1462,7 @@

    The two arguments to the 'sub' instruction must be either integer or floating point values. -This instruction can also take packed versions of the values. +This instruction can also take vector or fixed vector versions of the values. Both arguments must have identical types.

    Semantics:

    The value produced is the integer or floating point difference of @@ -1432,7 +1486,7 @@

    The two arguments to the 'mul' instruction must be either integer or floating point values. -This instruction can also take packed versions of the values. +This instruction can also take vector or fixed vector versions of the values. Both arguments must have identical types.

    Semantics:

    The value produced is the integer or floating point product of the @@ -1457,7 +1511,7 @@

    The two arguments to the 'div' instruction must be either integer or floating point values. -This instruction can also take packed versions of the values. +This instruction can also take vector or fixed vector versions of the values. Both arguments must have identical types.

    Semantics:

    The value produced is the integer or floating point quotient of the @@ -1480,7 +1534,7 @@

    The two arguments to the 'rem' instruction must be either integer or floating point values. -This instruction can also take packed versions of the values. +This instruction can also take vector or fixed vector versions of the values. Both arguments must have identical types.

    Semantics:

    This returns the remainder of a division (where the result @@ -1512,8 +1566,9 @@

    The two arguments to the 'setcc' instructions must be of first class type (it is not possible to compare 'label's, 'array's, 'structure' -or 'void' values, etc...). Both arguments must have identical -types.

    +or 'void' values, etc...). They may not be vector types (use +the vsetcc instructions to compare vectors). Both +arguments must have identical types.

    Semantics:

    The 'seteq' instruction yields a true 'bool' value if both operands are equal.
    @@ -1537,6 +1592,58 @@ <result> = setge sbyte 4, 5 ; yields {bool}:result = false

    + + +
    +
    Syntax:
    +
      <result> = vseteq [vector of <ty>]   <var1>, <var2>   ; yields [vector of bool]
    +  <result> = vseteq [vector of n <ty>] <var1>, <var2>   ; yields [vector of n bool]
    +  <result> = vsetne [vector of <ty>]   <var1>, <var2>   ; yields [vector of bool]
    +  <result> = vsetne [vector of n <ty>] <var1>, <var2>   ; yields [vector of n bool]
    +  <result> = vsetlt [vector of <ty>]   <var1>, <var2>   ; yields [vector of bool]
    +  <result> = vsetlt [vector of n <ty>] <var1>, <var2>   ; yields [vector of n bool]
    +  <result> = vsetgt [vector of <ty>]   <var1>, <var2>   ; yields [vector of bool]
    +  <result> = vsetgt [vector of n <ty>] <var1>, <var2>   ; yields [vector of n bool]
    +  <result> = vsetle [vector of <ty>]   <var1>, <var2>   ; yields [vector of bool]
    +  <result> = vsetle [vector of n <ty>] <var1>, <var2>   ; yields [vector of n bool]
    +  <result> = vsetge [vector of <ty>]   <var1>, <var2>   ; yields [vector of bool]
    +  <result> = vsetge [vector of n <ty>] <var1>, <var2>   ; yields [vector of n bool]
    +
    +
    Overview:
    +

    A 'vsetcc' instruction returns a vector of boolean +values representing, at each position, the result of the comparison +between the values at that position in the two operands.

    +
    Arguments:
    +

    The two arguments to a 'vsetcc' instruction must +be of vector or fixed vector type. Both arguments must +have identical types. If the arguments are of vector type, then the +result has type [vector of bool]. If the arguments are of fixed +vector type with length n, then the result has type [vector of n +bool].

    Semantics:
    +

    The 'vseteq' instruction yields a true 'bool' +value at position p of the result if both operands are equal at that position.
    +The 'vsetne' instruction yields a true 'bool' +value at position p of the result if both operands are unequal at that position.
    +The 'vsetlt' instruction yields a true 'bool' +value at position p of the result if the first operand is less than the second operand at that position.
    +The 'vsetgt' instruction yields a true 'bool' +value at position p of the result if the first operand is greater than the second operand at that position.
    +The 'vsetle' instruction yields a true 'bool' +value at position p of the result if the first operand is less than or equal to the second operand at that position.
    +The 'vsetge' instruction yields a true 'bool' +value at position p of the result if the first operand is greater than or equal to the second +operand at that position.

    +
    Example:
    +
      <result> = vseteq [vector of 2 int] <int 4, int 5>, <int 5, int 4>      ; yields {[vector of 2 bool]}:result = false, false
    +  <result> = vsetne [vector of 2 int] <int 4, int 5>, <int 5, int 4>      ; yields {[vector of 2 bool]}:result = true, true
    +  <result> = vsetlt [vector of 2 int] <int 4, int 5>, <int 5, int 4>      ; yields {[vector of 2 bool]}:result = true, false
    +  <result> = vsetgt [vector of 2 int] <int 4, int 5>, <int 5, int 4>      ; yields {[vector of 2 bool]}:result = false, true
    +  <result> = vsetle [vector of 2 int] <int 4, int 5>, <int 5, int 4>      ; yields {[vector of 2 bool]}:result = true, false
    +  <result> = vsetge [vector of 2 int] <int 4, int 5>, <int 5, int 4>      ; yields {[vector of 2 bool]}:result = false, true
    +
    +
    @@ -1857,53 +1964,325 @@
    +
    Syntax:
    -
      <result> = load <ty>* <pointer>
    <result> = volatile load <ty>* <pointer>
    + +
    +  <result> = load <ty>* <pointer>
    +  <result> = volatile load <ty>* <pointer>
    +  <result> = aligned load <ty>* <pointer>
    +
    +
    Overview:
    +

    The 'load' instruction is used to read from memory.

    +
    Arguments:
    -

    The argument to the 'load' instruction specifies the memory -address to load from. The pointer must point to a first class type. If the load is -marked as volatile then the optimizer is not allowed to modify -the number or order of execution of this load with other -volatile load and store -instructions.

    + +

    The argument to the 'load' instruction specifies the +memory address to load from. The pointer must point to a first class type. The load may be +marked as volatile and/or aligned.

    +
    Semantics:
    -

    The location of memory pointed to is loaded.

    + +

    The location of memory pointed to is loaded. If the load +is marked as volatile then the optimizer is not allowed to +modify the number or order of execution of this load with +other volatile load and store +instructions. The aligned attribute applies only to loads of +vectors and fixed +vectors. An aligned load means that the pointer is +guaranteed to satisfy the target architecture's alignment requirement +for loads (if any), and that the load may be translated +directly to a native load for the target. Otherwise, the backend may +have to perform an unaligned load or insert a runtime alignment +correction, reducing efficiency.

    +
    Examples:
      %ptr = alloca int                               ; yields {int*}:ptr
       store int 3, int* %ptr                          ; yields {void}
       %val = load int* %ptr                           ; yields {int}:val = int 3
     
    + +
    TO DO:
    +The aligned attribute is not yet implemented for load. +
    +
    +
    Syntax:
    -
      store <ty> <value>, <ty>* <pointer>                   ; yields {void}
    -  volatile store <ty> <value>, <ty>* <pointer>                   ; yields {void}
    +
    +
    +  store <ty> <value>, <ty>* <pointer>                      ; yields {void}
    +  volatile store <ty> <value>, <ty>* <pointer>             ; yields {void}
    +  aligned store <ty> <value>, <ty>* <pointer>              ; yields {void}
     
    +
    Overview:
    +

    The 'store' instruction is used to write to memory.

    +
    Arguments:
    -

    There are two arguments to the 'store' instruction: a value -to store and an address to store it into. The type of the '<pointer>' -operand must be a pointer to the type of the '<value>' -operand. If the store is marked as volatile, then the -optimizer is not allowed to modify the number or order of execution of -this store with other volatile load and store instructions.

    + +

    There are two arguments to the 'store' instruction: a +value to store and an address to store it into. The type of the +'<pointer>' operand must be a pointer to the type of +the '<value>' operand. The store may be +marked as volatile and/or aligned.

    +
    Semantics:
    -

    The contents of memory are updated to contain '<value>' -at the location specified by the '<pointer>' operand.

    + +

    The contents of memory are updated to contain +'<value>' at the location specified by the +'<pointer>' operand. If the store is marked +as volatile, then the optimizer is not allowed to modify the +number or order of execution of this store with other +volatile load and store +instructions. An aligned store means that the pointer is +guaranteed to satisfy the target architecture's alignment requirement +for stores (if any), and that the store may be translated +directly to a native store for the target. Otherwise, the backend may +have to perform an unaligned store or insert a runtime alignment +correction, reducing efficiency.

    +
    Example:
      %ptr = alloca int                               ; yields {int*}:ptr
       store int 3, int* %ptr                          ; yields {void}
       %val = load int* %ptr                           ; yields {int}:val = int 3
     
    + +
    TO DO:
    +The aligned attribute is not yet implemented for store. + +
    + + + +
    + +
    Syntax:
    +
    +  <result> = vgather <ty>* <pointer>{, <index group>, <multiplier>}+
    +  <result> = aligned vgather <ty>* <pointer>{, <index group>, <multiplier>}+
    +
    + +<index group> means either +long <start>, long <end>, long <stride> or +[vector of long] + +
    Overview:
    + +

    The 'vgather' instruction reads an array slice of +arbitrary dimension from memory into a vector register.

    + +
    Arguments:
    + +

    The first argument to the 'vgather' instruction specifies +the memory address at which to start the gather. The pointer must +point to an integral or floating point type. Following the pointer +argument are one or more (index group, multiplier) pairs. An +index group specifies a list of indices, either as a triple +(start, end, stride), or as a vector of indices. The stride +may be negative. multiplier specifies a multiplier for the +indices when generating the array access; this allows access to arrays +whose shape is unknown at compile time, as well as access to repeated +values (by using a zero multiplier). The vgather may be +marked as aligned.

    + +
    Semantics:
    +

    Values are loaded from memory into the resulting register according to the following:

    +
    +  i = 0;
    +  for each index I1 in index group 1
    +    for each index I2 in index group 2
    +      ...
    +        for each index In in index group n
    +	  result[i++] = pointer[I1 * multiplier1 + I2 * multiplier2 + ... + In * multipliern]
    +
    +The semantics of vgather guarantees only that these loads +occur, and that the loaded values are placed into result in +the order specified above. Otherwise, vgather does not +guarantee that the loads occur in any particular order. In +particular, unlike a Fortran 90 triplet, vgather does +not guarantee that all loads are performed before any use of a +value in the result vector. In compiling vgather to a +particular target, the code generator is free to schedule the load of +any value in the result vector at any point in the program from the +vgather to the first use of that value. The Vector LLVM +program must be written so that this rule produces correct results. +The result of a vgather instruction is of vector type. + +

    +The aligned attribute functions as described for load. +

    + +
    Examples (Using Fortran 90-Style Notation):
    +
      %vec = vgather int* %ptr, long 0, long 9, long 1, long 1   ; yields {[vector of int]}:vec = ptr[0:9:1]
    +  %vec = vgather int* %ptr, long 0, long 9, long 1, long 10, long 0, long 9, long 1, long 1   ; yields {[vector of int]}:vec = ptr[0:9:1][0:9:1]
    +  %vec = vgather int* %ptr, [vector of long] %idx, long 1   ; yields{[vector of int]}:vec = ptr[idx]
    +
    + +
    TO DO:
    +
      + +
    1. The aligned attribute is not yet implemented for vgather. +
    2. + +
    3. Currently only the strided form of the index group is implemented; the +[vector of long] form is not yet implemented.
    4. + +
    + +
    + + +
    + +
    Syntax:
    + +
    +  <result> = vimm <ty> <val>, uint <length>
    +  <result> = fixed vimm <ty> <val>, uint <length>
    +
    + +
    Overview:
    + +

    The 'vimm' instruction expands a scalar value into a +vector value.

    + +
    Arguments:
    + +

    The first argument specifies the scalar value to use. The value +must be of integral or floating point type. The second argument +specifies the length of the resulting vector. The vimm may +be fixed or not; a fixed vimm must have a constant +second operand. The result of a vimm is of vector type, and the result of a fixed +vimm is of fixed vector type.

    + +
    Semantics:
    + +

    The specified value is used to populate each position of a vector +of the specified length.

    + +
    Examples:
    + +
    +  %vec = vimm int 0, uint %n          ; yields [vector of int]
    +  %vec = vimm int 0, uint 10          ; yields [vector of int]
    +  %vec = fixed vimm int 0, uint 10    ; yields [vector of 10 int]
    +
    + +
    TO DO:
    This definition leaves open a perverse case that might +break the program. If someone creates a fixed vimm with a +constant second operand (as required) then later replaces that +constant with a variable, the instruction will be illegal, and the +program will break on subsequent verification. It's hard to see why +an optimization pass would replace a constant with a variable, but to +guard against this we could + +
      + +
    1. Include the type of the instruction as an operand in the assembly +language format. For fixed vectors, this would make the length +argument useless, but it would also prevent someone from creating an +illegal instruction by replacing the length operand with a different +value (since the type is an invariant of the instruction, and cannot +be "replaced" without explicitly creating a new instruction of a +different type). + +
    2. Provide a separate form for fixed vectors (possibly with a +separate opcode/assembly mnemonic) that takes a scalar value and a +type (similar to the cast instruction) rather than a length. + +
    3. Ignore the problem, ostrich-like. Maybe it's not a real issue. + +
    + +
    + + + +
    +
    Syntax:
    +
      <result> = vscatter [vector of <ty>] <value>, <ty>* <pointer>{, <index group>, <multiplier>}+
    +<index group> means either +long <start>, long <end>, long <stride> or +[vector of long] + +
    Overview:
    + +

    The 'vscatter' instruction stores ("scatters") a vector +register into an array slice of arbitrary dimension.

    + +
    Arguments:
    + +

    The first argument to the 'vscatter' instruction specifies +a value of vector type to scatter to memory, +and the second is a pointer specifying the location where the scatter +should begin. The pointer must point to the element type of the +vector. Following the pointer argument are one or more (index +group, multiplier) pairs. An index group specifies a +list of indices, either as a triple (start, end, stride), or +as a vector of indices. The stride may be negative. +multiplier specifies a multiplier for the indices when +generating the array access; this allows access to arrays whose shape +is unknown at compile time. The vscatter may be +marked as aligned.

    + +
    Semantics:
    +

    Values are stored to memory according to the following:

    +
    +  i = 0;
    +  for each index I1 in index group 1
    +    for each index I2 in index group 2
    +      ...
    +        for each index In in index group n
    +	  pointer[I1 * multiplier1 + I2 * multiplier2 + ... + In * multipliern] = value[i++]
    +
    + +The semantics of vscatter guarantees only that these stores +occur, and that the stored values are placed into memory in the order +specified above. Otherwise, vscatter does not guarantee +that the stores occur in any particular order. In compiling +vscatter to a particular target, the code generator is free to +schedule the store of any value in the result vector at any point in +the program from the point where the value is defined to the +vscatter. The Vector LLVM program must be written so that this +rule produces correct results. + +

    +The aligned attribute functions as described for store. +

    + +
    Examples (Using Fortran 90-Style Notation):
    +
      vscatter [vector of int] %vec, int* %ptr, long 0, long 9, long 1, long 1   ; ptr[0:9:1] = {[vector of int]}:vec
    +  vscatter [vector of int] %vec, int* %ptr, long 0, long 9, long 1, long 10, long 0, long 9, long 1, long 1   ; ptr[0:9:1][0:9:1] = {[vector of int]}:vec
    +  vscatter [vector of int] %vec, int* %ptr, [vector of long] %idx, long 1   ; ptr[idx] = {[vector of int]}:vec
    +
    + +
    TO DO:
    +
      + +
    1. The aligned attribute is not yet implemented for vscatter.
    2. + +
    3. Currently only the strided form of the index group is implemented; the +[vector of long] form is not yet implemented.
    4. + +
    + +
    'getelementptr' Instruction @@ -2148,7 +2527,334 @@
    + + +
    + +
    Syntax:
    + +
    +  <result> = vselect [vector of bool]   <cond>, [vector of <ty>]   <val1>, [vector of <ty>]   <val2> ; yields [vector of <ty>]
    +  <result> = vselect [vector of n bool] <cond>, [vector of n <ty>] <val1>, [vector of n <ty>] <val2> ; yields [vector of n <ty>]
    +
    + +
    Overview:
    + +

    +The 'vselect' instruction chooses one value at each position +of a vector based on a condition, without branching. +

    + + +
    Arguments:
    + +

    + +The 'vselect' instruction requires a vector of boolean values +indicating the condition at each vector position, and two values of +the same vector or fixed vector type. All three operands must +be vectors or fixed vectors, and all must have the same length. The +type of the result is the same as the type of the two value +operands.

    + +
    Semantics:
    + +

    +At each vector position, if the boolean vector contains true at that +position, that position of the result gets the value at that position +in the first value argument; otherwise, it gets that value at that +position in the second value argument. +

    + +
    Example:
    + +
    +  %X = vselect bool [vector of 2 bool] <bool true, bool false>, [vector of 2 ubyte] <ubyte 17, ubyte 17>, 
    +    [vector of 2 ubyte] <ubyte 42, ubyte 42>      ; yields [vector of 2 ubyte]:17, 42
    +
    +
    + + + + +
    + +
    Syntax:
    + +
    +  <result> = extract [vector of <ty>] <val>, uint <start>, uint <stride>, uint <length>   ; yields [vector of <ty>]
    +  <result> = extract [vector of n <ty>] <val>, uint <start>, uint <stride>, uint <length>   ; yields [vector of <ty>]
    +  <result> = fixed extract [vector of <ty>] <val>, uint <start>, uint <stride>, uint <length>   ; yields [vector of n <ty>]
    +  <result> = fixed extract [vector of n <ty>] <val>, uint <start>, uint <stride>, uint <length>   ; yields [vector of n <ty>]
    +
    + +
    Overview:
    + +

    +The 'extract' instruction extracts a strided range of values +from a vector. +

    + +
    Arguments:
    + +

    +The first operand of an 'extract' instruction is a value of +vector or fixed +vector type. The following operands are indices indicating a +start position, stride, and length. The vimm may be +fixed or not; a fixed vimm must have a constant +second operand. The result of a extract is of vector type, and the result of a fixed +extract is of fixed vector +type.

    + +
    Semantics:
    + +

    +The result is a vector of the same type as val with length +length. The result contains the length values +obtained by starting at position start in val and +incrementing the position by stride between each successive +value. If start + stride * length exceeds the length of +val, the results are undefined. +

    + +
    Example:
    + +
    +  %result = extract [vector of int]    %vec, uint 0, uint 9, uint 2    ; yields [vector of int]
    +  %result = extract [vector of 10 int] %vec, uint 0, uint 9, uint 2    ; yields [vector of 10 int]
    +
    + +
    TO DO:
    + +

    +The fixed attribute is not currently implemented. Instead, +we generate a fixed vector if and only if the first operand of +extract is a fixed vector, and the length operand is a +constant. This is broken, because changing the length operand (e.g., +from a variable to a constant, through constant propagation), changes +the type of the extract, which must be an invariant of the +instruction. +

    + +

    +The fixed attribute suffers from the same issues as described +in vimm. Instead of fixed, we could +pursue the options outlined there. +

    + +
    + + + + +
    + +
    Syntax:
    + +
    +  <result> = extractelement [vector of <ty>]   <val>, uint <idx>    ; yields <ty>
    +  <result> = extractelement [vector of n <ty>] <val>, uint <idx>    ; yields <ty>
    +
    + +
    Overview:
    + +

    +The 'extractelement' instruction extracts a single scalar +element from a vector at a specified index. +

    + + +
    Arguments:
    + +

    +The first operand of an 'extract' instruction is a value of +vector or fixed +vector type. The second operand is an index indicating the +position from which to extract the element.

    + +
    Semantics:
    + +

    +The result is a scalar of the same type as the element type of +val. Its value is the value at position idx of +val. If idx exceeds the length of val, the +results are undefined. +

    + +
    Example:
    + +
    +  %result = extractelement [vector of int]    %vec, uint 0    ; yields int
    +  %result = extractelement [vector of 10 int] %vec, uint 0    ; yields int
    +
    +
    + + + + +
    + +
    Syntax:
    + +
    +  <result> = combine [vector of <ty>]   <val1>, [vector of <ty>],   <val2>, uint <start>, uint <stride>   ; yields [vector of <ty>]
    +  <result> = combine [vector of n <ty>] <val2>, [vector of n <ty>], <val2>, uint <start>, uint <stride>   ; yields [vector of n <ty>]
    +
    + +
    Overview:
    + +

    +The 'combine' instruction combines two vectors by overlaying +the values of the second on the first at the specified start position +and stride. +

    + +
    Arguments:
    + +

    +The first two operands of a 'combine' instruction are values +of vector or fixed +vector type. The second two operands are indices indicating a +start position and stride. +

    + +
    Semantics:
    + +

    +The result is a vector of the same type and length as val1. +The result contains the values of val1 at each position +except those starting at start and proceeding by stride +stride, to and including the length of val2. Each +of those positions gets the value from the corresponding position of +val2. If the length of val2 times stride +plus start exceeds the length of val1, the results +are undefined. +

    + +
    Example:
    + +
    +  %result = combine [vector of int]    %v1, [vector of int]    %v2, uint 0, uint 9    ; yields [vector of int]
    +  %result = combine [vector of 10 int] %v1, [vector of 10 int] %v2, uint 0, uint 9    ; yields [vector of 10 int]
    +
    +
    + + + + +
    + +
    Syntax:
    + +
    +  <result> = combineelement [vector of <ty>]   <val>, <ty> <elt>, uint <idx>    ; yields [vector of <ty>]
    +  <result> = combineelement [vector of n <ty>] <val>, <ty> <elt>, uint <idx>    ; yields [vector of n <ty>]
    +
    + +
    Overview:
    + +

    +The 'combineelement' instruction overlays a single scalar +element on a vector at a specified index. +

    + + +
    Arguments:
    + +

    +The first operand of a 'combineelement' instruction is a +value of vector or fixed vector type. The second operand is a +scalar value. The third operand is an index indicating the position +at which to overlay the value.

    + +
    Semantics:
    + +

    +The result is a vector of the same type as val. Its element +values are those of val except at position idx, +where it gets the value elt. If idx exceeds the +length of val, the results are undefined. +

    + +
    Example:
    + +
    +  %result = combineelement [vector of int]    %vec, int 5, uint 0    ; yields [vector of int]
    +  %result = combineelement [vector of 10 int] %vec, int 5, uint 0    ; yields [vector of 10 int]
    +
    +
    + + + + +
    + +
    Syntax:
    + +
    +  <result> = permute [vector of <ty>] <val>, [vector of uint] <idx>    ; yields [vector of <ty>]
    +  <result> = permute [vector of n <ty>] <val>, [vector of n uint] <idx>    ; yields [vector of n <ty>]
    +
    + +
    Overview:
    + +

    +The 'permute' instruction permutes a value vector according +to an index vector. +

    + + +
    Arguments:
    + +

    +The first operand of a 'permute' is a value of any vector or fixed +vector type. The second operand is a vector of uint. It +must have the same length as the first operand and must be a vector or +fixed vector according to whether the first operand is.

    + +
    Semantics:
    + +

    +The result is a vector of the same type as val. Its element +values are those of val, except at position i it has +the value at position j of val, where j is +element i of idx. If any element of idx is +greater than the length of val minus 1, the results are +undefined. +

    + +
    Example:
    + +
    +  %result = permute [vector of 4 int] <int 1, int 2, int 3, int 4>, 
    +    [vector of uint] <uint 4, uint 3, uint 2, uint 1>
    +  ; yields [vector of 4 int] <int 4, int 3, int 2, int 1>
    +
    + +
    TO DO:
    + +This instruction is not yet implemented. Currently, I use a +permute function (intrinsic) with the semantics described. + +
    @@ -3314,7 +4020,7 @@ Chris Lattner
    The LLVM Compiler Infrastructure
    - Last modified: $Date: 2005/07/21 01:29:16 $ + Last modified: $Date: 2005/10/18 19:21:55 $ From bocchino at cs.uiuc.edu Tue Oct 18 14:22:20 2005 From: bocchino at cs.uiuc.edu (Robert Bocchino) Date: Tue, 18 Oct 2005 14:22:20 -0500 Subject: [llvm-commits] [vector_llvm] CVS: llvm/lib/Transforms/Scalar/DeadStoreElimination.cpp InstructionCombining.cpp LowerConstantExprs.cpp SCCP.cpp Message-ID: <200510181922.OAA13347@zion.cs.uiuc.edu> Changes in directory llvm/lib/Transforms/Scalar: DeadStoreElimination.cpp updated: 1.12 -> 1.12.4.1 InstructionCombining.cpp updated: 1.388 -> 1.388.2.1 LowerConstantExprs.cpp updated: 1.4 -> 1.4.4.1 SCCP.cpp updated: 1.125 -> 1.125.2.1 --- Log message: Initial commit of Vector LLVM. --- Diffs of the changes: (+9 -2) DeadStoreElimination.cpp | 7 ++++++- InstructionCombining.cpp | 1 + LowerConstantExprs.cpp | 1 + SCCP.cpp | 2 +- 4 files changed, 9 insertions(+), 2 deletions(-) Index: llvm/lib/Transforms/Scalar/DeadStoreElimination.cpp diff -u llvm/lib/Transforms/Scalar/DeadStoreElimination.cpp:1.12 llvm/lib/Transforms/Scalar/DeadStoreElimination.cpp:1.12.4.1 --- llvm/lib/Transforms/Scalar/DeadStoreElimination.cpp:1.12 Thu Apr 21 18:45:12 2005 +++ llvm/lib/Transforms/Scalar/DeadStoreElimination.cpp Tue Oct 18 14:21:57 2005 @@ -16,7 +16,7 @@ //===----------------------------------------------------------------------===// #include "llvm/Transforms/Scalar.h" -#include "llvm/DerivedTypes.h" +#include "VectorLLVM/Utils.h" #include "llvm/Function.h" #include "llvm/Instructions.h" #include "llvm/Analysis/AliasAnalysis.h" @@ -88,6 +88,11 @@ for (BasicBlock::iterator BBI = BB.end(); BBI != BB.begin(); ) { Instruction *I = --BBI; // Keep moving iterator backwards + // FIXME: This is a temporary fix to make vectors work + // + if (VectorUtils::containsVector(I)) + continue; + // If this is a free instruction, it makes the free'd location dead! if (FreeInst *FI = dyn_cast(I)) { // Free instructions make any stores to the free'd location dead. Index: llvm/lib/Transforms/Scalar/InstructionCombining.cpp diff -u llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.388 llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.388.2.1 --- llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.388 Mon Oct 17 15:18:38 2005 +++ llvm/lib/Transforms/Scalar/InstructionCombining.cpp Tue Oct 18 14:21:57 2005 @@ -3343,6 +3343,7 @@ } Instruction *InstCombiner::visitShiftInst(ShiftInst &I) { + if (isa(I.getType())) return 0; assert(I.getOperand(1)->getType() == Type::UByteTy); Value *Op0 = I.getOperand(0), *Op1 = I.getOperand(1); bool isLeftShift = I.getOpcode() == Instruction::Shl; Index: llvm/lib/Transforms/Scalar/LowerConstantExprs.cpp diff -u llvm/lib/Transforms/Scalar/LowerConstantExprs.cpp:1.4 llvm/lib/Transforms/Scalar/LowerConstantExprs.cpp:1.4.4.1 --- llvm/lib/Transforms/Scalar/LowerConstantExprs.cpp:1.4 Thu Apr 21 18:45:12 2005 +++ llvm/lib/Transforms/Scalar/LowerConstantExprs.cpp Tue Oct 18 14:21:57 2005 @@ -163,6 +163,7 @@ namespace llvm { + const PassInfo *llvm::LowerConstantExpressionsID = X.getPassInfo(); FunctionPass* createLowerConstantExpressionsPass() { return new ConstantExpressionsLower; Index: llvm/lib/Transforms/Scalar/SCCP.cpp diff -u llvm/lib/Transforms/Scalar/SCCP.cpp:1.125 llvm/lib/Transforms/Scalar/SCCP.cpp:1.125.2.1 --- llvm/lib/Transforms/Scalar/SCCP.cpp:1.125 Mon Sep 26 00:28:52 2005 +++ llvm/lib/Transforms/Scalar/SCCP.cpp Tue Oct 18 14:21:57 2005 @@ -342,7 +342,7 @@ void visitInstruction(Instruction &I) { // If a new instruction is added to LLVM that we don't handle... - std::cerr << "SCCP: Don't know how to handle: " << I; + DEBUG(std::cerr << "SCCP: Don't know how to handle: " << I); markOverdefined(&I); // Just in case } }; From bocchino at cs.uiuc.edu Tue Oct 18 14:22:20 2005 From: bocchino at cs.uiuc.edu (Robert Bocchino) Date: Tue, 18 Oct 2005 14:22:20 -0500 Subject: [llvm-commits] [vector_llvm] CVS: llvm/include/llvm/Analysis/AliasAnalysis.h CallGraph.h Message-ID: <200510181922.OAA13365@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm/Analysis: AliasAnalysis.h updated: 1.22 -> 1.22.2.1 CallGraph.h updated: 1.43 -> 1.43.4.1 --- Log message: Initial commit of Vector LLVM. --- Diffs of the changes: (+3 -8) AliasAnalysis.h | 3 +++ CallGraph.h | 8 -------- 2 files changed, 3 insertions(+), 8 deletions(-) Index: llvm/include/llvm/Analysis/AliasAnalysis.h diff -u llvm/include/llvm/Analysis/AliasAnalysis.h:1.22 llvm/include/llvm/Analysis/AliasAnalysis.h:1.22.2.1 --- llvm/include/llvm/Analysis/AliasAnalysis.h:1.22 Mon Jun 20 10:24:23 2005 +++ llvm/include/llvm/Analysis/AliasAnalysis.h Tue Oct 18 14:21:56 2005 @@ -265,6 +265,9 @@ case Instruction::Store: return getModRefInfo((StoreInst*)I, P, Size); case Instruction::Call: return getModRefInfo((CallInst*)I, P, Size); case Instruction::Invoke: return getModRefInfo((InvokeInst*)I, P, Size); + // FIXME: This is extra safe for now. Fix it so that we use the + // indices to figure out the bounding size of the vscatter. + case Instruction::VScatter: return Mod; default: return NoModRef; } } Index: llvm/include/llvm/Analysis/CallGraph.h diff -u llvm/include/llvm/Analysis/CallGraph.h:1.43 llvm/include/llvm/Analysis/CallGraph.h:1.43.4.1 --- llvm/include/llvm/Analysis/CallGraph.h:1.43 Thu Apr 21 15:16:31 2005 +++ llvm/include/llvm/Analysis/CallGraph.h Tue Oct 18 14:21:56 2005 @@ -169,10 +169,6 @@ /// void print(std::ostream &o, const Module *M) const; - /// dump - Print out this call graph. - /// - void dump() const; - // stub - dummy function, just ignore it static void stub(); private: @@ -224,10 +220,6 @@ // CallGraphNode *operator[](unsigned i) const { return CalledFunctions[i];} - /// dump - Print out this call graph node. - /// - void dump() const; - void print(std::ostream &OS) const; //===--------------------------------------------------------------------- // Methods to keep a call graph up to date with a function that has been From bocchino at cs.uiuc.edu Tue Oct 18 14:22:22 2005 From: bocchino at cs.uiuc.edu (Robert Bocchino) Date: Tue, 18 Oct 2005 14:22:22 -0500 Subject: [llvm-commits] [vector_llvm] CVS: llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp Message-ID: <200510181922.OAA13393@zion.cs.uiuc.edu> Changes in directory llvm/lib/CodeGen/SelectionDAG: SelectionDAGISel.cpp updated: 1.88 -> 1.88.2.1 --- Log message: Initial commit of Vector LLVM. --- Diffs of the changes: (+24 -11) SelectionDAGISel.cpp | 35 ++++++++++++++++++++++++----------- 1 files changed, 24 insertions(+), 11 deletions(-) Index: llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp diff -u llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:1.88 llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:1.88.2.1 --- llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:1.88 Mon Oct 10 11:47:10 2005 +++ llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp Tue Oct 18 14:21:57 2005 @@ -189,7 +189,10 @@ } } - +static void badInstruction(User &I) { + std::cerr << "Instruction " << I << " should not exist at instruction selection time!"; + abort(); +} //===----------------------------------------------------------------------===// /// SelectionDAGLowering - This is the common target-independent lowering @@ -389,8 +392,6 @@ void visitGetElementPtr(User &I); void visitCast(User &I); void visitSelect(User &I); - // - void visitMalloc(MallocInst &I); void visitFree(FreeInst &I); void visitAlloca(AllocaInst &I); @@ -407,14 +408,26 @@ void visitMemIntrinsic(CallInst &I, unsigned Op); - void visitUserOp1(Instruction &I) { - assert(0 && "UserOp1 should not exist at instruction selection time!"); - abort(); - } - void visitUserOp2(Instruction &I) { - assert(0 && "UserOp2 should not exist at instruction selection time!"); - abort(); - } + // Instructions that should not exist at lowering time + // + void visitUserOp1(Instruction &I) { badInstruction(I); } + void visitUserOp2(Instruction &I) { badInstruction(I); } + void visitVGather(Instruction &I) { badInstruction(I); } + void visitVImm(Instruction &I) { badInstruction(I); } + void visitVScatter(Instruction &I) { badInstruction(I); } + void visitExtract(Instruction & I) { badInstruction(I); } + void visitExtractElement(Instruction &I) { badInstruction(I); } + void visitCombine(Instruction & I) { badInstruction(I); } + void visitCombineElement(Instruction & I) { badInstruction(I); } + void visitVSetCC(Instruction &I) { badInstruction(I); } + void visitVSetEQ(Instruction &I) { badInstruction(I); } + void visitVSetNE(Instruction &I) { badInstruction(I); } + void visitVSetLE(Instruction &I) { badInstruction(I); } + void visitVSetGE(Instruction &I) { badInstruction(I); } + void visitVSetLT(Instruction &I) { badInstruction(I); } + void visitVSetGT(Instruction &I) { badInstruction(I); } + void visitVSelect(Instruction &I) { badInstruction(I); } + }; } // end namespace llvm From bocchino at cs.uiuc.edu Tue Oct 18 14:22:21 2005 From: bocchino at cs.uiuc.edu (Robert Bocchino) Date: Tue, 18 Oct 2005 14:22:21 -0500 Subject: [llvm-commits] [vector_llvm] CVS: llvm/include/llvm/Analysis/DataStructure/DSGraph.h DataStructure.h Message-ID: <200510181922.OAA13369@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm/Analysis/DataStructure: DSGraph.h updated: 1.109 -> 1.109.4.1 DataStructure.h updated: 1.94 -> 1.94.4.1 --- Log message: Initial commit of Vector LLVM. --- Diffs of the changes: (+16 -3) DSGraph.h | 7 ++++--- DataStructure.h | 12 ++++++++++++ 2 files changed, 16 insertions(+), 3 deletions(-) Index: llvm/include/llvm/Analysis/DataStructure/DSGraph.h diff -u llvm/include/llvm/Analysis/DataStructure/DSGraph.h:1.109 llvm/include/llvm/Analysis/DataStructure/DSGraph.h:1.109.4.1 --- llvm/include/llvm/Analysis/DataStructure/DSGraph.h:1.109 Thu Apr 21 15:18:05 2005 +++ llvm/include/llvm/Analysis/DataStructure/DSGraph.h Tue Oct 18 14:21:56 2005 @@ -437,9 +437,10 @@ void updateFromGlobalGraph(); - /// computeNodeMapping - Given roots in two different DSGraphs, traverse the - /// nodes reachable from the two graphs, computing the mapping of nodes from - /// the first to the second graph. + /// computeNodeMapping - Given roots in two different DSGraphs, + /// traverse the nodes reachable from the two graphs, computing the + /// mapping of nodes from the first to the second graph. Returns + /// true if mapping succeeded, false otherwise. /// static void computeNodeMapping(const DSNodeHandle &NH1, const DSNodeHandle &NH2, NodeMapTy &NodeMap, Index: llvm/include/llvm/Analysis/DataStructure/DataStructure.h diff -u llvm/include/llvm/Analysis/DataStructure/DataStructure.h:1.94 llvm/include/llvm/Analysis/DataStructure/DataStructure.h:1.94.4.1 --- llvm/include/llvm/Analysis/DataStructure/DataStructure.h:1.94 Thu Apr 21 15:18:05 2005 +++ llvm/include/llvm/Analysis/DataStructure/DataStructure.h Tue Oct 18 14:21:56 2005 @@ -191,6 +191,12 @@ hash_map DSInfo; hash_set ArgsRemainIncomplete; DSGraph *GlobalsGraph; + + // --- RLB start --- + // SCCs of call graph, in reverse postorder + std::vector SCCs; + // --- RLB end --- + BUDataStructures *BUInfo; /// GlobalECs - The equivalence classes for each global value that is merged @@ -266,6 +272,12 @@ AU.addRequired(); } + // --- RLB begin --- + typedef std::vector::const_iterator SCC_iterator; + SCC_iterator SCC_begin() const { return SCCs.begin(); } + SCC_iterator SCC_end() const { return SCCs.end(); } + // --- RLB end --- + private: void markReachableFunctionsExternallyAccessible(DSNode *N, hash_set &Visited); From bocchino at cs.uiuc.edu Tue Oct 18 14:22:23 2005 From: bocchino at cs.uiuc.edu (Robert Bocchino) Date: Tue, 18 Oct 2005 14:22:23 -0500 Subject: [llvm-commits] [vector_llvm] CVS: llvm/lib/Transforms/IPO/GlobalOpt.cpp Message-ID: <200510181922.OAA13416@zion.cs.uiuc.edu> Changes in directory llvm/lib/Transforms/IPO: GlobalOpt.cpp updated: 1.58 -> 1.58.2.1 --- Log message: Initial commit of Vector LLVM. --- Diffs of the changes: (+2 -2) GlobalOpt.cpp | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) Index: llvm/lib/Transforms/IPO/GlobalOpt.cpp diff -u llvm/lib/Transforms/IPO/GlobalOpt.cpp:1.58 llvm/lib/Transforms/IPO/GlobalOpt.cpp:1.58.2.1 --- llvm/lib/Transforms/IPO/GlobalOpt.cpp:1.58 Tue Sep 27 17:28:11 2005 +++ llvm/lib/Transforms/IPO/GlobalOpt.cpp Tue Oct 18 14:21:57 2005 @@ -274,7 +274,7 @@ if (IdxV < CS->getNumOperands()) return CS->getOperand(IdxV); } else if (ConstantArray *CA = dyn_cast(Agg)) { if (IdxV < CA->getNumOperands()) return CA->getOperand(IdxV); - } else if (ConstantPacked *CP = dyn_cast(Agg)) { + } else if (ConstantVector *CP = dyn_cast(Agg)) { if (IdxV < CP->getNumOperands()) return CP->getOperand(IdxV); } else if (isa(Agg)) { if (const StructType *STy = dyn_cast(Agg->getType())) { @@ -394,7 +394,7 @@ unsigned NumElements = 0; if (const ArrayType *ATy = dyn_cast(STy)) NumElements = ATy->getNumElements(); - else if (const PackedType *PTy = dyn_cast(STy)) + else if (const FixedVectorType *PTy = dyn_cast(STy)) NumElements = PTy->getNumElements(); else assert(0 && "Unknown aggregate sequential type!"); From bocchino at cs.uiuc.edu Tue Oct 18 14:22:23 2005 From: bocchino at cs.uiuc.edu (Robert Bocchino) Date: Tue, 18 Oct 2005 14:22:23 -0500 Subject: [llvm-commits] [vector_llvm] CVS: llvm/lib/Analysis/IPA/CallGraph.cpp Message-ID: <200510181922.OAA13425@zion.cs.uiuc.edu> Changes in directory llvm/lib/Analysis/IPA: CallGraph.cpp updated: 1.48 -> 1.48.4.1 --- Log message: Initial commit of Vector LLVM. --- Diffs of the changes: (+17 -21) CallGraph.cpp | 38 +++++++++++++++++--------------------- 1 files changed, 17 insertions(+), 21 deletions(-) Index: llvm/lib/Analysis/IPA/CallGraph.cpp diff -u llvm/lib/Analysis/IPA/CallGraph.cpp:1.48 llvm/lib/Analysis/IPA/CallGraph.cpp:1.48.4.1 --- llvm/lib/Analysis/IPA/CallGraph.cpp:1.48 Thu Apr 21 16:08:44 2005 +++ llvm/lib/Analysis/IPA/CallGraph.cpp Tue Oct 18 14:21:56 2005 @@ -17,6 +17,7 @@ #include "llvm/Support/CallSite.h" #include "llvm/ADT/STLExtras.h" #include + using namespace llvm; static RegisterAnalysis X("callgraph", "Call Graph Construction"); @@ -126,35 +127,30 @@ CallsExternalNode = 0; } -void CallGraphNode::print(std::ostream &OS) const { - if (Function *F = getFunction()) - OS << "Call graph node for function: '" << F->getName() <<"'\n"; +static void WriteToOutput(const CallGraphNode *CGN, std::ostream &o) { + if (CGN->getFunction()) + o << "Call graph node for function: '" + << CGN->getFunction()->getName() <<"'\n"; else - OS << "Call graph node <>:\n"; + o << "Call graph node <>:\n"; - for (const_iterator I = begin(), E = end(); I != E; ++I) - if ((*I)->getFunction()) - OS << " Calls function '" << (*I)->getFunction()->getName() << "'\n"; + for (unsigned i = 0; i < CGN->size(); ++i) + if ((*CGN)[i]->getFunction()) + o << " Calls function '" << (*CGN)[i]->getFunction()->getName() << "'\n"; else - OS << " Calls external node\n"; - OS << "\n"; + o << " Calls external node\n"; + o << "\n"; } -void CallGraphNode::dump() const { print(std::cerr); } - -void CallGraph::print(std::ostream &OS, const Module *M) const { - OS << "CallGraph Root is: "; - if (Function *F = getRoot()->getFunction()) - OS << F->getName() << "\n"; +void CallGraph::print(std::ostream &o, const Module *M) const { + o << "CallGraph Root is: "; + if (getRoot()->getFunction()) + o << getRoot()->getFunction()->getName() << "\n"; else - OS << "<>\n"; + o << "<>\n"; for (CallGraph::const_iterator I = begin(), E = end(); I != E; ++I) - I->second->print(OS); -} - -void CallGraph::dump() const { - print(std::cerr, 0); + WriteToOutput(I->second, o); } From bocchino at cs.uiuc.edu Tue Oct 18 14:22:22 2005 From: bocchino at cs.uiuc.edu (Robert Bocchino) Date: Tue, 18 Oct 2005 14:22:22 -0500 Subject: [llvm-commits] [vector_llvm] CVS: llvm/lib/Bytecode/Writer/Writer.cpp Message-ID: <200510181922.OAA13379@zion.cs.uiuc.edu> Changes in directory llvm/lib/Bytecode/Writer: Writer.cpp updated: 1.108 -> 1.108.2.1 --- Log message: Initial commit of Vector LLVM. --- Diffs of the changes: (+20 -5) Writer.cpp | 25 ++++++++++++++++++++----- 1 files changed, 20 insertions(+), 5 deletions(-) Index: llvm/lib/Bytecode/Writer/Writer.cpp diff -u llvm/lib/Bytecode/Writer/Writer.cpp:1.108 llvm/lib/Bytecode/Writer/Writer.cpp:1.108.2.1 --- llvm/lib/Bytecode/Writer/Writer.cpp:1.108 Wed Aug 17 14:23:14 2005 +++ llvm/lib/Bytecode/Writer/Writer.cpp Tue Oct 18 14:21:57 2005 @@ -234,8 +234,8 @@ break; } - case Type::PackedTyID: { - const PackedType *PT = cast(T); + case Type::FixedVectorTyID: { + const FixedVectorType *PT = cast(T); int Slot = Table.getSlot(PT->getElementType()); assert(Slot != -1 && "Type used but not available!!"); output_typeid((unsigned)Slot); @@ -268,6 +268,14 @@ break; } + case Type::VectorTyID: { + const VectorType *VT = cast(T); + int Slot = Table.getSlot(VT->getElementType()); + assert(Slot != -1 && "Type used but not available!!"); + output_vbr((unsigned)Slot); + break; + } + case Type::OpaqueTyID: // No need to emit anything, just the count of opaque types is enough. break; @@ -342,8 +350,8 @@ break; } - case Type::PackedTyID: { - const ConstantPacked *CP = cast(CPV); + case Type::FixedVectorTyID: { + const ConstantVector *CP = cast(CPV); for (unsigned i = 0, e = CP->getNumOperands(); i != e; ++i) { int Slot = Table.getSlot(CP->getOperand(i)); @@ -432,7 +440,7 @@ output_typeid(Type); // Result type unsigned NumArgs = I->getNumOperands(); - output_vbr(NumArgs + (isa(I) || + output_vbr(NumArgs + (isa(I) || isa(I) || isa(I) || Opcode == 56 || Opcode == 58)); if (!isa(&I)) { @@ -446,6 +454,10 @@ int Slot = Table.getSlot(I->getType()); assert(Slot != -1 && "Cast return type unknown?"); output_typeid((unsigned)Slot); + } else if (const CombineInst *CI = dyn_cast(I)) { + int Slot = Table.getSlot(I->getOperand(1)->getType()); + assert(Slot != -1 && "Combine operand 1 type unknown?"); + output_typeid((unsigned)Slot); } else if (Opcode == 56) { // Invoke escape sequence output_vbr(cast(I)->getCallingConv()); } else if (Opcode == 58) { // Call escape sequence @@ -637,11 +649,14 @@ const Type *Ty; switch (I.getOpcode()) { case Instruction::Select: + case Instruction::VSelect: case Instruction::Malloc: case Instruction::Alloca: + case Instruction::VImm: Ty = I.getType(); // These ALWAYS want to encode the return type break; case Instruction::Store: + case Instruction::VScatter: Ty = I.getOperand(1)->getType(); // Encode the pointer type... assert(isa(Ty) && "Store to nonpointer type!?!?"); break; From bocchino at cs.uiuc.edu Tue Oct 18 14:22:22 2005 From: bocchino at cs.uiuc.edu (Robert Bocchino) Date: Tue, 18 Oct 2005 14:22:22 -0500 Subject: [llvm-commits] [vector_llvm] CVS: llvm/lib/Analysis/DataStructure/DataStructure.cpp TopDownClosure.cpp Message-ID: <200510181922.OAA13395@zion.cs.uiuc.edu> Changes in directory llvm/lib/Analysis/DataStructure: DataStructure.cpp updated: 1.240 -> 1.240.4.1 TopDownClosure.cpp updated: 1.89 -> 1.89.4.1 --- Log message: Initial commit of Vector LLVM. --- Diffs of the changes: (+51 -0) DataStructure.cpp | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ TopDownClosure.cpp | 3 +++ 2 files changed, 51 insertions(+) Index: llvm/lib/Analysis/DataStructure/DataStructure.cpp diff -u llvm/lib/Analysis/DataStructure/DataStructure.cpp:1.240 llvm/lib/Analysis/DataStructure/DataStructure.cpp:1.240.4.1 --- llvm/lib/Analysis/DataStructure/DataStructure.cpp:1.240 Mon Apr 25 14:16:17 2005 +++ llvm/lib/Analysis/DataStructure/DataStructure.cpp Tue Oct 18 14:21:56 2005 @@ -2234,6 +2234,7 @@ /// graph may have multiple nodes representing one node in the second graph), /// but it will not work if there is a one-to-many or many-to-many mapping. /// + void DSGraph::computeNodeMapping(const DSNodeHandle &NH1, const DSNodeHandle &NH2, NodeMapTy &NodeMap, bool StrictChecking) { @@ -2336,3 +2337,50 @@ computeNodeMapping(CalleeSM[*GI], CallerSM[*GI], NodeMap); } } + +/* +/// computeNodeMapping - Given roots in two different DSGraphs, +/// traverse the nodes reachable from the two graphs, computing the +/// mapping of nodes from the first to the second graph. Returns true +/// if mapping succeeded, false otherwise. +/// +bool DSGraph::computeNodeMapping(const DSNodeHandle &NH1, + const DSNodeHandle &NH2, NodeMapTy &NodeMap, + bool StrictChecking) { + DSNode *N1 = NH1.getNode(), *N2 = NH2.getNode(); + if (N1 == 0 || N2 == 0) return true; + + DSNodeHandle &Entry = NodeMap[N1]; + if (Entry.getNode()) { + // Termination of recursion! + if (StrictChecking) { + assert(Entry.getNode() == N2 && "Inconsistent mapping detected!"); + assert((Entry.getOffset() == (NH2.getOffset()-NH1.getOffset()) || + Entry.getNode()->isNodeCompletelyFolded()) && + "Inconsistent mapping detected!"); + } + return true; + } + + Entry.setTo(N2, NH2.getOffset()-NH1.getOffset()); + + // Loop over all of the fields that N1 and N2 have in common, recursively + // mapping the edges together now. + int N2Idx = NH2.getOffset()-NH1.getOffset(); + unsigned N2Size = N2->getSize(); + for (unsigned i = 0, e = N1->getSize(); i < e; i += DS::PointerSize) { + if (unsigned(N2Idx)+i < N2Size) { + if (N1->hasLink(i) && N2->hasLink(N2Idx+i)) + return computeNodeMapping(N1->getLink(i), N2->getLink(N2Idx+i), NodeMap); + else return false; + } + else { + if (N1->hasLink(i) && N2->hasLink(unsigned(N2Idx+i) % N2Size)) + return computeNodeMapping(N1->getLink(i), + N2->getLink(unsigned(N2Idx+i) % N2Size), NodeMap); + else return false; + } + } + return true; +} +*/ Index: llvm/lib/Analysis/DataStructure/TopDownClosure.cpp diff -u llvm/lib/Analysis/DataStructure/TopDownClosure.cpp:1.89 llvm/lib/Analysis/DataStructure/TopDownClosure.cpp:1.89.4.1 --- llvm/lib/Analysis/DataStructure/TopDownClosure.cpp:1.89 Thu Apr 21 16:07:28 2005 +++ llvm/lib/Analysis/DataStructure/TopDownClosure.cpp Tue Oct 18 14:21:56 2005 @@ -125,6 +125,9 @@ // Visit each of the graphs in reverse post-order now! while (!PostOrder.empty()) { + // --- RLB start --- + SCCs.push_back(PostOrder.back()); + // --- RLB end --- InlineCallersIntoGraph(*PostOrder.back()); PostOrder.pop_back(); } From bocchino at cs.uiuc.edu Tue Oct 18 14:22:23 2005 From: bocchino at cs.uiuc.edu (Robert Bocchino) Date: Tue, 18 Oct 2005 14:22:23 -0500 Subject: [llvm-commits] [vector_llvm] CVS: llvm/lib/Transforms/Utils/Local.cpp ValueMapper.cpp Message-ID: <200510181922.OAA13453@zion.cs.uiuc.edu> Changes in directory llvm/lib/Transforms/Utils: Local.cpp updated: 1.44 -> 1.44.2.1 ValueMapper.cpp updated: 1.20 -> 1.20.4.1 --- Log message: Initial commit of Vector LLVM. --- Diffs of the changes: (+4 -1) Local.cpp | 1 + ValueMapper.cpp | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) Index: llvm/lib/Transforms/Utils/Local.cpp diff -u llvm/lib/Transforms/Utils/Local.cpp:1.44 llvm/lib/Transforms/Utils/Local.cpp:1.44.2.1 --- llvm/lib/Transforms/Utils/Local.cpp:1.44 Tue Sep 27 20:34:32 2005 +++ llvm/lib/Transforms/Utils/Local.cpp Tue Oct 18 14:21:57 2005 @@ -21,6 +21,7 @@ #include "llvm/Support/MathExtras.h" #include #include + using namespace llvm; //===----------------------------------------------------------------------===// Index: llvm/lib/Transforms/Utils/ValueMapper.cpp diff -u llvm/lib/Transforms/Utils/ValueMapper.cpp:1.20 llvm/lib/Transforms/Utils/ValueMapper.cpp:1.20.4.1 --- llvm/lib/Transforms/Utils/ValueMapper.cpp:1.20 Thu Apr 21 18:45:34 2005 +++ llvm/lib/Transforms/Utils/ValueMapper.cpp Tue Oct 18 14:21:57 2005 @@ -16,10 +16,12 @@ #include "llvm/Constants.h" #include "llvm/GlobalValue.h" #include "llvm/Instruction.h" +#include "llvm/DerivedTypes.h" #include using namespace llvm; + Value *llvm::MapValue(const Value *V, std::map &VM) { Value *&VMSlot = VM[V]; if (VMSlot) return VMSlot; // Does it exist in the map yet? @@ -32,7 +34,7 @@ if (Constant *C = const_cast(dyn_cast(V))) { if (isa(C) || isa(C) || isa(C) || isa(C) || - isa(C)) + isa(C) || isa(C->getType())) return VMSlot = C; // Primitive constants map directly else if (ConstantArray *CA = dyn_cast(C)) { for (unsigned i = 0, e = CA->getNumOperands(); i != e; ++i) { From bocchino at cs.uiuc.edu Tue Oct 18 14:22:23 2005 From: bocchino at cs.uiuc.edu (Robert Bocchino) Date: Tue, 18 Oct 2005 14:22:23 -0500 Subject: [llvm-commits] [vector_llvm] CVS: llvm/lib/Linker/LinkModules.cpp Message-ID: <200510181922.OAA13424@zion.cs.uiuc.edu> Changes in directory llvm/lib/Linker: LinkModules.cpp updated: 1.107 -> 1.107.2.1 --- Log message: Initial commit of Vector LLVM. --- Diffs of the changes: (+1 -1) LinkModules.cpp | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm/lib/Linker/LinkModules.cpp diff -u llvm/lib/Linker/LinkModules.cpp:1.107 llvm/lib/Linker/LinkModules.cpp:1.107.2.1 --- llvm/lib/Linker/LinkModules.cpp:1.107 Thu Jul 7 18:21:43 2005 +++ llvm/lib/Linker/LinkModules.cpp Tue Oct 18 14:21:57 2005 @@ -271,7 +271,7 @@ // Check to see if it's a constant that we are interesting in transforming. if (const Constant *CPV = dyn_cast(In)) { if ((!isa(CPV->getType()) && !isa(CPV)) || - isa(CPV)) + isa(CPV) || isa(CPV->getType())) return const_cast(CPV); // Simple constants stay identical. Constant *Result = 0; From bocchino at cs.uiuc.edu Tue Oct 18 14:22:21 2005 From: bocchino at cs.uiuc.edu (Robert Bocchino) Date: Tue, 18 Oct 2005 14:22:21 -0500 Subject: [llvm-commits] [vector_llvm] CVS: llvm/include/llvm/Bytecode/BytecodeHandler.h Message-ID: <200510181922.OAA13377@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm/Bytecode: BytecodeHandler.h updated: 1.9 -> 1.9.4.1 --- Log message: Initial commit of Vector LLVM. --- Diffs of the changes: (+5 -5) BytecodeHandler.h | 10 +++++----- 1 files changed, 5 insertions(+), 5 deletions(-) Index: llvm/include/llvm/Bytecode/BytecodeHandler.h diff -u llvm/include/llvm/Bytecode/BytecodeHandler.h:1.9 llvm/include/llvm/Bytecode/BytecodeHandler.h:1.9.4.1 --- llvm/include/llvm/Bytecode/BytecodeHandler.h:1.9 Thu May 5 17:31:18 2005 +++ llvm/include/llvm/Bytecode/BytecodeHandler.h Tue Oct 18 14:21:56 2005 @@ -23,7 +23,7 @@ class ArrayType; class StructType; class PointerType; -class PackedType; +class FixedVectorType; class ConstantArray; class Module; @@ -267,10 +267,10 @@ Constant* Val ///< The constant value ) {} - /// @brief Handle a constant packed - virtual void handleConstantPacked( - const PackedType* PT, ///< Type of the array - std::vector& ElementSlots,///< Slot nums for packed values + /// @brief Handle a constant fixed vector + virtual void handleConstantVector( + const FixedVectorType* PT, ///< Type of the fixed vector + std::vector& ElementSlots,///< Slot nums for fixed vector values unsigned TypeSlot, ///< Slot # of type Constant* Val ///< The constant value ) {} From bocchino at cs.uiuc.edu Tue Oct 18 14:22:20 2005 From: bocchino at cs.uiuc.edu (Robert Bocchino) Date: Tue, 18 Oct 2005 14:22:20 -0500 Subject: [llvm-commits] [vector_llvm] CVS: llvm/include/llvm/Constants.h DerivedTypes.h Instruction.def Instructions.h Type.h Message-ID: <200510181922.OAA13361@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm: Constants.h updated: 1.75 -> 1.75.2.1 DerivedTypes.h updated: 1.68 -> 1.68.4.1 Instruction.def updated: 1.16 -> 1.16.2.1 Instructions.h updated: 1.27 -> 1.27.2.1 Type.h updated: 1.77 -> 1.77.4.1 --- Log message: Initial commit of Vector LLVM. --- Diffs of the changes: (+673 -74) Constants.h | 38 ++-- DerivedTypes.h | 132 ++++++++++++--- Instruction.def | 65 ++++--- Instructions.h | 492 +++++++++++++++++++++++++++++++++++++++++++++++++++++++- Type.h | 20 +- 5 files changed, 673 insertions(+), 74 deletions(-) Index: llvm/include/llvm/Constants.h diff -u llvm/include/llvm/Constants.h:1.75 llvm/include/llvm/Constants.h:1.75.2.1 --- llvm/include/llvm/Constants.h:1.75 Tue Oct 4 13:12:13 2005 +++ llvm/include/llvm/Constants.h Tue Oct 18 14:21:56 2005 @@ -29,7 +29,7 @@ class ArrayType; class StructType; class PointerType; -class PackedType; +class FixedVectorType; template struct ConstantCreator; @@ -163,6 +163,7 @@ /// ConstantInt::get static method: return a ConstantInt with the specified /// value. as above, we work only with very small values here. /// + static ConstantInt *get(const Type *Ty, unsigned char V); /// isNullValue - Return true if this is the value that would be returned by @@ -192,6 +193,7 @@ public: /// get() - Static factory methods - Return objects of the specified value /// + static ConstantSInt *get(const Type *Ty, int64_t V); /// isValueValidForType - return true if Ty is big enough to represent V. @@ -243,6 +245,7 @@ public: /// get() - Static factory methods - Return objects of the specified value /// + static ConstantUInt *get(const Type *Ty, uint64_t V); /// isValueValidForType - return true if Ty is big enough to represent V. @@ -280,6 +283,7 @@ ConstantFP(const Type *Ty, double V); public: /// get() - Static factory methods - Return objects of the specified value + static ConstantFP *get(const Type *Ty, double V); /// isValueValidForType - return true if Ty is big enough to represent V. @@ -420,25 +424,26 @@ }; //===----------------------------------------------------------------------===// -/// ConstantPacked - Constant Packed Declarations +/// ConstantVector - Constant FixedVector Declarations /// -class ConstantPacked : public Constant { - friend struct ConstantCreator >; - ConstantPacked(const ConstantPacked &); // DO NOT IMPLEMENT + ConstantVector(const ConstantVector &); // DO NOT IMPLEMENT protected: - ConstantPacked(const PackedType *T, const std::vector &Val); - ~ConstantPacked(); + ConstantVector(const FixedVectorType *T, const std::vector &Val); + ~ConstantVector(); public: /// get() - Static factory methods - Return objects of the specified value - static Constant *get(const PackedType *T, const std::vector &); + static Constant *get(const FixedVectorType *T, const std::vector &); static Constant *get(const std::vector &V); - - /// getType - Specialize the getType() method to always return an PackedType, - /// which reduces the amount of casting needed in parts of the compiler. + + /// getType - Specialize the getType() method to always return a + /// FixedVectorType, which reduces the amount of casting needed in + /// parts of the compiler. /// - inline const PackedType *getType() const { - return reinterpret_cast(Value::getType()); + inline const FixedVectorType *getType() const { + return reinterpret_cast(Value::getType()); } /// isNullValue - Return true if this is the value that would be returned by @@ -450,9 +455,14 @@ virtual void replaceUsesOfWithOnConstant(Value *From, Value *To, Use *U); /// Methods for support type inquiry through isa, cast, and dyn_cast: - static inline bool classof(const ConstantPacked *) { return true; } + static inline bool classof(const ConstantVector *) { return true; } static bool classof(const Value *V) { + //<<<<<<< Constants.h + //return V->getValueType() == SimpleConstantVal && + // V->getType()->getTypeID() == Type::FixedVectorTyID; + //======= return V->getValueType() == ConstantPackedVal; + //>>>>>>> 1.75 } }; Index: llvm/include/llvm/DerivedTypes.h diff -u llvm/include/llvm/DerivedTypes.h:1.68 llvm/include/llvm/DerivedTypes.h:1.68.4.1 --- llvm/include/llvm/DerivedTypes.h:1.68 Sun May 15 11:13:11 2005 +++ llvm/include/llvm/DerivedTypes.h Tue Oct 18 14:21:56 2005 @@ -29,7 +29,9 @@ class ArrayValType; class StructValType; class PointerValType; -class PackedValType; +class StreamValType; +class VectorValType; +class FixedVectorValType; class DerivedType : public Type, public AbstractTypeUser { // AbstractTypeUsers - Implement a list of the users that need to be notified @@ -156,7 +158,7 @@ /// CompositeType - Common super class of ArrayType, StructType, PointerType -/// and PackedType +/// and FixedVectorType class CompositeType : public DerivedType { protected: inline CompositeType(TypeID id) : DerivedType(id) { } @@ -174,7 +176,9 @@ return T->getTypeID() == ArrayTyID || T->getTypeID() == StructTyID || T->getTypeID() == PointerTyID || - T->getTypeID() == PackedTyID; + T->getTypeID() == StreamTyID || + T->getTypeID() == VectorTyID || + T->getTypeID() == FixedVectorTyID; } }; @@ -231,13 +235,12 @@ }; -/// SequentialType - This is the superclass of the array, pointer and packed -/// type classes. All of these represent "arrays" in memory. The array type -/// represents a specifically sized array, pointer types are unsized/unknown -/// size arrays, packed types represent specifically sized arrays that -/// allow for use of SIMD instructions. SequentialType holds the common -/// features of all, which stem from the fact that all three lay their -/// components out in memory identically. +/// SequentialType - This is the superclass of the array, pointer, and +/// vector type classes. The array type represents a specifically +/// sized array, pointer types are unsized/unknown size arrays, and +/// vector types are first-class types that allow for use of SIMD +/// instructions. SequentialType holds the common features of all, +/// which stem from the fact that each is a sequence of elements. /// class SequentialType : public CompositeType { SequentialType(const SequentialType &); // Do not implement! @@ -264,8 +267,10 @@ static inline bool classof(const SequentialType *T) { return true; } static inline bool classof(const Type *T) { return T->getTypeID() == ArrayTyID || - T->getTypeID() == PointerTyID || - T->getTypeID() == PackedTyID; + T->getTypeID() == PointerTyID || + T->getTypeID() == StreamTyID || + T->getTypeID() == VectorTyID || + T->getTypeID() == FixedVectorTyID; } }; @@ -306,28 +311,105 @@ } }; -/// PackedType - Class to represent packed types +/// StreamType - Class to represent vector types /// -class PackedType : public SequentialType { - friend class TypeMap; - unsigned NumElements; +class StreamType : public SequentialType { + friend class TypeMap; + + StreamType(const StreamType &); // Do not implement + const StreamType &operator=(const StreamType &); // Do not implement + +protected: + /// This should really be private, but it squelches a bogus warning + /// from GCC to make them protected: warning: `class StreamType' only + /// defines private constructors and has no friends + /// + /// Private ctor - Only can be created by a static member... + /// + StreamType(const Type *ElType); + +public: + /// StreamType::get - This static method is the primary way to construct a + /// StreamType + /// + static StreamType *get(const Type *ElementType); + + // Implement the AbstractTypeUser interface. + virtual void refineAbstractType(const DerivedType *OldTy, const Type *NewTy); + virtual void typeBecameConcrete(const DerivedType *AbsTy); + + // Methods for support type inquiry through isa, cast, and dyn_cast: + static inline bool classof(const StreamType *T) { return true; } + static inline bool classof(const Type *T) { + return T->getTypeID() == StreamTyID; + } +}; + +/// VectorType - Class to represent vector types +/// +class VectorType : public SequentialType { + friend class TypeMap; + + VectorType(const VectorType &); // Do not implement + const VectorType &operator=(const VectorType &); // Do not implement - PackedType(const PackedType &); // Do not implement - const PackedType &operator=(const PackedType &); // Do not implement protected: /// This should really be private, but it squelches a bogus warning - /// from GCC to make them protected: warning: `class PackedType' only + /// from GCC to make them protected: warning: `class VectorType' only /// defines private constructors and has no friends /// /// Private ctor - Only can be created by a static member... /// - PackedType(const Type *ElType, unsigned NumEl); + VectorType(const Type *ElType, bool fixed = false); + +public: + /// VectorType::get - This static method is the primary way to construct a + /// VectorType + /// + static VectorType *get(const Type *ElementType); + + /// Functions for vector support + /// + bool isIntegerVector() const { return getElementType()->isInteger(); } + bool isIntegralVector() const { return getElementType()->isIntegral(); } + bool isFPVector() const { return getElementType()->isFloatingPoint(); } + bool isBooleanVector() const { return getElementType() == Type::BoolTy; } + + // Implement the AbstractTypeUser interface. + virtual void refineAbstractType(const DerivedType *OldTy, const Type *NewTy); + virtual void typeBecameConcrete(const DerivedType *AbsTy); + + // Methods for support type inquiry through isa, cast, and dyn_cast: + static inline bool classof(const VectorType *T) { return true; } + static inline bool classof(const Type *T) { + return T->getTypeID() == VectorTyID || + T->getTypeID() == FixedVectorTyID; + } +}; + +/// FixedVectorType - Class to represent vectors with fixed lengths +/// +class FixedVectorType : public VectorType { + friend class TypeMap; + unsigned NumElements; + + FixedVectorType(const FixedVectorType &); // Do not implement + const FixedVectorType &operator=(const FixedVectorType &); // Do not implement +protected: + /// This should really be private, but it squelches a bogus warning + /// from GCC to make them protected: warning: `class + /// FixedVectorType' only defines private constructors and has no + /// friends + /// + /// Private ctor - Only can be created by a static member... + /// + FixedVectorType(const Type *ElType, unsigned NumEl); public: - /// PackedType::get - This static method is the primary way to construct an - /// PackedType + /// FixedVectorType::get - This static method is the primary way to construct an + /// FixedVectorType /// - static PackedType *get(const Type *ElementType, unsigned NumElements); + static FixedVectorType *get(const Type *ElementType, unsigned NumElements); inline unsigned getNumElements() const { return NumElements; } @@ -336,9 +418,9 @@ virtual void typeBecameConcrete(const DerivedType *AbsTy); // Methods for support type inquiry through isa, cast, and dyn_cast: - static inline bool classof(const PackedType *T) { return true; } + static inline bool classof(const FixedVectorType *T) { return true; } static inline bool classof(const Type *T) { - return T->getTypeID() == PackedTyID; + return T->getTypeID() == FixedVectorTyID; } }; Index: llvm/include/llvm/Instruction.def diff -u llvm/include/llvm/Instruction.def:1.16 llvm/include/llvm/Instruction.def:1.16.2.1 --- llvm/include/llvm/Instruction.def:1.16 Fri Jun 24 13:17:33 2005 +++ llvm/include/llvm/Instruction.def Tue Oct 18 14:21:56 2005 @@ -102,40 +102,55 @@ HANDLE_BINARY_INST(14, Xor , BinaryOperator) // Binary comparison operators... -HANDLE_BINARY_INST(15, SetEQ , SetCondInst) +HANDLE_BINARY_INST(15, SetEQ , SetCondInst) // Scalar operators HANDLE_BINARY_INST(16, SetNE , SetCondInst) HANDLE_BINARY_INST(17, SetLE , SetCondInst) HANDLE_BINARY_INST(18, SetGE , SetCondInst) HANDLE_BINARY_INST(19, SetLT , SetCondInst) HANDLE_BINARY_INST(20, SetGT , SetCondInst) - LAST_BINARY_INST(20) +HANDLE_BINARY_INST(21, VSetEQ , SetCondInst) // Vector operators +HANDLE_BINARY_INST(22, VSetNE , SetCondInst) +HANDLE_BINARY_INST(23, VSetLE , SetCondInst) +HANDLE_BINARY_INST(24, VSetGE , SetCondInst) +HANDLE_BINARY_INST(25, VSetLT , SetCondInst) +HANDLE_BINARY_INST(26, VSetGT , SetCondInst) + LAST_BINARY_INST(26) // Memory operators... - FIRST_MEMORY_INST(21) -HANDLE_MEMORY_INST(21, Malloc, MallocInst) // Heap management instructions -HANDLE_MEMORY_INST(22, Free , FreeInst ) -HANDLE_MEMORY_INST(23, Alloca, AllocaInst) // Stack management -HANDLE_MEMORY_INST(24, Load , LoadInst ) // Memory manipulation instrs -HANDLE_MEMORY_INST(25, Store , StoreInst ) -HANDLE_MEMORY_INST(26, GetElementPtr, GetElementPtrInst) - LAST_MEMORY_INST(26) + FIRST_MEMORY_INST(27) +HANDLE_MEMORY_INST(28, Malloc, MallocInst) // Heap management instructions +HANDLE_MEMORY_INST(29, Free , FreeInst ) +HANDLE_MEMORY_INST(30, Alloca, AllocaInst) // Stack management +HANDLE_MEMORY_INST(31, Load , LoadInst ) // Memory manipulation instrs +HANDLE_MEMORY_INST(32, Store , StoreInst ) +HANDLE_MEMORY_INST(33, VGather, VGatherInst) // vector gather +HANDLE_MEMORY_INST(34, VImm, VImmInst) // vector immediate +HANDLE_MEMORY_INST(35, VScatter, VScatterInst) // vector scatter +HANDLE_MEMORY_INST(36, GetElementPtr, GetElementPtrInst) + LAST_MEMORY_INST(36) // Other operators... - FIRST_OTHER_INST(27) -HANDLE_OTHER_INST(27, PHI , PHINode ) // PHI node instruction -HANDLE_OTHER_INST(28, Cast , CastInst ) // Type cast -HANDLE_OTHER_INST(29, Call , CallInst ) // Call a function - -HANDLE_OTHER_INST(30, Shl , ShiftInst ) // Shift operations -HANDLE_OTHER_INST(31, Shr , ShiftInst ) -// 32 -> Empty slot used to be used for vanext in llvm 1.5 and before. -// 33 -> Empty slot used to be used for vaarg in llvm 1.5 and before. -HANDLE_OTHER_INST(34, Select , SelectInst ) // select instruction - -HANDLE_OTHER_INST(35, UserOp1, Instruction) // May be used internally in a pass -HANDLE_OTHER_INST(36, UserOp2, Instruction) -HANDLE_OTHER_INST(37, VAArg , VAArgInst ) // vaarg instruction - LAST_OTHER_INST(37) + FIRST_OTHER_INST(37) +HANDLE_OTHER_INST(37, PHI , PHINode ) // PHI node instruction +HANDLE_OTHER_INST(38, Cast , CastInst ) // Type cast +HANDLE_OTHER_INST(39, Call , CallInst ) // Call a function + +HANDLE_OTHER_INST(40, Shl , ShiftInst ) // Shift operations +HANDLE_OTHER_INST(41, Shr , ShiftInst ) + // 42 is reserved for old VANext + // 43 is reserved for old VAArg +HANDLE_OTHER_INST(44, Select , SelectInst ) // select instruction +HANDLE_OTHER_INST(45, VSelect, VSelectInst ) // vector select instruction + +HANDLE_OTHER_INST(46, Extract, ExtractInst) // vector extract +HANDLE_OTHER_INST(47, ExtractElement, ExtractElementInst) // vector extract element +HANDLE_OTHER_INST(48, Combine, CombineInst) // vector combine +HANDLE_OTHER_INST(49, CombineElement, CombineElementInst) // vector combine element + +HANDLE_OTHER_INST(50, UserOp1, Instruction) // May be used internally in a pass +HANDLE_OTHER_INST(51, UserOp2, Instruction) +HANDLE_OTHER_INST(52, VAArg , VAArgInst ) // vaarg instruction + LAST_OTHER_INST(52) #undef FIRST_TERM_INST #undef HANDLE_TERM_INST Index: llvm/include/llvm/Instructions.h diff -u llvm/include/llvm/Instructions.h:1.27 llvm/include/llvm/Instructions.h:1.27.2.1 --- llvm/include/llvm/Instructions.h:1.27 Thu Aug 4 19:49:06 2005 +++ llvm/include/llvm/Instructions.h Tue Oct 18 14:21:56 2005 @@ -24,6 +24,8 @@ class BasicBlock; class ConstantInt; class PointerType; +class VectorType; + //===----------------------------------------------------------------------===// // AllocationInst Class @@ -380,8 +382,8 @@ // SetCondInst Class //===----------------------------------------------------------------------===// -/// SetCondInst class - Represent a setCC operator, where CC is eq, ne, lt, gt, -/// le, or ge. +/// SetCondInst class - Represent a SetCC or VSetCC operator, where CC +/// is eq, ne, lt, gt, le, or ge. /// class SetCondInst : public BinaryOperator { public: @@ -415,13 +417,35 @@ /// static BinaryOps getSwappedCondition(BinaryOps Opcode); + // getScalarOpcode - Return the scalar version of this opcode. + // For example seteq -> seteq, vseteq -> seteq, etc. + // + BinaryOps getScalarOpcode() const { + return getScalarOpcode(getOpcode()); + } + + /// getScalarOpcode - Static version that you can use without an + /// instruction available. + /// + static BinaryOps getScalarOpcode(BinaryOps Opcode); + + // getVectorOpcode - Return the scalar version of this opcode. + // For example seteq -> seteq, vseteq -> seteq, etc. + // + BinaryOps getVectorOpcode() const { + return getVectorOpcode(getOpcode()); + } + + /// getVectorOpcode - Static version that you can use without an + /// instruction available. + /// + static BinaryOps getVectorOpcode(BinaryOps Opcode); // Methods for support type inquiry through isa, cast, and dyn_cast: static inline bool classof(const SetCondInst *) { return true; } static inline bool classof(const Instruction *I) { - return I->getOpcode() == SetEQ || I->getOpcode() == SetNE || - I->getOpcode() == SetLE || I->getOpcode() == SetGE || - I->getOpcode() == SetLT || I->getOpcode() == SetGT; + return I->getOpcode() >= SetEQ && + I->getOpcode() <= VSetGT; } static inline bool classof(const Value *V) { return isa(V) && classof(cast(V)); @@ -661,6 +685,72 @@ }; //===----------------------------------------------------------------------===// +// VSelectInst Class +//===----------------------------------------------------------------------===// + +/// VSelectInst - This class represents the vector version of the LLVM +/// 'select' instruction. +/// +class VSelectInst : public Instruction { + Use Ops[3]; + + void init(Value *C, Value *S1, Value *S2) { + Ops[0].init(C, this); + Ops[1].init(S1, this); + Ops[2].init(S2, this); + } + + VSelectInst(const VSelectInst &SI) + : Instruction(SI.getType(), SI.getOpcode(), Ops, 3) { + init(SI.Ops[0], SI.Ops[1], SI.Ops[2]); + } +public: + VSelectInst(Value *C, Value *S1, Value *S2, const std::string &Name = "", + Instruction *InsertBefore = 0) + : Instruction(S1->getType(), Instruction::VSelect, Ops, 3, + Name, InsertBefore) { + init(C, S1, S2); + } + VSelectInst(Value *C, Value *S1, Value *S2, const std::string &Name, + BasicBlock *InsertAtEnd) + : Instruction(S1->getType(), Instruction::VSelect, Ops, 3, + Name, InsertAtEnd) { + init(C, S1, S2); + } + + Value *getCondition() const { return Ops[0]; } + Value *getTrueValue() const { return Ops[1]; } + Value *getFalseValue() const { return Ops[2]; } + + /// Transparently provide more efficient getOperand methods. + Value *getOperand(unsigned i) const { + assert(i < 3 && "getOperand() out of range!"); + return Ops[i]; + } + void setOperand(unsigned i, Value *Val) { + assert(i < 3 && "setOperand() out of range!"); + Ops[i] = Val; + } + unsigned getNumOperands() const { return 3; } + + OtherOps getOpcode() const { + return static_cast(Instruction::getOpcode()); + } + + virtual VSelectInst *clone() const; + + // Methods for support type inquiry through isa, cast, and dyn_cast: + static inline bool classof(const VSelectInst *) { return true; } + static inline bool classof(const Instruction *I) { + return I->getOpcode() == Instruction::VSelect; + } + static inline bool classof(const Value *V) { + return isa(V) && classof(cast(V)); + } +}; + + +//===----------------------------------------------------------------------===// // VAArgInst Class //===----------------------------------------------------------------------===// @@ -1289,6 +1379,398 @@ virtual void setSuccessorV(unsigned idx, BasicBlock *B); }; +//===----------------------------------------------------------------------===// +// VMemoryInst Class +//===----------------------------------------------------------------------===// + +/// VMemoryInst - This class is the common base class of VGatherInst and +/// VScatterInst. +/// +class VMemoryInst : public Instruction { +protected: + VMemoryInst(const Type *Ty, unsigned iType, + Use *Ops, unsigned NumOps, + const std::string &Name = "", Instruction *InsertBef = 0); + VMemoryInst(const Type* Ty, unsigned iType, + Use *Ops, unsigned NumOps, + const std::string &Name, BasicBlock *InsertAE); + ~VMemoryInst(); + +public: + + // Check for correct number of indices + // + static bool VMemoryInst::checkNumIndices(const std::vector &Idx) { + return (Idx.size() >= 4 && Idx.size() % 4 == 0); + } + + // Check for correct types of indices + // + static bool VMemoryInst::checkIndexType(const std::vector &); + + virtual Instruction *clone() const = 0; + + const Type *getElementType() const; + virtual Value *getPointerOperand() = 0; + virtual const Value *getPointerOperand() const = 0; + + virtual unsigned getNumIndices() const = 0; + virtual Value *getIndex(unsigned) = 0; + virtual const Value *getIndex(unsigned) const = 0; + + Value *getLowerBound(unsigned level) { return getIndex(4*level); } + const Value *getLowerBound(unsigned level) const { return getIndex(4*level); } + + Value *getUpperBound(unsigned level) { return getIndex(4*level+1); } + const Value *getUpperBound(unsigned level) const { return getIndex(4*level+1); } + + Value *getStride(unsigned level) { return getIndex(4*level+2); } + const Value *getStride(unsigned level) const { return getIndex(4*level+2); } + + Value *getMultiplier(unsigned level) {return getIndex(4*level+3); } + const Value *getMultiplier(unsigned level) const {return getIndex(4*level+3); } + + // Methods for support type inquiry through isa, cast, and dyn_cast: + static inline bool classof(const VMemoryInst *) { return true; } + static inline bool classof(const Instruction *I) { + return I->getOpcode() == Instruction::VGather || + I->getOpcode() == Instruction::VScatter; + } + static inline bool classof(const Value *V) { + return isa(V) && classof(cast(V)); + } +}; + + +//===----------------------------------------------------------------------===// +// VGatherInst Class +//===----------------------------------------------------------------------===// + +/// VGatherInst - an instruction for reading a vector into a register +/// from memory +/// +class VGatherInst : public VMemoryInst { + VGatherInst(const VGatherInst &LI) : VMemoryInst(LI.getType(), VGather, 0, 0) { + NumOperands = LI.getNumOperands(); + Use *OL = OperandList = new Use[NumOperands]; + for (unsigned i = 0; i < NumOperands; ++i) + OL[i].init(LI.getOperand(i), this); + } + void init(Value *Ptr, const std::vector &Idx); + +public: + VGatherInst(Value *Ptr, const std::vector &Idx, + const std::string &Name = "", Instruction *InsertBefore = 0); + VGatherInst(Value *Ptr, const std::vector &Idx, + const std::string &Name, BasicBlock *InsertAtEnd); + + virtual VGatherInst *clone() const; + + virtual bool mayWriteToMemory() const { return false; } + + Value *getPointerOperand() { return getOperand(0); } + const Value *getPointerOperand() const { return getOperand(0); } + static unsigned getPointerOperandIndex() { return 0U; } + + unsigned getNumIndices() const { // Note: always non-negative + return getNumOperands() - 1; + } + + Value *getIndex(unsigned i) { return getOperand(i + 1); } + const Value *getIndex(unsigned i) const { return getOperand(i + 1); } + + // Methods for support type inquiry through isa, cast, and dyn_cast: + static inline bool classof(const VGatherInst *) { return true; } + static inline bool classof(const Instruction *I) { + return I->getOpcode() == Instruction::VGather; + } + static inline bool classof(const Value *V) { + return isa(V) && classof(cast(V)); + } +}; + + + +//===----------------------------------------------------------------------===// +// VScatterInst Class +//===----------------------------------------------------------------------===// + +/// VScatterInst - an instruction for storing a vector register to +/// memory +/// +class VScatterInst : public VMemoryInst { + VScatterInst(const VScatterInst &SI) : VMemoryInst(SI.getType(), VScatter, 0, 0) { + NumOperands = SI.getNumOperands(); + Use *OL = OperandList = new Use[NumOperands]; + for (unsigned i = 0; i < NumOperands; ++i) + OL[i].init(SI.getOperand(i), this); + } + void init(Value *Val, Value *Ptr, const std::vector &Idx); + +public: + VScatterInst(Value *Val, Value *Ptr, const std::vector &Idx, + Instruction *InsertBefore = 0); + VScatterInst(Value *Val, Value *Ptr, const std::vector &Idx, + BasicBlock *InsertAtEnd); + + virtual VScatterInst *clone() const; + + virtual bool mayWriteToMemory() const { return true; } + + Value *getPointerOperand() { return getOperand(1); } + const Value *getPointerOperand() const { return getOperand(1); } + static unsigned getPointerOperandIndex() { return 1U; } + + unsigned getNumIndices() const { // Note: always non-negative + return getNumOperands() - 2; + } + + Value *getIndex(unsigned i) { return getOperand(i + 2); } + const Value *getIndex(unsigned i) const { return getOperand(i + 2); } + + // Methods for support type inquiry through isa, cast, and dyn_cast: + static inline bool classof(const VScatterInst *) { return true; } + static inline bool classof(const Instruction *I) { + return I->getOpcode() == Instruction::VScatter; + } + static inline bool classof(const Value *V) { + return isa(V) && classof(cast(V)); + } +}; + + +//===----------------------------------------------------------------------===// +// VImmInst Class +//===----------------------------------------------------------------------===// + +/// VImmInst - an instruction for creating a vector from a replicated +/// scalar value +/// +class VImmInst : public Instruction { + Use Ops[2]; + VImmInst(const VImmInst &VI) : Instruction(VI.getType(), VImm, Ops, 2) { + Ops[0].init(VI.Ops[0], this); + Ops[1].init(VI.Ops[1], this); + } + +public: + VImmInst(Value *Ptr, Value *Len, bool isFixed, + const std::string &Name = "", Instruction *InsertBefore = 0); + VImmInst(Value *Ptr, Value *Len, bool isFixed, + const std::string &Name, BasicBlock *InsertAtEnd); + + virtual VImmInst *clone() const; + + virtual bool mayWriteToMemory() const { return false; } + + /// Transparently provide more efficient getOperand methods. + Value *getOperand(unsigned i) const { + assert(i < 2 && "getOperand() out of range!"); + return Ops[i]; + } + void setOperand(unsigned i, Value *Val) { + assert(i < 2 && "setOperand() out of range!"); + Ops[i] = Val; + } + unsigned getNumOperands() const { return 2; } + + // Methods for support type inquiry through isa, cast, and dyn_cast: + static inline bool classof(const VImmInst *) { return true; } + static inline bool classof(const Instruction *I) { + return I->getOpcode() == Instruction::VImm; + } + static inline bool classof(const Value *V) { + return isa(V) && classof(cast(V)); + } +}; + +//===----------------------------------------------------------------------===// +// ExtractInst Class +//===----------------------------------------------------------------------===// + +/// ExtractInst - an instruction for extracting a subvector from a +/// vector +/// +class ExtractInst : public Instruction { + Use Ops[4]; + ExtractInst(const ExtractInst &EI) : Instruction(EI.getType(), Extract, Ops, 4) { + Ops[0].init(EI.Ops[0], this); + Ops[1].init(EI.Ops[1], this); + Ops[2].init(EI.Ops[2], this); + Ops[3].init(EI.Ops[3], this); + } + +public: + ExtractInst(Value *Val, Value *Start, Value *Stride, Value *Len, + const std::string &Name = "", Instruction *InsertBefore = 0); + ExtractInst(Value *Val, Value *Start, Value *Stride, Value *Len, + const std::string &Name, BasicBlock *InsertAtEnd); + + virtual ExtractInst *clone() const; + + virtual bool mayWriteToMemory() const { return false; } + + /// Transparently provide more efficient getOperand methods. + Value *getOperand(unsigned i) const { + assert(i < 4 && "getOperand() out of range!"); + return Ops[i]; + } + void setOperand(unsigned i, Value *Val) { + assert(i < 4 && "setOperand() out of range!"); + Ops[i] = Val; + } + unsigned getNumOperands() const { return 4; } + + // Methods for support type inquiry through isa, cast, and dyn_cast: + static inline bool classof(const ExtractInst *) { return true; } + static inline bool classof(const Instruction *I) { + return I->getOpcode() == Instruction::Extract; + } + static inline bool classof(const Value *V) { + return isa(V) && classof(cast(V)); + } +}; + +//===----------------------------------------------------------------------===// +// ExtractElementInst Class +//===----------------------------------------------------------------------===// + +/// ExtractElementInst - an instruction for extracting a single +/// element from a vector +/// +class ExtractElementInst : public Instruction { + Use Ops[2]; + ExtractElementInst(const ExtractElementInst &EI) : + Instruction(EI.getType(), ExtractElement, Ops, 2) { + Ops[0].init(EI.Ops[0], this); + Ops[1].init(EI.Ops[1], this); + } + +public: + ExtractElementInst(Value *Val, Value *Index, + const std::string &Name = "", Instruction *InsertBefore = 0); + ExtractElementInst(Value *Val, Value *Index, + const std::string &Name, BasicBlock *InsertAtEnd); + + virtual ExtractElementInst *clone() const; + + virtual bool mayWriteToMemory() const { return false; } + + /// Transparently provide more efficient getOperand methods. + Value *getOperand(unsigned i) const { + assert(i < 2 && "getOperand() out of range!"); + return Ops[i]; + } + void setOperand(unsigned i, Value *Val) { + assert(i < 2 && "setOperand() out of range!"); + Ops[i] = Val; + } + unsigned getNumOperands() const { return 2; } + + // Methods for support type inquiry through isa, cast, and dyn_cast: + static inline bool classof(const ExtractElementInst *) { return true; } + static inline bool classof(const Instruction *I) { + return I->getOpcode() == Instruction::ExtractElement; + } + static inline bool classof(const Value *V) { + return isa(V) && classof(cast(V)); + } +}; + +//===----------------------------------------------------------------------===// +// CombineInst Class +//===----------------------------------------------------------------------===// + +/// CombineInst - an instruction for combining two vectors by +/// overlaying the second on the first +/// +class CombineInst : public Instruction { + Use Ops[4]; + CombineInst(const CombineInst &EI) : Instruction(EI.getType(), Combine, Ops, 4) { + Ops[0].init(EI.Ops[0], this); + Ops[1].init(EI.Ops[1], this); + Ops[2].init(EI.Ops[2], this); + Ops[3].init(EI.Ops[3], this); + } + +public: + CombineInst(Value *V1, Value *V2, Value *Start, Value *Stride, + const std::string &Name = "", Instruction *InsertBefore = 0); + CombineInst(Value *V1, Value *V2, Value *Start, Value *Stride, + const std::string &Name, BasicBlock *InsertAtEnd); + + virtual CombineInst *clone() const; + + virtual bool mayWriteToMemory() const { return false; } + + /// Transparently provide more efficient getOperand methods. + Value *getOperand(unsigned i) const { + assert(i < 4 && "getOperand() out of range!"); + return Ops[i]; + } + void setOperand(unsigned i, Value *Val) { + assert(i < 4 && "setOperand() out of range!"); + Ops[i] = Val; + } + unsigned getNumOperands() const { return 4; } + + // Methods for support type inquiry through isa, cast, and dyn_cast: + static inline bool classof(const CombineInst *) { return true; } + static inline bool classof(const Instruction *I) { + return I->getOpcode() == Instruction::Combine; + } + static inline bool classof(const Value *V) { + return isa(V) && classof(cast(V)); + } +}; + +//===----------------------------------------------------------------------===// +// CombineElementInst Class +//===----------------------------------------------------------------------===// + +/// CombineElementInst - an instruction for combining two vectors by +/// overlaying the second on the first +/// +class CombineElementInst : public Instruction { + Use Ops[3]; + CombineElementInst(const CombineElementInst &EI) : + Instruction(EI.getType(), CombineElement, Ops, 3) { + Ops[0].init(EI.Ops[0], this); + Ops[1].init(EI.Ops[1], this); + Ops[2].init(EI.Ops[2], this); + } + +public: + CombineElementInst(Value *Vector, Value *Element, Value *Index, + const std::string &Name = "", Instruction *InsertBefore = 0); + CombineElementInst(Value *Vector, Value *Element, Value *Index, + const std::string &Name, BasicBlock *InsertAtEnd); + + virtual CombineElementInst *clone() const; + + virtual bool mayWriteToMemory() const { return false; } + + /// Transparently provide more efficient getOperand methods. + Value *getOperand(unsigned i) const { + assert(i < 3 && "getOperand() out of range!"); + return Ops[i]; + } + void setOperand(unsigned i, Value *Val) { + assert(i < 3 && "setOperand() out of range!"); + Ops[i] = Val; + } + unsigned getNumOperands() const { return 3; } + + // Methods for support type inquiry through isa, cast, and dyn_cast: + static inline bool classof(const CombineElementInst *) { return true; } + static inline bool classof(const Instruction *I) { + return I->getOpcode() == Instruction::CombineElement; + } + static inline bool classof(const Value *V) { + return isa(V) && classof(cast(V)); + } +}; + } // End llvm namespace #endif Index: llvm/include/llvm/Type.h diff -u llvm/include/llvm/Type.h:1.77 llvm/include/llvm/Type.h:1.77.4.1 --- llvm/include/llvm/Type.h:1.77 Sat Apr 23 16:59:42 2005 +++ llvm/include/llvm/Type.h Tue Oct 18 14:21:56 2005 @@ -48,7 +48,7 @@ class OpaqueType; class PointerType; class StructType; -class PackedType; +class FixedVectorType; class Type { public: @@ -73,7 +73,9 @@ FunctionTyID , StructTyID, // Functions... Structs... ArrayTyID , PointerTyID, // Array... pointer... OpaqueTyID, // Opaque type instances... - PackedTyID, // SIMD 'packed' format... + StreamTyID, // Stream... + VectorTyID, // Vector... + FixedVectorTyID, // Vector with fixed length... //... NumTypeIDs, // Must remain as last defined ID @@ -172,6 +174,13 @@ /// types bool isFloatingPoint() const { return ID == FloatTyID || ID == DoubleTyID; } + /// Functions for vector support + /// + virtual bool isIntegerVector() const { return false; } + virtual bool isIntegralVector() const { return false; } + virtual bool isFPVector() const { return false; } + virtual bool isBooleanVector() const { return false; } + /// isAbstract - True if the type is either an Opaque type, or is a derived /// type that includes an opaque type somewhere in it. /// @@ -192,8 +201,9 @@ /// isFirstClassType - Return true if the value is holdable in a register. /// inline bool isFirstClassType() const { - return (ID != VoidTyID && ID <= LastPrimitiveTyID) || - ID == PointerTyID || ID == PackedTyID; + return (ID != VoidTyID && ID <= LastPrimitiveTyID) || + ID == PointerTyID || ID == VectorTyID || ID == FixedVectorTyID || + ID == StreamTyID; } /// isSized - Return true if it makes sense to take the size of this type. To @@ -206,7 +216,7 @@ return true; // If it is not something that can have a size (e.g. a function or label), // it doesn't have a size. - if (ID != StructTyID && ID != ArrayTyID && ID != PackedTyID) + if (ID != StructTyID && ID != ArrayTyID && ID != FixedVectorTyID) return false; // If it is something that can have a size and it's concrete, it definitely // has a size, otherwise we have to try harder to decide. From bocchino at cs.uiuc.edu Tue Oct 18 14:22:23 2005 From: bocchino at cs.uiuc.edu (Robert Bocchino) Date: Tue, 18 Oct 2005 14:22:23 -0500 Subject: [llvm-commits] [vector_llvm] CVS: llvm/lib/Bytecode/Reader/Analyzer.cpp Reader.cpp Message-ID: <200510181922.OAA13479@zion.cs.uiuc.edu> Changes in directory llvm/lib/Bytecode/Reader: Analyzer.cpp updated: 1.20 -> 1.20.4.1 Reader.cpp updated: 1.167 -> 1.167.2.1 --- Log message: Initial commit of Vector LLVM. --- Diffs of the changes: (+119 -17) Analyzer.cpp | 12 ++--- Reader.cpp | 124 +++++++++++++++++++++++++++++++++++++++++++++++++++++------ 2 files changed, 119 insertions(+), 17 deletions(-) Index: llvm/lib/Bytecode/Reader/Analyzer.cpp diff -u llvm/lib/Bytecode/Reader/Analyzer.cpp:1.20 llvm/lib/Bytecode/Reader/Analyzer.cpp:1.20.4.1 --- llvm/lib/Bytecode/Reader/Analyzer.cpp:1.20 Thu May 5 17:32:13 2005 +++ llvm/lib/Bytecode/Reader/Analyzer.cpp Tue Oct 18 14:21:57 2005 @@ -470,14 +470,14 @@ bca.numValues++; } - virtual void handleConstantPacked( - const PackedType* PT, + virtual void handleConstantVector( + const FixedVectorType* PT, std::vector& Elements, - unsigned TypeSlot, - Constant* PackedVal) + unsigned TypeSlot, + Constant* FixedVectorVal) { if (os) { - *os << " PACKD: "; + *os << " VECTOR: "; WriteTypeSymbolic(*os,PT,M); *os << " TypeSlot=" << TypeSlot << "\n"; for ( unsigned i = 0; i < Elements.size(); ++i ) { @@ -486,7 +486,7 @@ *os << "\n"; } *os << " Value="; - PackedVal->print(*os); + FixedVectorVal->print(*os); *os << "\n"; } Index: llvm/lib/Bytecode/Reader/Reader.cpp diff -u llvm/lib/Bytecode/Reader/Reader.cpp:1.167 llvm/lib/Bytecode/Reader/Reader.cpp:1.167.2.1 --- llvm/lib/Bytecode/Reader/Reader.cpp:1.167 Mon Oct 3 16:26:53 2005 +++ llvm/lib/Bytecode/Reader/Reader.cpp Tue Oct 18 14:21:57 2005 @@ -678,7 +678,7 @@ Result = new VAArgInst(getValue(iType, Oprnds[0]), getSanitizedType(Oprnds[1])); break; - case 32: { //VANext_old + case 42: { //VANext_old const Type* ArgTy = getValue(iType, Oprnds[0])->getType(); Function* NF = TheModule->getOrInsertFunction("llvm.va_copy", ArgTy, ArgTy, 0); @@ -698,7 +698,7 @@ Result = new LoadInst(foo); break; } - case 33: { //VAArg_old + case 43: { //VAArg_old const Type* ArgTy = getValue(iType, Oprnds[0])->getType(); Function* NF = TheModule->getOrInsertFunction("llvm.va_copy", ArgTy, ArgTy, 0); @@ -719,11 +719,26 @@ Result = new CastInst(getValue(iType, Oprnds[0]), getSanitizedType(Oprnds[1])); break; - case Instruction::Select: - Result = new SelectInst(getValue(Type::BoolTyID, Oprnds[0]), + case Instruction::Select: { + unsigned rType = Type::BoolTyID; + Result = new SelectInst(getValue(rType, Oprnds[0]), getValue(iType, Oprnds[1]), getValue(iType, Oprnds[2])); break; + } + case Instruction::VSelect: { + unsigned rType; + if (const FixedVectorType *VT = dyn_cast(InstTy)) + rType = getTypeSlot(FixedVectorType::get(Type::BoolTy, VT->getNumElements())); + else if (isa(InstTy)) + rType = getTypeSlot(VectorType::get(Type::BoolTy)); + else + error("Type of vselect must be vector type!"); + Result = new VSelectInst(getValue(rType, Oprnds[0]), + getValue(iType, Oprnds[1]), + getValue(iType, Oprnds[2])); + break; + } case Instruction::PHI: { if (Oprnds.size() == 0 || (Oprnds.size() & 1)) error("Invalid phi node encountered!"); @@ -981,7 +996,73 @@ Result = new LoadInst(getValue(iType, Oprnds[0]), "", Opcode == 62); break; - case 63: // volatile store + case Instruction::VGather: { + if (Oprnds.size() == 0 || !isa(InstTy)) + throw std::string("Invalid vgather instruction!"); + + std::vector Idx; + for (unsigned i = 1, e = Oprnds.size(); i != e; ++i) { + Idx.push_back(getValue(Type::LongTyID, Oprnds[i])); + } + + Result = new VGatherInst(getValue(iType, Oprnds[0]), Idx); + break; + } + + case Instruction::VImm: { + if (Oprnds.size() != 2) + throw std::string("Invalid vimm instruction!"); + const VectorType *VT = dyn_cast(InstTy); + if (!VT) + throw std::string("Type of vimm must be vector type!"); + // Result = new VImmInst(getValue(iType, Oprnds[0]), + Result = new VImmInst(getValue(getTypeSlot(VT->getElementType()), Oprnds[0]), + getValue(Type::UIntTyID, Oprnds[1]), + isa(VT)); + break; + } + + case Instruction::Extract: { + if (Oprnds.size() != 4) + throw std::string("Invalid extract instruction!"); + Result = new ExtractInst(getValue(iType, Oprnds[0]), + getValue(Type::UIntTyID, Oprnds[1]), + getValue(Type::UIntTyID, Oprnds[2]), + getValue(Type::UIntTyID, Oprnds[3])); + break; + } + + case Instruction::ExtractElement: { + if (Oprnds.size() != 2) + throw std::string("Invalid extractelement instruction!"); + Result = new ExtractElementInst(getValue(iType, Oprnds[0]), + getValue(Type::UIntTyID, Oprnds[1])); + break; + } + + case Instruction::Combine: { + if (Oprnds.size() != 5) + throw std::string("Invalid combine instruction!"); + Result = new CombineInst(getValue(iType, Oprnds[0]), + //getValue(iType, Oprnds[1]), + getValue(getTypeSlot(getSanitizedType(Oprnds[4])), Oprnds[1]), + getValue(Type::UIntTyID, Oprnds[2]), + getValue(Type::UIntTyID, Oprnds[3])); + break; + } + + case Instruction::CombineElement: { + if (!isa(InstTy) || Oprnds.size() != 3) + throw std::string("Invalid combineelement instruction!"); + Value *Vector = getValue(iType, Oprnds[0]); + const Type *ElTy = cast(Vector->getType())->getElementType(); + Result = new CombineElementInst(Vector, + getValue(getTypeSlot(ElTy), Oprnds[1]), + getValue(Type::UIntTyID, Oprnds[2])); + break; + } + + case 63: // volatile store case Instruction::Store: { if (!isa(InstTy) || Oprnds.size() != 2) error("Invalid store instruction!"); @@ -992,6 +1073,22 @@ Opcode == 63); break; } + + case Instruction::VScatter: { + if (Oprnds.size() == 0 || !isa(InstTy)) + error("Invalid vscatter instruction!"); + + std::vector Idx; + for (unsigned i = 2, e = Oprnds.size(); i != e; ++i) { + Idx.push_back(getValue(Type::LongTyID, Oprnds[i])); + } + Value *Ptr = getValue(iType, Oprnds[1]); + const VectorType *ValTy = VectorType::get(cast(InstTy)->getElementType()); + Result = new VScatterInst(getValue(getTypeSlot(ValTy), Oprnds[0]), Ptr, + Idx); + break; + } + case Instruction::Unwind: if (Oprnds.size() != 0) error("Invalid unwind instruction!"); Result = new UnwindInst(); @@ -1278,10 +1375,10 @@ Result = ArrayType::get(ElementType, NumElements); break; } - case Type::PackedTyID: { + case Type::FixedVectorTyID: { const Type *ElementType = readSanitizedType(); unsigned NumElements = read_vbr_uint(); - Result = PackedType::get(ElementType, NumElements); + Result = FixedVectorType::get(ElementType, NumElements); break; } case Type::StructTyID: { @@ -1304,6 +1401,11 @@ break; } + case Type::VectorTyID: { + Result = VectorType::get(readSanitizedType()); + break; + } + case Type::OpaqueTyID: { Result = OpaqueType::get(); break; @@ -1525,8 +1627,8 @@ return Result; } - case Type::PackedTyID: { - const PackedType *PT = cast(Ty); + case Type::FixedVectorTyID: { + const FixedVectorType *PT = cast(Ty); unsigned NumElements = PT->getNumElements(); unsigned TypeSlot = getTypeSlot(PT->getElementType()); std::vector Elements; @@ -1534,8 +1636,8 @@ while (NumElements--) // Read all of the elements of the constant. Elements.push_back(getConstantValue(TypeSlot, read_vbr_uint())); - Constant* Result = ConstantPacked::get(PT, Elements); - if (Handler) Handler->handleConstantPacked(PT, Elements, TypeSlot, Result); + Constant* Result = ConstantVector::get(PT, Elements); + if (Handler) Handler->handleConstantVector(PT, Elements, TypeSlot, Result); return Result; } From bocchino at cs.uiuc.edu Tue Oct 18 14:22:23 2005 From: bocchino at cs.uiuc.edu (Robert Bocchino) Date: Tue, 18 Oct 2005 14:22:23 -0500 Subject: [llvm-commits] [vector_llvm] CVS: llvm/lib/Transforms/Makefile Message-ID: <200510181922.OAA13470@zion.cs.uiuc.edu> Changes in directory llvm/lib/Transforms: Makefile updated: 1.9 -> 1.9.6.1 --- Log message: Initial commit of Vector LLVM. --- Diffs of the changes: (+1 -1) Makefile | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm/lib/Transforms/Makefile diff -u llvm/lib/Transforms/Makefile:1.9 llvm/lib/Transforms/Makefile:1.9.6.1 --- llvm/lib/Transforms/Makefile:1.9 Wed Oct 27 18:18:45 2004 +++ llvm/lib/Transforms/Makefile Tue Oct 18 14:21:57 2005 @@ -7,7 +7,7 @@ # ##===----------------------------------------------------------------------===## LEVEL = ../.. -PARALLEL_DIRS = Utils Instrumentation Scalar IPO +PARALLEL_DIRS = Utils Instrumentation Scalar IPO Vector TLS LIBRARYNAME = LLVMTransforms BUILD_ARCHIVE = 1 From bocchino at cs.uiuc.edu Tue Oct 18 14:22:22 2005 From: bocchino at cs.uiuc.edu (Robert Bocchino) Date: Tue, 18 Oct 2005 14:22:22 -0500 Subject: [llvm-commits] [vector_llvm] CVS: llvm/include/llvm/Transforms/IPO.h LinkAllPasses.h Scalar.h Message-ID: <200510181922.OAA13388@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm/Transforms: IPO.h updated: 1.44 -> 1.44.2.1 LinkAllPasses.h updated: 1.19 -> 1.19.4.1 Scalar.h updated: 1.56 -> 1.56.4.1 --- Log message: Initial commit of Vector LLVM. --- Diffs of the changes: (+5 -3) IPO.h | 2 ++ LinkAllPasses.h | 2 +- Scalar.h | 4 ++-- 3 files changed, 5 insertions(+), 3 deletions(-) Index: llvm/include/llvm/Transforms/IPO.h diff -u llvm/include/llvm/Transforms/IPO.h:1.44 llvm/include/llvm/Transforms/IPO.h:1.44.2.1 --- llvm/include/llvm/Transforms/IPO.h:1.44 Tue Oct 18 01:28:16 2005 +++ llvm/include/llvm/Transforms/IPO.h Tue Oct 18 14:21:56 2005 @@ -24,6 +24,8 @@ class Function; class BasicBlock; +ModulePass *createHeap2StackPass(); + //===----------------------------------------------------------------------===// // // These functions removes symbols from functions and modules. If OnlyDebugInfo Index: llvm/include/llvm/Transforms/LinkAllPasses.h diff -u llvm/include/llvm/Transforms/LinkAllPasses.h:1.19 llvm/include/llvm/Transforms/LinkAllPasses.h:1.19.4.1 --- llvm/include/llvm/Transforms/LinkAllPasses.h:1.19 Mon Apr 25 21:57:49 2005 +++ llvm/include/llvm/Transforms/LinkAllPasses.h Tue Oct 18 14:21:56 2005 @@ -89,7 +89,7 @@ (void) llvm::createLowerConstantExpressionsPass(); (void) llvm::createLowerGCPass(); (void) llvm::createLowerInvokePass(); - (void) llvm::createLowerPackedPass(); + (void) llvm::createLowerFixedVectorPass(); (void) llvm::createLowerSelectPass(); (void) llvm::createLowerSetJmpPass(); (void) llvm::createLowerSwitchPass(); Index: llvm/include/llvm/Transforms/Scalar.h diff -u llvm/include/llvm/Transforms/Scalar.h:1.56 llvm/include/llvm/Transforms/Scalar.h:1.56.4.1 --- llvm/include/llvm/Transforms/Scalar.h:1.56 Thu Apr 21 15:57:32 2005 +++ llvm/include/llvm/Transforms/Scalar.h Tue Oct 18 14:21:56 2005 @@ -258,9 +258,9 @@ FunctionPass *createLowerSelectPass(bool OnlyFP = false); //===----------------------------------------------------------------------===// -// This pass converts PackedType operations into low-level scalar operations. +// This pass converts FixedVectorType operations into low-level scalar operations. // -FunctionPass *createLowerPackedPass(); +FunctionPass *createLowerFixedVectorPass(); //===----------------------------------------------------------------------===// // This pass converts invoke and unwind instructions to use sjlj exception From bocchino at cs.uiuc.edu Tue Oct 18 14:22:23 2005 From: bocchino at cs.uiuc.edu (Robert Bocchino) Date: Tue, 18 Oct 2005 14:22:23 -0500 Subject: [llvm-commits] [vector_llvm] CVS: llvm/include/llvm/Support/InstVisitor.h Message-ID: <200510181922.OAA13451@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm/Support: InstVisitor.h updated: 1.36 -> 1.36.2.1 --- Log message: Initial commit of Vector LLVM. --- Diffs of the changes: (+8 -0) InstVisitor.h | 8 ++++++++ 1 files changed, 8 insertions(+) Index: llvm/include/llvm/Support/InstVisitor.h diff -u llvm/include/llvm/Support/InstVisitor.h:1.36 llvm/include/llvm/Support/InstVisitor.h:1.36.2.1 --- llvm/include/llvm/Support/InstVisitor.h:1.36 Sat Jun 18 13:31:30 2005 +++ llvm/include/llvm/Support/InstVisitor.h Tue Oct 18 14:21:56 2005 @@ -172,9 +172,17 @@ RetTy visitPHINode(PHINode &I) { DELEGATE(Instruction); } RetTy visitCastInst(CastInst &I) { DELEGATE(Instruction); } RetTy visitSelectInst(SelectInst &I) { DELEGATE(Instruction); } + RetTy visitVSelectInst(VSelectInst &I) { DELEGATE(Instruction); } RetTy visitCallInst(CallInst &I) { DELEGATE(Instruction); } RetTy visitShiftInst(ShiftInst &I) { DELEGATE(Instruction); } RetTy visitVAArgInst(VAArgInst &I) { DELEGATE(Instruction); } + RetTy visitVGatherInst(VGatherInst &I) { DELEGATE(Instruction); } + RetTy visitVScatterInst(VScatterInst &I) { DELEGATE(Instruction); } + RetTy visitVImmInst(VImmInst &I) { DELEGATE(Instruction); } + RetTy visitExtractInst(ExtractInst &I) { DELEGATE(Instruction); } + RetTy visitExtractElementInst(ExtractElementInst &I){ DELEGATE(Instruction); } + RetTy visitCombineInst(CombineInst &I) { DELEGATE(Instruction); } + RetTy visitCombineElementInst(CombineElementInst &I){ DELEGATE(Instruction); } // Next level propagators... if the user does not overload a specific // instruction type, they can overload one of these to get the whole class From bocchino at cs.uiuc.edu Tue Oct 18 14:22:22 2005 From: bocchino at cs.uiuc.edu (Robert Bocchino) Date: Tue, 18 Oct 2005 14:22:22 -0500 Subject: [llvm-commits] [vector_llvm] CVS: llvm/tools/opt/Makefile Message-ID: <200510181922.OAA13399@zion.cs.uiuc.edu> Changes in directory llvm/tools/opt: Makefile updated: 1.49 -> 1.49.4.1 --- Log message: Initial commit of Vector LLVM. --- Diffs of the changes: (+1 -1) Makefile | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm/tools/opt/Makefile diff -u llvm/tools/opt/Makefile:1.49 llvm/tools/opt/Makefile:1.49.4.1 --- llvm/tools/opt/Makefile:1.49 Fri Apr 22 12:14:14 2005 +++ llvm/tools/opt/Makefile Tue Oct 18 14:21:59 2005 @@ -10,7 +10,7 @@ TOOLNAME = opt USEDLIBS = LLVMBCReader LLVMBCWriter LLVMInstrumentation LLVMProfilePaths \ - LLVMScalarOpts LLVMipo LLVMipa LLVMDataStructure LLVMTransforms \ + LLVMScalarOpts LLVMVectorOpts LLVMipo LLVMipa LLVMDataStructure LLVMTransforms \ LLVMTarget.a LLVMAnalysis LLVMTransformUtils LLVMCore LLVMSupport.a \ LLVMbzip2 LLVMSystem.a From bocchino at cs.uiuc.edu Tue Oct 18 14:22:23 2005 From: bocchino at cs.uiuc.edu (Robert Bocchino) Date: Tue, 18 Oct 2005 14:22:23 -0500 Subject: [llvm-commits] [vector_llvm] CVS: llvm/lib/Target/Makefile TargetData.cpp Message-ID: <200510181922.OAA13419@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target: Makefile updated: 1.24 -> 1.24.4.1 TargetData.cpp updated: 1.57 -> 1.57.2.1 --- Log message: Initial commit of Vector LLVM. --- Diffs of the changes: (+3 -2) Makefile | 1 + TargetData.cpp | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) Index: llvm/lib/Target/Makefile diff -u llvm/lib/Target/Makefile:1.24 llvm/lib/Target/Makefile:1.24.4.1 --- llvm/lib/Target/Makefile:1.24 Fri Apr 22 12:20:11 2005 +++ llvm/lib/Target/Makefile Tue Oct 18 14:21:57 2005 @@ -7,6 +7,7 @@ # ##===----------------------------------------------------------------------===## LEVEL = ../.. + LIBRARYNAME = LLVMTarget BUILD_ARCHIVE = 1 Index: llvm/lib/Target/TargetData.cpp diff -u llvm/lib/Target/TargetData.cpp:1.57 llvm/lib/Target/TargetData.cpp:1.57.2.1 --- llvm/lib/Target/TargetData.cpp:1.57 Tue Aug 2 14:25:02 2005 +++ llvm/lib/Target/TargetData.cpp Tue Oct 18 14:21:57 2005 @@ -192,8 +192,8 @@ Size = AlignedSize*ATy->getNumElements(); return; } - case Type::PackedTyID: { - const PackedType *PTy = cast(Ty); + case Type::FixedVectorTyID: { + const FixedVectorType *PTy = cast(Ty); getTypeInfo(PTy->getElementType(), TD, Size, Alignment); unsigned AlignedSize = (Size + Alignment - 1)/Alignment*Alignment; Size = AlignedSize*PTy->getNumElements(); From bocchino at cs.uiuc.edu Tue Oct 18 14:22:22 2005 From: bocchino at cs.uiuc.edu (Robert Bocchino) Date: Tue, 18 Oct 2005 14:22:22 -0500 Subject: [llvm-commits] [vector_llvm] CVS: llvm/lib/Analysis/LoadValueNumbering.cpp ScalarEvolution.cpp Message-ID: <200510181922.OAA13405@zion.cs.uiuc.edu> Changes in directory llvm/lib/Analysis: LoadValueNumbering.cpp updated: 1.33 -> 1.33.2.1 ScalarEvolution.cpp updated: 1.43 -> 1.43.2.1 --- Log message: Initial commit of Vector LLVM. --- Diffs of the changes: (+5 -1) LoadValueNumbering.cpp | 4 ++++ ScalarEvolution.cpp | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) Index: llvm/lib/Analysis/LoadValueNumbering.cpp diff -u llvm/lib/Analysis/LoadValueNumbering.cpp:1.33 llvm/lib/Analysis/LoadValueNumbering.cpp:1.33.2.1 --- llvm/lib/Analysis/LoadValueNumbering.cpp:1.33 Mon Jun 20 10:25:22 2005 +++ llvm/lib/Analysis/LoadValueNumbering.cpp Tue Oct 18 14:21:56 2005 @@ -32,6 +32,7 @@ #include "llvm/Analysis/Dominators.h" #include "llvm/Support/CFG.h" #include "llvm/Target/TargetData.h" +#include "llvm/DerivedTypes.h" #include #include using namespace llvm; @@ -283,6 +284,9 @@ LoadInst *LI = cast(V); if (LI->isVolatile()) return getAnalysis().getEqualNumberNodes(V, RetVals); + // FIXME: This is a temporary fix to make vectors work + if (isa(LI->getType()) && !isa(LI->getType())) + return; Value *LoadPtr = LI->getOperand(0); BasicBlock *LoadBB = LI->getParent(); Index: llvm/lib/Analysis/ScalarEvolution.cpp diff -u llvm/lib/Analysis/ScalarEvolution.cpp:1.43 llvm/lib/Analysis/ScalarEvolution.cpp:1.43.2.1 --- llvm/lib/Analysis/ScalarEvolution.cpp:1.43 Wed Sep 28 17:30:58 2005 +++ llvm/lib/Analysis/ScalarEvolution.cpp Tue Oct 18 14:21:56 2005 @@ -2509,7 +2509,7 @@ OS << "Classifying expressions for: " << F.getName() << "\n"; for (inst_iterator I = inst_begin(F), E = inst_end(F); I != E; ++I) - if (I->getType()->isInteger()) { + if (I->getType()->isInteger() && !isa(I->getType())) { OS << *I; OS << " --> "; SCEVHandle SV = getSCEV(&*I); From bocchino at cs.uiuc.edu Tue Oct 18 14:22:23 2005 From: bocchino at cs.uiuc.edu (Robert Bocchino) Date: Tue, 18 Oct 2005 14:22:23 -0500 Subject: [llvm-commits] [vector_llvm] CVS: llvm/utils/TableGen/FileLexer.cpp FileParser.cpp Message-ID: <200510181922.OAA13477@zion.cs.uiuc.edu> Changes in directory llvm/utils/TableGen: FileLexer.cpp updated: 1.3 -> 1.3.2.1 FileParser.cpp updated: 1.9 -> 1.9.2.1 --- Log message: Initial commit of Vector LLVM. --- Diffs of the changes: (+126 -122) FileLexer.cpp | 86 +++++++++++++++--------------- FileParser.cpp | 162 ++++++++++++++++++++++++++++----------------------------- 2 files changed, 126 insertions(+), 122 deletions(-) Index: llvm/utils/TableGen/FileLexer.cpp diff -u llvm/utils/TableGen/FileLexer.cpp:1.3 llvm/utils/TableGen/FileLexer.cpp:1.3.2.1 --- llvm/utils/TableGen/FileLexer.cpp:1.3 Mon Sep 12 00:30:06 2005 +++ llvm/utils/TableGen/FileLexer.cpp Tue Oct 18 14:21:59 2005 @@ -21,7 +21,7 @@ /* A lexical scanner generated by flex */ /* Scanner skeleton version: - * $Header: /home/vadve/shared/PublicCVS/llvm/utils/TableGen/FileLexer.cpp,v 1.3 2005/09/12 05:30:06 lattner Exp $ + * $Header: /home/vadve/shared/PublicCVS/llvm/utils/TableGen/FileLexer.cpp,v 1.3.2.1 2005/10/18 19:21:59 bocchino Exp $ */ #define FLEX_SCANNER @@ -29,7 +29,6 @@ #define YY_FLEX_MINOR_VERSION 5 #include -#include /* cfront 1.2 defines "c_plusplus" instead of "__cplusplus" */ @@ -43,6 +42,7 @@ #ifdef __cplusplus #include +#include /* Use prototypes in function declarations. */ #define YY_USE_PROTOS @@ -489,7 +489,7 @@ #define YY_MORE_ADJ 0 #define YY_RESTORE_YY_MORE_OFFSET char *yytext; -#line 1 "/home/vadve/lattner/llvm/utils/TableGen/FileLexer.l" +#line 1 "/Users/bocchino/llvm/obj/../src/utils/TableGen/FileLexer.l" #define INITIAL 0 /*===-- FileLexer.l - Scanner for TableGen Files ----------------*- C++ -*-===// // @@ -507,7 +507,7 @@ #define YY_NEVER_INTERACTIVE 1 #define comment 1 -#line 30 "/home/vadve/lattner/llvm/utils/TableGen/FileLexer.l" +#line 30 "/Users/bocchino/llvm/obj/../src/utils/TableGen/FileLexer.l" #include "Record.h" typedef std::pair*> SubClassRefTy; #include "FileParser.h" @@ -792,10 +792,10 @@ YY_DECL { register yy_state_type yy_current_state; - register char *yy_cp = NULL, *yy_bp = NULL; + register char *yy_cp, *yy_bp; register int yy_act; -#line 176 "/home/vadve/lattner/llvm/utils/TableGen/FileLexer.l" +#line 176 "/Users/bocchino/llvm/obj/../src/utils/TableGen/FileLexer.l" #line 802 "Lexer.cpp" @@ -891,165 +891,165 @@ { /* beginning of action switch */ case 1: YY_RULE_SETUP -#line 178 "/home/vadve/lattner/llvm/utils/TableGen/FileLexer.l" +#line 178 "/Users/bocchino/llvm/obj/../src/utils/TableGen/FileLexer.l" { /* Ignore comments */ } YY_BREAK case 2: YY_RULE_SETUP -#line 180 "/home/vadve/lattner/llvm/utils/TableGen/FileLexer.l" +#line 180 "/Users/bocchino/llvm/obj/../src/utils/TableGen/FileLexer.l" { HandleInclude(yytext); } YY_BREAK case 3: YY_RULE_SETUP -#line 181 "/home/vadve/lattner/llvm/utils/TableGen/FileLexer.l" +#line 181 "/Users/bocchino/llvm/obj/../src/utils/TableGen/FileLexer.l" { Filelval.StrVal = new std::string(yytext+2, yytext+yyleng-2); return CODEFRAGMENT; } YY_BREAK case 4: YY_RULE_SETUP -#line 184 "/home/vadve/lattner/llvm/utils/TableGen/FileLexer.l" +#line 184 "/Users/bocchino/llvm/obj/../src/utils/TableGen/FileLexer.l" { return INT; } YY_BREAK case 5: YY_RULE_SETUP -#line 185 "/home/vadve/lattner/llvm/utils/TableGen/FileLexer.l" +#line 185 "/Users/bocchino/llvm/obj/../src/utils/TableGen/FileLexer.l" { return BIT; } YY_BREAK case 6: YY_RULE_SETUP -#line 186 "/home/vadve/lattner/llvm/utils/TableGen/FileLexer.l" +#line 186 "/Users/bocchino/llvm/obj/../src/utils/TableGen/FileLexer.l" { return BITS; } YY_BREAK case 7: YY_RULE_SETUP -#line 187 "/home/vadve/lattner/llvm/utils/TableGen/FileLexer.l" +#line 187 "/Users/bocchino/llvm/obj/../src/utils/TableGen/FileLexer.l" { return STRING; } YY_BREAK case 8: YY_RULE_SETUP -#line 188 "/home/vadve/lattner/llvm/utils/TableGen/FileLexer.l" +#line 188 "/Users/bocchino/llvm/obj/../src/utils/TableGen/FileLexer.l" { return LIST; } YY_BREAK case 9: YY_RULE_SETUP -#line 189 "/home/vadve/lattner/llvm/utils/TableGen/FileLexer.l" +#line 189 "/Users/bocchino/llvm/obj/../src/utils/TableGen/FileLexer.l" { return CODE; } YY_BREAK case 10: YY_RULE_SETUP -#line 190 "/home/vadve/lattner/llvm/utils/TableGen/FileLexer.l" +#line 190 "/Users/bocchino/llvm/obj/../src/utils/TableGen/FileLexer.l" { return DAG; } YY_BREAK case 11: YY_RULE_SETUP -#line 192 "/home/vadve/lattner/llvm/utils/TableGen/FileLexer.l" +#line 192 "/Users/bocchino/llvm/obj/../src/utils/TableGen/FileLexer.l" { return CLASS; } YY_BREAK case 12: YY_RULE_SETUP -#line 193 "/home/vadve/lattner/llvm/utils/TableGen/FileLexer.l" +#line 193 "/Users/bocchino/llvm/obj/../src/utils/TableGen/FileLexer.l" { return DEF; } YY_BREAK case 13: YY_RULE_SETUP -#line 194 "/home/vadve/lattner/llvm/utils/TableGen/FileLexer.l" +#line 194 "/Users/bocchino/llvm/obj/../src/utils/TableGen/FileLexer.l" { return FIELD; } YY_BREAK case 14: YY_RULE_SETUP -#line 195 "/home/vadve/lattner/llvm/utils/TableGen/FileLexer.l" +#line 195 "/Users/bocchino/llvm/obj/../src/utils/TableGen/FileLexer.l" { return LET; } YY_BREAK case 15: YY_RULE_SETUP -#line 196 "/home/vadve/lattner/llvm/utils/TableGen/FileLexer.l" +#line 196 "/Users/bocchino/llvm/obj/../src/utils/TableGen/FileLexer.l" { return IN; } YY_BREAK case 16: YY_RULE_SETUP -#line 198 "/home/vadve/lattner/llvm/utils/TableGen/FileLexer.l" +#line 198 "/Users/bocchino/llvm/obj/../src/utils/TableGen/FileLexer.l" { return SRATOK; } YY_BREAK case 17: YY_RULE_SETUP -#line 199 "/home/vadve/lattner/llvm/utils/TableGen/FileLexer.l" +#line 199 "/Users/bocchino/llvm/obj/../src/utils/TableGen/FileLexer.l" { return SRLTOK; } YY_BREAK case 18: YY_RULE_SETUP -#line 200 "/home/vadve/lattner/llvm/utils/TableGen/FileLexer.l" +#line 200 "/Users/bocchino/llvm/obj/../src/utils/TableGen/FileLexer.l" { return SHLTOK; } YY_BREAK case 19: YY_RULE_SETUP -#line 203 "/home/vadve/lattner/llvm/utils/TableGen/FileLexer.l" +#line 203 "/Users/bocchino/llvm/obj/../src/utils/TableGen/FileLexer.l" { Filelval.StrVal = new std::string(yytext, yytext+yyleng); return ID; } YY_BREAK case 20: YY_RULE_SETUP -#line 205 "/home/vadve/lattner/llvm/utils/TableGen/FileLexer.l" +#line 205 "/Users/bocchino/llvm/obj/../src/utils/TableGen/FileLexer.l" { Filelval.StrVal = new std::string(yytext+1, yytext+yyleng); return VARNAME; } YY_BREAK case 21: YY_RULE_SETUP -#line 208 "/home/vadve/lattner/llvm/utils/TableGen/FileLexer.l" +#line 208 "/Users/bocchino/llvm/obj/../src/utils/TableGen/FileLexer.l" { Filelval.StrVal = new std::string(yytext+1, yytext+yyleng-1); return STRVAL; } YY_BREAK case 22: YY_RULE_SETUP -#line 211 "/home/vadve/lattner/llvm/utils/TableGen/FileLexer.l" +#line 211 "/Users/bocchino/llvm/obj/../src/utils/TableGen/FileLexer.l" { Filelval.IntVal = ParseInt(Filetext); return INTVAL; } YY_BREAK case 23: YY_RULE_SETUP -#line 213 "/home/vadve/lattner/llvm/utils/TableGen/FileLexer.l" +#line 213 "/Users/bocchino/llvm/obj/../src/utils/TableGen/FileLexer.l" { /* Ignore whitespace */ } YY_BREAK case 24: YY_RULE_SETUP -#line 216 "/home/vadve/lattner/llvm/utils/TableGen/FileLexer.l" +#line 216 "/Users/bocchino/llvm/obj/../src/utils/TableGen/FileLexer.l" { BEGIN(comment); CommentDepth++; } YY_BREAK case 25: YY_RULE_SETUP -#line 217 "/home/vadve/lattner/llvm/utils/TableGen/FileLexer.l" +#line 217 "/Users/bocchino/llvm/obj/../src/utils/TableGen/FileLexer.l" {} /* eat anything that's not a '*' or '/' */ YY_BREAK case 26: YY_RULE_SETUP -#line 218 "/home/vadve/lattner/llvm/utils/TableGen/FileLexer.l" +#line 218 "/Users/bocchino/llvm/obj/../src/utils/TableGen/FileLexer.l" {} /* eat up '*'s not followed by '/'s */ YY_BREAK case 27: YY_RULE_SETUP -#line 219 "/home/vadve/lattner/llvm/utils/TableGen/FileLexer.l" +#line 219 "/Users/bocchino/llvm/obj/../src/utils/TableGen/FileLexer.l" { ++CommentDepth; } YY_BREAK case 28: YY_RULE_SETUP -#line 220 "/home/vadve/lattner/llvm/utils/TableGen/FileLexer.l" +#line 220 "/Users/bocchino/llvm/obj/../src/utils/TableGen/FileLexer.l" {} /* eat up /'s not followed by *'s */ YY_BREAK case 29: YY_RULE_SETUP -#line 221 "/home/vadve/lattner/llvm/utils/TableGen/FileLexer.l" +#line 221 "/Users/bocchino/llvm/obj/../src/utils/TableGen/FileLexer.l" { if (!--CommentDepth) { BEGIN(INITIAL); } } YY_BREAK case YY_STATE_EOF(comment): -#line 222 "/home/vadve/lattner/llvm/utils/TableGen/FileLexer.l" +#line 222 "/Users/bocchino/llvm/obj/../src/utils/TableGen/FileLexer.l" { err() << "Unterminated comment!\n"; exit(1); } YY_BREAK case 30: YY_RULE_SETUP -#line 224 "/home/vadve/lattner/llvm/utils/TableGen/FileLexer.l" +#line 224 "/Users/bocchino/llvm/obj/../src/utils/TableGen/FileLexer.l" { return Filetext[0]; } YY_BREAK case 31: YY_RULE_SETUP -#line 226 "/home/vadve/lattner/llvm/utils/TableGen/FileLexer.l" +#line 226 "/Users/bocchino/llvm/obj/../src/utils/TableGen/FileLexer.l" YY_FATAL_ERROR( "flex scanner jammed" ); YY_BREAK #line 1056 "Lexer.cpp" @@ -1430,7 +1430,6 @@ #endif /* ifndef YY_NO_UNPUT */ -#ifndef YY_NO_INPUT #ifdef __cplusplus static int yyinput() #else @@ -1504,7 +1503,7 @@ return c; } -#endif /* YY_NO_INPUT */ + #ifdef YY_USE_PROTOS void yyrestart( FILE *input_file ) @@ -1615,6 +1614,11 @@ } +#ifndef YY_ALWAYS_INTERACTIVE +#ifndef YY_NEVER_INTERACTIVE +extern int isatty YY_PROTO(( int )); +#endif +#endif #ifdef YY_USE_PROTOS void yy_init_buffer( YY_BUFFER_STATE b, FILE *file ) @@ -1932,5 +1936,5 @@ return 0; } #endif -#line 226 "/home/vadve/lattner/llvm/utils/TableGen/FileLexer.l" +#line 226 "/Users/bocchino/llvm/obj/../src/utils/TableGen/FileLexer.l" Index: llvm/utils/TableGen/FileParser.cpp diff -u llvm/utils/TableGen/FileParser.cpp:1.9 llvm/utils/TableGen/FileParser.cpp:1.9.2.1 --- llvm/utils/TableGen/FileParser.cpp:1.9 Fri Sep 30 01:09:50 2005 +++ llvm/utils/TableGen/FileParser.cpp Tue Oct 18 14:21:59 2005 @@ -1,5 +1,5 @@ -/* A Bison parser, made from /Users/sabre/llvm/utils/TableGen/FileParser.y +/* A Bison parser, made from /Users/bocchino/llvm/obj/../src/utils/TableGen/FileParser.y by GNU Bison version 1.28 */ #define YYBISON 1 /* Identify Bison output. */ @@ -32,7 +32,7 @@ #define STRVAL 275 #define CODEFRAGMENT 276 -#line 14 "/Users/sabre/llvm/utils/TableGen/FileParser.y" +#line 14 "/Users/bocchino/llvm/obj/../src/utils/TableGen/FileParser.y" #include "Record.h" #include "llvm/ADT/StringExtras.h" @@ -207,7 +207,7 @@ using namespace llvm; -#line 189 "/Users/sabre/llvm/utils/TableGen/FileParser.y" +#line 189 "/Users/bocchino/llvm/obj/../src/utils/TableGen/FileParser.y" typedef union { std::string* StrVal; int IntVal; @@ -1005,7 +1005,7 @@ switch (yyn) { case 1: -#line 223 "/Users/sabre/llvm/utils/TableGen/FileParser.y" +#line 223 "/Users/bocchino/llvm/obj/../src/utils/TableGen/FileParser.y" { yyval.Rec = Records.getClass(*yyvsp[0].StrVal); if (yyval.Rec == 0) { @@ -1016,97 +1016,97 @@ ; break;} case 2: -#line 234 "/Users/sabre/llvm/utils/TableGen/FileParser.y" +#line 234 "/Users/bocchino/llvm/obj/../src/utils/TableGen/FileParser.y" { // string type yyval.Ty = new StringRecTy(); ; break;} case 3: -#line 236 "/Users/sabre/llvm/utils/TableGen/FileParser.y" +#line 236 "/Users/bocchino/llvm/obj/../src/utils/TableGen/FileParser.y" { // bit type yyval.Ty = new BitRecTy(); ; break;} case 4: -#line 238 "/Users/sabre/llvm/utils/TableGen/FileParser.y" +#line 238 "/Users/bocchino/llvm/obj/../src/utils/TableGen/FileParser.y" { // bits type yyval.Ty = new BitsRecTy(yyvsp[-1].IntVal); ; break;} case 5: -#line 240 "/Users/sabre/llvm/utils/TableGen/FileParser.y" +#line 240 "/Users/bocchino/llvm/obj/../src/utils/TableGen/FileParser.y" { // int type yyval.Ty = new IntRecTy(); ; break;} case 6: -#line 242 "/Users/sabre/llvm/utils/TableGen/FileParser.y" +#line 242 "/Users/bocchino/llvm/obj/../src/utils/TableGen/FileParser.y" { // list type yyval.Ty = new ListRecTy(yyvsp[-1].Ty); ; break;} case 7: -#line 244 "/Users/sabre/llvm/utils/TableGen/FileParser.y" +#line 244 "/Users/bocchino/llvm/obj/../src/utils/TableGen/FileParser.y" { // code type yyval.Ty = new CodeRecTy(); ; break;} case 8: -#line 246 "/Users/sabre/llvm/utils/TableGen/FileParser.y" +#line 246 "/Users/bocchino/llvm/obj/../src/utils/TableGen/FileParser.y" { // dag type yyval.Ty = new DagRecTy(); ; break;} case 9: -#line 248 "/Users/sabre/llvm/utils/TableGen/FileParser.y" +#line 248 "/Users/bocchino/llvm/obj/../src/utils/TableGen/FileParser.y" { // Record Type yyval.Ty = new RecordRecTy(yyvsp[0].Rec); ; break;} case 10: -#line 252 "/Users/sabre/llvm/utils/TableGen/FileParser.y" +#line 252 "/Users/bocchino/llvm/obj/../src/utils/TableGen/FileParser.y" { yyval.IntVal = 0; ; break;} case 11: -#line 252 "/Users/sabre/llvm/utils/TableGen/FileParser.y" +#line 252 "/Users/bocchino/llvm/obj/../src/utils/TableGen/FileParser.y" { yyval.IntVal = 1; ; break;} case 12: -#line 254 "/Users/sabre/llvm/utils/TableGen/FileParser.y" +#line 254 "/Users/bocchino/llvm/obj/../src/utils/TableGen/FileParser.y" { yyval.Initializer = 0; ; break;} case 13: -#line 254 "/Users/sabre/llvm/utils/TableGen/FileParser.y" +#line 254 "/Users/bocchino/llvm/obj/../src/utils/TableGen/FileParser.y" { yyval.Initializer = yyvsp[0].Initializer; ; break;} case 14: -#line 256 "/Users/sabre/llvm/utils/TableGen/FileParser.y" +#line 256 "/Users/bocchino/llvm/obj/../src/utils/TableGen/FileParser.y" { yyval.Initializer = new IntInit(yyvsp[0].IntVal); ; break;} case 15: -#line 258 "/Users/sabre/llvm/utils/TableGen/FileParser.y" +#line 258 "/Users/bocchino/llvm/obj/../src/utils/TableGen/FileParser.y" { yyval.Initializer = new StringInit(*yyvsp[0].StrVal); delete yyvsp[0].StrVal; ; break;} case 16: -#line 261 "/Users/sabre/llvm/utils/TableGen/FileParser.y" +#line 261 "/Users/bocchino/llvm/obj/../src/utils/TableGen/FileParser.y" { yyval.Initializer = new CodeInit(*yyvsp[0].StrVal); delete yyvsp[0].StrVal; ; break;} case 17: -#line 264 "/Users/sabre/llvm/utils/TableGen/FileParser.y" +#line 264 "/Users/bocchino/llvm/obj/../src/utils/TableGen/FileParser.y" { yyval.Initializer = new UnsetInit(); ; break;} case 18: -#line 266 "/Users/sabre/llvm/utils/TableGen/FileParser.y" +#line 266 "/Users/bocchino/llvm/obj/../src/utils/TableGen/FileParser.y" { BitsInit *Init = new BitsInit(yyvsp[-1].FieldList->size()); for (unsigned i = 0, e = yyvsp[-1].FieldList->size(); i != e; ++i) { @@ -1123,7 +1123,7 @@ ; break;} case 19: -#line 279 "/Users/sabre/llvm/utils/TableGen/FileParser.y" +#line 279 "/Users/bocchino/llvm/obj/../src/utils/TableGen/FileParser.y" { // This is a CLASS expression. This is supposed to synthesize // a new anonymous definition, deriving from CLASS with no @@ -1155,7 +1155,7 @@ ; break;} case 20: -#line 307 "/Users/sabre/llvm/utils/TableGen/FileParser.y" +#line 307 "/Users/bocchino/llvm/obj/../src/utils/TableGen/FileParser.y" { if (const RecordVal *RV = (CurRec ? CurRec->getValue(*yyvsp[0].StrVal) : 0)) { yyval.Initializer = new VarInit(*yyvsp[0].StrVal, RV->getType()); @@ -1174,7 +1174,7 @@ ; break;} case 21: -#line 322 "/Users/sabre/llvm/utils/TableGen/FileParser.y" +#line 322 "/Users/bocchino/llvm/obj/../src/utils/TableGen/FileParser.y" { yyval.Initializer = yyvsp[-3].Initializer->convertInitializerBitRange(*yyvsp[-1].BitList); if (yyval.Initializer == 0) { @@ -1185,14 +1185,14 @@ ; break;} case 22: -#line 329 "/Users/sabre/llvm/utils/TableGen/FileParser.y" +#line 329 "/Users/bocchino/llvm/obj/../src/utils/TableGen/FileParser.y" { yyval.Initializer = new ListInit(*yyvsp[-1].FieldList); delete yyvsp[-1].FieldList; ; break;} case 23: -#line 332 "/Users/sabre/llvm/utils/TableGen/FileParser.y" +#line 332 "/Users/bocchino/llvm/obj/../src/utils/TableGen/FileParser.y" { if (!yyvsp[-2].Initializer->getFieldType(*yyvsp[0].StrVal)) { err() << "Cannot access field '" << *yyvsp[0].StrVal << "' of value '" << *yyvsp[-2].Initializer << "!\n"; @@ -1203,7 +1203,7 @@ ; break;} case 24: -#line 339 "/Users/sabre/llvm/utils/TableGen/FileParser.y" +#line 339 "/Users/bocchino/llvm/obj/../src/utils/TableGen/FileParser.y" { Record *D = Records.getDef(*yyvsp[-2].StrVal); if (D == 0) { @@ -1215,7 +1215,7 @@ ; break;} case 25: -#line 347 "/Users/sabre/llvm/utils/TableGen/FileParser.y" +#line 347 "/Users/bocchino/llvm/obj/../src/utils/TableGen/FileParser.y" { std::reverse(yyvsp[-1].BitList->begin(), yyvsp[-1].BitList->end()); yyval.Initializer = yyvsp[-3].Initializer->convertInitListSlice(*yyvsp[-1].BitList); @@ -1227,7 +1227,7 @@ ; break;} case 26: -#line 355 "/Users/sabre/llvm/utils/TableGen/FileParser.y" +#line 355 "/Users/bocchino/llvm/obj/../src/utils/TableGen/FileParser.y" { yyval.Initializer = yyvsp[-3].Initializer->getBinaryOp(Init::SHL, yyvsp[-1].Initializer); if (yyval.Initializer == 0) { @@ -1237,7 +1237,7 @@ ; break;} case 27: -#line 361 "/Users/sabre/llvm/utils/TableGen/FileParser.y" +#line 361 "/Users/bocchino/llvm/obj/../src/utils/TableGen/FileParser.y" { yyval.Initializer = yyvsp[-3].Initializer->getBinaryOp(Init::SRA, yyvsp[-1].Initializer); if (yyval.Initializer == 0) { @@ -1247,7 +1247,7 @@ ; break;} case 28: -#line 367 "/Users/sabre/llvm/utils/TableGen/FileParser.y" +#line 367 "/Users/bocchino/llvm/obj/../src/utils/TableGen/FileParser.y" { yyval.Initializer = yyvsp[-3].Initializer->getBinaryOp(Init::SRL, yyvsp[-1].Initializer); if (yyval.Initializer == 0) { @@ -1257,19 +1257,19 @@ ; break;} case 29: -#line 375 "/Users/sabre/llvm/utils/TableGen/FileParser.y" +#line 375 "/Users/bocchino/llvm/obj/../src/utils/TableGen/FileParser.y" { yyval.StrVal = new std::string(); ; break;} case 30: -#line 378 "/Users/sabre/llvm/utils/TableGen/FileParser.y" +#line 378 "/Users/bocchino/llvm/obj/../src/utils/TableGen/FileParser.y" { yyval.StrVal = yyvsp[0].StrVal; ; break;} case 31: -#line 382 "/Users/sabre/llvm/utils/TableGen/FileParser.y" +#line 382 "/Users/bocchino/llvm/obj/../src/utils/TableGen/FileParser.y" { yyval.DagValueList = new std::vector >(); yyval.DagValueList->push_back(std::make_pair(yyvsp[-1].Initializer, *yyvsp[0].StrVal)); @@ -1277,7 +1277,7 @@ ; break;} case 32: -#line 387 "/Users/sabre/llvm/utils/TableGen/FileParser.y" +#line 387 "/Users/bocchino/llvm/obj/../src/utils/TableGen/FileParser.y" { yyvsp[-3].DagValueList->push_back(std::make_pair(yyvsp[-1].Initializer, *yyvsp[0].StrVal)); delete yyvsp[0].StrVal; @@ -1285,24 +1285,24 @@ ; break;} case 33: -#line 393 "/Users/sabre/llvm/utils/TableGen/FileParser.y" +#line 393 "/Users/bocchino/llvm/obj/../src/utils/TableGen/FileParser.y" { yyval.DagValueList = new std::vector >(); ; break;} case 34: -#line 396 "/Users/sabre/llvm/utils/TableGen/FileParser.y" +#line 396 "/Users/bocchino/llvm/obj/../src/utils/TableGen/FileParser.y" { yyval.DagValueList = yyvsp[0].DagValueList; ; break;} case 35: -#line 399 "/Users/sabre/llvm/utils/TableGen/FileParser.y" +#line 399 "/Users/bocchino/llvm/obj/../src/utils/TableGen/FileParser.y" { yyval.BitList = new std::vector(); yyval.BitList->push_back(yyvsp[0].IntVal); ; break;} case 36: -#line 402 "/Users/sabre/llvm/utils/TableGen/FileParser.y" +#line 402 "/Users/bocchino/llvm/obj/../src/utils/TableGen/FileParser.y" { if (yyvsp[-2].IntVal < 0 || yyvsp[0].IntVal < 0) { err() << "Invalid range: " << yyvsp[-2].IntVal << "-" << yyvsp[0].IntVal << "!\n"; @@ -1319,7 +1319,7 @@ ; break;} case 37: -#line 415 "/Users/sabre/llvm/utils/TableGen/FileParser.y" +#line 415 "/Users/bocchino/llvm/obj/../src/utils/TableGen/FileParser.y" { yyvsp[0].IntVal = -yyvsp[0].IntVal; if (yyvsp[-1].IntVal < 0 || yyvsp[0].IntVal < 0) { @@ -1337,13 +1337,13 @@ ; break;} case 38: -#line 429 "/Users/sabre/llvm/utils/TableGen/FileParser.y" +#line 429 "/Users/bocchino/llvm/obj/../src/utils/TableGen/FileParser.y" { (yyval.BitList=yyvsp[-2].BitList)->push_back(yyvsp[0].IntVal); ; break;} case 39: -#line 431 "/Users/sabre/llvm/utils/TableGen/FileParser.y" +#line 431 "/Users/bocchino/llvm/obj/../src/utils/TableGen/FileParser.y" { if (yyvsp[-2].IntVal < 0 || yyvsp[0].IntVal < 0) { err() << "Invalid range: " << yyvsp[-2].IntVal << "-" << yyvsp[0].IntVal << "!\n"; @@ -1360,7 +1360,7 @@ ; break;} case 40: -#line 444 "/Users/sabre/llvm/utils/TableGen/FileParser.y" +#line 444 "/Users/bocchino/llvm/obj/../src/utils/TableGen/FileParser.y" { yyvsp[0].IntVal = -yyvsp[0].IntVal; if (yyvsp[-1].IntVal < 0 || yyvsp[0].IntVal < 0) { @@ -1378,44 +1378,44 @@ ; break;} case 41: -#line 460 "/Users/sabre/llvm/utils/TableGen/FileParser.y" +#line 460 "/Users/bocchino/llvm/obj/../src/utils/TableGen/FileParser.y" { yyval.BitList = yyvsp[0].BitList; std::reverse(yyvsp[0].BitList->begin(), yyvsp[0].BitList->end()); ; break;} case 42: -#line 462 "/Users/sabre/llvm/utils/TableGen/FileParser.y" +#line 462 "/Users/bocchino/llvm/obj/../src/utils/TableGen/FileParser.y" { yyval.BitList = 0; ; break;} case 43: -#line 462 "/Users/sabre/llvm/utils/TableGen/FileParser.y" +#line 462 "/Users/bocchino/llvm/obj/../src/utils/TableGen/FileParser.y" { yyval.BitList = yyvsp[-1].BitList; ; break;} case 44: -#line 466 "/Users/sabre/llvm/utils/TableGen/FileParser.y" +#line 466 "/Users/bocchino/llvm/obj/../src/utils/TableGen/FileParser.y" { yyval.FieldList = new std::vector(); ; break;} case 45: -#line 468 "/Users/sabre/llvm/utils/TableGen/FileParser.y" +#line 468 "/Users/bocchino/llvm/obj/../src/utils/TableGen/FileParser.y" { yyval.FieldList = yyvsp[0].FieldList; ; break;} case 46: -#line 472 "/Users/sabre/llvm/utils/TableGen/FileParser.y" +#line 472 "/Users/bocchino/llvm/obj/../src/utils/TableGen/FileParser.y" { yyval.FieldList = new std::vector(); yyval.FieldList->push_back(yyvsp[0].Initializer); ; break;} case 47: -#line 475 "/Users/sabre/llvm/utils/TableGen/FileParser.y" +#line 475 "/Users/bocchino/llvm/obj/../src/utils/TableGen/FileParser.y" { (yyval.FieldList = yyvsp[-2].FieldList)->push_back(yyvsp[0].Initializer); ; break;} case 48: -#line 479 "/Users/sabre/llvm/utils/TableGen/FileParser.y" +#line 479 "/Users/bocchino/llvm/obj/../src/utils/TableGen/FileParser.y" { std::string DecName = *yyvsp[-1].StrVal; if (ParsingTemplateArgs) @@ -1427,13 +1427,13 @@ ; break;} case 49: -#line 489 "/Users/sabre/llvm/utils/TableGen/FileParser.y" +#line 489 "/Users/bocchino/llvm/obj/../src/utils/TableGen/FileParser.y" { delete yyvsp[-1].StrVal; ; break;} case 50: -#line 491 "/Users/sabre/llvm/utils/TableGen/FileParser.y" +#line 491 "/Users/bocchino/llvm/obj/../src/utils/TableGen/FileParser.y" { setValue(*yyvsp[-4].StrVal, yyvsp[-3].BitList, yyvsp[-1].Initializer); delete yyvsp[-4].StrVal; @@ -1441,19 +1441,19 @@ ; break;} case 55: -#line 500 "/Users/sabre/llvm/utils/TableGen/FileParser.y" +#line 500 "/Users/bocchino/llvm/obj/../src/utils/TableGen/FileParser.y" { yyval.SubClassRef = new SubClassRefTy(yyvsp[0].Rec, new std::vector()); ; break;} case 56: -#line 502 "/Users/sabre/llvm/utils/TableGen/FileParser.y" +#line 502 "/Users/bocchino/llvm/obj/../src/utils/TableGen/FileParser.y" { yyval.SubClassRef = new SubClassRefTy(yyvsp[-3].Rec, yyvsp[-1].FieldList); ; break;} case 57: -#line 506 "/Users/sabre/llvm/utils/TableGen/FileParser.y" +#line 506 "/Users/bocchino/llvm/obj/../src/utils/TableGen/FileParser.y" { yyval.SubClassList = new std::vector(); yyval.SubClassList->push_back(*yyvsp[0].SubClassRef); @@ -1461,52 +1461,52 @@ ; break;} case 58: -#line 511 "/Users/sabre/llvm/utils/TableGen/FileParser.y" +#line 511 "/Users/bocchino/llvm/obj/../src/utils/TableGen/FileParser.y" { (yyval.SubClassList=yyvsp[-2].SubClassList)->push_back(*yyvsp[0].SubClassRef); delete yyvsp[0].SubClassRef; ; break;} case 59: -#line 516 "/Users/sabre/llvm/utils/TableGen/FileParser.y" +#line 516 "/Users/bocchino/llvm/obj/../src/utils/TableGen/FileParser.y" { yyval.SubClassList = new std::vector(); ; break;} case 60: -#line 519 "/Users/sabre/llvm/utils/TableGen/FileParser.y" +#line 519 "/Users/bocchino/llvm/obj/../src/utils/TableGen/FileParser.y" { yyval.SubClassList = yyvsp[0].SubClassList; ; break;} case 61: -#line 523 "/Users/sabre/llvm/utils/TableGen/FileParser.y" +#line 523 "/Users/bocchino/llvm/obj/../src/utils/TableGen/FileParser.y" { CurRec->addTemplateArg(*yyvsp[0].StrVal); delete yyvsp[0].StrVal; ; break;} case 62: -#line 526 "/Users/sabre/llvm/utils/TableGen/FileParser.y" +#line 526 "/Users/bocchino/llvm/obj/../src/utils/TableGen/FileParser.y" { CurRec->addTemplateArg(*yyvsp[0].StrVal); delete yyvsp[0].StrVal; ; break;} case 63: -#line 531 "/Users/sabre/llvm/utils/TableGen/FileParser.y" +#line 531 "/Users/bocchino/llvm/obj/../src/utils/TableGen/FileParser.y" {; break;} case 66: -#line 534 "/Users/sabre/llvm/utils/TableGen/FileParser.y" +#line 534 "/Users/bocchino/llvm/obj/../src/utils/TableGen/FileParser.y" { yyval.StrVal = yyvsp[0].StrVal; ; break;} case 67: -#line 534 "/Users/sabre/llvm/utils/TableGen/FileParser.y" +#line 534 "/Users/bocchino/llvm/obj/../src/utils/TableGen/FileParser.y" { yyval.StrVal = new std::string(); ; break;} case 68: -#line 536 "/Users/sabre/llvm/utils/TableGen/FileParser.y" +#line 536 "/Users/bocchino/llvm/obj/../src/utils/TableGen/FileParser.y" { static unsigned AnonCounter = 0; if (yyvsp[0].StrVal->empty()) @@ -1515,7 +1515,7 @@ ; break;} case 69: -#line 543 "/Users/sabre/llvm/utils/TableGen/FileParser.y" +#line 543 "/Users/bocchino/llvm/obj/../src/utils/TableGen/FileParser.y" { // If a class of this name already exists, it must be a forward ref. if ((CurRec = Records.getClass(*yyvsp[0].StrVal))) { @@ -1535,7 +1535,7 @@ ; break;} case 70: -#line 561 "/Users/sabre/llvm/utils/TableGen/FileParser.y" +#line 561 "/Users/bocchino/llvm/obj/../src/utils/TableGen/FileParser.y" { CurRec = new Record(*yyvsp[0].StrVal); delete yyvsp[0].StrVal; @@ -1549,7 +1549,7 @@ ; break;} case 71: -#line 573 "/Users/sabre/llvm/utils/TableGen/FileParser.y" +#line 573 "/Users/bocchino/llvm/obj/../src/utils/TableGen/FileParser.y" { for (unsigned i = 0, e = yyvsp[0].SubClassList->size(); i != e; ++i) { addSubClass((*yyvsp[0].SubClassList)[i].first, *(*yyvsp[0].SubClassList)[i].second); @@ -1567,32 +1567,32 @@ ; break;} case 72: -#line 587 "/Users/sabre/llvm/utils/TableGen/FileParser.y" +#line 587 "/Users/bocchino/llvm/obj/../src/utils/TableGen/FileParser.y" { yyval.Rec = CurRec; CurRec = 0; ; break;} case 73: -#line 592 "/Users/sabre/llvm/utils/TableGen/FileParser.y" +#line 592 "/Users/bocchino/llvm/obj/../src/utils/TableGen/FileParser.y" { ParsingTemplateArgs = true; ; break;} case 74: -#line 594 "/Users/sabre/llvm/utils/TableGen/FileParser.y" +#line 594 "/Users/bocchino/llvm/obj/../src/utils/TableGen/FileParser.y" { ParsingTemplateArgs = false; ; break;} case 75: -#line 596 "/Users/sabre/llvm/utils/TableGen/FileParser.y" +#line 596 "/Users/bocchino/llvm/obj/../src/utils/TableGen/FileParser.y" { yyval.Rec = yyvsp[0].Rec; ; break;} case 76: -#line 600 "/Users/sabre/llvm/utils/TableGen/FileParser.y" +#line 600 "/Users/bocchino/llvm/obj/../src/utils/TableGen/FileParser.y" { yyvsp[0].Rec->resolveReferences(); @@ -1602,38 +1602,38 @@ ; break;} case 79: -#line 611 "/Users/sabre/llvm/utils/TableGen/FileParser.y" +#line 611 "/Users/bocchino/llvm/obj/../src/utils/TableGen/FileParser.y" { LetStack.back().push_back(LetRecord(*yyvsp[-3].StrVal, yyvsp[-2].BitList, yyvsp[0].Initializer)); delete yyvsp[-3].StrVal; delete yyvsp[-2].BitList; ; break;} case 82: -#line 619 "/Users/sabre/llvm/utils/TableGen/FileParser.y" +#line 619 "/Users/bocchino/llvm/obj/../src/utils/TableGen/FileParser.y" { LetStack.push_back(std::vector()); ; break;} case 84: -#line 622 "/Users/sabre/llvm/utils/TableGen/FileParser.y" +#line 622 "/Users/bocchino/llvm/obj/../src/utils/TableGen/FileParser.y" { LetStack.pop_back(); ; break;} case 85: -#line 625 "/Users/sabre/llvm/utils/TableGen/FileParser.y" +#line 625 "/Users/bocchino/llvm/obj/../src/utils/TableGen/FileParser.y" { LetStack.pop_back(); ; break;} case 86: -#line 629 "/Users/sabre/llvm/utils/TableGen/FileParser.y" +#line 629 "/Users/bocchino/llvm/obj/../src/utils/TableGen/FileParser.y" {; break;} case 87: -#line 629 "/Users/sabre/llvm/utils/TableGen/FileParser.y" +#line 629 "/Users/bocchino/llvm/obj/../src/utils/TableGen/FileParser.y" {; break;} case 88: -#line 631 "/Users/sabre/llvm/utils/TableGen/FileParser.y" +#line 631 "/Users/bocchino/llvm/obj/../src/utils/TableGen/FileParser.y" {; break;} } @@ -1858,7 +1858,7 @@ } return 1; } -#line 633 "/Users/sabre/llvm/utils/TableGen/FileParser.y" +#line 633 "/Users/bocchino/llvm/obj/../src/utils/TableGen/FileParser.y" int yyerror(const char *ErrorMsg) { From bocchino at cs.uiuc.edu Tue Oct 18 14:22:22 2005 From: bocchino at cs.uiuc.edu (Robert Bocchino) Date: Tue, 18 Oct 2005 14:22:22 -0500 Subject: [llvm-commits] [vector_llvm] CVS: llvm/lib/VMCore/AsmWriter.cpp Constants.cpp Instruction.cpp Instructions.cpp Type.cpp Verifier.cpp Message-ID: <200510181922.OAA13411@zion.cs.uiuc.edu> Changes in directory llvm/lib/VMCore: AsmWriter.cpp updated: 1.181 -> 1.181.2.1 Constants.cpp updated: 1.139 -> 1.139.2.1 Instruction.cpp updated: 1.48 -> 1.48.2.1 Instructions.cpp updated: 1.26 -> 1.26.2.1 Type.cpp updated: 1.129 -> 1.129.2.1 Verifier.cpp updated: 1.134 -> 1.134.2.1 --- Log message: Initial commit of Vector LLVM. --- Diffs of the changes: (+594 -80) AsmWriter.cpp | 25 ++-- Constants.cpp | 52 ++++---- Instruction.cpp | 18 ++ Instructions.cpp | 340 ++++++++++++++++++++++++++++++++++++++++++++++++++++++- Type.cpp | 214 +++++++++++++++++++++++++++++----- Verifier.cpp | 25 ++-- 6 files changed, 594 insertions(+), 80 deletions(-) Index: llvm/lib/VMCore/AsmWriter.cpp diff -u llvm/lib/VMCore/AsmWriter.cpp:1.181 llvm/lib/VMCore/AsmWriter.cpp:1.181.2.1 --- llvm/lib/VMCore/AsmWriter.cpp:1.181 Wed Aug 17 14:33:31 2005 +++ llvm/lib/VMCore/AsmWriter.cpp Tue Oct 18 14:21:57 2005 @@ -332,16 +332,23 @@ Result += "]"; break; } - case Type::PackedTyID: { - const PackedType *PTy = cast(Ty); - Result += "<" + utostr(PTy->getNumElements()) + " x "; + case Type::FixedVectorTyID: { + const FixedVectorType *PTy = cast(Ty); + Result += "[vector of " + utostr(PTy->getNumElements()) + " "; calcTypeName(PTy->getElementType(), TypeStack, TypeNames, Result); - Result += ">"; + Result += "]"; break; } case Type::OpaqueTyID: Result += "opaque"; break; + case Type::VectorTyID: { + const VectorType *VTy = cast(Ty); + Result += "[vector of "; + calcTypeName(VTy->getElementType(), TypeStack, TypeNames, Result); + Result += "]"; + break; + } default: Result += ""; } @@ -503,10 +510,10 @@ } Out << " }"; - } else if (const ConstantPacked *CP = dyn_cast(CV)) { + } else if (const ConstantVector *CP = dyn_cast(CV)) { const Type *ETy = CP->getType()->getElementType(); - assert(CP->getNumOperands() > 0 && - "Number of operands for a PackedConst must be > 0"); + assert(CP->getNumOperands() > 0 && + "Number of operands for a FixedVectorConst must be > 0"); Out << '<'; Out << ' '; printTypeInt(Out, ETy, TypeTable); @@ -734,7 +741,7 @@ } else if (const ArrayType *ATy = dyn_cast(Ty)) { Out << '[' << ATy->getNumElements() << " x "; printType(ATy->getElementType()) << ']'; - } else if (const PackedType *PTy = dyn_cast(Ty)) { + } else if (const FixedVectorType *PTy = dyn_cast(Ty)) { Out << '<' << PTy->getNumElements() << " x "; printType(PTy->getElementType()) << '>'; } @@ -1054,6 +1061,8 @@ } else if (isa(I) && cast(I).isTailCall()) { // If this is a call, check if it's a tail call. Out << "tail "; + } else if (isa(I) && isa(I.getType())) { + Out << "fixed "; } // Print out the opcode... Index: llvm/lib/VMCore/Constants.cpp diff -u llvm/lib/VMCore/Constants.cpp:1.139 llvm/lib/VMCore/Constants.cpp:1.139.2.1 --- llvm/lib/VMCore/Constants.cpp:1.139 Fri Oct 7 00:23:36 2005 +++ llvm/lib/VMCore/Constants.cpp Tue Oct 18 14:21:57 2005 @@ -112,9 +112,15 @@ case Type::PointerTyID: return ConstantPointerNull::get(cast(Ty)); + //case Type::VectorTyID: { + //const VectorType *VT = cast(Ty); + //return ConstantExpr::getCast(Constant::getNullValue(VT->getElementType()), Ty); + //} + case Type::StructTyID: case Type::ArrayTyID: - case Type::PackedTyID: + case Type::FixedVectorTyID: + case Type::VectorTyID: return ConstantAggregateZero::get(Ty); default: // Function, Label, or Opaque type? @@ -287,7 +293,7 @@ } -ConstantPacked::ConstantPacked(const PackedType *T, +ConstantVector::ConstantVector(const FixedVectorType *T, const std::vector &V) : Constant(T, ConstantPackedVal, new Use[V.size()], V.size()) { Use *OL = OperandList; @@ -297,12 +303,12 @@ assert((C->getType() == T->getElementType() || (T->isAbstract() && C->getType()->getTypeID() == T->getElementType()->getTypeID())) && - "Initializer for packed element doesn't match packed element type!"); + "Initializer for vector element doesn't match vector element type!"); OL->init(C, this); } } -ConstantPacked::~ConstantPacked() { +ConstantVector::~ConstantVector() { delete [] OperandList; } @@ -483,10 +489,12 @@ // TODO: Figure out how to test if a double can be cast to a float! case Type::FloatTyID: case Type::DoubleTyID: + case Type::VectorTyID: // Added this for vector type! return true; // This is the largest type... } }; + //===----------------------------------------------------------------------===// // Factory Function Implementation @@ -982,17 +990,17 @@ destroyConstantImpl(); } -//---- ConstantPacked::get() implementation... +//---- ConstantVector::get() implementation... // namespace llvm { template<> - struct ConvertConstantType { - static void convert(ConstantPacked *OldC, const PackedType *NewTy) { + struct ConvertConstantType { + static void convert(ConstantVector *OldC, const FixedVectorType *NewTy) { // Make everyone now use a constant of the new type... std::vector C; for (unsigned i = 0, e = OldC->getNumOperands(); i != e; ++i) C.push_back(cast(OldC->getOperand(i))); - Constant *New = ConstantPacked::get(NewTy, C); + Constant *New = ConstantVector::get(NewTy, C); assert(New != OldC && "Didn't replace constant??"); OldC->uncheckedReplaceAllUsesWith(New); OldC->destroyConstant(); // This constant is now dead, destroy it. @@ -1000,7 +1008,7 @@ }; } -static std::vector getValType(ConstantPacked *CP) { +static std::vector getValType(ConstantVector *CP) { std::vector Elements; Elements.reserve(CP->getNumOperands()); for (unsigned i = 0, e = CP->getNumOperands(); i != e; ++i) @@ -1008,32 +1016,32 @@ return Elements; } -static ValueMap, PackedType, - ConstantPacked> PackedConstants; +static ValueMap, FixedVectorType, + ConstantVector> FixedVectorConstants; -Constant *ConstantPacked::get(const PackedType *Ty, +Constant *ConstantVector::get(const FixedVectorType *Ty, const std::vector &V) { - // If this is an all-zero packed, return a ConstantAggregateZero object + // If this is an all-zero vector, return a ConstantAggregateZero object if (!V.empty()) { Constant *C = V[0]; if (!C->isNullValue()) - return PackedConstants.getOrCreate(Ty, V); + return FixedVectorConstants.getOrCreate(Ty, V); for (unsigned i = 1, e = V.size(); i != e; ++i) if (V[i] != C) - return PackedConstants.getOrCreate(Ty, V); + return FixedVectorConstants.getOrCreate(Ty, V); } return ConstantAggregateZero::get(Ty); } -Constant *ConstantPacked::get(const std::vector &V) { +Constant *ConstantVector::get(const std::vector &V) { assert(!V.empty() && "Cannot infer type if V is empty"); - return get(PackedType::get(V.front()->getType(),V.size()), V); + return get(FixedVectorType::get(V.front()->getType(),V.size()), V); } // destroyConstant - Remove the constant from the constant table... // -void ConstantPacked::destroyConstant() { - PackedConstants.remove(this); +void ConstantVector::destroyConstant() { + FixedVectorConstants.remove(this); destroyConstantImpl(); } @@ -1529,7 +1537,7 @@ destroyConstant(); } -void ConstantPacked::replaceUsesOfWithOnConstant(Value *From, Value *To, +void ConstantVector::replaceUsesOfWithOnConstant(Value *From, Value *To, Use *U) { assert(isa(To) && "Cannot make Constant refer to non-constant!"); @@ -1541,7 +1549,7 @@ Values.push_back(Val); } - Constant *Replacement = ConstantPacked::get(getType(), Values); + Constant *Replacement = ConstantVector::get(getType(), Values); assert(Replacement != this && "I didn't contain From!"); // Everyone using this now uses the replacement. @@ -1615,7 +1623,7 @@ AggZeroConstants.clear(Constants); ArrayConstants.clear(Constants); StructConstants.clear(Constants); - PackedConstants.clear(Constants); + FixedVectorConstants.clear(Constants); NullPtrConstants.clear(Constants); UndefValueConstants.clear(Constants); ExprConstants.clear(Constants); Index: llvm/lib/VMCore/Instruction.cpp diff -u llvm/lib/VMCore/Instruction.cpp:1.48 llvm/lib/VMCore/Instruction.cpp:1.48.2.1 --- llvm/lib/VMCore/Instruction.cpp:1.48 Mon Aug 8 00:21:50 2005 +++ llvm/lib/VMCore/Instruction.cpp Tue Oct 18 14:21:57 2005 @@ -104,6 +104,14 @@ case SetEQ: return "seteq"; case SetNE: return "setne"; + // VSetCC operators... + case VSetLE: return "vsetle"; + case VSetGE: return "vsetge"; + case VSetLT: return "vsetlt"; + case VSetGT: return "vsetgt"; + case VSetEQ: return "vseteq"; + case VSetNE: return "vsetne"; + // Memory instructions... case Malloc: return "malloc"; case Free: return "free"; @@ -116,10 +124,18 @@ case PHI: return "phi"; case Cast: return "cast"; case Select: return "select"; + case VSelect: return "vselect"; case Call: return "call"; case Shl: return "shl"; case Shr: return "shr"; - case VAArg: return "va_arg"; + case VAArg: return "vaarg"; + case VImm: return "vimm"; + case VGather: return "vgather"; + case VScatter: return "vscatter"; + case Extract: return "extract"; + case ExtractElement: return "extractelement"; + case Combine: return "combine"; + case CombineElement: return "combineelement"; default: return " "; } Index: llvm/lib/VMCore/Instructions.cpp diff -u llvm/lib/VMCore/Instructions.cpp:1.26 llvm/lib/VMCore/Instructions.cpp:1.26.2.1 --- llvm/lib/VMCore/Instructions.cpp:1.26 Fri Aug 5 10:37:31 2005 +++ llvm/lib/VMCore/Instructions.cpp Tue Oct 18 14:21:57 2005 @@ -18,6 +18,7 @@ #include "llvm/Function.h" #include "llvm/Instructions.h" #include "llvm/Support/CallSite.h" + using namespace llvm; unsigned CallSite::getCallingConv() const { @@ -809,21 +810,27 @@ case Rem: assert(getType() == LHS->getType() && "Arithmetic operation should return same type as operands!"); - assert((getType()->isInteger() || - getType()->isFloatingPoint() || - isa(getType()) ) && + assert((getType()->isInteger() || + getType()->isFloatingPoint() || + isa(getType())) && "Tried to create an arithmetic operation on a non-arithmetic type!"); break; case And: case Or: case Xor: assert(getType() == LHS->getType() && "Logical operation should return same type as operands!"); - assert(getType()->isIntegral() && + assert(getType()->isIntegral() || + getType()->isIntegralVector() && "Tried to create a logical operation on a non-integral type!"); break; case SetLT: case SetGT: case SetLE: case SetGE: case SetEQ: case SetNE: assert(getType() == Type::BoolTy && "Setcc must return bool!"); + break; + case VSetLT: case VSetGT: case VSetLE: + case VSetGE: case VSetEQ: case VSetNE: + assert(getType()->isBooleanVector() && "VSetcc must return bool vector!"); + break; default: break; } @@ -839,6 +846,8 @@ // Binary comparison operators... case SetLT: case SetGT: case SetLE: case SetGE: case SetEQ: case SetNE: + case VSetLT: case VSetGT: case VSetLE: + case VSetGE: case VSetEQ: case VSetNE: return new SetCondInst(Op, S1, S2, Name, InsertBefore); default: @@ -964,9 +973,18 @@ // SetCondInst Class //===----------------------------------------------------------------------===// +static Type *condType(Value *S) { + const Type *T = S->getType(); + if (const FixedVectorType *VT = dyn_cast(T)) + return FixedVectorType::get(Type::BoolTy, VT->getNumElements()); + if (const VectorType *VT = dyn_cast(T)) + return VectorType::get(Type::BoolTy); + return Type::BoolTy; +} + SetCondInst::SetCondInst(BinaryOps Opcode, Value *S1, Value *S2, const std::string &Name, Instruction *InsertBefore) - : BinaryOperator(Opcode, S1, S2, Type::BoolTy, Name, InsertBefore) { + : BinaryOperator(Opcode, S1, S2, condType(S1), Name, InsertBefore) { // Make sure it's a valid type... getInverseCondition will assert out if not. assert(getInverseCondition(Opcode)); @@ -974,7 +992,7 @@ SetCondInst::SetCondInst(BinaryOps Opcode, Value *S1, Value *S2, const std::string &Name, BasicBlock *InsertAtEnd) - : BinaryOperator(Opcode, S1, S2, Type::BoolTy, Name, InsertAtEnd) { + : BinaryOperator(Opcode, S1, S2, condType(S1), Name, InsertAtEnd) { // Make sure it's a valid type... getInverseCondition will assert out if not. assert(getInverseCondition(Opcode)); @@ -993,6 +1011,12 @@ case SetLT: return SetGE; case SetGE: return SetLT; case SetLE: return SetGT; + case VSetEQ: return VSetNE; + case VSetNE: return VSetEQ; + case VSetGT: return VSetLE; + case VSetLT: return VSetGE; + case VSetGE: return VSetLT; + case VSetLE: return VSetGT; } } @@ -1008,6 +1032,54 @@ case SetLT: return SetGT; case SetGE: return SetLE; case SetLE: return SetGE; + case VSetGT: return VSetLT; + case VSetLT: return VSetGT; + case VSetGE: return VSetLE; + case VSetLE: return VSetGE; + } +} + +// getScalarOpcode - Return the scalar version of this opcode. +// For example seteq -> seteq, vseteq -> seteq, etc. +// +Instruction::BinaryOps SetCondInst::getScalarOpcode(BinaryOps Opcode) { + switch (Opcode) { + default: + assert(0 && "Unknown setcc opcode!"); + case SetEQ: case VSetEQ: + return SetEQ; + case SetNE: case VSetNE: + return SetNE; + case SetGT: case VSetGT: + return SetGT; + case SetLT: case VSetLT: + return SetLT; + case SetGE: case VSetGE: + return SetGE; + case SetLE: case VSetLE: + return SetLE; + } +} + +// getVectorOpcode - Return the vector version of this opcode. +// For example seteq -> vseteq, vseteq -> vseteq, etc. +// +Instruction::BinaryOps SetCondInst::getVectorOpcode(BinaryOps Opcode) { + switch (Opcode) { + default: + assert(0 && "Unknown setcc opcode!"); + case SetEQ: case VSetEQ: + return VSetEQ; + case SetNE: case VSetNE: + return VSetNE; + case SetGT: case VSetGT: + return VSetGT; + case SetLT: case VSetLT: + return VSetLT; + case SetGE: case VSetGE: + return VSetGE; + case SetLE: case VSetLE: + return VSetLE; } } @@ -1122,6 +1194,252 @@ } +//===----------------------------------------------------------------------===// +// VMemoryInst Implementation +//===----------------------------------------------------------------------===// + +VMemoryInst::VMemoryInst(const Type *Ty, unsigned iType, + Use *Ops, unsigned NumOps, + const std::string &Name, Instruction *InsertBef) + : Instruction(Ty, iType, Ops, NumOps, Name, InsertBef) {} + +VMemoryInst::VMemoryInst(const Type* Ty, unsigned iType, + Use *Ops, unsigned NumOps, + const std::string &Name, BasicBlock *InsertAE) + + : Instruction(Ty, iType, Ops, NumOps, Name, InsertAE) {} + +VMemoryInst::~VMemoryInst() { + delete [] OperandList; +} + +bool VMemoryInst::checkIndexType(const std::vector &Idx) { + unsigned i; + for (i = 0; i < Idx.size(); ++i) + if (Idx[i]->getType() != Type::LongTy) + return false; + return true; +} + +const Type *VMemoryInst::getElementType() const { + const VectorType *VT = dyn_cast(getType()); + assert(VT && "Vector instruction not of vector type!"); + return VT->getElementType(); +} + + +//===----------------------------------------------------------------------===// +// VGatherInst Implementation +//===----------------------------------------------------------------------===// + +void VGatherInst::init(Value *Ptr, const std::vector &Idx) +{ + assert(isa(Ptr->getType()) && "Ptr must be of pointer type!"); + assert(cast(Ptr->getType())->getElementType()->isPrimitiveType() && + "Ptr must be pointer to primitive type!"); + assert(checkNumIndices(Idx) && "vgather must have four indices for each array dimension!"); + assert(checkIndexType(Idx) && "vgather indices must be of type long!"); + + NumOperands = 1+Idx.size(); + Use *OL = OperandList = new Use[NumOperands]; + OL[0].init(Ptr, this); + + for (unsigned i = 0, e = Idx.size(); i != e; ++i) + OL[i+1].init(Idx[i], this); +} + +VGatherInst::VGatherInst(Value *Ptr, const std::vector &Idx, + const std::string &Name, Instruction *InsertBef) + : VMemoryInst(VectorType::get(cast(Ptr->getType())->getElementType()), + VGather, 0, 0, Name, InsertBef) { + init(Ptr, Idx); +} + +VGatherInst::VGatherInst(Value *Ptr, const std::vector &Idx, + const std::string &Name, BasicBlock *InsertAE) + : VMemoryInst(VectorType::get(cast(Ptr->getType())->getElementType()), + VGather, 0, 0, Name, InsertAE) { + init(Ptr, Idx); +} + + +//===----------------------------------------------------------------------===// +// VScatterInst Implementation +//===----------------------------------------------------------------------===// + +void VScatterInst::init(Value *Val, Value *Ptr, const std::vector &Idx) { + assert(isa(Val->getType()) && "Val must be of vector type!"); + assert(isa(Ptr->getType()) && "Ptr must be of pointer type!"); + assert(cast(Ptr->getType())->getElementType()->isPrimitiveType() && + "Ptr must be pointer to primitive type!"); + //assert(Val->getType() == VectorType::get(cast(Ptr->getType())->getElementType()) + // && "Ptr must be a pointer to Val type!"); + assert(cast(Val->getType())->getElementType() == + cast(Ptr->getType())->getElementType() + && "Ptr must be a pointer to Val type!"); + assert(checkNumIndices(Idx) && "vscatter must have four indices for each array dimension!"); + assert(checkIndexType(Idx) && "vscatter indices must be of type long!"); + + NumOperands = 2+Idx.size(); + Use *OL = OperandList = new Use[NumOperands]; + OL[0].init(Val, this); + OL[1].init(Ptr, this); + + for (unsigned i = 0, e = Idx.size(); i != e; ++i) + OL[i+2].init(Idx[i], this); + +} + +VScatterInst::VScatterInst(Value *Val, Value *Ptr, const std::vector &Idx, + Instruction *InsertBefore) + : VMemoryInst(Type::VoidTy, VScatter, 0, 0, "", InsertBefore) { + init(Val, Ptr, Idx); +} + +VScatterInst::VScatterInst(Value *Val, Value *Ptr, const std::vector &Idx, + BasicBlock *InsertAtEnd) + : VMemoryInst(Type::VoidTy, VScatter, 0, 0, "", InsertAtEnd) { + init(Val, Ptr, Idx); +} + +//===----------------------------------------------------------------------===// +// VImmInst Implementation +//===----------------------------------------------------------------------===// + +static const VectorType *VImmType(const Type* Ty, Value *Len, bool isFixed) { + if (!isFixed) + return VectorType::get(Ty); + ConstantUInt *C = dyn_cast(Len); + assert(C && "Length operand of fixed vimm must be constant uint!"); + return FixedVectorType::get(Ty, C->getValue()); +} + +VImmInst::VImmInst(Value *Val, Value *Len, bool isFixed, + const std::string &Name, + Instruction *InsertBef) + : Instruction(VImmType(Val->getType(), Len, isFixed), + VImm, Ops, 2, Name, InsertBef) { + Ops[0].init(Val, this); + Ops[1].init(Len, this); +} + +VImmInst::VImmInst(Value *Val, Value *Len, bool isFixed, + const std::string &Name, + BasicBlock *InsertAE) + : Instruction(VImmType(Val->getType(), Len, isFixed), + VImm, Ops, 2, Name, InsertAE) { + Ops[0].init(Val, this); + Ops[1].init(Len, this); +} + +//===----------------------------------------------------------------------===// +// ExtractInst Implementation +//===----------------------------------------------------------------------===// + +static const Type *getExtractType(const Type *Ty, Value *len) { + const VectorType *VTy = dyn_cast(Ty); + assert(VTy && "Extract inst must have vector type!"); + // FIXME: Add a fixed attribute that says whether the result should + // be a fixed or variable vector (this is what vimm currently does). + // OR, we could explicitly encode the type in the assembly form. I + // haven't decided which is better. + // + if (isa(Ty)) + if (ConstantUInt *C = dyn_cast(len)) + return FixedVectorType::get(VTy->getElementType(), C->getValue()); + return Ty; +} + +ExtractInst::ExtractInst(Value *Val, Value *Start, + Value *Stride, Value *Len, + const std::string &Name, Instruction *InsertBef) + : Instruction(getExtractType(Val->getType(), Len),//Val->getType(), + Extract, Ops, 4, Name, InsertBef) { + Ops[0].init(Val, this); + Ops[1].init(Start, this); + Ops[2].init(Stride, this); + Ops[3].init(Len, this); +} + +ExtractInst::ExtractInst(Value *Val, Value *Start, + Value *Stride, Value *Len, + const std::string &Name, BasicBlock *InsertAE) + : Instruction(getExtractType(Val->getType(), Len),//Val->getType(), + Extract, Ops, 4, Name, InsertAE) { + Ops[0].init(Val, this); + Ops[1].init(Start, this); + Ops[2].init(Stride, this); + Ops[3].init(Len, this); +} + +//===----------------------------------------------------------------------===// +// ExtractElementInst Implementation +//===----------------------------------------------------------------------===// + +ExtractElementInst::ExtractElementInst(Value *Val, Value *Index, + const std::string &Name, Instruction *InsertBef) + : Instruction(cast(Val->getType())->getElementType(), + ExtractElement, Ops, 2, Name, InsertBef) { + Ops[0].init(Val, this); + Ops[1].init(Index, this); +} + +ExtractElementInst::ExtractElementInst(Value *Val, Value *Index, + const std::string &Name, BasicBlock *InsertAE) + : Instruction(cast(Val->getType())->getElementType(), + ExtractElement, Ops, 2, Name, InsertAE) { + Ops[0].init(Val, this); + Ops[1].init(Index, this); +} + +//===----------------------------------------------------------------------===// +// CombineInst Implementation +//===----------------------------------------------------------------------===// + +CombineInst::CombineInst(Value *V1, Value *V2, + Value *Start, Value *Stride, + const std::string &Name, Instruction *InsertBef) + : Instruction(V1->getType(), + Combine, Ops, 4, Name, InsertBef) { + Ops[0].init(V1, this); + Ops[1].init(V2, this); + Ops[2].init(Start, this); + Ops[3].init(Stride, this); +} + +CombineInst::CombineInst(Value *V1, Value *V2, + Value *Start, Value *Stride, + const std::string &Name, BasicBlock *InsertAE) + : Instruction(V1->getType(), + Combine, Ops, 4, Name, InsertAE) { + Ops[0].init(V1, this); + Ops[1].init(V2, this); + Ops[2].init(Start, this); + Ops[3].init(Stride, this); +} + +//===----------------------------------------------------------------------===// +// CombineElementInst Implementation +//===----------------------------------------------------------------------===// + +CombineElementInst::CombineElementInst(Value *Vector, Value *Element, Value *Index, + const std::string &Name, Instruction *InsertBef) + : Instruction(Vector->getType(), + CombineElement, Ops, 3, Name, InsertBef) { + Ops[0].init(Vector, this); + Ops[1].init(Element, this); + Ops[2].init(Index, this); +} + +CombineElementInst::CombineElementInst(Value *Vector, Value *Element, Value *Index, + const std::string &Name, BasicBlock *InsertAE) + : Instruction(Vector->getType(), + CombineElement, Ops, 3, Name, InsertAE) { + Ops[0].init(Vector, this); + Ops[1].init(Element, this); + Ops[2].init(Index, this); +} + // Define these methods here so vtables don't get emitted into every translation // unit that uses these classes. @@ -1133,6 +1451,14 @@ return create(getOpcode(), Ops[0], Ops[1]); } +VGatherInst *VGatherInst::clone() const { return new VGatherInst(*this); } +VScatterInst *VScatterInst::clone() const { return new VScatterInst(*this); } +VImmInst *VImmInst::clone() const { return new VImmInst(*this); } +ExtractInst *ExtractInst::clone() const { return new ExtractInst(*this); } +ExtractElementInst *ExtractElementInst::clone() const { return new ExtractElementInst(*this); } +CombineInst *CombineInst::clone() const { return new CombineInst(*this); } +CombineElementInst *CombineElementInst::clone() const { return new CombineElementInst(*this); } + MallocInst *MallocInst::clone() const { return new MallocInst(*this); } AllocaInst *AllocaInst::clone() const { return new AllocaInst(*this); } FreeInst *FreeInst::clone() const { return new FreeInst(getOperand(0)); } @@ -1142,6 +1468,7 @@ CallInst *CallInst::clone() const { return new CallInst(*this); } ShiftInst *ShiftInst::clone() const { return new ShiftInst(*this); } SelectInst *SelectInst::clone() const { return new SelectInst(*this); } +VSelectInst *VSelectInst::clone() const { return new VSelectInst(*this); } VAArgInst *VAArgInst::clone() const { return new VAArgInst(*this); } PHINode *PHINode::clone() const { return new PHINode(*this); } ReturnInst *ReturnInst::clone() const { return new ReturnInst(*this); } @@ -1150,3 +1477,4 @@ InvokeInst *InvokeInst::clone() const { return new InvokeInst(*this); } UnwindInst *UnwindInst::clone() const { return new UnwindInst(); } UnreachableInst *UnreachableInst::clone() const { return new UnreachableInst();} + Index: llvm/lib/VMCore/Type.cpp diff -u llvm/lib/VMCore/Type.cpp:1.129 llvm/lib/VMCore/Type.cpp:1.129.2.1 --- llvm/lib/VMCore/Type.cpp:1.129 Wed Jul 27 01:12:34 2005 +++ llvm/lib/VMCore/Type.cpp Tue Oct 18 14:21:58 2005 @@ -177,7 +177,7 @@ if (const ArrayType *ATy = dyn_cast(this)) return ATy->getElementType()->isSized(); - if (const PackedType *PTy = dyn_cast(this)) + if (const FixedVectorType *PTy = dyn_cast(this)) return PTy->getElementType()->isSized(); if (!isa(this)) return false; @@ -291,12 +291,24 @@ Result += getTypeDescription(ATy->getElementType(), TypeStack) + "]"; break; } - case Type::PackedTyID: { - const PackedType *PTy = cast(Ty); + case Type::StreamTyID: { + const StreamType *STy = cast(Ty); + Result = "[stream of "; + Result += getTypeDescription(STy->getElementType(), TypeStack) + "]"; + break; + } + case Type::VectorTyID: { + const VectorType *VTy = cast(Ty); + Result = "[vector of "; + Result += getTypeDescription(VTy->getElementType(), TypeStack) + "]"; + break; + } + case Type::FixedVectorTyID: { + const FixedVectorType *PTy = cast(Ty); unsigned NumElements = PTy->getNumElements(); - Result = "<"; - Result += utostr(NumElements) + " x "; - Result += getTypeDescription(PTy->getElementType(), TypeStack) + ">"; + Result = "[vector of "; + Result += utostr(NumElements) + " "; + Result += getTypeDescription(PTy->getElementType(), TypeStack) + "]"; break; } default: @@ -436,19 +448,27 @@ setAbstract(ElType->isAbstract()); } -PackedType::PackedType(const Type *ElType, unsigned NumEl) - : SequentialType(PackedTyID, ElType) { - NumElements = NumEl; +PointerType::PointerType(const Type *E) : SequentialType(PointerTyID, E) { + // Calculate whether or not this type is abstract + setAbstract(E->isAbstract()); +} - assert(NumEl > 0 && "NumEl of a PackedType must be greater than 0"); - assert((ElType->isIntegral() || ElType->isFloatingPoint()) && - "Elements of a PackedType must be a primitive type"); +StreamType::StreamType(const Type *E) + : SequentialType(StreamTyID, E) { + assert((E->isIntegral() || E->isFloatingPoint() || isa(E)) && + "Elements of a StreamType must be a primitive or fixed vector type!"); } +VectorType::VectorType(const Type *E, bool fixed) + : SequentialType(fixed ? FixedVectorTyID : VectorTyID, E) { + assert((E->isIntegral() || E->isFloatingPoint()) && + "Elements of a VectorType must be a primitive type!"); +} -PointerType::PointerType(const Type *E) : SequentialType(PointerTyID, E) { - // Calculate whether or not this type is abstract - setAbstract(E->isAbstract()); +FixedVectorType::FixedVectorType(const Type *ElType, unsigned NumEl) + : VectorType(ElType, true) { + NumElements = NumEl; + assert(NumEl > 0 && "NumEl of a FixedVectorType must be greater than 0!"); } OpaqueType::OpaqueType() : DerivedType(OpaqueTyID) { @@ -595,8 +615,8 @@ const ArrayType *ATy2 = cast(Ty2); return ATy->getNumElements() == ATy2->getNumElements() && TypesEqual(ATy->getElementType(), ATy2->getElementType(), EqTypes); - } else if (const PackedType *PTy = dyn_cast(Ty)) { - const PackedType *PTy2 = cast(Ty2); + } else if (const FixedVectorType *PTy = dyn_cast(Ty)) { + const FixedVectorType *PTy2 = cast(Ty2); return PTy->getNumElements() == PTy2->getNumElements() && TypesEqual(PTy->getElementType(), PTy2->getElementType(), EqTypes); } else if (const FunctionType *FTy = dyn_cast(Ty)) { @@ -971,20 +991,20 @@ //===----------------------------------------------------------------------===// -// Packed Type Factory... +// FixedVector Type Factory... // namespace llvm { -class PackedValType { +class FixedVectorValType { const Type *ValTy; unsigned Size; public: - PackedValType(const Type *val, int sz) : ValTy(val), Size(sz) {} + FixedVectorValType(const Type *val, int sz) : ValTy(val), Size(sz) {} - static PackedValType get(const PackedType *PT) { - return PackedValType(PT->getElementType(), PT->getNumElements()); + static FixedVectorValType get(const FixedVectorType *PT) { + return FixedVectorValType(PT->getElementType(), PT->getNumElements()); } - static unsigned hashTypeStructure(const PackedType *PT) { + static unsigned hashTypeStructure(const FixedVectorType *PT) { return PT->getNumElements(); } @@ -994,24 +1014,24 @@ ValTy = NewType; } - inline bool operator<(const PackedValType &MTV) const { + inline bool operator<(const FixedVectorValType &MTV) const { if (Size < MTV.Size) return true; return Size == MTV.Size && ValTy < MTV.ValTy; } }; } -static TypeMap PackedTypes; +static TypeMap FixedVectorTypes; -PackedType *PackedType::get(const Type *ElementType, unsigned NumElements) { - assert(ElementType && "Can't get packed of null types!"); +FixedVectorType *FixedVectorType::get(const Type *ElementType, unsigned NumElements) { + assert(ElementType && "Can't get fixed-length vector of null types!"); - PackedValType PVT(ElementType, NumElements); - PackedType *PT = PackedTypes.get(PVT); + FixedVectorValType PVT(ElementType, NumElements); + FixedVectorType *PT = FixedVectorTypes.get(PVT); if (PT) return PT; // Found a match, return it! // Value not found. Derive a new type! - PackedTypes.add(PVT, PT = new PackedType(ElementType, NumElements)); + FixedVectorTypes.add(PVT, PT = new FixedVectorType(ElementType, NumElements)); #ifdef DEBUG_MERGE_TYPES std::cerr << "Derived new type: " << *PT << "\n"; @@ -1130,6 +1150,102 @@ //===----------------------------------------------------------------------===// +// Vector Type Factory... +// +namespace llvm { +class VectorValType { + const Type *ValTy; +public: + VectorValType(const Type *val) : ValTy(val) {} + + static VectorValType get(const VectorType *AT) { + return VectorValType(AT->getElementType()); + } + + static unsigned hashTypeStructure(const VectorType *AT) { + return AT->getElementType()->getTypeID(); // ??? + } + + // Subclass should override this... to update self as usual + void doRefinement(const DerivedType *OldType, const Type *NewType) { + assert(ValTy == OldType); + ValTy = NewType; + } + + inline bool operator<(const VectorValType &MTV) const { + return ValTy < MTV.ValTy; + } +}; +} + +static TypeMap VectorTypes; + +VectorType *VectorType::get(const Type *ElementType) { + assert(ElementType && "Can't get vector of null types!"); + + VectorValType AVT(ElementType); + VectorType *AT = VectorTypes.get(AVT); + if (AT) return AT; // Found a match, return it! + + // Value not found. Derive a new type! + VectorTypes.add(AVT, AT = new VectorType(ElementType)); + +#ifdef DEBUG_MERGE_TYPES + std::cerr << "Derived new type: " << *AT << "\n"; +#endif + return AT; +} + + +//===----------------------------------------------------------------------===// +// Stream Type Factory... +// +namespace llvm { +class StreamValType { + const Type *ValTy; +public: + StreamValType(const Type *val) : ValTy(val) {} + + static StreamValType get(const StreamType *AT) { + return StreamValType(AT->getElementType()); + } + + static unsigned hashTypeStructure(const StreamType *AT) { + return AT->getElementType()->getTypeID(); // ??? + } + + // Subclass should override this... to update self as usual + void doRefinement(const DerivedType *OldType, const Type *NewType) { + assert(ValTy == OldType); + ValTy = NewType; + } + + inline bool operator<(const StreamValType &MTV) const { + return ValTy < MTV.ValTy; + } +}; +} + +static TypeMap StreamTypes; + +StreamType *StreamType::get(const Type *ElementType) { + assert(ElementType && "Can't get vector of null types!"); + + StreamValType AVT(ElementType); + StreamType *AT = StreamTypes.get(AVT); + if (AT) return AT; // Found a match, return it! + + // Value not found. Derive a new type! + StreamTypes.add(AVT, AT = new StreamType(ElementType)); + +#ifdef DEBUG_MERGE_TYPES + std::cerr << "Derived new type: " << *AT << "\n"; +#endif + return AT; +} + + +//===----------------------------------------------------------------------===// // Derived Type Refinement Functions //===----------------------------------------------------------------------===// @@ -1288,12 +1404,12 @@ // concrete - this could potentially change us from an abstract type to a // concrete type. // -void PackedType::refineAbstractType(const DerivedType *OldType, +void FixedVectorType::refineAbstractType(const DerivedType *OldType, const Type *NewType) { - PackedTypes.finishRefinement(this, OldType, NewType); + FixedVectorTypes.finishRefinement(this, OldType, NewType); } -void PackedType::typeBecameConcrete(const DerivedType *AbsTy) { +void FixedVectorType::typeBecameConcrete(const DerivedType *AbsTy) { refineAbstractType(AbsTy, AbsTy); } @@ -1323,6 +1439,34 @@ refineAbstractType(AbsTy, AbsTy); } +// refineAbstractType - Called when a contained type is found to be more +// concrete - this could potentially change us from an abstract type to a +// concrete type. +// +void VectorType::refineAbstractType(const DerivedType *OldType, + const Type *NewType) { + VectorTypes.finishRefinement(this, OldType, NewType); +} + +void VectorType::typeBecameConcrete(const DerivedType *AbsTy) { + refineAbstractType(AbsTy, AbsTy); +} + + +// refineAbstractType - Called when a contained type is found to be more +// concrete - this could potentially change us from an abstract type to a +// concrete type. +// +void StreamType::refineAbstractType(const DerivedType *OldType, + const Type *NewType) { + StreamTypes.finishRefinement(this, OldType, NewType); +} + +void StreamType::typeBecameConcrete(const DerivedType *AbsTy) { + refineAbstractType(AbsTy, AbsTy); +} + + bool SequentialType::indexValid(const Value *V) const { const Type *Ty = V->getType(); switch (Ty->getTypeID()) { @@ -1361,7 +1505,9 @@ PointerTypes.clear(DerivedTypes); StructTypes.clear(DerivedTypes); ArrayTypes.clear(DerivedTypes); - PackedTypes.clear(DerivedTypes); + StreamTypes.clear(DerivedTypes); + VectorTypes.clear(DerivedTypes); + FixedVectorTypes.clear(DerivedTypes); for(std::vector::iterator I = DerivedTypes.begin(), E = DerivedTypes.end(); I != E; ++I) Index: llvm/lib/VMCore/Verifier.cpp diff -u llvm/lib/VMCore/Verifier.cpp:1.134 llvm/lib/VMCore/Verifier.cpp:1.134.2.1 --- llvm/lib/VMCore/Verifier.cpp:1.134 Sat Jun 18 13:34:52 2005 +++ llvm/lib/VMCore/Verifier.cpp Tue Oct 18 14:21:58 2005 @@ -418,7 +418,8 @@ } void Verifier::visitSelectInst(SelectInst &SI) { - Assert1(SI.getCondition()->getType() == Type::BoolTy, + Assert1(SI.getCondition()->getType() == Type::BoolTy || + SI.getCondition()->getType()->isBooleanVector(), "Select condition type must be bool!", &SI); Assert1(SI.getTrueValue()->getType() == SI.getFalseValue()->getType(), "Select values must have identical types!", &SI); @@ -498,30 +499,36 @@ // Check that logical operators are only used with integral operands. if (B.getOpcode() == Instruction::And || B.getOpcode() == Instruction::Or || B.getOpcode() == Instruction::Xor) { - Assert1(B.getType()->isIntegral(), + Assert1(B.getType()->isIntegral() || + B.getType()->isIntegralVector(), "Logical operators only work with integral types!", &B); Assert1(B.getType() == B.getOperand(0)->getType(), "Logical operators must have same type for operands and result!", &B); } else if (isa(B)) { - // Check that setcc instructions return bool - Assert1(B.getType() == Type::BoolTy, - "setcc instructions must return boolean values!", &B); + // Check that setcc instructions return bool or bool vectors + if (B.getOpcode() < Instruction::VSetEQ) + Assert1(B.getType() == Type::BoolTy, + "setcc instructions must return boolean values!", &B); + else + Assert1(B.getType()->isBooleanVector(), + "vsetcc instructions must return boolean vector values!", &B); } else { // Arithmetic operators only work on integer or fp values Assert1(B.getType() == B.getOperand(0)->getType(), "Arithmetic operators must have same type for operands and result!", &B); - Assert1(B.getType()->isInteger() || B.getType()->isFloatingPoint() || - isa(B.getType()), - "Arithmetic operators must have integer, fp, or packed type!", &B); + Assert1(B.getType()->isInteger() || B.getType()->isFloatingPoint() || + isa(B.getType()), + "Arithmetic operators must have integer, fp, or vector type!", &B); } visitInstruction(B); } void Verifier::visitShiftInst(ShiftInst &SI) { - Assert1(SI.getType()->isInteger(), + Assert1(SI.getType()->isInteger() || + SI.getType()->isIntegerVector(), "Shift must return an integer result!", &SI); Assert1(SI.getType() == SI.getOperand(0)->getType(), "Shift return type must be same as first operand!", &SI); From bocchino at cs.uiuc.edu Tue Oct 18 14:22:23 2005 From: bocchino at cs.uiuc.edu (Robert Bocchino) Date: Tue, 18 Oct 2005 14:22:23 -0500 Subject: [llvm-commits] [vector_llvm] CVS: llvm/lib/Target/CBackend/CTargetMachine.h Writer.cpp Message-ID: <200510181922.OAA13429@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/CBackend: CTargetMachine.h updated: 1.8 -> 1.8.2.1 Writer.cpp updated: 1.245 -> 1.245.2.1 --- Log message: Initial commit of Vector LLVM. --- Diffs of the changes: (+65 -243) CTargetMachine.h | 5 Writer.cpp | 303 +++++++++++-------------------------------------------- 2 files changed, 65 insertions(+), 243 deletions(-) Index: llvm/lib/Target/CBackend/CTargetMachine.h diff -u llvm/lib/Target/CBackend/CTargetMachine.h:1.8 llvm/lib/Target/CBackend/CTargetMachine.h:1.8.2.1 --- llvm/lib/Target/CBackend/CTargetMachine.h:1.8 Thu Sep 1 16:38:20 2005 +++ llvm/lib/Target/CBackend/CTargetMachine.h Tue Oct 18 14:21:57 2005 @@ -20,9 +20,8 @@ class IntrinsicLowering; struct CTargetMachine : public TargetMachine { - CTargetMachine(const Module &M, IntrinsicLowering *IL, - const std::string &FS) : - TargetMachine("CBackend", IL, M) {} + CTargetMachine(const Module &M, IntrinsicLowering *IL, const std::string &name="CBackend") : + TargetMachine(name, IL, M) {} // This is the only thing that actually does anything here. virtual bool addPassesToEmitFile(PassManager &PM, std::ostream &Out, Index: llvm/lib/Target/CBackend/Writer.cpp diff -u llvm/lib/Target/CBackend/Writer.cpp:1.245 llvm/lib/Target/CBackend/Writer.cpp:1.245.2.1 --- llvm/lib/Target/CBackend/Writer.cpp:1.245 Tue Sep 27 15:52:44 2005 +++ llvm/lib/Target/CBackend/Writer.cpp Tue Oct 18 14:21:57 2005 @@ -13,209 +13,13 @@ //===----------------------------------------------------------------------===// #include "CTargetMachine.h" -#include "llvm/Constants.h" -#include "llvm/DerivedTypes.h" -#include "llvm/Module.h" -#include "llvm/Instructions.h" -#include "llvm/Pass.h" -#include "llvm/PassManager.h" -#include "llvm/SymbolTable.h" -#include "llvm/Intrinsics.h" -#include "llvm/Analysis/ConstantsScanner.h" -#include "llvm/Analysis/FindUsedTypes.h" -#include "llvm/Analysis/LoopInfo.h" -#include "llvm/CodeGen/IntrinsicLowering.h" -#include "llvm/Transforms/Scalar.h" -#include "llvm/Target/TargetMachineRegistry.h" -#include "llvm/Support/CallSite.h" -#include "llvm/Support/CFG.h" -#include "llvm/Support/GetElementPtrTypeIterator.h" -#include "llvm/Support/InstVisitor.h" -#include "llvm/Support/Mangler.h" -#include "llvm/Support/MathExtras.h" -#include "llvm/ADT/StringExtras.h" -#include "llvm/ADT/STLExtras.h" -#include "llvm/Support/MathExtras.h" -#include "llvm/Config/config.h" -#include -#include -#include +#include "Writer.h" + using namespace llvm; namespace { // Register the target. RegisterTarget X("c", " C backend"); - - /// NameAllUsedStructs - This pass inserts names for any unnamed structure - /// types that are used by the program. - /// - class CBackendNameAllUsedStructs : public ModulePass { - void getAnalysisUsage(AnalysisUsage &AU) const { - AU.addRequired(); - } - - virtual const char *getPassName() const { - return "C backend type canonicalizer"; - } - - virtual bool runOnModule(Module &M); - }; - - /// CWriter - This class is the main chunk of code that converts an LLVM - /// module to a C translation unit. - class CWriter : public FunctionPass, public InstVisitor { - std::ostream &Out; - IntrinsicLowering &IL; - Mangler *Mang; - LoopInfo *LI; - const Module *TheModule; - std::map TypeNames; - - std::map FPConstantMap; - public: - CWriter(std::ostream &o, IntrinsicLowering &il) : Out(o), IL(il) {} - - virtual const char *getPassName() const { return "C backend"; } - - void getAnalysisUsage(AnalysisUsage &AU) const { - AU.addRequired(); - AU.setPreservesAll(); - } - - virtual bool doInitialization(Module &M); - - bool runOnFunction(Function &F) { - LI = &getAnalysis(); - - // Get rid of intrinsics we can't handle. - lowerIntrinsics(F); - - // Output all floating point constants that cannot be printed accurately. - printFloatingPointConstants(F); - - // Ensure that no local symbols conflict with global symbols. - F.renameLocalSymbols(); - - printFunction(F); - FPConstantMap.clear(); - return false; - } - - virtual bool doFinalization(Module &M) { - // Free memory... - delete Mang; - TypeNames.clear(); - return false; - } - - std::ostream &printType(std::ostream &Out, const Type *Ty, - const std::string &VariableName = "", - bool IgnoreName = false); - - void writeOperand(Value *Operand); - void writeOperandInternal(Value *Operand); - - private : - void lowerIntrinsics(Function &F); - - bool nameAllUsedStructureTypes(Module &M); - void printModule(Module *M); - void printModuleTypes(const SymbolTable &ST); - void printContainedStructs(const Type *Ty, std::set &); - void printFloatingPointConstants(Function &F); - void printFunctionSignature(const Function *F, bool Prototype); - - void printFunction(Function &); - void printBasicBlock(BasicBlock *BB); - void printLoop(Loop *L); - - void printConstant(Constant *CPV); - void printConstantArray(ConstantArray *CPA); - - // isInlinableInst - Attempt to inline instructions into their uses to build - // trees as much as possible. To do this, we have to consistently decide - // what is acceptable to inline, so that variable declarations don't get - // printed and an extra copy of the expr is not emitted. - // - static bool isInlinableInst(const Instruction &I) { - // Always inline setcc instructions, even if they are shared by multiple - // expressions. GCC generates horrible code if we don't. - if (isa(I)) return true; - - // Must be an expression, must be used exactly once. If it is dead, we - // emit it inline where it would go. - if (I.getType() == Type::VoidTy || !I.hasOneUse() || - isa(I) || isa(I) || isa(I) || - isa(I) || isa(I)) - // Don't inline a load across a store or other bad things! - return false; - - // Only inline instruction it it's use is in the same BB as the inst. - return I.getParent() == cast(I.use_back())->getParent(); - } - - // isDirectAlloca - Define fixed sized allocas in the entry block as direct - // variables which are accessed with the & operator. This causes GCC to - // generate significantly better code than to emit alloca calls directly. - // - static const AllocaInst *isDirectAlloca(const Value *V) { - const AllocaInst *AI = dyn_cast(V); - if (!AI) return false; - if (AI->isArrayAllocation()) - return 0; // FIXME: we can also inline fixed size array allocas! - if (AI->getParent() != &AI->getParent()->getParent()->getEntryBlock()) - return 0; - return AI; - } - - // Instruction visitation functions - friend class InstVisitor; - - void visitReturnInst(ReturnInst &I); - void visitBranchInst(BranchInst &I); - void visitSwitchInst(SwitchInst &I); - void visitInvokeInst(InvokeInst &I) { - assert(0 && "Lowerinvoke pass didn't work!"); - } - - void visitUnwindInst(UnwindInst &I) { - assert(0 && "Lowerinvoke pass didn't work!"); - } - void visitUnreachableInst(UnreachableInst &I); - - void visitPHINode(PHINode &I); - void visitBinaryOperator(Instruction &I); - - void visitCastInst (CastInst &I); - void visitSelectInst(SelectInst &I); - void visitCallInst (CallInst &I); - void visitShiftInst(ShiftInst &I) { visitBinaryOperator(I); } - - void visitMallocInst(MallocInst &I); - void visitAllocaInst(AllocaInst &I); - void visitFreeInst (FreeInst &I); - void visitLoadInst (LoadInst &I); - void visitStoreInst (StoreInst &I); - void visitGetElementPtrInst(GetElementPtrInst &I); - void visitVAArgInst (VAArgInst &I); - - void visitInstruction(Instruction &I) { - std::cerr << "C Writer does not know about " << I; - abort(); - } - - void outputLValue(Instruction *I) { - Out << " " << Mang->getValueName(I) << " = "; - } - - bool isGotoCodeNecessary(BasicBlock *From, BasicBlock *To); - void printPHICopiesForSuccessor(BasicBlock *CurBlock, - BasicBlock *Successor, unsigned Indent); - void printBranchToBlock(BasicBlock *CurBlock, BasicBlock *SuccBlock, - unsigned Indent); - void printIndexingExpression(Value *Ptr, gep_type_iterator I, - gep_type_iterator E); - }; } /// This method inserts names for any unnamed structure types that are used by @@ -342,6 +146,16 @@ NameSoFar + "[" + utostr(NumElements) + "]"); } + case Type::FixedVectorTyID: { + return printFixedVectorType(Out, cast(Ty), + NameSoFar); + } + + case Type::VectorTyID: { + return printVectorType(Out, cast(Ty), + NameSoFar); + } + case Type::OpaqueTyID: { static int Count = 0; std::string TyName = "struct opaque_" + itostr(Count++); @@ -586,10 +400,14 @@ const unsigned long SignalNaN = 0x7ff4UL; // We need to grab the first part of the FP # + union { + double d; + uint64_t ll; + } DHex; char Buffer[100]; - uint64_t ll = DoubleToBits(FPC->getValue()); - sprintf(Buffer, "0x%llx", (unsigned long long)ll); + DHex.d = FPC->getValue(); + sprintf(Buffer, "0x%llx", (unsigned long long)DHex.ll); std::string Num(&Buffer[0], &Buffer[6]); unsigned long Val = strtoul(Num.c_str(), 0, 16); @@ -684,6 +502,10 @@ } } +void CWriter::writeValueName(Value *V) { + Out << Mang->getValueName(V); +} + void CWriter::writeOperandInternal(Value *Operand) { if (Instruction *I = dyn_cast(Operand)) if (isInlinableInst(*I) && !isDirectAlloca(I)) { @@ -698,7 +520,7 @@ if (CPV && !isa(CPV)) { printConstant(CPV); } else { - Out << Mang->getValueName(Operand); + writeValueName(Operand); //Out << Mang->getValueName(Operand); } } @@ -826,6 +648,12 @@ } +bool CWriter::printDeclarationFor(Function *F) { + return !F->getIntrinsicID() && + F->getName() != "setjmp" && F->getName() != "longjmp" && + F->getName() != "memcpy"; +} + bool CWriter::doInitialization(Module &M) { // Initialize TheModule = &M; @@ -871,15 +699,11 @@ } // Function declarations - Out << "double fmod(double, double);\n"; // Support for FP rem - Out << "float fmodf(float, float);\n"; - if (!M.empty()) { Out << "\n/* Function Declarations */\n"; for (Module::iterator I = M.begin(), E = M.end(); I != E; ++I) { // Don't print declarations for intrinsic functions. - if (!I->getIntrinsicID() && - I->getName() != "setjmp" && I->getName() != "longjmp") { + if (printDeclarationFor(I)) { printFunctionSignature(I, true); if (I->hasWeakLinkage()) Out << " __ATTRIBUTE_WEAK__"; if (I->hasLinkOnceLinkage()) Out << " __ATTRIBUTE_WEAK__"; @@ -953,6 +777,16 @@ /// Output all floating point constants that cannot be printed accurately... void CWriter::printFloatingPointConstants(Function &F) { + union { + double D; + uint64_t U; + } DBLUnion; + + union { + float F; + unsigned U; + } FLTUnion; + // Scan the module for floating point constants. If any FP constant is used // in the function, we want to redirect it here so that we do not depend on // the precision of the printed form, unless the printed form preserves @@ -969,12 +803,14 @@ FPConstantMap[FPC] = FPCounter; // Number the FP constants if (FPC->getType() == Type::DoubleTy) { + DBLUnion.D = Val; Out << "static const ConstantDoubleTy FPConstant" << FPCounter++ - << " = 0x" << std::hex << DoubleToBits(Val) << std::dec + << " = 0x" << std::hex << DBLUnion.U << std::dec << "ULL; /* " << Val << " */\n"; } else if (FPC->getType() == Type::FloatTy) { + FLTUnion.F = Val; Out << "static const ConstantFloatTy FPConstant" << FPCounter++ - << " = 0x" << std::hex << FloatToBits(Val) << std::dec + << " = 0x" << std::hex << FLTUnion.U << std::dec << "U; /* " << Val << " */\n"; } else assert(0 && "Unknown float type!"); @@ -985,7 +821,7 @@ /// printSymbolTable - Run through symbol table looking for type names. If a -/// type name is found, emit it's declaration... +/// type name is found, emit its declaration... /// void CWriter::printModuleTypes(const SymbolTable &ST) { // We are only interested in the type plane of the symbol table. @@ -1349,20 +1185,9 @@ // If this is a negation operation, print it out as such. For FP, we don't // want to print "-0.0 - X". if (BinaryOperator::isNeg(&I)) { - Out << "-("; + Out << "-"; writeOperand(BinaryOperator::getNegArgument(cast(&I))); - Out << ")"; - } else if (I.getOpcode() == Instruction::Rem && - I.getType()->isFloatingPoint()) { - // Output a call to fmod/fmodf instead of emitting a%b - if (I.getType() == Type::FloatTy) - Out << "fmodf("; - else - Out << "fmod("; - writeOperand(I.getOperand(0)); - Out << ", "; - writeOperand(I.getOperand(1)); - Out << ")"; + } else { writeOperand(I.getOperand(0)); @@ -1409,7 +1234,6 @@ // Avoid "cast to pointer from integer of different size" warnings Out << "(long)"; } - writeOperand(I.getOperand(0)); } @@ -1467,10 +1291,7 @@ case Intrinsic::vastart: Out << "0; "; - // Out << "va_start(*(va_list*)&" << Mang->getValueName(&I) << ", "; - Out << "va_start(*(va_list*)"; - writeOperand(I.getOperand(1)); - Out << ", "; + Out << "va_start(*(va_list*)&" << Mang->getValueName(&I) << ", "; // Output the last argument to the enclosing function... if (I.getParent()->getParent()->arg_empty()) { std::cerr << "The C backend does not currently support zero " @@ -1483,7 +1304,7 @@ return; case Intrinsic::vaend: if (!isa(I.getOperand(1))) { - Out << "0; va_end(*(va_list*)"; + Out << "va_end(*(va_list*)&"; writeOperand(I.getOperand(1)); Out << ')'; } else { @@ -1491,11 +1312,10 @@ } return; case Intrinsic::vacopy: - Out << "0; "; - Out << "va_copy(*(va_list*)"; + Out << "0;"; + Out << "va_copy(*(va_list*)&" << Mang->getValueName(&I) << ", "; + Out << "*(va_list*)&"; writeOperand(I.getOperand(1)); - Out << ", *(va_list*)"; - writeOperand(I.getOperand(2)); Out << ')'; return; case Intrinsic::returnaddress: @@ -1683,8 +1503,8 @@ Out << '*'; if (I.isVolatile()) { Out << "(("; - printType(Out, I.getType(), "volatile*"); - Out << ")"; + printType(Out, I.getType()); + Out << " volatile*)"; } writeOperand(I.getOperand(0)); @@ -1697,8 +1517,8 @@ Out << '*'; if (I.isVolatile()) { Out << "(("; - printType(Out, I.getOperand(0)->getType(), " volatile*"); - Out << ")"; + printType(Out, I.getOperand(0)->getType()); + Out << " volatile*)"; } writeOperand(I.getPointerOperand()); if (I.isVolatile()) Out << ')'; @@ -1713,11 +1533,12 @@ } void CWriter::visitVAArgInst(VAArgInst &I) { - Out << "va_arg(*(va_list*)"; + Out << "0;\n"; + Out << "{ va_list Tmp; va_copy(Tmp, *(va_list*)&"; writeOperand(I.getOperand(0)); - Out << ", "; + Out << ");\n " << Mang->getValueName(&I) << " = va_arg(Tmp, "; printType(Out, I.getType()); - Out << ");\n "; + Out << ");\n va_end(Tmp); }"; } //===----------------------------------------------------------------------===// @@ -1725,7 +1546,7 @@ //===----------------------------------------------------------------------===// bool CTargetMachine::addPassesToEmitFile(PassManager &PM, std::ostream &o, - CodeGenFileType FileType) { + CodeGenFileType FileType) { if (FileType != TargetMachine::AssemblyFile) return true; PM.add(createLowerGCPass()); @@ -1735,3 +1556,5 @@ PM.add(new CWriter(o, getIntrinsicLowering())); return false; } + +// vim: sw=2 From bocchino at cs.uiuc.edu Tue Oct 18 14:22:23 2005 From: bocchino at cs.uiuc.edu (Robert Bocchino) Date: Tue, 18 Oct 2005 14:22:23 -0500 Subject: [llvm-commits] [vector_llvm] CVS: llvm/lib/AsmParser/Lexer.cpp Lexer.l llvmAsmParser.cpp llvmAsmParser.h llvmAsmParser.y Message-ID: <200510181922.OAA13459@zion.cs.uiuc.edu> Changes in directory llvm/lib/AsmParser: Lexer.cpp updated: 1.10 -> 1.10.2.1 Lexer.l updated: 1.64 -> 1.64.2.1 llvmAsmParser.cpp updated: 1.17 -> 1.17.2.1 llvmAsmParser.h updated: 1.9 -> 1.9.2.1 llvmAsmParser.y updated: 1.231 -> 1.231.2.1 --- Log message: Initial commit of Vector LLVM. --- Diffs of the changes: (+3157 -3350) Lexer.cpp | 1151 +++++++----- Lexer.l | 19 llvmAsmParser.cpp | 4799 ++++++++++++++++++++++++------------------------------ llvmAsmParser.h | 341 +-- llvmAsmParser.y | 197 +- 5 files changed, 3157 insertions(+), 3350 deletions(-) Index: llvm/lib/AsmParser/Lexer.cpp diff -u llvm/lib/AsmParser/Lexer.cpp:1.10 llvm/lib/AsmParser/Lexer.cpp:1.10.2.1 --- llvm/lib/AsmParser/Lexer.cpp:1.10 Sat Aug 27 13:50:38 2005 +++ llvm/lib/AsmParser/Lexer.cpp Tue Oct 18 14:21:56 2005 @@ -20,7 +20,7 @@ /* A lexical scanner generated by flex */ /* Scanner skeleton version: - * $Header: /home/vadve/shared/PublicCVS/llvm/lib/AsmParser/Lexer.cpp,v 1.10 2005/08/27 18:50:38 reid Exp $ + * $Header: /home/vadve/shared/PublicCVS/llvm/lib/AsmParser/Lexer.cpp,v 1.10.2.1 2005/10/18 19:21:56 bocchino Exp $ */ #define FLEX_SCANNER @@ -28,7 +28,6 @@ #define YY_FLEX_MINOR_VERSION 5 #include -#include /* cfront 1.2 defines "c_plusplus" instead of "__cplusplus" */ @@ -42,6 +41,7 @@ #ifdef __cplusplus #include +#include /* Use prototypes in function declarations. */ #define YY_USE_PROTOS @@ -308,32 +308,35 @@ *yy_cp = '\0'; \ yy_c_buf_p = yy_cp; -#define YY_NUM_RULES 99 -#define YY_END_OF_BUFFER 100 -static yyconst short int yy_acclist[177] = +#define YY_NUM_RULES 116 +#define YY_END_OF_BUFFER 117 +static yyconst short int yy_acclist[194] = { 0, - 100, 98, 99, 97, 98, 99, 97, 99, 98, 99, - 98, 99, 98, 99, 98, 99, 98, 99, 98, 99, - 90, 98, 99, 90, 98, 99, 1, 98, 99, 98, - 99, 98, 99, 98, 99, 98, 99, 98, 99, 98, - 99, 98, 99, 98, 99, 98, 99, 98, 99, 98, - 99, 98, 99, 98, 99, 98, 99, 98, 99, 98, - 99, 98, 99, 98, 99, 98, 99, 98, 99, 98, - 99, 89, 87, 86, 86, 93, 91, 95, 90, 1, - 75, 32, 57, 20, 89, 86, 86, 94, 95, 17, - 95, 96, 51, 56, 30, 33, 54, 3, 42, 53, - - 22, 65, 55, 74, 69, 70, 52, 58, 88, 95, - 95, 37, 66, 67, 82, 83, 44, 19, 92, 23, - 4, 49, 43, 36, 11, 95, 2, 5, 46, 48, - 38, 60, 64, 62, 63, 61, 59, 40, 84, 39, - 45, 18, 72, 81, 35, 47, 27, 21, 34, 7, - 77, 29, 80, 50, 68, 76, 24, 25, 78, 41, - 73, 71, 6, 26, 8, 14, 9, 10, 31, 12, - 28, 79, 85, 13, 15, 16 + 117, 115, 116, 114, 115, 116, 114, 116, 115, 116, + 115, 116, 115, 116, 115, 116, 115, 116, 115, 116, + 107, 115, 116, 107, 115, 116, 1, 115, 116, 115, + 116, 115, 116, 115, 116, 115, 116, 115, 116, 115, + 116, 115, 116, 115, 116, 115, 116, 115, 116, 115, + 116, 115, 116, 115, 116, 115, 116, 115, 116, 115, + 116, 115, 116, 115, 116, 115, 116, 115, 116, 115, + 116, 106, 104, 103, 103, 110, 108, 112, 107, 1, + 83, 33, 102, 58, 20, 106, 103, 103, 111, 112, + 17, 112, 113, 52, 57, 30, 34, 55, 3, 43, + + 54, 22, 72, 56, 82, 77, 78, 53, 59, 105, + 112, 112, 38, 73, 74, 90, 91, 45, 19, 109, + 23, 4, 50, 44, 95, 37, 11, 112, 2, 5, + 32, 47, 49, 39, 61, 65, 63, 64, 62, 60, + 41, 92, 40, 46, 18, 80, 89, 36, 48, 27, + 21, 35, 7, 85, 29, 88, 51, 75, 84, 24, + 25, 86, 42, 81, 79, 101, 67, 71, 69, 70, + 68, 66, 99, 6, 26, 97, 94, 76, 8, 14, + 9, 10, 31, 96, 12, 28, 87, 93, 13, 100, + 98, 15, 16 + } ; -static yyconst short int yy_accept[398] = +static yyconst short int yy_accept[463] = { 0, 1, 1, 1, 2, 4, 7, 9, 11, 13, 15, 17, 19, 21, 24, 27, 30, 32, 34, 36, 38, @@ -343,42 +346,49 @@ 81, 81, 81, 81, 81, 81, 81, 81, 82, 82, 83, 83, 83, 83, 83, 83, 83, 83, 83, 83, 83, 83, 83, 83, 83, 83, 83, 83, 83, 83, - 83, 83, 84, 84, 84, 84, 84, 84, 84, 84, - 84, 84, 84, 84, 85, 85, 85, 85, 85, 85, - - 85, 85, 85, 85, 85, 85, 85, 86, 87, 89, - 90, 91, 92, 92, 93, 94, 94, 95, 95, 95, - 96, 96, 96, 96, 97, 97, 97, 97, 97, 98, - 98, 99, 99, 99, 99, 99, 99, 99, 99, 99, - 99, 100, 100, 100, 100, 100, 100, 100, 100, 101, - 102, 102, 102, 103, 103, 104, 105, 105, 105, 105, - 105, 106, 106, 107, 107, 108, 108, 108, 108, 108, - 108, 108, 108, 108, 108, 108, 108, 108, 108, 108, - 108, 108, 108, 108, 108, 108, 109, 109, 110, 111, - 111, 111, 111, 112, 112, 112, 112, 113, 114, 115, - - 115, 115, 115, 115, 115, 115, 115, 115, 115, 115, - 115, 116, 116, 116, 116, 116, 116, 116, 116, 116, - 117, 118, 118, 119, 119, 119, 120, 120, 120, 120, - 120, 120, 120, 120, 120, 120, 121, 121, 121, 122, - 123, 123, 124, 124, 124, 124, 124, 124, 124, 124, - 124, 124, 125, 125, 126, 126, 127, 127, 127, 128, - 128, 128, 128, 128, 128, 128, 128, 128, 129, 129, - 130, 130, 130, 130, 130, 130, 131, 131, 131, 131, - 131, 131, 132, 132, 133, 134, 135, 136, 137, 138, - 139, 140, 140, 140, 140, 141, 142, 143, 143, 143, - - 143, 143, 143, 144, 144, 144, 144, 145, 145, 146, - 146, 146, 146, 147, 148, 149, 149, 150, 150, 151, - 151, 151, 152, 152, 153, 154, 155, 155, 156, 157, - 158, 159, 159, 159, 160, 161, 162, 163, 163, 163, - 163, 163, 164, 165, 165, 165, 165, 165, 165, 165, - 165, 165, 165, 165, 165, 166, 167, 167, 167, 168, - 169, 169, 169, 169, 170, 170, 171, 171, 171, 171, - 171, 171, 171, 171, 171, 171, 171, 171, 171, 171, - 171, 172, 172, 173, 173, 173, 173, 173, 173, 174, - 174, 175, 175, 176, 176, 177, 177 + 83, 83, 84, 84, 85, 85, 85, 85, 85, 85, + 85, 85, 85, 85, 85, 85, 86, 86, 86, 86, + 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, + 86, 86, 86, 87, 88, 90, 91, 92, 93, 93, + 94, 95, 95, 96, 96, 96, 97, 97, 97, 97, + 98, 98, 98, 98, 98, 98, 99, 99, 100, 100, + 100, 100, 100, 100, 100, 100, 100, 100, 100, 101, + 101, 101, 101, 101, 101, 101, 101, 102, 103, 103, + 103, 104, 104, 105, 106, 106, 106, 106, 106, 107, + 107, 108, 108, 109, 109, 109, 109, 109, 109, 109, + 109, 109, 109, 109, 109, 109, 109, 109, 109, 109, + 109, 109, 109, 109, 109, 109, 109, 109, 109, 110, + + 110, 111, 112, 112, 112, 112, 113, 113, 113, 113, + 114, 115, 116, 116, 116, 116, 116, 116, 116, 116, + 116, 116, 116, 116, 116, 116, 116, 117, 117, 117, + 117, 117, 117, 117, 117, 117, 118, 119, 119, 120, + 120, 120, 121, 121, 121, 121, 121, 121, 121, 121, + 121, 121, 122, 122, 122, 123, 124, 124, 125, 125, + 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, + 126, 127, 127, 127, 127, 127, 128, 128, 129, 129, + 129, 130, 130, 130, 130, 130, 130, 130, 130, 130, + 130, 130, 131, 131, 132, 133, 133, 133, 133, 133, + + 133, 134, 134, 134, 134, 134, 134, 135, 135, 136, + 137, 138, 139, 140, 141, 142, 143, 143, 143, 143, + 144, 145, 146, 146, 146, 146, 146, 146, 147, 147, + 147, 147, 147, 147, 147, 147, 147, 147, 147, 147, + 148, 148, 149, 149, 149, 149, 149, 150, 151, 152, + 152, 152, 153, 153, 154, 154, 154, 155, 155, 156, + 157, 158, 158, 159, 160, 161, 162, 162, 162, 163, + 164, 165, 166, 167, 167, 167, 167, 167, 168, 169, + 170, 171, 172, 173, 173, 173, 174, 174, 175, 176, + 176, 177, 177, 177, 177, 177, 177, 177, 177, 178, + + 178, 178, 179, 179, 179, 179, 180, 181, 181, 181, + 181, 182, 183, 183, 183, 183, 184, 185, 185, 186, + 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, + 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, + 187, 187, 188, 188, 188, 188, 188, 188, 188, 188, + 188, 188, 189, 189, 190, 190, 191, 192, 193, 193, + 194, 194 } ; static yyconst int yy_ec[256] = @@ -422,205 +432,232 @@ 3 } ; -static yyconst short int yy_base[402] = +static yyconst short int yy_base[467] = { 0, - 0, 0, 834, 835, 835, 835, 829, 820, 34, 36, + 0, 0, 964, 965, 965, 965, 959, 950, 34, 36, 38, 42, 46, 50, 0, 51, 54, 53, 56, 61, 76, 77, 79, 80, 82, 83, 84, 90, 31, 111, - 94, 140, 113, 55, 110, 116, 827, 835, 818, 835, - 0, 128, 131, 144, 150, 124, 160, 167, 172, 0, - 136, 89, 168, 100, 41, 145, 114, 817, 139, 183, - 184, 185, 173, 186, 187, 189, 191, 133, 188, 193, - 200, 202, 194, 203, 205, 215, 208, 211, 207, 214, - 57, 816, 224, 225, 227, 231, 233, 234, 241, 235, - 236, 239, 247, 815, 251, 244, 245, 248, 254, 266, - - 255, 276, 269, 278, 270, 277, 814, 0, 287, 291, - 813, 303, 309, 0, 812, 295, 811, 288, 310, 810, - 296, 299, 315, 809, 316, 317, 318, 319, 808, 240, - 322, 320, 321, 325, 326, 327, 328, 331, 336, 341, - 343, 344, 345, 346, 348, 350, 353, 351, 807, 806, - 355, 357, 805, 359, 804, 803, 380, 361, 363, 391, - 802, 373, 801, 374, 800, 369, 365, 393, 396, 398, - 401, 397, 399, 409, 403, 411, 405, 368, 413, 416, - 417, 418, 367, 419, 423, 799, 425, 835, 431, 437, - 443, 446, 449, 450, 439, 451, 798, 797, 796, 452, - - 453, 455, 454, 458, 461, 462, 463, 465, 464, 469, - 795, 470, 472, 478, 475, 479, 480, 482, 483, 794, - 793, 486, 792, 488, 490, 0, 494, 499, 489, 501, - 502, 505, 497, 507, 508, 791, 517, 518, 790, 789, - 519, 788, 521, 527, 522, 529, 523, 530, 531, 536, - 538, 787, 539, 786, 541, 544, 544, 545, 785, 548, - 556, 546, 557, 550, 558, 560, 564, 784, 566, 783, - 568, 569, 570, 571, 576, 782, 572, 578, 590, 582, - 592, 781, 579, 780, 779, 778, 777, 776, 775, 774, - 773, 593, 580, 595, 772, 771, 770, 594, 599, 600, - - 596, 598, 769, 607, 610, 611, 768, 612, 767, 614, - 613, 615, 766, 765, 764, 616, 763, 618, 762, 620, - 627, 761, 626, 760, 759, 758, 624, 757, 756, 755, - 754, 635, 638, 753, 752, 749, 739, 636, 639, 640, - 641, 738, 737, 643, 644, 642, 646, 647, 649, 655, - 662, 654, 665, 666, 736, 735, 668, 669, 734, 733, - 670, 672, 673, 732, 676, 731, 674, 675, 678, 681, - 684, 686, 682, 690, 693, 695, 696, 700, 698, 703, - 730, 708, 728, 706, 704, 709, 710, 711, 726, 712, - 722, 714, 574, 720, 491, 835, 753, 755, 280, 759, - - 161 + 110, 141, 164, 55, 100, 104, 957, 965, 948, 965, + 0, 123, 126, 145, 151, 119, 162, 181, 189, 0, + 132, 99, 145, 127, 41, 155, 112, 947, 152, 126, + 168, 193, 176, 190, 202, 204, 203, 205, 206, 207, + 136, 208, 209, 213, 215, 217, 230, 157, 222, 219, + 229, 946, 57, 945, 220, 239, 241, 223, 231, 243, + 253, 245, 248, 249, 256, 944, 260, 246, 251, 255, + + 267, 270, 275, 276, 282, 290, 286, 288, 297, 294, + 292, 298, 943, 0, 309, 311, 942, 318, 330, 0, + 941, 305, 940, 315, 322, 939, 331, 332, 311, 938, + 333, 336, 337, 338, 339, 937, 343, 344, 351, 352, + 340, 345, 355, 358, 356, 366, 370, 367, 369, 371, + 372, 374, 377, 379, 380, 383, 936, 935, 384, 385, + 934, 386, 933, 932, 408, 396, 392, 412, 931, 404, + 930, 409, 929, 397, 393, 422, 424, 426, 428, 431, + 432, 434, 436, 439, 438, 440, 441, 390, 442, 448, + 444, 446, 449, 394, 461, 468, 460, 450, 928, 452, + + 965, 473, 482, 486, 488, 491, 492, 462, 493, 927, + 926, 925, 494, 495, 474, 498, 496, 500, 502, 504, + 505, 506, 512, 513, 514, 516, 924, 517, 519, 518, + 525, 528, 529, 530, 534, 923, 922, 533, 921, 531, + 535, 0, 536, 540, 537, 541, 543, 553, 538, 554, + 560, 920, 556, 559, 919, 918, 568, 917, 569, 571, + 570, 573, 572, 575, 576, 579, 582, 584, 300, 916, + 915, 585, 587, 586, 603, 914, 588, 593, 593, 599, + 913, 604, 600, 616, 594, 613, 622, 606, 605, 624, + 625, 912, 626, 911, 910, 627, 629, 630, 634, 638, + + 909, 635, 639, 642, 645, 650, 908, 637, 907, 906, + 905, 904, 903, 902, 901, 900, 643, 640, 653, 899, + 898, 897, 656, 657, 658, 661, 665, 896, 667, 668, + 669, 670, 671, 673, 672, 677, 682, 687, 681, 895, + 675, 894, 693, 695, 697, 685, 893, 892, 891, 699, + 701, 890, 703, 889, 708, 709, 888, 711, 887, 886, + 885, 710, 884, 883, 882, 881, 713, 715, 880, 879, + 878, 877, 876, 716, 720, 721, 722, 875, 874, 873, + 872, 871, 870, 723, 725, 729, 728, 867, 858, 732, + 734, 739, 733, 740, 744, 741, 749, 752, 857, 756, + + 746, 853, 758, 759, 760, 852, 851, 761, 762, 764, + 849, 848, 769, 768, 766, 845, 843, 771, 842, 777, + 780, 773, 785, 774, 778, 792, 788, 794, 795, 797, + 798, 799, 800, 804, 802, 805, 806, 801, 809, 841, + 818, 840, 812, 819, 820, 823, 828, 826, 830, 831, + 832, 839, 833, 674, 838, 458, 350, 348, 835, 261, + 965, 871, 873, 179, 877, 138 } ; -static yyconst short int yy_def[402] = +static yyconst short int yy_def[467] = { 0, - 396, 1, 396, 396, 396, 396, 397, 398, 399, 396, - 398, 398, 398, 398, 400, 398, 398, 398, 398, 398, - 398, 398, 398, 398, 398, 398, 398, 398, 398, 398, - 398, 398, 398, 398, 398, 398, 397, 396, 398, 396, - 401, 401, 396, 396, 398, 398, 398, 398, 398, 400, - 398, 398, 398, 398, 398, 398, 398, 398, 398, 398, - 398, 398, 398, 398, 398, 398, 398, 398, 398, 398, - 398, 398, 398, 398, 398, 398, 398, 398, 398, 398, - 398, 398, 398, 398, 398, 398, 398, 398, 398, 398, - 398, 398, 398, 398, 398, 398, 398, 398, 398, 398, - - 398, 398, 398, 398, 398, 398, 396, 401, 401, 396, - 398, 398, 398, 49, 398, 398, 398, 398, 398, 398, - 398, 398, 398, 398, 398, 398, 398, 398, 398, 398, - 398, 398, 398, 398, 398, 398, 398, 398, 398, 398, - 398, 398, 398, 398, 398, 398, 398, 398, 398, 398, - 398, 398, 398, 398, 398, 398, 49, 398, 398, 398, - 398, 398, 398, 398, 398, 398, 398, 398, 398, 398, - 398, 398, 398, 398, 398, 398, 398, 398, 398, 398, - 398, 398, 398, 398, 398, 398, 398, 396, 396, 396, - 396, 398, 398, 398, 398, 398, 398, 398, 398, 398, - - 398, 398, 398, 398, 398, 398, 398, 398, 398, 398, - 398, 398, 398, 398, 398, 398, 398, 398, 398, 398, - 398, 398, 398, 398, 398, 157, 398, 398, 398, 398, - 398, 398, 398, 398, 398, 398, 398, 398, 398, 398, - 398, 398, 398, 398, 398, 398, 398, 398, 398, 398, - 398, 398, 398, 398, 398, 396, 398, 398, 398, 398, - 398, 398, 398, 398, 398, 398, 398, 398, 398, 398, - 398, 398, 398, 398, 398, 398, 398, 398, 398, 398, - 398, 398, 398, 398, 398, 398, 398, 398, 398, 398, - 398, 398, 398, 398, 398, 398, 398, 398, 398, 398, - - 398, 398, 398, 398, 398, 398, 398, 398, 398, 398, - 398, 398, 398, 398, 398, 398, 398, 398, 398, 398, - 398, 398, 398, 398, 398, 398, 398, 398, 398, 398, - 398, 398, 398, 398, 398, 398, 398, 398, 398, 398, - 398, 398, 398, 398, 398, 398, 398, 398, 398, 398, - 398, 398, 398, 398, 398, 398, 398, 398, 398, 398, - 398, 398, 398, 398, 398, 398, 398, 398, 398, 398, - 398, 398, 398, 398, 398, 398, 398, 398, 398, 398, - 398, 398, 398, 398, 398, 398, 398, 398, 398, 398, - 398, 398, 398, 398, 398, 0, 396, 396, 396, 396, - - 396 + 461, 1, 461, 461, 461, 461, 462, 463, 464, 461, + 463, 463, 463, 463, 465, 463, 463, 463, 463, 463, + 463, 463, 463, 463, 463, 463, 463, 463, 463, 463, + 463, 463, 463, 463, 463, 463, 462, 461, 463, 461, + 466, 466, 461, 461, 463, 463, 463, 463, 463, 465, + 463, 463, 463, 463, 463, 463, 463, 463, 463, 463, + 463, 463, 463, 463, 463, 463, 463, 463, 463, 463, + 463, 463, 463, 463, 463, 463, 463, 463, 463, 463, + 463, 463, 463, 463, 463, 463, 463, 463, 463, 463, + 463, 463, 463, 463, 463, 463, 463, 463, 463, 463, + + 463, 463, 463, 463, 463, 463, 463, 463, 463, 463, + 463, 463, 461, 466, 466, 461, 463, 463, 463, 49, + 463, 463, 463, 463, 463, 463, 463, 463, 463, 463, + 463, 463, 463, 463, 463, 463, 463, 463, 463, 463, + 463, 463, 463, 463, 463, 463, 463, 463, 463, 463, + 463, 463, 463, 463, 463, 463, 463, 463, 463, 463, + 463, 463, 463, 463, 49, 463, 463, 463, 463, 463, + 463, 463, 463, 463, 463, 463, 463, 463, 463, 463, + 463, 463, 463, 463, 463, 463, 463, 463, 463, 463, + 463, 463, 463, 463, 463, 463, 463, 463, 463, 463, + + 461, 461, 461, 461, 463, 463, 463, 463, 463, 463, + 463, 463, 463, 463, 463, 463, 463, 463, 463, 463, + 463, 463, 463, 463, 463, 463, 463, 463, 463, 463, + 463, 463, 463, 463, 463, 463, 463, 463, 463, 463, + 463, 165, 463, 463, 463, 463, 463, 463, 463, 463, + 463, 463, 463, 463, 463, 463, 463, 463, 463, 463, + 463, 463, 463, 463, 463, 463, 463, 463, 463, 463, + 463, 463, 463, 463, 463, 463, 463, 461, 463, 463, + 463, 463, 463, 463, 463, 463, 463, 463, 463, 463, + 463, 463, 463, 463, 463, 463, 463, 463, 463, 463, + + 463, 463, 463, 463, 463, 463, 463, 463, 463, 463, + 463, 463, 463, 463, 463, 463, 463, 463, 463, 463, + 463, 463, 463, 463, 463, 463, 463, 463, 463, 463, + 463, 463, 463, 463, 463, 463, 463, 463, 463, 463, + 463, 463, 463, 463, 463, 463, 463, 463, 463, 463, + 463, 463, 463, 463, 463, 463, 463, 463, 463, 463, + 463, 463, 463, 463, 463, 463, 463, 463, 463, 463, + 463, 463, 463, 463, 463, 463, 463, 463, 463, 463, + 463, 463, 463, 463, 463, 463, 463, 463, 463, 463, + 463, 463, 463, 463, 463, 463, 463, 463, 463, 463, + + 463, 463, 463, 463, 463, 463, 463, 463, 463, 463, + 463, 463, 463, 463, 463, 463, 463, 463, 463, 463, + 463, 463, 463, 463, 463, 463, 463, 463, 463, 463, + 463, 463, 463, 463, 463, 463, 463, 463, 463, 463, + 463, 463, 463, 463, 463, 463, 463, 463, 463, 463, + 463, 463, 463, 463, 463, 463, 463, 463, 463, 463, + 0, 461, 461, 461, 461, 461 } ; -static yyconst short int yy_nxt[877] = +static yyconst short int yy_nxt[1007] = { 0, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 4, 15, 8, 8, 8, 16, 17, 18, 19, 20, 21, 22, 8, 23, 8, 24, 25, 26, 27, 28, 8, 29, 30, 31, 32, 33, 34, 35, 8, 36, 42, 40, 43, 43, 44, 44, 45, 45, 40, - 46, 85, 40, 40, 47, 48, 48, 40, 47, 48, - 48, 40, 40, 119, 40, 40, 40, 40, 40, 59, - 51, 60, 40, 152, 55, 104, 62, 52, 56, 53, + 46, 87, 40, 40, 47, 48, 48, 40, 47, 48, + 48, 40, 40, 125, 40, 40, 40, 40, 40, 59, + 51, 60, 40, 160, 55, 110, 62, 52, 56, 53, 63, 54, 61, 57, 49, 64, 58, 40, 40, 65, - 40, 40, 67, 40, 40, 40, 74, 70, 77, 66, + 40, 40, 67, 40, 40, 40, 75, 71, 78, 66, + + 68, 40, 69, 72, 76, 82, 73, 74, 70, 77, + 40, 40, 80, 85, 83, 40, 84, 79, 81, 86, + 88, 40, 40, 40, 112, 122, 95, 117, 89, 111, + 40, 90, 115, 115, 91, 43, 43, 40, 40, 96, + 114, 127, 97, 40, 130, 92, 93, 40, 94, 98, + 88, 121, 40, 116, 44, 44, 40, 124, 99, 47, + 45, 45, 40, 40, 123, 100, 40, 101, 40, 102, + 146, 118, 118, 40, 103, 40, 119, 126, 128, 40, + 104, 41, 119, 156, 105, 129, 106, 40, 107, 47, + 48, 48, 40, 108, 131, 132, 133, 109, 120, 120, + + 40, 40, 120, 120, 40, 120, 120, 120, 120, 120, + 120, 134, 136, 40, 40, 40, 40, 40, 40, 40, + 40, 138, 139, 135, 40, 137, 40, 145, 40, 141, + 40, 40, 151, 40, 40, 144, 142, 147, 140, 148, + 40, 40, 40, 143, 161, 152, 154, 149, 157, 150, + 40, 153, 40, 158, 40, 159, 40, 40, 155, 40, + 40, 165, 40, 162, 40, 173, 40, 40, 163, 167, + 166, 40, 40, 174, 172, 164, 179, 168, 40, 169, + 175, 40, 170, 181, 177, 171, 40, 40, 176, 183, + 180, 188, 189, 40, 184, 178, 182, 40, 187, 40, + + 191, 40, 185, 40, 190, 40, 192, 186, 40, 40, + 198, 40, 194, 193, 195, 196, 40, 197, 115, 115, + 202, 202, 40, 331, 199, 203, 40, 118, 118, 40, + 200, 203, 119, 40, 207, 208, 204, 205, 119, 206, + 206, 40, 40, 40, 40, 212, 209, 40, 40, 40, + 40, 40, 213, 214, 40, 40, 40, 210, 211, 40, + 218, 40, 40, 40, 216, 217, 40, 40, 219, 40, + 215, 220, 221, 223, 226, 225, 227, 40, 40, 224, + 40, 40, 40, 40, 222, 40, 228, 229, 40, 231, + 40, 40, 233, 230, 40, 40, 40, 40, 236, 234, + + 232, 40, 237, 40, 40, 40, 265, 40, 40, 238, + 239, 235, 244, 271, 241, 40, 240, 242, 242, 252, + 40, 242, 242, 40, 242, 242, 242, 242, 242, 242, + 243, 251, 245, 40, 246, 40, 249, 40, 247, 40, + 248, 250, 40, 40, 253, 40, 255, 40, 256, 40, + 40, 40, 40, 40, 254, 40, 260, 40, 262, 40, + 40, 40, 259, 40, 263, 257, 258, 261, 267, 40, + 264, 40, 40, 40, 266, 276, 270, 272, 268, 40, + 269, 277, 202, 202, 273, 40, 274, 203, 204, 204, + 280, 278, 278, 203, 275, 278, 278, 206, 206, 40, + + 206, 206, 40, 40, 40, 40, 40, 40, 284, 40, + 279, 40, 282, 40, 285, 40, 40, 40, 288, 283, + 286, 281, 291, 40, 40, 40, 287, 40, 40, 40, + 40, 293, 292, 294, 289, 297, 40, 290, 298, 40, + 40, 40, 40, 296, 40, 40, 40, 40, 40, 40, + 295, 40, 40, 300, 40, 301, 307, 299, 308, 302, + 303, 310, 304, 312, 40, 40, 305, 40, 309, 306, + 40, 40, 315, 314, 316, 311, 318, 313, 317, 40, + 40, 40, 40, 40, 40, 319, 40, 40, 320, 324, + 40, 321, 322, 40, 323, 40, 40, 40, 40, 40, + + 325, 328, 278, 278, 40, 40, 334, 326, 327, 340, + 40, 40, 339, 330, 40, 40, 40, 40, 341, 332, + 329, 333, 342, 335, 40, 336, 345, 40, 343, 337, + 346, 338, 344, 40, 348, 40, 40, 40, 40, 349, + 40, 40, 347, 351, 352, 40, 40, 353, 40, 40, + 40, 40, 350, 40, 40, 354, 40, 355, 357, 359, + 360, 40, 356, 358, 40, 361, 364, 40, 40, 40, + 362, 363, 40, 366, 365, 368, 40, 369, 40, 40, + 40, 40, 40, 40, 40, 40, 40, 371, 40, 374, + 367, 377, 40, 40, 375, 370, 40, 379, 40, 385, + + 373, 372, 381, 378, 40, 376, 40, 383, 40, 384, + 40, 380, 40, 386, 40, 390, 382, 388, 389, 40, + 40, 40, 40, 387, 40, 394, 40, 40, 393, 395, + 392, 40, 40, 40, 40, 391, 40, 397, 398, 40, + 40, 401, 396, 40, 40, 40, 400, 403, 399, 405, + 40, 40, 40, 404, 408, 40, 402, 40, 407, 409, + 40, 410, 406, 40, 412, 414, 411, 40, 415, 40, + 40, 40, 40, 40, 413, 40, 416, 40, 417, 40, + 40, 419, 40, 426, 40, 40, 420, 421, 40, 40, + 422, 40, 418, 424, 425, 427, 40, 428, 423, 40, + + 429, 431, 433, 40, 435, 40, 40, 430, 40, 40, + 40, 40, 40, 40, 432, 40, 40, 40, 434, 440, + 40, 436, 437, 40, 442, 444, 445, 438, 443, 40, + 40, 40, 439, 447, 40, 446, 449, 40, 448, 40, + 441, 40, 40, 40, 40, 454, 40, 450, 451, 40, + 40, 40, 40, 40, 40, 452, 40, 453, 459, 40, + 40, 458, 40, 40, 40, 456, 457, 460, 40, 40, + 455, 37, 37, 37, 37, 39, 39, 50, 40, 50, + 50, 40, 40, 40, 40, 40, 40, 40, 40, 40, + 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, - 40, 40, 68, 71, 75, 40, 72, 73, 69, 76, - 93, 40, 79, 83, 81, 116, 82, 78, 80, 84, - 86, 40, 40, 94, 40, 40, 95, 40, 87, 102, - 118, 88, 111, 96, 89, 40, 106, 109, 109, 105, - 43, 43, 103, 121, 40, 90, 91, 40, 92, 86, - 40, 40, 110, 44, 44, 115, 40, 97, 47, 45, - 45, 40, 136, 108, 98, 122, 99, 120, 100, 112, - 112, 40, 123, 101, 113, 47, 48, 48, 40, 40, - 113, 114, 114, 40, 40, 114, 114, 117, 114, 114, - 114, 114, 114, 114, 40, 40, 40, 40, 40, 40, - - 40, 124, 40, 127, 40, 40, 131, 132, 137, 129, - 125, 40, 126, 40, 40, 128, 40, 134, 40, 40, - 143, 130, 40, 133, 135, 40, 40, 138, 141, 139, - 142, 146, 140, 144, 148, 40, 40, 149, 40, 145, - 151, 150, 40, 147, 40, 40, 40, 40, 153, 154, - 40, 40, 40, 165, 155, 40, 40, 204, 40, 40, - 159, 156, 40, 166, 164, 40, 40, 161, 160, 157, - 162, 167, 158, 163, 171, 169, 173, 40, 179, 168, - 40, 40, 41, 174, 172, 175, 170, 40, 40, 40, - 176, 180, 181, 183, 185, 184, 109, 109, 177, 40, - - 189, 189, 186, 178, 182, 190, 40, 40, 195, 187, - 40, 190, 112, 112, 40, 191, 192, 113, 193, 193, - 40, 40, 197, 113, 194, 198, 40, 40, 40, 40, - 40, 40, 40, 40, 196, 200, 40, 40, 40, 40, - 206, 207, 40, 210, 202, 203, 205, 40, 211, 199, - 201, 212, 40, 213, 40, 40, 40, 40, 208, 40, - 209, 40, 40, 215, 40, 217, 40, 214, 40, 220, - 40, 218, 40, 216, 40, 221, 40, 222, 40, 40, - 40, 223, 219, 228, 40, 40, 252, 225, 224, 226, - 226, 236, 247, 226, 226, 227, 226, 226, 226, 226, - - 226, 226, 40, 235, 40, 233, 234, 40, 40, 40, - 40, 229, 40, 230, 40, 237, 40, 231, 239, 232, - 40, 240, 40, 244, 40, 246, 238, 40, 40, 40, - 40, 241, 249, 242, 40, 253, 40, 243, 251, 245, - 189, 189, 248, 191, 191, 190, 256, 256, 254, 250, - 40, 190, 256, 256, 255, 193, 193, 40, 193, 193, - 40, 40, 40, 40, 40, 40, 40, 258, 257, 40, - 260, 262, 40, 40, 40, 40, 40, 265, 263, 259, - 40, 40, 269, 40, 264, 268, 40, 261, 272, 40, - 40, 40, 266, 40, 40, 267, 271, 40, 273, 40, - - 40, 40, 40, 270, 275, 40, 276, 274, 40, 278, - 40, 277, 40, 40, 282, 279, 40, 283, 40, 40, - 284, 285, 287, 280, 281, 289, 292, 291, 40, 40, - 40, 290, 40, 40, 40, 286, 288, 293, 40, 295, - 40, 40, 40, 296, 294, 299, 298, 40, 297, 40, - 40, 300, 40, 256, 256, 40, 40, 40, 303, 40, - 307, 40, 301, 302, 308, 306, 309, 40, 40, 40, - 313, 40, 310, 305, 312, 40, 304, 40, 311, 40, - 40, 40, 40, 40, 317, 40, 314, 40, 318, 40, - 40, 40, 316, 40, 315, 319, 322, 320, 324, 321, - - 323, 40, 326, 40, 40, 40, 40, 40, 325, 40, - 40, 40, 327, 328, 330, 331, 329, 333, 40, 334, - 336, 40, 40, 40, 40, 40, 40, 40, 332, 40, - 335, 40, 344, 342, 338, 40, 340, 40, 40, 339, - 346, 337, 341, 347, 348, 345, 40, 40, 343, 40, - 40, 40, 40, 40, 40, 40, 349, 40, 40, 350, - 40, 351, 352, 353, 357, 40, 40, 360, 354, 356, - 358, 362, 359, 40, 364, 355, 40, 40, 363, 40, - 40, 40, 361, 40, 40, 40, 40, 40, 366, 40, - 371, 374, 40, 40, 369, 40, 367, 40, 370, 365, - - 372, 40, 378, 368, 40, 376, 40, 40, 373, 40, - 377, 40, 379, 381, 40, 40, 383, 40, 375, 40, - 40, 40, 40, 40, 380, 40, 384, 386, 387, 391, - 388, 40, 385, 40, 394, 382, 389, 40, 390, 40, - 393, 40, 40, 40, 40, 40, 40, 40, 40, 40, - 40, 392, 395, 37, 37, 37, 37, 39, 39, 50, - 40, 50, 50, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, - 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, - 40, 40, 40, 40, 40, 188, 40, 40, 40, 40, - 107, 40, 38, 396, 3, 396, 396, 396, 396, 396, - 396, 396, 396, 396, 396, 396, 396, 396, 396, 396, - 396, 396, 396, 396, 396, 396, 396, 396, 396, 396, - 396, 396, 396, 396, 396, 396, 396, 396, 396, 396, - 396, 396, 396, 396, 396, 396 + 40, 40, 40, 40, 201, 40, 40, 40, 40, 40, + 113, 40, 38, 461, 3, 461, 461, 461, 461, 461, + 461, 461, 461, 461, 461, 461, 461, 461, 461, 461, + 461, 461, 461, 461, 461, 461, 461, 461, 461, 461, + 461, 461, 461, 461, 461, 461, 461, 461, 461, 461, + + 461, 461, 461, 461, 461, 461 } ; -static yyconst short int yy_chk[877] = +static yyconst short int yy_chk[1007] = { 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, @@ -628,96 +665,111 @@ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 9, 29, 9, 9, 10, 10, 11, 11, 11, 12, 29, 55, 12, 13, 13, 13, 13, 14, 14, - 14, 14, 16, 55, 18, 17, 34, 19, 81, 18, - 16, 18, 20, 81, 17, 34, 19, 16, 17, 16, + 14, 14, 16, 55, 18, 17, 34, 19, 83, 18, + 16, 18, 20, 83, 17, 34, 19, 16, 17, 16, 19, 16, 18, 17, 13, 19, 17, 21, 22, 20, 23, 24, 21, 25, 26, 27, 24, 22, 25, 20, - 52, 28, 21, 22, 24, 31, 23, 23, 21, 24, - 31, 54, 26, 28, 27, 52, 27, 25, 26, 28, - 30, 35, 30, 31, 33, 57, 31, 36, 30, 33, - 54, 30, 46, 31, 30, 46, 36, 42, 42, 35, - 43, 43, 33, 57, 68, 30, 30, 51, 30, 32, - 59, 32, 44, 44, 44, 51, 56, 32, 45, 45, - 45, 45, 68, 401, 32, 59, 32, 56, 32, 47, - 47, 47, 59, 32, 47, 48, 48, 48, 48, 53, - 47, 49, 49, 49, 63, 49, 49, 53, 49, 49, - 49, 49, 49, 49, 60, 61, 62, 64, 65, 69, - - 66, 60, 67, 62, 70, 73, 65, 66, 69, 63, - 61, 71, 61, 72, 74, 62, 75, 67, 79, 77, - 74, 64, 78, 66, 67, 80, 76, 70, 73, 71, - 73, 76, 72, 75, 77, 83, 84, 78, 85, 75, - 80, 79, 86, 76, 87, 88, 90, 91, 83, 84, - 92, 130, 89, 91, 85, 96, 97, 130, 93, 98, - 88, 85, 95, 92, 90, 99, 101, 89, 88, 86, - 89, 93, 87, 89, 96, 95, 98, 100, 101, 93, - 103, 105, 399, 99, 97, 100, 95, 102, 106, 104, - 100, 102, 102, 103, 104, 103, 109, 109, 100, 118, - - 110, 110, 105, 100, 102, 110, 116, 121, 118, 106, - 122, 110, 112, 112, 112, 113, 113, 112, 113, 113, - 113, 119, 121, 112, 116, 122, 123, 125, 126, 127, - 128, 132, 133, 131, 119, 125, 134, 135, 136, 137, - 132, 133, 138, 136, 127, 128, 131, 139, 137, 123, - 126, 138, 140, 139, 141, 142, 143, 144, 134, 145, - 135, 146, 148, 141, 147, 143, 151, 140, 152, 146, - 154, 144, 158, 142, 159, 147, 167, 148, 183, 178, - 166, 151, 145, 159, 162, 164, 183, 154, 152, 157, - 157, 167, 178, 157, 157, 158, 157, 157, 157, 157, - - 157, 157, 160, 166, 168, 162, 164, 169, 172, 170, - 173, 160, 171, 160, 175, 168, 177, 160, 170, 160, - 174, 171, 176, 175, 179, 177, 169, 180, 181, 182, - 184, 172, 180, 173, 185, 184, 187, 174, 182, 176, - 189, 189, 179, 190, 190, 189, 190, 190, 185, 181, - 195, 189, 191, 191, 187, 192, 192, 192, 193, 193, - 193, 194, 196, 200, 201, 203, 202, 195, 194, 204, - 200, 202, 205, 206, 207, 209, 208, 205, 203, 196, - 210, 212, 209, 213, 204, 208, 215, 201, 213, 214, - 216, 217, 206, 218, 219, 207, 212, 222, 214, 224, - - 229, 225, 395, 210, 216, 227, 217, 215, 233, 219, - 228, 218, 230, 231, 227, 222, 232, 228, 234, 235, - 229, 230, 231, 224, 225, 232, 235, 234, 237, 238, - 241, 233, 243, 245, 247, 230, 231, 237, 244, 241, - 246, 248, 249, 243, 238, 246, 245, 250, 244, 251, - 253, 247, 255, 256, 256, 257, 258, 262, 250, 260, - 257, 264, 248, 249, 258, 255, 260, 261, 263, 265, - 264, 266, 261, 253, 263, 267, 251, 269, 262, 271, - 272, 273, 274, 277, 269, 393, 265, 275, 271, 278, - 283, 293, 267, 280, 266, 272, 275, 273, 278, 274, - - 277, 279, 280, 281, 292, 298, 294, 301, 279, 302, - 299, 300, 281, 283, 293, 294, 292, 299, 304, 300, - 302, 305, 306, 308, 311, 310, 312, 316, 298, 318, - 301, 320, 316, 311, 305, 327, 308, 323, 321, 306, - 320, 304, 310, 321, 323, 318, 332, 338, 312, 333, - 339, 340, 341, 346, 344, 345, 327, 347, 348, 332, - 349, 333, 338, 339, 345, 352, 350, 348, 340, 344, - 346, 350, 347, 351, 352, 341, 353, 354, 351, 357, - 358, 361, 349, 362, 363, 367, 368, 365, 354, 369, - 363, 368, 370, 373, 361, 371, 357, 372, 362, 353, - - 365, 374, 372, 358, 375, 370, 376, 377, 367, 379, - 371, 378, 373, 375, 380, 385, 377, 384, 369, 382, - 386, 387, 388, 390, 374, 392, 378, 380, 382, 387, - 384, 394, 379, 391, 392, 376, 385, 389, 386, 383, - 390, 381, 366, 364, 360, 359, 356, 355, 343, 342, - 337, 388, 394, 397, 397, 397, 397, 398, 398, 400, - 336, 400, 400, 335, 334, 331, 330, 329, 328, 326, - 325, 324, 322, 319, 317, 315, 314, 313, 309, 307, - 303, 297, 296, 295, 291, 290, 289, 288, 287, 286, - 285, 284, 282, 276, 270, 268, 259, 254, 252, 242, - - 240, 239, 236, 223, 221, 220, 211, 199, 198, 197, - 186, 165, 163, 161, 156, 155, 153, 150, 149, 129, - 124, 120, 117, 115, 111, 107, 94, 82, 58, 39, - 37, 8, 7, 3, 396, 396, 396, 396, 396, 396, - 396, 396, 396, 396, 396, 396, 396, 396, 396, 396, - 396, 396, 396, 396, 396, 396, 396, 396, 396, 396, - 396, 396, 396, 396, 396, 396, 396, 396, 396, 396, - 396, 396, 396, 396, 396, 396 + 21, 28, 21, 22, 24, 27, 23, 23, 21, 24, + 52, 35, 26, 28, 27, 36, 27, 25, 26, 28, + 30, 31, 30, 57, 36, 52, 31, 46, 30, 35, + 46, 30, 42, 42, 30, 43, 43, 60, 54, 31, + 466, 57, 31, 51, 60, 30, 30, 71, 30, 31, + 32, 51, 32, 44, 44, 44, 53, 54, 32, 45, + 45, 45, 45, 59, 53, 32, 56, 32, 78, 32, + 71, 47, 47, 47, 32, 33, 47, 56, 59, 61, + 33, 464, 47, 78, 33, 59, 33, 63, 33, 48, + 48, 48, 48, 33, 61, 61, 61, 33, 49, 49, + + 49, 64, 49, 49, 62, 49, 49, 49, 49, 49, + 49, 62, 63, 65, 67, 66, 68, 69, 70, 72, + 73, 65, 66, 62, 74, 64, 75, 70, 76, 67, + 80, 85, 75, 79, 88, 69, 67, 72, 66, 73, + 81, 77, 89, 68, 85, 76, 77, 74, 79, 74, + 86, 76, 87, 80, 90, 81, 92, 98, 77, 93, + 94, 88, 99, 86, 91, 93, 100, 95, 87, 90, + 89, 97, 460, 94, 92, 87, 98, 90, 101, 91, + 95, 102, 91, 100, 97, 91, 103, 104, 95, 102, + 99, 104, 104, 105, 102, 97, 101, 107, 103, 108, + + 105, 106, 102, 111, 104, 110, 106, 102, 109, 112, + 110, 269, 108, 107, 108, 109, 122, 109, 115, 115, + 116, 116, 129, 269, 111, 116, 124, 118, 118, 118, + 112, 116, 118, 125, 122, 124, 119, 119, 118, 119, + 119, 119, 127, 128, 131, 129, 125, 132, 133, 134, + 135, 141, 131, 132, 137, 138, 142, 127, 128, 458, + 137, 457, 139, 140, 134, 135, 143, 145, 138, 144, + 133, 139, 140, 141, 144, 143, 145, 146, 148, 142, + 149, 147, 150, 151, 140, 152, 146, 147, 153, 149, + 154, 155, 151, 148, 156, 159, 160, 162, 154, 152, + + 150, 188, 155, 167, 175, 194, 188, 166, 174, 156, + 159, 153, 167, 194, 162, 170, 160, 165, 165, 175, + 172, 165, 165, 168, 165, 165, 165, 165, 165, 165, + 166, 174, 168, 176, 168, 177, 170, 178, 168, 179, + 168, 172, 180, 181, 176, 182, 178, 183, 179, 185, + 184, 186, 187, 189, 177, 191, 183, 192, 185, 190, + 193, 198, 182, 200, 186, 180, 181, 184, 190, 456, + 187, 197, 195, 208, 189, 198, 193, 195, 191, 196, + 192, 200, 202, 202, 196, 215, 197, 202, 203, 203, + 208, 203, 203, 202, 197, 204, 204, 205, 205, 205, + + 206, 206, 206, 207, 209, 213, 214, 217, 215, 216, + 207, 218, 213, 219, 216, 220, 221, 222, 219, 214, + 217, 209, 222, 223, 224, 225, 218, 226, 228, 230, + 229, 224, 223, 225, 220, 229, 231, 221, 230, 232, + 233, 234, 240, 228, 238, 235, 241, 243, 245, 249, + 226, 244, 246, 232, 247, 233, 243, 231, 244, 234, + 235, 246, 238, 247, 248, 250, 240, 253, 245, 241, + 254, 251, 249, 248, 250, 246, 253, 247, 251, 257, + 259, 261, 260, 263, 262, 254, 264, 265, 257, 262, + 266, 259, 260, 267, 261, 268, 272, 274, 273, 277, + + 263, 266, 278, 278, 279, 285, 274, 264, 265, 279, + 280, 283, 277, 268, 275, 282, 289, 288, 280, 272, + 267, 273, 282, 275, 286, 275, 285, 284, 283, 275, + 286, 275, 284, 287, 288, 290, 291, 293, 296, 289, + 297, 298, 287, 291, 293, 299, 302, 296, 308, 300, + 303, 318, 290, 304, 317, 297, 305, 298, 300, 303, + 304, 306, 299, 302, 319, 305, 317, 323, 324, 325, + 306, 308, 326, 319, 318, 324, 327, 325, 329, 330, + 331, 332, 333, 335, 334, 454, 341, 327, 336, 331, + 323, 334, 339, 337, 332, 326, 346, 336, 338, 341, + + 330, 329, 337, 335, 343, 333, 344, 338, 345, 339, + 350, 336, 351, 343, 353, 350, 337, 345, 346, 355, + 356, 362, 358, 344, 367, 356, 368, 374, 355, 358, + 353, 375, 376, 377, 384, 351, 385, 367, 368, 387, + 386, 376, 362, 390, 393, 391, 375, 384, 374, 386, + 392, 394, 396, 385, 391, 395, 377, 401, 390, 392, + 397, 393, 387, 398, 395, 397, 394, 400, 398, 403, + 404, 405, 408, 409, 396, 410, 400, 415, 401, 414, + 413, 404, 418, 415, 422, 424, 405, 408, 420, 425, + 409, 421, 403, 413, 414, 418, 423, 420, 410, 427, + + 421, 423, 425, 426, 427, 428, 429, 422, 430, 431, + 432, 433, 438, 435, 424, 434, 436, 437, 426, 432, + 439, 428, 429, 443, 434, 436, 437, 430, 435, 441, + 444, 445, 431, 439, 446, 438, 443, 448, 441, 447, + 433, 449, 450, 451, 453, 448, 459, 444, 445, 455, + 452, 442, 440, 419, 417, 446, 416, 447, 455, 412, + 411, 453, 407, 406, 402, 450, 451, 459, 399, 389, + 449, 462, 462, 462, 462, 463, 463, 465, 388, 465, + 465, 383, 382, 381, 380, 379, 378, 373, 372, 371, + 370, 369, 366, 365, 364, 363, 361, 360, 359, 357, + + 354, 352, 349, 348, 347, 342, 340, 328, 322, 321, + 320, 316, 315, 314, 313, 312, 311, 310, 309, 307, + 301, 295, 294, 292, 281, 276, 271, 270, 258, 256, + 255, 252, 239, 237, 236, 227, 212, 211, 210, 199, + 173, 171, 169, 164, 163, 161, 158, 157, 136, 130, + 126, 123, 121, 117, 113, 96, 84, 82, 58, 39, + 37, 8, 7, 3, 461, 461, 461, 461, 461, 461, + 461, 461, 461, 461, 461, 461, 461, 461, 461, 461, + 461, 461, 461, 461, 461, 461, 461, 461, 461, 461, + 461, 461, 461, 461, 461, 461, 461, 461, 461, 461, + + 461, 461, 461, 461, 461, 461 } ; static yy_state_type yy_state_buf[YY_BUF_SIZE + 2], *yy_state_ptr; @@ -734,7 +786,7 @@ #define YY_MORE_ADJ 0 #define YY_RESTORE_YY_MORE_OFFSET char *yytext; -#line 1 "/proj/llvm/build/../llvm/lib/AsmParser/Lexer.l" +#line 1 "/Users/bocchino/llvm/obj/../src/lib/AsmParser/Lexer.l" #define INITIAL 0 /*===-- Lexer.l - Scanner for llvm assembly files --------------*- C++ -*--===// // @@ -749,7 +801,7 @@ // //===----------------------------------------------------------------------===*/ #define YY_NEVER_INTERACTIVE 1 -#line 28 "/proj/llvm/build/../llvm/lib/AsmParser/Lexer.l" +#line 28 "/Users/bocchino/llvm/obj/../src/lib/AsmParser/Lexer.l" #include "ParserInternals.h" #include "llvm/Module.h" #include @@ -875,7 +927,7 @@ /* HexIntConstant - Hexadecimal constant generated by the CFE to avoid forcing * it to deal with 64 bit numbers. */ -#line 879 "Lexer.cpp" +#line 931 "Lexer.cpp" /* Macros after this point can all be overridden by user definitions in * section 1. @@ -1023,13 +1075,13 @@ YY_DECL { register yy_state_type yy_current_state; - register char *yy_cp = NULL, *yy_bp = NULL; + register char *yy_cp, *yy_bp; register int yy_act; -#line 179 "/proj/llvm/build/../llvm/lib/AsmParser/Lexer.l" +#line 179 "/Users/bocchino/llvm/obj/../src/lib/AsmParser/Lexer.l" -#line 1033 "Lexer.cpp" +#line 1085 "Lexer.cpp" if ( yy_init ) { @@ -1077,14 +1129,14 @@ while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) { yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 397 ) + if ( yy_current_state >= 462 ) yy_c = yy_meta[(unsigned int) yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; *yy_state_ptr++ = yy_current_state; ++yy_cp; } - while ( yy_current_state != 396 ); + while ( yy_current_state != 461 ); yy_find_action: yy_current_state = *--yy_state_ptr; @@ -1122,441 +1174,526 @@ { /* beginning of action switch */ case 1: YY_RULE_SETUP -#line 181 "/proj/llvm/build/../llvm/lib/AsmParser/Lexer.l" +#line 181 "/Users/bocchino/llvm/obj/../src/lib/AsmParser/Lexer.l" { /* Ignore comments for now */ } YY_BREAK case 2: YY_RULE_SETUP -#line 183 "/proj/llvm/build/../llvm/lib/AsmParser/Lexer.l" +#line 183 "/Users/bocchino/llvm/obj/../src/lib/AsmParser/Lexer.l" { return BEGINTOK; } YY_BREAK case 3: YY_RULE_SETUP -#line 184 "/proj/llvm/build/../llvm/lib/AsmParser/Lexer.l" +#line 184 "/Users/bocchino/llvm/obj/../src/lib/AsmParser/Lexer.l" { return ENDTOK; } YY_BREAK case 4: YY_RULE_SETUP -#line 185 "/proj/llvm/build/../llvm/lib/AsmParser/Lexer.l" +#line 185 "/Users/bocchino/llvm/obj/../src/lib/AsmParser/Lexer.l" { return TRUETOK; } YY_BREAK case 5: YY_RULE_SETUP -#line 186 "/proj/llvm/build/../llvm/lib/AsmParser/Lexer.l" +#line 186 "/Users/bocchino/llvm/obj/../src/lib/AsmParser/Lexer.l" { return FALSETOK; } YY_BREAK case 6: YY_RULE_SETUP -#line 187 "/proj/llvm/build/../llvm/lib/AsmParser/Lexer.l" +#line 187 "/Users/bocchino/llvm/obj/../src/lib/AsmParser/Lexer.l" { return DECLARE; } YY_BREAK case 7: YY_RULE_SETUP -#line 188 "/proj/llvm/build/../llvm/lib/AsmParser/Lexer.l" +#line 188 "/Users/bocchino/llvm/obj/../src/lib/AsmParser/Lexer.l" { return GLOBAL; } YY_BREAK case 8: YY_RULE_SETUP -#line 189 "/proj/llvm/build/../llvm/lib/AsmParser/Lexer.l" +#line 189 "/Users/bocchino/llvm/obj/../src/lib/AsmParser/Lexer.l" { return CONSTANT; } YY_BREAK case 9: YY_RULE_SETUP -#line 190 "/proj/llvm/build/../llvm/lib/AsmParser/Lexer.l" +#line 190 "/Users/bocchino/llvm/obj/../src/lib/AsmParser/Lexer.l" { return INTERNAL; } YY_BREAK case 10: YY_RULE_SETUP -#line 191 "/proj/llvm/build/../llvm/lib/AsmParser/Lexer.l" +#line 191 "/Users/bocchino/llvm/obj/../src/lib/AsmParser/Lexer.l" { return LINKONCE; } YY_BREAK case 11: YY_RULE_SETUP -#line 192 "/proj/llvm/build/../llvm/lib/AsmParser/Lexer.l" +#line 192 "/Users/bocchino/llvm/obj/../src/lib/AsmParser/Lexer.l" { return WEAK; } YY_BREAK case 12: YY_RULE_SETUP -#line 193 "/proj/llvm/build/../llvm/lib/AsmParser/Lexer.l" +#line 193 "/Users/bocchino/llvm/obj/../src/lib/AsmParser/Lexer.l" { return APPENDING; } YY_BREAK case 13: YY_RULE_SETUP -#line 194 "/proj/llvm/build/../llvm/lib/AsmParser/Lexer.l" +#line 194 "/Users/bocchino/llvm/obj/../src/lib/AsmParser/Lexer.l" { return EXTERNAL; } /* Deprecated, turn into external */ YY_BREAK case 14: YY_RULE_SETUP -#line 195 "/proj/llvm/build/../llvm/lib/AsmParser/Lexer.l" +#line 195 "/Users/bocchino/llvm/obj/../src/lib/AsmParser/Lexer.l" { return EXTERNAL; } YY_BREAK case 15: YY_RULE_SETUP -#line 196 "/proj/llvm/build/../llvm/lib/AsmParser/Lexer.l" +#line 196 "/Users/bocchino/llvm/obj/../src/lib/AsmParser/Lexer.l" { return IMPLEMENTATION; } YY_BREAK case 16: YY_RULE_SETUP -#line 197 "/proj/llvm/build/../llvm/lib/AsmParser/Lexer.l" +#line 197 "/Users/bocchino/llvm/obj/../src/lib/AsmParser/Lexer.l" { return ZEROINITIALIZER; } YY_BREAK case 17: YY_RULE_SETUP -#line 198 "/proj/llvm/build/../llvm/lib/AsmParser/Lexer.l" +#line 198 "/Users/bocchino/llvm/obj/../src/lib/AsmParser/Lexer.l" { return DOTDOTDOT; } YY_BREAK case 18: YY_RULE_SETUP -#line 199 "/proj/llvm/build/../llvm/lib/AsmParser/Lexer.l" +#line 199 "/Users/bocchino/llvm/obj/../src/lib/AsmParser/Lexer.l" { return UNDEF; } YY_BREAK case 19: YY_RULE_SETUP -#line 200 "/proj/llvm/build/../llvm/lib/AsmParser/Lexer.l" +#line 200 "/Users/bocchino/llvm/obj/../src/lib/AsmParser/Lexer.l" { return NULL_TOK; } YY_BREAK case 20: YY_RULE_SETUP -#line 201 "/proj/llvm/build/../llvm/lib/AsmParser/Lexer.l" +#line 201 "/Users/bocchino/llvm/obj/../src/lib/AsmParser/Lexer.l" { return TO; } YY_BREAK case 21: YY_RULE_SETUP -#line 202 "/proj/llvm/build/../llvm/lib/AsmParser/Lexer.l" +#line 202 "/Users/bocchino/llvm/obj/../src/lib/AsmParser/Lexer.l" { RET_TOK(TermOpVal, Unwind, UNWIND); } YY_BREAK case 22: YY_RULE_SETUP -#line 203 "/proj/llvm/build/../llvm/lib/AsmParser/Lexer.l" +#line 203 "/Users/bocchino/llvm/obj/../src/lib/AsmParser/Lexer.l" { return NOT; } /* Deprecated, turned into XOR */ YY_BREAK case 23: YY_RULE_SETUP -#line 204 "/proj/llvm/build/../llvm/lib/AsmParser/Lexer.l" +#line 204 "/Users/bocchino/llvm/obj/../src/lib/AsmParser/Lexer.l" { return TAIL; } YY_BREAK case 24: YY_RULE_SETUP -#line 205 "/proj/llvm/build/../llvm/lib/AsmParser/Lexer.l" +#line 205 "/Users/bocchino/llvm/obj/../src/lib/AsmParser/Lexer.l" { return TARGET; } YY_BREAK case 25: YY_RULE_SETUP -#line 206 "/proj/llvm/build/../llvm/lib/AsmParser/Lexer.l" +#line 206 "/Users/bocchino/llvm/obj/../src/lib/AsmParser/Lexer.l" { return TRIPLE; } YY_BREAK case 26: YY_RULE_SETUP -#line 207 "/proj/llvm/build/../llvm/lib/AsmParser/Lexer.l" +#line 207 "/Users/bocchino/llvm/obj/../src/lib/AsmParser/Lexer.l" { return DEPLIBS; } YY_BREAK case 27: YY_RULE_SETUP -#line 208 "/proj/llvm/build/../llvm/lib/AsmParser/Lexer.l" +#line 208 "/Users/bocchino/llvm/obj/../src/lib/AsmParser/Lexer.l" { return ENDIAN; } YY_BREAK case 28: YY_RULE_SETUP -#line 209 "/proj/llvm/build/../llvm/lib/AsmParser/Lexer.l" +#line 209 "/Users/bocchino/llvm/obj/../src/lib/AsmParser/Lexer.l" { return POINTERSIZE; } YY_BREAK case 29: YY_RULE_SETUP -#line 210 "/proj/llvm/build/../llvm/lib/AsmParser/Lexer.l" +#line 210 "/Users/bocchino/llvm/obj/../src/lib/AsmParser/Lexer.l" { return LITTLE; } YY_BREAK case 30: YY_RULE_SETUP -#line 211 "/proj/llvm/build/../llvm/lib/AsmParser/Lexer.l" +#line 211 "/Users/bocchino/llvm/obj/../src/lib/AsmParser/Lexer.l" { return BIG; } YY_BREAK case 31: YY_RULE_SETUP -#line 212 "/proj/llvm/build/../llvm/lib/AsmParser/Lexer.l" +#line 212 "/Users/bocchino/llvm/obj/../src/lib/AsmParser/Lexer.l" { return VOLATILE; } YY_BREAK case 32: YY_RULE_SETUP -#line 214 "/proj/llvm/build/../llvm/lib/AsmParser/Lexer.l" -{ return CC_TOK; } +#line 213 "/Users/bocchino/llvm/obj/../src/lib/AsmParser/Lexer.l" +{ return FIXED; } YY_BREAK case 33: YY_RULE_SETUP -#line 215 "/proj/llvm/build/../llvm/lib/AsmParser/Lexer.l" -{ return CCC_TOK; } +#line 215 "/Users/bocchino/llvm/obj/../src/lib/AsmParser/Lexer.l" +{ return CC_TOK; } YY_BREAK case 34: YY_RULE_SETUP -#line 216 "/proj/llvm/build/../llvm/lib/AsmParser/Lexer.l" -{ return FASTCC_TOK; } +#line 216 "/Users/bocchino/llvm/obj/../src/lib/AsmParser/Lexer.l" +{ return CCC_TOK; } YY_BREAK case 35: YY_RULE_SETUP -#line 217 "/proj/llvm/build/../llvm/lib/AsmParser/Lexer.l" -{ return COLDCC_TOK; } +#line 217 "/Users/bocchino/llvm/obj/../src/lib/AsmParser/Lexer.l" +{ return FASTCC_TOK; } YY_BREAK case 36: YY_RULE_SETUP -#line 219 "/proj/llvm/build/../llvm/lib/AsmParser/Lexer.l" -{ llvmAsmlval.PrimType = Type::VoidTy ; return VOID; } +#line 218 "/Users/bocchino/llvm/obj/../src/lib/AsmParser/Lexer.l" +{ return COLDCC_TOK; } YY_BREAK case 37: YY_RULE_SETUP -#line 220 "/proj/llvm/build/../llvm/lib/AsmParser/Lexer.l" -{ llvmAsmlval.PrimType = Type::BoolTy ; return BOOL; } +#line 220 "/Users/bocchino/llvm/obj/../src/lib/AsmParser/Lexer.l" +{ llvmAsmlval.PrimType = Type::VoidTy ; return VOID; } YY_BREAK case 38: YY_RULE_SETUP -#line 221 "/proj/llvm/build/../llvm/lib/AsmParser/Lexer.l" -{ llvmAsmlval.PrimType = Type::SByteTy ; return SBYTE; } +#line 221 "/Users/bocchino/llvm/obj/../src/lib/AsmParser/Lexer.l" +{ llvmAsmlval.PrimType = Type::BoolTy ; return BOOL; } YY_BREAK case 39: YY_RULE_SETUP -#line 222 "/proj/llvm/build/../llvm/lib/AsmParser/Lexer.l" -{ llvmAsmlval.PrimType = Type::UByteTy ; return UBYTE; } +#line 222 "/Users/bocchino/llvm/obj/../src/lib/AsmParser/Lexer.l" +{ llvmAsmlval.PrimType = Type::SByteTy ; return SBYTE; } YY_BREAK case 40: YY_RULE_SETUP -#line 223 "/proj/llvm/build/../llvm/lib/AsmParser/Lexer.l" -{ llvmAsmlval.PrimType = Type::ShortTy ; return SHORT; } +#line 223 "/Users/bocchino/llvm/obj/../src/lib/AsmParser/Lexer.l" +{ llvmAsmlval.PrimType = Type::UByteTy ; return UBYTE; } YY_BREAK case 41: YY_RULE_SETUP -#line 224 "/proj/llvm/build/../llvm/lib/AsmParser/Lexer.l" -{ llvmAsmlval.PrimType = Type::UShortTy; return USHORT; } +#line 224 "/Users/bocchino/llvm/obj/../src/lib/AsmParser/Lexer.l" +{ llvmAsmlval.PrimType = Type::ShortTy ; return SHORT; } YY_BREAK case 42: YY_RULE_SETUP -#line 225 "/proj/llvm/build/../llvm/lib/AsmParser/Lexer.l" -{ llvmAsmlval.PrimType = Type::IntTy ; return INT; } +#line 225 "/Users/bocchino/llvm/obj/../src/lib/AsmParser/Lexer.l" +{ llvmAsmlval.PrimType = Type::UShortTy; return USHORT; } YY_BREAK case 43: YY_RULE_SETUP -#line 226 "/proj/llvm/build/../llvm/lib/AsmParser/Lexer.l" -{ llvmAsmlval.PrimType = Type::UIntTy ; return UINT; } +#line 226 "/Users/bocchino/llvm/obj/../src/lib/AsmParser/Lexer.l" +{ llvmAsmlval.PrimType = Type::IntTy ; return INT; } YY_BREAK case 44: YY_RULE_SETUP -#line 227 "/proj/llvm/build/../llvm/lib/AsmParser/Lexer.l" -{ llvmAsmlval.PrimType = Type::LongTy ; return LONG; } +#line 227 "/Users/bocchino/llvm/obj/../src/lib/AsmParser/Lexer.l" +{ llvmAsmlval.PrimType = Type::UIntTy ; return UINT; } YY_BREAK case 45: YY_RULE_SETUP -#line 228 "/proj/llvm/build/../llvm/lib/AsmParser/Lexer.l" -{ llvmAsmlval.PrimType = Type::ULongTy ; return ULONG; } +#line 228 "/Users/bocchino/llvm/obj/../src/lib/AsmParser/Lexer.l" +{ llvmAsmlval.PrimType = Type::LongTy ; return LONG; } YY_BREAK case 46: YY_RULE_SETUP -#line 229 "/proj/llvm/build/../llvm/lib/AsmParser/Lexer.l" -{ llvmAsmlval.PrimType = Type::FloatTy ; return FLOAT; } +#line 229 "/Users/bocchino/llvm/obj/../src/lib/AsmParser/Lexer.l" +{ llvmAsmlval.PrimType = Type::ULongTy ; return ULONG; } YY_BREAK case 47: YY_RULE_SETUP -#line 230 "/proj/llvm/build/../llvm/lib/AsmParser/Lexer.l" -{ llvmAsmlval.PrimType = Type::DoubleTy; return DOUBLE; } +#line 230 "/Users/bocchino/llvm/obj/../src/lib/AsmParser/Lexer.l" +{ llvmAsmlval.PrimType = Type::FloatTy ; return FLOAT; } YY_BREAK case 48: YY_RULE_SETUP -#line 231 "/proj/llvm/build/../llvm/lib/AsmParser/Lexer.l" -{ llvmAsmlval.PrimType = Type::LabelTy ; return LABEL; } +#line 231 "/Users/bocchino/llvm/obj/../src/lib/AsmParser/Lexer.l" +{ llvmAsmlval.PrimType = Type::DoubleTy; return DOUBLE; } YY_BREAK case 49: YY_RULE_SETUP -#line 232 "/proj/llvm/build/../llvm/lib/AsmParser/Lexer.l" -{ return TYPE; } +#line 232 "/Users/bocchino/llvm/obj/../src/lib/AsmParser/Lexer.l" +{ llvmAsmlval.PrimType = Type::LabelTy ; return LABEL; } YY_BREAK case 50: YY_RULE_SETUP -#line 233 "/proj/llvm/build/../llvm/lib/AsmParser/Lexer.l" -{ return OPAQUE; } +#line 233 "/Users/bocchino/llvm/obj/../src/lib/AsmParser/Lexer.l" +{ return TYPE; } YY_BREAK case 51: YY_RULE_SETUP -#line 235 "/proj/llvm/build/../llvm/lib/AsmParser/Lexer.l" -{ RET_TOK(BinaryOpVal, Add, ADD); } +#line 234 "/Users/bocchino/llvm/obj/../src/lib/AsmParser/Lexer.l" +{ return OPAQUE; } YY_BREAK case 52: YY_RULE_SETUP -#line 236 "/proj/llvm/build/../llvm/lib/AsmParser/Lexer.l" -{ RET_TOK(BinaryOpVal, Sub, SUB); } +#line 236 "/Users/bocchino/llvm/obj/../src/lib/AsmParser/Lexer.l" +{ RET_TOK(BinaryOpVal, Add, ADD); } YY_BREAK case 53: YY_RULE_SETUP -#line 237 "/proj/llvm/build/../llvm/lib/AsmParser/Lexer.l" -{ RET_TOK(BinaryOpVal, Mul, MUL); } +#line 237 "/Users/bocchino/llvm/obj/../src/lib/AsmParser/Lexer.l" +{ RET_TOK(BinaryOpVal, Sub, SUB); } YY_BREAK case 54: YY_RULE_SETUP -#line 238 "/proj/llvm/build/../llvm/lib/AsmParser/Lexer.l" -{ RET_TOK(BinaryOpVal, Div, DIV); } +#line 238 "/Users/bocchino/llvm/obj/../src/lib/AsmParser/Lexer.l" +{ RET_TOK(BinaryOpVal, Mul, MUL); } YY_BREAK case 55: YY_RULE_SETUP -#line 239 "/proj/llvm/build/../llvm/lib/AsmParser/Lexer.l" -{ RET_TOK(BinaryOpVal, Rem, REM); } +#line 239 "/Users/bocchino/llvm/obj/../src/lib/AsmParser/Lexer.l" +{ RET_TOK(BinaryOpVal, Div, DIV); } YY_BREAK case 56: YY_RULE_SETUP -#line 240 "/proj/llvm/build/../llvm/lib/AsmParser/Lexer.l" -{ RET_TOK(BinaryOpVal, And, AND); } +#line 240 "/Users/bocchino/llvm/obj/../src/lib/AsmParser/Lexer.l" +{ RET_TOK(BinaryOpVal, Rem, REM); } YY_BREAK case 57: YY_RULE_SETUP -#line 241 "/proj/llvm/build/../llvm/lib/AsmParser/Lexer.l" -{ RET_TOK(BinaryOpVal, Or , OR ); } +#line 241 "/Users/bocchino/llvm/obj/../src/lib/AsmParser/Lexer.l" +{ RET_TOK(BinaryOpVal, And, AND); } YY_BREAK case 58: YY_RULE_SETUP -#line 242 "/proj/llvm/build/../llvm/lib/AsmParser/Lexer.l" -{ RET_TOK(BinaryOpVal, Xor, XOR); } +#line 242 "/Users/bocchino/llvm/obj/../src/lib/AsmParser/Lexer.l" +{ RET_TOK(BinaryOpVal, Or , OR ); } YY_BREAK case 59: YY_RULE_SETUP -#line 243 "/proj/llvm/build/../llvm/lib/AsmParser/Lexer.l" -{ RET_TOK(BinaryOpVal, SetNE, SETNE); } +#line 243 "/Users/bocchino/llvm/obj/../src/lib/AsmParser/Lexer.l" +{ RET_TOK(BinaryOpVal, Xor, XOR); } YY_BREAK case 60: YY_RULE_SETUP -#line 244 "/proj/llvm/build/../llvm/lib/AsmParser/Lexer.l" -{ RET_TOK(BinaryOpVal, SetEQ, SETEQ); } +#line 244 "/Users/bocchino/llvm/obj/../src/lib/AsmParser/Lexer.l" +{ RET_TOK(BinaryOpVal, SetNE, SETNE); } YY_BREAK case 61: YY_RULE_SETUP -#line 245 "/proj/llvm/build/../llvm/lib/AsmParser/Lexer.l" -{ RET_TOK(BinaryOpVal, SetLT, SETLT); } +#line 245 "/Users/bocchino/llvm/obj/../src/lib/AsmParser/Lexer.l" +{ RET_TOK(BinaryOpVal, SetEQ, SETEQ); } YY_BREAK case 62: YY_RULE_SETUP -#line 246 "/proj/llvm/build/../llvm/lib/AsmParser/Lexer.l" -{ RET_TOK(BinaryOpVal, SetGT, SETGT); } +#line 246 "/Users/bocchino/llvm/obj/../src/lib/AsmParser/Lexer.l" +{ RET_TOK(BinaryOpVal, SetLT, SETLT); } YY_BREAK case 63: YY_RULE_SETUP -#line 247 "/proj/llvm/build/../llvm/lib/AsmParser/Lexer.l" -{ RET_TOK(BinaryOpVal, SetLE, SETLE); } +#line 247 "/Users/bocchino/llvm/obj/../src/lib/AsmParser/Lexer.l" +{ RET_TOK(BinaryOpVal, SetGT, SETGT); } YY_BREAK case 64: YY_RULE_SETUP -#line 248 "/proj/llvm/build/../llvm/lib/AsmParser/Lexer.l" -{ RET_TOK(BinaryOpVal, SetGE, SETGE); } +#line 248 "/Users/bocchino/llvm/obj/../src/lib/AsmParser/Lexer.l" +{ RET_TOK(BinaryOpVal, SetLE, SETLE); } YY_BREAK case 65: YY_RULE_SETUP -#line 250 "/proj/llvm/build/../llvm/lib/AsmParser/Lexer.l" -{ RET_TOK(OtherOpVal, PHI, PHI_TOK); } +#line 249 "/Users/bocchino/llvm/obj/../src/lib/AsmParser/Lexer.l" +{ RET_TOK(BinaryOpVal, SetGE, SETGE); } YY_BREAK case 66: YY_RULE_SETUP -#line 251 "/proj/llvm/build/../llvm/lib/AsmParser/Lexer.l" -{ RET_TOK(OtherOpVal, Call, CALL); } +#line 250 "/Users/bocchino/llvm/obj/../src/lib/AsmParser/Lexer.l" +{ RET_TOK(BinaryOpVal, VSetNE, VSETNE); } YY_BREAK case 67: YY_RULE_SETUP -#line 252 "/proj/llvm/build/../llvm/lib/AsmParser/Lexer.l" -{ RET_TOK(OtherOpVal, Cast, CAST); } +#line 251 "/Users/bocchino/llvm/obj/../src/lib/AsmParser/Lexer.l" +{ RET_TOK(BinaryOpVal, VSetEQ, VSETEQ); } YY_BREAK case 68: YY_RULE_SETUP -#line 253 "/proj/llvm/build/../llvm/lib/AsmParser/Lexer.l" -{ RET_TOK(OtherOpVal, Select, SELECT); } +#line 252 "/Users/bocchino/llvm/obj/../src/lib/AsmParser/Lexer.l" +{ RET_TOK(BinaryOpVal, VSetLT, VSETLT); } YY_BREAK case 69: YY_RULE_SETUP -#line 254 "/proj/llvm/build/../llvm/lib/AsmParser/Lexer.l" -{ RET_TOK(OtherOpVal, Shl, SHL); } +#line 253 "/Users/bocchino/llvm/obj/../src/lib/AsmParser/Lexer.l" +{ RET_TOK(BinaryOpVal, VSetGT, VSETGT); } YY_BREAK case 70: YY_RULE_SETUP -#line 255 "/proj/llvm/build/../llvm/lib/AsmParser/Lexer.l" -{ RET_TOK(OtherOpVal, Shr, SHR); } +#line 254 "/Users/bocchino/llvm/obj/../src/lib/AsmParser/Lexer.l" +{ RET_TOK(BinaryOpVal, VSetLE, VSETLE); } YY_BREAK case 71: YY_RULE_SETUP -#line 256 "/proj/llvm/build/../llvm/lib/AsmParser/Lexer.l" -{ return VANEXT_old; } +#line 255 "/Users/bocchino/llvm/obj/../src/lib/AsmParser/Lexer.l" +{ RET_TOK(BinaryOpVal, VSetGE, VSETGE); } YY_BREAK case 72: YY_RULE_SETUP -#line 257 "/proj/llvm/build/../llvm/lib/AsmParser/Lexer.l" -{ return VAARG_old; } +#line 257 "/Users/bocchino/llvm/obj/../src/lib/AsmParser/Lexer.l" +{ RET_TOK(OtherOpVal, PHI, PHI_TOK); } YY_BREAK case 73: YY_RULE_SETUP -#line 258 "/proj/llvm/build/../llvm/lib/AsmParser/Lexer.l" -{ RET_TOK(OtherOpVal, VAArg , VAARG); } +#line 258 "/Users/bocchino/llvm/obj/../src/lib/AsmParser/Lexer.l" +{ RET_TOK(OtherOpVal, Call, CALL); } YY_BREAK case 74: YY_RULE_SETUP -#line 259 "/proj/llvm/build/../llvm/lib/AsmParser/Lexer.l" -{ RET_TOK(TermOpVal, Ret, RET); } +#line 259 "/Users/bocchino/llvm/obj/../src/lib/AsmParser/Lexer.l" +{ RET_TOK(OtherOpVal, Cast, CAST); } YY_BREAK case 75: YY_RULE_SETUP -#line 260 "/proj/llvm/build/../llvm/lib/AsmParser/Lexer.l" -{ RET_TOK(TermOpVal, Br, BR); } +#line 260 "/Users/bocchino/llvm/obj/../src/lib/AsmParser/Lexer.l" +{ RET_TOK(OtherOpVal, Select, SELECT); } YY_BREAK case 76: YY_RULE_SETUP -#line 261 "/proj/llvm/build/../llvm/lib/AsmParser/Lexer.l" -{ RET_TOK(TermOpVal, Switch, SWITCH); } +#line 261 "/Users/bocchino/llvm/obj/../src/lib/AsmParser/Lexer.l" +{ RET_TOK(OtherOpVal, VSelect, VSELECT); } YY_BREAK case 77: YY_RULE_SETUP -#line 262 "/proj/llvm/build/../llvm/lib/AsmParser/Lexer.l" -{ RET_TOK(TermOpVal, Invoke, INVOKE); } +#line 262 "/Users/bocchino/llvm/obj/../src/lib/AsmParser/Lexer.l" +{ RET_TOK(OtherOpVal, Shl, SHL); } YY_BREAK case 78: YY_RULE_SETUP -#line 263 "/proj/llvm/build/../llvm/lib/AsmParser/Lexer.l" -{ RET_TOK(TermOpVal, Unwind, UNWIND); } +#line 263 "/Users/bocchino/llvm/obj/../src/lib/AsmParser/Lexer.l" +{ RET_TOK(OtherOpVal, Shr, SHR); } YY_BREAK case 79: YY_RULE_SETUP -#line 264 "/proj/llvm/build/../llvm/lib/AsmParser/Lexer.l" -{ RET_TOK(TermOpVal, Unreachable, UNREACHABLE); } +#line 264 "/Users/bocchino/llvm/obj/../src/lib/AsmParser/Lexer.l" +{ return VANEXT_old; } YY_BREAK case 80: YY_RULE_SETUP -#line 266 "/proj/llvm/build/../llvm/lib/AsmParser/Lexer.l" -{ RET_TOK(MemOpVal, Malloc, MALLOC); } +#line 265 "/Users/bocchino/llvm/obj/../src/lib/AsmParser/Lexer.l" +{ return VAARG_old; } YY_BREAK case 81: YY_RULE_SETUP -#line 267 "/proj/llvm/build/../llvm/lib/AsmParser/Lexer.l" -{ RET_TOK(MemOpVal, Alloca, ALLOCA); } +#line 266 "/Users/bocchino/llvm/obj/../src/lib/AsmParser/Lexer.l" +{ RET_TOK(OtherOpVal, VAArg , VAARG); } YY_BREAK case 82: YY_RULE_SETUP -#line 268 "/proj/llvm/build/../llvm/lib/AsmParser/Lexer.l" -{ RET_TOK(MemOpVal, Free, FREE); } +#line 267 "/Users/bocchino/llvm/obj/../src/lib/AsmParser/Lexer.l" +{ RET_TOK(TermOpVal, Ret, RET); } YY_BREAK case 83: YY_RULE_SETUP -#line 269 "/proj/llvm/build/../llvm/lib/AsmParser/Lexer.l" -{ RET_TOK(MemOpVal, Load, LOAD); } +#line 268 "/Users/bocchino/llvm/obj/../src/lib/AsmParser/Lexer.l" +{ RET_TOK(TermOpVal, Br, BR); } YY_BREAK case 84: YY_RULE_SETUP -#line 270 "/proj/llvm/build/../llvm/lib/AsmParser/Lexer.l" -{ RET_TOK(MemOpVal, Store, STORE); } +#line 269 "/Users/bocchino/llvm/obj/../src/lib/AsmParser/Lexer.l" +{ RET_TOK(TermOpVal, Switch, SWITCH); } YY_BREAK case 85: YY_RULE_SETUP -#line 271 "/proj/llvm/build/../llvm/lib/AsmParser/Lexer.l" -{ RET_TOK(MemOpVal, GetElementPtr, GETELEMENTPTR); } +#line 270 "/Users/bocchino/llvm/obj/../src/lib/AsmParser/Lexer.l" +{ RET_TOK(TermOpVal, Invoke, INVOKE); } YY_BREAK case 86: YY_RULE_SETUP -#line 274 "/proj/llvm/build/../llvm/lib/AsmParser/Lexer.l" +#line 271 "/Users/bocchino/llvm/obj/../src/lib/AsmParser/Lexer.l" +{ RET_TOK(TermOpVal, Unwind, UNWIND); } + YY_BREAK +case 87: +YY_RULE_SETUP +#line 272 "/Users/bocchino/llvm/obj/../src/lib/AsmParser/Lexer.l" +{ RET_TOK(TermOpVal, Unreachable, UNREACHABLE); } + YY_BREAK +case 88: +YY_RULE_SETUP +#line 274 "/Users/bocchino/llvm/obj/../src/lib/AsmParser/Lexer.l" +{ RET_TOK(MemOpVal, Malloc, MALLOC); } + YY_BREAK +case 89: +YY_RULE_SETUP +#line 275 "/Users/bocchino/llvm/obj/../src/lib/AsmParser/Lexer.l" +{ RET_TOK(MemOpVal, Alloca, ALLOCA); } + YY_BREAK +case 90: +YY_RULE_SETUP +#line 276 "/Users/bocchino/llvm/obj/../src/lib/AsmParser/Lexer.l" +{ RET_TOK(MemOpVal, Free, FREE); } + YY_BREAK +case 91: +YY_RULE_SETUP +#line 277 "/Users/bocchino/llvm/obj/../src/lib/AsmParser/Lexer.l" +{ RET_TOK(MemOpVal, Load, LOAD); } + YY_BREAK +case 92: +YY_RULE_SETUP +#line 278 "/Users/bocchino/llvm/obj/../src/lib/AsmParser/Lexer.l" +{ RET_TOK(MemOpVal, Store, STORE); } + YY_BREAK +case 93: +YY_RULE_SETUP +#line 279 "/Users/bocchino/llvm/obj/../src/lib/AsmParser/Lexer.l" +{ RET_TOK(MemOpVal, GetElementPtr, GETELEMENTPTR); } + YY_BREAK +case 94: +YY_RULE_SETUP +#line 280 "/Users/bocchino/llvm/obj/../src/lib/AsmParser/Lexer.l" +{ RET_TOK(MemOpVal, VGather, VGATHER); } + YY_BREAK +case 95: +YY_RULE_SETUP +#line 281 "/Users/bocchino/llvm/obj/../src/lib/AsmParser/Lexer.l" +{ RET_TOK(MemOpVal, VImm, VIMM); } + YY_BREAK +case 96: +YY_RULE_SETUP +#line 282 "/Users/bocchino/llvm/obj/../src/lib/AsmParser/Lexer.l" +{ RET_TOK(MemOpVal, VScatter, VSCATTER); } + YY_BREAK +case 97: +YY_RULE_SETUP +#line 284 "/Users/bocchino/llvm/obj/../src/lib/AsmParser/Lexer.l" +{ RET_TOK(OtherOpVal, Extract, EXTRACT); } + YY_BREAK +case 98: +YY_RULE_SETUP +#line 285 "/Users/bocchino/llvm/obj/../src/lib/AsmParser/Lexer.l" +{ RET_TOK(OtherOpVal, ExtractElement, EXTRACTELEMENT); } + YY_BREAK +case 99: +YY_RULE_SETUP +#line 286 "/Users/bocchino/llvm/obj/../src/lib/AsmParser/Lexer.l" +{ RET_TOK(OtherOpVal, Combine, COMBINE); } + YY_BREAK +case 100: +YY_RULE_SETUP +#line 287 "/Users/bocchino/llvm/obj/../src/lib/AsmParser/Lexer.l" +{ RET_TOK(OtherOpVal, CombineElement, COMBINEELEMENT); } + YY_BREAK +case 101: +YY_RULE_SETUP +#line 288 "/Users/bocchino/llvm/obj/../src/lib/AsmParser/Lexer.l" +{ return VECTOR; } + YY_BREAK +case 102: +YY_RULE_SETUP +#line 289 "/Users/bocchino/llvm/obj/../src/lib/AsmParser/Lexer.l" +{ return OF; } + YY_BREAK +case 103: +YY_RULE_SETUP +#line 291 "/Users/bocchino/llvm/obj/../src/lib/AsmParser/Lexer.l" { UnEscapeLexed(yytext+1); llvmAsmlval.StrVal = strdup(yytext+1); // Skip % return VAR_ID; } YY_BREAK -case 87: +case 104: YY_RULE_SETUP -#line 279 "/proj/llvm/build/../llvm/lib/AsmParser/Lexer.l" +#line 296 "/Users/bocchino/llvm/obj/../src/lib/AsmParser/Lexer.l" { yytext[strlen(yytext)-1] = 0; // nuke colon UnEscapeLexed(yytext); @@ -1564,9 +1701,9 @@ return LABELSTR; } YY_BREAK -case 88: +case 105: YY_RULE_SETUP -#line 285 "/proj/llvm/build/../llvm/lib/AsmParser/Lexer.l" +#line 302 "/Users/bocchino/llvm/obj/../src/lib/AsmParser/Lexer.l" { yytext[strlen(yytext)-2] = 0; // nuke colon, end quote UnEscapeLexed(yytext+1); @@ -1574,9 +1711,9 @@ return LABELSTR; } YY_BREAK -case 89: +case 106: YY_RULE_SETUP -#line 292 "/proj/llvm/build/../llvm/lib/AsmParser/Lexer.l" +#line 309 "/Users/bocchino/llvm/obj/../src/lib/AsmParser/Lexer.l" { // Note that we cannot unescape a string constant here! The // string constant might contain a \00 which would not be // understood by the string stuff. It is valid to make a @@ -1587,14 +1724,14 @@ return STRINGCONSTANT; } YY_BREAK -case 90: +case 107: YY_RULE_SETUP -#line 303 "/proj/llvm/build/../llvm/lib/AsmParser/Lexer.l" +#line 320 "/Users/bocchino/llvm/obj/../src/lib/AsmParser/Lexer.l" { llvmAsmlval.UInt64Val = atoull(yytext); return EUINT64VAL; } YY_BREAK -case 91: +case 108: YY_RULE_SETUP -#line 304 "/proj/llvm/build/../llvm/lib/AsmParser/Lexer.l" +#line 321 "/Users/bocchino/llvm/obj/../src/lib/AsmParser/Lexer.l" { uint64_t Val = atoull(yytext+1); // +1: we have bigger negative range @@ -1604,17 +1741,17 @@ return ESINT64VAL; } YY_BREAK -case 92: +case 109: YY_RULE_SETUP -#line 312 "/proj/llvm/build/../llvm/lib/AsmParser/Lexer.l" +#line 329 "/Users/bocchino/llvm/obj/../src/lib/AsmParser/Lexer.l" { llvmAsmlval.UInt64Val = HexIntToVal(yytext+3); return yytext[0] == 's' ? ESINT64VAL : EUINT64VAL; } YY_BREAK -case 93: +case 110: YY_RULE_SETUP -#line 317 "/proj/llvm/build/../llvm/lib/AsmParser/Lexer.l" +#line 334 "/Users/bocchino/llvm/obj/../src/lib/AsmParser/Lexer.l" { uint64_t Val = atoull(yytext+1); if ((unsigned)Val != Val) @@ -1623,9 +1760,9 @@ return UINTVAL; } YY_BREAK -case 94: +case 111: YY_RULE_SETUP -#line 324 "/proj/llvm/build/../llvm/lib/AsmParser/Lexer.l" +#line 341 "/Users/bocchino/llvm/obj/../src/lib/AsmParser/Lexer.l" { uint64_t Val = atoull(yytext+2); // +1: we have bigger negative range @@ -1635,18 +1772,18 @@ return SINTVAL; } YY_BREAK -case 95: +case 112: YY_RULE_SETUP -#line 333 "/proj/llvm/build/../llvm/lib/AsmParser/Lexer.l" +#line 350 "/Users/bocchino/llvm/obj/../src/lib/AsmParser/Lexer.l" { llvmAsmlval.FPVal = atof(yytext); return FPVAL; } YY_BREAK -case 96: +case 113: YY_RULE_SETUP -#line 334 "/proj/llvm/build/../llvm/lib/AsmParser/Lexer.l" +#line 351 "/Users/bocchino/llvm/obj/../src/lib/AsmParser/Lexer.l" { llvmAsmlval.FPVal = HexToFP(yytext); return FPVAL; } YY_BREAK case YY_STATE_EOF(INITIAL): -#line 336 "/proj/llvm/build/../llvm/lib/AsmParser/Lexer.l" +#line 353 "/Users/bocchino/llvm/obj/../src/lib/AsmParser/Lexer.l" { /* Make sure to free the internal buffers for flex when we are * done reading our input! @@ -1655,22 +1792,22 @@ return EOF; } YY_BREAK -case 97: +case 114: YY_RULE_SETUP -#line 344 "/proj/llvm/build/../llvm/lib/AsmParser/Lexer.l" +#line 361 "/Users/bocchino/llvm/obj/../src/lib/AsmParser/Lexer.l" { /* Ignore whitespace */ } YY_BREAK -case 98: +case 115: YY_RULE_SETUP -#line 345 "/proj/llvm/build/../llvm/lib/AsmParser/Lexer.l" +#line 362 "/Users/bocchino/llvm/obj/../src/lib/AsmParser/Lexer.l" { return yytext[0]; } YY_BREAK -case 99: +case 116: YY_RULE_SETUP -#line 347 "/proj/llvm/build/../llvm/lib/AsmParser/Lexer.l" +#line 364 "/Users/bocchino/llvm/obj/../src/lib/AsmParser/Lexer.l" YY_FATAL_ERROR( "flex scanner jammed" ); YY_BREAK -#line 1674 "Lexer.cpp" +#line 1811 "Lexer.cpp" case YY_END_OF_BUFFER: { @@ -1957,7 +2094,7 @@ while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) { yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 397 ) + if ( yy_current_state >= 462 ) yy_c = yy_meta[(unsigned int) yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; @@ -1987,11 +2124,11 @@ while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) { yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 397 ) + if ( yy_current_state >= 462 ) yy_c = yy_meta[(unsigned int) yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; - yy_is_jam = (yy_current_state == 396); + yy_is_jam = (yy_current_state == 461); if ( ! yy_is_jam ) *yy_state_ptr++ = yy_current_state; @@ -2046,7 +2183,6 @@ #endif /* ifndef YY_NO_UNPUT */ -#ifndef YY_NO_INPUT #ifdef __cplusplus static int yyinput() #else @@ -2120,7 +2256,7 @@ return c; } -#endif /* YY_NO_INPUT */ + #ifdef YY_USE_PROTOS void yyrestart( FILE *input_file ) @@ -2231,6 +2367,11 @@ } +#ifndef YY_ALWAYS_INTERACTIVE +#ifndef YY_NEVER_INTERACTIVE +extern int isatty YY_PROTO(( int )); +#endif +#endif #ifdef YY_USE_PROTOS void yy_init_buffer( YY_BUFFER_STATE b, FILE *file ) @@ -2548,5 +2689,5 @@ return 0; } #endif -#line 347 "/proj/llvm/build/../llvm/lib/AsmParser/Lexer.l" +#line 364 "/Users/bocchino/llvm/obj/../src/lib/AsmParser/Lexer.l" Index: llvm/lib/AsmParser/Lexer.l diff -u llvm/lib/AsmParser/Lexer.l:1.64 llvm/lib/AsmParser/Lexer.l:1.64.2.1 --- llvm/lib/AsmParser/Lexer.l:1.64 Sat Jun 18 13:34:51 2005 +++ llvm/lib/AsmParser/Lexer.l Tue Oct 18 14:21:56 2005 @@ -210,6 +210,7 @@ little { return LITTLE; } big { return BIG; } volatile { return VOLATILE; } +fixed { return FIXED; } cc { return CC_TOK; } ccc { return CCC_TOK; } @@ -246,11 +247,18 @@ setgt { RET_TOK(BinaryOpVal, SetGT, SETGT); } setle { RET_TOK(BinaryOpVal, SetLE, SETLE); } setge { RET_TOK(BinaryOpVal, SetGE, SETGE); } +vsetne { RET_TOK(BinaryOpVal, VSetNE, VSETNE); } +vseteq { RET_TOK(BinaryOpVal, VSetEQ, VSETEQ); } +vsetlt { RET_TOK(BinaryOpVal, VSetLT, VSETLT); } +vsetgt { RET_TOK(BinaryOpVal, VSetGT, VSETGT); } +vsetle { RET_TOK(BinaryOpVal, VSetLE, VSETLE); } +vsetge { RET_TOK(BinaryOpVal, VSetGE, VSETGE); } phi { RET_TOK(OtherOpVal, PHI, PHI_TOK); } call { RET_TOK(OtherOpVal, Call, CALL); } cast { RET_TOK(OtherOpVal, Cast, CAST); } select { RET_TOK(OtherOpVal, Select, SELECT); } +vselect { RET_TOK(OtherOpVal, VSelect, VSELECT); } shl { RET_TOK(OtherOpVal, Shl, SHL); } shr { RET_TOK(OtherOpVal, Shr, SHR); } vanext { return VANEXT_old; } @@ -269,7 +277,16 @@ load { RET_TOK(MemOpVal, Load, LOAD); } store { RET_TOK(MemOpVal, Store, STORE); } getelementptr { RET_TOK(MemOpVal, GetElementPtr, GETELEMENTPTR); } - +vgather { RET_TOK(MemOpVal, VGather, VGATHER); } +vimm { RET_TOK(MemOpVal, VImm, VIMM); } +vscatter { RET_TOK(MemOpVal, VScatter, VSCATTER); } + +extract { RET_TOK(OtherOpVal, Extract, EXTRACT); } +extractelement { RET_TOK(OtherOpVal, ExtractElement, EXTRACTELEMENT); } +combine { RET_TOK(OtherOpVal, Combine, COMBINE); } +combineelement { RET_TOK(OtherOpVal, CombineElement, COMBINEELEMENT); } +vector { return VECTOR; } +of { return OF; } {VarID} { UnEscapeLexed(yytext+1); Index: llvm/lib/AsmParser/llvmAsmParser.cpp diff -u llvm/lib/AsmParser/llvmAsmParser.cpp:1.17 llvm/lib/AsmParser/llvmAsmParser.cpp:1.17.2.1 --- llvm/lib/AsmParser/llvmAsmParser.cpp:1.17 Sat Aug 27 13:50:38 2005 +++ llvm/lib/AsmParser/llvmAsmParser.cpp Tue Oct 18 14:21:56 2005 @@ -1,257 +1,126 @@ -/* A Bison parser, made by GNU Bison 1.875c. */ -/* Skeleton parser for Yacc-like parsing with Bison, - Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003 Free Software Foundation, Inc. +/* A Bison parser, made from /Users/bocchino/llvm/obj/../src/lib/AsmParser/llvmAsmParser.y + by GNU Bison version 1.28 */ - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -/* As a special exception, when this file is copied by Bison into a - Bison output file, you may use that output file without restriction. - This special exception was added by the Free Software Foundation - in version 1.24 of Bison. */ - -/* Written by Richard Stallman by simplifying the original so called - ``semantic'' parser. */ +#define YYBISON 1 /* Identify Bison output. */ -/* All symbols defined below should begin with yy or YY, to avoid - infringing on user name space. This should be done even for local - variables, as they might otherwise be expanded by user macros. - There are some unavoidable exceptions within include files to - define necessary library symbols; they are noted "INFRINGES ON - USER NAME SPACE" below. */ - -/* Identify Bison output. */ -#define YYBISON 1 - -/* Skeleton name. */ -#define YYSKELETON_NAME "yacc.c" - -/* Pure parsers. */ -#define YYPURE 0 - -/* Using locations. */ -#define YYLSP_NEEDED 0 - -/* If NAME_PREFIX is specified substitute the variables and functions - names. */ #define yyparse llvmAsmparse -#define yylex llvmAsmlex +#define yylex llvmAsmlex #define yyerror llvmAsmerror -#define yylval llvmAsmlval -#define yychar llvmAsmchar +#define yylval llvmAsmlval +#define yychar llvmAsmchar #define yydebug llvmAsmdebug #define yynerrs llvmAsmnerrs +#define ESINT64VAL 257 +#define EUINT64VAL 258 +#define SINTVAL 259 +#define UINTVAL 260 +#define FPVAL 261 +#define VOID 262 +#define BOOL 263 +#define SBYTE 264 +#define UBYTE 265 +#define SHORT 266 +#define USHORT 267 +#define INT 268 +#define UINT 269 +#define LONG 270 +#define ULONG 271 +#define FLOAT 272 +#define DOUBLE 273 +#define TYPE 274 +#define LABEL 275 +#define VAR_ID 276 +#define LABELSTR 277 +#define STRINGCONSTANT 278 +#define IMPLEMENTATION 279 +#define ZEROINITIALIZER 280 +#define TRUETOK 281 +#define FALSETOK 282 +#define BEGINTOK 283 +#define ENDTOK 284 +#define DECLARE 285 +#define GLOBAL 286 +#define CONSTANT 287 +#define VOLATILE 288 +#define FIXED 289 +#define TO 290 +#define DOTDOTDOT 291 +#define NULL_TOK 292 +#define UNDEF 293 +#define CONST 294 +#define INTERNAL 295 +#define LINKONCE 296 +#define WEAK 297 +#define APPENDING 298 +#define OPAQUE 299 +#define NOT 300 +#define EXTERNAL 301 +#define TARGET 302 +#define TRIPLE 303 +#define ENDIAN 304 +#define POINTERSIZE 305 +#define LITTLE 306 +#define BIG 307 +#define DEPLIBS 308 +#define CALL 309 +#define TAIL 310 +#define CC_TOK 311 +#define CCC_TOK 312 +#define FASTCC_TOK 313 +#define COLDCC_TOK 314 +#define VECTOR 315 +#define OF 316 +#define RET 317 +#define BR 318 +#define SWITCH 319 +#define INVOKE 320 +#define UNWIND 321 +#define UNREACHABLE 322 +#define ADD 323 +#define SUB 324 +#define MUL 325 +#define DIV 326 +#define REM 327 +#define AND 328 +#define OR 329 +#define XOR 330 +#define SETLE 331 +#define SETGE 332 +#define SETLT 333 +#define SETGT 334 +#define SETEQ 335 +#define SETNE 336 +#define VSETLE 337 +#define VSETGE 338 +#define VSETLT 339 +#define VSETGT 340 +#define VSETEQ 341 +#define VSETNE 342 +#define MALLOC 343 +#define ALLOCA 344 +#define FREE 345 +#define LOAD 346 +#define STORE 347 +#define GETELEMENTPTR 348 +#define PHI_TOK 349 +#define CAST 350 +#define SELECT 351 +#define VSELECT 352 +#define SHL 353 +#define SHR 354 +#define VAARG 355 +#define VGATHER 356 +#define VIMM 357 +#define VSCATTER 358 +#define EXTRACT 359 +#define EXTRACTELEMENT 360 +#define COMBINE 361 +#define COMBINEELEMENT 362 +#define VAARG_old 363 +#define VANEXT_old 364 - -/* Tokens. */ -#ifndef YYTOKENTYPE -# define YYTOKENTYPE - /* Put the tokens into the symbol table, so that GDB and other debuggers - know about them. */ - enum yytokentype { - ESINT64VAL = 258, - EUINT64VAL = 259, - SINTVAL = 260, - UINTVAL = 261, - FPVAL = 262, - VOID = 263, - BOOL = 264, - SBYTE = 265, - UBYTE = 266, - SHORT = 267, - USHORT = 268, - INT = 269, - UINT = 270, - LONG = 271, - ULONG = 272, - FLOAT = 273, - DOUBLE = 274, - TYPE = 275, - LABEL = 276, - VAR_ID = 277, - LABELSTR = 278, - STRINGCONSTANT = 279, - IMPLEMENTATION = 280, - ZEROINITIALIZER = 281, - TRUETOK = 282, - FALSETOK = 283, - BEGINTOK = 284, - ENDTOK = 285, - DECLARE = 286, - GLOBAL = 287, - CONSTANT = 288, - VOLATILE = 289, - TO = 290, - DOTDOTDOT = 291, - NULL_TOK = 292, - UNDEF = 293, - CONST = 294, - INTERNAL = 295, - LINKONCE = 296, - WEAK = 297, - APPENDING = 298, - OPAQUE = 299, - NOT = 300, - EXTERNAL = 301, - TARGET = 302, - TRIPLE = 303, - ENDIAN = 304, - POINTERSIZE = 305, - LITTLE = 306, - BIG = 307, - DEPLIBS = 308, - CALL = 309, - TAIL = 310, - CC_TOK = 311, - CCC_TOK = 312, - FASTCC_TOK = 313, - COLDCC_TOK = 314, - RET = 315, - BR = 316, - SWITCH = 317, - INVOKE = 318, - UNWIND = 319, - UNREACHABLE = 320, - ADD = 321, - SUB = 322, - MUL = 323, - DIV = 324, - REM = 325, - AND = 326, - OR = 327, - XOR = 328, - SETLE = 329, - SETGE = 330, - SETLT = 331, - SETGT = 332, - SETEQ = 333, - SETNE = 334, - MALLOC = 335, - ALLOCA = 336, - FREE = 337, - LOAD = 338, - STORE = 339, - GETELEMENTPTR = 340, - PHI_TOK = 341, - CAST = 342, - SELECT = 343, - SHL = 344, - SHR = 345, - VAARG = 346, - VAARG_old = 347, - VANEXT_old = 348 - }; -#endif -#define ESINT64VAL 258 -#define EUINT64VAL 259 -#define SINTVAL 260 -#define UINTVAL 261 -#define FPVAL 262 -#define VOID 263 -#define BOOL 264 -#define SBYTE 265 -#define UBYTE 266 -#define SHORT 267 -#define USHORT 268 -#define INT 269 -#define UINT 270 -#define LONG 271 -#define ULONG 272 -#define FLOAT 273 -#define DOUBLE 274 -#define TYPE 275 -#define LABEL 276 -#define VAR_ID 277 -#define LABELSTR 278 -#define STRINGCONSTANT 279 -#define IMPLEMENTATION 280 -#define ZEROINITIALIZER 281 -#define TRUETOK 282 -#define FALSETOK 283 -#define BEGINTOK 284 -#define ENDTOK 285 -#define DECLARE 286 -#define GLOBAL 287 -#define CONSTANT 288 -#define VOLATILE 289 -#define TO 290 -#define DOTDOTDOT 291 -#define NULL_TOK 292 -#define UNDEF 293 -#define CONST 294 -#define INTERNAL 295 -#define LINKONCE 296 -#define WEAK 297 -#define APPENDING 298 -#define OPAQUE 299 -#define NOT 300 -#define EXTERNAL 301 -#define TARGET 302 -#define TRIPLE 303 -#define ENDIAN 304 -#define POINTERSIZE 305 -#define LITTLE 306 -#define BIG 307 -#define DEPLIBS 308 -#define CALL 309 -#define TAIL 310 -#define CC_TOK 311 -#define CCC_TOK 312 -#define FASTCC_TOK 313 -#define COLDCC_TOK 314 -#define RET 315 -#define BR 316 -#define SWITCH 317 -#define INVOKE 318 -#define UNWIND 319 -#define UNREACHABLE 320 -#define ADD 321 -#define SUB 322 -#define MUL 323 -#define DIV 324 -#define REM 325 -#define AND 326 -#define OR 327 -#define XOR 328 -#define SETLE 329 -#define SETGE 330 -#define SETLT 331 -#define SETGT 332 -#define SETEQ 333 -#define SETNE 334 -#define MALLOC 335 -#define ALLOCA 336 -#define FREE 337 -#define LOAD 338 -#define STORE 339 -#define GETELEMENTPTR 340 -#define PHI_TOK 341 -#define CAST 342 -#define SELECT 343 -#define SHL 344 -#define SHR 345 -#define VAARG 346 -#define VAARG_old 347 -#define VANEXT_old 348 - - - - -/* Copy the first part of user declarations. */ -#line 14 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y" +#line 14 "/Users/bocchino/llvm/obj/../src/lib/AsmParser/llvmAsmParser.y" #include "ParserInternals.h" #include "llvm/CallingConv.h" @@ -1102,23 +971,8 @@ } - -/* Enabling traces. */ -#ifndef YYDEBUG -# define YYDEBUG 0 -#endif - -/* Enabling verbose error messages. */ -#ifdef YYERROR_VERBOSE -# undef YYERROR_VERBOSE -# define YYERROR_VERBOSE 1 -#else -# define YYERROR_VERBOSE 0 -#endif - -#if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED) -#line 865 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y" -typedef union YYSTYPE { +#line 865 "/Users/bocchino/llvm/obj/../src/lib/AsmParser/llvmAsmParser.y" +typedef union { llvm::Module *ModuleVal; llvm::Function *FunctionVal; std::pair *ArgVal; @@ -1157,1235 +1011,981 @@ llvm::Instruction::OtherOps OtherOpVal; llvm::Module::Endianness Endianness; } YYSTYPE; -/* Line 191 of yacc.c. */ -#line 1162 "llvmAsmParser.tab.c" -# define yystype YYSTYPE /* obsolescent; will be withdrawn */ -# define YYSTYPE_IS_DECLARED 1 -# define YYSTYPE_IS_TRIVIAL 1 -#endif - +#include +#ifndef __cplusplus +#ifndef __STDC__ +#define const +#endif +#endif -/* Copy the second part of user declarations. */ - - -/* Line 214 of yacc.c. */ -#line 1174 "llvmAsmParser.tab.c" - -#if ! defined (yyoverflow) || YYERROR_VERBOSE - -# ifndef YYFREE -# define YYFREE free -# endif -# ifndef YYMALLOC -# define YYMALLOC malloc -# endif - -/* The parser invokes alloca or malloc; define the necessary symbols. */ - -# ifdef YYSTACK_USE_ALLOCA -# if YYSTACK_USE_ALLOCA -# define YYSTACK_ALLOC alloca -# endif -# else -# if defined (alloca) || defined (_ALLOCA_H) -# define YYSTACK_ALLOC alloca -# else -# ifdef __GNUC__ -# define YYSTACK_ALLOC __builtin_alloca -# endif -# endif -# endif - -# ifdef YYSTACK_ALLOC - /* Pacify GCC's `empty if-body' warning. */ -# define YYSTACK_FREE(Ptr) do { /* empty */; } while (0) -# else -# if defined (__STDC__) || defined (__cplusplus) -# include /* INFRINGES ON USER NAME SPACE */ -# define YYSIZE_T size_t -# endif -# define YYSTACK_ALLOC YYMALLOC -# define YYSTACK_FREE YYFREE -# endif -#endif /* ! defined (yyoverflow) || YYERROR_VERBOSE */ - - -#if (! defined (yyoverflow) \ - && (! defined (__cplusplus) \ - || (defined (YYSTYPE_IS_TRIVIAL) && YYSTYPE_IS_TRIVIAL))) -/* A type that is properly aligned for any stack member. */ -union yyalloc -{ - short yyss; - YYSTYPE yyvs; - }; -/* The size of the maximum gap between one aligned stack and the next. */ -# define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1) +#define YYFINAL 480 +#define YYFLAG -32768 +#define YYNTBASE 125 + +#define YYTRANSLATE(x) ((unsigned)(x) <= 364 ? yytranslate[x] : 188) + +static const char yytranslate[] = { 0, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 113, + 114, 120, 2, 121, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 123, + 111, 124, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 115, 112, 117, 2, 2, 2, 2, 2, 122, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 116, + 2, 2, 118, 2, 119, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 1, 3, 4, 5, 6, + 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, + 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, + 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, + 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, + 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, + 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, + 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, + 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, + 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, + 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, + 107, 108, 109, 110 +}; -/* The size of an array large to enough to hold all stacks, each with - N elements. */ -# define YYSTACK_BYTES(N) \ - ((N) * (sizeof (short) + sizeof (YYSTYPE)) \ - + YYSTACK_GAP_MAXIMUM) - -/* Copy COUNT objects from FROM to TO. The source and destination do - not overlap. */ -# ifndef YYCOPY -# if defined (__GNUC__) && 1 < __GNUC__ -# define YYCOPY(To, From, Count) \ - __builtin_memcpy (To, From, (Count) * sizeof (*(From))) -# else -# define YYCOPY(To, From, Count) \ - do \ - { \ - register YYSIZE_T yyi; \ - for (yyi = 0; yyi < (Count); yyi++) \ - (To)[yyi] = (From)[yyi]; \ - } \ - while (0) -# endif -# endif - -/* Relocate STACK from its old location to the new one. The - local variables YYSIZE and YYSTACKSIZE give the old and new number of - elements in the stack, and YYPTR gives the new location of the - stack. Advance YYPTR to a properly aligned location for the next - stack. */ -# define YYSTACK_RELOCATE(Stack) \ - do \ - { \ - YYSIZE_T yynewbytes; \ - YYCOPY (&yyptr->Stack, Stack, yysize); \ - Stack = &yyptr->Stack; \ - yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \ - yyptr += yynewbytes / sizeof (*yyptr); \ - } \ - while (0) +#if YYDEBUG != 0 +static const short yyprhs[] = { 0, + 0, 2, 4, 6, 8, 10, 12, 14, 16, 18, + 20, 22, 24, 26, 28, 30, 32, 34, 36, 38, + 40, 42, 44, 46, 48, 50, 52, 54, 56, 58, + 60, 62, 64, 66, 68, 70, 72, 74, 76, 79, + 80, 82, 84, 86, 88, 89, 90, 92, 94, 96, + 99, 101, 103, 105, 107, 109, 111, 113, 115, 117, + 119, 121, 123, 125, 127, 129, 131, 133, 135, 137, + 139, 141, 144, 149, 155, 161, 168, 172, 175, 178, + 180, 184, 186, 190, 192, 193, 198, 202, 206, 211, + 216, 220, 223, 226, 229, 232, 235, 238, 241, 244, + 247, 250, 257, 263, 272, 279, 286, 293, 300, 304, + 306, 308, 310, 312, 315, 318, 321, 323, 328, 331, + 337, 343, 347, 352, 353, 355, 357, 361, 365, 369, + 373, 377, 379, 380, 382, 384, 386, 387, 390, 394, + 396, 398, 402, 404, 405, 412, 414, 416, 420, 422, + 424, 427, 428, 432, 434, 436, 438, 440, 442, 444, + 446, 450, 452, 454, 456, 458, 460, 463, 466, 469, + 473, 476, 477, 479, 482, 485, 489, 499, 509, 518, + 532, 534, 536, 543, 549, 552, 559, 567, 569, 573, + 575, 576, 579, 581, 587, 593, 599, 605, 608, 613, + 618, 625, 632, 637, 642, 647, 650, 658, 660, 663, + 664, 666, 667, 669, 670, 673, 679, 682, 688, 691, + 696, 703, 708, 713, 719, 728, 733, 742, 749 +}; -#endif +static const short yyrhs[] = { 5, + 0, 6, 0, 3, 0, 4, 0, 69, 0, 70, + 0, 71, 0, 72, 0, 73, 0, 74, 0, 75, + 0, 76, 0, 77, 0, 78, 0, 79, 0, 80, + 0, 81, 0, 82, 0, 83, 0, 84, 0, 85, + 0, 86, 0, 87, 0, 88, 0, 99, 0, 100, + 0, 16, 0, 14, 0, 12, 0, 10, 0, 17, + 0, 15, 0, 13, 0, 11, 0, 132, 0, 133, + 0, 18, 0, 19, 0, 157, 111, 0, 0, 41, + 0, 42, 0, 43, 0, 44, 0, 0, 0, 58, + 0, 59, 0, 60, 0, 57, 4, 0, 141, 0, + 8, 0, 143, 0, 8, 0, 143, 0, 9, 0, + 10, 0, 11, 0, 12, 0, 13, 0, 14, 0, + 15, 0, 16, 0, 17, 0, 18, 0, 19, 0, + 20, 0, 21, 0, 45, 0, 142, 0, 170, 0, + 112, 4, 0, 140, 113, 145, 114, 0, 115, 4, + 116, 143, 117, 0, 115, 61, 62, 143, 117, 0, + 115, 61, 62, 4, 143, 117, 0, 118, 144, 119, + 0, 118, 119, 0, 143, 120, 0, 143, 0, 144, + 121, 143, 0, 144, 0, 144, 121, 37, 0, 37, + 0, 0, 141, 115, 148, 117, 0, 141, 115, 117, + 0, 141, 122, 24, 0, 141, 123, 148, 124, 0, + 141, 118, 148, 119, 0, 141, 118, 119, 0, 141, + 38, 0, 141, 39, 0, 141, 170, 0, 141, 147, + 0, 141, 26, 0, 132, 126, 0, 133, 4, 0, + 9, 27, 0, 9, 28, 0, 135, 7, 0, 96, + 113, 146, 36, 141, 114, 0, 94, 113, 146, 184, + 114, 0, 97, 113, 146, 121, 146, 121, 146, 114, + 0, 127, 113, 146, 121, 146, 114, 0, 128, 113, + 146, 121, 146, 114, 0, 129, 113, 146, 121, 146, + 114, 0, 131, 113, 146, 121, 146, 114, 0, 148, + 121, 146, 0, 146, 0, 32, 0, 33, 0, 151, + 0, 151, 166, 0, 151, 167, 0, 151, 25, 0, + 152, 0, 152, 136, 20, 139, 0, 152, 167, 0, + 152, 136, 137, 149, 146, 0, 152, 136, 47, 149, + 141, 0, 152, 48, 154, 0, 152, 54, 111, 155, + 0, 0, 53, 0, 52, 0, 50, 111, 153, 0, + 51, 111, 4, 0, 49, 111, 24, 0, 115, 156, + 117, 0, 156, 121, 24, 0, 24, 0, 0, 22, + 0, 24, 0, 157, 0, 0, 141, 158, 0, 160, + 121, 159, 0, 159, 0, 160, 0, 160, 121, 37, + 0, 37, 0, 0, 138, 139, 157, 113, 161, 114, + 0, 29, 0, 118, 0, 137, 162, 163, 0, 30, + 0, 119, 0, 173, 165, 0, 0, 31, 168, 162, + 0, 3, 0, 4, 0, 7, 0, 27, 0, 28, + 0, 38, 0, 39, 0, 123, 148, 124, 0, 147, + 0, 125, 0, 157, 0, 170, 0, 169, 0, 141, + 171, 0, 173, 174, 0, 164, 174, 0, 175, 136, + 176, 0, 175, 178, 0, 0, 23, 0, 63, 172, + 0, 63, 8, 0, 64, 21, 171, 0, 64, 9, + 171, 121, 21, 171, 121, 21, 171, 0, 65, 134, + 171, 121, 21, 171, 115, 177, 117, 0, 65, 134, + 171, 121, 21, 171, 115, 117, 0, 66, 138, 139, + 171, 113, 181, 114, 36, 21, 171, 67, 21, 171, + 0, 67, 0, 68, 0, 177, 134, 169, 121, 21, + 171, 0, 134, 169, 121, 21, 171, 0, 136, 183, + 0, 141, 115, 171, 121, 171, 117, 0, 179, 121, + 115, 171, 121, 171, 117, 0, 172, 0, 180, 121, + 172, 0, 180, 0, 0, 56, 55, 0, 55, 0, + 127, 141, 171, 121, 171, 0, 128, 141, 171, 121, + 171, 0, 129, 141, 171, 121, 171, 0, 130, 141, + 171, 121, 171, 0, 46, 172, 0, 131, 172, 121, + 172, 0, 96, 172, 36, 141, 0, 97, 172, 121, + 172, 121, 172, 0, 98, 172, 121, 172, 121, 172, + 0, 101, 172, 121, 141, 0, 109, 172, 121, 141, + 0, 110, 172, 121, 141, 0, 95, 179, 0, 182, + 138, 139, 171, 113, 181, 114, 0, 187, 0, 121, + 180, 0, 0, 34, 0, 0, 35, 0, 0, 89, + 141, 0, 89, 141, 121, 15, 171, 0, 90, 141, + 0, 90, 141, 121, 15, 171, 0, 91, 172, 0, + 185, 92, 141, 171, 0, 185, 93, 172, 121, 141, + 171, 0, 94, 141, 171, 184, 0, 102, 141, 171, + 184, 0, 186, 103, 172, 121, 172, 0, 105, 172, + 121, 172, 121, 172, 121, 172, 0, 106, 172, 121, + 172, 0, 107, 172, 121, 172, 121, 172, 121, 172, + 0, 108, 172, 121, 172, 121, 172, 0, 104, 172, + 121, 141, 171, 184, 0 +}; -#if defined (__STDC__) || defined (__cplusplus) - typedef signed char yysigned_char; -#else - typedef short yysigned_char; #endif -/* YYFINAL -- State number of the termination state. */ -#define YYFINAL 4 -/* YYLAST -- Last index in YYTABLE. */ -#define YYLAST 1102 - -/* YYNTOKENS -- Number of terminals. */ -#define YYNTOKENS 108 -/* YYNNTS -- Number of nonterminals. */ -#define YYNNTS 62 -/* YYNRULES -- Number of rules. */ -#define YYNRULES 212 -/* YYNRULES -- Number of states. */ -#define YYNSTATES 419 - -/* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */ -#define YYUNDEFTOK 2 -#define YYMAXUTOK 348 - -#define YYTRANSLATE(YYX) \ - ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) - -/* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */ -static const unsigned char yytranslate[] = -{ - 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 96, 97, 105, 2, 106, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 101, 94, 102, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 98, 95, 100, 2, 2, 2, 2, 2, 107, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 99, 2, 2, 103, 2, 104, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 1, 2, 3, 4, - 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, - 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, - 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, - 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, - 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, - 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, - 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, - 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, - 85, 86, 87, 88, 89, 90, 91, 92, 93 +#if YYDEBUG != 0 +static const short yyrline[] = { 0, + 986, 987, 994, 995, 1004, 1004, 1004, 1004, 1004, 1005, + 1005, 1005, 1006, 1006, 1006, 1006, 1006, 1006, 1007, 1007, + 1007, 1007, 1007, 1007, 1009, 1009, 1013, 1013, 1013, 1013, + 1014, 1014, 1014, 1014, 1015, 1015, 1016, 1016, 1019, 1022, + 1026, 1026, 1027, 1028, 1029, 1032, 1032, 1033, 1034, 1035, + 1049, 1049, 1050, 1050, 1052, 1061, 1061, 1061, 1061, 1061, + 1061, 1061, 1062, 1062, 1062, 1062, 1062, 1062, 1063, 1066, + 1069, 1075, 1082, 1094, 1099, 1104, 1116, 1125, 1128, 1136, + 1140, 1145, 1146, 1149, 1152, 1162, 1187, 1200, 1228, 1253, + 1273, 1285, 1294, 1298, 1357, 1363, 1371, 1376, 1381, 1384, + 1387, 1394, 1404, 1435, 1442, 1463, 1471, 1476, 1488, 1491, + 1498, 1498, 1508, 1515, 1519, 1522, 1525, 1538, 1558, 1560, + 1564, 1568, 1570, 1572, 1577, 1578, 1580, 1583, 1591, 1596, + 1598, 1602, 1606, 1614, 1614, 1615, 1615, 1617, 1623, 1628, + 1634, 1637, 1642, 1646, 1650, 1730, 1730, 1732, 1740, 1740, + 1742, 1746, 1746, 1755, 1758, 1761, 1764, 1767, 1770, 1773, + 1776, 1800, 1807, 1810, 1815, 1815, 1821, 1825, 1828, 1836, + 1845, 1849, 1859, 1870, 1873, 1876, 1879, 1882, 1896, 1900, + 1953, 1956, 1962, 1970, 1980, 1987, 1992, 1998, 2002, 2008, + 2008, 2010, 2013, 2019, 2032, 2041, 2047, 2053, 2065, 2073, + 2080, 2087, 2096, 2101, 2120, 2142, 2156, 2213, 2219, 2221, + 2225, 2228, 2232, 2235, 2240, 2244, 2248, 2252, 2256, 2263, + 2274, 2288, 2310, 2325, 2331, 2343, 2351, 2363, 2373 }; +#endif -#if YYDEBUG -/* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in - YYRHS. */ -static const unsigned short yyprhs[] = -{ - 0, 0, 3, 5, 7, 9, 11, 13, 15, 17, - 19, 21, 23, 25, 27, 29, 31, 33, 35, 37, - 39, 41, 43, 45, 47, 49, 51, 53, 55, 57, - 59, 61, 63, 65, 67, 70, 71, 73, 75, 77, - 79, 80, 81, 83, 85, 87, 90, 92, 94, 96, - 98, 100, 102, 104, 106, 108, 110, 112, 114, 116, - 118, 120, 122, 124, 126, 128, 130, 132, 135, 140, - 146, 152, 156, 159, 162, 164, 168, 170, 174, 176, - 177, 182, 186, 190, 195, 200, 204, 207, 210, 213, - 216, 219, 222, 225, 228, 231, 234, 241, 247, 256, - 263, 270, 277, 284, 288, 290, 292, 294, 296, 299, - 302, 305, 307, 312, 315, 321, 327, 331, 336, 337, - 339, 341, 345, 349, 353, 357, 361, 363, 364, 366, - 368, 370, 371, 374, 378, 380, 382, 386, 388, 389, - 396, 398, 400, 404, 406, 408, 411, 412, 416, 418, - 420, 422, 424, 426, 428, 430, 434, 436, 438, 440, - 442, 444, 447, 450, 453, 457, 460, 461, 463, 466, - 469, 473, 483, 493, 502, 516, 518, 520, 527, 533, - 536, 543, 551, 553, 557, 559, 560, 563, 565, 571, - 577, 583, 586, 591, 596, 603, 608, 613, 618, 621, - 629, 631, 634, 635, 637, 638, 641, 647, 650, 656, - 659, 664, 671 -}; -/* YYRHS -- A `-1'-separated list of the rules' RHS. */ -static const short yyrhs[] = -{ - 133, 0, -1, 5, -1, 6, -1, 3, -1, 4, - -1, 66, -1, 67, -1, 68, -1, 69, -1, 70, - -1, 71, -1, 72, -1, 73, -1, 74, -1, 75, - -1, 76, -1, 77, -1, 78, -1, 79, -1, 89, - -1, 90, -1, 16, -1, 14, -1, 12, -1, 10, - -1, 17, -1, 15, -1, 13, -1, 11, -1, 115, - -1, 116, -1, 18, -1, 19, -1, 140, 94, -1, - -1, 40, -1, 41, -1, 42, -1, 43, -1, -1, - -1, 57, -1, 58, -1, 59, -1, 56, 4, -1, - 124, -1, 8, -1, 126, -1, 8, -1, 126, -1, - 9, -1, 10, -1, 11, -1, 12, -1, 13, -1, - 14, -1, 15, -1, 16, -1, 17, -1, 18, -1, - 19, -1, 20, -1, 21, -1, 44, -1, 125, -1, - 153, -1, 95, 4, -1, 123, 96, 128, 97, -1, - 98, 4, 99, 126, 100, -1, 101, 4, 99, 126, - 102, -1, 103, 127, 104, -1, 103, 104, -1, 126, - 105, -1, 126, -1, 127, 106, 126, -1, 127, -1, - 127, 106, 36, -1, 36, -1, -1, 124, 98, 131, - 100, -1, 124, 98, 100, -1, 124, 107, 24, -1, - 124, 101, 131, 102, -1, 124, 103, 131, 104, -1, - 124, 103, 104, -1, 124, 37, -1, 124, 38, -1, - 124, 153, -1, 124, 130, -1, 124, 26, -1, 115, - 110, -1, 116, 4, -1, 9, 27, -1, 9, 28, - -1, 118, 7, -1, 87, 96, 129, 35, 124, 97, - -1, 85, 96, 129, 167, 97, -1, 88, 96, 129, - 106, 129, 106, 129, 97, -1, 111, 96, 129, 106, - 129, 97, -1, 112, 96, 129, 106, 129, 97, -1, - 113, 96, 129, 106, 129, 97, -1, 114, 96, 129, - 106, 129, 97, -1, 131, 106, 129, -1, 129, -1, - 32, -1, 33, -1, 134, -1, 134, 149, -1, 134, - 150, -1, 134, 25, -1, 135, -1, 135, 119, 20, - 122, -1, 135, 150, -1, 135, 119, 120, 132, 129, - -1, 135, 119, 46, 132, 124, -1, 135, 47, 137, - -1, 135, 53, 94, 138, -1, -1, 52, -1, 51, - -1, 49, 94, 136, -1, 50, 94, 4, -1, 48, - 94, 24, -1, 98, 139, 100, -1, 139, 106, 24, - -1, 24, -1, -1, 22, -1, 24, -1, 140, -1, - -1, 124, 141, -1, 143, 106, 142, -1, 142, -1, - 143, -1, 143, 106, 36, -1, 36, -1, -1, 121, - 122, 140, 96, 144, 97, -1, 29, -1, 103, -1, - 120, 145, 146, -1, 30, -1, 104, -1, 156, 148, - -1, -1, 31, 151, 145, -1, 3, -1, 4, -1, - 7, -1, 27, -1, 28, -1, 37, -1, 38, -1, - 101, 131, 102, -1, 130, -1, 109, -1, 140, -1, - 153, -1, 152, -1, 124, 154, -1, 156, 157, -1, - 147, 157, -1, 158, 119, 159, -1, 158, 161, -1, - -1, 23, -1, 60, 155, -1, 60, 8, -1, 61, - 21, 154, -1, 61, 9, 154, 106, 21, 154, 106, - 21, 154, -1, 62, 117, 154, 106, 21, 154, 98, - 160, 100, -1, 62, 117, 154, 106, 21, 154, 98, - 100, -1, 63, 121, 122, 154, 96, 164, 97, 35, - 21, 154, 64, 21, 154, -1, 64, -1, 65, -1, - 160, 117, 152, 106, 21, 154, -1, 117, 152, 106, - 21, 154, -1, 119, 166, -1, 124, 98, 154, 106, - 154, 100, -1, 162, 106, 98, 154, 106, 154, 100, - -1, 155, -1, 163, 106, 155, -1, 163, -1, -1, - 55, 54, -1, 54, -1, 111, 124, 154, 106, 154, - -1, 112, 124, 154, 106, 154, -1, 113, 124, 154, - 106, 154, -1, 45, 155, -1, 114, 155, 106, 155, - -1, 87, 155, 35, 124, -1, 88, 155, 106, 155, - 106, 155, -1, 91, 155, 106, 124, -1, 92, 155, - 106, 124, -1, 93, 155, 106, 124, -1, 86, 162, - -1, 165, 121, 122, 154, 96, 164, 97, -1, 169, - -1, 106, 163, -1, -1, 34, -1, -1, 80, 124, - -1, 80, 124, 106, 15, 154, -1, 81, 124, -1, - 81, 124, 106, 15, 154, -1, 82, 155, -1, 168, - 83, 124, 154, -1, 168, 84, 155, 106, 124, 154, - -1, 85, 124, 154, 167, -1 -}; +#if YYDEBUG != 0 || defined (YYERROR_VERBOSE) -/* YYRLINE[YYN] -- source line where rule number YYN was defined. */ -static const unsigned short yyrline[] = -{ - 0, 982, 982, 983, 990, 991, 1000, 1000, 1000, 1000, - 1000, 1001, 1001, 1001, 1002, 1002, 1002, 1002, 1002, 1002, - 1004, 1004, 1008, 1008, 1008, 1008, 1009, 1009, 1009, 1009, - 1010, 1010, 1011, 1011, 1014, 1017, 1021, 1022, 1023, 1024, - 1025, 1027, 1028, 1029, 1030, 1031, 1044, 1044, 1045, 1045, - 1047, 1056, 1056, 1056, 1056, 1056, 1056, 1056, 1057, 1057, - 1057, 1057, 1057, 1057, 1058, 1061, 1064, 1070, 1077, 1089, - 1093, 1104, 1113, 1116, 1124, 1128, 1133, 1134, 1137, 1140, - 1150, 1175, 1188, 1216, 1241, 1261, 1273, 1282, 1286, 1345, - 1351, 1359, 1364, 1369, 1372, 1375, 1382, 1392, 1423, 1430, - 1451, 1458, 1463, 1473, 1476, 1483, 1483, 1493, 1500, 1504, - 1507, 1510, 1523, 1543, 1545, 1549, 1553, 1555, 1557, 1562, - 1563, 1565, 1568, 1576, 1581, 1583, 1587, 1591, 1599, 1599, - 1600, 1600, 1602, 1608, 1613, 1619, 1622, 1627, 1631, 1635, - 1715, 1715, 1717, 1725, 1725, 1727, 1731, 1731, 1740, 1743, - 1746, 1749, 1752, 1755, 1758, 1761, 1785, 1792, 1795, 1800, - 1800, 1806, 1810, 1813, 1821, 1830, 1834, 1844, 1855, 1858, - 1861, 1864, 1867, 1881, 1885, 1938, 1941, 1947, 1955, 1965, - 1972, 1977, 1984, 1988, 1994, 1994, 1996, 1999, 2005, 2017, - 2025, 2035, 2047, 2054, 2061, 2068, 2073, 2092, 2114, 2128, - 2185, 2191, 2193, 2197, 2200, 2206, 2210, 2214, 2218, 2222, - 2229, 2239, 2252 +static const char * const yytname[] = { "$","error","$undefined.","ESINT64VAL", +"EUINT64VAL","SINTVAL","UINTVAL","FPVAL","VOID","BOOL","SBYTE","UBYTE","SHORT", +"USHORT","INT","UINT","LONG","ULONG","FLOAT","DOUBLE","TYPE","LABEL","VAR_ID", +"LABELSTR","STRINGCONSTANT","IMPLEMENTATION","ZEROINITIALIZER","TRUETOK","FALSETOK", +"BEGINTOK","ENDTOK","DECLARE","GLOBAL","CONSTANT","VOLATILE","FIXED","TO","DOTDOTDOT", +"NULL_TOK","UNDEF","CONST","INTERNAL","LINKONCE","WEAK","APPENDING","OPAQUE", +"NOT","EXTERNAL","TARGET","TRIPLE","ENDIAN","POINTERSIZE","LITTLE","BIG","DEPLIBS", +"CALL","TAIL","CC_TOK","CCC_TOK","FASTCC_TOK","COLDCC_TOK","VECTOR","OF","RET", +"BR","SWITCH","INVOKE","UNWIND","UNREACHABLE","ADD","SUB","MUL","DIV","REM", +"AND","OR","XOR","SETLE","SETGE","SETLT","SETGT","SETEQ","SETNE","VSETLE","VSETGE", +"VSETLT","VSETGT","VSETEQ","VSETNE","MALLOC","ALLOCA","FREE","LOAD","STORE", +"GETELEMENTPTR","PHI_TOK","CAST","SELECT","VSELECT","SHL","SHR","VAARG","VGATHER", +"VIMM","VSCATTER","EXTRACT","EXTRACTELEMENT","COMBINE","COMBINEELEMENT","VAARG_old", +"VANEXT_old","'='","'\\\\'","'('","')'","'['","'x'","']'","'{'","'}'","'*'", +"','","'c'","'<'","'>'","INTVAL","EINT64VAL","ArithmeticOps","LogicalOps","SetCondOps", +"VSetCondOps","ShiftOps","SIntType","UIntType","IntType","FPType","OptAssign", +"OptLinkage","OptCallingConv","TypesV","UpRTypesV","Types","PrimType","UpRTypes", +"TypeListI","ArgTypeListI","ConstVal","ConstExpr","ConstVector","GlobalType", +"Module","FunctionList","ConstPool","BigOrLittle","TargetDefinition","LibrariesDefinition", +"LibList","Name","OptName","ArgVal","ArgListH","ArgList","FunctionHeaderH","BEGIN", +"FunctionHeader","END","Function","FunctionProto","@1","ConstValueRef","SymbolicValueRef", +"ValueRef","ResolvedVal","BasicBlockList","BasicBlock","InstructionList","BBTerminatorInst", +"JumpTable","Inst","PHIList","ValueRefList","ValueRefListE","OptTailCall","InstVal", +"IndexList","OptVolatile","OptFixed","MemoryInst", NULL }; #endif -#if YYDEBUG || YYERROR_VERBOSE -/* YYTNME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM. - First, the terminals, then, starting at YYNTOKENS, nonterminals. */ -static const char *const yytname[] = -{ - "$end", "error", "$undefined", "ESINT64VAL", "EUINT64VAL", "SINTVAL", - "UINTVAL", "FPVAL", "VOID", "BOOL", "SBYTE", "UBYTE", "SHORT", "USHORT", - "INT", "UINT", "LONG", "ULONG", "FLOAT", "DOUBLE", "TYPE", "LABEL", - "VAR_ID", "LABELSTR", "STRINGCONSTANT", "IMPLEMENTATION", - "ZEROINITIALIZER", "TRUETOK", "FALSETOK", "BEGINTOK", "ENDTOK", - "DECLARE", "GLOBAL", "CONSTANT", "VOLATILE", "TO", "DOTDOTDOT", - "NULL_TOK", "UNDEF", "CONST", "INTERNAL", "LINKONCE", "WEAK", - "APPENDING", "OPAQUE", "NOT", "EXTERNAL", "TARGET", "TRIPLE", "ENDIAN", - "POINTERSIZE", "LITTLE", "BIG", "DEPLIBS", "CALL", "TAIL", "CC_TOK", - "CCC_TOK", "FASTCC_TOK", "COLDCC_TOK", "RET", "BR", "SWITCH", "INVOKE", - "UNWIND", "UNREACHABLE", "ADD", "SUB", "MUL", "DIV", "REM", "AND", "OR", - "XOR", "SETLE", "SETGE", "SETLT", "SETGT", "SETEQ", "SETNE", "MALLOC", - "ALLOCA", "FREE", "LOAD", "STORE", "GETELEMENTPTR", "PHI_TOK", "CAST", - "SELECT", "SHL", "SHR", "VAARG", "VAARG_old", "VANEXT_old", "'='", - "'\\\\'", "'('", "')'", "'['", "'x'", "']'", "'<'", "'>'", "'{'", "'}'", - "'*'", "','", "'c'", "$accept", "INTVAL", "EINT64VAL", "ArithmeticOps", - "LogicalOps", "SetCondOps", "ShiftOps", "SIntType", "UIntType", - "IntType", "FPType", "OptAssign", "OptLinkage", "OptCallingConv", - "TypesV", "UpRTypesV", "Types", "PrimType", "UpRTypes", "TypeListI", - "ArgTypeListI", "ConstVal", "ConstExpr", "ConstVector", "GlobalType", - "Module", "FunctionList", "ConstPool", "BigOrLittle", "TargetDefinition", - "LibrariesDefinition", "LibList", "Name", "OptName", "ArgVal", - "ArgListH", "ArgList", "FunctionHeaderH", "BEGIN", "FunctionHeader", - "END", "Function", "FunctionProto", "@1", "ConstValueRef", - "SymbolicValueRef", "ValueRef", "ResolvedVal", "BasicBlockList", - "BasicBlock", "InstructionList", "BBTerminatorInst", "JumpTable", "Inst", - "PHIList", "ValueRefList", "ValueRefListE", "OptTailCall", "InstVal", - "IndexList", "OptVolatile", "MemoryInst", 0 +static const short yyr1[] = { 0, + 125, 125, 126, 126, 127, 127, 127, 127, 127, 128, + 128, 128, 129, 129, 129, 129, 129, 129, 130, 130, + 130, 130, 130, 130, 131, 131, 132, 132, 132, 132, + 133, 133, 133, 133, 134, 134, 135, 135, 136, 136, + 137, 137, 137, 137, 137, 138, 138, 138, 138, 138, + 139, 139, 140, 140, 141, 142, 142, 142, 142, 142, + 142, 142, 142, 142, 142, 142, 142, 142, 143, 143, + 143, 143, 143, 143, 143, 143, 143, 143, 143, 144, + 144, 145, 145, 145, 145, 146, 146, 146, 146, 146, + 146, 146, 146, 146, 146, 146, 146, 146, 146, 146, + 146, 147, 147, 147, 147, 147, 147, 147, 148, 148, + 149, 149, 150, 151, 151, 151, 151, 152, 152, 152, + 152, 152, 152, 152, 153, 153, 154, 154, 154, 155, + 156, 156, 156, 157, 157, 158, 158, 159, 160, 160, + 161, 161, 161, 161, 162, 163, 163, 164, 165, 165, + 166, 168, 167, 169, 169, 169, 169, 169, 169, 169, + 169, 169, 170, 170, 171, 171, 172, 173, 173, 174, + 175, 175, 175, 176, 176, 176, 176, 176, 176, 176, + 176, 176, 177, 177, 178, 179, 179, 180, 180, 181, + 181, 182, 182, 183, 183, 183, 183, 183, 183, 183, + 183, 183, 183, 183, 183, 183, 183, 183, 184, 184, + 185, 185, 186, 186, 187, 187, 187, 187, 187, 187, + 187, 187, 187, 187, 187, 187, 187, 187, 187 }; -#endif -# ifdef YYPRINT -/* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to - token YYLEX-NUM. */ -static const unsigned short yytoknum[] = -{ - 0, 256, 257, 258, 259, 260, 261, 262, 263, 264, - 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, - 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, - 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, - 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, - 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, - 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, - 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, - 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, - 345, 346, 347, 348, 61, 92, 40, 41, 91, 120, - 93, 60, 62, 123, 125, 42, 44, 99 +static const short yyr2[] = { 0, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 2, 0, + 1, 1, 1, 1, 0, 0, 1, 1, 1, 2, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 2, 4, 5, 5, 6, 3, 2, 2, 1, + 3, 1, 3, 1, 0, 4, 3, 3, 4, 4, + 3, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 6, 5, 8, 6, 6, 6, 6, 3, 1, + 1, 1, 1, 2, 2, 2, 1, 4, 2, 5, + 5, 3, 4, 0, 1, 1, 3, 3, 3, 3, + 3, 1, 0, 1, 1, 1, 0, 2, 3, 1, + 1, 3, 1, 0, 6, 1, 1, 3, 1, 1, + 2, 0, 3, 1, 1, 1, 1, 1, 1, 1, + 3, 1, 1, 1, 1, 1, 2, 2, 2, 3, + 2, 0, 1, 2, 2, 3, 9, 9, 8, 13, + 1, 1, 6, 5, 2, 6, 7, 1, 3, 1, + 0, 2, 1, 5, 5, 5, 5, 2, 4, 4, + 6, 6, 4, 4, 4, 2, 7, 1, 2, 0, + 1, 0, 1, 0, 2, 5, 2, 5, 2, 4, + 6, 4, 4, 5, 8, 4, 8, 6, 6 }; -# endif -/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ -static const unsigned char yyr1[] = -{ - 0, 108, 109, 109, 110, 110, 111, 111, 111, 111, - 111, 112, 112, 112, 113, 113, 113, 113, 113, 113, - 114, 114, 115, 115, 115, 115, 116, 116, 116, 116, - 117, 117, 118, 118, 119, 119, 120, 120, 120, 120, - 120, 121, 121, 121, 121, 121, 122, 122, 123, 123, - 124, 125, 125, 125, 125, 125, 125, 125, 125, 125, - 125, 125, 125, 125, 126, 126, 126, 126, 126, 126, - 126, 126, 126, 126, 127, 127, 128, 128, 128, 128, - 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, - 129, 129, 129, 129, 129, 129, 130, 130, 130, 130, - 130, 130, 130, 131, 131, 132, 132, 133, 134, 134, - 134, 134, 135, 135, 135, 135, 135, 135, 135, 136, - 136, 137, 137, 137, 138, 139, 139, 139, 140, 140, - 141, 141, 142, 143, 143, 144, 144, 144, 144, 145, - 146, 146, 147, 148, 148, 149, 151, 150, 152, 152, - 152, 152, 152, 152, 152, 152, 152, 153, 153, 154, - 154, 155, 156, 156, 157, 158, 158, 158, 159, 159, - 159, 159, 159, 159, 159, 159, 159, 160, 160, 161, - 162, 162, 163, 163, 164, 164, 165, 165, 166, 166, - 166, 166, 166, 166, 166, 166, 166, 166, 166, 166, - 166, 167, 167, 168, 168, 169, 169, 169, 169, 169, - 169, 169, 169 +static const short yydefact[] = { 124, + 45, 117, 116, 152, 41, 42, 43, 44, 46, 172, + 114, 115, 172, 134, 135, 0, 0, 45, 0, 119, + 46, 0, 47, 48, 49, 0, 0, 173, 169, 40, + 149, 150, 151, 168, 0, 0, 0, 122, 0, 0, + 0, 0, 39, 153, 50, 1, 2, 52, 56, 57, + 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, + 68, 69, 0, 0, 0, 163, 0, 0, 51, 70, + 55, 164, 71, 146, 147, 148, 212, 171, 0, 0, + 0, 133, 123, 118, 111, 112, 0, 0, 72, 0, + 0, 54, 78, 80, 0, 0, 85, 79, 211, 213, + 0, 193, 0, 0, 0, 0, 46, 181, 182, 5, + 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, + 16, 17, 18, 19, 20, 21, 22, 23, 24, 0, + 0, 0, 0, 0, 0, 0, 0, 25, 26, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 170, 46, 185, 0, 0, 208, 129, + 126, 125, 127, 128, 132, 0, 121, 56, 57, 58, + 59, 60, 61, 62, 63, 64, 65, 66, 0, 0, + 0, 0, 120, 0, 0, 77, 0, 144, 84, 82, + 0, 0, 198, 192, 175, 174, 0, 0, 30, 34, + 29, 33, 28, 32, 27, 31, 35, 36, 0, 0, + 215, 217, 219, 0, 0, 206, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 130, 0, 99, + 100, 3, 4, 97, 98, 101, 96, 92, 93, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 95, 94, 53, 0, 53, 81, 143, 137, 140, 141, + 0, 0, 73, 154, 155, 156, 157, 158, 159, 160, + 0, 162, 166, 165, 167, 0, 176, 0, 0, 0, + 0, 210, 0, 0, 0, 0, 0, 0, 210, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 131, 0, 0, 0, 87, + 110, 0, 91, 0, 88, 0, 0, 0, 0, 0, + 74, 53, 75, 136, 138, 0, 145, 83, 0, 0, + 0, 0, 0, 0, 0, 222, 0, 0, 200, 0, + 0, 203, 223, 0, 0, 226, 0, 0, 204, 205, + 0, 0, 0, 0, 199, 0, 220, 0, 0, 210, + 0, 0, 86, 0, 90, 89, 0, 0, 0, 0, + 76, 142, 139, 161, 0, 0, 191, 216, 218, 188, + 209, 0, 0, 0, 0, 210, 0, 0, 0, 194, + 195, 196, 197, 191, 0, 224, 0, 0, 0, 109, + 0, 0, 0, 0, 0, 0, 190, 0, 0, 0, + 0, 201, 202, 229, 0, 0, 228, 0, 221, 103, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 189, + 186, 0, 0, 0, 207, 102, 0, 105, 106, 107, + 108, 0, 179, 0, 0, 0, 187, 225, 227, 0, + 177, 0, 178, 0, 0, 104, 0, 0, 0, 0, + 0, 0, 184, 0, 0, 183, 180, 0, 0, 0 }; -/* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */ -static const unsigned char yyr2[] = -{ - 0, 2, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 2, 0, 1, 1, 1, 1, - 0, 0, 1, 1, 1, 2, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 2, 4, 5, - 5, 3, 2, 2, 1, 3, 1, 3, 1, 0, - 4, 3, 3, 4, 4, 3, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 6, 5, 8, 6, - 6, 6, 6, 3, 1, 1, 1, 1, 2, 2, - 2, 1, 4, 2, 5, 5, 3, 4, 0, 1, - 1, 3, 3, 3, 3, 3, 1, 0, 1, 1, - 1, 0, 2, 3, 1, 1, 3, 1, 0, 6, - 1, 1, 3, 1, 1, 2, 0, 3, 1, 1, - 1, 1, 1, 1, 1, 3, 1, 1, 1, 1, - 1, 2, 2, 2, 3, 2, 0, 1, 2, 2, - 3, 9, 9, 8, 13, 1, 1, 6, 5, 2, - 6, 7, 1, 3, 1, 0, 2, 1, 5, 5, - 5, 2, 4, 4, 6, 4, 4, 4, 2, 7, - 1, 2, 0, 1, 0, 2, 5, 2, 5, 2, - 4, 6, 4 +static const short yydefgoto[] = { 66, + 244, 257, 258, 259, 152, 260, 179, 180, 209, 181, + 18, 9, 26, 67, 68, 192, 70, 71, 95, 191, + 321, 282, 322, 87, 478, 1, 2, 163, 38, 83, + 166, 72, 335, 269, 270, 271, 27, 76, 10, 33, + 11, 12, 21, 283, 73, 285, 390, 13, 29, 30, + 154, 455, 78, 216, 417, 418, 155, 156, 346, 157, + 158, 159 }; -/* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state - STATE-NUM when YYTABLE doesn't specify something else to do. Zero - means the default is an error. */ -static const unsigned char yydefact[] = -{ - 118, 0, 40, 111, 1, 110, 146, 36, 37, 38, - 39, 41, 166, 108, 109, 166, 128, 129, 0, 0, - 40, 0, 113, 41, 0, 42, 43, 44, 0, 0, - 167, 163, 35, 143, 144, 145, 162, 0, 0, 0, - 116, 0, 0, 0, 0, 34, 147, 45, 2, 3, - 47, 51, 52, 53, 54, 55, 56, 57, 58, 59, - 60, 61, 62, 63, 64, 0, 0, 0, 0, 157, - 0, 0, 46, 65, 50, 158, 66, 140, 141, 142, - 204, 165, 0, 0, 0, 127, 117, 112, 105, 106, - 0, 0, 67, 0, 0, 49, 72, 74, 0, 0, - 79, 73, 203, 0, 187, 0, 0, 0, 0, 41, - 175, 176, 6, 7, 8, 9, 10, 11, 12, 13, - 14, 15, 16, 17, 18, 19, 0, 0, 0, 0, - 0, 0, 0, 20, 21, 0, 0, 0, 0, 0, - 0, 0, 164, 41, 179, 0, 200, 123, 120, 119, - 121, 122, 126, 0, 115, 51, 52, 53, 54, 55, - 56, 57, 58, 59, 60, 61, 0, 0, 0, 0, - 114, 0, 0, 71, 0, 138, 78, 76, 0, 0, - 191, 186, 169, 168, 0, 0, 25, 29, 24, 28, - 23, 27, 22, 26, 30, 31, 0, 0, 205, 207, - 209, 0, 0, 198, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 124, 0, 93, 94, - 4, 5, 91, 92, 95, 90, 86, 87, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 89, - 88, 48, 48, 75, 137, 131, 134, 135, 0, 0, - 68, 148, 149, 150, 151, 152, 153, 154, 0, 156, - 160, 159, 161, 0, 170, 0, 0, 0, 0, 202, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 125, 0, 0, 0, 81, 104, - 0, 0, 85, 0, 82, 0, 0, 0, 0, 69, - 70, 130, 132, 0, 139, 77, 0, 0, 0, 0, - 0, 0, 0, 212, 0, 0, 193, 0, 195, 196, - 197, 0, 0, 0, 192, 0, 210, 0, 202, 0, - 0, 80, 0, 83, 84, 0, 0, 0, 0, 136, - 133, 155, 0, 0, 185, 206, 208, 182, 201, 0, - 0, 0, 188, 189, 190, 185, 0, 0, 0, 0, - 103, 0, 0, 0, 0, 0, 0, 184, 0, 0, - 0, 0, 194, 0, 211, 97, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 183, 180, 0, 199, 96, - 0, 99, 100, 101, 102, 0, 173, 0, 0, 0, - 181, 0, 171, 0, 172, 0, 0, 98, 0, 0, - 0, 0, 0, 0, 178, 0, 0, 177, 174 +static const short yypact[] = {-32768, + 11, 169,-32768,-32768,-32768,-32768,-32768,-32768, 40, -11, +-32768,-32768, -17,-32768,-32768, 68, -68, 93, -61,-32768, + 40, 66,-32768,-32768,-32768, 1089, -22,-32768,-32768, 34, +-32768,-32768,-32768,-32768, -5, 18, 30,-32768, 1, 1089, + 77, 77,-32768,-32768,-32768,-32768,-32768, 8,-32768,-32768, +-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768, +-32768,-32768, 147, 6, 67,-32768, 34, 48,-32768,-32768, + -74,-32768,-32768,-32768,-32768,-32768, 1261,-32768, 148, 80, + 174, 159,-32768,-32768,-32768,-32768, 1127, 1165,-32768, 71, + 126,-32768,-32768, -74, -55, 79, 899,-32768,-32768,-32768, + 1127,-32768, 135, 1203, 28, 154, 40,-32768,-32768,-32768, +-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768, +-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768, 1127, + 1127, 1127, 1127, 1127, 1127, 1127, 1127,-32768,-32768, 1127, + 1127, 1127, 1127, 1127, 1127, 1127, 1127, 1127, 1127, 1127, + 1127, 1127, 1127,-32768, 40,-32768, 46, 91,-32768,-32768, +-32768,-32768,-32768,-32768,-32768, -76,-32768, 116, 145, 191, + 156, 192, 170, 193, 173, 194, 196, 197, 177, 201, + 199, 780,-32768, 1127, 456,-32768, 1127, 937,-32768, 97, + 100, 621,-32768,-32768, 8,-32768, 621, 621,-32768,-32768, +-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768, 621, 1089, + 98, 99,-32768, 621, 106, 101, 188, 104, 105, 108, + 621, 113, 114, 115, 117, 118, 119, 124, 621, 621, + 621, 621, 127, 1089, 1127, 1127, 1127,-32768, 213,-32768, +-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768, 136, + 137, 138, 975, 820, 228, 1165, 140, 141, 143, 144, +-32768,-32768, -73, 1127, -52, -74,-32768, 34,-32768, 139, + 149, 1013,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768, + 1165,-32768,-32768,-32768,-32768, 150,-32768, 152, 621, 243, + 244, 155, 621, 151, 1127, 1127, 1127, 1127, 155, 1127, + 1127, 1127, 1127, 1127, 1127, 1127, 157, 160, 161, 162, + 1127, 621, 621, 163, 164,-32768, 1165, 1165, 1165,-32768, +-32768, -58,-32768, -18,-32768, -50, 1165, 1165, 1165, 1165, +-32768, -27,-32768,-32768,-32768, 1051,-32768,-32768, -29, 240, + 241, 176, 621, 621, 1127,-32768, 165, 621,-32768, 166, + 175,-32768,-32768, 621, 178,-32768, 179, 184,-32768,-32768, + 621, 621, 621, 621,-32768, 181,-32768, 1127, 1127, 155, + 229, 187,-32768, 1165,-32768,-32768, 195, 198, 203, 208, +-32768,-32768,-32768,-32768, 621, 621, 1127,-32768,-32768,-32768, + 209, 621, 210, 1127, 1127, 155, 1127, 1127, 1127,-32768, +-32768,-32768,-32768, 1127, 621,-32768, 153, 1127, 1165,-32768, + 1165, 1165, 1165, 1165, 211, 180, 209, 183, 1127, 158, + 621,-32768,-32768,-32768, 215, 216,-32768, 204,-32768,-32768, + 206, 217, 220, 225, 226, 227, 247, 5, 254,-32768, +-32768, 200, 1127, 1127,-32768,-32768, 1165,-32768,-32768,-32768, +-32768, 621,-32768, 701, 14, 256,-32768,-32768,-32768, 231, +-32768, 230,-32768, 701, 621,-32768, 277, 232, 242, 621, + 294, 301,-32768, 621, 621,-32768,-32768, 264, 346,-32768 }; -/* YYDEFGOTO[NTERM-NUM]. */ -static const short yydefgoto[] = -{ - -1, 69, 222, 235, 236, 237, 238, 166, 167, 196, - 168, 20, 11, 28, 70, 71, 169, 73, 74, 98, - 178, 289, 259, 290, 90, 1, 2, 3, 150, 40, - 86, 153, 75, 302, 246, 247, 248, 29, 79, 12, - 35, 13, 14, 23, 260, 76, 262, 347, 15, 31, - 32, 142, 398, 81, 203, 367, 368, 143, 144, 313, - 145, 146 +static const short yypgoto[] = {-32768, +-32768, 270, 272, 279,-32768, 280, -105, -103, -404,-32768, + 324, 340, -98, -35,-32768, -26,-32768, -57, 262,-32768, + -86, 182, -221, 320,-32768,-32768,-32768,-32768,-32768,-32768, +-32768, 2,-32768, 27,-32768,-32768, 344,-32768,-32768,-32768, +-32768, 364,-32768, -416, 202, 146, 10,-32768, 355,-32768, +-32768,-32768,-32768,-32768, 24, -34,-32768,-32768, -276,-32768, +-32768,-32768 }; -/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing - STATE-NUM. */ -#define YYPACT_NINF -383 -static const short yypact[] = -{ - -383, 48, 136, 517, -383, -383, -383, -383, -383, -383, - -383, 27, 36, -383, -383, -17, -383, -383, 46, -21, - -3, 3, -383, 27, 73, -383, -383, -383, 879, -24, - -383, -383, 113, -383, -383, -383, -383, 20, 51, 60, - -383, 21, 879, -13, -13, -383, -383, -383, -383, -383, - 62, -383, -383, -383, -383, -383, -383, -383, -383, -383, - -383, -383, -383, -383, -383, 156, 162, 164, 480, -383, - 113, 76, -383, -383, -25, -383, -383, -383, -383, -383, - 992, -383, 149, 37, 170, 157, -383, -383, -383, -383, - 900, 941, -383, 81, 83, -383, -383, -25, 34, 87, - 643, -383, -383, 900, -383, 130, 999, 32, 243, 27, - -383, -383, -383, -383, -383, -383, -383, -383, -383, -383, - -383, -383, -383, -383, -383, -383, 900, 900, 900, 900, - 900, 900, 900, -383, -383, 900, 900, 900, 900, 900, - 900, 900, -383, 27, -383, 22, -383, -383, -383, -383, - -383, -383, -383, -82, -383, 122, 148, 184, 153, 185, - 159, 186, 161, 187, 191, 193, 167, 197, 195, 380, - -383, 900, 900, -383, 900, 680, -383, 97, 114, 549, - -383, -383, 62, -383, 549, 549, -383, -383, -383, -383, - -383, -383, -383, -383, -383, -383, 549, 879, 108, 109, - -383, 549, 118, 111, 183, 116, 117, 119, 121, 549, - 549, 549, 124, 879, 900, 900, -383, 196, -383, -383, - -383, -383, -383, -383, -383, -383, -383, -383, 123, 132, - 135, 742, 941, 501, 208, 137, 144, 145, 147, -383, - -383, -84, -12, -25, -383, 113, -383, 155, 154, 779, - -383, -383, -383, -383, -383, -383, -383, -383, 941, -383, - -383, -383, -383, 158, -383, 160, 549, 235, 247, 173, - 549, 165, 900, 900, 900, 900, 900, 174, 175, 176, - 900, 549, 549, 177, -383, 941, 941, 941, -383, -383, - -54, -57, -383, 42, -383, 941, 941, 941, 941, -383, - -383, -383, -383, 842, -383, -383, -30, 244, 246, 172, - 549, 549, 900, -383, 179, 549, -383, 180, -383, -383, - -383, 549, 549, 549, -383, 194, -383, 900, 173, 241, - 181, -383, 941, -383, -383, 190, 198, 199, 202, -383, - -383, -383, 549, 549, 900, -383, -383, -383, 205, 549, - 206, 900, -383, -383, -383, 900, 549, 192, 900, 941, - -383, 941, 941, 941, 941, 207, 203, 205, 200, 900, - 214, 549, -383, 218, -383, -383, 220, 212, 222, 223, - 224, 225, 281, 17, 268, -383, -383, 226, -383, -383, - 941, -383, -383, -383, -383, 549, -383, 54, 53, 303, - -383, 228, -383, 227, -383, 54, 549, -383, 307, 231, - 265, 549, 310, 311, -383, 549, 549, -383, -383 -}; -/* YYPGOTO[NTERM-NUM]. */ -static const short yypgoto[] = -{ - -383, -383, -383, 254, 262, 264, 272, -106, -105, -372, - -383, 313, 333, -101, -38, -383, -28, -383, -56, 255, - -383, -90, 188, -223, 312, -383, -383, -383, -383, -383, - -383, -383, 4, -383, 55, -383, -383, 331, -383, -383, - -383, -383, 356, -383, -382, 25, 28, -81, -383, 345, - -383, -383, -383, -383, -383, 49, 7, -383, -383, 35, - -383, -383 -}; +#define YYLAST 1371 -/* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If - positive, shift that token. If negative, reduce the rule which - number is the opposite. If zero, do what YYDEFACT says. - If YYTABLE_NINF, syntax error. */ -#define YYTABLE_NINF -108 -static const short yytable[] = -{ - 72, 170, 194, 195, 87, 77, 30, 21, 197, 291, - 293, 397, 97, 33, 72, 403, 299, 42, 216, 88, - 89, 101, 180, 409, 217, 183, 405, 186, 187, 188, - 189, 190, 191, 192, 193, 306, 21, 7, 8, 9, - 10, 184, 213, 43, 97, 333, 331, 200, 4, 332, - 204, 205, 332, 185, 206, 207, 208, 251, 252, 30, - 212, 253, 154, 186, 187, 188, 189, 190, 191, 192, - 193, -48, 341, 41, 99, 179, 332, 47, 179, 78, - 101, 254, 255, 24, 25, 26, 27, 34, 148, 149, - 300, 256, 257, 101, 37, 38, 39, 45, 198, 199, - 179, 201, 202, 179, 179, 214, 215, 179, 179, 179, - 209, 210, 211, 179, 82, 241, 242, 396, 243, 85, - 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, - 122, 123, 124, 125, 283, 16, -107, 17, 173, 228, - 174, 229, 230, 133, 134, 83, 334, 245, 332, 218, - 219, -25, -25, 404, 84, 258, -24, -24, -49, 266, - 92, 5, -23, -23, -22, -22, 93, 6, 94, 72, - 220, 221, 100, 147, 151, 281, 7, 8, 9, 10, - 171, 152, 172, 175, 181, 72, 282, 179, -29, -28, - -27, -26, 317, 243, 240, 328, 329, 330, -32, 324, - -33, 223, 224, 249, 261, 335, 336, 337, 338, 261, - 261, 250, 263, 264, 267, 268, 270, 271, 272, 285, - 284, 261, 273, 274, 265, 275, 261, 276, 286, 269, - 280, 287, 294, 295, 261, 261, 261, 277, 278, 279, - 296, 297, 360, 298, 316, 179, 318, 319, 320, 301, - 310, 304, 179, 186, 187, 188, 189, 190, 191, 192, - 193, 303, 311, 315, 307, 342, 308, 343, 344, 377, - 372, 378, 379, 380, 381, 245, 358, 194, 195, 312, - 321, 322, 323, 327, 179, 349, 351, 359, 385, 375, - 355, 261, 194, 195, 309, 261, 361, 384, 314, 356, - 401, 383, 395, 399, 362, 363, 261, 261, 364, 325, - 326, 369, 371, 382, 386, 388, 179, 389, 390, 391, - 392, 393, 394, 179, 406, 407, 400, 179, 411, 413, - 376, 415, 416, 408, 138, 261, 261, 412, 345, 346, - 261, 179, 139, 350, 140, 80, 261, 261, 261, 352, - 353, 354, 141, 44, 46, 177, 91, 239, 340, 22, - 36, 348, 373, 357, 0, 0, 0, 261, 261, 0, - 365, 366, 0, 0, 261, 0, 0, 370, 0, 0, - 0, 261, 0, 0, 374, 48, 49, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 261, 0, 0, 387, - 0, 0, 16, 0, 17, 0, 225, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 226, 227, 0, - 261, 0, 0, 402, 0, 0, 0, 0, 0, 0, - 0, 261, 0, 0, 410, 0, 261, 0, 0, 414, - 261, 261, 0, 417, 418, 0, 112, 113, 114, 115, - 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, - 0, 0, 0, 0, 0, 228, 0, 229, 230, 133, - 134, 0, 0, 0, 0, 0, 0, 0, 231, 0, - 0, 232, 0, 233, 0, 48, 49, 234, 95, 51, - 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, - 62, 63, 16, 0, 17, 0, 48, 49, 0, 95, - 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, - 165, 62, 63, 16, 64, 17, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, -35, 0, 16, - 0, 17, 0, 0, 0, 64, 0, 0, 6, -35, - -35, 0, 251, 252, 48, 49, 253, -35, -35, -35, - -35, 0, 0, -35, 18, 0, 0, 0, 0, 0, - 19, 16, 0, 17, 0, 65, 254, 255, 66, 0, - 0, 67, 0, 68, 96, 0, 256, 257, 0, 0, - 0, 0, 0, 0, 0, 0, 65, 0, 0, 66, - 0, 0, 67, 0, 68, 292, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 112, 113, 114, 115, 116, - 117, 118, 119, 120, 121, 122, 123, 124, 125, 0, - 0, 0, 0, 0, 228, 0, 229, 230, 133, 134, - 0, 0, 0, 0, 0, 0, 0, 0, 48, 49, - 258, 95, 51, 52, 53, 54, 55, 56, 57, 58, - 59, 60, 61, 62, 63, 16, 0, 17, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 176, - 0, 0, 0, 0, 0, 48, 49, 64, 95, 51, - 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, - 62, 63, 16, 0, 17, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 244, 0, 0, 0, - 0, 0, 0, 0, 64, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 65, 0, - 0, 66, 0, 0, 67, 0, 68, 48, 49, 0, - 95, 155, 156, 157, 158, 159, 160, 161, 162, 163, - 164, 165, 62, 63, 16, 0, 17, 0, 0, 0, - 0, 0, 0, 0, 0, 65, 0, 0, 66, 0, - 0, 67, 0, 68, 48, 49, 64, 95, 51, 52, - 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, - 63, 16, 0, 17, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 305, 0, 0, 0, 0, - 0, 0, 0, 64, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 65, 0, 0, - 66, 0, 288, 67, 0, 68, 0, 48, 49, 0, - 95, 51, 52, 53, 54, 55, 56, 57, 58, 59, - 60, 61, 62, 63, 16, 0, 17, 0, 0, 0, - 0, 0, 0, 0, 65, 0, 0, 66, 339, 0, - 67, 0, 68, 0, 48, 49, 64, 50, 51, 52, - 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, - 63, 16, 0, 17, 0, 48, 49, 0, 95, 51, - 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, - 62, 63, 16, 64, 17, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 65, 0, 0, - 66, 0, 0, 67, 64, 68, 48, 49, 0, 95, - 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, - 165, 62, 63, 16, 0, 17, 0, 0, 0, 0, - 0, 0, 0, 0, 65, 0, 0, 66, 0, 0, - 67, 0, 68, 0, 0, 64, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 65, 0, 0, 66, 0, - 0, 67, 0, 68, 48, 49, 0, 182, 51, 52, - 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, - 63, 16, 0, 17, 0, 0, 102, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 65, 103, 0, 66, - 0, 0, 67, 64, 68, 0, 104, 105, 0, 0, - 0, 0, 106, 107, 108, 109, 110, 111, 112, 113, - 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, - 124, 125, 126, 127, 128, 0, 0, 129, 130, 131, - 132, 133, 134, 135, 136, 137, 0, 0, 0, 0, - 0, 0, 0, 0, 65, 0, 0, 66, 0, 0, - 67, 0, 68 -}; -static const short yycheck[] = -{ - 28, 91, 108, 108, 42, 29, 23, 3, 109, 232, - 233, 383, 68, 30, 42, 397, 100, 20, 100, 32, - 33, 105, 103, 405, 106, 106, 398, 10, 11, 12, - 13, 14, 15, 16, 17, 258, 32, 40, 41, 42, - 43, 9, 143, 46, 100, 102, 100, 128, 0, 106, - 131, 132, 106, 21, 135, 136, 137, 3, 4, 23, - 141, 7, 90, 10, 11, 12, 13, 14, 15, 16, - 17, 96, 102, 94, 70, 103, 106, 4, 106, 103, - 105, 27, 28, 56, 57, 58, 59, 104, 51, 52, - 102, 37, 38, 105, 48, 49, 50, 94, 126, 127, - 128, 129, 130, 131, 132, 83, 84, 135, 136, 137, - 138, 139, 140, 141, 94, 171, 172, 100, 174, 98, - 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, - 76, 77, 78, 79, 215, 22, 0, 24, 104, 85, - 106, 87, 88, 89, 90, 94, 104, 175, 106, 27, - 28, 3, 4, 100, 94, 101, 3, 4, 96, 197, - 4, 25, 3, 4, 3, 4, 4, 31, 4, 197, - 3, 4, 96, 24, 4, 213, 40, 41, 42, 43, - 99, 24, 99, 96, 54, 213, 214, 215, 4, 4, - 4, 4, 273, 249, 169, 285, 286, 287, 7, 280, - 7, 4, 7, 106, 179, 295, 296, 297, 298, 184, - 185, 97, 184, 185, 106, 106, 98, 106, 35, 96, - 24, 196, 106, 106, 196, 106, 201, 106, 96, 201, - 106, 96, 24, 96, 209, 210, 211, 209, 210, 211, - 96, 96, 332, 96, 272, 273, 274, 275, 276, 245, - 15, 97, 280, 10, 11, 12, 13, 14, 15, 16, - 17, 106, 15, 98, 106, 21, 106, 21, 96, 359, - 351, 361, 362, 363, 364, 303, 35, 383, 383, 106, - 106, 106, 106, 106, 312, 106, 106, 106, 369, 97, - 96, 266, 398, 398, 266, 270, 106, 97, 270, 327, - 390, 98, 21, 35, 106, 106, 281, 282, 106, 281, - 282, 106, 106, 106, 100, 97, 344, 97, 106, 97, - 97, 97, 97, 351, 21, 97, 100, 355, 21, 64, - 358, 21, 21, 106, 80, 310, 311, 106, 310, 311, - 315, 369, 80, 315, 80, 32, 321, 322, 323, 321, - 322, 323, 80, 20, 23, 100, 44, 169, 303, 3, - 15, 312, 355, 328, -1, -1, -1, 342, 343, -1, - 342, 343, -1, -1, 349, -1, -1, 349, -1, -1, - -1, 356, -1, -1, 356, 5, 6, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 371, -1, -1, 371, - -1, -1, 22, -1, 24, -1, 26, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 37, 38, -1, - 395, -1, -1, 395, -1, -1, -1, -1, -1, -1, - -1, 406, -1, -1, 406, -1, 411, -1, -1, 411, - 415, 416, -1, 415, 416, -1, 66, 67, 68, 69, - 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, - -1, -1, -1, -1, -1, 85, -1, 87, 88, 89, - 90, -1, -1, -1, -1, -1, -1, -1, 98, -1, - -1, 101, -1, 103, -1, 5, 6, 107, 8, 9, - 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, - 20, 21, 22, -1, 24, -1, 5, 6, -1, 8, - 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, - 19, 20, 21, 22, 44, 24, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 20, -1, 22, - -1, 24, -1, -1, -1, 44, -1, -1, 31, 32, - 33, -1, 3, 4, 5, 6, 7, 40, 41, 42, - 43, -1, -1, 46, 47, -1, -1, -1, -1, -1, - 53, 22, -1, 24, -1, 95, 27, 28, 98, -1, - -1, 101, -1, 103, 104, -1, 37, 38, -1, -1, - -1, -1, -1, -1, -1, -1, 95, -1, -1, 98, - -1, -1, 101, -1, 103, 104, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 66, 67, 68, 69, 70, - 71, 72, 73, 74, 75, 76, 77, 78, 79, -1, - -1, -1, -1, -1, 85, -1, 87, 88, 89, 90, - -1, -1, -1, -1, -1, -1, -1, -1, 5, 6, - 101, 8, 9, 10, 11, 12, 13, 14, 15, 16, - 17, 18, 19, 20, 21, 22, -1, 24, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 36, - -1, -1, -1, -1, -1, 5, 6, 44, 8, 9, - 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, - 20, 21, 22, -1, 24, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 36, -1, -1, -1, - -1, -1, -1, -1, 44, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 95, -1, - -1, 98, -1, -1, 101, -1, 103, 5, 6, -1, - 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, - 18, 19, 20, 21, 22, -1, 24, -1, -1, -1, - -1, -1, -1, -1, -1, 95, -1, -1, 98, -1, - -1, 101, -1, 103, 5, 6, 44, 8, 9, 10, - 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, - 21, 22, -1, 24, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 36, -1, -1, -1, -1, - -1, -1, -1, 44, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 95, -1, -1, - 98, -1, 100, 101, -1, 103, -1, 5, 6, -1, - 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, - 18, 19, 20, 21, 22, -1, 24, -1, -1, -1, - -1, -1, -1, -1, 95, -1, -1, 98, 36, -1, - 101, -1, 103, -1, 5, 6, 44, 8, 9, 10, - 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, - 21, 22, -1, 24, -1, 5, 6, -1, 8, 9, - 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, - 20, 21, 22, 44, 24, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 95, -1, -1, - 98, -1, -1, 101, 44, 103, 5, 6, -1, 8, - 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, - 19, 20, 21, 22, -1, 24, -1, -1, -1, -1, - -1, -1, -1, -1, 95, -1, -1, 98, -1, -1, - 101, -1, 103, -1, -1, 44, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 95, -1, -1, 98, -1, - -1, 101, -1, 103, 5, 6, -1, 8, 9, 10, - 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, - 21, 22, -1, 24, -1, -1, 34, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 95, 45, -1, 98, - -1, -1, 101, 44, 103, -1, 54, 55, -1, -1, - -1, -1, 60, 61, 62, 63, 64, 65, 66, 67, - 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, - 78, 79, 80, 81, 82, -1, -1, 85, 86, 87, - 88, 89, 90, 91, 92, 93, -1, -1, -1, -1, - -1, -1, -1, -1, 95, -1, -1, 98, -1, -1, - 101, -1, 103 +static const short yytable[] = { 69, + 207, 183, 208, 19, 84, 28, 74, 94, 210, 90, + -113, 28, 31, 69, 199, 200, 201, 202, 203, 204, + 205, 206, 353, 199, 200, 201, 202, 203, 204, 205, + 206, 19, 324, 454, 326, 3, 197, 462, -53, 94, + 238, 4, 39, 331, 239, 98, 98, 468, 198, 43, + 464, 5, 6, 7, 8, 14, 234, 15, 373, 339, + 167, 182, 374, 186, 333, 187, 91, 98, 96, 45, + 374, 46, 47, 376, 92, 49, 50, 51, 52, 53, + 54, 55, 56, 57, 58, 59, 60, 61, 14, 381, + 15, 374, 98, 407, 384, 75, 22, 23, 24, 25, + 375, 32, 374, 211, 212, 79, 214, 215, 85, 86, + 193, 62, 40, 196, 221, 82, 35, 36, 37, 424, + -54, 453, 229, 230, 231, 232, 263, 265, 80, 266, + 463, 161, 162, 5, 6, 7, 8, 235, 236, 41, + 81, 213, 240, 241, 217, 218, 219, -30, -30, 220, + 89, 222, 223, 224, 225, 226, 227, 228, -29, -29, + 97, 268, 233, 199, 200, 201, 202, 203, 204, 205, + 206, 160, -28, -28, 289, -27, -27, 164, 63, 242, + 243, 64, 165, 69, 65, 93, 184, 185, -40, 194, + 14, 188, 15, 237, -34, -33, -32, -31, 312, 4, + -40, -40, -37, -38, 245, 246, 332, 69, 313, -40, + -40, -40, -40, 273, 266, -40, 16, 272, 290, 291, + 293, 294, 17, 295, 296, 297, 182, 182, 298, 182, + 370, 371, 372, 300, 301, 302, 316, 303, 304, 305, + 377, 378, 379, 380, 306, 314, 315, 311, 317, 318, + 319, 325, 327, 328, 182, 329, 330, 343, 344, 336, + 385, 386, 337, 479, 408, 348, 430, 452, 349, 334, + 340, 352, 341, 354, 441, 345, 465, 361, 359, 360, + 362, 363, 364, 368, 369, 392, 394, 410, 387, 456, + 182, 182, 182, 404, 438, 395, 439, 470, 397, 398, + 182, 182, 182, 182, 399, 350, 351, 409, 472, 268, + 355, 356, 357, 358, 474, 411, 457, 445, 412, 446, + 365, 475, 432, 413, 433, 434, 435, 436, 414, 419, + 421, 437, 207, 448, 208, 443, 444, 447, 449, 450, + 451, 405, 286, 287, 466, 480, 149, 182, 150, 207, + 467, 208, 471, 77, 288, 151, 153, 42, 190, 292, + 460, 88, 383, 261, 44, 20, 299, 34, 391, 428, + 0, 0, 0, 0, 307, 308, 309, 310, 406, 0, + 0, 431, 182, 262, 182, 182, 182, 182, 0, 0, + 0, 0, 0, 284, 0, 0, 0, 0, 284, 284, + 0, 0, 0, 422, 423, 0, 425, 426, 427, 0, + 284, 0, 0, 0, 0, 284, 0, 0, 0, 0, + 182, 0, 284, 0, 0, 0, 0, 0, 440, 0, + 284, 284, 284, 284, 342, 0, 0, 0, 347, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 458, 459, 0, 0, 0, 366, 367, 264, + 46, 47, 0, 92, 49, 50, 51, 52, 53, 54, + 55, 56, 57, 58, 59, 60, 61, 14, 0, 15, + 0, 0, 0, 0, 0, 0, 0, 0, 388, 389, + 284, 0, 0, 393, 284, 0, 0, 0, 0, 396, + 62, 0, 0, 0, 0, 0, 400, 401, 402, 403, + 0, 0, 0, 284, 284, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 415, 416, 0, 0, 0, 0, 0, 420, 0, 0, + 0, 0, 0, 0, 284, 284, 0, 0, 0, 284, + 429, 0, 0, 0, 0, 284, 0, 0, 0, 0, + 0, 0, 284, 284, 284, 284, 442, 63, 0, 0, + 64, 0, 0, 65, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 284, 284, 0, 0, + 0, 0, 0, 284, 0, 0, 0, 461, 0, 0, + 0, 0, 0, 0, 0, 0, 284, 0, 0, 0, + 469, 0, 0, 0, 0, 473, 0, 0, 0, 476, + 477, 0, 284, 274, 275, 46, 47, 276, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 14, 0, 15, 0, 0, 277, 278, 0, + 0, 0, 0, 284, 0, 0, 0, 0, 279, 280, + 0, 0, 0, 0, 0, 0, 284, 0, 0, 0, + 0, 284, 0, 0, 0, 284, 284, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 110, + 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, + 121, 122, 123, 274, 275, 0, 0, 276, 0, 0, + 0, 0, 0, 0, 250, 0, 251, 252, 0, 138, + 139, 0, 0, 0, 0, 0, 0, 277, 278, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 279, 280, + 0, 0, 0, 281, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 110, + 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, + 121, 122, 123, 0, 46, 47, 0, 0, 0, 0, + 0, 0, 0, 0, 250, 0, 251, 252, 0, 138, + 139, 14, 0, 15, 0, 247, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 248, 249, 0, + 0, 0, 0, 281, 46, 47, 0, 92, 168, 169, + 170, 171, 172, 173, 174, 175, 176, 177, 178, 60, + 61, 14, 0, 15, 0, 0, 0, 0, 110, 111, + 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, + 122, 123, 0, 0, 62, 0, 0, 0, 0, 0, + 0, 0, 0, 250, 0, 251, 252, 0, 138, 139, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 253, 0, 0, 254, 0, 0, + 0, 255, 256, 46, 47, 0, 92, 49, 50, 51, + 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, + 14, 0, 15, 0, 0, 0, 0, 0, 0, 0, + 0, 63, 0, 0, 64, 189, 0, 65, 323, 0, + 0, 46, 47, 62, 92, 49, 50, 51, 52, 53, + 54, 55, 56, 57, 58, 59, 60, 61, 14, 0, + 15, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 267, 0, 0, 0, 0, 0, 46, + 47, 62, 92, 168, 169, 170, 171, 172, 173, 174, + 175, 176, 177, 178, 60, 61, 14, 0, 15, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 63, 0, 0, 64, 0, 0, 65, 46, 47, 62, + 92, 49, 50, 51, 52, 53, 54, 55, 56, 57, + 58, 59, 60, 61, 14, 0, 15, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 63, 338, + 0, 64, 0, 0, 65, 46, 47, 62, 92, 49, + 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, + 60, 61, 14, 0, 15, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 63, 382, 0, 64, + 0, 320, 65, 46, 47, 62, 48, 49, 50, 51, + 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, + 14, 0, 15, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 63, 0, 0, 64, 0, 0, + 65, 46, 47, 62, 92, 49, 50, 51, 52, 53, + 54, 55, 56, 57, 58, 59, 60, 61, 14, 0, + 15, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 63, 0, 0, 64, 0, 0, 65, 46, + 47, 62, 92, 168, 169, 170, 171, 172, 173, 174, + 175, 176, 177, 178, 60, 61, 14, 0, 15, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 63, 0, 0, 64, 0, 0, 65, 46, 47, 62, + 195, 49, 50, 51, 52, 53, 54, 55, 56, 57, + 58, 59, 60, 61, 14, 0, 15, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 63, 0, + 0, 64, 0, 0, 65, 0, 0, 62, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 63, 0, 0, 64, + 0, 0, 65, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 99, 100, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 101, 0, 0, 0, + 0, 0, 0, 0, 63, 102, 103, 64, 0, 0, + 65, 0, 0, 104, 105, 106, 107, 108, 109, 110, + 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, + 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, + 131, 132, 0, 0, 133, 134, 135, 136, 137, 138, + 139, 140, 141, -214, 142, 143, 144, 145, 146, 147, + 148 }; -/* YYSTOS[STATE-NUM] -- The (internal number of the) accessing - symbol of state STATE-NUM. */ -static const unsigned char yystos[] = -{ - 0, 133, 134, 135, 0, 25, 31, 40, 41, 42, - 43, 120, 147, 149, 150, 156, 22, 24, 47, 53, - 119, 140, 150, 151, 56, 57, 58, 59, 121, 145, - 23, 157, 158, 30, 104, 148, 157, 48, 49, 50, - 137, 94, 20, 46, 120, 94, 145, 4, 5, 6, - 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, - 18, 19, 20, 21, 44, 95, 98, 101, 103, 109, - 122, 123, 124, 125, 126, 140, 153, 29, 103, 146, - 119, 161, 94, 94, 94, 98, 138, 122, 32, 33, - 132, 132, 4, 4, 4, 8, 104, 126, 127, 140, - 96, 105, 34, 45, 54, 55, 60, 61, 62, 63, - 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, - 74, 75, 76, 77, 78, 79, 80, 81, 82, 85, - 86, 87, 88, 89, 90, 91, 92, 93, 111, 112, - 113, 114, 159, 165, 166, 168, 169, 24, 51, 52, - 136, 4, 24, 139, 124, 9, 10, 11, 12, 13, - 14, 15, 16, 17, 18, 19, 115, 116, 118, 124, - 129, 99, 99, 104, 106, 96, 36, 127, 128, 124, - 155, 54, 8, 155, 9, 21, 10, 11, 12, 13, - 14, 15, 16, 17, 115, 116, 117, 121, 124, 124, - 155, 124, 124, 162, 155, 155, 155, 155, 155, 124, - 124, 124, 155, 121, 83, 84, 100, 106, 27, 28, - 3, 4, 110, 4, 7, 26, 37, 38, 85, 87, - 88, 98, 101, 103, 107, 111, 112, 113, 114, 130, - 153, 126, 126, 126, 36, 124, 142, 143, 144, 106, - 97, 3, 4, 7, 27, 28, 37, 38, 101, 130, - 152, 153, 154, 154, 154, 154, 122, 106, 106, 154, - 98, 106, 35, 106, 106, 106, 106, 154, 154, 154, - 106, 122, 124, 155, 24, 96, 96, 96, 100, 129, - 131, 131, 104, 131, 24, 96, 96, 96, 96, 100, - 102, 140, 141, 106, 97, 36, 131, 106, 106, 154, - 15, 15, 106, 167, 154, 98, 124, 155, 124, 124, - 124, 106, 106, 106, 155, 154, 154, 106, 129, 129, - 129, 100, 106, 102, 104, 129, 129, 129, 129, 36, - 142, 102, 21, 21, 96, 154, 154, 155, 163, 106, - 154, 106, 154, 154, 154, 96, 124, 167, 35, 106, - 129, 106, 106, 106, 106, 154, 154, 163, 164, 106, - 154, 106, 155, 164, 154, 97, 124, 129, 129, 129, - 129, 129, 106, 98, 97, 155, 100, 154, 97, 97, - 106, 97, 97, 97, 97, 21, 100, 117, 160, 35, - 100, 129, 154, 152, 100, 117, 21, 97, 106, 152, - 154, 21, 106, 64, 154, 21, 21, 154, 154 +static const short yycheck[] = { 26, + 106, 88, 106, 2, 40, 23, 29, 65, 107, 4, + 0, 23, 30, 40, 10, 11, 12, 13, 14, 15, + 16, 17, 299, 10, 11, 12, 13, 14, 15, 16, + 17, 30, 254, 438, 256, 25, 9, 454, 113, 97, + 117, 31, 111, 117, 121, 120, 120, 464, 21, 111, + 455, 41, 42, 43, 44, 22, 155, 24, 117, 281, + 87, 88, 121, 119, 117, 121, 61, 120, 67, 4, + 121, 5, 6, 124, 8, 9, 10, 11, 12, 13, + 14, 15, 16, 17, 18, 19, 20, 21, 22, 117, + 24, 121, 120, 370, 124, 118, 57, 58, 59, 60, + 119, 119, 121, 130, 131, 111, 133, 134, 32, 33, + 101, 45, 20, 104, 141, 115, 49, 50, 51, 396, + 113, 117, 149, 150, 151, 152, 184, 185, 111, 187, + 117, 52, 53, 41, 42, 43, 44, 92, 93, 47, + 111, 132, 27, 28, 135, 136, 137, 3, 4, 140, + 4, 142, 143, 144, 145, 146, 147, 148, 3, 4, + 113, 188, 153, 10, 11, 12, 13, 14, 15, 16, + 17, 24, 3, 4, 210, 3, 4, 4, 112, 3, + 4, 115, 24, 210, 118, 119, 116, 62, 20, 55, + 22, 113, 24, 103, 4, 4, 4, 4, 234, 31, + 32, 33, 7, 7, 4, 7, 264, 234, 235, 41, + 42, 43, 44, 114, 272, 47, 48, 121, 121, 121, + 115, 121, 54, 36, 121, 121, 253, 254, 121, 256, + 317, 318, 319, 121, 121, 121, 24, 121, 121, 121, + 327, 328, 329, 330, 121, 236, 237, 121, 113, 113, + 113, 24, 113, 113, 281, 113, 113, 15, 15, 121, + 21, 21, 114, 0, 36, 115, 114, 21, 295, 268, + 121, 298, 121, 300, 117, 121, 21, 121, 305, 306, + 121, 121, 121, 121, 121, 121, 121, 374, 113, 36, + 317, 318, 319, 113, 115, 121, 114, 21, 121, 121, + 327, 328, 329, 330, 121, 296, 297, 121, 67, 336, + 301, 302, 303, 304, 21, 121, 117, 114, 121, 114, + 311, 21, 409, 121, 411, 412, 413, 414, 121, 121, + 121, 121, 438, 114, 438, 121, 121, 121, 114, 114, + 114, 368, 197, 198, 114, 0, 77, 374, 77, 455, + 121, 455, 121, 30, 209, 77, 77, 18, 97, 214, + 447, 42, 336, 182, 21, 2, 221, 13, 345, 404, + -1, -1, -1, -1, 229, 230, 231, 232, 369, -1, + -1, 408, 409, 182, 411, 412, 413, 414, -1, -1, + -1, -1, -1, 192, -1, -1, -1, -1, 197, 198, + -1, -1, -1, 394, 395, -1, 397, 398, 399, -1, + 209, -1, -1, -1, -1, 214, -1, -1, -1, -1, + 447, -1, 221, -1, -1, -1, -1, -1, 419, -1, + 229, 230, 231, 232, 289, -1, -1, -1, 293, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, 443, 444, -1, -1, -1, 312, 313, 4, + 5, 6, -1, 8, 9, 10, 11, 12, 13, 14, + 15, 16, 17, 18, 19, 20, 21, 22, -1, 24, + -1, -1, -1, -1, -1, -1, -1, -1, 343, 344, + 289, -1, -1, 348, 293, -1, -1, -1, -1, 354, + 45, -1, -1, -1, -1, -1, 361, 362, 363, 364, + -1, -1, -1, 312, 313, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + 385, 386, -1, -1, -1, -1, -1, 392, -1, -1, + -1, -1, -1, -1, 343, 344, -1, -1, -1, 348, + 405, -1, -1, -1, -1, 354, -1, -1, -1, -1, + -1, -1, 361, 362, 363, 364, 421, 112, -1, -1, + 115, -1, -1, 118, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, 385, 386, -1, -1, + -1, -1, -1, 392, -1, -1, -1, 452, -1, -1, + -1, -1, -1, -1, -1, -1, 405, -1, -1, -1, + 465, -1, -1, -1, -1, 470, -1, -1, -1, 474, + 475, -1, 421, 3, 4, 5, 6, 7, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, 22, -1, 24, -1, -1, 27, 28, -1, + -1, -1, -1, 452, -1, -1, -1, -1, 38, 39, + -1, -1, -1, -1, -1, -1, 465, -1, -1, -1, + -1, 470, -1, -1, -1, 474, 475, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 69, + 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, + 80, 81, 82, 3, 4, -1, -1, 7, -1, -1, + -1, -1, -1, -1, 94, -1, 96, 97, -1, 99, + 100, -1, -1, -1, -1, -1, -1, 27, 28, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 38, 39, + -1, -1, -1, 123, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 69, + 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, + 80, 81, 82, -1, 5, 6, -1, -1, -1, -1, + -1, -1, -1, -1, 94, -1, 96, 97, -1, 99, + 100, 22, -1, 24, -1, 26, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 38, 39, -1, + -1, -1, -1, 123, 5, 6, -1, 8, 9, 10, + 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, + 21, 22, -1, 24, -1, -1, -1, -1, 69, 70, + 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, + 81, 82, -1, -1, 45, -1, -1, -1, -1, -1, + -1, -1, -1, 94, -1, 96, 97, -1, 99, 100, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, 115, -1, -1, 118, -1, -1, + -1, 122, 123, 5, 6, -1, 8, 9, 10, 11, + 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, + 22, -1, 24, -1, -1, -1, -1, -1, -1, -1, + -1, 112, -1, -1, 115, 37, -1, 118, 119, -1, + -1, 5, 6, 45, 8, 9, 10, 11, 12, 13, + 14, 15, 16, 17, 18, 19, 20, 21, 22, -1, + 24, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 37, -1, -1, -1, -1, -1, 5, + 6, 45, 8, 9, 10, 11, 12, 13, 14, 15, + 16, 17, 18, 19, 20, 21, 22, -1, 24, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + 112, -1, -1, 115, -1, -1, 118, 5, 6, 45, + 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, + 18, 19, 20, 21, 22, -1, 24, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 112, 37, + -1, 115, -1, -1, 118, 5, 6, 45, 8, 9, + 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, + 20, 21, 22, -1, 24, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, 112, 37, -1, 115, + -1, 117, 118, 5, 6, 45, 8, 9, 10, 11, + 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, + 22, -1, 24, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, 112, -1, -1, 115, -1, -1, + 118, 5, 6, 45, 8, 9, 10, 11, 12, 13, + 14, 15, 16, 17, 18, 19, 20, 21, 22, -1, + 24, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, 112, -1, -1, 115, -1, -1, 118, 5, + 6, 45, 8, 9, 10, 11, 12, 13, 14, 15, + 16, 17, 18, 19, 20, 21, 22, -1, 24, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + 112, -1, -1, 115, -1, -1, 118, 5, 6, 45, + 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, + 18, 19, 20, 21, 22, -1, 24, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 112, -1, + -1, 115, -1, -1, 118, -1, -1, 45, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, 112, -1, -1, 115, + -1, -1, 118, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, 34, 35, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, 46, -1, -1, -1, + -1, -1, -1, -1, 112, 55, 56, 115, -1, -1, + 118, -1, -1, 63, 64, 65, 66, 67, 68, 69, + 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, + 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, + 90, 91, -1, -1, 94, 95, 96, 97, 98, 99, + 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, + 110 }; +/* -*-C-*- Note some compilers choke on comments on `#line' lines. */ +#line 3 "/usr/share/bison.simple" +/* This file comes from bison-1.28. */ -#if ! defined (YYSIZE_T) && defined (__SIZE_TYPE__) -# define YYSIZE_T __SIZE_TYPE__ -#endif -#if ! defined (YYSIZE_T) && defined (size_t) -# define YYSIZE_T size_t +/* Skeleton output parser for bison, + Copyright (C) 1984, 1989, 1990 Free Software Foundation, Inc. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + +/* As a special exception, when this file is copied by Bison into a + Bison output file, you may use that output file without restriction. + This special exception was added by the Free Software Foundation + in version 1.24 of Bison. */ + +/* This is the parser code that is written into each bison parser + when the %semantic_parser declaration is not specified in the grammar. + It was written by Richard Stallman by simplifying the hairy parser + used when %semantic_parser is specified. */ + +#ifndef YYSTACK_USE_ALLOCA +#ifdef alloca +#define YYSTACK_USE_ALLOCA +#else /* alloca not defined */ +#ifdef __GNUC__ +#define YYSTACK_USE_ALLOCA +#define alloca __builtin_alloca +#else /* not GNU C. */ +#if (!defined (__STDC__) && defined (sparc)) || defined (__sparc__) || defined (__sparc) || defined (__sgi) || (defined (__sun) && defined (__i386)) +#define YYSTACK_USE_ALLOCA +#include +#else /* not sparc */ +/* We think this test detects Watcom and Microsoft C. */ +/* This used to test MSDOS, but that is a bad idea + since that symbol is in the user namespace. */ +#if (defined (_MSDOS) || defined (_MSDOS_)) && !defined (__TURBOC__) +#if 0 /* No need for malloc.h, which pollutes the namespace; + instead, just don't use alloca. */ +#include #endif -#if ! defined (YYSIZE_T) -# if defined (__STDC__) || defined (__cplusplus) -# include /* INFRINGES ON USER NAME SPACE */ -# define YYSIZE_T size_t -# endif +#else /* not MSDOS, or __TURBOC__ */ +#if defined(_AIX) +/* I don't know what this was needed for, but it pollutes the namespace. + So I turned it off. rms, 2 May 1997. */ +/* #include */ + #pragma alloca +#define YYSTACK_USE_ALLOCA +#else /* not MSDOS, or __TURBOC__, or _AIX */ +#if 0 +#ifdef __hpux /* haible at ilog.fr says this works for HPUX 9.05 and up, + and on HPUX 10. Eventually we can turn this on. */ +#define YYSTACK_USE_ALLOCA +#define alloca __builtin_alloca +#endif /* __hpux */ #endif -#if ! defined (YYSIZE_T) -# define YYSIZE_T unsigned int +#endif /* not _AIX */ +#endif /* not MSDOS, or __TURBOC__ */ +#endif /* not sparc */ +#endif /* not GNU C */ +#endif /* alloca not defined */ +#endif /* YYSTACK_USE_ALLOCA not defined */ + +#ifdef YYSTACK_USE_ALLOCA +#define YYSTACK_ALLOC alloca +#else +#define YYSTACK_ALLOC malloc #endif +/* Note: there must be only one dollar sign in this file. + It is replaced by the list of actions, each action + as one case of the switch. */ + #define yyerrok (yyerrstatus = 0) #define yyclearin (yychar = YYEMPTY) -#define YYEMPTY (-2) +#define YYEMPTY -2 #define YYEOF 0 - #define YYACCEPT goto yyacceptlab -#define YYABORT goto yyabortlab -#define YYERROR goto yyerrorlab - - -/* Like YYERROR except do call yyerror. This remains here temporarily - to ease the transition to the new meaning of YYERROR, for GCC. +#define YYABORT goto yyabortlab +#define YYERROR goto yyerrlab1 +/* Like YYERROR except do call yyerror. + This remains here temporarily to ease the + transition to the new meaning of YYERROR, for GCC. Once GCC version 2 has supplanted version 1, this can go. */ - #define YYFAIL goto yyerrlab - #define YYRECOVERING() (!!yyerrstatus) - -#define YYBACKUP(Token, Value) \ +#define YYBACKUP(token, value) \ do \ if (yychar == YYEMPTY && yylen == 1) \ - { \ - yychar = (Token); \ - yylval = (Value); \ - yytoken = YYTRANSLATE (yychar); \ + { yychar = (token), yylval = (value); \ + yychar1 = YYTRANSLATE (yychar); \ YYPOPSTACK; \ goto yybackup; \ } \ else \ - { \ - yyerror ("syntax error: cannot back up");\ - YYERROR; \ - } \ + { yyerror ("syntax error: cannot back up"); YYERROR; } \ while (0) #define YYTERROR 1 #define YYERRCODE 256 -/* YYLLOC_DEFAULT -- Compute the default location (before the actions - are run). */ - -#ifndef YYLLOC_DEFAULT -# define YYLLOC_DEFAULT(Current, Rhs, N) \ - ((Current).first_line = (Rhs)[1].first_line, \ - (Current).first_column = (Rhs)[1].first_column, \ - (Current).last_line = (Rhs)[N].last_line, \ - (Current).last_column = (Rhs)[N].last_column) +#ifndef YYPURE +#define YYLEX yylex() #endif -/* YYLEX -- calling `yylex' with the right arguments. */ - +#ifdef YYPURE +#ifdef YYLSP_NEEDED #ifdef YYLEX_PARAM -# define YYLEX yylex (YYLEX_PARAM) +#define YYLEX yylex(&yylval, &yylloc, YYLEX_PARAM) #else -# define YYLEX yylex () +#define YYLEX yylex(&yylval, &yylloc) #endif - -/* Enable debugging if requested. */ -#if YYDEBUG - -# ifndef YYFPRINTF -# include /* INFRINGES ON USER NAME SPACE */ -# define YYFPRINTF fprintf -# endif - -# define YYDPRINTF(Args) \ -do { \ - if (yydebug) \ - YYFPRINTF Args; \ -} while (0) - -# define YYDSYMPRINT(Args) \ -do { \ - if (yydebug) \ - yysymprint Args; \ -} while (0) - -# define YYDSYMPRINTF(Title, Token, Value, Location) \ -do { \ - if (yydebug) \ - { \ - YYFPRINTF (stderr, "%s ", Title); \ - yysymprint (stderr, \ - Token, Value); \ - YYFPRINTF (stderr, "\n"); \ - } \ -} while (0) - -/*------------------------------------------------------------------. -| yy_stack_print -- Print the state stack from its BOTTOM up to its | -| TOP (included). | -`------------------------------------------------------------------*/ - -#if defined (__STDC__) || defined (__cplusplus) -static void -yy_stack_print (short *bottom, short *top) +#else /* not YYLSP_NEEDED */ +#ifdef YYLEX_PARAM +#define YYLEX yylex(&yylval, YYLEX_PARAM) #else -static void -yy_stack_print (bottom, top) - short *bottom; - short *top; +#define YYLEX yylex(&yylval) +#endif +#endif /* not YYLSP_NEEDED */ #endif -{ - YYFPRINTF (stderr, "Stack now"); - for (/* Nothing. */; bottom <= top; ++bottom) - YYFPRINTF (stderr, " %d", *bottom); - YYFPRINTF (stderr, "\n"); -} -# define YY_STACK_PRINT(Bottom, Top) \ -do { \ - if (yydebug) \ - yy_stack_print ((Bottom), (Top)); \ -} while (0) +/* If nonreentrant, generate the variables here */ +#ifndef YYPURE -/*------------------------------------------------. -| Report that the YYRULE is going to be reduced. | -`------------------------------------------------*/ +int yychar; /* the lookahead symbol */ +YYSTYPE yylval; /* the semantic value of the */ + /* lookahead symbol */ -#if defined (__STDC__) || defined (__cplusplus) -static void -yy_reduce_print (int yyrule) -#else -static void -yy_reduce_print (yyrule) - int yyrule; +#ifdef YYLSP_NEEDED +YYLTYPE yylloc; /* location data for the lookahead */ + /* symbol */ #endif -{ - int yyi; - unsigned int yylno = yyrline[yyrule]; - YYFPRINTF (stderr, "Reducing stack by rule %d (line %u), ", - yyrule - 1, yylno); - /* Print the symbols being reduced, and their result. */ - for (yyi = yyprhs[yyrule]; 0 <= yyrhs[yyi]; yyi++) - YYFPRINTF (stderr, "%s ", yytname [yyrhs[yyi]]); - YYFPRINTF (stderr, "-> %s\n", yytname [yyr1[yyrule]]); -} -# define YY_REDUCE_PRINT(Rule) \ -do { \ - if (yydebug) \ - yy_reduce_print (Rule); \ -} while (0) - -/* Nonzero means print parse trace. It is left uninitialized so that - multiple parsers can coexist. */ -int yydebug; -#else /* !YYDEBUG */ -# define YYDPRINTF(Args) -# define YYDSYMPRINT(Args) -# define YYDSYMPRINTF(Title, Token, Value, Location) -# define YY_STACK_PRINT(Bottom, Top) -# define YY_REDUCE_PRINT(Rule) -#endif /* !YYDEBUG */ +int yynerrs; /* number of parse errors so far */ +#endif /* not YYPURE */ + +#if YYDEBUG != 0 +int yydebug; /* nonzero means print parse trace */ +/* Since this is uninitialized, it does not stop multiple parsers + from coexisting. */ +#endif +/* YYINITDEPTH indicates the initial size of the parser's stacks */ -/* YYINITDEPTH -- initial size of the parser's stacks. */ #ifndef YYINITDEPTH -# define YYINITDEPTH 200 +#define YYINITDEPTH 200 #endif -/* YYMAXDEPTH -- maximum size the stacks can grow to (effective only - if the built-in stack extension method is used). - - Do not make this value too large; the results are undefined if - SIZE_MAX < YYSTACK_BYTES (YYMAXDEPTH) - evaluated with infinite-precision integer arithmetic. */ +/* YYMAXDEPTH is the maximum size the stacks can grow to + (effective only if the built-in stack extension method is used). */ -#if defined (YYMAXDEPTH) && YYMAXDEPTH == 0 -# undef YYMAXDEPTH +#if YYMAXDEPTH == 0 +#undef YYMAXDEPTH #endif #ifndef YYMAXDEPTH -# define YYMAXDEPTH 10000 +#define YYMAXDEPTH 10000 #endif - +/* Define __yy_memcpy. Note that the size argument + should be passed with type unsigned int, because that is what the non-GCC + definitions require. With GCC, __builtin_memcpy takes an arg + of type size_t, but it can handle unsigned int. */ + +#if __GNUC__ > 1 /* GNU C and GNU C++ define this. */ +#define __yy_memcpy(TO,FROM,COUNT) __builtin_memcpy(TO,FROM,COUNT) +#else /* not GNU C or C++ */ +#ifndef __cplusplus -#if YYERROR_VERBOSE - -# ifndef yystrlen -# if defined (__GLIBC__) && defined (_STRING_H) -# define yystrlen strlen -# else -/* Return the length of YYSTR. */ -static YYSIZE_T -# if defined (__STDC__) || defined (__cplusplus) -yystrlen (const char *yystr) -# else -yystrlen (yystr) - const char *yystr; -# endif -{ - register const char *yys = yystr; - - while (*yys++ != '\0') - continue; - - return yys - yystr - 1; -} -# endif -# endif - -# ifndef yystpcpy -# if defined (__GLIBC__) && defined (_STRING_H) && defined (_GNU_SOURCE) -# define yystpcpy stpcpy -# else -/* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in - YYDEST. */ -static char * -# if defined (__STDC__) || defined (__cplusplus) -yystpcpy (char *yydest, const char *yysrc) -# else -yystpcpy (yydest, yysrc) - char *yydest; - const char *yysrc; -# endif +/* This is the most reliable way to avoid incompatibilities + in available built-in functions on various systems. */ +static void +__yy_memcpy (to, from, count) + char *to; + char *from; + unsigned int count; { - register char *yyd = yydest; - register const char *yys = yysrc; + register char *f = from; + register char *t = to; + register int i = count; - while ((*yyd++ = *yys++) != '\0') - continue; - - return yyd - 1; + while (i-- > 0) + *t++ = *f++; } -# endif -# endif - -#endif /* !YYERROR_VERBOSE */ - - -#if YYDEBUG -/*--------------------------------. -| Print this symbol on YYOUTPUT. | -`--------------------------------*/ +#else /* __cplusplus */ -#if defined (__STDC__) || defined (__cplusplus) -static void -yysymprint (FILE *yyoutput, int yytype, YYSTYPE *yyvaluep) -#else +/* This is the most reliable way to avoid incompatibilities + in available built-in functions on various systems. */ static void -yysymprint (yyoutput, yytype, yyvaluep) - FILE *yyoutput; - int yytype; - YYSTYPE *yyvaluep; -#endif +__yy_memcpy (char *to, char *from, unsigned int count) { - /* Pacify ``unused variable'' warnings. */ - (void) yyvaluep; - - if (yytype < YYNTOKENS) - { - YYFPRINTF (yyoutput, "token %s (", yytname[yytype]); -# ifdef YYPRINT - YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep); -# endif - } - else - YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]); + register char *t = to; + register char *f = from; + register int i = count; - switch (yytype) - { - default: - break; - } - YYFPRINTF (yyoutput, ")"); + while (i-- > 0) + *t++ = *f++; } -#endif /* ! YYDEBUG */ -/*-----------------------------------------------. -| Release the memory associated to this symbol. | -`-----------------------------------------------*/ - -#if defined (__STDC__) || defined (__cplusplus) -static void -yydestruct (int yytype, YYSTYPE *yyvaluep) -#else -static void -yydestruct (yytype, yyvaluep) - int yytype; - YYSTYPE *yyvaluep; #endif -{ - /* Pacify ``unused variable'' warnings. */ - (void) yyvaluep; - - switch (yytype) - { - - default: - break; - } -} +#endif +#line 217 "/usr/share/bison.simple" -/* Prevent warnings from -Wmissing-prototypes. */ +/* The user can define YYPARSE_PARAM as the name of an argument to be passed + into yyparse. The argument should have type void *. + It should actually point to an object. + Grammar actions can access the variable by casting it + to the proper pointer type. */ #ifdef YYPARSE_PARAM -# if defined (__STDC__) || defined (__cplusplus) -int yyparse (void *YYPARSE_PARAM); -# else -int yyparse (); -# endif -#else /* ! YYPARSE_PARAM */ -#if defined (__STDC__) || defined (__cplusplus) -int yyparse (void); -#else -int yyparse (); -#endif -#endif /* ! YYPARSE_PARAM */ - - - -/* The lookahead symbol. */ -int yychar; - -/* The semantic value of the lookahead symbol. */ -YYSTYPE yylval; - -/* Number of syntax errors so far. */ -int yynerrs; - - - -/*----------. -| yyparse. | -`----------*/ +#ifdef __cplusplus +#define YYPARSE_PARAM_ARG void *YYPARSE_PARAM +#define YYPARSE_PARAM_DECL +#else /* not __cplusplus */ +#define YYPARSE_PARAM_ARG YYPARSE_PARAM +#define YYPARSE_PARAM_DECL void *YYPARSE_PARAM; +#endif /* not __cplusplus */ +#else /* not YYPARSE_PARAM */ +#define YYPARSE_PARAM_ARG +#define YYPARSE_PARAM_DECL +#endif /* not YYPARSE_PARAM */ +/* Prevent warning if -Wstrict-prototypes. */ +#ifdef __GNUC__ #ifdef YYPARSE_PARAM -# if defined (__STDC__) || defined (__cplusplus) -int yyparse (void *YYPARSE_PARAM) -# else -int yyparse (YYPARSE_PARAM) - void *YYPARSE_PARAM; -# endif -#else /* ! YYPARSE_PARAM */ -#if defined (__STDC__) || defined (__cplusplus) -int -yyparse (void) +int yyparse (void *); #else -int -yyparse () - +int yyparse (void); #endif #endif + +int +yyparse(YYPARSE_PARAM_ARG) + YYPARSE_PARAM_DECL { - register int yystate; register int yyn; - int yyresult; - /* Number of tokens to shift before error messages enabled. */ - int yyerrstatus; - /* Lookahead token as an internal (translated) token number. */ - int yytoken = 0; - - /* Three stacks and their tools: - `yyss': related to states, - `yyvs': related to semantic values, - `yyls': related to locations. - - Refer to the stacks thru separate pointers, to allow yyoverflow - to reallocate them elsewhere. */ - - /* The state stack. */ - short yyssa[YYINITDEPTH]; - short *yyss = yyssa; register short *yyssp; - - /* The semantic value stack. */ - YYSTYPE yyvsa[YYINITDEPTH]; - YYSTYPE *yyvs = yyvsa; register YYSTYPE *yyvsp; + int yyerrstatus; /* number of tokens to shift before error messages enabled */ + int yychar1 = 0; /* lookahead token as an internal (translated) token number */ + short yyssa[YYINITDEPTH]; /* the state stack */ + YYSTYPE yyvsa[YYINITDEPTH]; /* the semantic value stack */ + short *yyss = yyssa; /* refer to the stacks thru separate pointers */ + YYSTYPE *yyvs = yyvsa; /* to allow yyoverflow to reallocate them elsewhere */ +#ifdef YYLSP_NEEDED + YYLTYPE yylsa[YYINITDEPTH]; /* the location stack */ + YYLTYPE *yyls = yylsa; + YYLTYPE *yylsp; + +#define YYPOPSTACK (yyvsp--, yyssp--, yylsp--) +#else #define YYPOPSTACK (yyvsp--, yyssp--) +#endif - YYSIZE_T yystacksize = YYINITDEPTH; + int yystacksize = YYINITDEPTH; + int yyfree_stacks = 0; - /* The variables used to return semantic value and location from the - action routines. */ - YYSTYPE yyval; +#ifdef YYPURE + int yychar; + YYSTYPE yylval; + int yynerrs; +#ifdef YYLSP_NEEDED + YYLTYPE yylloc; +#endif +#endif + YYSTYPE yyval; /* the variable used to return */ + /* semantic values from the action */ + /* routines */ - /* When reducing, the number of symbols on the RHS of the reduced - rule. */ int yylen; - YYDPRINTF ((stderr, "Starting parse\n")); +#if YYDEBUG != 0 + if (yydebug) + fprintf(stderr, "Starting parse\n"); +#endif yystate = 0; yyerrstatus = 0; @@ -2397,96 +1997,110 @@ so that they stay on the same level as the state stack. The wasted elements are never initialized. */ - yyssp = yyss; + yyssp = yyss - 1; yyvsp = yyvs; +#ifdef YYLSP_NEEDED + yylsp = yyls; +#endif - goto yysetstate; - -/*------------------------------------------------------------. -| yynewstate -- Push a new state, which is found in yystate. | -`------------------------------------------------------------*/ - yynewstate: - /* In all cases, when you get here, the value and location stacks - have just been pushed. so pushing a state here evens the stacks. - */ - yyssp++; - - yysetstate: - *yyssp = yystate; +/* Push a new state, which is found in yystate . */ +/* In all cases, when you get here, the value and location stacks + have just been pushed. so pushing a state here evens the stacks. */ +yynewstate: + + *++yyssp = yystate; + + if (yyssp >= yyss + yystacksize - 1) + { + /* Give user a chance to reallocate the stack */ + /* Use copies of these so that the &'s don't force the real ones into memory. */ + YYSTYPE *yyvs1 = yyvs; + short *yyss1 = yyss; +#ifdef YYLSP_NEEDED + YYLTYPE *yyls1 = yyls; +#endif - if (yyss + yystacksize - 1 <= yyssp) - { /* Get the current used size of the three stacks, in elements. */ - YYSIZE_T yysize = yyssp - yyss + 1; + int size = yyssp - yyss + 1; #ifdef yyoverflow - { - /* Give user a chance to reallocate the stack. Use copies of - these so that the &'s don't force the real ones into - memory. */ - YYSTYPE *yyvs1 = yyvs; - short *yyss1 = yyss; - - - /* Each stack pointer address is followed by the size of the - data in use in that stack, in bytes. This used to be a - conditional around just the two extra args, but that might - be undefined if yyoverflow is a macro. */ - yyoverflow ("parser stack overflow", - &yyss1, yysize * sizeof (*yyssp), - &yyvs1, yysize * sizeof (*yyvsp), - - &yystacksize); + /* Each stack pointer address is followed by the size of + the data in use in that stack, in bytes. */ +#ifdef YYLSP_NEEDED + /* This used to be a conditional around just the two extra args, + but that might be undefined if yyoverflow is a macro. */ + yyoverflow("parser stack overflow", + &yyss1, size * sizeof (*yyssp), + &yyvs1, size * sizeof (*yyvsp), + &yyls1, size * sizeof (*yylsp), + &yystacksize); +#else + yyoverflow("parser stack overflow", + &yyss1, size * sizeof (*yyssp), + &yyvs1, size * sizeof (*yyvsp), + &yystacksize); +#endif - yyss = yyss1; - yyvs = yyvs1; - } + yyss = yyss1; yyvs = yyvs1; +#ifdef YYLSP_NEEDED + yyls = yyls1; +#endif #else /* no yyoverflow */ -# ifndef YYSTACK_RELOCATE - goto yyoverflowlab; -# else /* Extend the stack our own way. */ - if (YYMAXDEPTH <= yystacksize) - goto yyoverflowlab; + if (yystacksize >= YYMAXDEPTH) + { + yyerror("parser stack overflow"); + if (yyfree_stacks) + { + free (yyss); + free (yyvs); +#ifdef YYLSP_NEEDED + free (yyls); +#endif + } + return 2; + } yystacksize *= 2; - if (YYMAXDEPTH < yystacksize) + if (yystacksize > YYMAXDEPTH) yystacksize = YYMAXDEPTH; - - { - short *yyss1 = yyss; - union yyalloc *yyptr = - (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize)); - if (! yyptr) - goto yyoverflowlab; - YYSTACK_RELOCATE (yyss); - YYSTACK_RELOCATE (yyvs); - -# undef YYSTACK_RELOCATE - if (yyss1 != yyssa) - YYSTACK_FREE (yyss1); - } -# endif +#ifndef YYSTACK_USE_ALLOCA + yyfree_stacks = 1; +#endif + yyss = (short *) YYSTACK_ALLOC (yystacksize * sizeof (*yyssp)); + __yy_memcpy ((char *)yyss, (char *)yyss1, + size * (unsigned int) sizeof (*yyssp)); + yyvs = (YYSTYPE *) YYSTACK_ALLOC (yystacksize * sizeof (*yyvsp)); + __yy_memcpy ((char *)yyvs, (char *)yyvs1, + size * (unsigned int) sizeof (*yyvsp)); +#ifdef YYLSP_NEEDED + yyls = (YYLTYPE *) YYSTACK_ALLOC (yystacksize * sizeof (*yylsp)); + __yy_memcpy ((char *)yyls, (char *)yyls1, + size * (unsigned int) sizeof (*yylsp)); +#endif #endif /* no yyoverflow */ - yyssp = yyss + yysize - 1; - yyvsp = yyvs + yysize - 1; - + yyssp = yyss + size - 1; + yyvsp = yyvs + size - 1; +#ifdef YYLSP_NEEDED + yylsp = yyls + size - 1; +#endif - YYDPRINTF ((stderr, "Stack size increased to %lu\n", - (unsigned long int) yystacksize)); +#if YYDEBUG != 0 + if (yydebug) + fprintf(stderr, "Stack size increased to %d\n", yystacksize); +#endif - if (yyss + yystacksize - 1 <= yyssp) + if (yyssp >= yyss + yystacksize - 1) YYABORT; } - YYDPRINTF ((stderr, "Entering state %d\n", yystate)); +#if YYDEBUG != 0 + if (yydebug) + fprintf(stderr, "Entering state %d\n", yystate); +#endif goto yybackup; - -/*-----------. -| yybackup. | -`-----------*/ -yybackup: + yybackup: /* Do appropriate processing given the current state. */ /* Read a lookahead token if we need one and don't already have one. */ @@ -2495,236 +2109,251 @@ /* First try to decide what to do without reference to lookahead token. */ yyn = yypact[yystate]; - if (yyn == YYPACT_NINF) + if (yyn == YYFLAG) goto yydefault; /* Not known => get a lookahead token if don't already have one. */ - /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */ + /* yychar is either YYEMPTY or YYEOF + or a valid token in external form. */ + if (yychar == YYEMPTY) { - YYDPRINTF ((stderr, "Reading a token: ")); +#if YYDEBUG != 0 + if (yydebug) + fprintf(stderr, "Reading a token: "); +#endif yychar = YYLEX; } - if (yychar <= YYEOF) + /* Convert token to internal form (in yychar1) for indexing tables with */ + + if (yychar <= 0) /* This means end of input. */ { - yychar = yytoken = YYEOF; - YYDPRINTF ((stderr, "Now at end of input.\n")); + yychar1 = 0; + yychar = YYEOF; /* Don't call YYLEX any more */ + +#if YYDEBUG != 0 + if (yydebug) + fprintf(stderr, "Now at end of input.\n"); +#endif } else { - yytoken = YYTRANSLATE (yychar); - YYDSYMPRINTF ("Next token is", yytoken, &yylval, &yylloc); + yychar1 = YYTRANSLATE(yychar); + +#if YYDEBUG != 0 + if (yydebug) + { + fprintf (stderr, "Next token is %d (%s", yychar, yytname[yychar1]); + /* Give the individual parser a way to print the precise meaning + of a token, for further debugging info. */ +#ifdef YYPRINT + YYPRINT (stderr, yychar, yylval); +#endif + fprintf (stderr, ")\n"); + } +#endif } - /* If the proper action on seeing token YYTOKEN is to reduce or to - detect an error, take that action. */ - yyn += yytoken; - if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken) + yyn += yychar1; + if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != yychar1) goto yydefault; + yyn = yytable[yyn]; - if (yyn <= 0) + + /* yyn is what to do for this token type in this state. + Negative => reduce, -yyn is rule number. + Positive => shift, yyn is new state. + New state is final state => don't bother to shift, + just return success. + 0, or most negative number => error. */ + + if (yyn < 0) { - if (yyn == 0 || yyn == YYTABLE_NINF) + if (yyn == YYFLAG) goto yyerrlab; yyn = -yyn; goto yyreduce; } + else if (yyn == 0) + goto yyerrlab; if (yyn == YYFINAL) YYACCEPT; /* Shift the lookahead token. */ - YYDPRINTF ((stderr, "Shifting token %s, ", yytname[yytoken])); + +#if YYDEBUG != 0 + if (yydebug) + fprintf(stderr, "Shifting token %d (%s), ", yychar, yytname[yychar1]); +#endif /* Discard the token being shifted unless it is eof. */ if (yychar != YYEOF) yychar = YYEMPTY; *++yyvsp = yylval; +#ifdef YYLSP_NEEDED + *++yylsp = yylloc; +#endif - - /* Count tokens shifted since error; after three, turn off error - status. */ - if (yyerrstatus) - yyerrstatus--; + /* count tokens shifted since error; after three, turn off error status. */ + if (yyerrstatus) yyerrstatus--; yystate = yyn; goto yynewstate; - -/*-----------------------------------------------------------. -| yydefault -- do the default action for the current state. | -`-----------------------------------------------------------*/ +/* Do the default action for the current state. */ yydefault: + yyn = yydefact[yystate]; if (yyn == 0) goto yyerrlab; - goto yyreduce; - -/*-----------------------------. -| yyreduce -- Do a reduction. | -`-----------------------------*/ +/* Do a reduction. yyn is the number of a rule to reduce with. */ yyreduce: - /* yyn is the number of a rule to reduce with. */ yylen = yyr2[yyn]; + if (yylen > 0) + yyval = yyvsp[1-yylen]; /* implement default value of the action */ + +#if YYDEBUG != 0 + if (yydebug) + { + int i; + + fprintf (stderr, "Reducing via rule %d (line %d), ", + yyn, yyrline[yyn]); - /* If YYLEN is nonzero, implement the default value of the action: - `$$ = $1'. + /* Print the symbols being reduced, and their result. */ + for (i = yyprhs[yyn]; yyrhs[i] > 0; i++) + fprintf (stderr, "%s ", yytname[yyrhs[i]]); + fprintf (stderr, " -> %s\n", yytname[yyr1[yyn]]); + } +#endif - Otherwise, the following line sets YYVAL to garbage. - This behavior is undocumented and Bison - users should not rely upon it. Assigning to YYVAL - unconditionally makes the parser a bit smaller, and it avoids a - GCC warning that YYVAL may be used uninitialized. */ - yyval = yyvsp[1-yylen]; + switch (yyn) { - YY_REDUCE_PRINT (yyn); - switch (yyn) - { - case 3: -#line 983 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y" - { +case 2: +#line 987 "/Users/bocchino/llvm/obj/../src/lib/AsmParser/llvmAsmParser.y" +{ if (yyvsp[0].UIntVal > (uint32_t)INT32_MAX) // Outside of my range! ThrowException("Value too large for type!"); yyval.SIntVal = (int32_t)yyvsp[0].UIntVal; -;} - break; - - case 5: -#line 991 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y" - { +; + break;} +case 4: +#line 995 "/Users/bocchino/llvm/obj/../src/lib/AsmParser/llvmAsmParser.y" +{ if (yyvsp[0].UInt64Val > (uint64_t)INT64_MAX) // Outside of my range! ThrowException("Value too large for type!"); yyval.SInt64Val = (int64_t)yyvsp[0].UInt64Val; -;} - break; - - case 34: -#line 1014 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y" - { +; + break;} +case 39: +#line 1019 "/Users/bocchino/llvm/obj/../src/lib/AsmParser/llvmAsmParser.y" +{ yyval.StrVal = yyvsp[-1].StrVal; - ;} - break; - - case 35: -#line 1017 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y" - { + ; + break;} +case 40: +#line 1022 "/Users/bocchino/llvm/obj/../src/lib/AsmParser/llvmAsmParser.y" +{ yyval.StrVal = 0; - ;} - break; - - case 36: -#line 1021 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y" - { yyval.Linkage = GlobalValue::InternalLinkage; ;} - break; - - case 37: -#line 1022 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y" - { yyval.Linkage = GlobalValue::LinkOnceLinkage; ;} - break; - - case 38: -#line 1023 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y" - { yyval.Linkage = GlobalValue::WeakLinkage; ;} - break; - - case 39: -#line 1024 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y" - { yyval.Linkage = GlobalValue::AppendingLinkage; ;} - break; - - case 40: -#line 1025 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y" - { yyval.Linkage = GlobalValue::ExternalLinkage; ;} - break; - - case 41: -#line 1027 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y" - { yyval.UIntVal = CallingConv::C; ;} - break; - - case 42: -#line 1028 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y" - { yyval.UIntVal = CallingConv::C; ;} - break; - - case 43: -#line 1029 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y" - { yyval.UIntVal = CallingConv::Fast; ;} - break; - - case 44: -#line 1030 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y" - { yyval.UIntVal = CallingConv::Cold; ;} - break; - - case 45: -#line 1031 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y" - { + ; + break;} +case 41: +#line 1026 "/Users/bocchino/llvm/obj/../src/lib/AsmParser/llvmAsmParser.y" +{ yyval.Linkage = GlobalValue::InternalLinkage; ; + break;} +case 42: +#line 1027 "/Users/bocchino/llvm/obj/../src/lib/AsmParser/llvmAsmParser.y" +{ yyval.Linkage = GlobalValue::LinkOnceLinkage; ; + break;} +case 43: +#line 1028 "/Users/bocchino/llvm/obj/../src/lib/AsmParser/llvmAsmParser.y" +{ yyval.Linkage = GlobalValue::WeakLinkage; ; + break;} +case 44: +#line 1029 "/Users/bocchino/llvm/obj/../src/lib/AsmParser/llvmAsmParser.y" +{ yyval.Linkage = GlobalValue::AppendingLinkage; ; + break;} +case 45: +#line 1030 "/Users/bocchino/llvm/obj/../src/lib/AsmParser/llvmAsmParser.y" +{ yyval.Linkage = GlobalValue::ExternalLinkage; ; + break;} +case 46: +#line 1032 "/Users/bocchino/llvm/obj/../src/lib/AsmParser/llvmAsmParser.y" +{ yyval.UIntVal = CallingConv::C; ; + break;} +case 47: +#line 1033 "/Users/bocchino/llvm/obj/../src/lib/AsmParser/llvmAsmParser.y" +{ yyval.UIntVal = CallingConv::C; ; + break;} +case 48: +#line 1034 "/Users/bocchino/llvm/obj/../src/lib/AsmParser/llvmAsmParser.y" +{ yyval.UIntVal = CallingConv::Fast; ; + break;} +case 49: +#line 1035 "/Users/bocchino/llvm/obj/../src/lib/AsmParser/llvmAsmParser.y" +{ yyval.UIntVal = CallingConv::Cold; ; + break;} +case 50: +#line 1036 "/Users/bocchino/llvm/obj/../src/lib/AsmParser/llvmAsmParser.y" +{ if ((unsigned)yyvsp[0].UInt64Val != yyvsp[0].UInt64Val) ThrowException("Calling conv too large!"); yyval.UIntVal = yyvsp[0].UInt64Val; - ;} - break; - - case 47: -#line 1044 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y" - { yyval.TypeVal = new PATypeHolder(yyvsp[0].PrimType); ;} - break; - - case 49: -#line 1045 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y" - { yyval.TypeVal = new PATypeHolder(yyvsp[0].PrimType); ;} - break; - - case 50: -#line 1047 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y" - { + ; + break;} +case 52: +#line 1049 "/Users/bocchino/llvm/obj/../src/lib/AsmParser/llvmAsmParser.y" +{ yyval.TypeVal = new PATypeHolder(yyvsp[0].PrimType); ; + break;} +case 54: +#line 1050 "/Users/bocchino/llvm/obj/../src/lib/AsmParser/llvmAsmParser.y" +{ yyval.TypeVal = new PATypeHolder(yyvsp[0].PrimType); ; + break;} +case 55: +#line 1052 "/Users/bocchino/llvm/obj/../src/lib/AsmParser/llvmAsmParser.y" +{ if (!UpRefs.empty()) ThrowException("Invalid upreference in type: " + (*yyvsp[0].TypeVal)->getDescription()); yyval.TypeVal = yyvsp[0].TypeVal; - ;} - break; - - case 64: -#line 1058 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y" - { + ; + break;} +case 69: +#line 1063 "/Users/bocchino/llvm/obj/../src/lib/AsmParser/llvmAsmParser.y" +{ yyval.TypeVal = new PATypeHolder(OpaqueType::get()); - ;} - break; - - case 65: -#line 1061 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y" - { + ; + break;} +case 70: +#line 1066 "/Users/bocchino/llvm/obj/../src/lib/AsmParser/llvmAsmParser.y" +{ yyval.TypeVal = new PATypeHolder(yyvsp[0].PrimType); - ;} - break; - - case 66: -#line 1064 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y" - { // Named types are also simple types... + ; + break;} +case 71: +#line 1069 "/Users/bocchino/llvm/obj/../src/lib/AsmParser/llvmAsmParser.y" +{ // Named types are also simple types... yyval.TypeVal = new PATypeHolder(getTypeVal(yyvsp[0].ValIDVal)); -;} - break; - - case 67: -#line 1070 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y" - { // Type UpReference +; + break;} +case 72: +#line 1075 "/Users/bocchino/llvm/obj/../src/lib/AsmParser/llvmAsmParser.y" +{ // Type UpReference if (yyvsp[0].UInt64Val > (uint64_t)~0U) ThrowException("Value out of range!"); OpaqueType *OT = OpaqueType::get(); // Use temporary placeholder UpRefs.push_back(UpRefRecord((unsigned)yyvsp[0].UInt64Val, OT)); // Add to vector... yyval.TypeVal = new PATypeHolder(OT); UR_OUT("New Upreference!\n"); - ;} - break; - - case 68: -#line 1077 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y" - { // Function derived type? + ; + break;} +case 73: +#line 1082 "/Users/bocchino/llvm/obj/../src/lib/AsmParser/llvmAsmParser.y" +{ // Function derived type? std::vector Params; for (std::list::iterator I = yyvsp[-1].TypeList->begin(), E = yyvsp[-1].TypeList->end(); I != E; ++I) @@ -2735,35 +2364,39 @@ yyval.TypeVal = new PATypeHolder(HandleUpRefs(FunctionType::get(*yyvsp[-3].TypeVal,Params,isVarArg))); delete yyvsp[-1].TypeList; // Delete the argument list delete yyvsp[-3].TypeVal; // Delete the return type handle - ;} - break; - - case 69: -#line 1089 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y" - { // Sized array type? + ; + break;} +case 74: +#line 1094 "/Users/bocchino/llvm/obj/../src/lib/AsmParser/llvmAsmParser.y" +{ // Sized array type? yyval.TypeVal = new PATypeHolder(HandleUpRefs(ArrayType::get(*yyvsp[-1].TypeVal, (unsigned)yyvsp[-3].UInt64Val))); delete yyvsp[-1].TypeVal; - ;} - break; - - case 70: -#line 1093 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y" - { // Packed array type? + ; + break;} +case 75: +#line 1099 "/Users/bocchino/llvm/obj/../src/lib/AsmParser/llvmAsmParser.y" +{ // Vector type? + yyval.TypeVal = new PATypeHolder(HandleUpRefs(VectorType::get(*yyvsp[-1].TypeVal))); + delete yyvsp[-1].TypeVal; + ; + break;} +case 76: +#line 1104 "/Users/bocchino/llvm/obj/../src/lib/AsmParser/llvmAsmParser.y" +{ // FixedVector type? const llvm::Type* ElemTy = yyvsp[-1].TypeVal->get(); - if ((unsigned)yyvsp[-3].UInt64Val != yyvsp[-3].UInt64Val) { + if ((unsigned)yyvsp[-2].UInt64Val != yyvsp[-2].UInt64Val) { ThrowException("Unsigned result not equal to signed result"); } if(!ElemTy->isPrimitiveType()) { - ThrowException("Elemental type of a PackedType must be primitive"); + ThrowException("Element type of a FixedVectorType must be primitive"); } - yyval.TypeVal = new PATypeHolder(HandleUpRefs(PackedType::get(*yyvsp[-1].TypeVal, (unsigned)yyvsp[-3].UInt64Val))); + yyval.TypeVal = new PATypeHolder(HandleUpRefs(FixedVectorType::get(*yyvsp[-1].TypeVal, (unsigned)yyvsp[-2].UInt64Val))); delete yyvsp[-1].TypeVal; - ;} - break; - - case 71: -#line 1104 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y" - { // Structure type? + ; + break;} +case 77: +#line 1116 "/Users/bocchino/llvm/obj/../src/lib/AsmParser/llvmAsmParser.y" +{ // Structure type? std::vector Elements; for (std::list::iterator I = yyvsp[-1].TypeList->begin(), E = yyvsp[-1].TypeList->end(); I != E; ++I) @@ -2771,63 +2404,55 @@ yyval.TypeVal = new PATypeHolder(HandleUpRefs(StructType::get(Elements))); delete yyvsp[-1].TypeList; - ;} - break; - - case 72: -#line 1113 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y" - { // Empty structure type? + ; + break;} +case 78: +#line 1125 "/Users/bocchino/llvm/obj/../src/lib/AsmParser/llvmAsmParser.y" +{ // Empty structure type? yyval.TypeVal = new PATypeHolder(StructType::get(std::vector())); - ;} - break; - - case 73: -#line 1116 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y" - { // Pointer type? + ; + break;} +case 79: +#line 1128 "/Users/bocchino/llvm/obj/../src/lib/AsmParser/llvmAsmParser.y" +{ // Pointer type? yyval.TypeVal = new PATypeHolder(HandleUpRefs(PointerType::get(*yyvsp[-1].TypeVal))); delete yyvsp[-1].TypeVal; - ;} - break; - - case 74: -#line 1124 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y" - { + ; + break;} +case 80: +#line 1136 "/Users/bocchino/llvm/obj/../src/lib/AsmParser/llvmAsmParser.y" +{ yyval.TypeList = new std::list(); yyval.TypeList->push_back(*yyvsp[0].TypeVal); delete yyvsp[0].TypeVal; - ;} - break; - - case 75: -#line 1128 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y" - { + ; + break;} +case 81: +#line 1140 "/Users/bocchino/llvm/obj/../src/lib/AsmParser/llvmAsmParser.y" +{ (yyval.TypeList=yyvsp[-2].TypeList)->push_back(*yyvsp[0].TypeVal); delete yyvsp[0].TypeVal; - ;} - break; - - case 77: -#line 1134 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y" - { + ; + break;} +case 83: +#line 1146 "/Users/bocchino/llvm/obj/../src/lib/AsmParser/llvmAsmParser.y" +{ (yyval.TypeList=yyvsp[-2].TypeList)->push_back(Type::VoidTy); - ;} - break; - - case 78: -#line 1137 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y" - { + ; + break;} +case 84: +#line 1149 "/Users/bocchino/llvm/obj/../src/lib/AsmParser/llvmAsmParser.y" +{ (yyval.TypeList = new std::list())->push_back(Type::VoidTy); - ;} - break; - - case 79: -#line 1140 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y" - { + ; + break;} +case 85: +#line 1152 "/Users/bocchino/llvm/obj/../src/lib/AsmParser/llvmAsmParser.y" +{ yyval.TypeList = new std::list(); - ;} - break; - - case 80: -#line 1150 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y" - { // Nonempty unsized arr + ; + break;} +case 86: +#line 1162 "/Users/bocchino/llvm/obj/../src/lib/AsmParser/llvmAsmParser.y" +{ // Nonempty unsized arr const ArrayType *ATy = dyn_cast(yyvsp[-3].TypeVal->get()); if (ATy == 0) ThrowException("Cannot make array constant with type: '" + @@ -2851,12 +2476,11 @@ yyval.ConstVal = ConstantArray::get(ATy, *yyvsp[-1].ConstVector); delete yyvsp[-3].TypeVal; delete yyvsp[-1].ConstVector; - ;} - break; - - case 81: -#line 1175 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y" - { + ; + break;} +case 87: +#line 1187 "/Users/bocchino/llvm/obj/../src/lib/AsmParser/llvmAsmParser.y" +{ const ArrayType *ATy = dyn_cast(yyvsp[-2].TypeVal->get()); if (ATy == 0) ThrowException("Cannot make array constant with type: '" + @@ -2868,12 +2492,11 @@ " arguments, but has size of " + itostr(NumElements) +"!"); yyval.ConstVal = ConstantArray::get(ATy, std::vector()); delete yyvsp[-2].TypeVal; - ;} - break; - - case 82: -#line 1188 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y" - { + ; + break;} +case 88: +#line 1200 "/Users/bocchino/llvm/obj/../src/lib/AsmParser/llvmAsmParser.y" +{ const ArrayType *ATy = dyn_cast(yyvsp[-2].TypeVal->get()); if (ATy == 0) ThrowException("Cannot make array constant with type: '" + @@ -2900,22 +2523,21 @@ free(yyvsp[0].StrVal); yyval.ConstVal = ConstantArray::get(ATy, Vals); delete yyvsp[-2].TypeVal; - ;} - break; - - case 83: -#line 1216 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y" - { // Nonempty unsized arr - const PackedType *PTy = dyn_cast(yyvsp[-3].TypeVal->get()); + ; + break;} +case 89: +#line 1228 "/Users/bocchino/llvm/obj/../src/lib/AsmParser/llvmAsmParser.y" +{ // Nonempty unsized arr + const FixedVectorType *PTy = dyn_cast(yyvsp[-3].TypeVal->get()); if (PTy == 0) - ThrowException("Cannot make packed constant with type: '" + + ThrowException("Cannot make vector constant with type: '" + (*yyvsp[-3].TypeVal)->getDescription() + "'!"); const Type *ETy = PTy->getElementType(); int NumElements = PTy->getNumElements(); // Verify that we have the correct size... if (NumElements != -1 && NumElements != (int)yyvsp[-1].ConstVector->size()) - ThrowException("Type mismatch: constant sized packed initialized with " + + ThrowException("Type mismatch: constant sized vector initialized with " + utostr(yyvsp[-1].ConstVector->size()) + " arguments, but has size of " + itostr(NumElements) + "!"); @@ -2927,14 +2549,13 @@ (*yyvsp[-1].ConstVector)[i]->getType()->getDescription() + "'."); } - yyval.ConstVal = ConstantPacked::get(PTy, *yyvsp[-1].ConstVector); + yyval.ConstVal = ConstantVector::get(PTy, *yyvsp[-1].ConstVector); delete yyvsp[-3].TypeVal; delete yyvsp[-1].ConstVector; - ;} - break; - - case 84: -#line 1241 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y" - { + ; + break;} +case 90: +#line 1253 "/Users/bocchino/llvm/obj/../src/lib/AsmParser/llvmAsmParser.y" +{ const StructType *STy = dyn_cast(yyvsp[-3].TypeVal->get()); if (STy == 0) ThrowException("Cannot make struct constant with type: '" + @@ -2953,12 +2574,11 @@ yyval.ConstVal = ConstantStruct::get(STy, *yyvsp[-1].ConstVector); delete yyvsp[-3].TypeVal; delete yyvsp[-1].ConstVector; - ;} - break; - - case 85: -#line 1261 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y" - { + ; + break;} +case 91: +#line 1273 "/Users/bocchino/llvm/obj/../src/lib/AsmParser/llvmAsmParser.y" +{ const StructType *STy = dyn_cast(yyvsp[-2].TypeVal->get()); if (STy == 0) ThrowException("Cannot make struct constant with type: '" + @@ -2969,12 +2589,11 @@ yyval.ConstVal = ConstantStruct::get(STy, std::vector()); delete yyvsp[-2].TypeVal; - ;} - break; - - case 86: -#line 1273 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y" - { + ; + break;} +case 92: +#line 1285 "/Users/bocchino/llvm/obj/../src/lib/AsmParser/llvmAsmParser.y" +{ const PointerType *PTy = dyn_cast(yyvsp[-1].TypeVal->get()); if (PTy == 0) ThrowException("Cannot make null pointer constant with type: '" + @@ -2982,20 +2601,18 @@ yyval.ConstVal = ConstantPointerNull::get(PTy); delete yyvsp[-1].TypeVal; - ;} - break; - - case 87: -#line 1282 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y" - { + ; + break;} +case 93: +#line 1294 "/Users/bocchino/llvm/obj/../src/lib/AsmParser/llvmAsmParser.y" +{ yyval.ConstVal = UndefValue::get(yyvsp[-1].TypeVal->get()); delete yyvsp[-1].TypeVal; - ;} - break; - - case 88: -#line 1286 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y" - { + ; + break;} +case 94: +#line 1298 "/Users/bocchino/llvm/obj/../src/lib/AsmParser/llvmAsmParser.y" +{ const PointerType *Ty = dyn_cast(yyvsp[-1].TypeVal->get()); if (Ty == 0) ThrowException("Global const reference must be a pointer type!"); @@ -3053,74 +2670,66 @@ yyval.ConstVal = cast(V); delete yyvsp[-1].TypeVal; // Free the type handle - ;} - break; - - case 89: -#line 1345 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y" - { + ; + break;} +case 95: +#line 1357 "/Users/bocchino/llvm/obj/../src/lib/AsmParser/llvmAsmParser.y" +{ if (yyvsp[-1].TypeVal->get() != yyvsp[0].ConstVal->getType()) ThrowException("Mismatched types for constant expression!"); yyval.ConstVal = yyvsp[0].ConstVal; delete yyvsp[-1].TypeVal; - ;} - break; - - case 90: -#line 1351 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y" - { + ; + break;} +case 96: +#line 1363 "/Users/bocchino/llvm/obj/../src/lib/AsmParser/llvmAsmParser.y" +{ const Type *Ty = yyvsp[-1].TypeVal->get(); if (isa(Ty) || Ty == Type::LabelTy || isa(Ty)) ThrowException("Cannot create a null initialized value of this type!"); yyval.ConstVal = Constant::getNullValue(Ty); delete yyvsp[-1].TypeVal; - ;} - break; - - case 91: -#line 1359 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y" - { // integral constants + ; + break;} +case 97: +#line 1371 "/Users/bocchino/llvm/obj/../src/lib/AsmParser/llvmAsmParser.y" +{ // integral constants if (!ConstantSInt::isValueValidForType(yyvsp[-1].PrimType, yyvsp[0].SInt64Val)) ThrowException("Constant value doesn't fit in type!"); yyval.ConstVal = ConstantSInt::get(yyvsp[-1].PrimType, yyvsp[0].SInt64Val); - ;} - break; - - case 92: -#line 1364 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y" - { // integral constants + ; + break;} +case 98: +#line 1376 "/Users/bocchino/llvm/obj/../src/lib/AsmParser/llvmAsmParser.y" +{ // integral constants if (!ConstantUInt::isValueValidForType(yyvsp[-1].PrimType, yyvsp[0].UInt64Val)) ThrowException("Constant value doesn't fit in type!"); yyval.ConstVal = ConstantUInt::get(yyvsp[-1].PrimType, yyvsp[0].UInt64Val); - ;} - break; - - case 93: -#line 1369 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y" - { // Boolean constants + ; + break;} +case 99: +#line 1381 "/Users/bocchino/llvm/obj/../src/lib/AsmParser/llvmAsmParser.y" +{ // Boolean constants yyval.ConstVal = ConstantBool::True; - ;} - break; - - case 94: -#line 1372 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y" - { // Boolean constants + ; + break;} +case 100: +#line 1384 "/Users/bocchino/llvm/obj/../src/lib/AsmParser/llvmAsmParser.y" +{ // Boolean constants yyval.ConstVal = ConstantBool::False; - ;} - break; - - case 95: -#line 1375 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y" - { // Float & Double constants + ; + break;} +case 101: +#line 1387 "/Users/bocchino/llvm/obj/../src/lib/AsmParser/llvmAsmParser.y" +{ // Float & Double constants if (!ConstantFP::isValueValidForType(yyvsp[-1].PrimType, yyvsp[0].FPVal)) ThrowException("Floating point constant invalid for type!!"); yyval.ConstVal = ConstantFP::get(yyvsp[-1].PrimType, yyvsp[0].FPVal); - ;} - break; - - case 96: -#line 1382 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y" - { + ; + break;} +case 102: +#line 1394 "/Users/bocchino/llvm/obj/../src/lib/AsmParser/llvmAsmParser.y" +{ if (!yyvsp[-3].ConstVal->getType()->isFirstClassType()) ThrowException("cast constant expression from a non-primitive type: '" + yyvsp[-3].ConstVal->getType()->getDescription() + "'!"); @@ -3129,12 +2738,11 @@ yyvsp[-1].TypeVal->get()->getDescription() + "'!"); yyval.ConstVal = ConstantExpr::getCast(yyvsp[-3].ConstVal, yyvsp[-1].TypeVal->get()); delete yyvsp[-1].TypeVal; - ;} - break; - - case 97: -#line 1392 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y" - { + ; + break;} +case 103: +#line 1404 "/Users/bocchino/llvm/obj/../src/lib/AsmParser/llvmAsmParser.y" +{ if (!isa(yyvsp[-2].ConstVal->getType())) ThrowException("GetElementPtr requires a pointer operand!"); @@ -3164,23 +2772,21 @@ delete yyvsp[-1].ValueList; yyval.ConstVal = ConstantExpr::getGetElementPtr(yyvsp[-2].ConstVal, IdxVec); - ;} - break; - - case 98: -#line 1423 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y" - { + ; + break;} +case 104: +#line 1435 "/Users/bocchino/llvm/obj/../src/lib/AsmParser/llvmAsmParser.y" +{ if (yyvsp[-5].ConstVal->getType() != Type::BoolTy) ThrowException("Select condition must be of boolean type!"); if (yyvsp[-3].ConstVal->getType() != yyvsp[-1].ConstVal->getType()) ThrowException("Select operand types must match!"); yyval.ConstVal = ConstantExpr::getSelect(yyvsp[-5].ConstVal, yyvsp[-3].ConstVal, yyvsp[-1].ConstVal); - ;} - break; - - case 99: -#line 1430 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y" - { + ; + break;} +case 105: +#line 1442 "/Users/bocchino/llvm/obj/../src/lib/AsmParser/llvmAsmParser.y" +{ if (yyvsp[-3].ConstVal->getType() != yyvsp[-1].ConstVal->getType()) ThrowException("Binary operator types must match!"); // HACK: llvm 1.3 and earlier used to emit invalid pointer constant exprs. @@ -3200,98 +2806,89 @@ ConstantExpr::getCast(yyvsp[-1].ConstVal, IntPtrTy)); yyval.ConstVal = ConstantExpr::getCast(yyval.ConstVal, yyvsp[-3].ConstVal->getType()); } - ;} - break; - - case 100: -#line 1451 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y" - { + ; + break;} +case 106: +#line 1463 "/Users/bocchino/llvm/obj/../src/lib/AsmParser/llvmAsmParser.y" +{ if (yyvsp[-3].ConstVal->getType() != yyvsp[-1].ConstVal->getType()) ThrowException("Logical operator types must match!"); - if (!yyvsp[-3].ConstVal->getType()->isIntegral()) + if (!yyvsp[-3].ConstVal->getType()->isIntegral() && + !yyvsp[-3].ConstVal->getType()->isIntegralVector()) ThrowException("Logical operands must have integral types!"); yyval.ConstVal = ConstantExpr::get(yyvsp[-5].BinaryOpVal, yyvsp[-3].ConstVal, yyvsp[-1].ConstVal); - ;} - break; - - case 101: -#line 1458 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y" - { + ; + break;} +case 107: +#line 1471 "/Users/bocchino/llvm/obj/../src/lib/AsmParser/llvmAsmParser.y" +{ if (yyvsp[-3].ConstVal->getType() != yyvsp[-1].ConstVal->getType()) ThrowException("setcc operand types must match!"); yyval.ConstVal = ConstantExpr::get(yyvsp[-5].BinaryOpVal, yyvsp[-3].ConstVal, yyvsp[-1].ConstVal); - ;} - break; - - case 102: -#line 1463 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y" - { + ; + break;} +case 108: +#line 1476 "/Users/bocchino/llvm/obj/../src/lib/AsmParser/llvmAsmParser.y" +{ if (yyvsp[-1].ConstVal->getType() != Type::UByteTy) ThrowException("Shift count for shift constant must be unsigned byte!"); - if (!yyvsp[-3].ConstVal->getType()->isInteger()) + if (!yyvsp[-3].ConstVal->getType()->isInteger() && + !yyvsp[-3].ConstVal->getType()->isIntegerVector()) { ThrowException("Shift constant expression requires integer operand!"); + } yyval.ConstVal = ConstantExpr::get(yyvsp[-5].OtherOpVal, yyvsp[-3].ConstVal, yyvsp[-1].ConstVal); - ;} - break; - - case 103: -#line 1473 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y" - { + ; + break;} +case 109: +#line 1488 "/Users/bocchino/llvm/obj/../src/lib/AsmParser/llvmAsmParser.y" +{ (yyval.ConstVector = yyvsp[-2].ConstVector)->push_back(yyvsp[0].ConstVal); - ;} - break; - - case 104: -#line 1476 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y" - { + ; + break;} +case 110: +#line 1491 "/Users/bocchino/llvm/obj/../src/lib/AsmParser/llvmAsmParser.y" +{ yyval.ConstVector = new std::vector(); yyval.ConstVector->push_back(yyvsp[0].ConstVal); - ;} - break; - - case 105: -#line 1483 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y" - { yyval.BoolVal = false; ;} - break; - - case 106: -#line 1483 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y" - { yyval.BoolVal = true; ;} - break; - - case 107: -#line 1493 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y" - { + ; + break;} +case 111: +#line 1498 "/Users/bocchino/llvm/obj/../src/lib/AsmParser/llvmAsmParser.y" +{ yyval.BoolVal = false; ; + break;} +case 112: +#line 1498 "/Users/bocchino/llvm/obj/../src/lib/AsmParser/llvmAsmParser.y" +{ yyval.BoolVal = true; ; + break;} +case 113: +#line 1508 "/Users/bocchino/llvm/obj/../src/lib/AsmParser/llvmAsmParser.y" +{ yyval.ModuleVal = ParserResult = yyvsp[0].ModuleVal; CurModule.ModuleDone(); -;} - break; - - case 108: -#line 1500 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y" - { +; + break;} +case 114: +#line 1515 "/Users/bocchino/llvm/obj/../src/lib/AsmParser/llvmAsmParser.y" +{ yyval.ModuleVal = yyvsp[-1].ModuleVal; CurFun.FunctionDone(); - ;} - break; - - case 109: -#line 1504 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y" - { + ; + break;} +case 115: +#line 1519 "/Users/bocchino/llvm/obj/../src/lib/AsmParser/llvmAsmParser.y" +{ yyval.ModuleVal = yyvsp[-1].ModuleVal; - ;} - break; - - case 110: -#line 1507 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y" - { + ; + break;} +case 116: +#line 1522 "/Users/bocchino/llvm/obj/../src/lib/AsmParser/llvmAsmParser.y" +{ yyval.ModuleVal = yyvsp[-1].ModuleVal; - ;} - break; - - case 111: -#line 1510 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y" - { + ; + break;} +case 117: +#line 1525 "/Users/bocchino/llvm/obj/../src/lib/AsmParser/llvmAsmParser.y" +{ yyval.ModuleVal = CurModule.CurrentModule; // Emit an error if there are any unresolved types left. if (!CurModule.LateResolveTypes.empty()) { @@ -3301,12 +2898,11 @@ else ThrowException("Reference to an undefined type: #" + itostr(DID.Num)); } - ;} - break; - - case 112: -#line 1523 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y" - { + ; + break;} +case 118: +#line 1538 "/Users/bocchino/llvm/obj/../src/lib/AsmParser/llvmAsmParser.y" +{ // Eagerly resolve types. This is not an optimization, this is a // requirement that is due to the fact that we could have this: // @@ -3325,174 +2921,151 @@ } delete yyvsp[0].TypeVal; - ;} - break; - - case 113: -#line 1543 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y" - { // Function prototypes can be in const pool - ;} - break; - - case 114: -#line 1545 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y" - { + ; + break;} +case 119: +#line 1558 "/Users/bocchino/llvm/obj/../src/lib/AsmParser/llvmAsmParser.y" +{ // Function prototypes can be in const pool + ; + break;} +case 120: +#line 1560 "/Users/bocchino/llvm/obj/../src/lib/AsmParser/llvmAsmParser.y" +{ if (yyvsp[0].ConstVal == 0) ThrowException("Global value initializer is not a constant!"); ParseGlobalVariable(yyvsp[-3].StrVal, yyvsp[-2].Linkage, yyvsp[-1].BoolVal, yyvsp[0].ConstVal->getType(), yyvsp[0].ConstVal); - ;} - break; - - case 115: -#line 1549 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y" - { + ; + break;} +case 121: +#line 1564 "/Users/bocchino/llvm/obj/../src/lib/AsmParser/llvmAsmParser.y" +{ ParseGlobalVariable(yyvsp[-3].StrVal, GlobalValue::ExternalLinkage, yyvsp[-1].BoolVal, *yyvsp[0].TypeVal, 0); delete yyvsp[0].TypeVal; - ;} - break; - - case 116: -#line 1553 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y" - { - ;} - break; - - case 117: -#line 1555 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y" - { - ;} - break; - - case 118: -#line 1557 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y" - { - ;} - break; - - case 119: -#line 1562 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y" - { yyval.Endianness = Module::BigEndian; ;} - break; - - case 120: -#line 1563 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y" - { yyval.Endianness = Module::LittleEndian; ;} - break; - - case 121: -#line 1565 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y" - { + ; + break;} +case 122: +#line 1568 "/Users/bocchino/llvm/obj/../src/lib/AsmParser/llvmAsmParser.y" +{ + ; + break;} +case 123: +#line 1570 "/Users/bocchino/llvm/obj/../src/lib/AsmParser/llvmAsmParser.y" +{ + ; + break;} +case 124: +#line 1572 "/Users/bocchino/llvm/obj/../src/lib/AsmParser/llvmAsmParser.y" +{ + ; + break;} +case 125: +#line 1577 "/Users/bocchino/llvm/obj/../src/lib/AsmParser/llvmAsmParser.y" +{ yyval.Endianness = Module::BigEndian; ; + break;} +case 126: +#line 1578 "/Users/bocchino/llvm/obj/../src/lib/AsmParser/llvmAsmParser.y" +{ yyval.Endianness = Module::LittleEndian; ; + break;} +case 127: +#line 1580 "/Users/bocchino/llvm/obj/../src/lib/AsmParser/llvmAsmParser.y" +{ CurModule.CurrentModule->setEndianness(yyvsp[0].Endianness); - ;} - break; - - case 122: -#line 1568 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y" - { + ; + break;} +case 128: +#line 1583 "/Users/bocchino/llvm/obj/../src/lib/AsmParser/llvmAsmParser.y" +{ if (yyvsp[0].UInt64Val == 32) CurModule.CurrentModule->setPointerSize(Module::Pointer32); else if (yyvsp[0].UInt64Val == 64) CurModule.CurrentModule->setPointerSize(Module::Pointer64); else ThrowException("Invalid pointer size: '" + utostr(yyvsp[0].UInt64Val) + "'!"); - ;} - break; - - case 123: -#line 1576 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y" - { + ; + break;} +case 129: +#line 1591 "/Users/bocchino/llvm/obj/../src/lib/AsmParser/llvmAsmParser.y" +{ CurModule.CurrentModule->setTargetTriple(yyvsp[0].StrVal); free(yyvsp[0].StrVal); - ;} - break; - - case 125: -#line 1583 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y" - { + ; + break;} +case 131: +#line 1598 "/Users/bocchino/llvm/obj/../src/lib/AsmParser/llvmAsmParser.y" +{ CurModule.CurrentModule->addLibrary(yyvsp[0].StrVal); free(yyvsp[0].StrVal); - ;} - break; - - case 126: -#line 1587 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y" - { + ; + break;} +case 132: +#line 1602 "/Users/bocchino/llvm/obj/../src/lib/AsmParser/llvmAsmParser.y" +{ CurModule.CurrentModule->addLibrary(yyvsp[0].StrVal); free(yyvsp[0].StrVal); - ;} - break; - - case 127: -#line 1591 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y" - { - ;} - break; - - case 131: -#line 1600 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y" - { yyval.StrVal = 0; ;} - break; - - case 132: -#line 1602 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y" - { + ; + break;} +case 133: +#line 1606 "/Users/bocchino/llvm/obj/../src/lib/AsmParser/llvmAsmParser.y" +{ + ; + break;} +case 137: +#line 1615 "/Users/bocchino/llvm/obj/../src/lib/AsmParser/llvmAsmParser.y" +{ yyval.StrVal = 0; ; + break;} +case 138: +#line 1617 "/Users/bocchino/llvm/obj/../src/lib/AsmParser/llvmAsmParser.y" +{ if (*yyvsp[-1].TypeVal == Type::VoidTy) ThrowException("void typed arguments are invalid!"); yyval.ArgVal = new std::pair(yyvsp[-1].TypeVal, yyvsp[0].StrVal); -;} - break; - - case 133: -#line 1608 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y" - { +; + break;} +case 139: +#line 1623 "/Users/bocchino/llvm/obj/../src/lib/AsmParser/llvmAsmParser.y" +{ yyval.ArgList = yyvsp[-2].ArgList; yyvsp[-2].ArgList->push_back(*yyvsp[0].ArgVal); delete yyvsp[0].ArgVal; - ;} - break; - - case 134: -#line 1613 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y" - { + ; + break;} +case 140: +#line 1628 "/Users/bocchino/llvm/obj/../src/lib/AsmParser/llvmAsmParser.y" +{ yyval.ArgList = new std::vector >(); yyval.ArgList->push_back(*yyvsp[0].ArgVal); delete yyvsp[0].ArgVal; - ;} - break; - - case 135: -#line 1619 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y" - { + ; + break;} +case 141: +#line 1634 "/Users/bocchino/llvm/obj/../src/lib/AsmParser/llvmAsmParser.y" +{ yyval.ArgList = yyvsp[0].ArgList; - ;} - break; - - case 136: -#line 1622 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y" - { + ; + break;} +case 142: +#line 1637 "/Users/bocchino/llvm/obj/../src/lib/AsmParser/llvmAsmParser.y" +{ yyval.ArgList = yyvsp[-2].ArgList; yyval.ArgList->push_back(std::pair(new PATypeHolder(Type::VoidTy), 0)); - ;} - break; - - case 137: -#line 1627 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y" - { + ; + break;} +case 143: +#line 1642 "/Users/bocchino/llvm/obj/../src/lib/AsmParser/llvmAsmParser.y" +{ yyval.ArgList = new std::vector >(); yyval.ArgList->push_back(std::make_pair(new PATypeHolder(Type::VoidTy), (char*)0)); - ;} - break; - - case 138: -#line 1631 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y" - { + ; + break;} +case 144: +#line 1646 "/Users/bocchino/llvm/obj/../src/lib/AsmParser/llvmAsmParser.y" +{ yyval.ArgList = 0; - ;} - break; - - case 139: -#line 1635 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y" - { + ; + break;} +case 145: +#line 1650 "/Users/bocchino/llvm/obj/../src/lib/AsmParser/llvmAsmParser.y" +{ UnEscapeLexed(yyvsp[-3].StrVal); std::string FunctionName(yyvsp[-3].StrVal); free(yyvsp[-3].StrVal); // Free strdup'd memory! @@ -3570,99 +3143,87 @@ delete yyvsp[-1].ArgList; // We're now done with the argument list } -;} - break; - - case 142: -#line 1717 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y" - { +; + break;} +case 148: +#line 1732 "/Users/bocchino/llvm/obj/../src/lib/AsmParser/llvmAsmParser.y" +{ yyval.FunctionVal = CurFun.CurrentFunction; // Make sure that we keep track of the linkage type even if there was a // previous "declare". yyval.FunctionVal->setLinkage(yyvsp[-2].Linkage); -;} - break; - - case 145: -#line 1727 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y" - { +; + break;} +case 151: +#line 1742 "/Users/bocchino/llvm/obj/../src/lib/AsmParser/llvmAsmParser.y" +{ yyval.FunctionVal = yyvsp[-1].FunctionVal; -;} - break; - - case 146: -#line 1731 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y" - { CurFun.isDeclare = true; ;} - break; - - case 147: -#line 1731 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y" - { +; + break;} +case 152: +#line 1746 "/Users/bocchino/llvm/obj/../src/lib/AsmParser/llvmAsmParser.y" +{ CurFun.isDeclare = true; ; + break;} +case 153: +#line 1746 "/Users/bocchino/llvm/obj/../src/lib/AsmParser/llvmAsmParser.y" +{ yyval.FunctionVal = CurFun.CurrentFunction; CurFun.FunctionDone(); -;} - break; - - case 148: -#line 1740 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y" - { // A reference to a direct constant +; + break;} +case 154: +#line 1755 "/Users/bocchino/llvm/obj/../src/lib/AsmParser/llvmAsmParser.y" +{ // A reference to a direct constant yyval.ValIDVal = ValID::create(yyvsp[0].SInt64Val); - ;} - break; - - case 149: -#line 1743 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y" - { + ; + break;} +case 155: +#line 1758 "/Users/bocchino/llvm/obj/../src/lib/AsmParser/llvmAsmParser.y" +{ yyval.ValIDVal = ValID::create(yyvsp[0].UInt64Val); - ;} - break; - - case 150: -#line 1746 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y" - { // Perhaps it's an FP constant? + ; + break;} +case 156: +#line 1761 "/Users/bocchino/llvm/obj/../src/lib/AsmParser/llvmAsmParser.y" +{ // Perhaps it's an FP constant? yyval.ValIDVal = ValID::create(yyvsp[0].FPVal); - ;} - break; - - case 151: -#line 1749 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y" - { + ; + break;} +case 157: +#line 1764 "/Users/bocchino/llvm/obj/../src/lib/AsmParser/llvmAsmParser.y" +{ yyval.ValIDVal = ValID::create(ConstantBool::True); - ;} - break; - - case 152: -#line 1752 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y" - { + ; + break;} +case 158: +#line 1767 "/Users/bocchino/llvm/obj/../src/lib/AsmParser/llvmAsmParser.y" +{ yyval.ValIDVal = ValID::create(ConstantBool::False); - ;} - break; - - case 153: -#line 1755 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y" - { + ; + break;} +case 159: +#line 1770 "/Users/bocchino/llvm/obj/../src/lib/AsmParser/llvmAsmParser.y" +{ yyval.ValIDVal = ValID::createNull(); - ;} - break; - - case 154: -#line 1758 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y" - { + ; + break;} +case 160: +#line 1773 "/Users/bocchino/llvm/obj/../src/lib/AsmParser/llvmAsmParser.y" +{ yyval.ValIDVal = ValID::createUndef(); - ;} - break; - - case 155: -#line 1761 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y" - { // Nonempty unsized packed vector + ; + break;} +case 161: +#line 1776 "/Users/bocchino/llvm/obj/../src/lib/AsmParser/llvmAsmParser.y" +{ // Nonempty unsized vector const Type *ETy = (*yyvsp[-1].ConstVector)[0]->getType(); int NumElements = yyvsp[-1].ConstVector->size(); - PackedType* pt = PackedType::get(ETy, NumElements); + FixedVectorType* pt = FixedVectorType::get(ETy, NumElements); PATypeHolder* PTy = new PATypeHolder( HandleUpRefs( - PackedType::get( + FixedVectorType::get( ETy, NumElements) ) @@ -3676,76 +3237,67 @@ (*yyvsp[-1].ConstVector)[i]->getType()->getDescription() + "'."); } - yyval.ValIDVal = ValID::create(ConstantPacked::get(pt, *yyvsp[-1].ConstVector)); + yyval.ValIDVal = ValID::create(ConstantVector::get(pt, *yyvsp[-1].ConstVector)); delete PTy; delete yyvsp[-1].ConstVector; - ;} - break; - - case 156: -#line 1785 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y" - { + ; + break;} +case 162: +#line 1800 "/Users/bocchino/llvm/obj/../src/lib/AsmParser/llvmAsmParser.y" +{ yyval.ValIDVal = ValID::create(yyvsp[0].ConstVal); - ;} - break; - - case 157: -#line 1792 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y" - { // Is it an integer reference...? + ; + break;} +case 163: +#line 1807 "/Users/bocchino/llvm/obj/../src/lib/AsmParser/llvmAsmParser.y" +{ // Is it an integer reference...? yyval.ValIDVal = ValID::create(yyvsp[0].SIntVal); - ;} - break; - - case 158: -#line 1795 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y" - { // Is it a named reference...? + ; + break;} +case 164: +#line 1810 "/Users/bocchino/llvm/obj/../src/lib/AsmParser/llvmAsmParser.y" +{ // Is it a named reference...? yyval.ValIDVal = ValID::create(yyvsp[0].StrVal); - ;} - break; - - case 161: -#line 1806 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y" - { + ; + break;} +case 167: +#line 1821 "/Users/bocchino/llvm/obj/../src/lib/AsmParser/llvmAsmParser.y" +{ yyval.ValueVal = getVal(*yyvsp[-1].TypeVal, yyvsp[0].ValIDVal); delete yyvsp[-1].TypeVal; - ;} - break; - - case 162: -#line 1810 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y" - { + ; + break;} +case 168: +#line 1825 "/Users/bocchino/llvm/obj/../src/lib/AsmParser/llvmAsmParser.y" +{ yyval.FunctionVal = yyvsp[-1].FunctionVal; - ;} - break; - - case 163: -#line 1813 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y" - { // Do not allow functions with 0 basic blocks + ; + break;} +case 169: +#line 1828 "/Users/bocchino/llvm/obj/../src/lib/AsmParser/llvmAsmParser.y" +{ // Do not allow functions with 0 basic blocks yyval.FunctionVal = yyvsp[-1].FunctionVal; - ;} - break; - - case 164: -#line 1821 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y" - { + ; + break;} +case 170: +#line 1836 "/Users/bocchino/llvm/obj/../src/lib/AsmParser/llvmAsmParser.y" +{ setValueName(yyvsp[0].TermInstVal, yyvsp[-1].StrVal); InsertValue(yyvsp[0].TermInstVal); yyvsp[-2].BasicBlockVal->getInstList().push_back(yyvsp[0].TermInstVal); InsertValue(yyvsp[-2].BasicBlockVal); yyval.BasicBlockVal = yyvsp[-2].BasicBlockVal; - ;} - break; - - case 165: -#line 1830 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y" - { + ; + break;} +case 171: +#line 1845 "/Users/bocchino/llvm/obj/../src/lib/AsmParser/llvmAsmParser.y" +{ yyvsp[-1].BasicBlockVal->getInstList().push_back(yyvsp[0].InstVal); yyval.BasicBlockVal = yyvsp[-1].BasicBlockVal; - ;} - break; - - case 166: -#line 1834 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y" - { + ; + break;} +case 172: +#line 1849 "/Users/bocchino/llvm/obj/../src/lib/AsmParser/llvmAsmParser.y" +{ yyval.BasicBlockVal = CurBB = getBBVal(ValID::create((int)CurFun.NextBBNum++), true); // Make sure to move the basic block to the correct location in the @@ -3754,12 +3306,11 @@ Function::BasicBlockListType &BBL = CurFun.CurrentFunction->getBasicBlockList(); BBL.splice(BBL.end(), BBL, yyval.BasicBlockVal); - ;} - break; - - case 167: -#line 1844 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y" - { + ; + break;} +case 173: +#line 1859 "/Users/bocchino/llvm/obj/../src/lib/AsmParser/llvmAsmParser.y" +{ yyval.BasicBlockVal = CurBB = getBBVal(ValID::create(yyvsp[0].StrVal), true); // Make sure to move the basic block to the correct location in the @@ -3768,40 +3319,35 @@ Function::BasicBlockListType &BBL = CurFun.CurrentFunction->getBasicBlockList(); BBL.splice(BBL.end(), BBL, yyval.BasicBlockVal); - ;} - break; - - case 168: -#line 1855 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y" - { // Return with a result... + ; + break;} +case 174: +#line 1870 "/Users/bocchino/llvm/obj/../src/lib/AsmParser/llvmAsmParser.y" +{ // Return with a result... yyval.TermInstVal = new ReturnInst(yyvsp[0].ValueVal); - ;} - break; - - case 169: -#line 1858 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y" - { // Return with no result... + ; + break;} +case 175: +#line 1873 "/Users/bocchino/llvm/obj/../src/lib/AsmParser/llvmAsmParser.y" +{ // Return with no result... yyval.TermInstVal = new ReturnInst(); - ;} - break; - - case 170: -#line 1861 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y" - { // Unconditional Branch... + ; + break;} +case 176: +#line 1876 "/Users/bocchino/llvm/obj/../src/lib/AsmParser/llvmAsmParser.y" +{ // Unconditional Branch... yyval.TermInstVal = new BranchInst(getBBVal(yyvsp[0].ValIDVal)); - ;} - break; - - case 171: -#line 1864 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y" - { + ; + break;} +case 177: +#line 1879 "/Users/bocchino/llvm/obj/../src/lib/AsmParser/llvmAsmParser.y" +{ yyval.TermInstVal = new BranchInst(getBBVal(yyvsp[-3].ValIDVal), getBBVal(yyvsp[0].ValIDVal), getVal(Type::BoolTy, yyvsp[-6].ValIDVal)); - ;} - break; - - case 172: -#line 1867 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y" - { + ; + break;} +case 178: +#line 1882 "/Users/bocchino/llvm/obj/../src/lib/AsmParser/llvmAsmParser.y" +{ SwitchInst *S = new SwitchInst(getVal(yyvsp[-7].PrimType, yyvsp[-6].ValIDVal), getBBVal(yyvsp[-3].ValIDVal), yyvsp[-1].JumpTable->size()); yyval.TermInstVal = S; @@ -3814,20 +3360,18 @@ ThrowException("Switch case is constant, but not a simple integer!"); } delete yyvsp[-1].JumpTable; - ;} - break; - - case 173: -#line 1881 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y" - { + ; + break;} +case 179: +#line 1896 "/Users/bocchino/llvm/obj/../src/lib/AsmParser/llvmAsmParser.y" +{ SwitchInst *S = new SwitchInst(getVal(yyvsp[-6].PrimType, yyvsp[-5].ValIDVal), getBBVal(yyvsp[-2].ValIDVal), 0); yyval.TermInstVal = S; - ;} - break; - - case 174: -#line 1886 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y" - { + ; + break;} +case 180: +#line 1901 "/Users/bocchino/llvm/obj/../src/lib/AsmParser/llvmAsmParser.y" +{ const PointerType *PFTy; const FunctionType *Ty; @@ -3878,38 +3422,34 @@ delete yyvsp[-10].TypeVal; delete yyvsp[-7].ValueList; - ;} - break; - - case 175: -#line 1938 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y" - { + ; + break;} +case 181: +#line 1953 "/Users/bocchino/llvm/obj/../src/lib/AsmParser/llvmAsmParser.y" +{ yyval.TermInstVal = new UnwindInst(); - ;} - break; - - case 176: -#line 1941 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y" - { + ; + break;} +case 182: +#line 1956 "/Users/bocchino/llvm/obj/../src/lib/AsmParser/llvmAsmParser.y" +{ yyval.TermInstVal = new UnreachableInst(); - ;} - break; - - case 177: -#line 1947 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y" - { + ; + break;} +case 183: +#line 1962 "/Users/bocchino/llvm/obj/../src/lib/AsmParser/llvmAsmParser.y" +{ yyval.JumpTable = yyvsp[-5].JumpTable; Constant *V = cast(getValNonImprovising(yyvsp[-4].PrimType, yyvsp[-3].ValIDVal)); if (V == 0) ThrowException("May only switch on a constant pool value!"); yyval.JumpTable->push_back(std::make_pair(V, getBBVal(yyvsp[0].ValIDVal))); - ;} - break; - - case 178: -#line 1955 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y" - { + ; + break;} +case 184: +#line 1970 "/Users/bocchino/llvm/obj/../src/lib/AsmParser/llvmAsmParser.y" +{ yyval.JumpTable = new std::vector >(); Constant *V = cast(getValNonImprovising(yyvsp[-4].PrimType, yyvsp[-3].ValIDVal)); @@ -3917,117 +3457,112 @@ ThrowException("May only switch on a constant pool value!"); yyval.JumpTable->push_back(std::make_pair(V, getBBVal(yyvsp[0].ValIDVal))); - ;} - break; - - case 179: -#line 1965 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y" - { + ; + break;} +case 185: +#line 1980 "/Users/bocchino/llvm/obj/../src/lib/AsmParser/llvmAsmParser.y" +{ // Is this definition named?? if so, assign the name... setValueName(yyvsp[0].InstVal, yyvsp[-1].StrVal); InsertValue(yyvsp[0].InstVal); yyval.InstVal = yyvsp[0].InstVal; -;} - break; - - case 180: -#line 1972 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y" - { // Used for PHI nodes +; + break;} +case 186: +#line 1987 "/Users/bocchino/llvm/obj/../src/lib/AsmParser/llvmAsmParser.y" +{ // Used for PHI nodes yyval.PHIList = new std::list >(); yyval.PHIList->push_back(std::make_pair(getVal(*yyvsp[-5].TypeVal, yyvsp[-3].ValIDVal), getBBVal(yyvsp[-1].ValIDVal))); delete yyvsp[-5].TypeVal; - ;} - break; - - case 181: -#line 1977 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y" - { + ; + break;} +case 187: +#line 1992 "/Users/bocchino/llvm/obj/../src/lib/AsmParser/llvmAsmParser.y" +{ yyval.PHIList = yyvsp[-6].PHIList; yyvsp[-6].PHIList->push_back(std::make_pair(getVal(yyvsp[-6].PHIList->front().first->getType(), yyvsp[-3].ValIDVal), getBBVal(yyvsp[-1].ValIDVal))); - ;} - break; - - case 182: -#line 1984 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y" - { // Used for call statements, and memory insts... + ; + break;} +case 188: +#line 1998 "/Users/bocchino/llvm/obj/../src/lib/AsmParser/llvmAsmParser.y" +{ // Used for call statements, and memory insts... yyval.ValueList = new std::vector(); yyval.ValueList->push_back(yyvsp[0].ValueVal); - ;} - break; - - case 183: -#line 1988 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y" - { + ; + break;} +case 189: +#line 2002 "/Users/bocchino/llvm/obj/../src/lib/AsmParser/llvmAsmParser.y" +{ yyval.ValueList = yyvsp[-2].ValueList; yyvsp[-2].ValueList->push_back(yyvsp[0].ValueVal); - ;} - break; - - case 185: -#line 1994 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y" - { yyval.ValueList = 0; ;} - break; - - case 186: -#line 1996 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y" - { + ; + break;} +case 191: +#line 2008 "/Users/bocchino/llvm/obj/../src/lib/AsmParser/llvmAsmParser.y" +{ yyval.ValueList = 0; ; + break;} +case 192: +#line 2010 "/Users/bocchino/llvm/obj/../src/lib/AsmParser/llvmAsmParser.y" +{ yyval.BoolVal = true; - ;} - break; - - case 187: -#line 1999 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y" - { + ; + break;} +case 193: +#line 2013 "/Users/bocchino/llvm/obj/../src/lib/AsmParser/llvmAsmParser.y" +{ yyval.BoolVal = false; - ;} - break; - - case 188: -#line 2005 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y" - { + ; + break;} +case 194: +#line 2019 "/Users/bocchino/llvm/obj/../src/lib/AsmParser/llvmAsmParser.y" +{ if (!(*yyvsp[-3].TypeVal)->isInteger() && !(*yyvsp[-3].TypeVal)->isFloatingPoint() && - !isa((*yyvsp[-3].TypeVal).get())) + !isa((*yyvsp[-3].TypeVal).get())) + ThrowException("Arithmetic operator requires integer, FP, or vector operands!"); + if(isa((*yyvsp[-3].TypeVal).get()) && yyvsp[-4].BinaryOpVal == Instruction::Rem) { ThrowException( - "Arithmetic operator requires integer, FP, or packed operands!"); - if (isa((*yyvsp[-3].TypeVal).get()) && yyvsp[-4].BinaryOpVal == Instruction::Rem) - ThrowException("Rem not supported on packed types!"); + "Rem not supported on fixed vector types!"); // FIXME: Why not?! + } yyval.InstVal = BinaryOperator::create(yyvsp[-4].BinaryOpVal, getVal(*yyvsp[-3].TypeVal, yyvsp[-2].ValIDVal), getVal(*yyvsp[-3].TypeVal, yyvsp[0].ValIDVal)); if (yyval.InstVal == 0) ThrowException("binary operator returned null!"); delete yyvsp[-3].TypeVal; - ;} - break; - - case 189: -#line 2017 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y" - { - if (!(*yyvsp[-3].TypeVal)->isIntegral()) + ; + break;} +case 195: +#line 2032 "/Users/bocchino/llvm/obj/../src/lib/AsmParser/llvmAsmParser.y" +{ + if (!(*yyvsp[-3].TypeVal)->isIntegral() && + !(*yyvsp[-3].TypeVal)->isIntegralVector()) ThrowException("Logical operator requires integral operands!"); yyval.InstVal = BinaryOperator::create(yyvsp[-4].BinaryOpVal, getVal(*yyvsp[-3].TypeVal, yyvsp[-2].ValIDVal), getVal(*yyvsp[-3].TypeVal, yyvsp[0].ValIDVal)); if (yyval.InstVal == 0) ThrowException("binary operator returned null!"); delete yyvsp[-3].TypeVal; - ;} - break; - - case 190: -#line 2025 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y" - { - if(isa((*yyvsp[-3].TypeVal).get())) { - ThrowException( - "PackedTypes currently not supported in setcc instructions!"); - } + ; + break;} +case 196: +#line 2041 "/Users/bocchino/llvm/obj/../src/lib/AsmParser/llvmAsmParser.y" +{ yyval.InstVal = new SetCondInst(yyvsp[-4].BinaryOpVal, getVal(*yyvsp[-3].TypeVal, yyvsp[-2].ValIDVal), getVal(*yyvsp[-3].TypeVal, yyvsp[0].ValIDVal)); if (yyval.InstVal == 0) ThrowException("binary operator returned null!"); delete yyvsp[-3].TypeVal; - ;} - break; - - case 191: -#line 2035 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y" - { + ; + break;} +case 197: +#line 2047 "/Users/bocchino/llvm/obj/../src/lib/AsmParser/llvmAsmParser.y" +{ + yyval.InstVal = new SetCondInst(yyvsp[-4].BinaryOpVal, getVal(*yyvsp[-3].TypeVal, yyvsp[-2].ValIDVal), getVal(*yyvsp[-3].TypeVal, yyvsp[0].ValIDVal)); + if (yyval.InstVal == 0) + ThrowException("binary operator returned null!"); + delete yyvsp[-3].TypeVal; + ; + break;} +case 198: +#line 2053 "/Users/bocchino/llvm/obj/../src/lib/AsmParser/llvmAsmParser.y" +{ std::cerr << "WARNING: Use of eliminated 'not' instruction:" << " Replacing with 'xor'.\n"; @@ -4038,54 +3573,62 @@ yyval.InstVal = BinaryOperator::create(Instruction::Xor, yyvsp[0].ValueVal, Ones); if (yyval.InstVal == 0) ThrowException("Could not create a xor instruction!"); - ;} - break; - - case 192: -#line 2047 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y" - { + ; + break;} +case 199: +#line 2065 "/Users/bocchino/llvm/obj/../src/lib/AsmParser/llvmAsmParser.y" +{ if (yyvsp[0].ValueVal->getType() != Type::UByteTy) ThrowException("Shift amount must be ubyte!"); - if (!yyvsp[-2].ValueVal->getType()->isInteger()) - ThrowException("Shift constant expression requires integer operand!"); + if (!yyvsp[-2].ValueVal->getType()->isInteger() && + !yyvsp[-2].ValueVal->getType()->isIntegerVector()) + ThrowException("Shift requires integer operand!"); yyval.InstVal = new ShiftInst(yyvsp[-3].OtherOpVal, yyvsp[-2].ValueVal, yyvsp[0].ValueVal); - ;} - break; - - case 193: -#line 2054 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y" - { + ; + break;} +case 200: +#line 2073 "/Users/bocchino/llvm/obj/../src/lib/AsmParser/llvmAsmParser.y" +{ if (!yyvsp[0].TypeVal->get()->isFirstClassType()) ThrowException("cast instruction to a non-primitive type: '" + yyvsp[0].TypeVal->get()->getDescription() + "'!"); yyval.InstVal = new CastInst(yyvsp[-2].ValueVal, *yyvsp[0].TypeVal); delete yyvsp[0].TypeVal; - ;} - break; - - case 194: -#line 2061 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y" - { + ; + break;} +case 201: +#line 2080 "/Users/bocchino/llvm/obj/../src/lib/AsmParser/llvmAsmParser.y" +{ if (yyvsp[-4].ValueVal->getType() != Type::BoolTy) ThrowException("select condition must be boolean!"); if (yyvsp[-2].ValueVal->getType() != yyvsp[0].ValueVal->getType()) ThrowException("select value types should match!"); yyval.InstVal = new SelectInst(yyvsp[-4].ValueVal, yyvsp[-2].ValueVal, yyvsp[0].ValueVal); - ;} - break; - - case 195: -#line 2068 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y" - { + ; + break;} +case 202: +#line 2087 "/Users/bocchino/llvm/obj/../src/lib/AsmParser/llvmAsmParser.y" +{ + if (!yyvsp[-4].ValueVal->getType()->isBooleanVector()) + ThrowException("vselect condition must be boolean vector!"); + if (yyvsp[-2].ValueVal->getType() != yyvsp[0].ValueVal->getType()) + ThrowException("vselect value types should match!"); + if (!isa(yyvsp[-2].ValueVal->getType())) + ThrowException("vselect value must be a vector!"); + yyval.InstVal = new VSelectInst(yyvsp[-4].ValueVal, yyvsp[-2].ValueVal, yyvsp[0].ValueVal); + ; + break;} +case 203: +#line 2096 "/Users/bocchino/llvm/obj/../src/lib/AsmParser/llvmAsmParser.y" +{ NewVarArgs = true; yyval.InstVal = new VAArgInst(yyvsp[-2].ValueVal, *yyvsp[0].TypeVal); delete yyvsp[0].TypeVal; - ;} - break; - - case 196: -#line 2073 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y" - { + ; + break;} +case 204: +#line 2101 "/Users/bocchino/llvm/obj/../src/lib/AsmParser/llvmAsmParser.y" +{ ObsoleteVarArgs = true; const Type* ArgTy = yyvsp[-2].ValueVal->getType(); Function* NF = CurModule.CurrentModule-> @@ -4103,12 +3646,11 @@ CurBB->getInstList().push_back(new StoreInst(bar, foo)); yyval.InstVal = new VAArgInst(foo, *yyvsp[0].TypeVal); delete yyvsp[0].TypeVal; - ;} - break; - - case 197: -#line 2092 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y" - { + ; + break;} +case 205: +#line 2120 "/Users/bocchino/llvm/obj/../src/lib/AsmParser/llvmAsmParser.y" +{ ObsoleteVarArgs = true; const Type* ArgTy = yyvsp[-2].ValueVal->getType(); Function* NF = CurModule.CurrentModule-> @@ -4129,12 +3671,11 @@ CurBB->getInstList().push_back(tmp); yyval.InstVal = new LoadInst(foo); delete yyvsp[0].TypeVal; - ;} - break; - - case 198: -#line 2114 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y" - { + ; + break;} +case 206: +#line 2142 "/Users/bocchino/llvm/obj/../src/lib/AsmParser/llvmAsmParser.y" +{ const Type *Ty = yyvsp[0].PHIList->front().first->getType(); if (!Ty->isFirstClassType()) ThrowException("PHI node operands must be of first class type!"); @@ -4147,12 +3688,11 @@ yyvsp[0].PHIList->pop_front(); } delete yyvsp[0].PHIList; // Free the list... - ;} - break; - - case 199: -#line 2128 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y" - { + ; + break;} +case 207: +#line 2156 "/Users/bocchino/llvm/obj/../src/lib/AsmParser/llvmAsmParser.y" +{ const PointerType *PFTy; const FunctionType *Ty; @@ -4208,89 +3748,90 @@ cast(yyval.InstVal)->setCallingConv(yyvsp[-5].UIntVal); delete yyvsp[-4].TypeVal; delete yyvsp[-1].ValueList; - ;} - break; - - case 200: -#line 2185 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y" - { + ; + break;} +case 208: +#line 2213 "/Users/bocchino/llvm/obj/../src/lib/AsmParser/llvmAsmParser.y" +{ yyval.InstVal = yyvsp[0].InstVal; - ;} - break; - - case 201: -#line 2191 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y" - { + ; + break;} +case 209: +#line 2219 "/Users/bocchino/llvm/obj/../src/lib/AsmParser/llvmAsmParser.y" +{ yyval.ValueList = yyvsp[0].ValueList; - ;} - break; - - case 202: -#line 2193 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y" - { + ; + break;} +case 210: +#line 2221 "/Users/bocchino/llvm/obj/../src/lib/AsmParser/llvmAsmParser.y" +{ yyval.ValueList = new std::vector(); - ;} - break; - - case 203: -#line 2197 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y" - { + ; + break;} +case 211: +#line 2225 "/Users/bocchino/llvm/obj/../src/lib/AsmParser/llvmAsmParser.y" +{ yyval.BoolVal = true; - ;} - break; - - case 204: -#line 2200 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y" - { + ; + break;} +case 212: +#line 2228 "/Users/bocchino/llvm/obj/../src/lib/AsmParser/llvmAsmParser.y" +{ yyval.BoolVal = false; - ;} - break; - - case 205: -#line 2206 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y" - { + ; + break;} +case 213: +#line 2232 "/Users/bocchino/llvm/obj/../src/lib/AsmParser/llvmAsmParser.y" +{ + yyval.BoolVal = true; + ; + break;} +case 214: +#line 2235 "/Users/bocchino/llvm/obj/../src/lib/AsmParser/llvmAsmParser.y" +{ + yyval.BoolVal = false; + ; + break;} +case 215: +#line 2240 "/Users/bocchino/llvm/obj/../src/lib/AsmParser/llvmAsmParser.y" +{ yyval.InstVal = new MallocInst(*yyvsp[0].TypeVal); delete yyvsp[0].TypeVal; - ;} - break; - - case 206: -#line 2210 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y" - { + ; + break;} +case 216: +#line 2244 "/Users/bocchino/llvm/obj/../src/lib/AsmParser/llvmAsmParser.y" +{ yyval.InstVal = new MallocInst(*yyvsp[-3].TypeVal, getVal(yyvsp[-1].PrimType, yyvsp[0].ValIDVal)); delete yyvsp[-3].TypeVal; - ;} - break; - - case 207: -#line 2214 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y" - { + ; + break;} +case 217: +#line 2248 "/Users/bocchino/llvm/obj/../src/lib/AsmParser/llvmAsmParser.y" +{ yyval.InstVal = new AllocaInst(*yyvsp[0].TypeVal); delete yyvsp[0].TypeVal; - ;} - break; - - case 208: -#line 2218 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y" - { + ; + break;} +case 218: +#line 2252 "/Users/bocchino/llvm/obj/../src/lib/AsmParser/llvmAsmParser.y" +{ yyval.InstVal = new AllocaInst(*yyvsp[-3].TypeVal, getVal(yyvsp[-1].PrimType, yyvsp[0].ValIDVal)); delete yyvsp[-3].TypeVal; - ;} - break; - - case 209: -#line 2222 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y" - { + ; + break;} +case 219: +#line 2256 "/Users/bocchino/llvm/obj/../src/lib/AsmParser/llvmAsmParser.y" +{ if (!isa(yyvsp[0].ValueVal->getType())) ThrowException("Trying to free nonpointer type " + yyvsp[0].ValueVal->getType()->getDescription() + "!"); yyval.InstVal = new FreeInst(yyvsp[0].ValueVal); - ;} - break; - - case 210: -#line 2229 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y" - { + ; + break;} +case 220: +#line 2263 "/Users/bocchino/llvm/obj/../src/lib/AsmParser/llvmAsmParser.y" +{ if (!isa(yyvsp[-1].TypeVal->get())) ThrowException("Can't load from nonpointer type: " + (*yyvsp[-1].TypeVal)->getDescription()); @@ -4299,12 +3840,11 @@ (*yyvsp[-1].TypeVal)->getDescription()); yyval.InstVal = new LoadInst(getVal(*yyvsp[-1].TypeVal, yyvsp[0].ValIDVal), "", yyvsp[-3].BoolVal); delete yyvsp[-1].TypeVal; - ;} - break; - - case 211: -#line 2239 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y" - { + ; + break;} +case 221: +#line 2274 "/Users/bocchino/llvm/obj/../src/lib/AsmParser/llvmAsmParser.y" +{ const PointerType *PT = dyn_cast(yyvsp[-1].TypeVal->get()); if (!PT) ThrowException("Can't store to a nonpointer type: " + @@ -4316,12 +3856,11 @@ yyval.InstVal = new StoreInst(yyvsp[-3].ValueVal, getVal(*yyvsp[-1].TypeVal, yyvsp[0].ValIDVal), yyvsp[-5].BoolVal); delete yyvsp[-1].TypeVal; - ;} - break; - - case 212: -#line 2252 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y" - { + ; + break;} +case 222: +#line 2288 "/Users/bocchino/llvm/obj/../src/lib/AsmParser/llvmAsmParser.y" +{ if (!isa(yyvsp[-2].TypeVal->get())) ThrowException("getelementptr insn requires pointer operand!"); @@ -4341,239 +3880,340 @@ (*yyvsp[-2].TypeVal)->getDescription()+ "'!"); yyval.InstVal = new GetElementPtrInst(getVal(*yyvsp[-2].TypeVal, yyvsp[-1].ValIDVal), *yyvsp[0].ValueList); delete yyvsp[-2].TypeVal; delete yyvsp[0].ValueList; - ;} - break; - - - } - -/* Line 1000 of yacc.c. */ -#line 4352 "llvmAsmParser.tab.c" + ; + break;} +case 223: +#line 2310 "/Users/bocchino/llvm/obj/../src/lib/AsmParser/llvmAsmParser.y" +{ + if (!isa(yyvsp[-2].TypeVal->get())) + ThrowException("Can't load vector from nonpointer type: " + + (*yyvsp[-2].TypeVal)->getDescription()); + if (!cast(yyvsp[-2].TypeVal->get())->getElementType()->isPrimitiveType()) + ThrowException("Can't create vector of non-primitive type: " + + (*yyvsp[-2].TypeVal)->getDescription()); + if (!VMemoryInst::checkNumIndices(*yyvsp[0].ValueList)) + ThrowException("vgather must have four indices for each array dimension!"); + if (!VMemoryInst::checkIndexType(*yyvsp[0].ValueList)) + ThrowException("vgather indices must be of type long!"); + yyval.InstVal = new VGatherInst(getVal(*yyvsp[-2].TypeVal, yyvsp[-1].ValIDVal), *yyvsp[0].ValueList); + delete yyvsp[-2].TypeVal; delete yyvsp[0].ValueList; + ; + break;} +case 224: +#line 2325 "/Users/bocchino/llvm/obj/../src/lib/AsmParser/llvmAsmParser.y" +{ + if (yyvsp[0].ValueVal->getType() != Type::UIntTy) + ThrowException("Length of vimm must be unsigned int!"); + yyval.InstVal = new VImmInst(yyvsp[-2].ValueVal, yyvsp[0].ValueVal, yyvsp[-4].BoolVal); + ; + break;} +case 225: +#line 2331 "/Users/bocchino/llvm/obj/../src/lib/AsmParser/llvmAsmParser.y" +{ + if (!isa(yyvsp[-6].ValueVal->getType())) + ThrowException("First operand of extract must be a vector!"); + if (yyvsp[-4].ValueVal->getType() != Type::UIntTy) + ThrowException("Second operand of extract must be a uint!"); + if (yyvsp[-2].ValueVal->getType() != Type::UIntTy) + ThrowException("Third operand of extract must be a uint!"); + if (yyvsp[0].ValueVal->getType() != Type::UIntTy) + ThrowException("Fourth operand of extract must be a uint!"); + yyval.InstVal = new ExtractInst(yyvsp[-6].ValueVal, yyvsp[-4].ValueVal, yyvsp[-2].ValueVal, yyvsp[0].ValueVal); + ; + break;} +case 226: +#line 2343 "/Users/bocchino/llvm/obj/../src/lib/AsmParser/llvmAsmParser.y" +{ + if (!isa(yyvsp[-2].ValueVal->getType())) + ThrowException("First operand of extractelement must be a vector!"); + if (yyvsp[0].ValueVal->getType() != Type::UIntTy) + ThrowException("Second operand of extractelement must be a uint!"); + yyval.InstVal = new ExtractElementInst(yyvsp[-2].ValueVal, yyvsp[0].ValueVal); + ; + break;} +case 227: +#line 2351 "/Users/bocchino/llvm/obj/../src/lib/AsmParser/llvmAsmParser.y" +{ + if (!isa(yyvsp[-6].ValueVal->getType())) + ThrowException("First operand of combine must be a vector!"); + if (!isa(yyvsp[-4].ValueVal->getType())) + ThrowException("Second operand of combine must be a vector!"); + if (yyvsp[-2].ValueVal->getType() != Type::UIntTy) + ThrowException("Third operand of combine must be a uint!"); + if (yyvsp[0].ValueVal->getType() != Type::UIntTy) + ThrowException("Fourth operand of combine must be a uint!"); + yyval.InstVal = new CombineInst(yyvsp[-6].ValueVal, yyvsp[-4].ValueVal, yyvsp[-2].ValueVal, yyvsp[0].ValueVal); + ; + break;} +case 228: +#line 2363 "/Users/bocchino/llvm/obj/../src/lib/AsmParser/llvmAsmParser.y" +{ + if (!isa(yyvsp[-4].ValueVal->getType())) + ThrowException("First operand of combineelement must be a vector!"); + if (yyvsp[-2].ValueVal->getType() != cast(yyvsp[-4].ValueVal->getType())->getElementType()) + ThrowException("Second operand of combineelement must be vector element type!"); + if (yyvsp[0].ValueVal->getType() != Type::UIntTy) + ThrowException("Third operand of combineelement must be a uint!"); + yyval.InstVal = new CombineElementInst(yyvsp[-4].ValueVal, yyvsp[-2].ValueVal, yyvsp[0].ValueVal); + ; + break;} +case 229: +#line 2373 "/Users/bocchino/llvm/obj/../src/lib/AsmParser/llvmAsmParser.y" +{ + if (!isa(yyvsp[-2].TypeVal->get())) + ThrowException("Can't store to a nonpointer type: " + + (*yyvsp[-2].TypeVal)->getDescription()); + if (!isa(yyvsp[-4].ValueVal->getType())) + ThrowException("Can't store nonvector type: " + + yyvsp[-4].ValueVal->getType()->getDescription()); + // FIXME: We may change this, but for now it makes things simpler + // to require variable vectors in vscatters. If you need to vscatter + // a fixed vector, you can always cast it to a variable vector + // first. + // + if (isa(yyvsp[-4].ValueVal->getType())) + ThrowException("Can't store fixed vector type: " + + yyvsp[-4].ValueVal->getType()->getDescription() + + " cast to variable vector first"); + const Type *ElTy = cast(yyvsp[-2].TypeVal->get())->getElementType(); + if (!ElTy->isPrimitiveType()) + ThrowException("Can't create vector of non-primitive type: " + + ElTy->getDescription()); + if (!VMemoryInst::checkNumIndices(*yyvsp[0].ValueList)) + ThrowException("vscatter must have four indices for each array dimension!"); + if (!VMemoryInst::checkIndexType(*yyvsp[0].ValueList)) + ThrowException("vscatter indices must be of type long!"); + const VectorType *VT = cast(yyvsp[-4].ValueVal->getType()); + if (VT->getElementType() != ElTy) + ThrowException("Can't store '" + yyvsp[-4].ValueVal->getType()->getDescription() + + "' into space of type '" + VT->getDescription() + "'!"); + yyval.InstVal = new VScatterInst(yyvsp[-4].ValueVal, getVal(*yyvsp[-2].TypeVal, yyvsp[-1].ValIDVal), *yyvsp[0].ValueList); + delete yyvsp[-2].TypeVal; delete yyvsp[0].ValueList; + ; + break;} +} + /* the action file gets copied in in place of this dollarsign */ +#line 543 "/usr/share/bison.simple" yyvsp -= yylen; yyssp -= yylen; +#ifdef YYLSP_NEEDED + yylsp -= yylen; +#endif - - YY_STACK_PRINT (yyss, yyssp); +#if YYDEBUG != 0 + if (yydebug) + { + short *ssp1 = yyss - 1; + fprintf (stderr, "state stack now"); + while (ssp1 != yyssp) + fprintf (stderr, " %d", *++ssp1); + fprintf (stderr, "\n"); + } +#endif *++yyvsp = yyval; +#ifdef YYLSP_NEEDED + yylsp++; + if (yylen == 0) + { + yylsp->first_line = yylloc.first_line; + yylsp->first_column = yylloc.first_column; + yylsp->last_line = (yylsp-1)->last_line; + yylsp->last_column = (yylsp-1)->last_column; + yylsp->text = 0; + } + else + { + yylsp->last_line = (yylsp+yylen-1)->last_line; + yylsp->last_column = (yylsp+yylen-1)->last_column; + } +#endif - /* Now `shift' the result of the reduction. Determine what state - that goes to, based on the state we popped back to and the rule - number reduced by. */ + /* Now "shift" the result of the reduction. + Determine what state that goes to, + based on the state we popped back to + and the rule number reduced by. */ yyn = yyr1[yyn]; - yystate = yypgoto[yyn - YYNTOKENS] + *yyssp; - if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp) + yystate = yypgoto[yyn - YYNTBASE] + *yyssp; + if (yystate >= 0 && yystate <= YYLAST && yycheck[yystate] == *yyssp) yystate = yytable[yystate]; else - yystate = yydefgoto[yyn - YYNTOKENS]; + yystate = yydefgoto[yyn - YYNTBASE]; goto yynewstate; +yyerrlab: /* here on detecting error */ -/*------------------------------------. -| yyerrlab -- here on detecting error | -`------------------------------------*/ -yyerrlab: - /* If not already recovering from an error, report this error. */ - if (!yyerrstatus) + if (! yyerrstatus) + /* If not already recovering from an error, report this error. */ { ++yynerrs; -#if YYERROR_VERBOSE + +#ifdef YYERROR_VERBOSE yyn = yypact[yystate]; - if (YYPACT_NINF < yyn && yyn < YYLAST) + if (yyn > YYFLAG && yyn < YYLAST) { - YYSIZE_T yysize = 0; - int yytype = YYTRANSLATE (yychar); - const char* yyprefix; - char *yymsg; - int yyx; - - /* Start YYX at -YYN if negative to avoid negative indexes in - YYCHECK. */ - int yyxbegin = yyn < 0 ? -yyn : 0; - - /* Stay within bounds of both yycheck and yytname. */ - int yychecklim = YYLAST - yyn; - int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS; - int yycount = 0; - - yyprefix = ", expecting "; - for (yyx = yyxbegin; yyx < yyxend; ++yyx) - if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR) - { - yysize += yystrlen (yyprefix) + yystrlen (yytname [yyx]); - yycount += 1; - if (yycount == 5) - { - yysize = 0; - break; - } - } - yysize += (sizeof ("syntax error, unexpected ") - + yystrlen (yytname[yytype])); - yymsg = (char *) YYSTACK_ALLOC (yysize); - if (yymsg != 0) + int size = 0; + char *msg; + int x, count; + + count = 0; + /* Start X at -yyn if nec to avoid negative indexes in yycheck. */ + for (x = (yyn < 0 ? -yyn : 0); + x < (sizeof(yytname) / sizeof(char *)); x++) + if (yycheck[x + yyn] == x) + size += strlen(yytname[x]) + 15, count++; + msg = (char *) malloc(size + 15); + if (msg != 0) { - char *yyp = yystpcpy (yymsg, "syntax error, unexpected "); - yyp = yystpcpy (yyp, yytname[yytype]); + strcpy(msg, "parse error"); - if (yycount < 5) + if (count < 5) { - yyprefix = ", expecting "; - for (yyx = yyxbegin; yyx < yyxend; ++yyx) - if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR) + count = 0; + for (x = (yyn < 0 ? -yyn : 0); + x < (sizeof(yytname) / sizeof(char *)); x++) + if (yycheck[x + yyn] == x) { - yyp = yystpcpy (yyp, yyprefix); - yyp = yystpcpy (yyp, yytname[yyx]); - yyprefix = " or "; + strcat(msg, count == 0 ? ", expecting `" : " or `"); + strcat(msg, yytname[x]); + strcat(msg, "'"); + count++; } } - yyerror (yymsg); - YYSTACK_FREE (yymsg); + yyerror(msg); + free(msg); } else - yyerror ("syntax error; also virtual memory exhausted"); + yyerror ("parse error; also virtual memory exceeded"); } else #endif /* YYERROR_VERBOSE */ - yyerror ("syntax error"); + yyerror("parse error"); } - + goto yyerrlab1; +yyerrlab1: /* here on error raised explicitly by an action */ if (yyerrstatus == 3) { - /* If just tried and failed to reuse lookahead token after an - error, discard it. */ + /* if just tried and failed to reuse lookahead token after an error, discard it. */ - if (yychar <= YYEOF) - { - /* If at end of input, pop the error token, - then the rest of the stack, then return failure. */ - if (yychar == YYEOF) - for (;;) - { - YYPOPSTACK; - if (yyssp == yyss) - YYABORT; - YYDSYMPRINTF ("Error: popping", yystos[*yyssp], yyvsp, yylsp); - yydestruct (yystos[*yyssp], yyvsp); - } - } - else - { - YYDSYMPRINTF ("Error: discarding", yytoken, &yylval, &yylloc); - yydestruct (yytoken, &yylval); - yychar = YYEMPTY; + /* return failure if at end of input */ + if (yychar == YYEOF) + YYABORT; - } +#if YYDEBUG != 0 + if (yydebug) + fprintf(stderr, "Discarding token %d (%s).\n", yychar, yytname[yychar1]); +#endif + + yychar = YYEMPTY; } - /* Else will try to reuse lookahead token after shifting the error - token. */ - goto yyerrlab1; + /* Else will try to reuse lookahead token + after shifting the error token. */ + yyerrstatus = 3; /* Each real token shifted decrements this */ -/*---------------------------------------------------. -| yyerrorlab -- error raised explicitly by YYERROR. | -`---------------------------------------------------*/ -yyerrorlab: + goto yyerrhandle; -#ifdef __GNUC__ - /* Pacify GCC when the user code never invokes YYERROR and the label - yyerrorlab therefore never appears in user code. */ - if (0) - goto yyerrorlab; -#endif +yyerrdefault: /* current state does not do anything special for the error token. */ - yyvsp -= yylen; - yyssp -= yylen; - yystate = *yyssp; - goto yyerrlab1; +#if 0 + /* This is wrong; only states that explicitly want error tokens + should shift them. */ + yyn = yydefact[yystate]; /* If its default is to accept any token, ok. Otherwise pop it.*/ + if (yyn) goto yydefault; +#endif +yyerrpop: /* pop the current state because it cannot handle the error token */ -/*-------------------------------------------------------------. -| yyerrlab1 -- common code for both syntax error and YYERROR. | -`-------------------------------------------------------------*/ -yyerrlab1: - yyerrstatus = 3; /* Each real token shifted decrements this. */ + if (yyssp == yyss) YYABORT; + yyvsp--; + yystate = *--yyssp; +#ifdef YYLSP_NEEDED + yylsp--; +#endif - for (;;) +#if YYDEBUG != 0 + if (yydebug) { - yyn = yypact[yystate]; - if (yyn != YYPACT_NINF) - { - yyn += YYTERROR; - if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR) - { - yyn = yytable[yyn]; - if (0 < yyn) - break; - } - } + short *ssp1 = yyss - 1; + fprintf (stderr, "Error: state stack now"); + while (ssp1 != yyssp) + fprintf (stderr, " %d", *++ssp1); + fprintf (stderr, "\n"); + } +#endif - /* Pop the current state because it cannot handle the error token. */ - if (yyssp == yyss) - YYABORT; +yyerrhandle: + + yyn = yypact[yystate]; + if (yyn == YYFLAG) + goto yyerrdefault; + + yyn += YYTERROR; + if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != YYTERROR) + goto yyerrdefault; - YYDSYMPRINTF ("Error: popping", yystos[*yyssp], yyvsp, yylsp); - yydestruct (yystos[yystate], yyvsp); - YYPOPSTACK; - yystate = *yyssp; - YY_STACK_PRINT (yyss, yyssp); + yyn = yytable[yyn]; + if (yyn < 0) + { + if (yyn == YYFLAG) + goto yyerrpop; + yyn = -yyn; + goto yyreduce; } + else if (yyn == 0) + goto yyerrpop; if (yyn == YYFINAL) YYACCEPT; - YYDPRINTF ((stderr, "Shifting error token, ")); +#if YYDEBUG != 0 + if (yydebug) + fprintf(stderr, "Shifting error token, "); +#endif *++yyvsp = yylval; - +#ifdef YYLSP_NEEDED + *++yylsp = yylloc; +#endif yystate = yyn; goto yynewstate; + yyacceptlab: + /* YYACCEPT comes here. */ + if (yyfree_stacks) + { + free (yyss); + free (yyvs); +#ifdef YYLSP_NEEDED + free (yyls); +#endif + } + return 0; -/*-------------------------------------. -| yyacceptlab -- YYACCEPT comes here. | -`-------------------------------------*/ -yyacceptlab: - yyresult = 0; - goto yyreturn; - -/*-----------------------------------. -| yyabortlab -- YYABORT comes here. | -`-----------------------------------*/ -yyabortlab: - yyresult = 1; - goto yyreturn; - -#ifndef yyoverflow -/*----------------------------------------------. -| yyoverflowlab -- parser overflow comes here. | -`----------------------------------------------*/ -yyoverflowlab: - yyerror ("parser stack overflow"); - yyresult = 2; - /* Fall through. */ -#endif - -yyreturn: -#ifndef yyoverflow - if (yyss != yyssa) - YYSTACK_FREE (yyss); + yyabortlab: + /* YYABORT comes here. */ + if (yyfree_stacks) + { + free (yyss); + free (yyvs); +#ifdef YYLSP_NEEDED + free (yyls); #endif - return yyresult; + } + return 1; } - - -#line 2275 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y" +#line 2406 "/Users/bocchino/llvm/obj/../src/lib/AsmParser/llvmAsmParser.y" int yyerror(const char *ErrorMsg) { std::string where @@ -4587,4 +4227,3 @@ ThrowException(errMsg); return 0; } - Index: llvm/lib/AsmParser/llvmAsmParser.h diff -u llvm/lib/AsmParser/llvmAsmParser.h:1.9 llvm/lib/AsmParser/llvmAsmParser.h:1.9.2.1 --- llvm/lib/AsmParser/llvmAsmParser.h:1.9 Sat Aug 27 13:50:38 2005 +++ llvm/lib/AsmParser/llvmAsmParser.h Tue Oct 18 14:21:56 2005 @@ -1,225 +1,4 @@ -/* A Bison parser, made by GNU Bison 1.875c. */ - -/* Skeleton parser for Yacc-like parsing with Bison, - Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003 Free Software Foundation, Inc. - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -/* As a special exception, when this file is copied by Bison into a - Bison output file, you may use that output file without restriction. - This special exception was added by the Free Software Foundation - in version 1.24 of Bison. */ - -/* Tokens. */ -#ifndef YYTOKENTYPE -# define YYTOKENTYPE - /* Put the tokens into the symbol table, so that GDB and other debuggers - know about them. */ - enum yytokentype { - ESINT64VAL = 258, - EUINT64VAL = 259, - SINTVAL = 260, - UINTVAL = 261, - FPVAL = 262, - VOID = 263, - BOOL = 264, - SBYTE = 265, - UBYTE = 266, - SHORT = 267, - USHORT = 268, - INT = 269, - UINT = 270, - LONG = 271, - ULONG = 272, - FLOAT = 273, - DOUBLE = 274, - TYPE = 275, - LABEL = 276, - VAR_ID = 277, - LABELSTR = 278, - STRINGCONSTANT = 279, - IMPLEMENTATION = 280, - ZEROINITIALIZER = 281, - TRUETOK = 282, - FALSETOK = 283, - BEGINTOK = 284, - ENDTOK = 285, - DECLARE = 286, - GLOBAL = 287, - CONSTANT = 288, - VOLATILE = 289, - TO = 290, - DOTDOTDOT = 291, - NULL_TOK = 292, - UNDEF = 293, - CONST = 294, - INTERNAL = 295, - LINKONCE = 296, - WEAK = 297, - APPENDING = 298, - OPAQUE = 299, - NOT = 300, - EXTERNAL = 301, - TARGET = 302, - TRIPLE = 303, - ENDIAN = 304, - POINTERSIZE = 305, - LITTLE = 306, - BIG = 307, - DEPLIBS = 308, - CALL = 309, - TAIL = 310, - CC_TOK = 311, - CCC_TOK = 312, - FASTCC_TOK = 313, - COLDCC_TOK = 314, - RET = 315, - BR = 316, - SWITCH = 317, - INVOKE = 318, - UNWIND = 319, - UNREACHABLE = 320, - ADD = 321, - SUB = 322, - MUL = 323, - DIV = 324, - REM = 325, - AND = 326, - OR = 327, - XOR = 328, - SETLE = 329, - SETGE = 330, - SETLT = 331, - SETGT = 332, - SETEQ = 333, - SETNE = 334, - MALLOC = 335, - ALLOCA = 336, - FREE = 337, - LOAD = 338, - STORE = 339, - GETELEMENTPTR = 340, - PHI_TOK = 341, - CAST = 342, - SELECT = 343, - SHL = 344, - SHR = 345, - VAARG = 346, - VAARG_old = 347, - VANEXT_old = 348 - }; -#endif -#define ESINT64VAL 258 -#define EUINT64VAL 259 -#define SINTVAL 260 -#define UINTVAL 261 -#define FPVAL 262 -#define VOID 263 -#define BOOL 264 -#define SBYTE 265 -#define UBYTE 266 -#define SHORT 267 -#define USHORT 268 -#define INT 269 -#define UINT 270 -#define LONG 271 -#define ULONG 272 -#define FLOAT 273 -#define DOUBLE 274 -#define TYPE 275 -#define LABEL 276 -#define VAR_ID 277 -#define LABELSTR 278 -#define STRINGCONSTANT 279 -#define IMPLEMENTATION 280 -#define ZEROINITIALIZER 281 -#define TRUETOK 282 -#define FALSETOK 283 -#define BEGINTOK 284 -#define ENDTOK 285 -#define DECLARE 286 -#define GLOBAL 287 -#define CONSTANT 288 -#define VOLATILE 289 -#define TO 290 -#define DOTDOTDOT 291 -#define NULL_TOK 292 -#define UNDEF 293 -#define CONST 294 -#define INTERNAL 295 -#define LINKONCE 296 -#define WEAK 297 -#define APPENDING 298 -#define OPAQUE 299 -#define NOT 300 -#define EXTERNAL 301 -#define TARGET 302 -#define TRIPLE 303 -#define ENDIAN 304 -#define POINTERSIZE 305 -#define LITTLE 306 -#define BIG 307 -#define DEPLIBS 308 -#define CALL 309 -#define TAIL 310 -#define CC_TOK 311 -#define CCC_TOK 312 -#define FASTCC_TOK 313 -#define COLDCC_TOK 314 -#define RET 315 -#define BR 316 -#define SWITCH 317 -#define INVOKE 318 -#define UNWIND 319 -#define UNREACHABLE 320 -#define ADD 321 -#define SUB 322 -#define MUL 323 -#define DIV 324 -#define REM 325 -#define AND 326 -#define OR 327 -#define XOR 328 -#define SETLE 329 -#define SETGE 330 -#define SETLT 331 -#define SETGT 332 -#define SETEQ 333 -#define SETNE 334 -#define MALLOC 335 -#define ALLOCA 336 -#define FREE 337 -#define LOAD 338 -#define STORE 339 -#define GETELEMENTPTR 340 -#define PHI_TOK 341 -#define CAST 342 -#define SELECT 343 -#define SHL 344 -#define SHR 345 -#define VAARG 346 -#define VAARG_old 347 -#define VANEXT_old 348 - - - - -#if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED) -#line 865 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y" -typedef union YYSTYPE { +typedef union { llvm::Module *ModuleVal; llvm::Function *FunctionVal; std::pair *ArgVal; @@ -258,14 +37,114 @@ llvm::Instruction::OtherOps OtherOpVal; llvm::Module::Endianness Endianness; } YYSTYPE; -/* Line 1275 of yacc.c. */ -#line 263 "llvmAsmParser.tab.h" -# define yystype YYSTYPE /* obsolescent; will be withdrawn */ -# define YYSTYPE_IS_DECLARED 1 -# define YYSTYPE_IS_TRIVIAL 1 -#endif - -extern YYSTYPE llvmAsmlval; - +#define ESINT64VAL 257 +#define EUINT64VAL 258 +#define SINTVAL 259 +#define UINTVAL 260 +#define FPVAL 261 +#define VOID 262 +#define BOOL 263 +#define SBYTE 264 +#define UBYTE 265 +#define SHORT 266 +#define USHORT 267 +#define INT 268 +#define UINT 269 +#define LONG 270 +#define ULONG 271 +#define FLOAT 272 +#define DOUBLE 273 +#define TYPE 274 +#define LABEL 275 +#define VAR_ID 276 +#define LABELSTR 277 +#define STRINGCONSTANT 278 +#define IMPLEMENTATION 279 +#define ZEROINITIALIZER 280 +#define TRUETOK 281 +#define FALSETOK 282 +#define BEGINTOK 283 +#define ENDTOK 284 +#define DECLARE 285 +#define GLOBAL 286 +#define CONSTANT 287 +#define VOLATILE 288 +#define FIXED 289 +#define TO 290 +#define DOTDOTDOT 291 +#define NULL_TOK 292 +#define UNDEF 293 +#define CONST 294 +#define INTERNAL 295 +#define LINKONCE 296 +#define WEAK 297 +#define APPENDING 298 +#define OPAQUE 299 +#define NOT 300 +#define EXTERNAL 301 +#define TARGET 302 +#define TRIPLE 303 +#define ENDIAN 304 +#define POINTERSIZE 305 +#define LITTLE 306 +#define BIG 307 +#define DEPLIBS 308 +#define CALL 309 +#define TAIL 310 +#define CC_TOK 311 +#define CCC_TOK 312 +#define FASTCC_TOK 313 +#define COLDCC_TOK 314 +#define VECTOR 315 +#define OF 316 +#define RET 317 +#define BR 318 +#define SWITCH 319 +#define INVOKE 320 +#define UNWIND 321 +#define UNREACHABLE 322 +#define ADD 323 +#define SUB 324 +#define MUL 325 +#define DIV 326 +#define REM 327 +#define AND 328 +#define OR 329 +#define XOR 330 +#define SETLE 331 +#define SETGE 332 +#define SETLT 333 +#define SETGT 334 +#define SETEQ 335 +#define SETNE 336 +#define VSETLE 337 +#define VSETGE 338 +#define VSETLT 339 +#define VSETGT 340 +#define VSETEQ 341 +#define VSETNE 342 +#define MALLOC 343 +#define ALLOCA 344 +#define FREE 345 +#define LOAD 346 +#define STORE 347 +#define GETELEMENTPTR 348 +#define PHI_TOK 349 +#define CAST 350 +#define SELECT 351 +#define VSELECT 352 +#define SHL 353 +#define SHR 354 +#define VAARG 355 +#define VGATHER 356 +#define VIMM 357 +#define VSCATTER 358 +#define EXTRACT 359 +#define EXTRACTELEMENT 360 +#define COMBINE 361 +#define COMBINEELEMENT 362 +#define VAARG_old 363 +#define VANEXT_old 364 +extern YYSTYPE llvmAsmlval; Index: llvm/lib/AsmParser/llvmAsmParser.y diff -u llvm/lib/AsmParser/llvmAsmParser.y:1.231 llvm/lib/AsmParser/llvmAsmParser.y:1.231.2.1 --- llvm/lib/AsmParser/llvmAsmParser.y:1.231 Fri Jun 24 13:00:40 2005 +++ llvm/lib/AsmParser/llvmAsmParser.y Tue Oct 18 14:21:56 2005 @@ -919,6 +919,7 @@ %type GlobalType // GLOBAL or CONSTANT? %type OptVolatile // 'volatile' or not %type OptTailCall // TAIL CALL or plain CALL. +%type OptFixed // fixed or not %type OptLinkage %type BigOrLittle @@ -950,30 +951,33 @@ %token IMPLEMENTATION ZEROINITIALIZER TRUETOK FALSETOK BEGINTOK ENDTOK -%token DECLARE GLOBAL CONSTANT VOLATILE +%token DECLARE GLOBAL CONSTANT VOLATILE FIXED %token TO DOTDOTDOT NULL_TOK UNDEF CONST INTERNAL LINKONCE WEAK APPENDING %token OPAQUE NOT EXTERNAL TARGET TRIPLE ENDIAN POINTERSIZE LITTLE BIG %token DEPLIBS CALL TAIL %token CC_TOK CCC_TOK FASTCC_TOK COLDCC_TOK +%token VECTOR OF %type OptCallingConv // Basic Block Terminating Operators %token RET BR SWITCH INVOKE UNWIND UNREACHABLE -// Binary Operators -%type ArithmeticOps LogicalOps SetCondOps // Binops Subcatagories +// Binary Operators +%type ArithmeticOps LogicalOps SetCondOps VSetCondOps // Binops Subcategories + %token ADD SUB MUL DIV REM AND OR XOR %token SETLE SETGE SETLT SETGT SETEQ SETNE // Binary Comarators +%token VSETLE VSETGE VSETLT VSETGT VSETEQ VSETNE // Memory Instructions %token MALLOC ALLOCA FREE LOAD STORE GETELEMENTPTR // Other Operators %type ShiftOps -%token PHI_TOK CAST SELECT SHL SHR VAARG +%token PHI_TOK CAST SELECT VSELECT SHL SHR VAARG +%token VGATHER VIMM VSCATTER EXTRACT EXTRACTELEMENT COMBINE COMBINEELEMENT %token VAARG_old VANEXT_old //OBSOLETE - %start Module %% @@ -1000,6 +1004,7 @@ ArithmeticOps: ADD | SUB | MUL | DIV | REM; LogicalOps : AND | OR | XOR; SetCondOps : SETLE | SETGE | SETLT | SETGT | SETEQ | SETNE; +VSetCondOps : VSETLE | VSETGE | VSETLT | VSETGT | VSETEQ | VSETNE; ShiftOps : SHL | SHR; @@ -1090,17 +1095,24 @@ $$ = new PATypeHolder(HandleUpRefs(ArrayType::get(*$4, (unsigned)$2))); delete $4; } - | '<' EUINT64VAL 'x' UpRTypes '>' { // Packed array type? - const llvm::Type* ElemTy = $4->get(); - if ((unsigned)$2 != $2) { + + | '[' VECTOR OF UpRTypes ']' { // Vector type? + $$ = new PATypeHolder(HandleUpRefs(VectorType::get(*$4))); + delete $4; + } + + | '[' VECTOR OF EUINT64VAL UpRTypes ']' { // FixedVector type? + const llvm::Type* ElemTy = $5->get(); + if ((unsigned)$4 != $4) { ThrowException("Unsigned result not equal to signed result"); } if(!ElemTy->isPrimitiveType()) { - ThrowException("Elemental type of a PackedType must be primitive"); + ThrowException("Element type of a FixedVectorType must be primitive"); } - $$ = new PATypeHolder(HandleUpRefs(PackedType::get(*$4, (unsigned)$2))); - delete $4; + $$ = new PATypeHolder(HandleUpRefs(FixedVectorType::get(*$5, (unsigned)$4))); + delete $5; } + | '{' TypeListI '}' { // Structure type? std::vector Elements; for (std::list::iterator I = $2->begin(), @@ -1214,16 +1226,16 @@ delete $1; } | Types '<' ConstVector '>' { // Nonempty unsized arr - const PackedType *PTy = dyn_cast($1->get()); + const FixedVectorType *PTy = dyn_cast($1->get()); if (PTy == 0) - ThrowException("Cannot make packed constant with type: '" + + ThrowException("Cannot make vector constant with type: '" + (*$1)->getDescription() + "'!"); const Type *ETy = PTy->getElementType(); int NumElements = PTy->getNumElements(); // Verify that we have the correct size... if (NumElements != -1 && NumElements != (int)$3->size()) - ThrowException("Type mismatch: constant sized packed initialized with " + + ThrowException("Type mismatch: constant sized vector initialized with " + utostr($3->size()) + " arguments, but has size of " + itostr(NumElements) + "!"); @@ -1235,7 +1247,7 @@ (*$3)[i]->getType()->getDescription() + "'."); } - $$ = ConstantPacked::get(PTy, *$3); + $$ = ConstantVector::get(PTy, *$3); delete $1; delete $3; } | Types '{' ConstVector '}' { @@ -1451,7 +1463,8 @@ | LogicalOps '(' ConstVal ',' ConstVal ')' { if ($3->getType() != $5->getType()) ThrowException("Logical operator types must match!"); - if (!$3->getType()->isIntegral()) + if (!$3->getType()->isIntegral() && + !$3->getType()->isIntegralVector()) ThrowException("Logical operands must have integral types!"); $$ = ConstantExpr::get($1, $3, $5); } @@ -1463,8 +1476,10 @@ | ShiftOps '(' ConstVal ',' ConstVal ')' { if ($5->getType() != Type::UByteTy) ThrowException("Shift count for shift constant must be unsigned byte!"); - if (!$3->getType()->isInteger()) + if (!$3->getType()->isInteger() && + !$3->getType()->isIntegerVector()) { ThrowException("Shift constant expression requires integer operand!"); + } $$ = ConstantExpr::get($1, $3, $5); }; @@ -1758,14 +1773,14 @@ | UNDEF { $$ = ValID::createUndef(); } - | '<' ConstVector '>' { // Nonempty unsized packed vector + | '<' ConstVector '>' { // Nonempty unsized vector const Type *ETy = (*$2)[0]->getType(); int NumElements = $2->size(); - PackedType* pt = PackedType::get(ETy, NumElements); + FixedVectorType* pt = FixedVectorType::get(ETy, NumElements); PATypeHolder* PTy = new PATypeHolder( HandleUpRefs( - PackedType::get( + FixedVectorType::get( ETy, NumElements) ) @@ -1779,7 +1794,7 @@ (*$2)[i]->getType()->getDescription() + "'."); } - $$ = ValID::create(ConstantPacked::get(pt, *$2)); + $$ = ValID::create(ConstantVector::get(pt, *$2)); delete PTy; delete $2; } | ConstExpr { @@ -1980,7 +1995,6 @@ getBBVal($6))); }; - ValueRefList : ResolvedVal { // Used for call statements, and memory insts... $$ = new std::vector(); $$->push_back($1); @@ -2004,18 +2018,20 @@ InstVal : ArithmeticOps Types ValueRef ',' ValueRef { if (!(*$2)->isInteger() && !(*$2)->isFloatingPoint() && - !isa((*$2).get())) + !isa((*$2).get())) + ThrowException("Arithmetic operator requires integer, FP, or vector operands!"); + if(isa((*$2).get()) && $1 == Instruction::Rem) { ThrowException( - "Arithmetic operator requires integer, FP, or packed operands!"); - if (isa((*$2).get()) && $1 == Instruction::Rem) - ThrowException("Rem not supported on packed types!"); + "Rem not supported on fixed vector types!"); // FIXME: Why not?! + } $$ = BinaryOperator::create($1, getVal(*$2, $3), getVal(*$2, $5)); if ($$ == 0) ThrowException("binary operator returned null!"); delete $2; } | LogicalOps Types ValueRef ',' ValueRef { - if (!(*$2)->isIntegral()) + if (!(*$2)->isIntegral() && + !(*$2)->isIntegralVector()) ThrowException("Logical operator requires integral operands!"); $$ = BinaryOperator::create($1, getVal(*$2, $3), getVal(*$2, $5)); if ($$ == 0) @@ -2023,10 +2039,12 @@ delete $2; } | SetCondOps Types ValueRef ',' ValueRef { - if(isa((*$2).get())) { - ThrowException( - "PackedTypes currently not supported in setcc instructions!"); - } + $$ = new SetCondInst($1, getVal(*$2, $3), getVal(*$2, $5)); + if ($$ == 0) + ThrowException("binary operator returned null!"); + delete $2; + } + | VSetCondOps Types ValueRef ',' ValueRef { $$ = new SetCondInst($1, getVal(*$2, $3), getVal(*$2, $5)); if ($$ == 0) ThrowException("binary operator returned null!"); @@ -2047,8 +2065,9 @@ | ShiftOps ResolvedVal ',' ResolvedVal { if ($4->getType() != Type::UByteTy) ThrowException("Shift amount must be ubyte!"); - if (!$2->getType()->isInteger()) - ThrowException("Shift constant expression requires integer operand!"); + if (!$2->getType()->isInteger() && + !$2->getType()->isIntegerVector()) + ThrowException("Shift requires integer operand!"); $$ = new ShiftInst($1, $2, $4); } | CAST ResolvedVal TO Types { @@ -2065,6 +2084,15 @@ ThrowException("select value types should match!"); $$ = new SelectInst($2, $4, $6); } + | VSELECT ResolvedVal ',' ResolvedVal ',' ResolvedVal { + if (!$2->getType()->isBooleanVector()) + ThrowException("vselect condition must be boolean vector!"); + if ($4->getType() != $6->getType()) + ThrowException("vselect value types should match!"); + if (!isa($4->getType())) + ThrowException("vselect value must be a vector!"); + $$ = new VSelectInst($2, $4, $6); + } | VAARG ResolvedVal ',' Types { NewVarArgs = true; $$ = new VAArgInst($2, *$4); @@ -2201,6 +2229,12 @@ $$ = false; }; +OptFixed : FIXED { + $$ = true; + } + | /* empty */ { + $$ = false; + }; MemoryInst : MALLOC Types { @@ -2236,6 +2270,7 @@ $$ = new LoadInst(getVal(*$3, $4), "", $1); delete $3; } + | OptVolatile STORE ResolvedVal ',' Types ValueRef { const PointerType *PT = dyn_cast($5->get()); if (!PT) @@ -2249,6 +2284,7 @@ $$ = new StoreInst($3, getVal(*$5, $6), $1); delete $5; } + | GETELEMENTPTR Types ValueRef IndexList { if (!isa($2->get())) ThrowException("getelementptr insn requires pointer operand!"); @@ -2269,6 +2305,101 @@ (*$2)->getDescription()+ "'!"); $$ = new GetElementPtrInst(getVal(*$2, $3), *$4); delete $2; delete $4; + } + + | VGATHER Types ValueRef IndexList { + if (!isa($2->get())) + ThrowException("Can't load vector from nonpointer type: " + + (*$2)->getDescription()); + if (!cast($2->get())->getElementType()->isPrimitiveType()) + ThrowException("Can't create vector of non-primitive type: " + + (*$2)->getDescription()); + if (!VMemoryInst::checkNumIndices(*$4)) + ThrowException("vgather must have four indices for each array dimension!"); + if (!VMemoryInst::checkIndexType(*$4)) + ThrowException("vgather indices must be of type long!"); + $$ = new VGatherInst(getVal(*$2, $3), *$4); + delete $2; delete $4; + } + + | OptFixed VIMM ResolvedVal ',' ResolvedVal { + if ($5->getType() != Type::UIntTy) + ThrowException("Length of vimm must be unsigned int!"); + $$ = new VImmInst($3, $5, $1); + } + + | EXTRACT ResolvedVal ',' ResolvedVal ',' ResolvedVal ',' ResolvedVal { + if (!isa($2->getType())) + ThrowException("First operand of extract must be a vector!"); + if ($4->getType() != Type::UIntTy) + ThrowException("Second operand of extract must be a uint!"); + if ($6->getType() != Type::UIntTy) + ThrowException("Third operand of extract must be a uint!"); + if ($8->getType() != Type::UIntTy) + ThrowException("Fourth operand of extract must be a uint!"); + $$ = new ExtractInst($2, $4, $6, $8); + } + + | EXTRACTELEMENT ResolvedVal ',' ResolvedVal { + if (!isa($2->getType())) + ThrowException("First operand of extractelement must be a vector!"); + if ($4->getType() != Type::UIntTy) + ThrowException("Second operand of extractelement must be a uint!"); + $$ = new ExtractElementInst($2, $4); + } + + | COMBINE ResolvedVal ',' ResolvedVal ',' ResolvedVal ',' ResolvedVal { + if (!isa($2->getType())) + ThrowException("First operand of combine must be a vector!"); + if (!isa($4->getType())) + ThrowException("Second operand of combine must be a vector!"); + if ($6->getType() != Type::UIntTy) + ThrowException("Third operand of combine must be a uint!"); + if ($8->getType() != Type::UIntTy) + ThrowException("Fourth operand of combine must be a uint!"); + $$ = new CombineInst($2, $4, $6, $8); + } + + | COMBINEELEMENT ResolvedVal ',' ResolvedVal ',' ResolvedVal { + if (!isa($2->getType())) + ThrowException("First operand of combineelement must be a vector!"); + if ($4->getType() != cast($2->getType())->getElementType()) + ThrowException("Second operand of combineelement must be vector element type!"); + if ($6->getType() != Type::UIntTy) + ThrowException("Third operand of combineelement must be a uint!"); + $$ = new CombineElementInst($2, $4, $6); + } + + | VSCATTER ResolvedVal ',' Types ValueRef IndexList { + if (!isa($4->get())) + ThrowException("Can't store to a nonpointer type: " + + (*$4)->getDescription()); + if (!isa($2->getType())) + ThrowException("Can't store nonvector type: " + + $2->getType()->getDescription()); + // FIXME: We may change this, but for now it makes things simpler + // to require variable vectors in vscatters. If you need to vscatter + // a fixed vector, you can always cast it to a variable vector + // first. + // + if (isa($2->getType())) + ThrowException("Can't store fixed vector type: " + + $2->getType()->getDescription() + + " cast to variable vector first"); + const Type *ElTy = cast($4->get())->getElementType(); + if (!ElTy->isPrimitiveType()) + ThrowException("Can't create vector of non-primitive type: " + + ElTy->getDescription()); + if (!VMemoryInst::checkNumIndices(*$6)) + ThrowException("vscatter must have four indices for each array dimension!"); + if (!VMemoryInst::checkIndexType(*$6)) + ThrowException("vscatter indices must be of type long!"); + const VectorType *VT = cast($2->getType()); + if (VT->getElementType() != ElTy) + ThrowException("Can't store '" + $2->getType()->getDescription() + + "' into space of type '" + VT->getDescription() + "'!"); + $$ = new VScatterInst($2, getVal(*$4, $5), *$6); + delete $4; delete $6; }; From bocchino at cs.uiuc.edu Tue Oct 18 14:31:03 2005 From: bocchino at cs.uiuc.edu (Robert Bocchino) Date: Tue, 18 Oct 2005 14:31:03 -0500 Subject: [llvm-commits] CVS: llvm/include/SIMD/ Message-ID: <200510181931.OAA06594@zion.cs.uiuc.edu> Changes in directory llvm/include/SIMD: --- Log message: Directory /home/vadve/shared/PublicCVS/llvm/include/SIMD added to the repository --> Using per-directory sticky tag `vector_llvm' --- Diffs of the changes: (+0 -0) 0 files changed From bocchino at cs.uiuc.edu Tue Oct 18 14:31:03 2005 From: bocchino at cs.uiuc.edu (Robert Bocchino) Date: Tue, 18 Oct 2005 14:31:03 -0500 Subject: [llvm-commits] CVS: llvm/include/VectorC/ Message-ID: <200510181931.OAA06598@zion.cs.uiuc.edu> Changes in directory llvm/include/VectorC: --- Log message: Directory /home/vadve/shared/PublicCVS/llvm/include/VectorC added to the repository --> Using per-directory sticky tag `vector_llvm' --- Diffs of the changes: (+0 -0) 0 files changed From bocchino at cs.uiuc.edu Tue Oct 18 14:31:10 2005 From: bocchino at cs.uiuc.edu (Robert Bocchino) Date: Tue, 18 Oct 2005 14:31:10 -0500 Subject: [llvm-commits] CVS: llvm/include/VectorLLVM/ Message-ID: <200510181931.OAA06602@zion.cs.uiuc.edu> Changes in directory llvm/include/VectorLLVM: --- Log message: Directory /home/vadve/shared/PublicCVS/llvm/include/VectorLLVM added to the repository --> Using per-directory sticky tag `vector_llvm' --- Diffs of the changes: (+0 -0) 0 files changed From bocchino at cs.uiuc.edu Tue Oct 18 14:32:52 2005 From: bocchino at cs.uiuc.edu (Robert Bocchino) Date: Tue, 18 Oct 2005 14:32:52 -0500 Subject: [llvm-commits] [vector_llvm] CVS: llvm/include/VectorC/Intrinsics.h Makefile VectorC.h makedecls.pl triplet.h Message-ID: <200510181932.OAA06630@zion.cs.uiuc.edu> Changes in directory llvm/include/VectorC: Intrinsics.h added (r1.1.2.1) Makefile added (r1.1.2.1) VectorC.h added (r1.1.2.1) makedecls.pl added (r1.1.2.1) triplet.h added (r1.1.2.1) --- Log message: Initial commit of Vector LLVM. --- Diffs of the changes: (+460 -0) Intrinsics.h | 24 ++++ Makefile | 2 VectorC.h | 347 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ makedecls.pl | 83 ++++++++++++++ triplet.h | 4 5 files changed, 460 insertions(+) Index: llvm/include/VectorC/Intrinsics.h diff -c /dev/null llvm/include/VectorC/Intrinsics.h:1.1.2.1 *** /dev/null Tue Oct 18 14:32:50 2005 --- llvm/include/VectorC/Intrinsics.h Tue Oct 18 14:32:40 2005 *************** *** 0 **** --- 1,24 ---- + // VectorC intrinsics + + #ifndef INTRINSICS_H + #define INTRINSICS_H + + short vectorc_adds_short(short, short); + short vllvm_adds_short(short,short); + + short vectorc_subs_short(short, short); + short vllvm_subs_short(short,short); + + unsigned char vectorc_saturate_short_unsigned_char(short); + unsigned char vllvm_saturate_short_uchar(short); + + #define vectorc_mr_short(x, y) ((((x)*(y))+vllvm_fixed_vimm_short(1<<14,8))>>15) + #define vllvm_mr_short(x, y) ((((x)*(y))+vllvm_fixed_vimm_short(1<<14,8))>>15) + #define vectorc_mradds_short(x,y,z) vectorc_adds_short(vectorc_mr_short(x,y),z) + #define vllvm_mradds_short(x,y,z) vllvm_adds_short(vllvm_mr_short(x,y),z) + + short vllvm_max_short(short, short); + unsigned short vllvm_subs_ushort(unsigned short, unsigned short); + short vllvm_min_short(short, short); + + #endif Index: llvm/include/VectorC/Makefile diff -c /dev/null llvm/include/VectorC/Makefile:1.1.2.1 *** /dev/null Tue Oct 18 14:32:51 2005 --- llvm/include/VectorC/Makefile Tue Oct 18 14:32:40 2005 *************** *** 0 **** --- 1,2 ---- + VectorC.h : makedecls.pl + perl $< > $@ \ No newline at end of file Index: llvm/include/VectorC/VectorC.h diff -c /dev/null llvm/include/VectorC/VectorC.h:1.1.2.1 *** /dev/null Tue Oct 18 14:32:51 2005 --- llvm/include/VectorC/VectorC.h Tue Oct 18 14:32:40 2005 *************** *** 0 **** --- 1,347 ---- + // VectorC.h + // Header file for Vector C significant functions + // File autogenerated by makedecls.pl + + typedef unsigned char uchar; + typedef unsigned short ushort; + typedef unsigned int uint; + int _vimm_int(int, unsigned); + int vllvm_vimm_int(int, unsigned); + unsigned int _vimm_unsigned_int(unsigned int, unsigned); + unsigned int vllvm_vimm_unsigned_int(unsigned int, unsigned); + unsigned int vllvm_vimm_uint(unsigned int, unsigned); + short _vimm_short(short, unsigned); + short vllvm_vimm_short(short, unsigned); + unsigned short _vimm_unsigned_short(unsigned short, unsigned); + unsigned short vllvm_vimm_unsigned_short(unsigned short, unsigned); + unsigned short vllvm_vimm_ushort(unsigned short, unsigned); + long _vimm_long(long, unsigned); + long vllvm_vimm_long(long, unsigned); + unsigned long _vimm_unsigned_long(unsigned long, unsigned); + unsigned long vllvm_vimm_unsigned_long(unsigned long, unsigned); + unsigned long vllvm_vimm_ulong(unsigned long, unsigned); + char _vimm_char(char, unsigned); + char vllvm_vimm_char(char, unsigned); + unsigned char _vimm_unsigned_char(unsigned char, unsigned); + unsigned char vllvm_vimm_unsigned_char(unsigned char, unsigned); + unsigned char vllvm_vimm_uchar(unsigned char, unsigned); + int _fixed_vimm_int(int, unsigned); + int vllvm_fixed_vimm_int(int, unsigned); + unsigned int _fixed_vimm_unsigned_int(unsigned int, unsigned); + unsigned int vllvm_fixed_vimm_unsigned_int(unsigned int, unsigned); + unsigned int vllvm_fixed_vimm_uint(unsigned int, unsigned); + short _fixed_vimm_short(short, unsigned); + short vllvm_fixed_vimm_short(short, unsigned); + unsigned short _fixed_vimm_unsigned_short(unsigned short, unsigned); + unsigned short vllvm_fixed_vimm_unsigned_short(unsigned short, unsigned); + unsigned short vllvm_fixed_vimm_ushort(unsigned short, unsigned); + long _fixed_vimm_long(long, unsigned); + long vllvm_fixed_vimm_long(long, unsigned); + unsigned long _fixed_vimm_unsigned_long(unsigned long, unsigned); + unsigned long vllvm_fixed_vimm_unsigned_long(unsigned long, unsigned); + unsigned long vllvm_fixed_vimm_ulong(unsigned long, unsigned); + char _fixed_vimm_char(char, unsigned); + char vllvm_fixed_vimm_char(char, unsigned); + unsigned char _fixed_vimm_unsigned_char(unsigned char, unsigned); + unsigned char vllvm_fixed_vimm_unsigned_char(unsigned char, unsigned); + unsigned char vllvm_fixed_vimm_uchar(unsigned char, unsigned); + int _vgather_int(const int*, ...); + int vllvm_vgather_int(const int*, ...); + unsigned int _vgather_unsigned_int(const unsigned int*, ...); + unsigned int vllvm_vgather_unsigned_int(const unsigned int*, ...); + unsigned int vllvm_vgather_uint(const unsigned int*, ...); + short _vgather_short(const short*, ...); + short vllvm_vgather_short(const short*, ...); + unsigned short _vgather_unsigned_short(const unsigned short*, ...); + unsigned short vllvm_vgather_unsigned_short(const unsigned short*, ...); + unsigned short vllvm_vgather_ushort(const unsigned short*, ...); + long _vgather_long(const long*, ...); + long vllvm_vgather_long(const long*, ...); + unsigned long _vgather_unsigned_long(const unsigned long*, ...); + unsigned long vllvm_vgather_unsigned_long(const unsigned long*, ...); + unsigned long vllvm_vgather_ulong(const unsigned long*, ...); + char _vgather_char(const char*, ...); + char vllvm_vgather_char(const char*, ...); + unsigned char _vgather_unsigned_char(const unsigned char*, ...); + unsigned char vllvm_vgather_unsigned_char(const unsigned char*, ...); + unsigned char vllvm_vgather_uchar(const unsigned char*, ...); + void _vscatter_int(int, int*, ...); + void vllvm_vscatter_int(int, int*, ...); + void _vscatter_unsigned_int(unsigned int, unsigned int*, ...); + void vllvm_vscatter_unsigned_int(unsigned int, unsigned int*, ...); + void vllvm_vscatter_uint(unsigned int, unsigned int*, ...); + void _vscatter_short(short, short*, ...); + void vllvm_vscatter_short(short, short*, ...); + void _vscatter_unsigned_short(unsigned short, unsigned short*, ...); + void vllvm_vscatter_unsigned_short(unsigned short, unsigned short*, ...); + void vllvm_vscatter_ushort(unsigned short, unsigned short*, ...); + void _vscatter_long(long, long*, ...); + void vllvm_vscatter_long(long, long*, ...); + void _vscatter_unsigned_long(unsigned long, unsigned long*, ...); + void vllvm_vscatter_unsigned_long(unsigned long, unsigned long*, ...); + void vllvm_vscatter_ulong(unsigned long, unsigned long*, ...); + void _vscatter_char(char, char*, ...); + void vllvm_vscatter_char(char, char*, ...); + void _vscatter_unsigned_char(unsigned char, unsigned char*, ...); + void vllvm_vscatter_unsigned_char(unsigned char, unsigned char*, ...); + void vllvm_vscatter_uchar(unsigned char, unsigned char*, ...); + int _load_int(const int*, unsigned, int); + int vllvm_load_int(const int*, unsigned, int); + unsigned int _load_unsigned_int(const unsigned int*, unsigned, int); + unsigned int vllvm_load_unsigned_int(const unsigned int*, unsigned, int); + unsigned int vllvm_load_uint(const unsigned int*, unsigned, int); + short _load_short(const short*, unsigned, int); + short vllvm_load_short(const short*, unsigned, int); + unsigned short _load_unsigned_short(const unsigned short*, unsigned, int); + unsigned short vllvm_load_unsigned_short(const unsigned short*, unsigned, int); + unsigned short vllvm_load_ushort(const unsigned short*, unsigned, int); + long _load_long(const long*, unsigned, int); + long vllvm_load_long(const long*, unsigned, int); + unsigned long _load_unsigned_long(const unsigned long*, unsigned, int); + unsigned long vllvm_load_unsigned_long(const unsigned long*, unsigned, int); + unsigned long vllvm_load_ulong(const unsigned long*, unsigned, int); + char _load_char(const char*, unsigned, int); + char vllvm_load_char(const char*, unsigned, int); + unsigned char _load_unsigned_char(const unsigned char*, unsigned, int); + unsigned char vllvm_load_unsigned_char(const unsigned char*, unsigned, int); + unsigned char vllvm_load_uchar(const unsigned char*, unsigned, int); + int _store_int(int, int*, int); + int vllvm_store_int(int, int*, int); + unsigned int _store_unsigned_int(unsigned int, unsigned int*, int); + unsigned int vllvm_store_unsigned_int(unsigned int, unsigned int*, int); + unsigned int vllvm_store_uint(unsigned int, unsigned int*, int); + short _store_short(short, short*, int); + short vllvm_store_short(short, short*, int); + unsigned short _store_unsigned_short(unsigned short, unsigned short*, int); + unsigned short vllvm_store_unsigned_short(unsigned short, unsigned short*, int); + unsigned short vllvm_store_ushort(unsigned short, unsigned short*, int); + long _store_long(long, long*, int); + long vllvm_store_long(long, long*, int); + unsigned long _store_unsigned_long(unsigned long, unsigned long*, int); + unsigned long vllvm_store_unsigned_long(unsigned long, unsigned long*, int); + unsigned long vllvm_store_ulong(unsigned long, unsigned long*, int); + char _store_char(char, char*, int); + char vllvm_store_char(char, char*, int); + unsigned char _store_unsigned_char(unsigned char, unsigned char*, int); + unsigned char vllvm_store_unsigned_char(unsigned char, unsigned char*, int); + unsigned char vllvm_store_uchar(unsigned char, unsigned char*, int); + int _vselect_int(int, int, int); + int vllvm_vselect_int(int, int, int); + unsigned int _vselect_unsigned_int(int, unsigned int, unsigned int); + unsigned int vllvm_vselect_unsigned_int(int, unsigned int, unsigned int); + unsigned int vllvm_vselect_uint(int, unsigned int, unsigned int); + short _vselect_short(int, short, short); + short vllvm_vselect_short(int, short, short); + unsigned short _vselect_unsigned_short(int, unsigned short, unsigned short); + unsigned short vllvm_vselect_unsigned_short(int, unsigned short, unsigned short); + unsigned short vllvm_vselect_ushort(int, unsigned short, unsigned short); + long _vselect_long(int, long, long); + long vllvm_vselect_long(int, long, long); + unsigned long _vselect_unsigned_long(int, unsigned long, unsigned long); + unsigned long vllvm_vselect_unsigned_long(int, unsigned long, unsigned long); + unsigned long vllvm_vselect_ulong(int, unsigned long, unsigned long); + char _vselect_char(int, char, char); + char vllvm_vselect_char(int, char, char); + unsigned char _vselect_unsigned_char(int, unsigned char, unsigned char); + unsigned char vllvm_vselect_unsigned_char(int, unsigned char, unsigned char); + unsigned char vllvm_vselect_uchar(int, unsigned char, unsigned char); + int _extract_int(int, unsigned, unsigned, unsigned); + int vllvm_extract_int(int, unsigned, unsigned, unsigned); + unsigned int _extract_unsigned_int(unsigned int, unsigned, unsigned, unsigned); + unsigned int vllvm_extract_unsigned_int(unsigned int, unsigned, unsigned, unsigned); + unsigned int vllvm_extract_uint(unsigned int, unsigned, unsigned, unsigned); + short _extract_short(short, unsigned, unsigned, unsigned); + short vllvm_extract_short(short, unsigned, unsigned, unsigned); + unsigned short _extract_unsigned_short(unsigned short, unsigned, unsigned, unsigned); + unsigned short vllvm_extract_unsigned_short(unsigned short, unsigned, unsigned, unsigned); + unsigned short vllvm_extract_ushort(unsigned short, unsigned, unsigned, unsigned); + long _extract_long(long, unsigned, unsigned, unsigned); + long vllvm_extract_long(long, unsigned, unsigned, unsigned); + unsigned long _extract_unsigned_long(unsigned long, unsigned, unsigned, unsigned); + unsigned long vllvm_extract_unsigned_long(unsigned long, unsigned, unsigned, unsigned); + unsigned long vllvm_extract_ulong(unsigned long, unsigned, unsigned, unsigned); + char _extract_char(char, unsigned, unsigned, unsigned); + char vllvm_extract_char(char, unsigned, unsigned, unsigned); + unsigned char _extract_unsigned_char(unsigned char, unsigned, unsigned, unsigned); + unsigned char vllvm_extract_unsigned_char(unsigned char, unsigned, unsigned, unsigned); + unsigned char vllvm_extract_uchar(unsigned char, unsigned, unsigned, unsigned); + int _combine_int(int, int, unsigned, unsigned); + int vllvm_combine_int(int, int, unsigned, unsigned); + unsigned int _combine_unsigned_int(unsigned int, unsigned int, unsigned, unsigned); + unsigned int vllvm_combine_unsigned_int(unsigned int, unsigned int, unsigned, unsigned); + unsigned int vllvm_combine_uint(unsigned int, unsigned int, unsigned, unsigned); + short _combine_short(short, short, unsigned, unsigned); + short vllvm_combine_short(short, short, unsigned, unsigned); + unsigned short _combine_unsigned_short(unsigned short, unsigned short, unsigned, unsigned); + unsigned short vllvm_combine_unsigned_short(unsigned short, unsigned short, unsigned, unsigned); + unsigned short vllvm_combine_ushort(unsigned short, unsigned short, unsigned, unsigned); + long _combine_long(long, long, unsigned, unsigned); + long vllvm_combine_long(long, long, unsigned, unsigned); + unsigned long _combine_unsigned_long(unsigned long, unsigned long, unsigned, unsigned); + unsigned long vllvm_combine_unsigned_long(unsigned long, unsigned long, unsigned, unsigned); + unsigned long vllvm_combine_ulong(unsigned long, unsigned long, unsigned, unsigned); + char _combine_char(char, char, unsigned, unsigned); + char vllvm_combine_char(char, char, unsigned, unsigned); + unsigned char _combine_unsigned_char(unsigned char, unsigned char, unsigned, unsigned); + unsigned char vllvm_combine_unsigned_char(unsigned char, unsigned char, unsigned, unsigned); + unsigned char vllvm_combine_uchar(unsigned char, unsigned char, unsigned, unsigned); + int _fixed_combine_int(int, unsigned, int, unsigned, unsigned, unsigned); + int vllvm_fixed_combine_int(int, unsigned, int, unsigned, unsigned, unsigned); + unsigned int _fixed_combine_unsigned_int(unsigned int, unsigned, unsigned int, unsigned, unsigned, unsigned); + unsigned int vllvm_fixed_combine_unsigned_int(unsigned int, unsigned, unsigned int, unsigned, unsigned, unsigned); + unsigned int vllvm_fixed_combine_uint(unsigned int, unsigned, unsigned int, unsigned, unsigned, unsigned); + short _fixed_combine_short(short, unsigned, short, unsigned, unsigned, unsigned); + short vllvm_fixed_combine_short(short, unsigned, short, unsigned, unsigned, unsigned); + unsigned short _fixed_combine_unsigned_short(unsigned short, unsigned, unsigned short, unsigned, unsigned, unsigned); + unsigned short vllvm_fixed_combine_unsigned_short(unsigned short, unsigned, unsigned short, unsigned, unsigned, unsigned); + unsigned short vllvm_fixed_combine_ushort(unsigned short, unsigned, unsigned short, unsigned, unsigned, unsigned); + long _fixed_combine_long(long, unsigned, long, unsigned, unsigned, unsigned); + long vllvm_fixed_combine_long(long, unsigned, long, unsigned, unsigned, unsigned); + unsigned long _fixed_combine_unsigned_long(unsigned long, unsigned, unsigned long, unsigned, unsigned, unsigned); + unsigned long vllvm_fixed_combine_unsigned_long(unsigned long, unsigned, unsigned long, unsigned, unsigned, unsigned); + unsigned long vllvm_fixed_combine_ulong(unsigned long, unsigned, unsigned long, unsigned, unsigned, unsigned); + char _fixed_combine_char(char, unsigned, char, unsigned, unsigned, unsigned); + char vllvm_fixed_combine_char(char, unsigned, char, unsigned, unsigned, unsigned); + unsigned char _fixed_combine_unsigned_char(unsigned char, unsigned, unsigned char, unsigned, unsigned, unsigned); + unsigned char vllvm_fixed_combine_unsigned_char(unsigned char, unsigned, unsigned char, unsigned, unsigned, unsigned); + unsigned char vllvm_fixed_combine_uchar(unsigned char, unsigned, unsigned char, unsigned, unsigned, unsigned); + int _extractelement_int(int, unsigned); + int vllvm_extractelement_int(int, unsigned); + unsigned int _extractelement_unsigned_int(unsigned int, unsigned); + unsigned int vllvm_extractelement_unsigned_int(unsigned int, unsigned); + unsigned int vllvm_extractelement_uint(unsigned int, unsigned); + short _extractelement_short(short, unsigned); + short vllvm_extractelement_short(short, unsigned); + unsigned short _extractelement_unsigned_short(unsigned short, unsigned); + unsigned short vllvm_extractelement_unsigned_short(unsigned short, unsigned); + unsigned short vllvm_extractelement_ushort(unsigned short, unsigned); + long _extractelement_long(long, unsigned); + long vllvm_extractelement_long(long, unsigned); + unsigned long _extractelement_unsigned_long(unsigned long, unsigned); + unsigned long vllvm_extractelement_unsigned_long(unsigned long, unsigned); + unsigned long vllvm_extractelement_ulong(unsigned long, unsigned); + char _extractelement_char(char, unsigned); + char vllvm_extractelement_char(char, unsigned); + unsigned char _extractelement_unsigned_char(unsigned char, unsigned); + unsigned char vllvm_extractelement_unsigned_char(unsigned char, unsigned); + unsigned char vllvm_extractelement_uchar(unsigned char, unsigned); + int _combineelement_int(int, int, unsigned); + int vllvm_combineelement_int(int, int, unsigned); + unsigned int _combineelement_unsigned_int(unsigned int, unsigned int, unsigned); + unsigned int vllvm_combineelement_unsigned_int(unsigned int, unsigned int, unsigned); + unsigned int vllvm_combineelement_uint(unsigned int, unsigned int, unsigned); + short _combineelement_short(short, short, unsigned); + short vllvm_combineelement_short(short, short, unsigned); + unsigned short _combineelement_unsigned_short(unsigned short, unsigned short, unsigned); + unsigned short vllvm_combineelement_unsigned_short(unsigned short, unsigned short, unsigned); + unsigned short vllvm_combineelement_ushort(unsigned short, unsigned short, unsigned); + long _combineelement_long(long, long, unsigned); + long vllvm_combineelement_long(long, long, unsigned); + unsigned long _combineelement_unsigned_long(unsigned long, unsigned long, unsigned); + unsigned long vllvm_combineelement_unsigned_long(unsigned long, unsigned long, unsigned); + unsigned long vllvm_combineelement_ulong(unsigned long, unsigned long, unsigned); + char _combineelement_char(char, char, unsigned); + char vllvm_combineelement_char(char, char, unsigned); + unsigned char _combineelement_unsigned_char(unsigned char, unsigned char, unsigned); + unsigned char vllvm_combineelement_unsigned_char(unsigned char, unsigned char, unsigned); + unsigned char vllvm_combineelement_uchar(unsigned char, unsigned char, unsigned); + int _constant_int(int, ...); + int vllvm_constant_int(int, ...); + unsigned int _constant_unsigned_int(unsigned int, ...); + unsigned int vllvm_constant_unsigned_int(unsigned int, ...); + unsigned int vllvm_constant_uint(unsigned int, ...); + short _constant_short(short, ...); + short vllvm_constant_short(short, ...); + unsigned short _constant_unsigned_short(unsigned short, ...); + unsigned short vllvm_constant_unsigned_short(unsigned short, ...); + unsigned short vllvm_constant_ushort(unsigned short, ...); + long _constant_long(long, ...); + long vllvm_constant_long(long, ...); + unsigned long _constant_unsigned_long(unsigned long, ...); + unsigned long vllvm_constant_unsigned_long(unsigned long, ...); + unsigned long vllvm_constant_ulong(unsigned long, ...); + char _constant_char(char, ...); + char vllvm_constant_char(char, ...); + unsigned char _constant_unsigned_char(unsigned char, ...); + unsigned char vllvm_constant_unsigned_char(unsigned char, ...); + unsigned char vllvm_constant_uchar(unsigned char, ...); + int _fixed_permute_int(int, unsigned, int, unsigned); + int vllvm_fixed_permute_int(int, unsigned, int, unsigned); + unsigned int _fixed_permute_unsigned_int(unsigned int, unsigned, unsigned int, unsigned); + unsigned int vllvm_fixed_permute_unsigned_int(unsigned int, unsigned, unsigned int, unsigned); + unsigned int vllvm_fixed_permute_uint(unsigned int, unsigned, unsigned int, unsigned); + short _fixed_permute_short(short, unsigned, short, unsigned); + short vllvm_fixed_permute_short(short, unsigned, short, unsigned); + unsigned short _fixed_permute_unsigned_short(unsigned short, unsigned, unsigned short, unsigned); + unsigned short vllvm_fixed_permute_unsigned_short(unsigned short, unsigned, unsigned short, unsigned); + unsigned short vllvm_fixed_permute_ushort(unsigned short, unsigned, unsigned short, unsigned); + long _fixed_permute_long(long, unsigned, long, unsigned); + long vllvm_fixed_permute_long(long, unsigned, long, unsigned); + unsigned long _fixed_permute_unsigned_long(unsigned long, unsigned, unsigned long, unsigned); + unsigned long vllvm_fixed_permute_unsigned_long(unsigned long, unsigned, unsigned long, unsigned); + unsigned long vllvm_fixed_permute_ulong(unsigned long, unsigned, unsigned long, unsigned); + char _fixed_permute_char(char, unsigned, char, unsigned); + char vllvm_fixed_permute_char(char, unsigned, char, unsigned); + unsigned char _fixed_permute_unsigned_char(unsigned char, unsigned, unsigned char, unsigned); + unsigned char vllvm_fixed_permute_unsigned_char(unsigned char, unsigned, unsigned char, unsigned); + unsigned char vllvm_fixed_permute_uchar(unsigned char, unsigned, unsigned char, unsigned); + int _vload_int(const int*, ...); + int vllvm_vload_int(const int*, ...); + unsigned int _vload_unsigned_int(const unsigned int*, ...); + unsigned int vllvm_vload_unsigned_int(const unsigned int*, ...); + unsigned int vllvm_vload_uint(const unsigned int*, ...); + short _vload_short(const short*, ...); + short vllvm_vload_short(const short*, ...); + unsigned short _vload_unsigned_short(const unsigned short*, ...); + unsigned short vllvm_vload_unsigned_short(const unsigned short*, ...); + unsigned short vllvm_vload_ushort(const unsigned short*, ...); + long _vload_long(const long*, ...); + long vllvm_vload_long(const long*, ...); + unsigned long _vload_unsigned_long(const unsigned long*, ...); + unsigned long vllvm_vload_unsigned_long(const unsigned long*, ...); + unsigned long vllvm_vload_ulong(const unsigned long*, ...); + char _vload_char(const char*, ...); + char vllvm_vload_char(const char*, ...); + unsigned char _vload_unsigned_char(const unsigned char*, ...); + unsigned char vllvm_vload_unsigned_char(const unsigned char*, ...); + unsigned char vllvm_vload_uchar(const unsigned char*, ...); + int _vloadi_int(int, unsigned); + int vllvm_vloadi_int(int, unsigned); + unsigned int _vloadi_unsigned_int(unsigned int, unsigned); + unsigned int vllvm_vloadi_unsigned_int(unsigned int, unsigned); + unsigned int vllvm_vloadi_uint(unsigned int, unsigned); + short _vloadi_short(short, unsigned); + short vllvm_vloadi_short(short, unsigned); + unsigned short _vloadi_unsigned_short(unsigned short, unsigned); + unsigned short vllvm_vloadi_unsigned_short(unsigned short, unsigned); + unsigned short vllvm_vloadi_ushort(unsigned short, unsigned); + long _vloadi_long(long, unsigned); + long vllvm_vloadi_long(long, unsigned); + unsigned long _vloadi_unsigned_long(unsigned long, unsigned); + unsigned long vllvm_vloadi_unsigned_long(unsigned long, unsigned); + unsigned long vllvm_vloadi_ulong(unsigned long, unsigned); + char _vloadi_char(char, unsigned); + char vllvm_vloadi_char(char, unsigned); + unsigned char _vloadi_unsigned_char(unsigned char, unsigned); + unsigned char vllvm_vloadi_unsigned_char(unsigned char, unsigned); + unsigned char vllvm_vloadi_uchar(unsigned char, unsigned); + void _vstore_int(int, int*, ...); + void vllvm_vstore_int(int, int*, ...); + void _vstore_unsigned_int(unsigned int, unsigned int*, ...); + void vllvm_vstore_unsigned_int(unsigned int, unsigned int*, ...); + void vllvm_vstore_uint(unsigned int, unsigned int*, ...); + void _vstore_short(short, short*, ...); + void vllvm_vstore_short(short, short*, ...); + void _vstore_unsigned_short(unsigned short, unsigned short*, ...); + void vllvm_vstore_unsigned_short(unsigned short, unsigned short*, ...); + void vllvm_vstore_ushort(unsigned short, unsigned short*, ...); + void _vstore_long(long, long*, ...); + void vllvm_vstore_long(long, long*, ...); + void _vstore_unsigned_long(unsigned long, unsigned long*, ...); + void vllvm_vstore_unsigned_long(unsigned long, unsigned long*, ...); + void vllvm_vstore_ulong(unsigned long, unsigned long*, ...); + void _vstore_char(char, char*, ...); + void vllvm_vstore_char(char, char*, ...); + void _vstore_unsigned_char(unsigned char, unsigned char*, ...); + void vllvm_vstore_unsigned_char(unsigned char, unsigned char*, ...); + void vllvm_vstore_uchar(unsigned char, unsigned char*, ...); Index: llvm/include/VectorC/makedecls.pl diff -c /dev/null llvm/include/VectorC/makedecls.pl:1.1.2.1 *** /dev/null Tue Oct 18 14:32:52 2005 --- llvm/include/VectorC/makedecls.pl Tue Oct 18 14:32:40 2005 *************** *** 0 **** --- 1,83 ---- + #!/usr/bin/perl + + @types = ('int', short, long, char); + @funcs = (['', vimm, '', unsigned], + ['', fixed_vimm, '', unsigned], + ['', vgather, 'const *', '...'], + [void, vscatter, '', '*', '...'], + ['', load, 'const *', unsigned, 'int'], + ['', store, '', '*', 'int'], + ['', vselect, 'int', '', ''], + ['', extract, '', unsigned, unsigned, unsigned], + ['', combine, '', '', unsigned, unsigned], + ['', fixed_combine, '', unsigned, '', unsigned, unsigned, unsigned], + ['', extractelement, '', unsigned], + ['', combineelement, '', '', unsigned], + ['', constant, '', '...'], + ['', fixed_permute, '', unsigned, '', unsigned], + # Older forms (for compatibility) + ['', vload, 'const *', '...'], + ['', vloadi, '', unsigned], + [void, vstore, '', '*', '...'] + ); + + sub resolve(@) { + my ($str, $type) = @_; + $str =~ s//$type/g; + return $str; + } + + sub print_decl(@) { + my ($func, $type) = @_; + my $ext = $type; + $ext =~ s/ /_/g; + + #_... form + print resolve($func->[0], $type); + print " _$func->[1]_$ext("; + for (my $i = 2; $i < $#{$func}; ++$i) { + print resolve($func->[$i], $type); + print ", "; + } + print resolve($func->[$#{$func}], $type); + print ");\n"; + + # Alternate (newer, preferred) vllvm_... form + print resolve($func->[0], $type); + print " vllvm_$func->[1]_$ext("; + for (my $i = 2; $i < $#{$func}; ++$i) { + print resolve($func->[$i], $type); + print ", "; + } + print resolve($func->[$#{$func}], $type); + print ");\n"; + + if ($type =~ /unsigned\s+(\w+)/) { + $ext = 'u'.$1; + print resolve($func->[0], $type); + print " vllvm_$func->[1]_$ext("; + for (my $i = 2; $i < $#{$func}; ++$i) { + print resolve($func->[$i], $type); + print ", "; + } + print resolve($func->[$#{$func}], $type); + print ");\n"; + } + + } + + print "// VectorC.h\n"; + print "// Header file for Vector C significant functions\n"; + print "// File autogenerated by $0\n\n"; + print "typedef unsigned char uchar;\n"; + print "typedef unsigned short ushort;\n"; + print "typedef unsigned int uint;\n"; + foreach (@funcs) { + my $func = $_; + foreach (@types) { + my $type = $_; + print_decl($func, $type); + print_decl($func, "unsigned ".$type); + } + } + Index: llvm/include/VectorC/triplet.h diff -c /dev/null llvm/include/VectorC/triplet.h:1.1.2.1 *** /dev/null Tue Oct 18 14:32:52 2005 --- llvm/include/VectorC/triplet.h Tue Oct 18 14:32:40 2005 *************** *** 0 **** --- 1,4 ---- + int _triplet(int,...); + int _select_int(int,...); + short _select_short(int,...); + int _register(); From bocchino at cs.uiuc.edu Tue Oct 18 14:34:43 2005 From: bocchino at cs.uiuc.edu (Robert Bocchino) Date: Tue, 18 Oct 2005 14:34:43 -0500 Subject: [llvm-commits] [vector_llvm] CVS: llvm/include/SIMD/SSE.h Scalar.h Message-ID: <200510181934.OAA06660@zion.cs.uiuc.edu> Changes in directory llvm/include/SIMD: SSE.h added (r1.1.2.1) Scalar.h added (r1.1.2.1) --- Log message: Initial commit of Vector LLVM. --- Diffs of the changes: (+56 -0) SSE.h | 41 +++++++++++++++++++++++++++++++++++++++++ Scalar.h | 15 +++++++++++++++ 2 files changed, 56 insertions(+) Index: llvm/include/SIMD/SSE.h diff -c /dev/null llvm/include/SIMD/SSE.h:1.1.2.1 *** /dev/null Tue Oct 18 14:34:42 2005 --- llvm/include/SIMD/SSE.h Tue Oct 18 14:34:32 2005 *************** *** 0 **** --- 1,41 ---- + #ifndef SSE_H + #define SSE_H + + #include + #include "Scalar.h" + + // Some obvious missing SSE intrinsics + + #define _mm_splat_epi16(x) _mm_set_epi16(x,x,x,x,x,x,x,x) + #define _mm_splat_epi32(x) _mm_set_epi32(x,x,x,x) + #define _mm_pack_epi32(a,b) _mm_packs_epi32( _mm_srai_epi32( _mm_slli_epi32( a, 16), 16), \ + _mm_srai_epi32( _mm_slli_epi32( b, 16), 16) ) + #define _mm_pack_epu32(a,b) _mm_packs_epi32( _mm_srai_epi32( _mm_slli_epi32( a, 16), 16), \ + _mm_srai_epi32( _mm_slli_epi32( b, 16), 16) ) + #define _mm_pack_epi16(x,y) _mm_packs_epi16( _mm_srai_epi16( _mm_slli_epi16( x, 8), 8), \ + _mm_srai_epi16( _mm_slli_epi16( y, 8), 8) ) + #define _mm_select_si128(msk, a, b) _mm_or_si128(_mm_and_si128(a, msk), _mm_andnot_si128(msk, b)) + + + // Printing + + inline void print_vector_short(__m128i v) { + unsigned i; + for (i = 0; i < 8; ++i) + printf("%04X ", elt_short(v, i)); + printf("\n"); + } + + // AltiVec conversions + + inline __m128i _mm_mr_epi16(__m128i x, __m128i y) { + __m128i c = _mm_splat_epi32(1<<14); + __m128i tmp_hi = _mm_mulhi_epi16(x, y); + __m128i tmp_lo = _mm_mullo_epi16(x, y); + return _mm_pack_epi32(_mm_srai_epi32(_mm_add_epi32(_mm_unpacklo_epi16(tmp_lo, tmp_hi), c), 15), + _mm_srai_epi32(_mm_add_epi32(_mm_unpackhi_epi16(tmp_lo, tmp_hi), c), 15)); + } + + #define _mm_mradds_epi16(x, y, z) _mm_adds_epi16(_mm_mr_epi16(x,y),z) + + #endif Index: llvm/include/SIMD/Scalar.h diff -c /dev/null llvm/include/SIMD/Scalar.h:1.1.2.1 *** /dev/null Tue Oct 18 14:34:43 2005 --- llvm/include/SIMD/Scalar.h Tue Oct 18 14:34:32 2005 *************** *** 0 **** --- 1,15 ---- + #ifndef SCALAR_H + #define SCALAR_H + + // Scalar versions of common SIMD operations + + #define saturate_short(x) (((x) < -32768) ? -32768 : (((x) > 32767) ? 32767 : (x))) + #define adds_short(x, y) saturate_short(x+y) + #define subs_short(x, y) saturate_short(x-y) + #define mradds_short(x, y, z) saturate_short((((x*y) + (1<<14))>>15)+z) + + // Access to scalar elements + + #define elt_short(vec,i) ((short*) &vec)[i] + + #endif From bocchino at cs.uiuc.edu Tue Oct 18 14:35:36 2005 From: bocchino at cs.uiuc.edu (Robert Bocchino) Date: Tue, 18 Oct 2005 14:35:36 -0500 Subject: [llvm-commits] [vector_llvm] CVS: llvm/include/VectorLLVM/Utils.h VectorIntrinsics.h VectorSignificantFunctions.h Message-ID: <200510181935.OAA06686@zion.cs.uiuc.edu> Changes in directory llvm/include/VectorLLVM: Utils.h added (r1.1.2.1) VectorIntrinsics.h added (r1.1.2.1) VectorSignificantFunctions.h added (r1.1.2.1) --- Log message: Initial commit of Vector LLVM. --- Diffs of the changes: (+642 -0) Utils.h | 315 +++++++++++++++++++++++++++++++++++++++++++ VectorIntrinsics.h | 34 ++++ VectorSignificantFunctions.h | 293 +++++++++++++++++++++++++++++++++++++++ 3 files changed, 642 insertions(+) Index: llvm/include/VectorLLVM/Utils.h diff -c /dev/null llvm/include/VectorLLVM/Utils.h:1.1.2.1 *** /dev/null Tue Oct 18 14:35:34 2005 --- llvm/include/VectorLLVM/Utils.h Tue Oct 18 14:35:24 2005 *************** *** 0 **** --- 1,315 ---- + //===- Utils.h - Utilities for vector code generation -----------*- C++ -*-===// + // + // The LLVM Compiler Infrastructure + // + // This file was developed by the LLVM research group and is distributed under + // the University of Illinois Open Source License. See LICENSE.TXT for details. + // + //===----------------------------------------------------------------------===// + // + // + // + //===----------------------------------------------------------------------===// + + #ifndef PROJECTS_VECTOR_INCLUDE_UTILS_H + #define PROJECTS_VECTOR_INCLUDE_UTILS_H + + #include "llvm/Constants.h" + #include "llvm/DerivedTypes.h" + #include "llvm/Function.h" + #include "llvm/Instructions.h" + #include "llvm/Module.h" + #include "llvm/Type.h" + #include "llvm/Transforms/Utils/BasicBlockUtils.h" + #include "llvm/ADT/hash_set" + #include + #include + + using namespace llvm; + + namespace VectorUtils { + + + + //===----------------------------------------------------------------------===// + // Helper functions for managing register and label names + //===----------------------------------------------------------------------===// + + /// Counter for temporary variable names + /// + static unsigned tmpCount = 0; + + /// Counter for loop labels + /// + static unsigned loopCount = 0; + + /// Counter for conditionals + /// + static unsigned condCount = 0; + + static std::string next(std::string prefix, unsigned suffix) { + std::ostringstream os; + os << prefix << "." << suffix; + return os.str(); + } + + static std::string nextTmp() { + return next("tmp", tmpCount++); + } + + static std::string nextHeader() { + return next("loop_header", loopCount++); + } + + static std::string nextBody() { + return next("loop_body", loopCount-1); + } + + static std::string nextExit() { + return next("loop_exit", loopCount-1); + } + + static std::string nextIfTrue() { + return next("if_true", condCount++); + } + + static std::string nextIfFalse() { + return next("if_false", condCount); + } + + + //===----------------------------------------------------------------------===// + // Helper functions for identifying vector stuff + //===----------------------------------------------------------------------===// + + static bool recursiveContainsVector(const Type* Ty, + hash_set &seenTys) { + if (seenTys.count(Ty)) + return false; + seenTys.insert(Ty); + if (isa(Ty)) + return true; + else if (const SequentialType *SequentialTy = dyn_cast(Ty)) { + return recursiveContainsVector(SequentialTy->getElementType(), + seenTys); + } else if (const StructType *StructTy = dyn_cast(Ty)) { + for (StructType::element_iterator I = StructTy->element_begin(), + E = StructTy->element_end(); I != E; ++I) { + if (recursiveContainsVector(*I, seenTys)) return true; + } + return false; + } else if (const FunctionType *FunctionTy = dyn_cast(Ty)) { + if (recursiveContainsVector(FunctionTy->getReturnType(), + seenTys)) + return true; + for (FunctionType::param_iterator I = FunctionTy->param_begin(), + E = FunctionTy->param_end(); I != E; ++I) + if (recursiveContainsVector(*I, seenTys)) return true; + return false; + } + return false; + } + + static bool containsVector(const Type *Ty) { + hash_set seenTys; + return recursiveContainsVector(Ty, seenTys); + } + + static bool containsVector(Instruction *inst) { + if (containsVector(inst->getType())) return true; + for (User::op_iterator I = inst->op_begin(), E = inst->op_end(); + I != E; ++I) + if (containsVector((*I)->getType())) + return true; + return false; + } + + + //===----------------------------------------------------------------------===// + // Very useful for identifying intrinsics + //===----------------------------------------------------------------------===// + + static bool isFunctionContaining(Value *Val, const std::string &s) { + if (CallInst *CI = dyn_cast(Val)) { + if (Function *F = CI->getCalledFunction()) { + if (F->getName().find(s) != std::string::npos) { + return true; + } + } + } + return false; + } + + //===----------------------------------------------------------------------===// + // Helper functions for array computations + //===----------------------------------------------------------------------===// + + /// Compute an index into a flattened (one-dimensional) array + /// corresponding to the given indices for a possibly + /// multidimensional array. + /// + static Instruction *computeFlattenedPointer(VMemoryInst *VI, std::vector indices, + Instruction *before) { + unsigned numLevels = VI->getNumIndices() >> 2; + Value *indexValue = + BinaryOperator::create(Instruction::Mul, indices[0], + VI->getMultiplier(0), nextTmp(), before); + for (unsigned i = 1; i < numLevels; ++i) { + Instruction *mul = + BinaryOperator::create(Instruction::Mul, indices[i], + VI->getMultiplier(i), nextTmp(), before); + indexValue = + BinaryOperator::create(Instruction::Add, indexValue, mul, + nextTmp(), before); + } + + std::vector indexVector; + indexVector.push_back(indexValue); + return new GetElementPtrInst(VI->getPointerOperand(), indexVector, + "ptr", before); + } + + /// Compute the length of an array in a single dimension, given the + /// lower bound, upper bound, and stride. Type is LongTy. + /// + static Value *computeSingleDimensionLength(Value *lowerBound, Value *upperBound, + Value *stride, Instruction *before) { + ConstantSInt *longZero = ConstantSInt::get(Type::LongTy, 0); + ConstantSInt *longOne = ConstantSInt::get(Type::LongTy, 1); + ConstantSInt *longNegOne = ConstantSInt::get(Type::LongTy, -1); + Value *length; + length = (lowerBound == longZero) ? upperBound : + BinaryOperator::create(Instruction::Sub, upperBound, lowerBound, + nextTmp(), before); + length = BinaryOperator::create(Instruction::Add, length, stride, + nextTmp(), before); + if (stride != longOne) + length = BinaryOperator::create(Instruction::Div, length, stride, + nextTmp(), before); + return length; + } + + /// Given a vector instruction (vload or vstore), generate code to + /// compute the length of the (flattened) array slice defined by the + /// indices. Type is UIntTy. + /// + static Value *computeIndexedLength(VMemoryInst *VI, + Instruction *before = 0, + std::string name = "tmp") { + if (!before) + before = VI; + + unsigned numTriples = VI->getNumIndices() >> 2; + Value *oldVal = 0, *newVal = 0, *length = 0; + + for (unsigned i = 0; i < numTriples; ++i) { + Value *start = VI->getLowerBound(i); + Value *end = VI->getUpperBound(i); + Value *stride = VI->getStride(i); + if (start != end) { + newVal = computeSingleDimensionLength(start, end, stride, before); + if (oldVal) + newVal = BinaryOperator::create(Instruction::Mul, oldVal, newVal, + nextTmp(), before); + oldVal = newVal; + } + } + if (newVal) + length = new CastInst(newVal, Type::UIntTy, name, before); + else + length = ConstantUInt::get(Type::UIntTy, 1); + + return length; + } + + /// Given two lengths, generate code to ensure that they are equal; + /// abort if not + /// + static void ensureEquality(Instruction *before, Value *V1, Value *V2) { + // Set up the basic blocks + // + BasicBlock *initial = before->getParent(); + BasicBlock *ifFalse = initial->splitBasicBlock(before, nextIfFalse()); + BasicBlock *ifTrue = ifFalse->splitBasicBlock(before, nextIfTrue()); + Instruction *cond = + BinaryOperator::create(Instruction::SetEQ, V1, V2, + nextTmp(), initial->getTerminator()); + BasicBlock::iterator oldInst(initial->getTerminator()); + Instruction *newInst = new BranchInst(ifTrue, ifFalse, cond); + ReplaceInstWithInst(initial->getInstList(), oldInst, newInst); + + // Generate code to abort + // + std::vector formalArgs; + std::vector args; + + FunctionType *FType = FunctionType::get(Type::VoidTy, formalArgs, false); + Function *F = initial->getParent(); + Module *M = F->getParent(); + Function *abort = M->getOrInsertFunction("abort", FType); + Instruction *call = new CallInst(abort, args, "", ifFalse->getTerminator()); + + // Generate code to print the error message + // + formalArgs.push_back(PointerType::get(Type::SByteTy)); + FType = FunctionType::get(Type::IntTy, formalArgs, true); + Function *printf = M->getOrInsertFunction("printf", FType); + + std::string msg = "unequal vector lengths " + V1->getName() + " and " + + V2->getName() + " in function " + F->getName() + "\n"; + Constant *arr = ConstantArray::get(msg); + GlobalVariable *GV = new GlobalVariable(arr->getType(), true, + GlobalValue::InternalLinkage, + arr, "error_str", M); + std::vector idx; + idx.push_back(ConstantUInt::get(Type::ULongTy, 0)); + idx.push_back(ConstantUInt::get(Type::ULongTy, 0)); + Constant *gep = ConstantExpr::getGetElementPtr(GV, idx); + + args.push_back(gep); + new CallInst(printf, args, "", call); + } + + //===----------------------------------------------------------------------===// + // Nicer CallInst constructor interface + //===----------------------------------------------------------------------===// + + static CallInst *getCallInst(const Type* RetTy, const std::string& FName, std::vector& args, + const std::string& Name, Instruction *before) { + std::vector formalArgs; + for (std::vector::iterator I = args.begin(), E = args.end(); I != E; ++I) { + formalArgs.push_back((*I)->getType()); + } + FunctionType *FType = FunctionType::get(RetTy, formalArgs, false); + Module *M = before->getParent()->getParent()->getParent(); + Function *F = M->getOrInsertFunction(FName, FType); + return new CallInst(F, args, Name, before); + } + + static CallInst *getCallInst(const Type* RetTy, const std::string& FName, Value *arg1, + const std::string& Name, Instruction *before) { + std::vector args; + args.push_back(arg1); + return getCallInst(RetTy, FName, args, Name, before); + } + + static CallInst *getCallInst(const Type* RetTy, const std::string& FName, Value *arg1, Value *arg2, + const std::string& Name, Instruction *before) { + std::vector args; + args.push_back(arg1); + args.push_back(arg2); + return getCallInst(RetTy, FName, args, Name, before); + } + + static CallInst *getCallInst(const Type* RetTy, const std::string& FName, Value *arg1, Value *arg2, Value *arg3, + const std::string& Name, Instruction *before) { + std::vector args; + args.push_back(arg1); + args.push_back(arg2); + args.push_back(arg3); + return getCallInst(RetTy, FName, args, Name, before); + } + + } + + #endif Index: llvm/include/VectorLLVM/VectorIntrinsics.h diff -c /dev/null llvm/include/VectorLLVM/VectorIntrinsics.h:1.1.2.1 *** /dev/null Tue Oct 18 14:35:35 2005 --- llvm/include/VectorLLVM/VectorIntrinsics.h Tue Oct 18 14:35:24 2005 *************** *** 0 **** --- 1,34 ---- + //===-- llvm/VectorLLVM/VectorInstrinsics.h - LLVM Vector Intrinsic Function Handling ---*- C++ -*-===// + // + // The LLVM Compiler Infrastructure + // + // This file was developed by the LLVM research group and is distributed under + // the University of Illinois Open Source License. See LICENSE.TXT for details. + // + //===----------------------------------------------------------------------===// + // + // This file defines a set of enums which allow processing of + // intrinsic functions for Vector-LLVM. + // + //===----------------------------------------------------------------------===// + + #ifndef LLVM_VECTOR_INTRINSICS_H + #define LLVM_VECTOR_INTRINSICS_H + + namespace llvm { + + /// Intrinsic Namespace - This namespace contains an enum with a value for + /// every vector intrinsic/builtin function known by LLVM. + /// + namespace VectorIntrinsic { + enum ID { + not_intrinsic = 0, // Must be zero + + + }; + + } // End VectorIntrinsic namespace + + } // End llvm namespace + + #endif Index: llvm/include/VectorLLVM/VectorSignificantFunctions.h diff -c /dev/null llvm/include/VectorLLVM/VectorSignificantFunctions.h:1.1.2.1 *** /dev/null Tue Oct 18 14:35:35 2005 --- llvm/include/VectorLLVM/VectorSignificantFunctions.h Tue Oct 18 14:35:24 2005 *************** *** 0 **** --- 1,293 ---- + //===-- llvm/VectorLLVM/Instrinsics.h - LLVM Vector Significant Function Handling ---*- C++ -*-===// + // + // The LLVM Compiler Infrastructure + // + // This file was developed by the LLVM research group and is distributed under + // the University of Illinois Open Source License. See LICENSE.TXT for details. + // + //===----------------------------------------------------------------------===// + // + // This file defines a set of enums which allow processing of + // significant functions for Vector-LLVM. + // + //===----------------------------------------------------------------------===// + + #ifndef LLVM_VECTOR_SIGNIFICANT_FUNCTIONS_H + #define LLVM_VECTOR_SIGNIFICANT_FUNCTIONS_H + + #include + + namespace llvm { + + /// VectorSignificantFunctions Namespace - This namespace contains an + /// enum with a value for every vector significant function known by + /// LLVM. + /// + namespace VectorSignificantFunctions { + + #define NUM_NAMES 17 + + std::string names[NUM_NAMES] = { + "vimm", + "fixed_vimm", + "vgather", + "vscatter", + "load", + "store", + "vselect", + "extract", + "combine", + "fixed_combine", + "extractelement", + "combineelement", + "constant", + "fixed_permute", + // Older forms + "vload", + "vloadi", + "vstore" + }; + + enum ID { + not_significant = 0, // Must be zero + vimm, + fixed_vimm, + vgather, + vscatter, + load, + store, + vselect, + extract, + combine, + fixed_combine, + extractelement, + combineelement, + constant, + fixed_permute, + // Older forms + vload, + vloadi, + vstore + }; + + ID getID(std::string name) { + for (unsigned i = 0; i < NUM_NAMES; ++i) { + if (name.substr(0, 5) == "vllvm") { + if (name.substr(6, names[i].length()+1) == names[i] + '_') + return ID(i+1); + } + if (name.substr(0, names[i].length()+2) == '_'+names[i]+'_') + return ID(i+1); + } + return not_significant; + } + + /// Return true if the specified call represents a properly declared + /// vector significant function + /// + bool isProperlyDeclared(Function *F) { + std::string name = F->getName(); + const FunctionType *FTy = F->getFunctionType(); + const Type *RetTy = FTy->getReturnType(); + unsigned numParams = FTy->getNumParams(); + bool isVarArg = FTy->isVarArg(); + switch(getID(name)) { + case not_significant: + return true; + case vgather: + case vload: { + // A vload function must be a varargs function with 1 argument: + // the place to load from + // + if (numParams != 1 || !isVarArg) + return false; + const PointerType *PointerTy = + dyn_cast(FTy->getParamType(0)); + if (!PointerTy || RetTy != PointerTy->getElementType()) + return false; + break; + } + case load: { + // A fixed_vload function must have precisely 3 arguments: a + // pointer, a vector length, and an index. The pointer must + // point to the return value type. + // + if (numParams != 3 || isVarArg) + return false; + const PointerType *PointerTy = + dyn_cast(FTy->getParamType(0)); + if (!PointerTy || RetTy != PointerTy->getElementType()) + return false; + if (!FTy->getParamType(1)->isIntegral()) + return false; + if (!FTy->getParamType(2)->isIntegral()) + return false; + break; + } + case vloadi: + // A vloadi function must have precisely 2 arguments: a scalar + // and a length. It must return the type of its first argument. + // + if (numParams != 2 || isVarArg) + return false; + if (RetTy != FTy->getParamType(0)) + return false; + if (!FTy->getParamType(0)->isIntegral()) + return false; + break; + case vimm: + case fixed_vimm:{ + // A fixed_vimm must have precisely 2 arguments: a scalar and a + // vector length. It must return the type of its first + // argument. + // + if (numParams != 2 || isVarArg) + return false; + if (RetTy != FTy->getParamType(0)) + return false; + if (!FTy->getParamType(0)->isIntegral()) + return false; + break; + } + case vscatter: + case vstore: + // A vstore function must be a varargs function with 2 + // arguments: the value to store and the place to store it + // + if (numParams != 2 || !isVarArg) + return false; + if (!isa(FTy->getParamType(1))) + return false; + if (FTy->getParamType(0) != cast(FTy->getParamType(1))->getElementType()) + return false; + break; + case store: { + // A store function must have precisely 3 arguments: a value to + // store, the place to store it, and an index. The pointer must + // point to the value type. + // + if (numParams != 3 || isVarArg) + return false; + const PointerType *PointerTy = + dyn_cast(FTy->getParamType(1)); + if (!PointerTy || FTy->getParamType(0) != PointerTy->getElementType()) + return false; + if (!FTy->getParamType(2)->isIntegral()) + return false; + break; + } + case vselect: + // A vselect function must have precisely 3 arguments: an int + // (really a boolean) and two values of the same type + // + if (numParams != 3 || isVarArg) + return false; + if (FTy->getParamType(0) != Type::IntTy) + return false; + if (FTy->getParamType(1) != FTy->getParamType(2)) + return false; + break; + case extract: + // An extract function must have precisely 4 arguments: a value + // and 3 unsigned ints + // + if (numParams != 4 || isVarArg) + return false; + if (FTy->getParamType(1) != Type::UIntTy) + return false; + if (FTy->getParamType(2) != Type::UIntTy) + return false; + if (FTy->getParamType(3) != Type::UIntTy) + return false; + break; + case combine: + // A combine function must have precisely 4 arguments: two + // values of the same type and two unsigned ints + // + if (numParams != 4 || isVarArg) + return false; + if (RetTy != FTy->getParamType(0)) + return false; + if (FTy->getParamType(0) != FTy->getParamType(1)) + return false; + if (FTy->getParamType(2) != Type::UIntTy) + return false; + if (FTy->getParamType(3) != Type::UIntTy) + return false; + break; + case fixed_combine: + // A fixed_combine must have precisely 6 arguments: a value, a + // vector length, another value of the same type as the first, + // another vector length, and two unsigned ints. + // + if (numParams != 6 || isVarArg) + return false; + if (RetTy != FTy->getParamType(0)) + return false; + if (FTy->getParamType(0) != FTy->getParamType(2)) + return false; + if (FTy->getParamType(1) != Type::UIntTy) + return false; + if (FTy->getParamType(3) != Type::UIntTy) + return false; + if (FTy->getParamType(4) != Type::UIntTy) + return false; + if (FTy->getParamType(5) != Type::UIntTy) + return false; + break; + case extractelement: + // An extractelement function must have precisely 2 arguments: a + // value and an unsigned int + // + if (numParams != 2 || isVarArg) + return false; + if (FTy->getParamType(1) != Type::UIntTy) + return false; + break; + case combineelement: + // A combineelement function must have precisely 3 arguments: + // two values of the same type and two unsigned ints + // + if (numParams != 3 || isVarArg) + return false; + if (FTy->getParamType(0) != FTy->getParamType(1)) + return false; + if (FTy->getParamType(2) != Type::UIntTy) + return false; + break; + case constant: + // A constant function must be a varargs function with one + // argument. The return type must be the same as the type of + // that argument + // + if (numParams != 1 || !isVarArg) + return false; + if (RetTy != FTy->getParamType(0)) + return false; + break; + case fixed_permute: + // A fixed permute function must have four arguments: a vector, + // a length, and index vector, and a length + if (numParams != 4 || isVarArg) + return false; + if (FTy->getParamType(0) != FTy->getParamType(2)) + return false; + if (FTy->getParamType(1) != Type::UIntTy || + FTy->getParamType(3) != Type::UIntTy) + return false; + break; + // + // Newer Forms + // + default: + std::cerr << "Unknown vector significant function " << name << "!\n"; + exit(1); + } + return true; + } + + } // End VectorSignificantFunctions namespace + + } // End llvm namespace + + #endif From bocchino at cs.uiuc.edu Tue Oct 18 14:35:55 2005 From: bocchino at cs.uiuc.edu (Robert Bocchino) Date: Tue, 18 Oct 2005 14:35:55 -0500 Subject: [llvm-commits] CVS: llvm/lib/Transforms/Vector/ Message-ID: <200510181935.OAA06697@zion.cs.uiuc.edu> Changes in directory llvm/lib/Transforms/Vector: --- Log message: Directory /home/vadve/shared/PublicCVS/llvm/lib/Transforms/Vector added to the repository --> Using per-directory sticky tag `vector_llvm' --- Diffs of the changes: (+0 -0) 0 files changed From bocchino at cs.uiuc.edu Tue Oct 18 14:37:04 2005 From: bocchino at cs.uiuc.edu (Robert Bocchino) Date: Tue, 18 Oct 2005 14:37:04 -0500 Subject: [llvm-commits] [vector_llvm] CVS: llvm/lib/Target/CBackend/AltiVecCTargetMachine.h AltiVecWriter.cpp AltiVecWriter.h SSECTargetMachine.h SSEWriter.cpp SSEWriter.h Writer.h Message-ID: <200510181937.OAA06728@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/CBackend: AltiVecCTargetMachine.h added (r1.1.2.1) AltiVecWriter.cpp added (r1.1.2.1) AltiVecWriter.h added (r1.1.2.1) SSECTargetMachine.h added (r1.1.2.1) SSEWriter.cpp added (r1.1.2.1) SSEWriter.h added (r1.1.2.1) Writer.h added (r1.1.2.1) --- Log message: Initial commit of Vector LLVM. --- Diffs of the changes: (+799 -0) AltiVecCTargetMachine.h | 36 ++++++ AltiVecWriter.cpp | 206 ++++++++++++++++++++++++++++++++++++ AltiVecWriter.h | 66 +++++++++++ SSECTargetMachine.h | 36 ++++++ SSEWriter.cpp | 129 +++++++++++++++++++++++ SSEWriter.h | 57 ++++++++++ Writer.h | 269 ++++++++++++++++++++++++++++++++++++++++++++++++ 7 files changed, 799 insertions(+) Index: llvm/lib/Target/CBackend/AltiVecCTargetMachine.h diff -c /dev/null llvm/lib/Target/CBackend/AltiVecCTargetMachine.h:1.1.2.1 *** /dev/null Tue Oct 18 14:37:02 2005 --- llvm/lib/Target/CBackend/AltiVecCTargetMachine.h Tue Oct 18 14:36:52 2005 *************** *** 0 **** --- 1,36 ---- + //===-- CTargetMachine.h - TargetMachine for the C backend ------*- C++ -*-===// + // + // The LLVM Compiler Infrastructure + // + // This file was developed by the LLVM research group and is distributed under + // the University of Illinois Open Source License. See LICENSE.TXT for details. + // + //===----------------------------------------------------------------------===// + // + // This file declares the TargetMachine that is used by the AltiVec C backend. + // + //===----------------------------------------------------------------------===// + + #ifndef ALTIVECCTARGETMACHINE_H + #define ALTIVECCTARGETMACHINE_H + + #include "CTargetMachine.h" + + namespace llvm { + + class IntrinsicLowering; + + struct AltiVecCTargetMachine : public CTargetMachine { + AltiVecCTargetMachine(const Module &M, IntrinsicLowering *IL, const std::string& name) : + CTargetMachine(M, IL, "AltiVecCBackend") {} + + // This is the only thing that actually does anything here. + bool addPassesToEmitFile(PassManager &PM, std::ostream &Out, + CodeGenFileType FileType); + + }; + + } // End llvm namespace + + + #endif Index: llvm/lib/Target/CBackend/AltiVecWriter.cpp diff -c /dev/null llvm/lib/Target/CBackend/AltiVecWriter.cpp:1.1.2.1 *** /dev/null Tue Oct 18 14:37:03 2005 --- llvm/lib/Target/CBackend/AltiVecWriter.cpp Tue Oct 18 14:36:52 2005 *************** *** 0 **** --- 1,206 ---- + //===-- Writer.cpp - Library for converting LLVM code to C ----------------===// + // + // The LLVM Compiler Infrastructure + // + // This file was developed by the LLVM research group and is distributed under + // the University of Illinois Open Source License. See LICENSE.TXT for details. + // + //===----------------------------------------------------------------------===// + // + // This library converts LLVM code to C code with AltiVec extensions. + // + //===----------------------------------------------------------------------===// + + #include "AltiVecCTargetMachine.h" + #include "AltiVecWriter.h" + + using namespace llvm; + + namespace { + // Register the target. + RegisterTarget X("altivec-c", " AltiVec C backend"); + } + + static void badValue(Value *V) { + std::cerr << "AltiVec C Backend can't handle this value!\n"; + std::cerr << *V << "\n"; + abort(); + } + + void AltiVecCWriter::printConstant(Constant *CPV) { + if (!isa(CPV->getType())) { + CWriter::printConstant(CPV); + return; + } + if (const ConstantExpr *CE = dyn_cast(CPV)) { + switch (CE->getOpcode()) { + case Instruction::Cast: + Out << "(("; + printType(Out, CPV->getType()); + Out << ") ("; + printConstant(CE->getOperand(0)); + Out << "))"; + return; + default: + badValue(CPV); + } + } + // FIXME: Add support for literal vector constants here + // + Out << "(("; + printType(Out, CPV->getType()); + Out << ") ("; + for (unsigned i = 0; i < CPV->getNumOperands()-1; ++i) { + printConstant(CPV->getOperand(i)); + Out << ", "; + } + printConstant(CPV->getOperand(CPV->getNumOperands()-1)); + Out << "))"; + return; + + } + + void AltiVecCWriter::visitCastInst (CastInst &I) { + if (!isa(I.getType()) || + isa(I.getOperand(0)->getType())) + return CWriter::visitCastInst(I); + if (!isa(I.getOperand(0))) { + std::cerr << I; + std::cerr << "AltiVec C Backend can handle only cast of constant to vector!\n"; + exit(1); + } + Out << '('; + printType(Out, I.getType()); + Out << ") ("; + writeOperand(I.getOperand(0)); + Out << ')'; + } + + void AltiVecCWriter::visitVImmInst (VImmInst &VL) { + if (!isa(VL.getOperand(0))) { + std::cerr << VL; + std::cerr << "AltiVec C Backend can handle only vimm of constant!\n"; + exit(1); + } + Out << '('; + printType(Out, VL.getType()); + Out << ") ("; + writeOperand(VL.getOperand(0)); + Out << ')'; + } + + void AltiVecCWriter::visitBinaryOperator(Instruction &I) { + if (!isa(I.getType())) + return CWriter::visitBinaryOperator(I); + switch(I.getOpcode()) { + case Instruction::Add: + // Check for mladd pattern + // + if (BinaryOperator *BO = dyn_cast(I.getOperand(0))) { + if (BO->getOpcode() == Instruction::Mul) { + Out << "vec_mladd("; + writeOperand(BO->getOperand(0)); + Out << ","; + writeOperand(BO->getOperand(1)); + Out << ","; + writeOperand(I.getOperand(1)); + Out << ")"; + break; + } + } + Out << "vec_add("; + writeOperand(I.getOperand(0)); + Out << ","; + writeOperand(I.getOperand(1)); + Out << ")"; + break; + case Instruction::Mul: + Out << "vec_mladd("; + writeOperand(I.getOperand(0)); + Out << ","; + writeOperand(I.getOperand(1)); + Out << ",(vector short)(0))"; + break; + case Instruction::And: + Out << "vec_and("; + writeOperand(I.getOperand(0)); + Out << ","; + writeOperand(I.getOperand(1)); + Out << ")"; + break; + default: + std::cerr << "AltiVec C Backend can't handle this instruction:\n" << I; + exit(1); + } + } + + std::ostream &AltiVecCWriter::printFixedVectorType(std::ostream &Out, + const FixedVectorType *Ty, + const std::string &VariableName) { + unsigned numElements = Ty->getNumElements(); + switch(Ty->getElementType()->getTypeID()) { + case(Type::SByteTyID): + if (numElements != 16) { + std::cerr << "Vector of sbyte must have 16 elements!\n"; + exit(1); + } + Out << "vector signed char " << VariableName; + break; + case (Type::UByteTyID): + if (numElements != 16) { + std::cerr << "Vector of ubyte must have 16 elements!\n"; + exit(1); + } + Out << "vector unsigned char " << VariableName; + break; + case(Type::ShortTyID): + if (numElements != 8) { + std::cerr << "Vector of short must have 8 elements!\n"; + exit(1); + } + Out << "vector signed short " << VariableName; + break; + case(Type::UShortTyID): + if (numElements != 8) { + std::cerr << "Vector of ushort must have 8 elements!\n"; + exit(1); + } + Out << "vector unsigned short " << VariableName; + break; + case(Type::BoolTyID): + switch(numElements) { + case 8: + Out << "vector bool short "; + break; + default: + std::cerr << "AltiVec C Backend cannot handle boolean vector with " + << numElements << " elements!\n"; + break; + } + Out << VariableName; + break; + default: + std::cerr << "AltiVec C Backend cannot handle " << Ty->getDescription() << "!\n"; + exit(1); + break; + } + return Out; + } + + + //===----------------------------------------------------------------------===// + // External Interface declaration + //===----------------------------------------------------------------------===// + + bool AltiVecCTargetMachine::addPassesToEmitFile(PassManager &PM, std::ostream &o, + CodeGenFileType FileType) { + if (FileType != TargetMachine::AssemblyFile) return true; + // Add lowervectors pass here to lower variable-length vectors, which we can't handle + PM.add(createLowerGCPass()); + PM.add(createLowerAllocationsPass(true)); + PM.add(createLowerInvokePass()); + PM.add(new CBackendNameAllUsedStructs()); + PM.add(new AltiVecCWriter(o, getIntrinsicLowering())); + return false; + } + Index: llvm/lib/Target/CBackend/AltiVecWriter.h diff -c /dev/null llvm/lib/Target/CBackend/AltiVecWriter.h:1.1.2.1 *** /dev/null Tue Oct 18 14:37:03 2005 --- llvm/lib/Target/CBackend/AltiVecWriter.h Tue Oct 18 14:36:52 2005 *************** *** 0 **** --- 1,66 ---- + //===---------------- Writer.h - C backend interface ------------*- C++ -*-===// + // + // The LLVM Compiler Infrastructure + // + // This file was developed by the LLVM research group and is distributed under + // the University of Illinois Open Source License. See LICENSE.TXT for details. + // + //===----------------------------------------------------------------------===// + // + // This file exposes the interface that is common to all C backends. + // + //===----------------------------------------------------------------------===// + + #ifndef ALTIVECCWRITER_H + #define ALTIVECCWRITER_H + + #include "Writer.h" + + using namespace llvm; + + namespace llvm { + /// AltiVecCWriter - This class is the main chunk of code that + /// converts an LLVM module to an AltiVec/C translation unit. + class AltiVecCWriter : public CWriter { + void printConstant(Constant *CPV); + void visitCastInst(CastInst &I); + void visitVImmInst(VImmInst &I); + void visitBinaryOperator(Instruction &I); + + public: + AltiVecCWriter(std::ostream &o, IntrinsicLowering &il) : + CWriter(o,il) {} + + void writeValueName(Value *V) { + std::string name = Mang->getValueName(V); + if (name.substr(0,8) == "altivec_") { + unsigned pos = name.find("_", 8); + if (pos == std::string::npos) { + std::cerr << "Bad syntax for AltiVec intrinsic " << name << "\n"; + exit(1); + } + // C name is vec_xxx + Out << name.substr(4, pos-4); + } else { + CWriter::writeValueName(V); + } + } + + bool printDeclarationFor(Function *F) { + if (F->getName().substr(0, 7) == "altivec") + return false; + return CWriter::printDeclarationFor(F); + } + virtual const char *getPassName() const { return "AltiVec C backend"; } + + std::ostream &printFixedVectorType(std::ostream &Out, + const FixedVectorType *Ty, + const std::string &VariableName = ""); + + }; + } + + + + #endif + Index: llvm/lib/Target/CBackend/SSECTargetMachine.h diff -c /dev/null llvm/lib/Target/CBackend/SSECTargetMachine.h:1.1.2.1 *** /dev/null Tue Oct 18 14:37:03 2005 --- llvm/lib/Target/CBackend/SSECTargetMachine.h Tue Oct 18 14:36:52 2005 *************** *** 0 **** --- 1,36 ---- + //===-- CTargetMachine.h - TargetMachine for the C backend ------*- C++ -*-===// + // + // The LLVM Compiler Infrastructure + // + // This file was developed by the LLVM research group and is distributed under + // the University of Illinois Open Source License. See LICENSE.TXT for details. + // + //===----------------------------------------------------------------------===// + // + // This file declares the TargetMachine that is used by the SSE C backend. + // + //===----------------------------------------------------------------------===// + + #ifndef SSECTARGETMACHINE_H + #define SSECTARGETMACHINE_H + + #include "CTargetMachine.h" + + namespace llvm { + + class IntrinsicLowering; + + struct SSECTargetMachine : public CTargetMachine { + SSECTargetMachine(const Module &M, IntrinsicLowering *IL, const std::string& name) : + CTargetMachine(M, IL, "SSECBackend") {} + + // This is the only thing that actually does anything here. + bool addPassesToEmitFile(PassManager &PM, std::ostream &Out, + CodeGenFileType FileType); + + }; + + } // End llvm namespace + + + #endif Index: llvm/lib/Target/CBackend/SSEWriter.cpp diff -c /dev/null llvm/lib/Target/CBackend/SSEWriter.cpp:1.1.2.1 *** /dev/null Tue Oct 18 14:37:03 2005 --- llvm/lib/Target/CBackend/SSEWriter.cpp Tue Oct 18 14:36:52 2005 *************** *** 0 **** --- 1,129 ---- + //===-- Writer.cpp - Library for converting LLVM code to C ----------------===// + // + // The LLVM Compiler Infrastructure + // + // This file was developed by the LLVM research group and is distributed under + // the University of Illinois Open Source License. See LICENSE.TXT for details. + // + //===----------------------------------------------------------------------===// + // + // This library converts LLVM code to C code with SSE extensions. + // + //===----------------------------------------------------------------------===// + + #include "SSECTargetMachine.h" + #include "SSEWriter.h" + + using namespace llvm; + + namespace { + // Register the target. + RegisterTarget X("sse-c", " SSE C backend"); + } + + static void badValue(Value *V) { + std::cerr << "SSE C Backend can't handle this value!\n"; + std::cerr << *V << "\n"; + abort(); + } + + void SSECWriter::printConstant(Constant *CPV) { + if (!isa(CPV->getType())) { + CWriter::printConstant(CPV); + return; + } + if (const ConstantExpr *CE = dyn_cast(CPV)) { + switch (CE->getOpcode()) { + case Instruction::Cast: + Out << "(("; + printType(Out, CPV->getType()); + Out << ") ("; + printConstant(CE->getOperand(0)); + Out << "))"; + return; + default: + badValue(CPV); + } + } + // FIXME: Add support for literal vector constants here + // + Out << "(("; + printType(Out, CPV->getType()); + Out << ") ("; + for (unsigned i = 0; i < CPV->getNumOperands()-1; ++i) { + printConstant(CPV->getOperand(i)); + Out << ", "; + } + printConstant(CPV->getOperand(CPV->getNumOperands()-1)); + Out << "))"; + return; + + } + + void SSECWriter::visitCastInst (CastInst &I) { + if (!isa(I.getType()) || + isa(I.getOperand(0)->getType())) + return CWriter::visitCastInst(I); + std::cerr << I; + std::cerr << "SSE C Backend cannot handle this cast!\n"; + } + + void SSECWriter::visitBinaryOperator(Instruction &I) { + if (!isa(I.getType())) + return CWriter::visitBinaryOperator(I); + switch(I.getOpcode()) { + case Instruction::Add: + Out << "_mm_add_epi16("; + writeOperand(I.getOperand(0)); + Out << ","; + writeOperand(I.getOperand(1)); + Out << ")"; + break; + case Instruction::Mul: + Out << "_mm_mullo_epi16("; + writeOperand(I.getOperand(0)); + Out << ","; + writeOperand(I.getOperand(1)); + Out << ")"; + break; + case Instruction::And: + Out << "_mm_and_si128("; + writeOperand(I.getOperand(0)); + Out << ","; + writeOperand(I.getOperand(1)); + Out << ")"; + break; + default: + std::cerr << "SSE C Backend can't handle this instruction:\n" << I; + exit(1); + } + } + + std::ostream &SSECWriter::printFixedVectorType(std::ostream &Out, + const FixedVectorType *Ty, + const std::string &VariableName) { + if (Ty->isIntegralVector()) { + Out << "__m128i " << VariableName; + } else { + std::cerr << "SSE C Backend cannot handle type!\n" << Ty->getDescription() << "\n"; + exit(1); + } + return Out; + } + + + //===----------------------------------------------------------------------===// + // External Interface declaration + //===----------------------------------------------------------------------===// + + bool SSECTargetMachine::addPassesToEmitFile(PassManager &PM, std::ostream &o, + CodeGenFileType FileType) { + if (FileType != TargetMachine::AssemblyFile) return true; + // Add lowervectors pass here to lower variable-length vectors, which we can't handle + PM.add(createLowerGCPass()); + PM.add(createLowerAllocationsPass(true)); + PM.add(createLowerInvokePass()); + PM.add(new CBackendNameAllUsedStructs()); + PM.add(new SSECWriter(o, getIntrinsicLowering())); + return false; + } Index: llvm/lib/Target/CBackend/SSEWriter.h diff -c /dev/null llvm/lib/Target/CBackend/SSEWriter.h:1.1.2.1 *** /dev/null Tue Oct 18 14:37:03 2005 --- llvm/lib/Target/CBackend/SSEWriter.h Tue Oct 18 14:36:52 2005 *************** *** 0 **** --- 1,57 ---- + //===---------------- Writer.h - C backend interface ------------*- C++ -*-===// + // + // The LLVM Compiler Infrastructure + // + // This file was developed by the LLVM research group and is distributed under + // the University of Illinois Open Source License. See LICENSE.TXT for details. + // + //===----------------------------------------------------------------------===// + // + // This file exposes the interface that is common to all C backends. + // + //===----------------------------------------------------------------------===// + + #ifndef SSECWRITER_H + #define SSECWRITER_H + + #include "Writer.h" + + using namespace llvm; + + namespace llvm { + /// SSECWriter - This class is the main chunk of code that + /// converts an LLVM module to an SSE/C translation unit. + class SSECWriter : public CWriter { + void printConstant(Constant *CPV); + void visitCastInst (CastInst &I); + void visitBinaryOperator(Instruction &I); + + public: + SSECWriter(std::ostream &o, IntrinsicLowering &il) : + CWriter(o,il) {} + + // Provide declaration for SSE intrinsics + // + bool doInitialization(Module &M) { + Out << "#include \"SSE.h\"\n"; + return CWriter::doInitialization(M); + } + + bool printDeclarationFor(Function *F) { + if (F->getName().substr(0, 4) == "_mm_") + return false; + return CWriter::printDeclarationFor(F); + } + virtual const char *getPassName() const { return "SSE C backend"; } + + std::ostream &printFixedVectorType(std::ostream &Out, + const FixedVectorType *Ty, + const std::string &VariableName = ""); + + }; + } + + + + #endif + Index: llvm/lib/Target/CBackend/Writer.h diff -c /dev/null llvm/lib/Target/CBackend/Writer.h:1.1.2.1 *** /dev/null Tue Oct 18 14:37:03 2005 --- llvm/lib/Target/CBackend/Writer.h Tue Oct 18 14:36:52 2005 *************** *** 0 **** --- 1,269 ---- + //===---------------- Writer.h - C backend interface ------------*- C++ -*-===// + // + // The LLVM Compiler Infrastructure + // + // This file was developed by the LLVM research group and is distributed under + // the University of Illinois Open Source License. See LICENSE.TXT for details. + // + //===----------------------------------------------------------------------===// + // + // This file exposes the interface that is common to all C backends. + // + //===----------------------------------------------------------------------===// + + #ifndef CWRITER_H + #define CWRITER_H + + #include "llvm/Constants.h" + #include "llvm/DerivedTypes.h" + #include "llvm/Module.h" + #include "llvm/Instructions.h" + #include "llvm/Pass.h" + #include "llvm/PassManager.h" + #include "llvm/SymbolTable.h" + #include "llvm/Intrinsics.h" + #include "llvm/Analysis/ConstantsScanner.h" + #include "llvm/Analysis/FindUsedTypes.h" + #include "llvm/Analysis/LoopInfo.h" + #include "llvm/CodeGen/IntrinsicLowering.h" + #include "llvm/Transforms/Scalar.h" + #include "llvm/Target/TargetMachineRegistry.h" + #include "llvm/Support/CallSite.h" + #include "llvm/Support/CFG.h" + #include "llvm/Support/GetElementPtrTypeIterator.h" + #include "llvm/Support/InstVisitor.h" + #include "llvm/Support/Mangler.h" + #include "llvm/ADT/StringExtras.h" + #include "llvm/ADT/STLExtras.h" + #include "llvm/Support/MathExtras.h" + #include "llvm/Config/config.h" + #include + #include + #include + + using namespace llvm; + + namespace llvm { + /// NameAllUsedStructs - This pass inserts names for any unnamed structure + /// types that are used by the program. + /// + class CBackendNameAllUsedStructs : public ModulePass { + void getAnalysisUsage(AnalysisUsage &AU) const { + AU.addRequired(); + } + + virtual const char *getPassName() const { + return "C backend type canonicalizer"; + } + + virtual bool runOnModule(Module &M); + }; + + /// CWriter - This class is the main chunk of code that converts an LLVM + /// module to a C translation unit. + class CWriter : public FunctionPass, public InstVisitor { + protected: + std::ostream &Out; + IntrinsicLowering &IL; + Mangler *Mang; + LoopInfo *LI; + const Module *TheModule; + std::map TypeNames; + + std::map FPConstantMap; + public: + CWriter(std::ostream &o, IntrinsicLowering &il) : Out(o), IL(il) {} + + virtual const char *getPassName() const { return "C backend"; } + + void getAnalysisUsage(AnalysisUsage &AU) const { + AU.addRequired(); + AU.setPreservesAll(); + } + + virtual bool printDeclarationFor(Function *F); + virtual bool doInitialization(Module &M); + + bool runOnFunction(Function &F) { + LI = &getAnalysis(); + + // Get rid of intrinsics we can't handle. + lowerIntrinsics(F); + + // Output all floating point constants that cannot be printed accurately. + printFloatingPointConstants(F); + + // Ensure that no local symbols conflict with global symbols. + F.renameLocalSymbols(); + + printFunction(F); + FPConstantMap.clear(); + return false; + } + + virtual bool doFinalization(Module &M) { + // Free memory... + delete Mang; + TypeNames.clear(); + return false; + } + + std::ostream &printType(std::ostream &Out, const Type *Ty, + const std::string &VariableName = "", + bool IgnoreName = false); + + // Methods for printing vector types; these can be overridden by + // target-specific subclasses (AltiVec, SSE, etc.) + // + virtual std::ostream &printFixedVectorType(std::ostream &Out, + const FixedVectorType *Ty, + const std::string &VariableName = "") { + // FIXME: Insert lowering so this never happens + // + std::cerr << "Backend cannot handle vector types!\n"; + exit(1); + } + + virtual std::ostream &printVectorType(std::ostream &Out, + const VectorType *Ty, + const std::string &VariableName = "") { + // FIXME: Insert lowering so this never happens + // + std::cerr << "Backend cannot handle vector types!\n"; + exit(1); + } + + virtual void writeValueName(Value *V); + void writeOperand(Value *Operand); + void writeOperandInternal(Value *Operand); + + protected: + void lowerIntrinsics(Function &F); + + bool nameAllUsedStructureTypes(Module &M); + void printModule(Module *M); + void printModuleTypes(const SymbolTable &ST); + void printContainedStructs(const Type *Ty, std::set &); + void printFloatingPointConstants(Function &F); + void printFunctionSignature(const Function *F, bool Prototype); + + void printFunction(Function &); + void printBasicBlock(BasicBlock *BB); + void printLoop(Loop *L); + + virtual void printConstant(Constant *CPV); + void printConstantArray(ConstantArray *CPA); + + // isInlinableInst - Attempt to inline instructions into their uses to build + // trees as much as possible. To do this, we have to consistently decide + // what is acceptable to inline, so that variable declarations don't get + // printed and an extra copy of the expr is not emitted. + // + static bool isInlinableInst(const Instruction &I) { + // Always inline setcc instructions, even if they are shared by multiple + // expressions. GCC generates horrible code if we don't. + if (isa(I)) return true; + + // Must be an expression, must be used exactly once. If it is dead, we + // emit it inline where it would go. + if (I.getType() == Type::VoidTy || !I.hasOneUse() || + isa(I) || isa(I) || isa(I) || + isa(I) || isa(I)) + // Don't inline a load across a store or other bad things! + return false; + + // Only inline instruction if its use is in the same BB as the inst. + return I.getParent() == cast(I.use_back())->getParent(); + } + + static const bool isSafeUse(const Value *user, const Value *use) { + if (isa(user)) + return true; + if (const StoreInst *SI = dyn_cast(user)) + return (use == SI->getOperand(1)); + if (isa(user)) { + return isSafeUser(user); + } + return false; + } + + static const bool isSafeUser(const Value *user) { + for (User::use_const_iterator I = user->use_begin(), + E = user->use_end(); I != E; ++I) + if (!isSafeUse(*I, user)) + return false; + return true; + } + + // isDirectAlloca - Define fixed sized allocas in the entry block + // as direct variables which are accessed with the & operator. + // This causes GCC to generate significantly better code than to + // emit alloca calls directly. + // + static const AllocaInst *isDirectAlloca(const Value *V) { + const AllocaInst *AI = dyn_cast(V); + if (!AI) return false; + if (AI->isArrayAllocation()) + return 0; // FIXME: we can also inline fixed size array allocas! + if (AI->getParent() != &AI->getParent()->getParent()->getEntryBlock()) + if (!isSafeUser(AI)) + return 0; + return AI; + } + + // Instruction visitation functions + friend class InstVisitor; + + void visitReturnInst(ReturnInst &I); + void visitBranchInst(BranchInst &I); + void visitSwitchInst(SwitchInst &I); + void visitInvokeInst(InvokeInst &I) { + assert(0 && "Lowerinvoke pass didn't work!"); + } + + void visitUnwindInst(UnwindInst &I) { + assert(0 && "Lowerinvoke pass didn't work!"); + } + void visitUnreachableInst(UnreachableInst &I); + + void visitPHINode(PHINode &I); + virtual void visitBinaryOperator(Instruction &I); + + virtual void visitCastInst (CastInst &I); + virtual void visitVImmInst(VImmInst &VL) { visitInstruction(VL); } + void visitSelectInst(SelectInst &I); + void visitCallInst (CallInst &I); + void visitShiftInst(ShiftInst &I) { visitBinaryOperator(I); } + + void visitMallocInst(MallocInst &I); + void visitAllocaInst(AllocaInst &I); + void visitFreeInst (FreeInst &I); + void visitLoadInst (LoadInst &I); + void visitStoreInst (StoreInst &I); + void visitGetElementPtrInst(GetElementPtrInst &I); + //void visitVANextInst(VANextInst &I); + void visitVAArgInst (VAArgInst &I); + + void visitInstruction(Instruction &I) { + std::cerr << "C Writer does not know about " << I; + abort(); + } + + void outputLValue(Instruction *I) { + Out << " " << Mang->getValueName(I) << " = "; + } + + bool isGotoCodeNecessary(BasicBlock *From, BasicBlock *To); + void printPHICopiesForSuccessor(BasicBlock *CurBlock, + BasicBlock *Successor, unsigned Indent); + void printBranchToBlock(BasicBlock *CurBlock, BasicBlock *SuccBlock, + unsigned Indent); + void printIndexingExpression(Value *Ptr, gep_type_iterator I, + gep_type_iterator E); + }; + } + + + + #endif + From bocchino at cs.uiuc.edu Tue Oct 18 14:37:14 2005 From: bocchino at cs.uiuc.edu (Robert Bocchino) Date: Tue, 18 Oct 2005 14:37:14 -0500 Subject: [llvm-commits] [vector_llvm] CVS: llvm/lib/Transforms/Vector/Alloca2Realloc.cpp AltiVec.cpp LowerVectors.cpp RaiseVectors.cpp SSE.cpp Message-ID: <200510181937.OAA06744@zion.cs.uiuc.edu> Changes in directory llvm/lib/Transforms/Vector: Alloca2Realloc.cpp added (r1.1.2.1) AltiVec.cpp added (r1.1.2.1) LowerVectors.cpp added (r1.1.2.1) RaiseVectors.cpp added (r1.1.2.1) SSE.cpp added (r1.1.2.1) --- Log message: Initial commit of Vector LLVM. --- Diffs of the changes: (+2978 -0) Alloca2Realloc.cpp | 212 ++++++++++ AltiVec.cpp | 530 ++++++++++++++++++++++++++ LowerVectors.cpp | 1059 +++++++++++++++++++++++++++++++++++++++++++++++++++++ RaiseVectors.cpp | 594 +++++++++++++++++++++++++++++ SSE.cpp | 583 +++++++++++++++++++++++++++++ 5 files changed, 2978 insertions(+) Index: llvm/lib/Transforms/Vector/Alloca2Realloc.cpp diff -c /dev/null llvm/lib/Transforms/Vector/Alloca2Realloc.cpp:1.1.2.1 *** /dev/null Tue Oct 18 14:37:13 2005 --- llvm/lib/Transforms/Vector/Alloca2Realloc.cpp Tue Oct 18 14:37:03 2005 *************** *** 0 **** --- 1,212 ---- + //===- Alloca2Realloc.cpp - Replace allocas with realloc inside loops -----===// + // + // The LLVM Compiler Infrastructure + // + // This file was developed by the LLVM research group and is distributed under + // the University of Illinois Open Source License. See LICENSE.TXT for details. + // + //===----------------------------------------------------------------------===// + // + // This file replaces alloca instructions with calls to the C library + // function realloc inside loops, in order to conserve memory and + // prevent stack overflow. The replacement is done only if the + // pointer resulting from the alloca is never stored to memory or + // passed as an argument to a function. In this case, the replacement + // is safe: because LLVM is in SSA form, any subsequent execution of + // the same alloca must overwrite the old pointer. + // + //===----------------------------------------------------------------------===// + + #define DEBUG_TYPE "alloca2realloc" + + #include "llvm/Analysis/LoopInfo.h" + #include "llvm/BasicBlock.h" + #include "llvm/Constants.h" + #include "llvm/Function.h" + #include "llvm/Instructions.h" + #include "llvm/Module.h" + #include "llvm/Pass.h" + #include "llvm/DerivedTypes.h" + #include "llvm/Support/Debug.h" + + using namespace llvm; + + namespace { + + + //===----------------------------------------------------------------------===// + // Class definitions + //===----------------------------------------------------------------------===// + + class Alloca2Realloc : public FunctionPass { + + Function *ReallocFunc; + bool changed; + Function *function; + LoopInfo *LI; + + public: + /// This transformation requires natural loop information + /// + virtual void getAnalysisUsage(AnalysisUsage &AU) const { + AU.setPreservesCFG(); + AU.addRequired(); + } + virtual bool doInitialization(Module &M); + virtual bool runOnFunction(Function &F); + + private: + void visitLoop(Loop*); + bool processAlloca(AllocaInst*); + bool isSafe(Value*); + }; + + RegisterOpt X("alloca2realloc", + "Replace alloca with realloc inside loops"); + + + //===----------------------------------------------------------------------===// + // Alloca2Realloc implementation + //===----------------------------------------------------------------------===// + + bool Alloca2Realloc::doInitialization(Module &M) { + const Type *SBPTy = PointerType::get(Type::SByteTy); + ReallocFunc = M.getNamedFunction("realloc"); + + if (ReallocFunc == 0) + ReallocFunc = M.getOrInsertFunction("realloc", SBPTy, SBPTy, Type::UIntTy, 0); + + return true; + } + + bool Alloca2Realloc::runOnFunction(Function &F) { + changed = false; + function = &F; + assert(ReallocFunc && "Pass not initialized!"); + + // Get loop information + // + LI = &getAnalysis(); + + // Process each top-level loop + // + for (LoopInfo::iterator I = LI->begin(), E = LI->end(); I != E; ++I) { + visitLoop(*I); + } + return changed; + } + + void Alloca2Realloc::visitLoop(Loop *L) { + // Recurse through all subloops before we process this loop... + // + for (Loop::iterator I = L->begin(), E = L->end(); I != E; ++I) { + visitLoop(*I); + } + + // Now do this loop + // + for (std::vector::const_iterator BI = L->getBlocks().begin(), + BE = L->getBlocks().end(); BI != BE; ++BI) { + BasicBlock *BB = *BI; + if (LI->getLoopFor(BB) == L) { // Ignore blocks in subloops... + BasicBlock::InstListType &BBIL = BB->getInstList(); + for (BasicBlock::iterator II = BB->begin(), IE = BB->end(); II != IE; ++II) { + if (AllocaInst *AI = dyn_cast(II)) { + if (processAlloca(AI)) { + II = --BBIL.erase(II); // remove and delete the alloca instruction + changed = true; + } + } + } + } + } + + } + + // Process an alloca instruction. Return true if the alloca was + // replaced with a realloc, false otherwise. + // + bool Alloca2Realloc::processAlloca(AllocaInst *AI) { + DEBUG(std::cerr << "Processing " << *AI); + if (!isSafe(AI)) { + DEBUG(std::cerr << "Instruction is not safe to replace!\n"); + return false; + } + DEBUG(std::cerr << "Replacing instruction\n"); + Instruction *before = &(function->getEntryBlock().front()); + Value *loadStorePtr = new AllocaInst(AI->getType(), 0, "loadstore_ptr", before); + new StoreInst(Constant::getNullValue(AI->getType()), loadStorePtr, before); + + const FunctionType *ReallocFTy = ReallocFunc->getFunctionType(); + + // Create the vector of arguments to realloc + // + Value *reallocPtr = new LoadInst(loadStorePtr, "realloc_ptr", AI); + if (reallocPtr->getType() != ReallocFTy->getParamType(0)) { + reallocPtr = new CastInst(reallocPtr, ReallocFTy->getParamType(0), "cast", AI); + } + + Value *reallocSize = + BinaryOperator::create(Instruction::Mul, AI->getArraySize(), + ConstantUInt::get(Type::UIntTy, + AI->getAllocatedType()->getPrimitiveSize()), + "size", AI); + if (reallocSize->getType() != ReallocFTy->getParamType(1)) { + reallocSize = new CastInst(reallocSize, ReallocFTy->getParamType(1), "cast", AI); + } + + std::vector ReallocArgs; + ReallocArgs.push_back(reallocPtr); + ReallocArgs.push_back(reallocSize); + + // Create the call to realloc + // + CallInst *call = new CallInst(ReallocFunc, ReallocArgs, AI->getName(), AI); + + // Create a cast instruction to convert to the right type... + // + Value *newVal = call; + if (call->getType() == Type::VoidTy) + newVal = Constant::getNullValue(AI->getType()); + else if (call->getType() != AI->getType()) + newVal = new CastInst(call, AI->getType(), "cast", AI); + + // Replace all uses of the old malloc inst with the cast inst + // + AI->replaceAllUsesWith(newVal); + + // Insert a free instruction before every return + // + for (Function::iterator FI = function->begin(), FE = function->end(); + FI != FE; ++FI) { + if (ReturnInst *RI = dyn_cast(FI->getTerminator())) { + LoadInst *freePtr = new LoadInst(loadStorePtr, "free_ptr", RI); + new FreeInst(freePtr, RI); + } + } + + return true; + } + + // Return true if the given value is never used in a store or call + // instruction, false otherwise + // + bool Alloca2Realloc::isSafe(Value *V) { + for (Value::use_iterator I = V->use_begin(), E = V->use_end(); + I != E; ++I) { + if (isa(*I)) { + DEBUG(std::cerr << "Followed chain of uses to " << **I); + return false; + } + StoreInst *SI = dyn_cast(*I); + if (SI && V == SI->getOperand(0)) { + DEBUG(std::cerr << "Followed chain of uses to " << *SI); + return false; + } + if (!isa(*I) && !isSafe(*I)) + return false; + } + return true; + } + + } Index: llvm/lib/Transforms/Vector/AltiVec.cpp diff -c /dev/null llvm/lib/Transforms/Vector/AltiVec.cpp:1.1.2.1 *** /dev/null Tue Oct 18 14:37:14 2005 --- llvm/lib/Transforms/Vector/AltiVec.cpp Tue Oct 18 14:37:03 2005 *************** *** 0 **** --- 1,530 ---- + //===- AltiVec.cpp - Raise significant functions to Vector-LLVM ------===// + // + // The LLVM Compiler Infrastructure + // + // This file was developed by the LLVM research group and is distributed under + // the University of Illinois Open Source License. See LICENSE.TXT for details. + // + //===----------------------------------------------------------------------===// + // + // This file takes blocked Vector-LLVM code and puts it in a form that + // can be passed to the AltiVec C Backend. + // + //===----------------------------------------------------------------------===// + + #define DEBUG_TYPE "altivec" + + #include "VectorLLVM/Utils.h" + #include "llvm/Constants.h" + #include "llvm/DerivedTypes.h" + #include "llvm/Function.h" + #include "llvm/Instructions.h" + #include "llvm/Pass.h" + #include "llvm/Type.h" + #include "llvm/Support/Debug.h" + #include "llvm/ADT/hash_map" + #include "llvm/ADT/hash_set" + #include "llvm/ADT/STLExtras.h" + #include "llvm/Support/InstVisitor.h" + #include "VectorLLVM/Utils.h" + + using namespace llvm; + + namespace { + + + //===----------------------------------------------------------------------===// + // Class definitions + //===----------------------------------------------------------------------===// + + class AltiVec : public FunctionPass, public InstVisitor { + + public: + bool runOnFunction(Function &F); + void visitCastInst(CastInst &); + void visitVImmInst(VImmInst &); + void visitExtractInst(ExtractInst &); + void visitCombineInst(CombineInst &); + void visitVSelectInst(VSelectInst &); + void visitShiftInst(ShiftInst &); + void visitMul(BinaryOperator &BO); + void visitSub(BinaryOperator &BO); + void visitSetCondInst(SetCondInst &BO); + void visitCallInst(CallInst &); + void visitInstruction(Instruction& I) {} + + private: + bool changed; + hash_set instructionsToDelete; + + void deleteInstructions() { + for (hash_set::iterator I = instructionsToDelete.begin(), + E = instructionsToDelete.end(); I != E; ++I) { + (*I)->dropAllReferences(); + } + for (hash_set::iterator I = instructionsToDelete.begin(), + E = instructionsToDelete.end(); I != E; ++I) { + (*I)->getParent()->getInstList().erase(*I); + } + } + }; + + RegisterOpt X("altivec", + "AltiVec code generation pre-pass"); + + //===----------------------------------------------------------------------===// + // Helper functions + //===----------------------------------------------------------------------===// + + /// Check whether the type is one that AltiVec can handle; if not, + /// it must be lowered later. + /// + bool isProperType(const VectorType *VT) { + // Only fixed vector types are allowed + // + const FixedVectorType *FVT = dyn_cast(VT); + if (!FVT) return false; + switch(VT->getElementType()->getTypeID()) { + case (Type::IntTyID): + case (Type::UIntTyID): + return FVT->getNumElements() == 4; + case (Type::ShortTyID): + case (Type::UShortTyID): + return FVT->getNumElements() == 8; + case (Type::SByteTyID): + case (Type::UByteTyID): + return FVT->getNumElements() == 16; + default: + return false; + } + } + + std::string getAltiVecName(const std::string& baseName, const VectorType *VT) { + return "altivec_" + baseName + "_" + VT->getElementType()->getDescription(); + } + + + //===----------------------------------------------------------------------===// + // AltiVec implementation + //===----------------------------------------------------------------------===// + + /// Main function called by PassManager + /// + bool AltiVec::runOnFunction(Function &F) { + instructionsToDelete.clear(); + changed = false; + for (Function::iterator FI = F.begin(), FE = F.end(); + FI != FE; ++FI) + for (BasicBlock::iterator BI = FI->begin(), BE = FI->end(); + BI != BE; ++BI) + if (!instructionsToDelete.count(BI)) { + DEBUG(std::cerr << "Visiting instruction " << *BI); + visit(*BI); + } + if (changed) deleteInstructions(); + return changed; + } + + void AltiVec::visitVImmInst(VImmInst &VL) { + if (!VL.hasOneUse()) return; + CastInst *cast = dyn_cast(*VL.use_begin()); + if (!cast) return; + const VectorType *VT = dyn_cast(cast->getType()); + // We need only worry about a cast of a non-constant scalar to a + // vector; the AltiVec C Backend can handle the other cases + // directly. + // + if (!VT || !isProperType(VT) || + isa(VL.getOperand(0))) + return; + // We need to create a new vector on the stack, store the scalar + // value into it, and splat the value into a vector register + // + AllocaInst *vectorPtr = new AllocaInst(VT, 0, "alloca", &VL); + Value *element = VL.getOperand(0); + if (element->getType() != VT->getElementType()) + element = new CastInst(element, VT->getElementType(), "cast", &VL); + CastInst *scalarPtr = new CastInst(vectorPtr, PointerType::get(VT->getElementType()), + "cast", &VL); + StoreInst *store = new StoreInst(element, scalarPtr, &VL); + LoadInst *vector = new LoadInst(vectorPtr, "load", &VL); + CallInst *call = VectorUtils::getCallInst(VT, getAltiVecName("splat", VT), + vector, ConstantUInt::get(Type::UByteTy, 0), + "splat", &VL); + cast->replaceAllUsesWith(call); + instructionsToDelete.insert(cast); + instructionsToDelete.insert(&VL); + changed = true; + } + + void AltiVec::visitCastInst(CastInst &CI) { + // We need only worry about a cast of a non-constant scalar to a + // vector; the AltiVec C Backend can handle the other cases + // directly. + // + const VectorType *VT = dyn_cast(CI.getType()); + if (!VT || !isProperType(VT) || + isa(CI.getOperand(0)->getType()) || + isa(CI.getOperand(0))) + return; + // We need to create a new vector on the stack, store the scalar + // value into it, and splat the value into a vector register + // + AllocaInst *vectorPtr = new AllocaInst(VT, 0, "alloca", &CI); + Value *element = CI.getOperand(0); + if (element->getType() != VT->getElementType()) + element = new CastInst(element, VT->getElementType(), "cast", &CI); + CastInst *scalarPtr = new CastInst(vectorPtr, PointerType::get(VT->getElementType()), + "cast", &CI); + StoreInst *store = new StoreInst(element, scalarPtr, &CI); + LoadInst *vector = new LoadInst(vectorPtr, "load", &CI); + CallInst *call = VectorUtils::getCallInst(VT, getAltiVecName("splat", VT), + vector, ConstantUInt::get(Type::UByteTy, 0), + "splat", &CI); + CI.replaceAllUsesWith(call); + instructionsToDelete.insert(&CI); + changed = true; + } + + // Check whether an extract instruction should be turned into + // altivec_unpack + // + void AltiVec::visitExtractInst(ExtractInst &EI) { + Value *v = EI.getOperand(0); + ConstantUInt *start = dyn_cast(EI.getOperand(1)); + ConstantUInt *stride = dyn_cast(EI.getOperand(2)); + ConstantUInt *len = dyn_cast(EI.getOperand(3)); + if (!start || !stride || !len) return; + if (stride->getValue() != 1 || len->getValue() != 8) return; + std::string baseName; + if (start->getValue() == 0) + baseName = "unpackh"; + else if (start->getValue() == 8) + baseName = "unpackl"; + else return; + const FixedVectorType *VT = dyn_cast(v->getType()); + if (VT == FixedVectorType::get(Type::UByteTy, 16)) { + if (!EI.hasOneUse()) return; + CastInst *cast = dyn_cast(*EI.use_begin()); + if (!cast) return; + const FixedVectorType *argTy = FixedVectorType::get(Type::SByteTy, 16); + const FixedVectorType *retTy = FixedVectorType::get(Type::ShortTy, 8); + if (cast->getType() != FixedVectorType::get(Type::ShortTy, 8)) { + CastInst *cast2 = new CastInst(&EI, FixedVectorType::get(Type::ShortTy, 8), "cast", cast); + cast->setOperand(0, cast2); + cast = cast2; + } + CastInst *arg = new CastInst(v, argTy, "cast", &EI); + CallInst *call = VectorUtils::getCallInst(retTy, getAltiVecName(baseName, argTy), + arg, "unpack", &EI); + + BinaryOperator *andInst = + BinaryOperator::create(Instruction::And, call, + ConstantExpr::getCast(ConstantSInt::get(Type::ShortTy, 0xFF), retTy), + "and", &EI); + cast->replaceAllUsesWith(andInst); + instructionsToDelete.insert(cast); + instructionsToDelete.insert(&EI); + changed = true; + } + } + + void AltiVec::visitCombineInst(CombineInst &CI) { + CombineInst *combine1 = cast(&CI); + Value *v1 = CI.getOperand(0); + Value *v2 = CI.getOperand(1); + // If the destination is a combine instruction, do nothing; if + // necessary, we'll handle the first combine instruction in the + // series. + // + if (isa(v1)) + return; + // We must have two fixed-vector operands + // + const FixedVectorType *VT1 = dyn_cast(v1->getType()); + if (!VT1) return; + const FixedVectorType *VT2 = dyn_cast(v2->getType()); + if (!VT2) return; + if (VT1->getNumElements() != 2*VT2->getNumElements()) + return; + // This combine must have exactly one use, and it must be a + // combine whose operand 0 is this combine. The types must work + // out properly. + // + if (!CI.hasOneUse()) return; + CombineInst* combine2 = dyn_cast(*CI.use_begin()); + if (!combine2) return; + if (&CI != combine2->getOperand(0)) return; + if (combine2->getOperand(1)->getType() != VT2) return; + if (combine2->hasOneUse()) { + // Check for a vec_pack or vec_perm pattern + // + Instruction *use = dyn_cast(*combine2->use_begin()); + if (!use) return; + const FixedVectorType *VT = dyn_cast(use->getType()); + if (!VT || !isProperType(VT)) return; + std::string baseName; + CallInst *call = 0; + if (isa(use)) { + baseName = "pack"; + call = VectorUtils::getCallInst(VT, getAltiVecName(baseName, VT1), + v2, combine2->getOperand(1), + "pack", &CI); + } + else if (VectorUtils::isFunctionContaining(use, "saturate")) { + baseName = "packsu"; + call = VectorUtils::getCallInst(VT, getAltiVecName(baseName, VT1), + v2, combine2->getOperand(1), + "pack", &CI); + } + else if (VectorUtils::isFunctionContaining(use, "permute")) { + call = VectorUtils::getCallInst(VT, getAltiVecName("perm", VT), + CI.getOperand(1), combine2->getOperand(1), + cast(use)->getOperand(2), + "perm", &CI); + } + else { + return; + } + + use->replaceAllUsesWith(call); + instructionsToDelete.insert(use); + instructionsToDelete.insert(combine2); + instructionsToDelete.insert(&CI); + Instruction *op0 = dyn_cast(CI.getOperand(0)); + if (op0) + instructionsToDelete.insert(op0); + changed = true; + } else if (combine2->hasNUses(2)) { + Value::use_iterator I = combine2->use_begin(); + ExtractInst *extract0 = dyn_cast(*I++); + ExtractInst *extract1 = dyn_cast(*I); + assert(extract0 && extract1); + CallInst *mergeh = VectorUtils::getCallInst(VT2, getAltiVecName("mergeh", VT2), + combine1->getOperand(1), combine2->getOperand(1), + "mergeh", extract0); + CallInst *mergel = VectorUtils::getCallInst(VT2, getAltiVecName("mergel", VT2), + combine1->getOperand(1), combine2->getOperand(1), + "mergel", extract0); + if (cast(extract0->getOperand(1))->getValue() == 0) { + extract0->replaceAllUsesWith(mergeh); + extract1->replaceAllUsesWith(mergel); + } else { + extract0->replaceAllUsesWith(mergel); + extract1->replaceAllUsesWith(mergeh); + } + instructionsToDelete.insert(combine1); + instructionsToDelete.insert(combine2); + instructionsToDelete.insert(extract0); + instructionsToDelete.insert(extract1); + changed = true; + } + } + + void AltiVec::visitVSelectInst(VSelectInst &VI) { + const FixedVectorType *VT = dyn_cast(VI.getType()); + if (!VT || !isProperType(VT)) return; + CallInst *call = VectorUtils::getCallInst(VT, getAltiVecName("sel", VT), + VI.getOperand(2), VI.getOperand(1), + VI.getOperand(0), "sel", &VI); + VI.replaceAllUsesWith(call); + instructionsToDelete.insert(&VI); + changed = true; + } + + void AltiVec::visitSetCondInst(SetCondInst &BO) { + const FixedVectorType *VT = + dyn_cast(BO.getOperand(0)->getType()); + if (!VT || !isProperType(VT)) return; + std::string name; + switch(BO.getOpcode()) { + case Instruction::VSetGT: + name = "cmpgt"; + break; + default: + assert(0 && "Unknown VSetCC opcode!"); + } + CallInst *call = VectorUtils::getCallInst(BO.getType(), getAltiVecName(name, VT), + BO.getOperand(0), BO.getOperand(1), + "cmp", &BO); + BO.replaceAllUsesWith(call); + instructionsToDelete.insert(&BO); + changed = true; + } + + void AltiVec::visitSub(BinaryOperator &BO) { + const FixedVectorType *VT = + dyn_cast(BO.getOperand(0)->getType()); + if (!VT) return; + CallInst *sub = VectorUtils::getCallInst(VT, getAltiVecName("sub", VT), + BO.getOperand(0), BO.getOperand(1), + "sub", &BO); + BO.replaceAllUsesWith(sub); + instructionsToDelete.insert(&BO); + changed = true; + } + + void AltiVec::visitShiftInst(ShiftInst &SI) { + const FixedVectorType *VT = + dyn_cast(SI.getOperand(0)->getType()); + if (!VT) return; + std::string shortName; + if (SI.getOpcode() == Instruction::Shr) { + if (VT->getElementType()->isSigned()) + shortName = "sra"; + else + shortName = "srl"; + } else { + shortName = "sll"; + } + CastInst *cast = new CastInst(SI.getOperand(1), FixedVectorType::get(Type::UShortTy, 8), "cast", &SI); + CallInst *shift = VectorUtils::getCallInst(VT, getAltiVecName(shortName, VT), + SI.getOperand(0), cast, + "shift", &SI); + SI.replaceAllUsesWith(shift); + instructionsToDelete.insert(&SI); + changed = true; + } + + void AltiVec::visitMul(BinaryOperator &BO) { + const FixedVectorType *VT = + dyn_cast(BO.getOperand(0)->getType()); + if (!VT || !BO.hasOneUse()) + return; + Instruction *use = dyn_cast(*BO.use_begin()); + if (!use) return; + switch (use->getOpcode()) { + case Instruction::Add: { + // Check for mradds pattern + // + BinaryOperator *add = cast(use); + CastInst *mulCast0 = dyn_cast(BO.getOperand(0)); + CastInst *mulCast1 = dyn_cast(BO.getOperand(1)); + CastInst *addCast0 = 0, *addCast2 = 0, *shrCast = 0; + VImmInst *VImm = 0; + ShiftInst *shr = 0; + CallInst *adds; + unsigned offset = 0, shamt = 0; + if (&BO == add->getOperand(0)) + addCast0 = dyn_cast(add->getOperand(1)); + else + addCast0 = dyn_cast(add->getOperand(0)); + if (addCast0) + VImm = dyn_cast(addCast0->getOperand(0)); + if (VImm) { + if (ConstantSInt *C = dyn_cast(VImm->getOperand(0))) + offset = C->getValue(); + else if (ConstantUInt *C = dyn_cast(VImm->getOperand(0))) + offset = C->getValue(); + } + if (add->hasOneUse()) { + shr = dyn_cast(*add->use_begin()); + } + if (shr && shr->hasOneUse()) { + if (ConstantUInt *C = dyn_cast(shr->getOperand(1))) + shamt = C->getValue(); + shrCast = dyn_cast(*shr->use_begin()); + } + if (shrCast && shrCast->hasOneUse()) { + adds = dyn_cast(*shrCast->use_begin()); + Function *F = adds->getCalledFunction(); + if (!F || F->getName().substr(0, 10) != "vllvm_adds") + adds = 0; + } + if (mulCast0 && mulCast1 && addCast0 && VImm && + offset == 16384 && shrCast && shr && shamt == 15 && + adds) { + VT = cast(adds->getType()); + CallInst *mradds = VectorUtils::getCallInst(VT, getAltiVecName("mradds", VT), + new CastInst(mulCast0->getOperand(0), VT, "cast", adds), + new CastInst(mulCast1->getOperand(0), VT, "cast", adds), + (shrCast == adds->getOperand(1)) ? adds->getOperand(2) : adds->getOperand(1), + "mradds", adds); + adds->replaceAllUsesWith(mradds); + instructionsToDelete.insert(&BO); + instructionsToDelete.insert(add); + instructionsToDelete.insert(shr); + instructionsToDelete.insert(mulCast0); + instructionsToDelete.insert(mulCast1); + instructionsToDelete.insert(addCast0); + instructionsToDelete.insert(VImm); + instructionsToDelete.insert(shrCast); + instructionsToDelete.insert(adds); + changed = true; + return; + } + // Check for mladd pattern + // + CallInst *call = VectorUtils::getCallInst(VT, getAltiVecName("mladd", VT), + BO.getOperand(0), BO.getOperand(1), + (use->getOperand(0) == &BO) ? use->getOperand(1) : use->getOperand(0), + "mladd", use); + use->replaceAllUsesWith(call); + instructionsToDelete.insert(&BO); + instructionsToDelete.insert(use); + changed = true; + break; + } + case Instruction::Shr: { + // Check for madds pattern + // + if (!use->hasOneUse()) + return; + ConstantUInt *shamt = dyn_cast(use->getOperand(1)); + if (!shamt || (shamt->getValue() != 15)) + return; + CastInst *op0 = dyn_cast(BO.getOperand(0)); + CastInst *op1 = dyn_cast(BO.getOperand(1)); + CastInst *use2 = dyn_cast(*use->use_begin()); + VT = dyn_cast(op0->getOperand(0)->getType()); + if (op0 && op1 && use2 && VT) { + CallInst *madds = + VectorUtils::getCallInst(VT, getAltiVecName("madds", VT), + op0->getOperand(0), op1->getOperand(0), + ConstantExpr::getCast(ConstantSInt::get(Type::IntTy, 0), VT), + "madds", &BO); + use2->replaceAllUsesWith(madds); + instructionsToDelete.insert(&BO); + instructionsToDelete.insert(use); + instructionsToDelete.insert(op0); + instructionsToDelete.insert(op1); + instructionsToDelete.insert(use2); + changed = true; + } + break; + } + default: + break; + } + } + + void AltiVec::visitCallInst(CallInst &CI) { + const FixedVectorType *VT = + dyn_cast(CI.getType()); + if (!VT || !isProperType(VT)) return; + Function *callee = CI.getCalledFunction(); + if (!callee) return; + std::string calleeName = callee->getName(); + std::string prefix = calleeName.substr(0, 6); + if (prefix != "vllvm_") return; + unsigned pos = calleeName.find("_", 6); + if (pos == std::string::npos) { + std::cerr << "Bad syntax for Vector-LLVM intrinsic " << calleeName << "\n"; + exit(1); + } + std::string shortName = calleeName.substr(6, pos-6); + if (shortName == "saturate") { + return; + } else { + std::vector args; + for (unsigned i = 1; i < CI.getNumOperands(); ++i) + args.push_back(CI.getOperand(i)); + CallInst *call = VectorUtils::getCallInst(VT, getAltiVecName(shortName, VT), + args, "vec_func", &CI); + CI.replaceAllUsesWith(call); + instructionsToDelete.insert(&CI); + } + changed = true; + } + + } Index: llvm/lib/Transforms/Vector/LowerVectors.cpp diff -c /dev/null llvm/lib/Transforms/Vector/LowerVectors.cpp:1.1.2.1 *** /dev/null Tue Oct 18 14:37:14 2005 --- llvm/lib/Transforms/Vector/LowerVectors.cpp Tue Oct 18 14:37:03 2005 *************** *** 0 **** --- 1,1059 ---- + //===- LowerVectors.cpp - Lower vector operations -------------------------===// + // + // The LLVM Compiler Infrastructure + // + // This file was developed by the LLVM research group and is distributed under + // the University of Illinois Open Source License. See LICENSE.TXT for details. + // + //===----------------------------------------------------------------------===// + // + // This file lowers vector operations (such as vgather, vscatter, and + // vector arithmetic) to iterated scalar operations. This pass does + // NOT generate efficient code; it is intended for testing and + // debugging of Vector-LLVM. + // + //===----------------------------------------------------------------------===// + + #define DEBUG_TYPE "lowervectors" + + #include + + #include "llvm/Constants.h" + #include "llvm/DerivedTypes.h" + #include "llvm/Function.h" + #include "llvm/Instructions.h" + #include "llvm/Module.h" + #include "llvm/Pass.h" + #include "llvm/Type.h" + #include "llvm/Support/CFG.h" + #include "llvm/Support/Debug.h" + #include "llvm/Support/InstVisitor.h" + #include "llvm/Transforms/Utils/BasicBlockUtils.h" + #include "llvm/ADT/hash_map" + #include "llvm/ADT/hash_set" + #include "llvm/Transforms/Scalar.h" + #include "VectorLLVM/Utils.h" + + using namespace llvm; + + namespace { + + //===----------------------------------------------------------------------===// + // Class definitions + //===----------------------------------------------------------------------===// + + class LowerVectors : public FunctionPass, public InstVisitor { + + public: + bool doInitialization(Module &M); + bool runOnFunction(Function &F); + void visitVGatherInst(VGatherInst&); + void visitVScatterInst(VScatterInst&); + void visitCastInst(CastInst&); + void visitBinaryOperator(BinaryOperator&); + void visitVImmInst(VImmInst&); + void visitShiftInst(ShiftInst&); + void visitVSelectInst(VSelectInst&); + void visitExtractInst(ExtractInst&); + void visitCombineInst(CombineInst&); + void visitExtractElementInst(ExtractElementInst&); + void visitCombineElementInst(CombineElementInst&); + void visitPHINode(PHINode&); + void visitMallocInst(MallocInst&); + void visitFreeInst(FreeInst&); + void visitStoreInst(StoreInst&); + void visitLoadInst(LoadInst&); + void visitInstruction(Instruction& I) { + std::cerr << "LowerVectors class can't handle instruction " << I << "!\n"; + exit(1); + } + + static Function *ReallocFunc; + + private: + void lowerInstruction(Instruction&); + //void lowerInstructionToLoop(Instruction*,Value*); + }; + + RegisterOpt X("lowervectors", + "Lower vector operations to iterated scalar operations"); + + class VMemoryInstLowering { + protected: + BasicBlock *constructLoop(VMemoryInst*,BasicBlock*,std::vector,Value*); + void constructInnerLoop(VMemoryInst*,BasicBlock*,BasicBlock*,BasicBlock*, + BasicBlock*,std::vector,Value*); + virtual void constructLoopBody(VMemoryInst*,BasicBlock*, + std::vector,Value*) = 0; + }; + + class VGatherLowering : public VMemoryInstLowering { + public: + VGatherLowering(VGatherInst *VL) { lowerVGather(VL); } + void lowerVGather(VGatherInst*); + + private: + void constructLoopBody(VMemoryInst*,BasicBlock*, + std::vector,Value*); + }; + + class VScatterLowering : public VMemoryInstLowering { + public: + VScatterLowering(VScatterInst *VS) { lowerVScatter(VS); } + void lowerVScatter(VScatterInst*); + + private: + void constructLoopBody(VMemoryInst*,BasicBlock*, + std::vector,Value*); + }; + + class InstructionLowering : public InstVisitor { + friend class LowerVectors; + + Instruction *vector; + Value *result, *vectorIndex; + std::vector idx; + BasicBlock *body; + + public: + InstructionLowering(Instruction *I, Value *length, Value *ptr=0) + { lowerInstruction (I, length, ptr); } + void lowerInstruction(Instruction*,Value*,Value*); + void visitBinaryOperator(BinaryOperator&); + void visitVSelectInst(VSelectInst&); + void visitCastInst(CastInst&); + void visitShiftInst(ShiftInst&); + void visitExtractInst(ExtractInst&); + void visitCombineInst(CombineInst&); + void visitVImmInst(VImmInst&); + void visitLoadInst(LoadInst&); + void visitStoreInst(StoreInst&); + void visitInstruction(Instruction& I) { + std::cerr << "InstructionLowering class can't handle instruction " << I << "!\n"; + exit(1); + } + }; + + + //===----------------------------------------------------------------------===// + // Global data for this module + //===----------------------------------------------------------------------===// + + /// Map from each vector value to the in-memory array that has been + /// allocated to hold the vector. + /// + hash_map loweringMap; + + /// Map from each vector value to its length. If a vector value + /// does not appear in this map, then it has not yet been lowered. + /// + hash_map lengthMap; + + + //===----------------------------------------------------------------------===// + // Helper functions for managing vectors + //===----------------------------------------------------------------------===// + + /// Initialize all {T*,uint} instances in a lowered type + /// corresponding to a [vector of T] that would be created by a + /// malloc or alloca with nulls + /// + void initializeVectors(Value *ptr, const Type* originalAllocatedTy, + Instruction *before) { + if (isa(originalAllocatedTy)) { + for (unsigned i = 0; i < 2; ++i) { + std::vector Idx; + Idx.push_back(ConstantUInt::get(Type::UIntTy, 0)); + Idx.push_back(ConstantUInt::get(Type::UIntTy, i)); + GetElementPtrInst *GEP = + new GetElementPtrInst(ptr, Idx, "gep", before); + const PointerType *pointerTy = cast(GEP->getType()); + StoreInst *store = + new StoreInst(Constant::getNullValue(pointerTy->getElementType()), + GEP, before); + } + } else if (isa(originalAllocatedTy)) { + return; + } else { + std::cerr << "Can't yet handle this type!\n"; + exit(1); + } + } + + /// Initialize all {T*,uint} instances in a lowered type + /// corresponding to a [vector of T] that would be created by a + /// malloc or alloca with nulls + /// + void freeVectors(Value *ptr, const Type* originalAllocatedTy, + Instruction *before) { + if (isa(originalAllocatedTy)) { + std::vector Idx; + Idx.push_back(ConstantUInt::get(Type::UIntTy, 0)); + Idx.push_back(ConstantUInt::get(Type::UIntTy, 0)); + GetElementPtrInst *GEP = + new GetElementPtrInst(ptr, Idx, "gep", before); + LoadInst *load = + new LoadInst(GEP, "load", before); + FreeInst *free = + new FreeInst(load, before); + } else if (isa(originalAllocatedTy)) { + return; + } else { + std::cerr << "Can't yet handle this type!\n"; + exit(1); + } + } + + /// Add the specified pair to the lengthMap, + /// replacing dummy uses if necessary + /// + void setLength(Value *key, Value *newValue) { + Value*& oldValue = lengthMap[key]; + if (oldValue) { + oldValue->replaceAllUsesWith(newValue); + delete oldValue; + } + oldValue = newValue; + } + + /// Given a vector type value, look in the lengthMap to get its length. + /// + Value *getLength(Value *key) { + Value*& V = lengthMap[key]; + if (!V) { + V = new Argument(Type::UIntTy); + DEBUG(std::cerr << "Creating dummy length " << *V << "\n"); + } + return V; + } + + /// Add the specified pair to the loweringMap, replacing dummy uses + /// if necessary + /// + void setLoweredValue(Value *key, Value *newValue, Value *length = 0) { + Value*& oldValue = loweringMap[key]; + if (oldValue) { + oldValue->replaceAllUsesWith(newValue); + delete oldValue; + } + oldValue = newValue; + if (length) + setLength(key, length); + } + + /// Lower an arbitary type of a pointer or an object stored in + /// memory. Lower a vector-derived type by replacing all instances + /// of [vector of T] with {T*,uint}, with some special rules for + /// vector-derived function types. "Lower" a non-vector-derived + /// type to the same type. + /// + const Type* getLoweredMemoryType(const Type* Ty) { + if (const VectorType *VectorTy = dyn_cast(Ty)) { + std::vector Params; + Params.push_back(PointerType::get(VectorTy->getElementType())); + Params.push_back(Type::UIntTy); + return StructType::get(Params); + } else if (Ty->isPrimitiveType()) { + return Ty; + } else if (const PointerType *PT = dyn_cast(Ty)) { + return PointerType::get(getLoweredMemoryType(PT->getElementType())); + } + return Ty; // For now + } + + /// Lower the type of a first-class object stored in a virtual + /// register. Lower [vector of T] to T*, but lower [vector of T]* + /// to {T*,uint}*. "Lower" a non-vector-derived type to the same + /// type. + /// + const Type* getLoweredRegisterType(const Type* Ty) { + assert (Ty->isFirstClassType() && + "getLoweredRegisterType() should be called only on first-class types!"); + if (const VectorType *VectorTy = dyn_cast(Ty)) { + return PointerType::get(VectorTy->getElementType()); + } else if (isa(Ty)) { + return getLoweredMemoryType(Ty); + } + return Ty; + } + + /// Given a value, return the corresponding lowered value. + /// Otherwise, look in the loweringMap to get the corresponding + /// scalar value. If there is no corresponding value, we create a + /// dummy value that will be filled in later when the operand is + /// lowered. + /// + Value *getLoweredValue(Value *key) { + const VectorType *VectorTy = dyn_cast(key->getType()); + Value*& value = loweringMap[key]; + if (!value) { + value = new Argument(getLoweredRegisterType(key->getType())); + DEBUG(std::cerr << "Creating dummy lowered value " << *value << "\n"); + } + return value; + } + + /// Get a single lowered operand of an instruction. Each operand is + /// a value loaded from the specified position of the array that + /// stores the vector elements. + /// + Value* getOp(Instruction* I, unsigned n, std::vector& idx, + Instruction *insertBefore) { + Value *op = I->getOperand(n); + Value *loweredOp = getLoweredValue(op); + Value *ptr = new GetElementPtrInst(loweredOp, idx, "ptr", + insertBefore); + return new LoadInst(ptr, "load", insertBefore); + } + + /// Get the first n lowered operands of an instruction. + /// + void getOps(Instruction* I, Value* ops[], unsigned n, + std::vector& idx, Instruction *insertBefore) { + for (unsigned i = 0; i < n; ++i) + ops[i] = getOp(I, i, idx, insertBefore); + } + + /// Allocate a vector. We use realloc in case the allocation + /// happens inside a loop; because LLVM is in SSA form, this is + /// guaranteed to be correct. For each possible allocation, we + /// store a null pointer on the stack. When the allocation is + /// actually done, we store the pointer there. At each exit point + /// of the function, for each allocation, we call free on the + /// (possibly null) pointer. + /// + /// In the case of a store instruction, we use the + /// previously-allocated pointer, so we don't need to create a new + /// pointer, and we don't need to add the free instruction. + /// + Instruction *allocateVector(const Type* Ty, Value* ArraySize, + const std::string& Name, Instruction *InsertBefore, + Value *ptr=0) { + Function *function = InsertBefore->getParent()->getParent(); + Instruction *front = &(function->getEntryBlock().front()); + const Type *PointerTy = PointerType::get(Ty); + + Value *loadStorePtr = ptr; + if (!ptr) { + loadStorePtr = new AllocaInst(PointerType::get(Ty), 0, "loadstore_ptr", front); + new StoreInst(Constant::getNullValue(PointerType::get(Ty)), loadStorePtr, front); + } + + const FunctionType *ReallocFTy = LowerVectors::ReallocFunc->getFunctionType(); + + // Create the vector of arguments to realloc + // + Value *reallocPtr = new LoadInst(loadStorePtr, "realloc_ptr", InsertBefore); + if (reallocPtr->getType() != ReallocFTy->getParamType(0)) { + reallocPtr = new CastInst(reallocPtr, ReallocFTy->getParamType(0), "cast", InsertBefore); + } + + Value *reallocSize = + BinaryOperator::create(Instruction::Mul, ArraySize, + ConstantUInt::get(Type::UIntTy, + Ty->getPrimitiveSize()), + "size", InsertBefore); + if (reallocSize->getType() != ReallocFTy->getParamType(1)) { + reallocSize = new CastInst(reallocSize, ReallocFTy->getParamType(1), + "cast", InsertBefore); + } + + std::vector ReallocArgs; + ReallocArgs.push_back(reallocPtr); + ReallocArgs.push_back(reallocSize); + + // Create the call to realloc + // + CallInst *call = new CallInst(LowerVectors::ReallocFunc, + ReallocArgs, Name, InsertBefore); + + if (!ptr) { + // Insert a free instruction before every return + // + for (Function::iterator FI = function->begin(), FE = function->end(); + FI != FE; ++FI) { + if (ReturnInst *RI = dyn_cast(FI->getTerminator())) { + LoadInst *freePtr = new LoadInst(loadStorePtr, "free_ptr", RI); + new FreeInst(freePtr, RI); + } + } + } + + // Create a cast instruction if necessary to convert to the right + // type + // + Instruction *result = call; + if (call->getType() != PointerTy) + result = new CastInst(call, PointerTy, "cast", InsertBefore); + + // Store the pointer to the allocated memory in the load-store pointer + // + new StoreInst(result, loadStorePtr, InsertBefore); + + return result; + } + + /// Test whether a given instruction is a vector instruction that we + /// need to lower + /// + bool isVectorInstruction(Instruction *I) { + if (isa(I)) return true; + if (isa(I) || isa(I)) + return (getLoweredMemoryType(I->getOperand(0)->getType()) + != I->getOperand(0)->getType()); + return getLoweredMemoryType(I->getType()) != I->getType(); + } + + + //===----------------------------------------------------------------------===// + // LowerVectors implementation + //===----------------------------------------------------------------------===// + + Function *LowerVectors::ReallocFunc = 0; + + bool LowerVectors::doInitialization(Module &M) { + const Type *SBPTy = PointerType::get(Type::SByteTy); + ReallocFunc = M.getNamedFunction("realloc"); + + if (ReallocFunc == 0) + ReallocFunc = M.getOrInsertFunction("realloc", SBPTy, SBPTy, Type::UIntTy, 0); + + return false; + } + + bool LowerVectors::runOnFunction(Function &F) { + DEBUG(std::cerr << "\nrunOnFunction(" << F.getName() << ")\n"); + + std::vector instList; + loweringMap.clear(); + lengthMap.clear(); + + // Find all vector instructions and push them on a list + // + for (Function::iterator FI = F.begin(), FE = F.end(); + FI != FE; ++FI) + for (BasicBlock::iterator BI = FI->begin(), BE = FI->end(); + BI != BE; ++BI) + //if (isVectorInstruction(BI)) { + if (VectorUtils::containsVector(BI)) { + instList.push_back(BI); + } + + // Lower each one + // + for (std::vector::const_iterator I = instList.begin(); + I != instList.end(); ++I) { + lowerInstruction(**I); + } + + // Remove each one + // + for (std::vector::const_iterator I = instList.begin(); + I != instList.end(); ++I) { + (*I)->dropAllReferences(); + } + + for (std::vector::const_iterator I = instList.begin(); + I != instList.end(); ++I) { + DEBUG(std::cerr << "Removing instruction " << **I); + (*I)->getParent()->getInstList().erase(*I); + } + + // Program was changed iff we processed something on the list + // + return instList.size() > 0; + } + + /// Lower a single instruction + /// + void LowerVectors::lowerInstruction(Instruction &I) { + + // Check the operands + // + for (User::const_op_iterator OI = I.op_begin(), + OE = I.op_end(); OI != OE; ++OI) { + if (isa((*OI)->getType())) { + if (!isa(*OI)) + // For a correct Vector-LLVM program, this should never + // occur + // + assert(0 && "All operands of vector instructions must be instructions for this pass to work!"); + } + } + + // Now process the instruction itself + // + DEBUG(std::cerr << "Lowering instruction " << I); + visit(I); + + } + + void LowerVectors::visitVGatherInst(VGatherInst &VL) { + VGatherLowering lower(&VL); + } + + void LowerVectors::visitVScatterInst(VScatterInst &VS) { + VScatterLowering lower(&VS); + } + + void LowerVectors::visitVImmInst(VImmInst &VL) { + InstructionLowering lower(&VL, VL.getOperand(1)); + } + + void LowerVectors::visitCastInst(CastInst &CI) { + InstructionLowering lower(&CI, getLength(CI.getOperand(0))); + } + + void LowerVectors::visitBinaryOperator(BinaryOperator &BO) { + Value *op0 = BO.getOperand(0); + Value *op1 = BO.getOperand(1); + Value *length0 = getLength(op0); + Value *length1 = getLength(op1); + VectorUtils::ensureEquality(&BO, length0, length1); + InstructionLowering lower(&BO, length0); + } + + void LowerVectors::visitShiftInst(ShiftInst &SI) { + Value *op0 = SI.getOperand(0); + Value *length = getLength(op0); + InstructionLowering lower(&SI, length); + } + + void LowerVectors::visitVSelectInst(VSelectInst &SI) { + Value *op0 = SI.getOperand(0); + Value *op1 = SI.getOperand(1); + Value *op2 = SI.getOperand(2); + Value *loweredOp0 = getLoweredValue(op0); + Value *loweredOp1 = getLoweredValue(op1); + Value *loweredOp2 = getLoweredValue(op2); + Value *length0 = getLength(op0); + Value *length1 = getLength(op1); + Value *length2 = getLength(op2); + VectorUtils::ensureEquality(&SI, length0, length1); + VectorUtils::ensureEquality(&SI, length1, length2); + InstructionLowering lower(&SI, length0); + } + + void LowerVectors::visitExtractInst(ExtractInst &EI) { + Value *length = EI.getOperand(3); + InstructionLowering lower(&EI, length); + } + + void LowerVectors::visitCombineInst(CombineInst &CI) { + Value *length = getLength(CI.getOperand(0)); + InstructionLowering lower(&CI, length); + } + + void LowerVectors::visitExtractElementInst(ExtractElementInst &EI) { + std::vector idx; + idx.push_back(EI.getOperand(1)); + Value *element = getOp(&EI, 0, idx, &EI); + EI.replaceAllUsesWith(element); + } + + void LowerVectors::visitCombineElementInst(CombineElementInst &CI) { + Value *base = getLoweredValue(CI.getOperand(0)); + Value *element = CI.getOperand(1); + std::vector idx; + idx.push_back(CI.getOperand(2)); + Value *ptr = new GetElementPtrInst(base, idx, "ptr", &CI); + // According to the relaxed semantics, this is correct + // + new StoreInst(element, ptr, &CI); + setLoweredValue(&CI, base, getLength(CI.getOperand(0))); + } + + void LowerVectors::visitPHINode(PHINode &PN) { + const VectorType *Ty = dyn_cast(PN.getType()); + assert(Ty && "Instruction must be of vector type!"); + PHINode *vectorPHI = + new PHINode(getLoweredRegisterType(PN.getIncomingValue(0)->getType()), + "phi", &PN); + PHINode *lengthPHI = new PHINode(Type::UIntTy, "phi", vectorPHI); + for(unsigned i = 0, e = PN.getNumIncomingValues(); + i < e; ++i) { + Value *V = PN.getIncomingValue(i); + BasicBlock *BB = PN.getIncomingBlock(i); + vectorPHI->addIncoming(getLoweredValue(V), BB); + lengthPHI->addIncoming(getLength(V), BB); + } + setLoweredValue(&PN, vectorPHI, lengthPHI); + } + + void LowerVectors::visitMallocInst(MallocInst &MI) { + const Type* Ty = MI.getAllocatedType(); + const Type* loweredTy = getLoweredMemoryType(Ty); + MallocInst *malloc = + new MallocInst(loweredTy, MI.getArraySize(), "malloc", &MI); + initializeVectors(malloc, Ty, &MI); + setLoweredValue(&MI, malloc); + } + + void LowerVectors::visitFreeInst(FreeInst &FI) { + Value *ptr = FI.getOperand(0); + Value *loweredPtr = getLoweredValue(ptr); + const Type* originalAllocatedTy = + cast(ptr->getType())->getElementType(); + freeVectors(loweredPtr, originalAllocatedTy, &FI); + FreeInst *free = + new FreeInst(loweredPtr, &FI); + setLoweredValue(&FI, free); + } + + void LowerVectors::visitStoreInst(StoreInst &SI) { + if (isa(SI.getOperand(0)->getType())) { + std::vector Idx; + Idx.push_back(ConstantUInt::get(Type::UIntTy, 0)); + Idx.push_back(ConstantUInt::get(Type::UIntTy, 0)); + Value *ptr = getLoweredValue(SI.getOperand(1)); + GetElementPtrInst *GEP = + new GetElementPtrInst(ptr, Idx, "gep", &SI); + InstructionLowering lower(&SI, getLength(SI.getOperand(0)), GEP); + Idx.pop_back(); + Idx.push_back(ConstantUInt::get(Type::UIntTy, 1)); + GEP = new GetElementPtrInst(ptr, Idx, "gep", &SI); + new StoreInst(getLength(SI.getOperand(0)), GEP, &SI); + } else { + Value *val = getLoweredValue(SI.getOperand(0)); + Value *ptr = getLoweredValue(SI.getOperand(1)); + StoreInst *store = + new StoreInst(val, ptr, &SI); + setLoweredValue(&SI, store); + } + } + + void LowerVectors::visitLoadInst(LoadInst &LI) { + if (isa(cast(LI.getOperand(0)->getType())->getElementType())) { + std::vector Idx; + Idx.push_back(ConstantUInt::get(Type::UIntTy, 0)); + Idx.push_back(ConstantUInt::get(Type::UIntTy, 1)); + Value *ptr = getLoweredValue(LI.getOperand(0)); + GetElementPtrInst *GEP = + new GetElementPtrInst(ptr, Idx, "gep", &LI); + LoadInst *load = + new LoadInst(GEP, "load", &LI); + InstructionLowering lower(&LI, load); + } else { + LoadInst *load = + new LoadInst(getLoweredValue(LI.getOperand(0)), "load", &LI); + setLoweredValue(&LI, load); + } + } + + + //===----------------------------------------------------------------------===// + // InstructionLowering implementation + //===----------------------------------------------------------------------===// + + /// Lower an instruction to a loop + /// + void InstructionLowering::lowerInstruction(Instruction *I, Value *length, + Value *ptr = 0) { + const Type *Ty = + isa(I) ? I->getOperand(0)->getType() : I->getType(); + const VectorType *VectorTy = dyn_cast(Ty); + assert(VectorTy && "Instruction must be of vector type!"); + const Type *elementType = VectorTy->getElementType(); + vector = allocateVector(elementType, length, "vector", I, ptr); + setLoweredValue(I, vector, length); + + // Set up the loop index + // + Instruction *vectorIndexPtr = + new AllocaInst(Type::UIntTy, ConstantUInt::get(Type::UIntTy, 1), + vector->getName() + ".index", I); + new StoreInst(Constant::getNullValue(Type::UIntTy), vectorIndexPtr, I); + + // Create the basic blocks of the loop + // + BasicBlock *predecessor = I->getParent(); + BasicBlock *header = + I->getParent()->splitBasicBlock(I, "loop_header"); + body = + header->splitBasicBlock(I, "loop_body"); + BasicBlock *exit = + body->splitBasicBlock(I, "loop_exit"); + + // Add the correct branch instructions + // + body->getTerminator()->setSuccessor(0, header); + vectorIndex = new LoadInst(vectorIndexPtr, "index", + header->getTerminator()); + Instruction *cond = + BinaryOperator::create(Instruction::SetLT, vectorIndex, length, + "setlt", header->getTerminator()); + BasicBlock::iterator oldInst(header->getTerminator()); + Instruction *newInst = new BranchInst(body, exit, cond); + ReplaceInstWithInst(header->getInstList(), oldInst, newInst); + + // Perform the operation in the body of the loop + // + idx.clear(); + idx.push_back(vectorIndex); + visit(I); + Instruction *GEP = new GetElementPtrInst(vector, idx, "GEP", + body->getTerminator()); + new StoreInst(result, GEP, body->getTerminator()); + + // Increment the loop counter + // + Value *incr = BinaryOperator::create(Instruction::Add, vectorIndex, + ConstantUInt::get(Type::UIntTy, 1), + "incr", body->getTerminator()); + new StoreInst(incr, vectorIndexPtr, body->getTerminator()); + } + + void InstructionLowering::visitBinaryOperator(BinaryOperator &BO) { + Value *ops[2]; + getOps(&BO, ops, 2, idx, body->getTerminator()); + Instruction::BinaryOps loweredOpcode = BO.getOpcode(); + if (SetCondInst *SC = dyn_cast(&BO)) + loweredOpcode = SC->getScalarOpcode(); + result = BinaryOperator::create(loweredOpcode, + ops[0], ops[1], "binop", + body->getTerminator()); + } + + void InstructionLowering::visitVSelectInst(VSelectInst &SI) { + Value *ops[3]; + getOps(&SI, ops, 3, idx, body->getTerminator()); + result = new SelectInst(ops[0], ops[1], ops[2], "select", + body->getTerminator()); + } + + void InstructionLowering::visitCastInst(CastInst &CI) { + const VectorType *VT = dyn_cast(CI.getType()); + assert(VT && "Cast instruction must have vector type!"); + const Type* destTy = VT->getElementType(); + Value *loweredOp = getOp(&CI, 0, idx, body->getTerminator()); + result = new CastInst(loweredOp, destTy, "cast", body->getTerminator()); + } + + void InstructionLowering::visitShiftInst(ShiftInst &SI) { + Value *loweredOp = getOp(&SI, 0, idx, body->getTerminator()); + result = new ShiftInst(cast(SI).getOpcode(), loweredOp, + SI.getOperand(1), "shift", + body->getTerminator()); + } + + void InstructionLowering::visitExtractInst(ExtractInst &EI) { + Value *mul = BinaryOperator::create(Instruction::Mul, vectorIndex, + EI.getOperand(2), + "mul", body->getTerminator()); + Value *add = BinaryOperator::create(Instruction::Add, + EI.getOperand(1), mul, + "add", body->getTerminator()); + std::vector idx2; + idx2.push_back(add); + result = getOp(&EI, 0, idx2, body->getTerminator()); + } + + void InstructionLowering::visitCombineInst(CombineInst &CI) { + // Here we are generating code for + // + // %tmp = extract v1, v2, start, stride + // + // First we compute secondIndex, the index into v2. If start <= + // vectorIndex < start + stride * getLength(v2), then + // secondIndex = (vectorIndex - start) / stride. Otherwise, we + // won't use the value from the second vector, so we set + // secondIndex = 0 (a safe value that won't cause an illegal + // load). + // + Value *secondLength = + getLength(CI.getOperand(1)); + Instruction *mul = + BinaryOperator::create(Instruction::Mul, CI.getOperand(3), + secondLength, + "mul", body->getTerminator()); + Instruction *add = + BinaryOperator::create(Instruction::Add, CI.getOperand(2), + mul, + "add", body->getTerminator()); + Instruction *compare1 = + BinaryOperator::create(Instruction::SetGE, vectorIndex, + CI.getOperand(2), + "compare", body->getTerminator()); + Instruction *compare2 = + BinaryOperator::create(Instruction::SetLT, vectorIndex, + add, + "compare", body->getTerminator()); + Instruction *inRange = + BinaryOperator::create(Instruction::And, compare1, + compare2, + "inRange", body->getTerminator()); + Instruction *sub = + BinaryOperator::create(Instruction::Sub, vectorIndex, + CI.getOperand(2), + "secondIndex", body->getTerminator()); + Instruction *div = + BinaryOperator::create(Instruction::Div, sub, + CI.getOperand(3), + "secondIndex", body->getTerminator()); + Value *secondIndex = + new SelectInst(inRange, div, + ConstantUInt::get(Type::UIntTy, 0), + "select", body->getTerminator()); + + // Get the value out of v1 at vectorIndex and the value out of + // v2 at secondIndex + // + Value *firstValue = getOp(&CI, 0, idx, body->getTerminator()); + std::vector idx2; + idx2.push_back(secondIndex); + Value *secondValue = getOp(&CI, 1, idx2, body->getTerminator()); + + // Use the second value if vectorIndex is in range and + // (vectorIndex - start) is 0 mod the stride; otherwise use the + // first value + // + Value *select = + new SelectInst(inRange, secondValue, firstValue, + "select", body->getTerminator()); + Value *rem = + BinaryOperator::create(Instruction::Rem, sub, + CI.getOperand(3), "rem", + body->getTerminator()); + Value *compare = + BinaryOperator::create(Instruction::SetEQ, rem, + ConstantUInt::get(Type::UIntTy, 0), + "compare", body->getTerminator()); + result = + new SelectInst(compare, select, firstValue, + "select", body->getTerminator()); + } + + void InstructionLowering::visitVImmInst(VImmInst &VL) { + result = VL.getOperand(0); + } + + void InstructionLowering::visitLoadInst(LoadInst &LI) { + Value *ptr = getLoweredValue(LI.getOperand(0)); + std::vector idx2; + idx2.push_back(ConstantUInt::get(Type::UIntTy, 0)); + idx2.push_back(ConstantUInt::get(Type::UIntTy, 0)); + GetElementPtrInst *GEP = + new GetElementPtrInst(ptr, idx2, "gep", body->getTerminator()); + LoadInst *load = + new LoadInst(GEP, "load", body->getTerminator()); + GEP = + new GetElementPtrInst(load, idx, "gep", body->getTerminator()); + result = new LoadInst(GEP, "load", body->getTerminator()); + } + + void InstructionLowering::visitStoreInst(StoreInst &SI) { + result = getOp(&SI, 0, idx, body->getTerminator()); + } + + + //===----------------------------------------------------------------------===// + // VMemoryInstLowering implementation + //===----------------------------------------------------------------------===// + + /// Construct a loop over the array elements defined by the indices + /// of a vgather or vscatter instruction. The resulting loop has + /// one nest for each set of four indices. This function calls the + /// template function constructLoopBody(), which is defined + /// differently for vgather and vscatter. + /// + BasicBlock* VMemoryInstLowering::constructLoop(VMemoryInst *VI, BasicBlock *oldHeader, + std::vector arrayIndices, + Value* vectorIndex) { + BasicBlock *lastBB = 0; + unsigned loopLevel = arrayIndices.size(); + if (VI->getNumIndices() == 4 * loopLevel) { + // This is the innermost loop nest; construct the loop body + // + BasicBlock *body = + oldHeader->getTerminator()->getSuccessor(0); + body->setName("loop_body"); + constructLoopBody(VI, body, arrayIndices, vectorIndex); + // Increment the vector index if there is one + // + if (vectorIndex) { + Value *load = new LoadInst(vectorIndex, "load", body->getTerminator()); + Value *add = BinaryOperator::create(Instruction::Add, load, + ConstantSInt::get(Type::LongTy, 1), + "add", body->getTerminator()); + new StoreInst(add, vectorIndex, body->getTerminator()); + } + lastBB = body; + } else { + // We need another loop nest, so go ahead and split this loop + // into header, body, and exit basic blocks and recursively + // construct the nest + // + BasicBlock *header = + oldHeader->getTerminator()->getSuccessor(0); + header->setName("loop_header"); + BasicBlock *bodyBegin = + header->splitBasicBlock(header->begin()); + BasicBlock *exit = + bodyBegin->splitBasicBlock(bodyBegin->begin(), "loop_exit"); + bodyBegin->getTerminator()->setSuccessor(0, header); + constructInnerLoop(VI, oldHeader, header, bodyBegin, exit, + arrayIndices, vectorIndex); + lastBB = exit; + } + return lastBB; + } + + /// Construct an inner loop, recursively calling constructLoop + /// + void VMemoryInstLowering::constructInnerLoop(VMemoryInst *VI, BasicBlock *oldHeader, + BasicBlock *header, BasicBlock *bodyBegin, + BasicBlock *exit, std::vector arrayIndices, + Value *vectorIndex) { + // Fill in the loop header + // + unsigned loopLevel = arrayIndices.size(); + PHINode *arrayPHI = new PHINode(Type::LongTy, "phi", + header->getTerminator()); + arrayPHI->addIncoming(VI->getLowerBound(loopLevel), oldHeader); + + // Fill in the body or split it to make a new loop + // + arrayIndices.push_back(arrayPHI); + BasicBlock *bodyEnd = constructLoop(VI, header, arrayIndices, vectorIndex); + + // Fill in the increment and branch instructions at the end of the + // loop + // + pred_iterator pred = pred_begin(bodyEnd); + BasicBlock::iterator I = (*pred)->begin(); + Instruction *arrayIncr = + BinaryOperator::create(Instruction::Add, arrayPHI, VI->getStride(loopLevel), + "add", bodyEnd->getTerminator()); + arrayPHI->addIncoming(arrayIncr, bodyEnd); + Instruction *cond1 = + BinaryOperator::create(Instruction::SetLE, arrayPHI, VI->getUpperBound(loopLevel), + "setle", header->getTerminator()); + Instruction *cond2 = + BinaryOperator::create(Instruction::SetGE, arrayPHI, VI->getUpperBound(loopLevel), + "setge", header->getTerminator()); + Instruction *positiveStride = + BinaryOperator::create(Instruction::SetGE, VI->getStride(loopLevel), + ConstantSInt::get(Type::LongTy, 0), + "setge", header->getTerminator()); + Instruction *select = + new SelectInst(positiveStride, cond1, cond2, "select", header->getTerminator()); + BasicBlock::iterator oldInst(header->getTerminator()); + Instruction *newInst = new BranchInst(bodyBegin, exit, select); + ReplaceInstWithInst(header->getInstList(), oldInst, newInst); + } + + + //===----------------------------------------------------------------------===// + // VGatherLowering implementation + //===----------------------------------------------------------------------===// + + /// Lower a vgather instruction: Create an array to hold the vector + /// contents, then copy the indexed memory locations to that array + /// + void VGatherLowering::lowerVGather(VGatherInst *VL) { + + // Allocate the array. + // + Instruction *firstInst = VL; + std::string name = VL->getName(); + Value *length = + VectorUtils::computeIndexedLength(VL, VL, name + std::string(".length")); + VL->setName(name + std::string(".vector")); + Instruction *vector = allocateVector(VL->getElementType(), length, + name, firstInst); + setLoweredValue(VL, vector, length); + + // Generate a loop to copy the contents + // + BasicBlock *header = VL->getParent(); + Value *vectorIndex = new AllocaInst(Type::LongTy, ConstantUInt::get(Type::UIntTy, 1), + name + ".index", VL); + new StoreInst(Constant::getNullValue(Type::LongTy), vectorIndex, VL); + header->splitBasicBlock(VL); + std::vector arrayIndices; + constructLoop(VL, header, arrayIndices, vectorIndex); + + } + + /// Generate code to take elements from the indexed memory locations + /// and put them into the array that holds the vector + /// + void VGatherLowering::constructLoopBody(VMemoryInst *VI, BasicBlock *body, + std::vector arrayIndices, + Value* vectorIndexPtr) { + Instruction *arrayPtr = + VectorUtils::computeFlattenedPointer(VI, arrayIndices, + body->getTerminator()); + Instruction *load = + new LoadInst(arrayPtr, "load", body->getTerminator()); + + Value *vectorIndex = new LoadInst(vectorIndexPtr, "index", body->getTerminator()); + std::vector vectorIndices; + vectorIndices.push_back(vectorIndex); + Instruction *vectorPtr = + new GetElementPtrInst(getLoweredValue(VI), vectorIndices, "ptr", + body->getTerminator()); + new StoreInst(load, vectorPtr, body->getTerminator()); + } + + + //===----------------------------------------------------------------------===// + // VScatterLowering implementation + //===----------------------------------------------------------------------===// + + /// Lower a vstore instruction. Find the array that holds the + /// vector contents, then copy that array to the indexed memory + /// locations. + /// + void VScatterLowering::lowerVScatter(VScatterInst *VS) { + Value *V = getLoweredValue(VS->getOperand(0)); + setLoweredValue(VS, V); + + // Make sure the vector length agrees with the indexed array slice + // + Value *indexedLength = + VectorUtils::computeIndexedLength(VS, VS, + VS->getPointerOperand()->getName() + + std::string(".length")); + Value *operandLength = getLength(VS->getOperand(0)); + VectorUtils::ensureEquality(VS, indexedLength, operandLength); + + std::vector arrayIndices; + BasicBlock *header = VS->getParent(); + Value *vectorIndex = 0; + + // Create a vector index to track the indexed position in the + // vector. + // + vectorIndex = new AllocaInst(Type::LongTy, ConstantUInt::get(Type::UIntTy, 1), + V->getName() + ".index", VS); + new StoreInst(Constant::getNullValue(Type::LongTy), vectorIndex, VS); + + header->splitBasicBlock(VS); + constructLoop(VS, header, arrayIndices, vectorIndex); + } + + /// Generate code to take elements from the array allocated for the + /// vector and put them into the indexed memory locations + /// + void VScatterLowering::constructLoopBody(VMemoryInst *VI, BasicBlock *body, + std::vector arrayIndices, + Value* vectorIndexPtr) { + Value *elt; + // Copy vector array at indexed position to destination array. + // + Value *vectorIndex = new LoadInst(vectorIndexPtr, "index", + body->getTerminator()); + std::vector vectorIndices; + vectorIndices.push_back(vectorIndex); + Instruction *vectorPtr = + new GetElementPtrInst(getLoweredValue(VI), vectorIndices, "ptr", + body->getTerminator()); + elt = new LoadInst(vectorPtr, "load", body->getTerminator()); + Instruction *arrayPtr = + VectorUtils::computeFlattenedPointer(VI, arrayIndices, + body->getTerminator()); + new StoreInst(elt, arrayPtr, body->getTerminator()); + } + + } Index: llvm/lib/Transforms/Vector/RaiseVectors.cpp diff -c /dev/null llvm/lib/Transforms/Vector/RaiseVectors.cpp:1.1.2.1 *** /dev/null Tue Oct 18 14:37:14 2005 --- llvm/lib/Transforms/Vector/RaiseVectors.cpp Tue Oct 18 14:37:03 2005 *************** *** 0 **** --- 1,594 ---- + //===- RaiseVectors.cpp - Raise significant functions to Vector-LLVM ------===// + // + // The LLVM Compiler Infrastructure + // + // This file was developed by the LLVM research group and is distributed under + // the University of Illinois Open Source License. See LICENSE.TXT for details. + // + //===----------------------------------------------------------------------===// + // + // This file raises the Vector-C significant functions to Vector-LLVM. + // + //===----------------------------------------------------------------------===// + + #define DEBUG_TYPE "raisevectors" + + #include "llvm/Constants.h" + #include "llvm/DerivedTypes.h" + #include "llvm/Function.h" + #include "llvm/Instructions.h" + #include "llvm/Pass.h" + #include "llvm/Type.h" + #include "llvm/Support/Debug.h" + #include "llvm/ADT/hash_map" + #include "llvm/ADT/hash_set" + #include "llvm/ADT/STLExtras.h" + #include "llvm/Support/InstVisitor.h" + #include "VectorLLVM/VectorSignificantFunctions.h" + #include "VectorLLVM/Utils.h" + + using namespace llvm; + + namespace { + + + //===----------------------------------------------------------------------===// + // Class definitions + //===----------------------------------------------------------------------===// + + class RaiseVectors : public FunctionPass, public InstVisitor { + + public: + virtual bool doInitialization(Module &M); + virtual bool runOnFunction(Function &F); + void visitCallInst(CallInst&); + void visitBinaryOperator(BinaryOperator&); + void visitCastInst(CastInst&); + void visitShiftInst(ShiftInst&); + void visitSelectInst(SelectInst&); + void visitPHINode(PHINode&); + void visitInstruction(Instruction& I) { + std::cerr << "RaiseVectors: Unhandled instruction " << I; + exit(1); + } + + private: + /// Map from original value to vector instruction + /// + hash_map raisingMap; + + /// Worklist of instructions to raise + /// + std::vector workList; + + /// Set of instructions that we have raised + /// + hash_set raisedInstructions; + + unsigned getVectorLength(Instruction*); + const Type *getRaisedType(const Type*,unsigned); + void setRaisedValue(Instruction*,Value*); + Value *getRaisedValue(Value*,unsigned); + Value *getRaisedOperand(Instruction*,unsigned); + bool addDefsToWorklist(Function&); + void addUsesToWorklist(Instruction*); + void raiseInstructions(); + void deleteRaisedInstructions(); + + }; + + RegisterOpt X("raisevectors", + "Raise Vector-C significant functions to Vector-LLVM"); + + + //===----------------------------------------------------------------------===// + // RaiseVectors implementation + //===----------------------------------------------------------------------===// + + /// llvm-gcc is very permissive about function declarations -- + /// undeclared functions are treated as int(...). Here we require + /// and check that the user has properly declared all Vector-C + /// significant functions. + /// + bool RaiseVectors::doInitialization(Module &M) { + for (Module::iterator I = M.begin(), E = M.end(); + I != E; ++I) { + if (!VectorSignificantFunctions::isProperlyDeclared(I)) { + std::cerr << "Significant function " << I->getName() + << " was not declared or was improperly declared.\n"; + exit(1); + } + } + return false; + } + + /// Main function called by PassManager + /// + bool RaiseVectors::runOnFunction(Function &F) { + DEBUG(std::cerr << "\nrunOnFunction(" << F.getName() << ")\n"); + + raisingMap.clear(); + workList.clear(); + raisedInstructions.clear(); + bool changed = addDefsToWorklist(F); + + if (changed) { + raiseInstructions(); + deleteRaisedInstructions(); + } + + return changed; + + } + + /// Add all vector definitions to the work list + /// + bool RaiseVectors::addDefsToWorklist(Function& F) { + bool defFound = false; + for (Function::iterator FI = F.begin(), FE = F.end(); + FI != FE; ++FI) { + for (BasicBlock::iterator BI = FI->begin(), BE = FI->end(); + BI != BE; ++BI) { + if (CallInst *CI = dyn_cast(BI)) { + if (Function* F = CI->getCalledFunction()) { + VectorSignificantFunctions::ID id = + VectorSignificantFunctions::getID(F->getName()); + if (id == VectorSignificantFunctions::vload || + id == VectorSignificantFunctions::vgather || + id == VectorSignificantFunctions::vloadi || + id == VectorSignificantFunctions::vimm || + id == VectorSignificantFunctions::fixed_vimm || + id == VectorSignificantFunctions::load || + id == VectorSignificantFunctions::constant) { + workList.push_back(CI); + defFound = true; + } + } + } + } + } + return defFound; + + } + + /// Raise all instructions on the worklist. + /// + void RaiseVectors::raiseInstructions() { + // Visit all the instructions to be raised. As uses are + // encountered, they are added to the worklist. + // + while (workList.size() > 0) { + Instruction *I = workList.back(); + workList.pop_back(); + if(raisedInstructions.insert(I).second) { + DEBUG(std::cerr << "Raising " << *I); + visit(*I); + DEBUG(if (raisingMap[I]) {std::cerr << "Raised value is " << *raisingMap[I];}); + } + } + // Check for leftover dummy values indicating the program + // attempted to combine a scalar with a vector + // + for (hash_map::iterator I = raisingMap.begin(), + E = raisingMap.end(); I != E; ++I) { + if (I->second && isa(I->second)) { + std::cerr << "Value was never raised!\n"; + std::cerr << *(I->first) << "\n"; + std::cerr << "This is because you used a scalar value in a vector operation.\n"; + std::cerr << "Use vimm to promote scalars to vectors " + << "before combining them with vectors.\n"; + exit(1); + } + } + } + + /// Delete all instructions that we have raised. + /// + void RaiseVectors::deleteRaisedInstructions() { + + for (hash_set::iterator I = raisedInstructions.begin(), + E = raisedInstructions.end(); I != E; ++I) { + DEBUG(std::cerr << "Dropping all references from " << **I); + (*I)->dropAllReferences(); + } + + for (hash_set::iterator I = raisedInstructions.begin(), + E = raisedInstructions.end(); I != E; ++I) { + (*I)->getParent()->getInstList().erase(*I); + } + } + + /// Raise a significant function call + /// + void RaiseVectors::visitCallInst(CallInst &CI) { + Function *F = CI.getCalledFunction(); + if (!F) { + std::cerr << "Can't handle indirect function call " << CI; + exit(1); + } + std::string name = F->getName(); + Value *raisedValue; + switch(VectorSignificantFunctions::getID(name)) { + case VectorSignificantFunctions::vload: + case VectorSignificantFunctions::vgather: { + std::vector idx; + for (unsigned i = 2; i < CI.getNumOperands(); ++i) { + CastInst *castInst = + new CastInst(CI.getOperand(i), Type::LongTy, "cast", &CI); + idx.push_back(castInst); + } + raisedValue = new VGatherInst(CI.getOperand(1), + idx, "vgather", &CI); + addUsesToWorklist(&CI); + break; + } + case VectorSignificantFunctions::load: { + ConstantUInt *UIntVal = dyn_cast(CI.getOperand(2)); + assert(UIntVal && "Vector length must be a constant UInt!"); + const PointerType *PointerTy = + dyn_cast(CI.getOperand(1)->getType()); + assert(PointerTy && "Pointer operand must be pointer type!"); + CastInst *cast = + new CastInst(CI.getOperand(1), + PointerType::get(FixedVectorType::get(PointerTy->getElementType(), + UIntVal->getValue())), + "cast", &CI); + std::vector Idx; + Idx.push_back(CI.getOperand(3)); + GetElementPtrInst *GEP = + new GetElementPtrInst(cast, Idx, "gep", &CI); + raisedValue = new LoadInst(GEP, "load", &CI); + addUsesToWorklist(&CI); + break; + } + case VectorSignificantFunctions::vimm: + case VectorSignificantFunctions::vloadi: { + raisedValue = new VImmInst(CI.getOperand(1), CI.getOperand(2), false, + "vimm", &CI); + const VectorType *VT = VectorType::get(CI.getOperand(1)->getType()); + if (raisedValue->getType() != VT) + raisedValue = new CastInst(raisedValue, VT, "cast", &CI); + addUsesToWorklist(&CI); + break; + } + case VectorSignificantFunctions::constant: { + std::vector elements; + for (unsigned i = 1; i < CI.getNumOperands(); ++i) { + Constant *C = dyn_cast(CI.getOperand(i)); + assert(C && "Operands of constant must be constants!"); + elements.push_back(ConstantExpr::getCast(C, CI.getType())); + } + raisedValue = ConstantVector::get(elements); + addUsesToWorklist(&CI); + break; + } + case VectorSignificantFunctions::fixed_vimm: { + ConstantUInt *UIntVal = dyn_cast(CI.getOperand(2)); + assert(UIntVal && "Vector length must be a constant UInt!"); + raisedValue = new VImmInst(CI.getOperand(1), CI.getOperand(2), + true, "vimm", &CI); + const FixedVectorType *VT = FixedVectorType::get(CI.getType(), UIntVal->getValue()); + if (raisedValue->getType() != VT) + raisedValue = new CastInst(raisedValue, VT, "cast", &CI); + addUsesToWorklist(&CI); + break; + } + case VectorSignificantFunctions::vstore: + case VectorSignificantFunctions::vscatter: { + std::vector idx; + for (unsigned i = 3; i < CI.getNumOperands(); ++i) { + CastInst *castInst = + new CastInst(CI.getOperand(i), Type::LongTy, "cast", &CI); + idx.push_back(castInst); + } + Value *raisedOp = getRaisedValue(CI.getOperand(1), (unsigned) 0); + Value *ptr = CI.getOperand(2); + raisedValue = new VScatterInst(raisedOp, ptr, idx, &CI); + break; + } + case VectorSignificantFunctions::store: { + unsigned length = getVectorLength(&CI); + Value *op1 = getRaisedValue(CI.getOperand(1), length); + const PointerType *PointerTy = + dyn_cast(CI.getOperand(2)->getType()); + assert(PointerTy && "Pointer operand must be pointer type!"); + CastInst *cast = + new CastInst(CI.getOperand(2), + PointerType::get(FixedVectorType::get(PointerTy->getElementType(), + length)), + "cast", &CI); + std::vector Idx; + Idx.push_back(CI.getOperand(3)); + GetElementPtrInst *GEP = + new GetElementPtrInst(cast, Idx, "gep", &CI); + raisedValue = new StoreInst(op1, GEP, &CI); + break; + } + case VectorSignificantFunctions::vselect: { + unsigned numArgs = 3; + unsigned length = getVectorLength(&CI); + assert((CI.getNumOperands() == numArgs+1) && + "Wrong number of arguments to _select!"); + CastInst *cast = dyn_cast(CI.getOperand(1)); + assert(cast && "First operand of vselect must be cast!"); + assert(cast->getOperand(0)->getType() == Type::BoolTy && + "First operand of vselect must be cast of bool to int!"); + Value *raisedArgs[numArgs]; + raisedArgs[0] = getRaisedValue(cast->getOperand(0), length); + for (unsigned i = 1; i < numArgs; ++i) { + Value *arg = CI.getOperand(i+1); + raisedArgs[i] = getRaisedValue(arg, length); + } + raisedValue = + new VSelectInst(raisedArgs[0], raisedArgs[1], raisedArgs[2], "vselect", &CI); + addUsesToWorklist(&CI); + break; + } + case VectorSignificantFunctions::extract: { + Value *raisedOp = getRaisedOperand(&CI, 1); + raisedValue = new ExtractInst(raisedOp, CI.getOperand(2), + CI.getOperand(3), CI.getOperand(4), + "extract", &CI); + addUsesToWorklist(&CI); + break; + } + case VectorSignificantFunctions::combine: { + unsigned length = getVectorLength(&CI); + Value *raisedOp1 = getRaisedValue(CI.getOperand(1), length); + Value *raisedOp2 = getRaisedValue(CI.getOperand(2), length); + raisedValue = new CombineInst(raisedOp1, raisedOp2, + CI.getOperand(3), CI.getOperand(4), + "combine", &CI); + addUsesToWorklist(&CI); + + break; + } + case VectorSignificantFunctions::fixed_combine: { + ConstantUInt *op2 = dyn_cast(CI.getOperand(2)); + ConstantUInt *op4 = dyn_cast(CI.getOperand(4)); + assert((op2 && op4) && "Vector length operands to fixed_combine must be constant uints!"); + unsigned length1 = op2->getValue(); + unsigned length2 = op4->getValue(); + Value *raisedOp1 = getRaisedValue(CI.getOperand(1), length1); + Value *raisedOp2 = getRaisedValue(CI.getOperand(3), length2); + raisedValue = new CombineInst(raisedOp1, raisedOp2, + CI.getOperand(5), CI.getOperand(6), + "combine", &CI); + addUsesToWorklist(&CI); + break; + } + case VectorSignificantFunctions::fixed_permute: { + ConstantUInt *op2 = dyn_cast(CI.getOperand(2)); + ConstantUInt *op4 = dyn_cast(CI.getOperand(4)); + assert((op2 && op4) && "Vector length operands to fixed_combine must be constant uints!"); + unsigned length1 = op2->getValue(); + unsigned length2 = op4->getValue(); + Value *raisedOp1 = getRaisedValue(CI.getOperand(1), length1); + Value *raisedOp2 = getRaisedValue(CI.getOperand(3), length2); + raisedValue = VectorUtils::getCallInst(raisedOp2->getType(), "vllvm_permute_" + + cast(raisedOp2->getType())->getElementType()->getDescription(), + raisedOp1, raisedOp2, "permute", &CI); + addUsesToWorklist(&CI); + break; + } + case VectorSignificantFunctions::extractelement: { + Value *raisedOp = getRaisedOperand(&CI, 1); + raisedValue = + new ExtractElementInst(raisedOp, CI.getOperand(2), + "extractelement", &CI); + CI.replaceAllUsesWith(raisedValue); + break; + } + case VectorSignificantFunctions::combineelement: { + Value *raisedOp1 = getRaisedOperand(&CI, 1); + raisedValue = new CombineElementInst(raisedOp1, CI.getOperand(2), + CI.getOperand(3), "combineelement", &CI); + addUsesToWorklist(&CI); + break; + } + default: + if (name.substr(0, 7) == "vectorc") { + name.erase(0, 7); + name = "vllvm" + name; + } + else if (name.substr(0, 5) == "vllvm") { + name += "_vector"; + } else { + std::cerr << "Can't handle instruction " << CI; + exit(1); + } + unsigned length = getVectorLength(&CI); + std::vector formalArgs; + std::vector args; + for (unsigned i = 1; i < CI.getNumOperands(); ++i) { + Value *op = CI.getOperand(i); + if (isa(op)) { + formalArgs.push_back(op->getType()); + args.push_back(op); + } else { + formalArgs.push_back(getRaisedType(CI.getOperand(i)->getType(), length)); + args.push_back(getRaisedOperand(&CI, i)); + } + } + FunctionType *FType = + FunctionType::get(getRaisedType(F->getReturnType(), length), formalArgs, false); + Module *M = CI.getParent()->getParent()->getParent(); + Function *func = M->getOrInsertFunction(name, FType); + raisedValue = new CallInst(func, args, "func", &CI); + addUsesToWorklist(&CI); + break; + } + setRaisedValue(&CI, raisedValue); + } + + /// Raise a binary operator + /// + void RaiseVectors::visitBinaryOperator(BinaryOperator &BO) { + unsigned length = getVectorLength(&BO); + Value *newOp[2]; + for (unsigned i = 0; i < 2; ++i) { + newOp[i] = getRaisedValue(BO.getOperand(i), length); + } + Instruction::BinaryOps raisedOp; + if (SetCondInst *SI = dyn_cast(&BO)) + raisedOp = SI->getVectorOpcode(); + else raisedOp = BO.getOpcode(); + Instruction *raisedValue = + BinaryOperator::create(raisedOp, newOp[0], newOp[1], "binop", &BO); + setRaisedValue(&BO, raisedValue); + addUsesToWorklist(&BO); + } + + /// Raise a cast instruction + /// + void RaiseVectors::visitCastInst(CastInst &CI) { + // Don't raise the cast if it's a cast of a bool to an int to get + // it into a vselect significant function + // + if (CI.hasOneUse()) { + User *use = *CI.use_begin(); + if (CallInst *I = dyn_cast(use)) { + if (Function *F = I->getCalledFunction()) { + if (VectorSignificantFunctions::getID(F->getName()) == + VectorSignificantFunctions::vselect) + return; + } + } + } + unsigned length = getVectorLength(&CI); + Value *raisedOp = getRaisedValue(CI.getOperand(0), length); + Instruction *raisedValue = + new CastInst(raisedOp, getRaisedType(CI.getType(), length), "cast", &CI); + setRaisedValue(&CI, raisedValue); + addUsesToWorklist(&CI); + } + + /// Raise a shift instruction + /// + void RaiseVectors::visitShiftInst(ShiftInst &SI) { + Value *raisedOp = getRaisedOperand(&SI, 0); + Instruction *raisedValue = + new ShiftInst(SI.getOpcode(), raisedOp, + SI.getOperand(1), "shift", &SI); + setRaisedValue(&SI, raisedValue); + addUsesToWorklist(&SI); + } + + /// Raise a select instruction + /// + void RaiseVectors::visitSelectInst(SelectInst &SI) { + Value *newOp[2]; + unsigned length = getVectorLength(&SI); + for (unsigned i = 0; i < 2; ++i) { + newOp[i] = getRaisedValue(SI.getOperand(i+1), length); + } + Instruction *raisedValue = + new SelectInst(SI.getOperand(0), newOp[0], newOp[1], + "select", &SI); + setRaisedValue(&SI, raisedValue); + addUsesToWorklist(&SI); + } + + /// Raise a phi node + /// + void RaiseVectors::visitPHINode(PHINode &PN) { + PHINode *raisedValue = + new PHINode(VectorType::get(PN.getType()), "phi", + &PN); + unsigned length = getVectorLength(&PN); + for (unsigned i = 0; i < PN.getNumIncomingValues(); ++i) + raisedValue->addIncoming(getRaisedValue(PN.getIncomingValue(i), length), + PN.getIncomingBlock(i)); + setRaisedValue(&PN, raisedValue); + addUsesToWorklist(&PN); + } + + /// Get the raised type for a given scalar type or pointer to scalar + /// type and vector length. Vector length of 0 means a non-fixed + /// length vector. + /// + const Type *RaiseVectors::getRaisedType(const Type* Ty, unsigned length) { + unsigned i = 0; + while (isa(Ty)) { + Ty = cast(Ty)->getElementType(); + ++i; + } + const Type *result = + (length == 0) ? VectorType::get(Ty) : FixedVectorType::get(Ty, length); + while (i-- > 0) { + result = PointerType::get(result); + } + return result; + } + + /// Get the (fixed) vector length of a raised instruction. Return 0 + /// if the vector is not a fixed-length vector. + /// + unsigned RaiseVectors::getVectorLength(Instruction *I) { + for (User::op_iterator OI = I->op_begin(), OE = I->op_end(); + OI != OE; ++OI) { + if (Value *val = raisingMap[*OI]) { + const Type *Ty = val->getType(); + while (isa(Ty)) + Ty = cast(Ty)->getElementType(); + if (const FixedVectorType *VT = dyn_cast(Ty)) + return VT->getNumElements(); + return 0; + } + } + assert(0 && "Instruction has no raised operands!"); + } + + /// Add the specified pair to the raising map, replacing dummy uses + /// if necessary + /// + void RaiseVectors::setRaisedValue(Instruction *key, Value *newValue) { + if (!newValue) + return; + Value*& oldValue = raisingMap[key]; + if (oldValue) { + if (oldValue->getType() != newValue->getType()) + newValue = new CastInst(oldValue, newValue->getType(), "cast", key); + oldValue->replaceAllUsesWith(newValue); + delete oldValue; + } + oldValue = newValue; + } + + /// Get the value for the specified key from the raising map. If no + /// value is there, we haven't raised the value yet, so create a + /// dummy value with the appropriate vector length and replace it + /// when the value is raised. + /// + Value *RaiseVectors::getRaisedValue(Value *key, unsigned length) { + const Type *Ty = getRaisedType(key->getType(), length); + Value*& Val = raisingMap[key]; + if (!Val) { + Val = Ty ? new Argument(Ty) : new Argument(VectorType::get(key->getType())); + DEBUG(std::cerr << "Created dummy value " << *Val << "\n"); + } + return Val; + } + + /// Get the raised operand of an instruction + /// + Value *RaiseVectors::getRaisedOperand(Instruction *I, unsigned i) { + Value *op = I->getOperand(i); + unsigned length = getVectorLength(I); + return getRaisedValue(op, length); + } + + /// Add all uses of an instruction to the worklist + /// + void RaiseVectors::addUsesToWorklist(Instruction *I) { + DEBUG(std::cerr << "Adding uses of " << *I); + for (Value::use_iterator UI = I->use_begin(), UE = I->use_end(); + UI != UE; ++UI) { + if (Instruction *II = dyn_cast(*UI)) { + DEBUG(std::cerr << "Adding " << *II); + workList.push_back(II); + } + } + } + + } Index: llvm/lib/Transforms/Vector/SSE.cpp diff -c /dev/null llvm/lib/Transforms/Vector/SSE.cpp:1.1.2.1 *** /dev/null Tue Oct 18 14:37:14 2005 --- llvm/lib/Transforms/Vector/SSE.cpp Tue Oct 18 14:37:03 2005 *************** *** 0 **** --- 1,583 ---- + //===- SSE.cpp - Raise significant functions to Vector-LLVM ------===// + // + // The LLVM Compiler Infrastructure + // + // This file was developed by the LLVM research group and is distributed under + // the University of Illinois Open Source License. See LICENSE.TXT for details. + // + //===----------------------------------------------------------------------===// + // + // This file takes blocked Vector-LLVM code and puts it in a form that + // can be passed to the SSE C Backend. + // + //===----------------------------------------------------------------------===// + + #define DEBUG_TYPE "SSE" + + #include + #include "VectorLLVM/Utils.h" + #include "llvm/Constants.h" + #include "llvm/DerivedTypes.h" + #include "llvm/Function.h" + #include "llvm/Instructions.h" + #include "llvm/Pass.h" + #include "llvm/Type.h" + #include "llvm/Support/Debug.h" + #include "llvm/ADT/hash_map" + #include "llvm/ADT/hash_set" + #include "llvm/ADT/STLExtras.h" + #include "llvm/Support/InstVisitor.h" + + using namespace llvm; + + namespace { + + + //===----------------------------------------------------------------------===// + // Class definitions + //===----------------------------------------------------------------------===// + + class SSE : public FunctionPass, public InstVisitor { + + public: + bool runOnFunction(Function &F); + void visitCastInst(CastInst &); + void visitVImmInst(VImmInst &); + void visitExtractInst(ExtractInst &); + void visitCombineInst(CombineInst &); + void visitVSelectInst(VSelectInst &); + void visitAdd(BinaryOperator &); + void visitMul(BinaryOperator &); + void visitSetCondInst(SetCondInst &); + void visitSub(BinaryOperator &); + void visitCallInst(CallInst &); + void visitShiftInst(ShiftInst &); + void visitInstruction(Instruction& I) {} + + private: + bool changed; + hash_set instructionsToDelete; + + void deleteInstructions() { + for (hash_set::iterator I = instructionsToDelete.begin(), + E = instructionsToDelete.end(); I != E; ++I) { + (*I)->dropAllReferences(); + } + for (hash_set::iterator I = instructionsToDelete.begin(), + E = instructionsToDelete.end(); I != E; ++I) { + (*I)->getParent()->getInstList().erase(*I); + } + } + void addComposeConstant(BinaryOperator&,Value*,Value*); + }; + + RegisterOpt X("sse", + "SSE code generation pre-pass"); + + + //===----------------------------------------------------------------------===// + // Helper functions + //===----------------------------------------------------------------------===// + + static unsigned getVectorSize(const Type* Ty) { + return 128 / (8 * Ty->getPrimitiveSize()); + } + + /// Check whether the type is one that SSE can handle; if not, + /// it must be lowered later. + /// + bool isProperType(const VectorType *VT) { + // Only fixed vector types are allowed + // + const FixedVectorType *FVT = dyn_cast(VT); + if (!FVT) return false; + // Vector size must be appropriate + // + return (FVT->getNumElements() == getVectorSize(FVT->getElementType())); + } + + static std::string getSSESuffix(const FixedVectorType *VecTy) { + const Type *ElTy = VecTy->getElementType(); + std::ostringstream os; + if (ElTy->isIntegral()) { + if (ElTy->isSigned()) + os << "epi" << 8*ElTy->getPrimitiveSize(); + else + os << "epu" << 8*ElTy->getPrimitiveSize(); + } else { + std::cerr << "Can't yet handle this type!\n" + << VecTy->getDescription() << "\n"; + exit(1); + } + return os.str(); + } + + static std::string getSSEName(std::string baseName, const FixedVectorType *VecTy) { + return "_mm_" + baseName + "_" + getSSESuffix(VecTy); + } + + static bool isCall(Value *V, const std::string &name) { + if (!V) return false; + if (CallInst *CI = dyn_cast(V)) + if (Function *F = CI->getCalledFunction()) + if (F->getName().substr(0, name.length()) == name) + return true; + return false; + } + + static bool isMMCall(Value *V, const std::string &name) { + return isCall(V, "_mm_" + name); + } + + static bool isComposeIntrinsic(Value *V) { + if (CallInst *CI = dyn_cast(V)) { + if (Function *F = CI->getCalledFunction()) { + if (F->getName().substr(0, 7) == "compose") + return true; + } + } + return false; + } + + static bool isFullCompose(CallInst *CI) { + if (Function *F = CI->getCalledFunction()) { + if (F && F->getName().substr(0, 11) == "fullCompose") + return true; + } + return false; + } + + + //===----------------------------------------------------------------------===// + // SSE implementation + //===----------------------------------------------------------------------===// + + /// Main function called by PassManager + /// + bool SSE::runOnFunction(Function &F) { + instructionsToDelete.clear(); + changed = false; + for (Function::iterator FI = F.begin(), FE = F.end(); + FI != FE; ++FI) + for (BasicBlock::iterator BI = FI->begin(), BE = FI->end(); + BI != BE; ++BI) + if (!instructionsToDelete.count(BI)) { + DEBUG(std::cerr << "Visiting instruction " << *BI); + visit(*BI); + } + //visit(F); + if (changed) deleteInstructions(); + return changed; + } + + void SSE::visitVImmInst(VImmInst &VL) { + const FixedVectorType *VT = dyn_cast(VL.getType()); + assert(VT && "Vimm must be fixed vector type!\n"); + CallInst *call = VectorUtils::getCallInst(VT, getSSEName("splat", VT), + VL.getOperand(0), "splat", &VL); + VL.replaceAllUsesWith(call); + instructionsToDelete.insert(&VL); + changed = true; + } + + void SSE::visitCastInst(CastInst &CI) { + const VectorType *VT = dyn_cast(CI.getType()); + if (!VT || !isProperType(VT)) + return; + if (isa(CI.getOperand(0)->getType())) { + CallInst *op0 = dyn_cast(CI.getOperand(0)); + if (op0 && isComposeIntrinsic(op0) && (CI.getType() == op0->getOperand(1)->getType())) { + CallInst *Or = VectorUtils::getCallInst(VT, "_mm_or_si128", op0->getOperand(1), + op0->getOperand(2), "or", &CI); + CI.replaceAllUsesWith(Or); + instructionsToDelete.insert(&CI); + instructionsToDelete.insert(op0); + changed = true; + } else if (op0 && isFullCompose(op0)) { + if (const FixedVectorType *LongVT = dyn_cast(op0->getType())) { + CallInst *Pack = VectorUtils::getCallInst(VT, getSSEName("pack", LongVT), + op0->getOperand(1), op0->getOperand(2), + "pack", &CI); + CI.replaceAllUsesWith(Pack); + instructionsToDelete.insert(&CI); + instructionsToDelete.insert(op0); + changed = true; + } + } + } else { + // We need to use a _mm_set instruction + // + const Type *Ty = CI.getOperand(0)->getType(); + unsigned primitiveSize = Ty->getPrimitiveSize(); + unsigned vectorSize = getVectorSize(Ty); + const FixedVectorType *RetTy = FixedVectorType::get(Ty, vectorSize); + CallInst *call = VectorUtils::getCallInst(RetTy, getSSEName("splat", RetTy), + CI.getOperand(0), "splat", &CI); + if (RetTy != CI.getType()) + CI.replaceAllUsesWith(new CastInst(call, CI.getType(), "cast", &CI)); + else + CI.replaceAllUsesWith(call); + instructionsToDelete.insert(&CI); + changed = true; + } + } + + // Check whether an extract instruction should be turned into + // SSE_unpack + // + // FIXME: This code doesn't work + // + void SSE::visitExtractInst(ExtractInst &EI) { + Value *v = EI.getOperand(0); + ConstantUInt *start = dyn_cast(EI.getOperand(1)); + ConstantUInt *stride = dyn_cast(EI.getOperand(2)); + ConstantUInt *len = dyn_cast(EI.getOperand(3)); + if (!start || !stride || !len) return; + if (stride->getValue() != 1 || len->getValue() != 8) return; + std::string funcName; + if (start->getValue() == 0) + funcName = "SSE_unpackh_short"; + else if (start->getValue() == 8) + funcName = "SSE_unpackl_short"; + else return; + const FixedVectorType *VT = dyn_cast(v->getType()); + if (VT == FixedVectorType::get(Type::UByteTy, 16)) { + if (!EI.hasOneUse()) return; + CastInst *cast = dyn_cast(*EI.use_begin()); + if (!cast) return; + const FixedVectorType *argTy = FixedVectorType::get(Type::SByteTy, 16); + const FixedVectorType *retTy = FixedVectorType::get(Type::ShortTy, 8); + if (cast->getType() != FixedVectorType::get(Type::ShortTy, 8)) + return; + CastInst *arg = new CastInst(v, argTy, "cast", &EI); + std::vector formalArgs; + formalArgs.push_back(argTy); + std::vector args; + args.push_back(arg); + FunctionType *FType = FunctionType::get(retTy, formalArgs, false); + Module *M = EI.getParent()->getParent()->getParent(); + Function *unpack = + M->getOrInsertFunction(funcName, FType); + CallInst *call = new CallInst(unpack, args, "unpack", &EI); + BinaryOperator *andInst = + BinaryOperator::create(Instruction::And, call, + ConstantExpr::getCast(ConstantSInt::get(Type::ShortTy, 0xFF), retTy), + "and", &EI); + cast->replaceAllUsesWith(andInst); + instructionsToDelete.insert(cast); + instructionsToDelete.insert(&EI); + changed = true; + } + } + + void SSE::visitCombineInst(CombineInst &CI) { + Instruction *combine1 = cast(&CI); + Value *v1 = CI.getOperand(0); + Value *v2 = CI.getOperand(1); + // If the destination is a combine instruction, do nothing; if + // necessary, we'll handle the first combine instruction in the + // series. + // + if (isa(v1)) + return; + // We must have two fixed-vector operands, and the first must have + // twice as many elements as the second. Also, the second must + // have proper type (but the first need not). + // + const FixedVectorType *VT1 = dyn_cast(v1->getType()); + if (!VT1) return; + const FixedVectorType *VT2 = dyn_cast(v2->getType()); + if (!VT2) return; + if (VT1->getNumElements() != 2*VT2->getNumElements()) return; + // This combine must have exactly one use, and it must be a + // combine whose operand 0 is this combine. The types must work + // out properly. + // + if (!CI.hasOneUse()) return; + CombineInst* combine2 = dyn_cast(*CI.use_begin()); + if (!combine2) return; + if (&CI != combine2->getOperand(0)) return; + if (combine2->getOperand(1)->getType() != VT2) return; + if (combine2->hasOneUse()) { + // Check for _mm_packs pattern. Second combine must have + // exactly one use, and it must be a cast to an appropriate + // type. + // + Instruction *use = dyn_cast(*combine2->use_begin()); + if (!use) return; + const FixedVectorType *VT = dyn_cast(use->getType()); + if (!VT) return; + if (VT->getNumElements() != VT1->getNumElements()) return; + if (!isa(use)) + return; + Value *op1, *op2; + op1 = v2; + op2 = combine2->getOperand(1); + // Right now this only works for signed values + // + Value *eight = ConstantUInt::get(Type::UByteTy, 8); + op1 = VectorUtils::getCallInst(VT2, getSSEName("slli", VT2), + op1, eight, "slli", &CI); + op1 = VectorUtils::getCallInst(VT2, getSSEName("srai", VT2), + op1, eight, "srai", &CI); + op2 = VectorUtils::getCallInst(VT2, getSSEName("slli", VT2), + op2, eight, "slli", &CI); + op2 = VectorUtils::getCallInst(VT2, getSSEName("srai", VT2), + op2, eight, "srai", &CI); + use->replaceAllUsesWith(VectorUtils::getCallInst(VT, getSSEName("packs", VT1), + op1, op2, "packs", &CI)); + instructionsToDelete.insert(use); + instructionsToDelete.insert(combine2); + instructionsToDelete.insert(&CI); + Instruction *op0 = dyn_cast(CI.getOperand(0)); + if (op0) + instructionsToDelete.insert(op0); + changed = true; + } else if (combine2->hasNUses(2)) { + Value::use_iterator I = combine2->use_begin(); + ExtractInst *extract0 = dyn_cast(*I++); + ExtractInst *extract1 = dyn_cast(*I); + assert(extract0 && extract1); + CallInst *unpackhi = VectorUtils::getCallInst(VT2, getSSEName("unpackhi", VT2), + combine1->getOperand(1), combine2->getOperand(1), + "unpackhi", extract0); + CallInst *unpacklo = VectorUtils::getCallInst(VT2, getSSEName("unpacklo", VT2), + combine1->getOperand(1), combine2->getOperand(1), + "unpacklo", extract0); + if (cast(extract0->getOperand(1))->getValue() == 1) { + extract0->replaceAllUsesWith(unpackhi); + extract1->replaceAllUsesWith(unpacklo); + } else { + extract0->replaceAllUsesWith(unpacklo); + extract1->replaceAllUsesWith(unpackhi); + } + instructionsToDelete.insert(combine1); + instructionsToDelete.insert(combine2); + instructionsToDelete.insert(extract0); + instructionsToDelete.insert(extract1); + Instruction *op0 = dyn_cast(CI.getOperand(0)); + if (op0) + instructionsToDelete.insert(op0); + changed = true; + } + } + + void SSE::visitVSelectInst(VSelectInst &VI) { + const FixedVectorType *VT = dyn_cast(VI.getType()); + if (!VT || !isProperType(VT)) return; + Value *mask = VI.getOperand(0); + CallInst *And = VectorUtils::getCallInst(VT, "_mm_and_si128", VI.getOperand(1), + mask, "and", &VI); + CallInst *AndNot = VectorUtils::getCallInst(VT, "_mm_andnot_si128", mask, + VI.getOperand(2), "andnot", &VI); + CallInst *Or = VectorUtils::getCallInst(VT, "_mm_or_si128", And, AndNot, + "or", &VI); + VI.replaceAllUsesWith(Or); + instructionsToDelete.insert(&VI); + changed = true; + } + + void SSE::visitShiftInst(ShiftInst &SI) { + const FixedVectorType *VT = dyn_cast(SI.getType()); + if (!VT) return; + CallInst *CI = dyn_cast(SI.getOperand(0)); + if (CI && isFullCompose(CI)) { + Value *op1 = CI->getOperand(1); + Value *op2 = CI->getOperand(2); + VT = cast(op1->getType()); + std::string shortName; + if (SI.getOpcode() == Instruction::Shl) + shortName = "slli"; + else if (VT->getElementType()->isSigned()) + shortName = "srai"; + else + shortName = "srli"; + CallInst *shiftLo = VectorUtils::getCallInst(VT, getSSEName(shortName, VT), + op1, SI.getOperand(1), "shiftLo", &SI); + CallInst *shiftHi = VectorUtils::getCallInst(VT, getSSEName(shortName, VT), + op2, SI.getOperand(1), "shiftHi", &SI); + CallInst *fullCompose = new CallInst(CI->getCalledFunction(), shiftLo, + shiftHi, "fullCompose", &SI); + SI.replaceAllUsesWith(fullCompose); + instructionsToDelete.insert(&SI); + instructionsToDelete.insert(CI); + changed = true; + } else if (CI && isComposeIntrinsic(CI)) { + const FixedVectorType* Ty = cast(CI->getOperand(1)->getType()); + Value *shamtLo = SI.getOperand(1); + Instruction *shamtHi = BinaryOperator::create(Instruction::Sub, ConstantUInt::get(Type::UByteTy, 16), + shamtLo, "sub", &SI); + Instruction *lo = VectorUtils::getCallInst(Ty, "_mm_srli_" + getSSESuffix(Ty), + CI->getOperand(1), shamtLo, "lo", &SI); + Instruction *hi = VectorUtils::getCallInst(Ty, "_mm_slli_" + getSSESuffix(Ty), + CI->getOperand(2), shamtHi, "hi", &SI); + Instruction *compose = new CallInst(CI->getCalledFunction(), lo, hi, "compose", &SI); + SI.replaceAllUsesWith(compose); + instructionsToDelete.insert(&SI); + instructionsToDelete.insert(CI); + changed = true; + } else { + std::string shortName; + if (SI.getOpcode() == Instruction::Shr) { + if (VT->getElementType()->isSigned()) + shortName = "srai"; + else + shortName = "srli"; + } else { + shortName = "slli"; + } + CallInst *shift = VectorUtils::getCallInst(VT, getSSEName(shortName, VT), + SI.getOperand(0), SI.getOperand(1), + "shift", &SI); + SI.replaceAllUsesWith(shift); + instructionsToDelete.insert(&SI); + changed = true; + } + } + + static const Type *getSignedType(const Type *Ty) { + if (Ty->isSigned()) + return Ty; + switch(Ty->getTypeID()) { + case Type::UIntTyID: + return Type::IntTy; + default: + std::cerr << "Can't handle type " << Ty->getDescription() << "\n"; + } + return 0; + } + + void SSE::addComposeConstant(BinaryOperator &Add, + Value *arg1, Value *arg2) { + CallInst *compose = dyn_cast(arg1);//Add.getOperand(0)); + if (!compose || !isComposeIntrinsic(compose) || !compose->hasOneUse()) return; + Value *op1 = compose->getOperand(1); + Value *op2 = compose->getOperand(2); + CastInst *addCast0 = dyn_cast(arg2);//Add.getOperand(1)); + if (!addCast0) return; + CallInst *splat = dyn_cast(addCast0->getOperand(0)); + if (!isMMCall(splat, "splat")) return; + Constant *C = dyn_cast(splat->getOperand(1)); + if (!C) return; + const FixedVectorType *LongVT = dyn_cast(Add.getType()); + const FixedVectorType *ShortVT = dyn_cast(op1->getType()); + if (!LongVT || !ShortVT) return; + const FixedVectorType *HalfVT = FixedVectorType::get(getSignedType(LongVT->getElementType()), + LongVT->getNumElements() / 2); + CallInst *splat2 = VectorUtils::getCallInst(HalfVT, getSSEName("splat", HalfVT), + C, "splat", &Add); + CallInst *unpackLo = VectorUtils::getCallInst(HalfVT, getSSEName("unpacklo", ShortVT), + op1, op2, "unpackLo", &Add); + CallInst *unpackHi = VectorUtils::getCallInst(HalfVT, getSSEName("unpackhi", ShortVT), + op1, op2, "unpackHi", &Add); + CallInst *addLo = VectorUtils::getCallInst(HalfVT, getSSEName("add", HalfVT), + unpackLo, splat2, "addLo", &Add); + CallInst *addHi = VectorUtils::getCallInst(HalfVT, getSSEName("add", HalfVT), + unpackHi, splat2, "addHi", &Add); + CallInst *fullCompose = VectorUtils::getCallInst(LongVT, "fullCompose_" + HalfVT->getElementType()->getDescription(), + addLo, addHi, "fullCompose", &Add); + Add.replaceAllUsesWith(fullCompose); + instructionsToDelete.insert(addCast0); + instructionsToDelete.insert(splat); + instructionsToDelete.insert(compose); + instructionsToDelete.insert(&Add); + changed = true; + } + + /// FIXME: This is very specialized to the form add(compose, + /// cast(cast(constant))). Generalize this!!! + /// + void SSE::visitAdd(BinaryOperator &Add) { + addComposeConstant(Add, Add.getOperand(0), Add.getOperand(1)); + addComposeConstant(Add, Add.getOperand(1), Add.getOperand(0)); + } + + void SSE::visitMul(BinaryOperator &BO) { + CastInst *op0 = dyn_cast(BO.getOperand(0)); + CastInst *op1 = dyn_cast(BO.getOperand(1)); + if (!op0 || !op1) return; + const FixedVectorType *Ty = dyn_cast(op0->getType()); + const FixedVectorType* RetTy = dyn_cast(op0->getOperand(0)->getType()); + if (Ty && RetTy) { + Instruction *hi = VectorUtils::getCallInst(RetTy, "_mm_mulhi_" + getSSESuffix(RetTy), + op0->getOperand(0), op1->getOperand(0), + "mul", &BO); + Instruction *lo = VectorUtils::getCallInst(RetTy, "_mm_mullo_" + getSSESuffix(RetTy), + op0->getOperand(0), op1->getOperand(0), + "mul", &BO); + Instruction *result = VectorUtils::getCallInst(Ty, "compose_" + RetTy->getElementType()->getDescription(), + lo, hi, "compose", &BO); + BO.replaceAllUsesWith(result); + instructionsToDelete.insert(&BO); + instructionsToDelete.insert(op0); + instructionsToDelete.insert(op1); + changed = true; + } + } + + void SSE::visitSetCondInst(SetCondInst &BO) { + const FixedVectorType *VT = + dyn_cast(BO.getOperand(0)->getType()); + if (!VT) return; + std::string name; + switch(BO.getOpcode()) { + case Instruction::VSetGT: + name = "cmpgt"; + break; + default: + std::cerr << "Can't handle instruction " << BO; + exit(1); + } + std::string fullName = "_mm_" + name + "_" + getSSESuffix(VT); + CallInst *call = + VectorUtils::getCallInst(BO.getType(), fullName, + BO.getOperand(0), BO.getOperand(1), + "cmp", &BO); + BO.replaceAllUsesWith(call); + instructionsToDelete.insert(&BO); + changed = true; + } + + void SSE::visitSub(BinaryOperator &BO) { + const FixedVectorType *VT = + dyn_cast(BO.getOperand(0)->getType()); + if (!VT) return; + CallInst *sub = VectorUtils::getCallInst(VT, getSSEName("sub", VT), + BO.getOperand(0), BO.getOperand(1), + "sub", &BO); + BO.replaceAllUsesWith(sub); + instructionsToDelete.insert(&BO); + changed = true; + } + + void SSE::visitCallInst(CallInst &CI) { + const FixedVectorType *VT = + dyn_cast(CI.getType()); + if (!VT || !isProperType(VT)) return; + Function *callee = CI.getCalledFunction(); + if (!callee) return; + std::string calleeName = callee->getName(); + std::string prefix = calleeName.substr(0, 6); + if (prefix != "vllvm_") return; + unsigned pos = calleeName.find("_", 6); + if (pos == std::string::npos) { + std::cerr << "Bad syntax for Vector-LLVM intrinsic " << calleeName << "\n"; + exit(1); + } + std::string shortName = calleeName.substr(6, pos-6); + if (shortName == "saturate") { + return; + } else { + std::string fullName = "_mm_" + shortName + "_" + + getSSESuffix(VT); + std::vector args; + for (unsigned i = 1; i < CI.getNumOperands(); ++i) + args.push_back(CI.getOperand(i)); + CallInst *call = VectorUtils::getCallInst(VT, fullName, args, "mm_call", &CI); + CI.replaceAllUsesWith(call); + instructionsToDelete.insert(&CI); + } + changed = true; + } + + } From bocchino at cs.uiuc.edu Tue Oct 18 14:45:02 2005 From: bocchino at cs.uiuc.edu (Robert Bocchino) Date: Tue, 18 Oct 2005 14:45:02 -0500 Subject: [llvm-commits] [vector_llvm] CVS: llvm/lib/Transforms/Vector/LowerFixedVector.cpp Message-ID: <200510181945.OAA20824@zion.cs.uiuc.edu> Changes in directory llvm/lib/Transforms/Vector: LowerFixedVector.cpp added (r1.1.2.1) --- Log message: Initial commit of Vector LLVM. --- Diffs of the changes: (+362 -0) LowerFixedVector.cpp | 362 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 362 insertions(+) Index: llvm/lib/Transforms/Vector/LowerFixedVector.cpp diff -c /dev/null llvm/lib/Transforms/Vector/LowerFixedVector.cpp:1.1.2.1 *** /dev/null Tue Oct 18 14:45:01 2005 --- llvm/lib/Transforms/Vector/LowerFixedVector.cpp Tue Oct 18 14:44:51 2005 *************** *** 0 **** --- 1,362 ---- + //===- LowerFixedVector.cpp - Implementation of LowerFixedVector Transform ---------===// + // + // The LLVM Compiler Infrastructure + // + // This file was developed by Brad Jones and is distributed under + // the University of Illinois Open Source License. See LICENSE.TXT for details. + // + //===----------------------------------------------------------------------===// + // + // This file implements lowering FixedVector datatypes into more primitive + // FixedVector datatypes, and finally to scalar operations. + // + //===----------------------------------------------------------------------===// + + #include "llvm/Transforms/Scalar.h" + #include "llvm/Argument.h" + #include "llvm/Constants.h" + #include "llvm/DerivedTypes.h" + #include "llvm/Function.h" + #include "llvm/Instructions.h" + #include "llvm/Pass.h" + #include "llvm/Support/InstVisitor.h" + #include "llvm/ADT/StringExtras.h" + #include + #include + #include + + using namespace llvm; + + namespace { + + /// This pass converts fixed-length vector operators to an equivalent + /// operations on smaller fixed-length vector data, to possibly scalar + /// operations. Currently it supports lowering to scalar operations. + /// + /// @brief Transforms fixed-length vector instructions to simpler instructions. + /// + class LowerFixedVector : public FunctionPass, public InstVisitor { + public: + /// @brief Lowers fixed-length vector operations to scalar operations. + /// @param F The fuction to process + virtual bool runOnFunction(Function &F); + + /// @brief Lowers fixed-length vector load instructions. + /// @param LI the load instruction to convert + void visitLoadInst(LoadInst& LI); + + /// @brief Lowers fixed-length vector store instructions. + /// @param SI the store instruction to convert + void visitStoreInst(StoreInst& SI); + + /// @brief Lowers fixed-length vector binary operations. + /// @param BO the binary operator to convert + void visitBinaryOperator(BinaryOperator& BO); + + /// @brief Lowers fixed-length vector select instructions. + /// @param SELI the select operator to convert + void visitSelectInst(SelectInst& SELI); + + /// This function asserts if the instruction is a FixedVectorType but + /// is handled by another function. + /// + /// @brief Asserts if FixedVectorType instruction is not handled elsewhere. + /// @param I the unhandled instruction + void visitInstruction(Instruction &I) + { + if(isa(I.getType())) { + std::cerr << "Unhandled Instruction with FixedVector ReturnType: " << + I << '\n'; + } + } + private: + /// @brief Retrieves lowered values for a fixed-length vector value. + /// @param val the fixed-length vector value + /// @return the lowered values + std::vector& getValues(Value* val); + + /// @brief Sets lowered values for a fixed-length vector value. + /// @param val the fixed-length vector value + /// @param values the corresponding lowered values + void setValues(Value* val,const std::vector& values); + + // Data Members + /// @brief whether we changed the function or not + bool Changed; + + /// @brief a map from old fixed-length vector values to new smaller fixed-length vector values + std::map > fixedVectorToScalarMap; + + /// Instructions in the source program to get rid of + /// after we do a pass (the old fixed-length vector instructions) + std::vector instrsToRemove; + }; + + RegisterOpt + X("lower-fixed-vector", + "lowers fixed-length vector operations to operations on smaller fixed-length vector datatypes"); + + } // end namespace + + FunctionPass *llvm::createLowerFixedVectorPass() { return new LowerFixedVector(); } + + + // This function sets lowered values for a corresponding + // fixed-length vector value. Note, in the case of a forward reference + // getValues(Value*) will have already been called for + // the fixed-length vector parameter. This function will then replace + // all references in the in the function of the "dummy" + // value the previous getValues(Value*) call + // returned with actual references. + void LowerFixedVector::setValues(Value* value,const std::vector& values) + { + std::map >::iterator it = + fixedVectorToScalarMap.lower_bound(value); + if (it == fixedVectorToScalarMap.end() || it->first != value) { + // there was not a forward reference to this element + fixedVectorToScalarMap.insert(it,std::make_pair(value,values)); + } + else { + // replace forward declarations with actual definitions + assert(it->second.size() == values.size() && + "Error forward refences and actual definition differ in size"); + for (unsigned i = 0, e = values.size(); i != e; ++i) { + // replace and get rid of old forward references + it->second[i]->replaceAllUsesWith(values[i]); + delete it->second[i]; + it->second[i] = values[i]; + } + } + } + + // This function will examine the fixed-length vector value parameter + // and if it is a fixed-length vector constant or a forward reference + // properly create the lowered values needed. Otherwise + // it will simply retreive values from a + // setValues(Value*,const std::vector&) + // call. Failing both of these cases, it will abort + // the program. + std::vector& LowerFixedVector::getValues(Value* value) + { + assert(isa(value->getType()) && + "Value must be FixedVectorType"); + + // reject further processing if this one has + // already been handled + std::map >::iterator it = + fixedVectorToScalarMap.lower_bound(value); + if (it != fixedVectorToScalarMap.end() && it->first == value) { + return it->second; + } + + if (ConstantVector* CP = dyn_cast(value)) { + // non-zero constant case + std::vector results; + results.reserve(CP->getNumOperands()); + for (unsigned i = 0, e = CP->getNumOperands(); i != e; ++i) { + results.push_back(CP->getOperand(i)); + } + return fixedVectorToScalarMap.insert(it, + std::make_pair(value,results))->second; + } + else if (ConstantAggregateZero* CAZ = + dyn_cast(value)) { + // zero constant + const FixedVectorType* PKT = cast(CAZ->getType()); + std::vector results; + results.reserve(PKT->getNumElements()); + + Constant* C = Constant::getNullValue(PKT->getElementType()); + for (unsigned i = 0, e = PKT->getNumElements(); i != e; ++i) { + results.push_back(C); + } + return fixedVectorToScalarMap.insert(it, + std::make_pair(value,results))->second; + } + else if (isa(value)) { + // foward reference + const FixedVectorType* PKT = cast(value->getType()); + std::vector results; + results.reserve(PKT->getNumElements()); + + for (unsigned i = 0, e = PKT->getNumElements(); i != e; ++i) { + results.push_back(new Argument(PKT->getElementType())); + } + return fixedVectorToScalarMap.insert(it, + std::make_pair(value,results))->second; + } + else { + // we don't know what it is, and we are trying to retrieve + // a value for it + assert(false && "Unhandled FixedVectorType value"); + abort(); + } + } + + void LowerFixedVector::visitLoadInst(LoadInst& LI) + { + // Make sure what we are dealing with is a fixed-length vector type + if (const FixedVectorType* PKT = dyn_cast(LI.getType())) { + // Initialization, Idx is needed for getelementptr needed later + std::vector Idx(2); + Idx[0] = ConstantUInt::get(Type::UIntTy,0); + + ArrayType* AT = ArrayType::get(PKT->getContainedType(0), + PKT->getNumElements()); + PointerType* APT = PointerType::get(AT); + + // Cast the fixed-length vector type to an array + Value* array = new CastInst(LI.getPointerOperand(), + APT, + LI.getName() + ".a", + &LI); + + // Convert this load into num elements number of loads + std::vector values; + values.reserve(PKT->getNumElements()); + + for (unsigned i = 0, e = PKT->getNumElements(); i != e; ++i) { + // Calculate the second index we will need + Idx[1] = ConstantUInt::get(Type::UIntTy,i); + + // Get the pointer + Value* val = new GetElementPtrInst(array, + Idx, + LI.getName() + + ".ge." + utostr(i), + &LI); + + // generate the new load and save the result in fixedVectorToScalar map + values.push_back(new LoadInst(val, + LI.getName()+"."+utostr(i), + LI.isVolatile(), + &LI)); + } + + setValues(&LI,values); + Changed = true; + instrsToRemove.push_back(&LI); + } + } + + void LowerFixedVector::visitBinaryOperator(BinaryOperator& BO) + { + // Make sure both operands are FixedVectorTypes + if (isa(BO.getOperand(0)->getType())) { + std::vector& op0Vals = getValues(BO.getOperand(0)); + std::vector& op1Vals = getValues(BO.getOperand(1)); + std::vector result; + assert((op0Vals.size() == op1Vals.size()) && + "The two fixed-length vector operand to scalar maps must be equal in size."); + + result.reserve(op0Vals.size()); + + // generate the new binary op and save the result + for (unsigned i = 0; i != op0Vals.size(); ++i) { + result.push_back(BinaryOperator::create(BO.getOpcode(), + op0Vals[i], + op1Vals[i], + BO.getName() + + "." + utostr(i), + &BO)); + } + + setValues(&BO,result); + Changed = true; + instrsToRemove.push_back(&BO); + } + } + + void LowerFixedVector::visitStoreInst(StoreInst& SI) + { + if (const FixedVectorType* PKT = + dyn_cast(SI.getOperand(0)->getType())) { + // We will need this for getelementptr + std::vector Idx(2); + Idx[0] = ConstantUInt::get(Type::UIntTy,0); + + ArrayType* AT = ArrayType::get(PKT->getContainedType(0), + PKT->getNumElements()); + PointerType* APT = PointerType::get(AT); + + // cast the fixed-length vector to an array type + Value* array = new CastInst(SI.getPointerOperand(), + APT, + "store.ge.a.", + &SI); + std::vector& values = getValues(SI.getOperand(0)); + + assert((values.size() == PKT->getNumElements()) && + "Scalar must have the same number of elements as FixedVector Type"); + + for (unsigned i = 0, e = PKT->getNumElements(); i != e; ++i) { + // Generate the indices for getelementptr + Idx[1] = ConstantUInt::get(Type::UIntTy,i); + Value* val = new GetElementPtrInst(array, + Idx, + "store.ge." + + utostr(i) + ".", + &SI); + new StoreInst(values[i], val, SI.isVolatile(),&SI); + } + + Changed = true; + instrsToRemove.push_back(&SI); + } + } + + void LowerFixedVector::visitSelectInst(SelectInst& SELI) + { + // Make sure both operands are FixedVectorTypes + if (isa(SELI.getType())) { + std::vector& op0Vals = getValues(SELI.getTrueValue()); + std::vector& op1Vals = getValues(SELI.getFalseValue()); + std::vector result; + + assert((op0Vals.size() == op1Vals.size()) && + "The two fixed-length vector operand to scalar maps must be equal in size."); + + for (unsigned i = 0; i != op0Vals.size(); ++i) { + result.push_back(new SelectInst(SELI.getCondition(), + op0Vals[i], + op1Vals[i], + SELI.getName()+ "." + utostr(i), + &SELI)); + } + + setValues(&SELI,result); + Changed = true; + instrsToRemove.push_back(&SELI); + } + } + + bool LowerFixedVector::runOnFunction(Function& F) + { + // initialize + Changed = false; + + // Does three passes: + // Pass 1) Converts FixedVector Operations to + // new FixedVector Operations on smaller + // datatypes + visit(F); + + // Pass 2) Drop all references + std::for_each(instrsToRemove.begin(), + instrsToRemove.end(), + std::mem_fun(&Instruction::dropAllReferences)); + + // Pass 3) Delete the Instructions to remove aka fixed-length vector instructions + for (std::vector::iterator i = instrsToRemove.begin(), + e = instrsToRemove.end(); + i != e; ++i) { + (*i)->getParent()->getInstList().erase(*i); + } + + // clean-up + fixedVectorToScalarMap.clear(); + instrsToRemove.clear(); + + return Changed; + } + From bocchino at cs.uiuc.edu Tue Oct 18 14:45:36 2005 From: bocchino at cs.uiuc.edu (Robert Bocchino) Date: Tue, 18 Oct 2005 14:45:36 -0500 Subject: [llvm-commits] [vector_llvm] CVS: llvm/lib/Transforms/Scalar/LowerPacked.cpp Message-ID: <200510181945.OAA20839@zion.cs.uiuc.edu> Changes in directory llvm/lib/Transforms/Scalar: LowerPacked.cpp (r1.5) removed --- Log message: Initial commit of Vector LLVM. --- Diffs of the changes: (+0 -0) 0 files changed From bocchino at cs.uiuc.edu Tue Oct 18 14:49:13 2005 From: bocchino at cs.uiuc.edu (Robert Bocchino) Date: Tue, 18 Oct 2005 14:49:13 -0500 Subject: [llvm-commits] [vector_llvm] CVS: llvm/lib/Transforms/Vector/Makefile Message-ID: <200510181949.OAA23462@zion.cs.uiuc.edu> Changes in directory llvm/lib/Transforms/Vector: Makefile added (r1.1.2.1) --- Log message: Initial commit of Vector LLVM. --- Diffs of the changes: (+14 -0) Makefile | 14 ++++++++++++++ 1 files changed, 14 insertions(+) Index: llvm/lib/Transforms/Vector/Makefile diff -c /dev/null llvm/lib/Transforms/Vector/Makefile:1.1.2.1 *** /dev/null Tue Oct 18 14:49:12 2005 --- llvm/lib/Transforms/Vector/Makefile Tue Oct 18 14:49:02 2005 *************** *** 0 **** --- 1,14 ---- + ##===- lib/Transforms/Scalar/Makefile ----------------------*- Makefile -*-===## + # + # The LLVM Compiler Infrastructure + # + # This file was developed by the LLVM research group and is distributed under + # the University of Illinois Open Source License. See LICENSE.TXT for details. + # + ##===----------------------------------------------------------------------===## + LEVEL = ../../.. + LIBRARYNAME = LLVMVectorOpts + BUILD_ARCHIVE = 1 + + include $(LEVEL)/Makefile.common + From bocchino at cs.uiuc.edu Tue Oct 18 14:50:49 2005 From: bocchino at cs.uiuc.edu (Robert Bocchino) Date: Tue, 18 Oct 2005 14:50:49 -0500 Subject: [llvm-commits] [vector_llvm] CVS: llvm/lib/Transforms/Makefile Message-ID: <200510181950.OAA23799@zion.cs.uiuc.edu> Changes in directory llvm/lib/Transforms: Makefile updated: 1.9.6.1 -> 1.9.6.2 --- Log message: Don't build TLS. --- Diffs of the changes: (+1 -1) Makefile | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm/lib/Transforms/Makefile diff -u llvm/lib/Transforms/Makefile:1.9.6.1 llvm/lib/Transforms/Makefile:1.9.6.2 --- llvm/lib/Transforms/Makefile:1.9.6.1 Tue Oct 18 14:21:57 2005 +++ llvm/lib/Transforms/Makefile Tue Oct 18 14:50:38 2005 @@ -7,7 +7,7 @@ # ##===----------------------------------------------------------------------===## LEVEL = ../.. -PARALLEL_DIRS = Utils Instrumentation Scalar IPO Vector TLS +PARALLEL_DIRS = Utils Instrumentation Scalar IPO Vector LIBRARYNAME = LLVMTransforms BUILD_ARCHIVE = 1 From bocchino at persephone.cs.uiuc.edu Tue Oct 18 15:09:11 2005 From: bocchino at persephone.cs.uiuc.edu (Robert L. Bocchino Jr.) Date: Tue, 18 Oct 2005 15:09:11 -0500 (CDT) Subject: [llvm-commits] [vector_llvm] CVS: llvm/autoconf/configure.ac Message-ID: <20051018200911.53EF817AAF4D@persephone.cs.uiuc.edu> Changes in directory llvm/autoconf: configure.ac updated: 1.195.2.1 -> 1.195.2.2 --- Log message: Removed a spurious target from TARGETS_TO_BUILD. --- Diffs of the changes: (+1 -1) configure.ac | 2 +- 1 files changed, 1 insertion, 1 deletion Index: llvm/autoconf/configure.ac diff -u llvm/autoconf/configure.ac:1.195.2.1 llvm/autoconf/configure.ac:1.195.2.2 --- llvm/autoconf/configure.ac:1.195.2.1 Tue Oct 18 14:21:55 2005 +++ llvm/autoconf/configure.ac Tue Oct 18 15:08:37 2005 @@ -249,7 +249,7 @@ [Build specific host targets: all,host-only,{target-name} (default=all)]),, enableval=all) case "$enableval" in - all) TARGETS_TO_BUILD="X86 SparcV8 SparcV9 PowerPC Alpha IA64 Skeleton RSVP RSVP2" ;; + all) TARGETS_TO_BUILD="X86 SparcV8 SparcV9 PowerPC Alpha IA64 Skeleton" ;; host-only) case "$llvm_cv_target_arch" in x86) TARGETS_TO_BUILD="X86" ;; From reid at x10sys.com Tue Oct 18 15:35:01 2005 From: reid at x10sys.com (Reid Spencer) Date: Tue, 18 Oct 2005 13:35:01 -0700 Subject: [llvm-commits] CVS: llvm/runtime/libprofile/Makefile In-Reply-To: <200510181849.NAA11098@zion.cs.uiuc.edu> References: <200510181849.NAA11098@zion.cs.uiuc.edu> Message-ID: <43555C75.9090308@x10sys.com> Chris, Shouldn't that be LLVM_SRC_DIR? PROJ_SRC_DIR is going to make the makefile think that its somewhere in llvm/projects/X. Reid. Chris Lattner wrote: > Changes in directory llvm/runtime/libprofile: > > Makefile updated: 1.7 -> 1.8 > --- > Log message: > > This was never updated for the project makefile changes > > > --- > Diffs of the changes: (+1 -1) > > Makefile | 2 +- > 1 files changed, 1 insertion(+), 1 deletion(-) > > > Index: llvm/runtime/libprofile/Makefile > diff -u llvm/runtime/libprofile/Makefile:1.7 llvm/runtime/libprofile/Makefile:1.8 > --- llvm/runtime/libprofile/Makefile:1.7 Thu Jan 13 10:53:05 2005 > +++ llvm/runtime/libprofile/Makefile Tue Oct 18 13:49:11 2005 > @@ -13,7 +13,7 @@ > LOADABLE_MODULE = 1 > LIBRARYNAME = profile_rt > EXTRA_DIST = exported_symbols.lst > -EXPORTED_SYMBOL_FILE = $(BUILD_SRC_DIR)/exported_symbols.lst > +EXPORTED_SYMBOL_FILE = $(PROJ_SRC_DIR)/exported_symbols.lst > BYTECODE_DESTINATION = $(CFERuntimeLibDir) > > include $(LEVEL)/Makefile.common > > > > _______________________________________________ > llvm-commits mailing list > llvm-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits > From sabre at nondot.org Tue Oct 18 15:36:01 2005 From: sabre at nondot.org (Chris Lattner) Date: Tue, 18 Oct 2005 15:36:01 -0500 (CDT) Subject: [llvm-commits] CVS: llvm/runtime/libprofile/Makefile In-Reply-To: <43555C75.9090308@x10sys.com> References: <200510181849.NAA11098@zion.cs.uiuc.edu> <43555C75.9090308@x10sys.com> Message-ID: On Tue, 18 Oct 2005, Reid Spencer wrote: > Shouldn't that be LLVM_SRC_DIR? PROJ_SRC_DIR is going to make the makefile > think that its somewhere in llvm/projects/X. I don't think so. PROJ_SRC_DIR should be llvm/ for the main llvm tree. -Chris > Chris Lattner wrote: >> Changes in directory llvm/runtime/libprofile: >> >> Makefile updated: 1.7 -> 1.8 >> --- >> Log message: >> >> This was never updated for the project makefile changes >> >> >> --- >> Diffs of the changes: (+1 -1) >> >> Makefile | 2 +- >> 1 files changed, 1 insertion(+), 1 deletion(-) >> >> >> Index: llvm/runtime/libprofile/Makefile >> diff -u llvm/runtime/libprofile/Makefile:1.7 >> llvm/runtime/libprofile/Makefile:1.8 >> --- llvm/runtime/libprofile/Makefile:1.7 Thu Jan 13 10:53:05 2005 >> +++ llvm/runtime/libprofile/Makefile Tue Oct 18 13:49:11 2005 >> @@ -13,7 +13,7 @@ >> LOADABLE_MODULE = 1 >> LIBRARYNAME = profile_rt >> EXTRA_DIST = exported_symbols.lst >> -EXPORTED_SYMBOL_FILE = $(BUILD_SRC_DIR)/exported_symbols.lst >> +EXPORTED_SYMBOL_FILE = $(PROJ_SRC_DIR)/exported_symbols.lst >> BYTECODE_DESTINATION = $(CFERuntimeLibDir) >> include $(LEVEL)/Makefile.common >> >> >> >> _______________________________________________ >> llvm-commits mailing list >> llvm-commits at cs.uiuc.edu >> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits >> > -Chris -- http://nondot.org/sabre/ http://llvm.org/ From lattner at cs.uiuc.edu Tue Oct 18 17:11:54 2005 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Tue, 18 Oct 2005 17:11:54 -0500 Subject: [llvm-commits] CVS: llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp Message-ID: <200510182211.RAA31499@zion.cs.uiuc.edu> Changes in directory llvm/lib/CodeGen/SelectionDAG: SelectionDAGISel.cpp updated: 1.88 -> 1.89 --- Log message: remove hack --- Diffs of the changes: (+1 -3) SelectionDAGISel.cpp | 4 +--- 1 files changed, 1 insertion(+), 3 deletions(-) Index: llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp diff -u llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:1.88 llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:1.89 --- llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:1.88 Mon Oct 10 11:47:10 2005 +++ llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp Tue Oct 18 17:11:42 2005 @@ -151,9 +151,7 @@ // FIXME: This could be made better with a preferred alignment hook in // TargetData. It serves primarily to 8-byte align doubles for X86. if (Align < TySize && TySize <= 8) Align = TySize; - - if (CUI->getValue()) // Don't produce zero sized stack objects - TySize *= CUI->getValue(); // Get total allocated size. + TySize *= CUI->getValue(); // Get total allocated size. StaticAllocaMap[AI] = MF.getFrameInfo()->CreateStackObject((unsigned)TySize, Align); } From lattner at cs.uiuc.edu Tue Oct 18 17:13:52 2005 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Tue, 18 Oct 2005 17:13:52 -0500 Subject: [llvm-commits] CVS: llvm/test/Regression/CodeGen/Generic/2005-10-18-ZeroSizeStackObject.ll Message-ID: <200510182213.RAA31609@zion.cs.uiuc.edu> Changes in directory llvm/test/Regression/CodeGen/Generic: 2005-10-18-ZeroSizeStackObject.ll added (r1.1) --- Log message: new testcase --- Diffs of the changes: (+6 -0) 2005-10-18-ZeroSizeStackObject.ll | 6 ++++++ 1 files changed, 6 insertions(+) Index: llvm/test/Regression/CodeGen/Generic/2005-10-18-ZeroSizeStackObject.ll diff -c /dev/null llvm/test/Regression/CodeGen/Generic/2005-10-18-ZeroSizeStackObject.ll:1.1 *** /dev/null Tue Oct 18 17:13:50 2005 --- llvm/test/Regression/CodeGen/Generic/2005-10-18-ZeroSizeStackObject.ll Tue Oct 18 17:13:40 2005 *************** *** 0 **** --- 1,6 ---- + ; RUN: llvm-as < %s | llc + + void %test() { + %X = alloca {} + ret void + } From lattner at cs.uiuc.edu Tue Oct 18 17:14:17 2005 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Tue, 18 Oct 2005 17:14:17 -0500 Subject: [llvm-commits] CVS: llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp Message-ID: <200510182214.RAA31623@zion.cs.uiuc.edu> Changes in directory llvm/lib/CodeGen/SelectionDAG: SelectionDAGISel.cpp updated: 1.89 -> 1.90 --- Log message: Fix Generic/2005-10-18-ZeroSizeStackObject.ll by not requesting a zero sized stack object if either the array size or the type size is zero. --- Diffs of the changes: (+1 -0) SelectionDAGISel.cpp | 1 + 1 files changed, 1 insertion(+) Index: llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp diff -u llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:1.89 llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:1.90 --- llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:1.89 Tue Oct 18 17:11:42 2005 +++ llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp Tue Oct 18 17:14:06 2005 @@ -152,6 +152,7 @@ // TargetData. It serves primarily to 8-byte align doubles for X86. if (Align < TySize && TySize <= 8) Align = TySize; TySize *= CUI->getValue(); // Get total allocated size. + if (TySize == 0) TySize = 1; // Don't create zero-sized stack objects. StaticAllocaMap[AI] = MF.getFrameInfo()->CreateStackObject((unsigned)TySize, Align); } From natebegeman at mac.com Tue Oct 18 18:23:49 2005 From: natebegeman at mac.com (Nate Begeman) Date: Tue, 18 Oct 2005 18:23:49 -0500 Subject: [llvm-commits] CVS: llvm/include/llvm/Target/TargetLowering.h Message-ID: <200510182323.SAA32071@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm/Target: TargetLowering.h updated: 1.24 -> 1.25 --- Log message: Add the ability to lower return instructions to TargetLowering. This allows us to lower legal return types to something else, to meet ABI requirements (such as that i64 be returned in two i32 regs on Darwin/ppc). --- Diffs of the changes: (+6 -0) TargetLowering.h | 6 ++++++ 1 files changed, 6 insertions(+) Index: llvm/include/llvm/Target/TargetLowering.h diff -u llvm/include/llvm/Target/TargetLowering.h:1.24 llvm/include/llvm/Target/TargetLowering.h:1.25 --- llvm/include/llvm/Target/TargetLowering.h:1.24 Tue Sep 27 17:13:36 2005 +++ llvm/include/llvm/Target/TargetLowering.h Tue Oct 18 18:23:37 2005 @@ -311,6 +311,12 @@ unsigned CallingConv, bool isTailCall, SDOperand Callee, ArgListTy &Args, SelectionDAG &DAG) = 0; + /// LowerReturnTo - This hook lowers a return instruction into the appropriate + /// legal ISD::RET node for the target's current ABI. This method is optional + /// and is intended for targets that need non-standard behavior. + virtual SDOperand LowerReturnTo(SDOperand Chain, SDOperand Op, + SelectionDAG &DAG); + /// LowerVAStart - This lowers the llvm.va_start intrinsic. If not /// implemented, this method prints a message and aborts. This method should /// return the modified chain value. Note that VAListPtr* correspond to the From natebegeman at mac.com Tue Oct 18 18:23:50 2005 From: natebegeman at mac.com (Nate Begeman) Date: Tue, 18 Oct 2005 18:23:50 -0500 Subject: [llvm-commits] CVS: llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp Message-ID: <200510182323.SAA32075@zion.cs.uiuc.edu> Changes in directory llvm/lib/CodeGen/SelectionDAG: SelectionDAGISel.cpp updated: 1.90 -> 1.91 --- Log message: Add the ability to lower return instructions to TargetLowering. This allows us to lower legal return types to something else, to meet ABI requirements (such as that i64 be returned in two i32 regs on Darwin/ppc). --- Diffs of the changes: (+7 -2) SelectionDAGISel.cpp | 9 +++++++-- 1 files changed, 7 insertions(+), 2 deletions(-) Index: llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp diff -u llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:1.90 llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:1.91 --- llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:1.90 Tue Oct 18 17:14:06 2005 +++ llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp Tue Oct 18 18:23:37 2005 @@ -450,8 +450,8 @@ case MVT::f64: break; // No extension needed! } - - DAG.setRoot(DAG.getNode(ISD::RET, MVT::Other, getRoot(), Op1)); + // Allow targets to lower this further to meet ABI requirements + DAG.setRoot(TLI.LowerReturnTo(getRoot(), Op1, DAG)); } void SelectionDAGLowering::visitBr(BranchInst &I) { @@ -898,6 +898,11 @@ return 0; } +SDOperand TargetLowering::LowerReturnTo(SDOperand Chain, SDOperand Op, + SelectionDAG &DAG) { + return DAG.getNode(ISD::RET, MVT::Other, Chain, Op); +} + SDOperand TargetLowering::LowerVAStart(SDOperand Chain, SDOperand VAListP, Value *VAListV, SelectionDAG &DAG) { From natebegeman at mac.com Tue Oct 18 18:23:50 2005 From: natebegeman at mac.com (Nate Begeman) Date: Tue, 18 Oct 2005 18:23:50 -0500 Subject: [llvm-commits] CVS: llvm/lib/Target/PowerPC/PPCISelDAGToDAG.cpp PPCISelLowering.cpp PPCISelLowering.h Message-ID: <200510182323.SAA32083@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/PowerPC: PPCISelDAGToDAG.cpp updated: 1.108 -> 1.109 PPCISelLowering.cpp updated: 1.33 -> 1.34 PPCISelLowering.h updated: 1.8 -> 1.9 --- Log message: Add the ability to lower return instructions to TargetLowering. This allows us to lower legal return types to something else, to meet ABI requirements (such as that i64 be returned in two i32 regs on Darwin/ppc). --- Diffs of the changes: (+32 -5) PPCISelDAGToDAG.cpp | 21 ++++++++++++++++----- PPCISelLowering.cpp | 13 +++++++++++++ PPCISelLowering.h | 3 +++ 3 files changed, 32 insertions(+), 5 deletions(-) Index: llvm/lib/Target/PowerPC/PPCISelDAGToDAG.cpp diff -u llvm/lib/Target/PowerPC/PPCISelDAGToDAG.cpp:1.108 llvm/lib/Target/PowerPC/PPCISelDAGToDAG.cpp:1.109 --- llvm/lib/Target/PowerPC/PPCISelDAGToDAG.cpp:1.108 Mon Oct 17 19:28:58 2005 +++ llvm/lib/Target/PowerPC/PPCISelDAGToDAG.cpp Tue Oct 18 18:23:37 2005 @@ -1206,6 +1206,22 @@ // Other cases are autogenerated. break; + case ISD::ANY_EXTEND: + switch(N->getValueType(0)) { + default: assert(0 && "Unhandled type in ANY_EXTEND"); + case MVT::i64: + CurDAG->SelectNodeTo(N, PPC::OR8, MVT::i64, Select(N->getOperand(0)), + Select(N->getOperand(0))); + break; + } + return SDOperand(N, 0); + case ISD::ZERO_EXTEND: + assert(N->getValueType(0) == MVT::i64 && + N->getOperand(0).getValueType() == MVT::i32 && + "ZERO_EXTEND only supported for i32 -> i64"); + CurDAG->SelectNodeTo(N, PPC::RLDICL, MVT::i64, Select(N->getOperand(0)), + getI32Imm(32)); + return SDOperand(N, 0); case ISD::SHL: { unsigned Imm, SH, MB, ME; if (isOpcWithIntImmediate(N->getOperand(0).Val, ISD::AND, Imm) && @@ -1393,11 +1409,6 @@ SDOperand Val = Select(N->getOperand(1)); if (N->getOperand(1).getValueType() == MVT::i32) { Chain = CurDAG->getCopyToReg(Chain, PPC::R3, Val); - } else if (N->getOperand(1).getValueType() == MVT::i64) { - SDOperand Srl = CurDAG->getTargetNode(PPC::RLDICL, MVT::i64, Val, - getI32Imm(32), getI32Imm(32)); - Chain = CurDAG->getCopyToReg(Chain, PPC::R4, Val); - Chain = CurDAG->getCopyToReg(Chain, PPC::R3, Srl); } else { assert(MVT::isFloatingPoint(N->getOperand(1).getValueType())); Chain = CurDAG->getCopyToReg(Chain, PPC::F1, Val); Index: llvm/lib/Target/PowerPC/PPCISelLowering.cpp diff -u llvm/lib/Target/PowerPC/PPCISelLowering.cpp:1.33 llvm/lib/Target/PowerPC/PPCISelLowering.cpp:1.34 --- llvm/lib/Target/PowerPC/PPCISelLowering.cpp:1.33 Mon Oct 17 19:56:42 2005 +++ llvm/lib/Target/PowerPC/PPCISelLowering.cpp Tue Oct 18 18:23:37 2005 @@ -693,6 +693,19 @@ return std::make_pair(RetVal, Chain); } +SDOperand PPCTargetLowering::LowerReturnTo(SDOperand Chain, SDOperand Op, + SelectionDAG &DAG) { + if (Op.getValueType() == MVT::i64) { + SDOperand Hi = DAG.getNode(ISD::EXTRACT_ELEMENT, MVT::i32, Op, + DAG.getConstant(1, MVT::i32)); + SDOperand Lo = DAG.getNode(ISD::EXTRACT_ELEMENT, MVT::i32, Op, + DAG.getConstant(0, MVT::i32)); + return DAG.getNode(ISD::RET, MVT::Other, Chain, Lo, Hi); + } else { + return DAG.getNode(ISD::RET, MVT::Other, Chain, Op); + } +} + SDOperand PPCTargetLowering::LowerVAStart(SDOperand Chain, SDOperand VAListP, Value *VAListV, SelectionDAG &DAG) { // vastart just stores the address of the VarArgsFrameIndex slot into the Index: llvm/lib/Target/PowerPC/PPCISelLowering.h diff -u llvm/lib/Target/PowerPC/PPCISelLowering.h:1.8 llvm/lib/Target/PowerPC/PPCISelLowering.h:1.9 --- llvm/lib/Target/PowerPC/PPCISelLowering.h:1.8 Sun Oct 16 00:39:50 2005 +++ llvm/lib/Target/PowerPC/PPCISelLowering.h Tue Oct 18 18:23:37 2005 @@ -63,6 +63,9 @@ unsigned CC, bool isTailCall, SDOperand Callee, ArgListTy &Args, SelectionDAG &DAG); + + virtual SDOperand LowerReturnTo(SDOperand Chain, SDOperand Op, + SelectionDAG &DAG); virtual SDOperand LowerVAStart(SDOperand Chain, SDOperand VAListP, Value *VAListV, SelectionDAG &DAG); From natebegeman at mac.com Tue Oct 18 19:05:48 2005 From: natebegeman at mac.com (Nate Begeman) Date: Tue, 18 Oct 2005 19:05:48 -0500 Subject: [llvm-commits] CVS: llvm/lib/Target/PowerPC/PPCISelDAGToDAG.cpp PPCInstrInfo.td PPCRegisterInfo.td Message-ID: <200510190005.TAA32324@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/PowerPC: PPCISelDAGToDAG.cpp updated: 1.109 -> 1.110 PPCInstrInfo.td updated: 1.124 -> 1.125 PPCRegisterInfo.td updated: 1.18 -> 1.19 --- Log message: Make a new reg class for 64 bit regs that aliases the 32 bit regs. This will have to tide us over until we get real subreg support, but it prevents the PrologEpilogInserter from spilling 8 byte GPRs on a G4 processor. Add some initial support for TRUNCATE and ANY_EXTEND, but they don't currently work due to issues with ScheduleDAG. Something wll have to be figured out. --- Diffs of the changes: (+50 -9) PPCISelDAGToDAG.cpp | 24 +++++++++++++++++++++--- PPCInstrInfo.td | 1 - PPCRegisterInfo.td | 34 +++++++++++++++++++++++++++++----- 3 files changed, 50 insertions(+), 9 deletions(-) Index: llvm/lib/Target/PowerPC/PPCISelDAGToDAG.cpp diff -u llvm/lib/Target/PowerPC/PPCISelDAGToDAG.cpp:1.109 llvm/lib/Target/PowerPC/PPCISelDAGToDAG.cpp:1.110 --- llvm/lib/Target/PowerPC/PPCISelDAGToDAG.cpp:1.109 Tue Oct 18 18:23:37 2005 +++ llvm/lib/Target/PowerPC/PPCISelDAGToDAG.cpp Tue Oct 18 19:05:37 2005 @@ -219,6 +219,11 @@ // and mask opcode and mask operation. static bool isRotateAndMask(SDNode *N, unsigned Mask, bool IsShiftMask, unsigned &SH, unsigned &MB, unsigned &ME) { + // Don't even go down this path for i64, since different logic will be + // necessary for rldicl/rldicr/rldimi. + if (N->getValueType(0) != MVT::i32) + return false; + unsigned Shift = 32; unsigned Indeterminant = ~0; // bit mask marking indeterminant results unsigned Opcode = N->getOpcode(); @@ -1206,14 +1211,27 @@ // Other cases are autogenerated. break; + case ISD::TRUNCATE: { + assert(N->getValueType(0) == MVT::i32 && + N->getOperand(0).getValueType() == MVT::i64 && + "TRUNCATE only supported for i64 -> i32"); + // FIXME: this code breaks ScheduleDAG since Op0 is an i64 and OR4 + // takes i32s. + SDOperand Op0 = Select(N->getOperand(0)); + CurDAG->SelectNodeTo(N, PPC::OR4, MVT::i32, Op0, Op0); + break; + } case ISD::ANY_EXTEND: switch(N->getValueType(0)) { default: assert(0 && "Unhandled type in ANY_EXTEND"); - case MVT::i64: - CurDAG->SelectNodeTo(N, PPC::OR8, MVT::i64, Select(N->getOperand(0)), - Select(N->getOperand(0))); + case MVT::i64: { + // FIXME: this code breaks ScheduleDAG since Op0 is an i32 and OR8 + // takes i64s. + SDOperand Op0 = Select(N->getOperand(0)); + CurDAG->SelectNodeTo(N, PPC::OR8, MVT::i64, Op0, Op0); break; } + } return SDOperand(N, 0); case ISD::ZERO_EXTEND: assert(N->getValueType(0) == MVT::i64 && Index: llvm/lib/Target/PowerPC/PPCInstrInfo.td diff -u llvm/lib/Target/PowerPC/PPCInstrInfo.td:1.124 llvm/lib/Target/PowerPC/PPCInstrInfo.td:1.125 --- llvm/lib/Target/PowerPC/PPCInstrInfo.td:1.124 Tue Oct 18 11:51:22 2005 +++ llvm/lib/Target/PowerPC/PPCInstrInfo.td Tue Oct 18 19:05:37 2005 @@ -703,7 +703,6 @@ (XORIS (XORI GPRC:$in, (LO16 imm:$imm)), (HI16 imm:$imm))>; - // Same as above, but using a temporary. FIXME: implement temporaries :) /* def : Pattern<(xor GPRC:$in, imm:$imm), Index: llvm/lib/Target/PowerPC/PPCRegisterInfo.td diff -u llvm/lib/Target/PowerPC/PPCRegisterInfo.td:1.18 llvm/lib/Target/PowerPC/PPCRegisterInfo.td:1.19 --- llvm/lib/Target/PowerPC/PPCRegisterInfo.td:1.18 Mon Oct 17 19:28:58 2005 +++ llvm/lib/Target/PowerPC/PPCRegisterInfo.td Tue Oct 18 19:05:37 2005 @@ -21,6 +21,12 @@ field bits<5> Num = num; } +// GP8 - One of the 32 64-bit general-purpose registers +class GP8 num, string n, Register Alias> : PPCReg { + field bits<5> Num = num; + let Aliases = [Alias]; +} + // SPR - One of the 32-bit special-purpose registers class SPR num, string n> : PPCReg { field bits<5> Num = num; @@ -54,6 +60,24 @@ def R28 : GPR<28, "r28">; def R29 : GPR<29, "r29">; def R30 : GPR<30, "r30">; def R31 : GPR<31, "r31">; +// 64-bit General-purpose registers +def X0 : GP8< 0, "r0", R0>; def X1 : GP8< 1, "r1", R1>; +def X2 : GP8< 2, "r2", R2>; def X3 : GP8< 3, "r3", R3>; +def X4 : GP8< 4, "r4", R4>; def X5 : GP8< 5, "r5", R5>; +def X6 : GP8< 6, "r6", R6>; def X7 : GP8< 7, "r7", R7>; +def X8 : GP8< 8, "r8", R8>; def X9 : GP8< 9, "r9", R9>; +def X10 : GP8<10, "r10", R10>; def X11 : GP8<11, "r11", R11>; +def X12 : GP8<12, "r12", R12>; def X13 : GP8<13, "r13", R13>; +def X14 : GP8<14, "r14", R14>; def X15 : GP8<15, "r15", R15>; +def X16 : GP8<16, "r16", R16>; def X17 : GP8<17, "r17", R17>; +def X18 : GP8<18, "r18", R18>; def X19 : GP8<19, "r19", R19>; +def X20 : GP8<20, "r20", R20>; def X21 : GP8<21, "r21", R21>; +def X22 : GP8<22, "r22", R22>; def X23 : GP8<23, "r23", R23>; +def X24 : GP8<24, "r24", R24>; def X25 : GP8<25, "r25", R25>; +def X26 : GP8<26, "r26", R26>; def X27 : GP8<27, "r27", R27>; +def X28 : GP8<28, "r28", R28>; def X29 : GP8<29, "r29", R29>; +def X30 : GP8<30, "r30", R30>; def X31 : GP8<31, "r31", R31>; + // Floating-point registers def F0 : FPR< 0, "f0">; def F1 : FPR< 1, "f1">; def F2 : FPR< 2, "f2">; def F3 : FPR< 3, "f3">; @@ -111,9 +135,9 @@ }]; } def G8RC : RegisterClass<"PPC", i64, 64, - [R2, R3, R4, R5, R6, R7, R8, R9, R10, R11, R12, - R30, R29, R28, R27, R26, R25, R24, R23, R22, R21, R20, R19, R18, R17, - R16, R15, R14, R13, R31, R0, R1, LR]> + [X2, X3, X4, X5, X6, X7, X8, X9, X10, X11, X12, + X30, X29, X28, X27, X26, X25, X24, X23, X22, X21, X20, X19, X18, X17, + X16, X15, X14, X13, X31, X0, X1]> { let MethodProtos = [{ iterator allocation_order_begin(MachineFunction &MF) const; @@ -127,9 +151,9 @@ G8RCClass::iterator G8RCClass::allocation_order_end(MachineFunction &MF) const { if (hasFP(MF)) - return end()-4; - else return end()-3; + else + return end()-2; } }]; } From natebegeman at mac.com Tue Oct 18 19:07:07 2005 From: natebegeman at mac.com (Nate Begeman) Date: Tue, 18 Oct 2005 19:07:07 -0500 Subject: [llvm-commits] CVS: llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp Message-ID: <200510190007.TAA32339@zion.cs.uiuc.edu> Changes in directory llvm/lib/CodeGen/SelectionDAG: LegalizeDAG.cpp updated: 1.201 -> 1.202 --- Log message: Teach Legalize how to do something with EXTRACT_ELEMENT when the type of the pair of elements is a legal type. --- Diffs of the changes: (+30 -7) LegalizeDAG.cpp | 37 ++++++++++++++++++++++++++++++------- 1 files changed, 30 insertions(+), 7 deletions(-) Index: llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp diff -u llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp:1.201 llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp:1.202 --- llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp:1.201 Mon Oct 17 19:27:41 2005 +++ llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp Tue Oct 18 19:06:56 2005 @@ -955,14 +955,37 @@ } assert(0 && "Unreachable"); } - case ISD::EXTRACT_ELEMENT: - // Get both the low and high parts. - ExpandOp(Node->getOperand(0), Tmp1, Tmp2); - if (cast(Node->getOperand(1))->getValue()) - Result = Tmp2; // 1 -> Hi - else - Result = Tmp1; // 0 -> Lo + case ISD::EXTRACT_ELEMENT: { + MVT::ValueType OpTy = Node->getOperand(0).getValueType(); + switch (getTypeAction(OpTy)) { + default: + assert(0 && "EXTRACT_ELEMENT action for type unimplemented!"); + break; + case Legal: + if (cast(Node->getOperand(1))->getValue()) { + // 1 -> Hi + Result = DAG.getNode(ISD::SRL, OpTy, Node->getOperand(0), + DAG.getConstant(MVT::getSizeInBits(OpTy)/2, + TLI.getShiftAmountTy())); + Result = DAG.getNode(ISD::TRUNCATE, Node->getValueType(0), Result); + } else { + // 0 -> Lo + Result = DAG.getNode(ISD::TRUNCATE, Node->getValueType(0), + Node->getOperand(0)); + } + Result = LegalizeOp(Result); + break; + case Expand: + // Get both the low and high parts. + ExpandOp(Node->getOperand(0), Tmp1, Tmp2); + if (cast(Node->getOperand(1))->getValue()) + Result = Tmp2; // 1 -> Hi + else + Result = Tmp1; // 0 -> Lo + break; + } break; + } case ISD::CopyToReg: Tmp1 = LegalizeOp(Node->getOperand(0)); // Legalize the chain. From lattner at cs.uiuc.edu Tue Oct 18 19:18:07 2005 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Tue, 18 Oct 2005 19:18:07 -0500 Subject: [llvm-commits] CVS: llvm/lib/Target/PowerPC/PPCRegisterInfo.td Message-ID: <200510190018.TAA32459@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/PowerPC: PPCRegisterInfo.td updated: 1.19 -> 1.20 --- Log message: apply some tblgen majik to simplify the X register definitions --- Diffs of the changes: (+19 -19) PPCRegisterInfo.td | 38 +++++++++++++++++++------------------- 1 files changed, 19 insertions(+), 19 deletions(-) Index: llvm/lib/Target/PowerPC/PPCRegisterInfo.td diff -u llvm/lib/Target/PowerPC/PPCRegisterInfo.td:1.19 llvm/lib/Target/PowerPC/PPCRegisterInfo.td:1.20 --- llvm/lib/Target/PowerPC/PPCRegisterInfo.td:1.19 Tue Oct 18 19:05:37 2005 +++ llvm/lib/Target/PowerPC/PPCRegisterInfo.td Tue Oct 18 19:17:55 2005 @@ -22,10 +22,10 @@ } // GP8 - One of the 32 64-bit general-purpose registers -class GP8 num, string n, Register Alias> : PPCReg { - field bits<5> Num = num; +class GP8 : PPCReg { + field bits<5> Num = Alias.Num; let Aliases = [Alias]; -} +} // SPR - One of the 32-bit special-purpose registers class SPR num, string n> : PPCReg { @@ -61,22 +61,22 @@ def R30 : GPR<30, "r30">; def R31 : GPR<31, "r31">; // 64-bit General-purpose registers -def X0 : GP8< 0, "r0", R0>; def X1 : GP8< 1, "r1", R1>; -def X2 : GP8< 2, "r2", R2>; def X3 : GP8< 3, "r3", R3>; -def X4 : GP8< 4, "r4", R4>; def X5 : GP8< 5, "r5", R5>; -def X6 : GP8< 6, "r6", R6>; def X7 : GP8< 7, "r7", R7>; -def X8 : GP8< 8, "r8", R8>; def X9 : GP8< 9, "r9", R9>; -def X10 : GP8<10, "r10", R10>; def X11 : GP8<11, "r11", R11>; -def X12 : GP8<12, "r12", R12>; def X13 : GP8<13, "r13", R13>; -def X14 : GP8<14, "r14", R14>; def X15 : GP8<15, "r15", R15>; -def X16 : GP8<16, "r16", R16>; def X17 : GP8<17, "r17", R17>; -def X18 : GP8<18, "r18", R18>; def X19 : GP8<19, "r19", R19>; -def X20 : GP8<20, "r20", R20>; def X21 : GP8<21, "r21", R21>; -def X22 : GP8<22, "r22", R22>; def X23 : GP8<23, "r23", R23>; -def X24 : GP8<24, "r24", R24>; def X25 : GP8<25, "r25", R25>; -def X26 : GP8<26, "r26", R26>; def X27 : GP8<27, "r27", R27>; -def X28 : GP8<28, "r28", R28>; def X29 : GP8<29, "r29", R29>; -def X30 : GP8<30, "r30", R30>; def X31 : GP8<31, "r31", R31>; +def X0 : GP8< R0>; def X1 : GP8< R1>; +def X2 : GP8< R2>; def X3 : GP8< R3>; +def X4 : GP8< R4>; def X5 : GP8< R5>; +def X6 : GP8< R6>; def X7 : GP8< R7>; +def X8 : GP8< R8>; def X9 : GP8< R9>; +def X10 : GP8; def X11 : GP8; +def X12 : GP8; def X13 : GP8; +def X14 : GP8; def X15 : GP8; +def X16 : GP8; def X17 : GP8; +def X18 : GP8; def X19 : GP8; +def X20 : GP8; def X21 : GP8; +def X22 : GP8; def X23 : GP8; +def X24 : GP8; def X25 : GP8; +def X26 : GP8; def X27 : GP8; +def X28 : GP8; def X29 : GP8; +def X30 : GP8; def X31 : GP8; // Floating-point registers def F0 : FPR< 0, "f0">; def F1 : FPR< 1, "f1">; From lattner at cs.uiuc.edu Tue Oct 18 19:52:33 2005 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Tue, 18 Oct 2005 19:52:33 -0500 Subject: [llvm-commits] CVS: llvm/test/Regression/CFrontend/2005-10-18-VariableSizedElementCrash.c Message-ID: <200510190052.TAA32711@zion.cs.uiuc.edu> Changes in directory llvm/test/Regression/CFrontend: 2005-10-18-VariableSizedElementCrash.c added (r1.1) --- Log message: Testcase that crashes llvmgcc in type layout --- Diffs of the changes: (+9 -0) 2005-10-18-VariableSizedElementCrash.c | 9 +++++++++ 1 files changed, 9 insertions(+) Index: llvm/test/Regression/CFrontend/2005-10-18-VariableSizedElementCrash.c diff -c /dev/null llvm/test/Regression/CFrontend/2005-10-18-VariableSizedElementCrash.c:1.1 *** /dev/null Tue Oct 18 19:52:32 2005 --- llvm/test/Regression/CFrontend/2005-10-18-VariableSizedElementCrash.c Tue Oct 18 19:52:22 2005 *************** *** 0 **** --- 1,9 ---- + // RUN: %llvmgcc %s -S -o - + // XFAIL: * + int sub1(int i, char *pi) { + typedef int foo[i]; + struct bar {foo f1; int f2:3; int f3:4} *p = (struct bar *) pi; + xxx(p->f1); + return p->f3; + } + From natebegeman at mac.com Tue Oct 18 20:12:43 2005 From: natebegeman at mac.com (Nate Begeman) Date: Tue, 18 Oct 2005 20:12:43 -0500 Subject: [llvm-commits] CVS: llvm/lib/Target/PowerPC/PPCISelDAGToDAG.cpp PPCInstrInfo.td Message-ID: <200510190112.UAA00326@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/PowerPC: PPCISelDAGToDAG.cpp updated: 1.110 -> 1.111 PPCInstrInfo.td updated: 1.125 -> 1.126 --- Log message: Woo, it kinda works. We now generate this atrociously bad, but correct, code for long long foo(long long a, long long b) { return a + b; } _foo: or r2, r3, r3 or r3, r4, r4 or r4, r5, r5 or r5, r6, r6 rldicr r2, r2, 32, 31 rldicl r3, r3, 0, 32 rldicr r4, r4, 32, 31 rldicl r5, r5, 0, 32 or r2, r3, r2 or r3, r5, r4 add r4, r3, r2 rldicl r2, r4, 32, 32 or r4, r4, r4 or r3, r2, r2 blr --- Diffs of the changes: (+54 -23) PPCISelDAGToDAG.cpp | 59 +++++++++++++++++++++++++++++++++------------------- PPCInstrInfo.td | 18 ++++++++++++++- 2 files changed, 54 insertions(+), 23 deletions(-) Index: llvm/lib/Target/PowerPC/PPCISelDAGToDAG.cpp diff -u llvm/lib/Target/PowerPC/PPCISelDAGToDAG.cpp:1.110 llvm/lib/Target/PowerPC/PPCISelDAGToDAG.cpp:1.111 --- llvm/lib/Target/PowerPC/PPCISelDAGToDAG.cpp:1.110 Tue Oct 18 19:05:37 2005 +++ llvm/lib/Target/PowerPC/PPCISelDAGToDAG.cpp Tue Oct 18 20:12:32 2005 @@ -1215,31 +1215,30 @@ assert(N->getValueType(0) == MVT::i32 && N->getOperand(0).getValueType() == MVT::i64 && "TRUNCATE only supported for i64 -> i32"); - // FIXME: this code breaks ScheduleDAG since Op0 is an i64 and OR4 - // takes i32s. SDOperand Op0 = Select(N->getOperand(0)); - CurDAG->SelectNodeTo(N, PPC::OR4, MVT::i32, Op0, Op0); + CurDAG->SelectNodeTo(N, PPC::OR8To4, MVT::i32, Op0, Op0); break; } case ISD::ANY_EXTEND: switch(N->getValueType(0)) { default: assert(0 && "Unhandled type in ANY_EXTEND"); case MVT::i64: { - // FIXME: this code breaks ScheduleDAG since Op0 is an i32 and OR8 - // takes i64s. SDOperand Op0 = Select(N->getOperand(0)); - CurDAG->SelectNodeTo(N, PPC::OR8, MVT::i64, Op0, Op0); + CurDAG->SelectNodeTo(N, PPC::OR4To8, MVT::i64, Op0, Op0); break; } } return SDOperand(N, 0); - case ISD::ZERO_EXTEND: + case ISD::ZERO_EXTEND: { assert(N->getValueType(0) == MVT::i64 && N->getOperand(0).getValueType() == MVT::i32 && "ZERO_EXTEND only supported for i32 -> i64"); - CurDAG->SelectNodeTo(N, PPC::RLDICL, MVT::i64, Select(N->getOperand(0)), + SDOperand Op0 = Select(N->getOperand(0)); + Op0 = CurDAG->getTargetNode(PPC::OR4To8, MVT::i64, Op0, Op0); + CurDAG->SelectNodeTo(N, PPC::RLDICL, MVT::i64, Op0, getI32Imm(0), getI32Imm(32)); return SDOperand(N, 0); + } case ISD::SHL: { unsigned Imm, SH, MB, ME; if (isOpcWithIntImmediate(N->getOperand(0).Val, ISD::AND, Imm) && @@ -1247,12 +1246,21 @@ CurDAG->SelectNodeTo(N, PPC::RLWINM, MVT::i32, Select(N->getOperand(0).getOperand(0)), getI32Imm(SH), getI32Imm(MB), getI32Imm(ME)); - else if (isIntImmediate(N->getOperand(1), Imm)) - CurDAG->SelectNodeTo(N, PPC::RLWINM, MVT::i32, Select(N->getOperand(0)), - getI32Imm(Imm), getI32Imm(0), getI32Imm(31-Imm)); - else - CurDAG->SelectNodeTo(N, PPC::SLW, MVT::i32, Select(N->getOperand(0)), - Select(N->getOperand(1))); + else if (isIntImmediate(N->getOperand(1), Imm)) { + if (N->getValueType(0) == MVT::i64) + CurDAG->SelectNodeTo(N, PPC::RLDICR, MVT::i64, Select(N->getOperand(0)), + getI32Imm(Imm), getI32Imm(63-Imm)); + else + CurDAG->SelectNodeTo(N, PPC::RLWINM, MVT::i32, Select(N->getOperand(0)), + getI32Imm(Imm), getI32Imm(0), getI32Imm(31-Imm)); + } else { + if (N->getValueType(0) == MVT::i64) + CurDAG->SelectNodeTo(N, PPC::SLD, MVT::i64, Select(N->getOperand(0)), + Select(N->getOperand(1))); + else + CurDAG->SelectNodeTo(N, PPC::SLW, MVT::i32, Select(N->getOperand(0)), + Select(N->getOperand(1))); + } return SDOperand(N, 0); } case ISD::SRL: { @@ -1262,13 +1270,22 @@ CurDAG->SelectNodeTo(N, PPC::RLWINM, MVT::i32, Select(N->getOperand(0).getOperand(0)), getI32Imm(SH & 0x1F), getI32Imm(MB), getI32Imm(ME)); - else if (isIntImmediate(N->getOperand(1), Imm)) - CurDAG->SelectNodeTo(N, PPC::RLWINM, MVT::i32, Select(N->getOperand(0)), - getI32Imm((32-Imm) & 0x1F), getI32Imm(Imm), - getI32Imm(31)); - else - CurDAG->SelectNodeTo(N, PPC::SRW, MVT::i32, Select(N->getOperand(0)), - Select(N->getOperand(1))); + else if (isIntImmediate(N->getOperand(1), Imm)) { + if (N->getValueType(0) == MVT::i64) + CurDAG->SelectNodeTo(N, PPC::RLDICL, MVT::i64, Select(N->getOperand(0)), + getI32Imm(64-Imm), getI32Imm(Imm)); + else + CurDAG->SelectNodeTo(N, PPC::RLWINM, MVT::i32, Select(N->getOperand(0)), + getI32Imm((32-Imm) & 0x1F), getI32Imm(Imm), + getI32Imm(31)); + } else { + if (N->getValueType(0) == MVT::i64) + CurDAG->SelectNodeTo(N, PPC::SRD, MVT::i64, Select(N->getOperand(0)), + Select(N->getOperand(1))); + else + CurDAG->SelectNodeTo(N, PPC::SRW, MVT::i32, Select(N->getOperand(0)), + Select(N->getOperand(1))); + } return SDOperand(N, 0); } case ISD::FNEG: { Index: llvm/lib/Target/PowerPC/PPCInstrInfo.td diff -u llvm/lib/Target/PowerPC/PPCInstrInfo.td:1.125 llvm/lib/Target/PowerPC/PPCInstrInfo.td:1.126 --- llvm/lib/Target/PowerPC/PPCInstrInfo.td:1.125 Tue Oct 18 19:05:37 2005 +++ llvm/lib/Target/PowerPC/PPCInstrInfo.td Tue Oct 18 20:12:32 2005 @@ -18,6 +18,15 @@ //===----------------------------------------------------------------------===// // PowerPC specific transformation functions and pattern fragments. // +def GET_ZERO : SDNodeXForm; +def GET_32 : SDNodeXForm; + def LO16 : SDNodeXFormgetValue()); @@ -332,6 +341,12 @@ def OR8 : XForm_6<31, 444, (ops G8RC:$rA, G8RC:$rS, G8RC:$rB), "or $rA, $rS, $rB", [(set G8RC:$rA, (or G8RC:$rS, G8RC:$rB))]>; +def OR4To8 : XForm_6<31, 444, (ops G8RC:$rA, GPRC:$rS, GPRC:$rB), + "or $rA, $rS, $rB", + []>; +def OR8To4 : XForm_6<31, 444, (ops GPRC:$rA, G8RC:$rS, G8RC:$rB), + "or $rA, $rS, $rB", + []>; def NOR : XForm_6<31, 124, (ops GPRC:$rA, GPRC:$rS, GPRC:$rB), "nor $rA, $rS, $rB", [(set GPRC:$rA, (not (or GPRC:$rS, GPRC:$rB)))]>; @@ -701,8 +716,7 @@ // XOR an arbitrary immediate. def : Pat<(xor GPRC:$in, imm:$imm), (XORIS (XORI GPRC:$in, (LO16 imm:$imm)), (HI16 imm:$imm))>; - - + // Same as above, but using a temporary. FIXME: implement temporaries :) /* def : Pattern<(xor GPRC:$in, imm:$imm), From lattner at cs.uiuc.edu Tue Oct 18 20:27:34 2005 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Tue, 18 Oct 2005 20:27:34 -0500 Subject: [llvm-commits] CVS: llvm/utils/TableGen/DAGISelEmitter.cpp Message-ID: <200510190127.UAA00432@zion.cs.uiuc.edu> Changes in directory llvm/utils/TableGen: DAGISelEmitter.cpp updated: 1.59 -> 1.60 --- Log message: Nate wants to define 'Pat's which turn into instructions that don't have patterns. Certainly a logical request. --- Diffs of the changes: (+30 -4) DAGISelEmitter.cpp | 34 ++++++++++++++++++++++++++++++---- 1 files changed, 30 insertions(+), 4 deletions(-) Index: llvm/utils/TableGen/DAGISelEmitter.cpp diff -u llvm/utils/TableGen/DAGISelEmitter.cpp:1.59 llvm/utils/TableGen/DAGISelEmitter.cpp:1.60 --- llvm/utils/TableGen/DAGISelEmitter.cpp:1.59 Mon Oct 17 23:41:01 2005 +++ llvm/utils/TableGen/DAGISelEmitter.cpp Tue Oct 18 20:27:22 2005 @@ -975,11 +975,36 @@ std::vector Instrs = Records.getAllDerivedDefinitions("Instruction"); for (unsigned i = 0, e = Instrs.size(); i != e; ++i) { - if (!dynamic_cast(Instrs[i]->getValueInit("Pattern"))) - continue; // no pattern yet, ignore it. + ListInit *LI = 0; - ListInit *LI = Instrs[i]->getValueAsListInit("Pattern"); - if (LI->getSize() == 0) continue; // no pattern. + if (dynamic_cast(Instrs[i]->getValueInit("Pattern"))) + LI = Instrs[i]->getValueAsListInit("Pattern"); + + // If there is no pattern, only collect minimal information about the + // instruction for its operand list. We have to assume that there is one + // result, as we have no detailed info. + if (!LI || LI->getSize() == 0) { + std::vector ResultTypes; + std::vector OperandTypes; + + CodeGenInstruction &InstInfo =Target.getInstruction(Instrs[i]->getName()); + + // Doesn't even define a result? + if (InstInfo.OperandList.size() == 0) + continue; + + // Assume the first operand is the result. + ResultTypes.push_back(InstInfo.OperandList[0].Ty); + + // The rest are inputs. + for (unsigned j = 1, e = InstInfo.OperandList.size(); j != e; ++j) + OperandTypes.push_back(InstInfo.OperandList[j].Ty); + + // Create and insert the instruction. + Instructions.insert(std::make_pair(Instrs[i], + DAGInstruction(0, ResultTypes, OperandTypes))); + continue; // no pattern. + } // Parse the instruction. TreePattern *I = new TreePattern(Instrs[i], LI, *this); @@ -1112,6 +1137,7 @@ for (std::map::iterator II = Instructions.begin(), E = Instructions.end(); II != E; ++II) { TreePattern *I = II->second.getPattern(); + if (I == 0) continue; // No pattern. if (I->getNumTrees() != 1) { std::cerr << "CANNOT HANDLE: " << I->getRecord()->getName() << " yet!"; From lattner at cs.uiuc.edu Tue Oct 18 20:38:13 2005 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Tue, 18 Oct 2005 20:38:13 -0500 Subject: [llvm-commits] CVS: llvm/lib/Target/PowerPC/PPCISelDAGToDAG.cpp PPCInstrInfo.td Message-ID: <200510190138.UAA00668@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/PowerPC: PPCISelDAGToDAG.cpp updated: 1.111 -> 1.112 PPCInstrInfo.td updated: 1.126 -> 1.127 --- Log message: Convert these cases to patterns --- Diffs of the changes: (+11 -37) PPCISelDAGToDAG.cpp | 28 ---------------------------- PPCInstrInfo.td | 20 +++++++++++--------- 2 files changed, 11 insertions(+), 37 deletions(-) Index: llvm/lib/Target/PowerPC/PPCISelDAGToDAG.cpp diff -u llvm/lib/Target/PowerPC/PPCISelDAGToDAG.cpp:1.111 llvm/lib/Target/PowerPC/PPCISelDAGToDAG.cpp:1.112 --- llvm/lib/Target/PowerPC/PPCISelDAGToDAG.cpp:1.111 Tue Oct 18 20:12:32 2005 +++ llvm/lib/Target/PowerPC/PPCISelDAGToDAG.cpp Tue Oct 18 20:38:02 2005 @@ -1211,34 +1211,6 @@ // Other cases are autogenerated. break; - case ISD::TRUNCATE: { - assert(N->getValueType(0) == MVT::i32 && - N->getOperand(0).getValueType() == MVT::i64 && - "TRUNCATE only supported for i64 -> i32"); - SDOperand Op0 = Select(N->getOperand(0)); - CurDAG->SelectNodeTo(N, PPC::OR8To4, MVT::i32, Op0, Op0); - break; - } - case ISD::ANY_EXTEND: - switch(N->getValueType(0)) { - default: assert(0 && "Unhandled type in ANY_EXTEND"); - case MVT::i64: { - SDOperand Op0 = Select(N->getOperand(0)); - CurDAG->SelectNodeTo(N, PPC::OR4To8, MVT::i64, Op0, Op0); - break; - } - } - return SDOperand(N, 0); - case ISD::ZERO_EXTEND: { - assert(N->getValueType(0) == MVT::i64 && - N->getOperand(0).getValueType() == MVT::i32 && - "ZERO_EXTEND only supported for i32 -> i64"); - SDOperand Op0 = Select(N->getOperand(0)); - Op0 = CurDAG->getTargetNode(PPC::OR4To8, MVT::i64, Op0, Op0); - CurDAG->SelectNodeTo(N, PPC::RLDICL, MVT::i64, Op0, getI32Imm(0), - getI32Imm(32)); - return SDOperand(N, 0); - } case ISD::SHL: { unsigned Imm, SH, MB, ME; if (isOpcWithIntImmediate(N->getOperand(0).Val, ISD::AND, Imm) && Index: llvm/lib/Target/PowerPC/PPCInstrInfo.td diff -u llvm/lib/Target/PowerPC/PPCInstrInfo.td:1.126 llvm/lib/Target/PowerPC/PPCInstrInfo.td:1.127 --- llvm/lib/Target/PowerPC/PPCInstrInfo.td:1.126 Tue Oct 18 20:12:32 2005 +++ llvm/lib/Target/PowerPC/PPCInstrInfo.td Tue Oct 18 20:38:02 2005 @@ -18,14 +18,8 @@ //===----------------------------------------------------------------------===// // PowerPC specific transformation functions and pattern fragments. // -def GET_ZERO : SDNodeXForm; -def GET_32 : SDNodeXForm; +def GET_ZERO : SDNodeXForm; // HACK +def GET_32 : SDNodeXForm; // HACK def LO16 : SDNodeXForm; - + +def : Pat<(zext GPRC:$in), + (RLDICL (OR4To8 GPRC:$in, GPRC:$in), (GET_ZERO imm:$in), + (GET_32 imm:$in))>; +def : Pat<(anyext GPRC:$in), + (OR4To8 GPRC:$in, GPRC:$in)>; +def : Pat<(trunc G8RC:$in), + (OR8To4 G8RC:$in, G8RC:$in)>; + // Same as above, but using a temporary. FIXME: implement temporaries :) /* def : Pattern<(xor GPRC:$in, imm:$imm), From lattner at cs.uiuc.edu Tue Oct 18 20:41:58 2005 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Tue, 18 Oct 2005 20:41:58 -0500 Subject: [llvm-commits] CVS: llvm/include/llvm/Transforms/LinkAllPasses.h Message-ID: <200510190141.UAA00715@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm/Transforms: LinkAllPasses.h updated: 1.19 -> 1.20 --- Log message: Make this work with the internalize change --- Diffs of the changes: (+1 -1) LinkAllPasses.h | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm/include/llvm/Transforms/LinkAllPasses.h diff -u llvm/include/llvm/Transforms/LinkAllPasses.h:1.19 llvm/include/llvm/Transforms/LinkAllPasses.h:1.20 --- llvm/include/llvm/Transforms/LinkAllPasses.h:1.19 Mon Apr 25 21:57:49 2005 +++ llvm/include/llvm/Transforms/LinkAllPasses.h Tue Oct 18 20:41:47 2005 @@ -76,7 +76,7 @@ (void) llvm::createIPSCCPPass(); (void) llvm::createIndVarSimplifyPass(); (void) llvm::createInstructionCombiningPass(); - (void) llvm::createInternalizePass(); + (void) llvm::createInternalizePass(false); (void) llvm::createLICMPass(); (void) llvm::createLoadValueNumberingPass(); (void) llvm::createLoopExtractorPass(); From lattner at cs.uiuc.edu Tue Oct 18 20:50:48 2005 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Tue, 18 Oct 2005 20:50:48 -0500 Subject: [llvm-commits] CVS: llvm/lib/Target/PowerPC/PPCInstrInfo.cpp Message-ID: <200510190150.UAA00799@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/PowerPC: PPCInstrInfo.cpp updated: 1.12 -> 1.13 --- Log message: teach ppc backend these are copies --- Diffs of the changes: (+2 -1) PPCInstrInfo.cpp | 3 ++- 1 files changed, 2 insertions(+), 1 deletion(-) Index: llvm/lib/Target/PowerPC/PPCInstrInfo.cpp diff -u llvm/lib/Target/PowerPC/PPCInstrInfo.cpp:1.12 llvm/lib/Target/PowerPC/PPCInstrInfo.cpp:1.13 --- llvm/lib/Target/PowerPC/PPCInstrInfo.cpp:1.12 Mon Oct 17 19:28:58 2005 +++ llvm/lib/Target/PowerPC/PPCInstrInfo.cpp Tue Oct 18 20:50:36 2005 @@ -25,7 +25,8 @@ unsigned& sourceReg, unsigned& destReg) const { MachineOpCode oc = MI.getOpcode(); - if (oc == PPC::OR4 || oc == PPC::OR8) { // or r1, r2, r2 + if (oc == PPC::OR4 || oc == PPC::OR8 || + oc == PPC::OR4To8 || oc == PPC::OR8To4) { // or r1, r2, r2 assert(MI.getNumOperands() == 3 && MI.getOperand(0).isRegister() && MI.getOperand(1).isRegister() && From lattner at cs.uiuc.edu Tue Oct 18 20:55:35 2005 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Tue, 18 Oct 2005 20:55:35 -0500 Subject: [llvm-commits] CVS: llvm/utils/TableGen/DAGISelEmitter.cpp Message-ID: <200510190155.UAA00864@zion.cs.uiuc.edu> Changes in directory llvm/utils/TableGen: DAGISelEmitter.cpp updated: 1.60 -> 1.61 --- Log message: Asserting here is to violent --- Diffs of the changes: (+3 -1) DAGISelEmitter.cpp | 4 +++- 1 files changed, 3 insertions(+), 1 deletion(-) Index: llvm/utils/TableGen/DAGISelEmitter.cpp diff -u llvm/utils/TableGen/DAGISelEmitter.cpp:1.60 llvm/utils/TableGen/DAGISelEmitter.cpp:1.61 --- llvm/utils/TableGen/DAGISelEmitter.cpp:1.60 Tue Oct 18 20:27:22 2005 +++ llvm/utils/TableGen/DAGISelEmitter.cpp Tue Oct 18 20:55:23 2005 @@ -462,7 +462,9 @@ // Pattern fragment types will be resolved when they are inlined. return MVT::isUnknown; } else if (R->isSubClassOf("Register")) { - assert(0 && "Explicit registers not handled here yet!\n"); + //const CodeGenTarget &T = TP.getDAGISelEmitter().getTargetInfo(); + // TODO: if a register appears in exactly one regclass, we could use that + // type info. return MVT::isUnknown; } else if (R->isSubClassOf("ValueType")) { // Using a VTSDNode. From lattner at cs.uiuc.edu Tue Oct 18 21:07:37 2005 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Tue, 18 Oct 2005 21:07:37 -0500 Subject: [llvm-commits] CVS: llvm/utils/TableGen/DAGISelEmitter.cpp Message-ID: <200510190207.VAA00995@zion.cs.uiuc.edu> Changes in directory llvm/utils/TableGen: DAGISelEmitter.cpp updated: 1.61 -> 1.62 --- Log message: Add support for patterns that have physical registers in them. Testcase: def : Pat<(trunc G8RC:$in), (OR8To4 G8RC:$in, X0)>; Even though this doesn't make any sense on PPC :) --- Diffs of the changes: (+12 -0) DAGISelEmitter.cpp | 12 ++++++++++++ 1 files changed, 12 insertions(+) Index: llvm/utils/TableGen/DAGISelEmitter.cpp diff -u llvm/utils/TableGen/DAGISelEmitter.cpp:1.61 llvm/utils/TableGen/DAGISelEmitter.cpp:1.62 --- llvm/utils/TableGen/DAGISelEmitter.cpp:1.61 Tue Oct 18 20:55:23 2005 +++ llvm/utils/TableGen/DAGISelEmitter.cpp Tue Oct 18 21:07:26 2005 @@ -1617,6 +1617,18 @@ } if (N->isLeaf()) { + // If this is an explicit register reference, handle it. + if (DefInit *DI = dynamic_cast(N->getLeafValue())) { + unsigned ResNo = Ctr++; + if (DI->getDef()->isSubClassOf("Register")) { + OS << " SDOperand Tmp" << ResNo << " = CurDAG->getRegister(" + << getQualifiedName(DI->getDef()) << ", MVT::" + << getEnumName(N->getType()) + << ");\n"; + return ResNo; + } + } + N->dump(); assert(0 && "Unknown leaf type!"); return ~0U; From lattner at cs.uiuc.edu Tue Oct 18 23:12:26 2005 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Tue, 18 Oct 2005 23:12:26 -0500 Subject: [llvm-commits] CVS: llvm/utils/TableGen/DAGISelEmitter.h Message-ID: <200510190412.XAA01453@zion.cs.uiuc.edu> Changes in directory llvm/utils/TableGen: DAGISelEmitter.h updated: 1.33 -> 1.34 --- Log message: Fix some checking that was causing duraid to get a perplexing assertion instead of a happy error message --- Diffs of the changes: (+1 -1) DAGISelEmitter.h | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm/utils/TableGen/DAGISelEmitter.h diff -u llvm/utils/TableGen/DAGISelEmitter.h:1.33 llvm/utils/TableGen/DAGISelEmitter.h:1.34 --- llvm/utils/TableGen/DAGISelEmitter.h:1.33 Sat Oct 15 20:41:58 2005 +++ llvm/utils/TableGen/DAGISelEmitter.h Tue Oct 18 23:12:14 2005 @@ -226,7 +226,7 @@ /// ContainsUnresolvedType - Return true if this tree contains any /// unresolved types. bool ContainsUnresolvedType() const { - if (Ty == MVT::LAST_VALUETYPE) return true; + if (!hasTypeSet()) return true; for (unsigned i = 0, e = getNumChildren(); i != e; ++i) if (getChild(i)->ContainsUnresolvedType()) return true; return false; From lattner at cs.uiuc.edu Tue Oct 18 23:31:07 2005 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Tue, 18 Oct 2005 23:31:07 -0500 Subject: [llvm-commits] CVS: llvm/utils/TableGen/DAGISelEmitter.cpp Message-ID: <200510190431.XAA01593@zion.cs.uiuc.edu> Changes in directory llvm/utils/TableGen: DAGISelEmitter.cpp updated: 1.62 -> 1.63 --- Log message: Add basic support for integer constants in pattern results. --- Diffs of the changes: (+14 -0) DAGISelEmitter.cpp | 14 ++++++++++++++ 1 files changed, 14 insertions(+) Index: llvm/utils/TableGen/DAGISelEmitter.cpp diff -u llvm/utils/TableGen/DAGISelEmitter.cpp:1.62 llvm/utils/TableGen/DAGISelEmitter.cpp:1.63 --- llvm/utils/TableGen/DAGISelEmitter.cpp:1.62 Tue Oct 18 21:07:26 2005 +++ llvm/utils/TableGen/DAGISelEmitter.cpp Tue Oct 18 23:30:56 2005 @@ -665,8 +665,15 @@ Args.push_back(Dag->getArgName(i)); } } + } else if (IntInit *II = dynamic_cast(Arg)) { + TreePatternNode *Node = new TreePatternNode(II); + if (!Dag->getArgName(i).empty()) + error("Constant int argument should not have a name!"); + Children.push_back(Node); } else { + std::cerr << '"'; Arg->dump(); + std::cerr << "\": "; error("Unknown leaf value for tree pattern!"); } } @@ -1627,6 +1634,13 @@ << ");\n"; return ResNo; } + } else if (IntInit *II = dynamic_cast(N->getLeafValue())) { + unsigned ResNo = Ctr++; + OS << " SDOperand Tmp" << ResNo << " = CurDAG->getTargetConstant(" + << II->getValue() << ", MVT::" + << getEnumName(N->getType()) + << ");\n"; + return ResNo; } N->dump(); From lattner at cs.uiuc.edu Tue Oct 18 23:32:15 2005 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Tue, 18 Oct 2005 23:32:15 -0500 Subject: [llvm-commits] CVS: llvm/lib/Target/PowerPC/PPCInstrInfo.td Message-ID: <200510190432.XAA01651@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/PowerPC: PPCInstrInfo.td updated: 1.127 -> 1.128 --- Log message: now that tblgen is smarter, use integers directly. This should help Andrew too --- Diffs of the changes: (+1 -4) PPCInstrInfo.td | 5 +---- 1 files changed, 1 insertion(+), 4 deletions(-) Index: llvm/lib/Target/PowerPC/PPCInstrInfo.td diff -u llvm/lib/Target/PowerPC/PPCInstrInfo.td:1.127 llvm/lib/Target/PowerPC/PPCInstrInfo.td:1.128 --- llvm/lib/Target/PowerPC/PPCInstrInfo.td:1.127 Tue Oct 18 20:38:02 2005 +++ llvm/lib/Target/PowerPC/PPCInstrInfo.td Tue Oct 18 23:32:04 2005 @@ -18,8 +18,6 @@ //===----------------------------------------------------------------------===// // PowerPC specific transformation functions and pattern fragments. // -def GET_ZERO : SDNodeXForm; // HACK -def GET_32 : SDNodeXForm; // HACK def LO16 : SDNodeXForm; def : Pat<(zext GPRC:$in), - (RLDICL (OR4To8 GPRC:$in, GPRC:$in), (GET_ZERO imm:$in), - (GET_32 imm:$in))>; + (RLDICL (OR4To8 GPRC:$in, GPRC:$in), 0, 32)>; def : Pat<(anyext GPRC:$in), (OR4To8 GPRC:$in, GPRC:$in)>; def : Pat<(trunc G8RC:$in), From lattner at cs.uiuc.edu Tue Oct 18 23:41:17 2005 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Tue, 18 Oct 2005 23:41:17 -0500 Subject: [llvm-commits] CVS: llvm/utils/TableGen/DAGISelEmitter.cpp Message-ID: <200510190441.XAA01744@zion.cs.uiuc.edu> Changes in directory llvm/utils/TableGen: DAGISelEmitter.cpp updated: 1.63 -> 1.64 --- Log message: add support for literal immediates in patterns to match, allowing us to write things like this: def : Pat<(add GPRC:$in, 12), (ADD12 GPRC:$in)>; Andrew: if this isn't enough or doesn't work for you, please lemme know. --- Diffs of the changes: (+21 -9) DAGISelEmitter.cpp | 30 +++++++++++++++++++++--------- 1 files changed, 21 insertions(+), 9 deletions(-) Index: llvm/utils/TableGen/DAGISelEmitter.cpp diff -u llvm/utils/TableGen/DAGISelEmitter.cpp:1.63 llvm/utils/TableGen/DAGISelEmitter.cpp:1.64 --- llvm/utils/TableGen/DAGISelEmitter.cpp:1.63 Tue Oct 18 23:30:56 2005 +++ llvm/utils/TableGen/DAGISelEmitter.cpp Tue Oct 18 23:41:05 2005 @@ -1472,6 +1472,9 @@ TreePatternNode *Child = P->getChild(i); if (!Child->isLeaf() && Child->getExtType() != MVT::Other) Size += getPatternSize(Child); + else if (Child->isLeaf() && dynamic_cast(Child->getLeafValue())) { + ++Size; // Matches a ConstantSDNode. + } } return Size; @@ -1562,15 +1565,24 @@ } // Handle leaves of various types. - Init *LeafVal = Child->getLeafValue(); - Record *LeafRec = dynamic_cast(LeafVal)->getDef(); - if (LeafRec->isSubClassOf("RegisterClass")) { - // Handle register references. Nothing to do here. - } else if (LeafRec->isSubClassOf("ValueType")) { - // Make sure this is the specified value type. - OS << " if (cast(" << RootName << i << ")->getVT() != " - << "MVT::" << LeafRec->getName() << ") goto P" << PatternNo - << "Fail;\n"; + if (DefInit *DI = dynamic_cast(Child->getLeafValue())) { + Record *LeafRec = DI->getDef(); + if (LeafRec->isSubClassOf("RegisterClass")) { + // Handle register references. Nothing to do here. + } else if (LeafRec->isSubClassOf("ValueType")) { + // Make sure this is the specified value type. + OS << " if (cast(" << RootName << i << ")->getVT() != " + << "MVT::" << LeafRec->getName() << ") goto P" << PatternNo + << "Fail;\n"; + } else { + Child->dump(); + assert(0 && "Unknown leaf type!"); + } + } else if (IntInit *II = dynamic_cast(Child->getLeafValue())) { + OS << " if (!isa(" << RootName << i << ") ||\n" + << " cast(" << RootName << i + << ")->getValue() != " << II->getValue() << ")\n" + << " goto P" << PatternNo << "Fail;\n"; } else { Child->dump(); assert(0 && "Unknown leaf type!"); From jlaskey at apple.com Wed Oct 19 08:35:08 2005 From: jlaskey at apple.com (Jim Laskey) Date: Wed, 19 Oct 2005 08:35:08 -0500 Subject: [llvm-commits] CVS: llvm/lib/Target/Target.td TargetSchedule.td Message-ID: <200510191335.IAA22393@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target: Target.td updated: 1.52 -> 1.53 TargetSchedule.td updated: 1.1 -> 1.2 --- Log message: Push processor descriptions to the top of target and add command line info. --- Diffs of the changes: (+40 -9) Target.td | 39 +++++++++++++++++++++++++++++++++++++++ TargetSchedule.td | 10 +--------- 2 files changed, 40 insertions(+), 9 deletions(-) Index: llvm/lib/Target/Target.td diff -u llvm/lib/Target/Target.td:1.52 llvm/lib/Target/Target.td:1.53 --- llvm/lib/Target/Target.td:1.52 Mon Oct 10 01:00:30 2005 +++ llvm/lib/Target/Target.td Wed Oct 19 08:34:52 2005 @@ -242,6 +242,45 @@ } //===----------------------------------------------------------------------===// +// Pull in the common support for scheduling +// +include "../TargetSchedule.td" + +//===----------------------------------------------------------------------===// +// SubtargetFeature - A characteristic of the chip set. +// +class SubtargetFeature { + // Name - Feature name. Used by command line (-mattr=) to determine the + // appropriate target chip. + // + string Name = n; + + // Desc - Feature description. Used by command line (-mattr=) to display help + // information. + // + string Desc = d; +} + +//===----------------------------------------------------------------------===// +// Processor chip sets - These values represent each of the chip sets supported +// by the scheduler. Each Processor definition requires corresponding +// instruction itineraries. +// +class Processor f> { + // Name - Chip set name. Used by command line (-mcpu=) to determine the + // appropriate target chip. + // + string Name = n; + + // ProcItin - The scheduling information for the target processor. + // + ProcessorItineraries ProcItin = pi; + + // Features - list of + list Features; +} + +//===----------------------------------------------------------------------===// // Pull in the common support for DAG isel generation // include "../TargetSelectionDAG.td" Index: llvm/lib/Target/TargetSchedule.td diff -u llvm/lib/Target/TargetSchedule.td:1.1 llvm/lib/Target/TargetSchedule.td:1.2 --- llvm/lib/Target/TargetSchedule.td:1.1 Tue Oct 18 11:23:40 2005 +++ llvm/lib/Target/TargetSchedule.td Wed Oct 19 08:34:52 2005 @@ -13,13 +13,6 @@ //===----------------------------------------------------------------------===// //===----------------------------------------------------------------------===// -// Processor chip sets - These values represent each of the chip sets supported -// by the scheduler. Each Processor definition requires corresponding -// instruction itineraries. -// -class Processor; - -//===----------------------------------------------------------------------===// // Processor functional unit - These values represent the function units // available across all chip sets for the target. Eg., IntUnit, FPUnit, ... // These may be independent values for each chip set or may be shared across @@ -68,7 +61,6 @@ // Processor itineraries - These values represent the set of all itinerary // classes for a given chip set. // -class ProcessorItineraries iid> { - Processor Proc = proc; +class ProcessorItineraries iid> { list IID = iid; } From jlaskey at apple.com Wed Oct 19 08:35:08 2005 From: jlaskey at apple.com (Jim Laskey) Date: Wed, 19 Oct 2005 08:35:08 -0500 Subject: [llvm-commits] CVS: llvm/lib/Target/PowerPC/PPCSchedule.td PPCScheduleG3.td PPCScheduleG4.td PPCScheduleG4Plus.td PPCScheduleG5.td Message-ID: <200510191335.IAA22395@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/PowerPC: PPCSchedule.td updated: 1.1 -> 1.2 PPCScheduleG3.td updated: 1.2 -> 1.3 PPCScheduleG4.td updated: 1.2 -> 1.3 PPCScheduleG4Plus.td updated: 1.2 -> 1.3 PPCScheduleG5.td updated: 1.2 -> 1.3 --- Log message: Push processor descriptions to the top of target and add command line info. --- Diffs of the changes: (+40 -14) PPCSchedule.td | 46 ++++++++++++++++++++++++++++++++++++---------- PPCScheduleG3.td | 2 +- PPCScheduleG4.td | 2 +- PPCScheduleG4Plus.td | 2 +- PPCScheduleG5.td | 2 +- 5 files changed, 40 insertions(+), 14 deletions(-) Index: llvm/lib/Target/PowerPC/PPCSchedule.td diff -u llvm/lib/Target/PowerPC/PPCSchedule.td:1.1 llvm/lib/Target/PowerPC/PPCSchedule.td:1.2 --- llvm/lib/Target/PowerPC/PPCSchedule.td:1.1 Tue Oct 18 11:23:40 2005 +++ llvm/lib/Target/PowerPC/PPCSchedule.td Wed Oct 19 08:34:52 2005 @@ -7,20 +7,11 @@ // //===----------------------------------------------------------------------===// -#include "../TargetSchedule.td" - -//===----------------------------------------------------------------------===// -// PowerPC chips sets supported by scheduling (Apple naming) -// -def G3 : Processor; -def G4 : Processor; -def G4Plus : Processor; -def G5 : Processor; +#include "../Target.td" //===----------------------------------------------------------------------===// // Functional units across PowerPC chips sets // -def NoUnit : FuncUnit; // Instruction not supported on chip set def BPU : FuncUnit; // Branch unit def SLU : FuncUnit; // Store/load unit def SRU : FuncUnit; // special register unit @@ -518,3 +509,38 @@ // xoris IntGeneral // + +//===----------------------------------------------------------------------===// +// PowerPC Subtarget features. +// + +def F64Bit : SubtargetFeature<"64bit", + "Should 64 bit instructions be used">; +def F64BitRegs : SubtargetFeature<"64bitregs", + "Should 64 bit registers be used">; +def FAltivec : SubtargetFeature<"altivec", + "Should Altivec instructions be used">; +def FGPUL : SubtargetFeature<"gpul", + "Should GPUL instructions be used">; +def FFSQRT : SubtargetFeature<"fsqrt", + "Should the fsqrt instruction be used">; + +//===----------------------------------------------------------------------===// +// PowerPC chips sets supported +// + +def : Processor<"601", G3Itineraries, []>; +def : Processor<"602", G3Itineraries, []>; +def : Processor<"603", G3Itineraries, []>; +def : Processor<"604", G3Itineraries, []>; +def : Processor<"750", G3Itineraries, []>; +def : Processor<"7400", G4Itineraries, [FAltivec]>; +def : Processor<"g4", G4Itineraries, [FAltivec]>; +def : Processor<"7450", G4PlusItineraries, [FAltivec]>; +def : Processor<"g4+", G4PlusItineraries, [FAltivec]>; +def : Processor<"970", G5Itineraries, + [FAltivec, FGPUL, FFSQRT, F64Bit, F64BitRegs]>; +def : Processor<"g5", G5Itineraries, + [FAltivec, FGPUL, FFSQRT, F64Bit, F64BitRegs]>; + + Index: llvm/lib/Target/PowerPC/PPCScheduleG3.td diff -u llvm/lib/Target/PowerPC/PPCScheduleG3.td:1.2 llvm/lib/Target/PowerPC/PPCScheduleG3.td:1.3 --- llvm/lib/Target/PowerPC/PPCScheduleG3.td:1.2 Tue Oct 18 11:59:23 2005 +++ llvm/lib/Target/PowerPC/PPCScheduleG3.td Wed Oct 19 08:34:52 2005 @@ -12,7 +12,7 @@ //===----------------------------------------------------------------------===// -def G3Itineraries : ProcessorItineraries]>, InstrItinData]>, InstrItinData]>, Index: llvm/lib/Target/PowerPC/PPCScheduleG4.td diff -u llvm/lib/Target/PowerPC/PPCScheduleG4.td:1.2 llvm/lib/Target/PowerPC/PPCScheduleG4.td:1.3 --- llvm/lib/Target/PowerPC/PPCScheduleG4.td:1.2 Tue Oct 18 11:59:23 2005 +++ llvm/lib/Target/PowerPC/PPCScheduleG4.td Wed Oct 19 08:34:52 2005 @@ -11,7 +11,7 @@ // //===----------------------------------------------------------------------===// -def G4Itineraries : ProcessorItineraries]>, InstrItinData]>, InstrItinData]>, Index: llvm/lib/Target/PowerPC/PPCScheduleG4Plus.td diff -u llvm/lib/Target/PowerPC/PPCScheduleG4Plus.td:1.2 llvm/lib/Target/PowerPC/PPCScheduleG4Plus.td:1.3 --- llvm/lib/Target/PowerPC/PPCScheduleG4Plus.td:1.2 Tue Oct 18 11:59:23 2005 +++ llvm/lib/Target/PowerPC/PPCScheduleG4Plus.td Wed Oct 19 08:34:52 2005 @@ -11,7 +11,7 @@ // //===----------------------------------------------------------------------===// -def G4PlusItineraries : ProcessorItineraries]>, InstrItinData]>, InstrItinData]>, Index: llvm/lib/Target/PowerPC/PPCScheduleG5.td diff -u llvm/lib/Target/PowerPC/PPCScheduleG5.td:1.2 llvm/lib/Target/PowerPC/PPCScheduleG5.td:1.3 --- llvm/lib/Target/PowerPC/PPCScheduleG5.td:1.2 Tue Oct 18 11:59:23 2005 +++ llvm/lib/Target/PowerPC/PPCScheduleG5.td Wed Oct 19 08:34:52 2005 @@ -11,7 +11,7 @@ // //===----------------------------------------------------------------------===// -def G5Itineraries : ProcessorItineraries]>, InstrItinData]>, InstrItinData]>, From criswell at cs.uiuc.edu Wed Oct 19 13:30:58 2005 From: criswell at cs.uiuc.edu (John Criswell) Date: Wed, 19 Oct 2005 13:30:58 -0500 Subject: [llvm-commits] CVS: llvm/test/Regression/CodeGen/X86/2004-02-08-UnwindSupport.llx Message-ID: <200510191830.NAA11808@choi.cs.uiuc.edu> Changes in directory llvm/test/Regression/CodeGen/X86: 2004-02-08-UnwindSupport.llx updated: 1.2 -> 1.3 --- Log message: Force i386 code generation for an i386 specific test. --- Diffs of the changes: (+1 -1) 2004-02-08-UnwindSupport.llx | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm/test/Regression/CodeGen/X86/2004-02-08-UnwindSupport.llx diff -u llvm/test/Regression/CodeGen/X86/2004-02-08-UnwindSupport.llx:1.2 llvm/test/Regression/CodeGen/X86/2004-02-08-UnwindSupport.llx:1.3 --- llvm/test/Regression/CodeGen/X86/2004-02-08-UnwindSupport.llx:1.2 Thu Aug 4 14:55:39 2005 +++ llvm/test/Regression/CodeGen/X86/2004-02-08-UnwindSupport.llx Wed Oct 19 13:30:39 2005 @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | llc -enable-correct-eh-support +; RUN: llvm-as < %s | llc -march=x86 -enable-correct-eh-support int %test() { unwind From criswell at cs.uiuc.edu Wed Oct 19 13:36:01 2005 From: criswell at cs.uiuc.edu (John Criswell) Date: Wed, 19 Oct 2005 13:36:01 -0500 Subject: [llvm-commits] CVS: llvm-test/External/SPEC/CFP2000/168.wupwise/Makefile Message-ID: <200510191836.NAA12155@choi.cs.uiuc.edu> Changes in directory llvm-test/External/SPEC/CFP2000/168.wupwise: Makefile updated: 1.3 -> 1.4 --- Log message: Makefile.FORTRAN isn't copied into the object tree (and really doesn't need to be), so just look for it in the source tree instead. --- Diffs of the changes: (+1 -1) Makefile | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm-test/External/SPEC/CFP2000/168.wupwise/Makefile diff -u llvm-test/External/SPEC/CFP2000/168.wupwise/Makefile:1.3 llvm-test/External/SPEC/CFP2000/168.wupwise/Makefile:1.4 --- llvm-test/External/SPEC/CFP2000/168.wupwise/Makefile:1.3 Thu Jul 28 12:54:01 2005 +++ llvm-test/External/SPEC/CFP2000/168.wupwise/Makefile Wed Oct 19 13:35:41 2005 @@ -11,5 +11,5 @@ FP_TOLERANCE=0.005 -include $(LEVEL)/Makefile.FORTRAN include ../../Makefile.spec2000 +include $(PROC_SRC_ROOT)/Makefile.FORTRAN From criswell at cs.uiuc.edu Wed Oct 19 13:40:03 2005 From: criswell at cs.uiuc.edu (John Criswell) Date: Wed, 19 Oct 2005 13:40:03 -0500 Subject: [llvm-commits] CVS: llvm-test/External/SPEC/CFP2000/168.wupwise/Makefile Message-ID: <200510191840.NAA17834@choi.cs.uiuc.edu> Changes in directory llvm-test/External/SPEC/CFP2000/168.wupwise: Makefile updated: 1.4 -> 1.5 --- Log message: Corrected spelling. --- Diffs of the changes: (+1 -1) Makefile | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm-test/External/SPEC/CFP2000/168.wupwise/Makefile diff -u llvm-test/External/SPEC/CFP2000/168.wupwise/Makefile:1.4 llvm-test/External/SPEC/CFP2000/168.wupwise/Makefile:1.5 --- llvm-test/External/SPEC/CFP2000/168.wupwise/Makefile:1.4 Wed Oct 19 13:35:41 2005 +++ llvm-test/External/SPEC/CFP2000/168.wupwise/Makefile Wed Oct 19 13:39:49 2005 @@ -12,4 +12,4 @@ FP_TOLERANCE=0.005 include ../../Makefile.spec2000 -include $(PROC_SRC_ROOT)/Makefile.FORTRAN +include $(PROJ_SRC_ROOT)/Makefile.FORTRAN From natebegeman at mac.com Wed Oct 19 13:42:12 2005 From: natebegeman at mac.com (Nate Begeman) Date: Wed, 19 Oct 2005 13:42:12 -0500 Subject: [llvm-commits] CVS: llvm/lib/Target/PowerPC/PPCISelDAGToDAG.cpp PPCInstrFormats.td PPCInstrInfo.td Message-ID: <200510191842.NAA23877@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/PowerPC: PPCISelDAGToDAG.cpp updated: 1.112 -> 1.113 PPCInstrFormats.td updated: 1.52 -> 1.53 PPCInstrInfo.td updated: 1.128 -> 1.129 --- Log message: Write patterns for the various shl and srl patterns that don't involve doing something clever. --- Diffs of the changes: (+71 -50) PPCISelDAGToDAG.cpp | 43 ++++++++-------------------------- PPCInstrFormats.td | 14 ++++++++--- PPCInstrInfo.td | 64 +++++++++++++++++++++++++++++++++++++++++----------- 3 files changed, 71 insertions(+), 50 deletions(-) Index: llvm/lib/Target/PowerPC/PPCISelDAGToDAG.cpp diff -u llvm/lib/Target/PowerPC/PPCISelDAGToDAG.cpp:1.112 llvm/lib/Target/PowerPC/PPCISelDAGToDAG.cpp:1.113 --- llvm/lib/Target/PowerPC/PPCISelDAGToDAG.cpp:1.112 Tue Oct 18 20:38:02 2005 +++ llvm/lib/Target/PowerPC/PPCISelDAGToDAG.cpp Wed Oct 19 13:42:01 2005 @@ -1214,51 +1214,28 @@ case ISD::SHL: { unsigned Imm, SH, MB, ME; if (isOpcWithIntImmediate(N->getOperand(0).Val, ISD::AND, Imm) && - isRotateAndMask(N, Imm, true, SH, MB, ME)) + isRotateAndMask(N, Imm, true, SH, MB, ME)) { CurDAG->SelectNodeTo(N, PPC::RLWINM, MVT::i32, Select(N->getOperand(0).getOperand(0)), getI32Imm(SH), getI32Imm(MB), getI32Imm(ME)); - else if (isIntImmediate(N->getOperand(1), Imm)) { - if (N->getValueType(0) == MVT::i64) - CurDAG->SelectNodeTo(N, PPC::RLDICR, MVT::i64, Select(N->getOperand(0)), - getI32Imm(Imm), getI32Imm(63-Imm)); - else - CurDAG->SelectNodeTo(N, PPC::RLWINM, MVT::i32, Select(N->getOperand(0)), - getI32Imm(Imm), getI32Imm(0), getI32Imm(31-Imm)); - } else { - if (N->getValueType(0) == MVT::i64) - CurDAG->SelectNodeTo(N, PPC::SLD, MVT::i64, Select(N->getOperand(0)), - Select(N->getOperand(1))); - else - CurDAG->SelectNodeTo(N, PPC::SLW, MVT::i32, Select(N->getOperand(0)), - Select(N->getOperand(1))); + return SDOperand(N, 0); } - return SDOperand(N, 0); + + // Other cases are autogenerated. + break; } case ISD::SRL: { unsigned Imm, SH, MB, ME; if (isOpcWithIntImmediate(N->getOperand(0).Val, ISD::AND, Imm) && - isRotateAndMask(N, Imm, true, SH, MB, ME)) + isRotateAndMask(N, Imm, true, SH, MB, ME)) { CurDAG->SelectNodeTo(N, PPC::RLWINM, MVT::i32, Select(N->getOperand(0).getOperand(0)), getI32Imm(SH & 0x1F), getI32Imm(MB), getI32Imm(ME)); - else if (isIntImmediate(N->getOperand(1), Imm)) { - if (N->getValueType(0) == MVT::i64) - CurDAG->SelectNodeTo(N, PPC::RLDICL, MVT::i64, Select(N->getOperand(0)), - getI32Imm(64-Imm), getI32Imm(Imm)); - else - CurDAG->SelectNodeTo(N, PPC::RLWINM, MVT::i32, Select(N->getOperand(0)), - getI32Imm((32-Imm) & 0x1F), getI32Imm(Imm), - getI32Imm(31)); - } else { - if (N->getValueType(0) == MVT::i64) - CurDAG->SelectNodeTo(N, PPC::SRD, MVT::i64, Select(N->getOperand(0)), - Select(N->getOperand(1))); - else - CurDAG->SelectNodeTo(N, PPC::SRW, MVT::i32, Select(N->getOperand(0)), - Select(N->getOperand(1))); + return SDOperand(N, 0); } - return SDOperand(N, 0); + + // Other cases are autogenerated. + break; } case ISD::FNEG: { SDOperand Val = Select(N->getOperand(0)); Index: llvm/lib/Target/PowerPC/PPCInstrFormats.td diff -u llvm/lib/Target/PowerPC/PPCInstrFormats.td:1.52 llvm/lib/Target/PowerPC/PPCInstrFormats.td:1.53 --- llvm/lib/Target/PowerPC/PPCInstrFormats.td:1.52 Fri Oct 14 17:44:13 2005 +++ llvm/lib/Target/PowerPC/PPCInstrFormats.td Wed Oct 19 13:42:01 2005 @@ -468,13 +468,16 @@ } // 1.7.13 M-Form -class MForm_1 opcode, dag OL, string asmstr> : I { +class MForm_1 opcode, dag OL, string asmstr, list pattern> + : I { bits<5> RA; bits<5> RS; bits<5> RB; bits<5> MB; bits<5> ME; + let Pattern = pattern; + bit RC = 0; // set by isDOT let Inst{6-10} = RS; @@ -485,18 +488,21 @@ let Inst{31} = RC; } -class MForm_2 opcode, dag OL, string asmstr> - : MForm_1 { +class MForm_2 opcode, dag OL, string asmstr, list pattern> + : MForm_1 { } // 1.7.14 MD-Form -class MDForm_1 opcode, bits<3> xo, dag OL, string asmstr> +class MDForm_1 opcode, bits<3> xo, dag OL, string asmstr, + list pattern> : I { bits<5> RS; bits<5> RA; bits<6> SH; bits<6> MBE; + let Pattern = pattern; + bit RC = 0; // set by isDOT let Inst{6-10} = RS; Index: llvm/lib/Target/PowerPC/PPCInstrInfo.td diff -u llvm/lib/Target/PowerPC/PPCInstrInfo.td:1.128 llvm/lib/Target/PowerPC/PPCInstrInfo.td:1.129 --- llvm/lib/Target/PowerPC/PPCInstrInfo.td:1.128 Tue Oct 18 23:32:04 2005 +++ llvm/lib/Target/PowerPC/PPCInstrInfo.td Wed Oct 19 13:42:01 2005 @@ -19,6 +19,26 @@ // PowerPC specific transformation functions and pattern fragments. // +def SHL32 : SDNodeXFormgetValue()); +}]>; + +def SHL64 : SDNodeXFormgetValue()); +}]>; + +def SRL32 : SDNodeXFormgetValue() ? getI32Imm(32 - N->getValue()) : getI32Imm(0); +}]>; + +def SRL64 : SDNodeXFormgetValue() ? getI32Imm(64 - N->getValue()) : getI32Imm(0); +}]>; + def LO16 : SDNodeXFormgetValue()); @@ -354,21 +374,21 @@ def XOR : XForm_6<31, 316, (ops GPRC:$rA, GPRC:$rS, GPRC:$rB), "xor $rA, $rS, $rB", [(set GPRC:$rA, (xor GPRC:$rS, GPRC:$rB))]>; -def SLD : XForm_6<31, 27, (ops GPRC:$rA, GPRC:$rS, GPRC:$rB), +def SLD : XForm_6<31, 27, (ops G8RC:$rA, G8RC:$rS, G8RC:$rB), "sld $rA, $rS, $rB", - []>, isPPC64; + [(set G8RC:$rA, (shl G8RC:$rS, G8RC:$rB))]>, isPPC64; def SLW : XForm_6<31, 24, (ops GPRC:$rA, GPRC:$rS, GPRC:$rB), "slw $rA, $rS, $rB", [(set GPRC:$rA, (shl GPRC:$rS, GPRC:$rB))]>; -def SRD : XForm_6<31, 539, (ops GPRC:$rA, GPRC:$rS, GPRC:$rB), +def SRD : XForm_6<31, 539, (ops G8RC:$rA, G8RC:$rS, G8RC:$rB), "srd $rA, $rS, $rB", - []>, isPPC64; + [(set G8RC:$rA, (srl G8RC:$rS, G8RC:$rB))]>, isPPC64; def SRW : XForm_6<31, 536, (ops GPRC:$rA, GPRC:$rS, GPRC:$rB), "srw $rA, $rS, $rB", [(set GPRC:$rA, (srl GPRC:$rS, GPRC:$rB))]>; -def SRAD : XForm_6<31, 794, (ops GPRC:$rA, GPRC:$rS, GPRC:$rB), +def SRAD : XForm_6<31, 794, (ops G8RC:$rA, G8RC:$rS, G8RC:$rB), "srad $rA, $rS, $rB", - []>, isPPC64; + [(set G8RC:$rA, (sra G8RC:$rS, G8RC:$rB))]>, isPPC64; def SRAW : XForm_6<31, 792, (ops GPRC:$rA, GPRC:$rS, GPRC:$rB), "sraw $rA, $rS, $rB", [(set GPRC:$rA, (sra GPRC:$rS, GPRC:$rB))]>; @@ -663,29 +683,36 @@ // RLWIMI can be commuted if the rotate amount is zero. def RLWIMI : MForm_2<20, (ops GPRC:$rA, GPRC:$rSi, GPRC:$rS, u5imm:$SH, u5imm:$MB, - u5imm:$ME), "rlwimi $rA, $rS, $SH, $MB, $ME">; + u5imm:$ME), "rlwimi $rA, $rS, $SH, $MB, $ME", + []>; def RLDIMI : MDForm_1<30, 3, (ops G8RC:$rA, G8RC:$rSi, G8RC:$rS, u6imm:$SH, u6imm:$MB), - "rldimi $rA, $rS, $SH, $MB">, isPPC64; + "rldimi $rA, $rS, $SH, $MB", + []>, isPPC64; } def RLWINM : MForm_2<21, (ops GPRC:$rA, GPRC:$rS, u5imm:$SH, u5imm:$MB, u5imm:$ME), - "rlwinm $rA, $rS, $SH, $MB, $ME">; + "rlwinm $rA, $rS, $SH, $MB, $ME", + []>; def RLWINMo : MForm_2<21, (ops GPRC:$rA, GPRC:$rS, u5imm:$SH, u5imm:$MB, u5imm:$ME), - "rlwinm. $rA, $rS, $SH, $MB, $ME">, isDOT; + "rlwinm. $rA, $rS, $SH, $MB, $ME", + []>, isDOT; def RLWNM : MForm_2<23, (ops GPRC:$rA, GPRC:$rS, GPRC:$rB, u5imm:$MB, u5imm:$ME), - "rlwnm $rA, $rS, $rB, $MB, $ME">; + "rlwnm $rA, $rS, $rB, $MB, $ME", + []>; // MD-Form instructions. 64 bit rotate instructions. // def RLDICL : MDForm_1<30, 0, (ops G8RC:$rA, G8RC:$rS, u6imm:$SH, u6imm:$MB), - "rldicl $rA, $rS, $SH, $MB">, isPPC64; + "rldicl $rA, $rS, $SH, $MB", + []>, isPPC64; def RLDICR : MDForm_1<30, 1, (ops G8RC:$rA, G8RC:$rS, u6imm:$SH, u6imm:$ME), - "rldicr $rA, $rS, $SH, $ME">, isPPC64; + "rldicr $rA, $rS, $SH, $ME", + []>, isPPC64; //===----------------------------------------------------------------------===// // PowerPC Instruction Patterns @@ -716,6 +743,17 @@ def : Pat<(trunc G8RC:$in), (OR8To4 G8RC:$in, G8RC:$in)>; +// SHL +def : Pat<(shl GPRC:$in, imm:$imm), + (RLWINM GPRC:$in, imm:$imm, 0, (SHL32 imm:$imm))>; +def : Pat<(shl G8RC:$in, imm:$imm), + (RLDICR G8RC:$in, imm:$imm, (SHL64 imm:$imm))>; +// SRL +def : Pat<(srl GPRC:$in, imm:$imm), + (RLWINM GPRC:$in, (SRL32 imm:$imm), imm:$imm, 31)>; +def : Pat<(srl G8RC:$in, imm:$imm), + (RLDICL G8RC:$in, (SRL64 imm:$imm), imm:$imm)>; + // Same as above, but using a temporary. FIXME: implement temporaries :) /* def : Pattern<(xor GPRC:$in, imm:$imm), From criswell at cs.uiuc.edu Wed Oct 19 13:42:46 2005 From: criswell at cs.uiuc.edu (John Criswell) Date: Wed, 19 Oct 2005 13:42:46 -0500 Subject: [llvm-commits] CVS: llvm-test/External/SPEC/CFP2000/171.swim/Makefile Message-ID: <200510191842.NAA18992@choi.cs.uiuc.edu> Changes in directory llvm-test/External/SPEC/CFP2000/171.swim: Makefile updated: 1.2 -> 1.3 --- Log message: Corrected the inclusion of Makefile.FORTRAN, which is not copied into the object tree by configure. --- Diffs of the changes: (+1 -1) Makefile | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm-test/External/SPEC/CFP2000/171.swim/Makefile diff -u llvm-test/External/SPEC/CFP2000/171.swim/Makefile:1.2 llvm-test/External/SPEC/CFP2000/171.swim/Makefile:1.3 --- llvm-test/External/SPEC/CFP2000/171.swim/Makefile:1.2 Tue Jul 19 14:05:46 2005 +++ llvm-test/External/SPEC/CFP2000/171.swim/Makefile Wed Oct 19 13:42:19 2005 @@ -6,5 +6,5 @@ STDOUT_FILENAME = swim.out FP_ABSTOLERANCE = 0.000001 -include $(LEVEL)/Makefile.FORTRAN include ../../Makefile.spec2000 +include $(PROJ_SRC_ROOT)/Makefile.FORTRAN From criswell at cs.uiuc.edu Wed Oct 19 13:42:51 2005 From: criswell at cs.uiuc.edu (John Criswell) Date: Wed, 19 Oct 2005 13:42:51 -0500 Subject: [llvm-commits] CVS: llvm-test/External/SPEC/CFP2000/173.applu/Makefile Message-ID: <200510191842.NAA18998@choi.cs.uiuc.edu> Changes in directory llvm-test/External/SPEC/CFP2000/173.applu: Makefile updated: 1.2 -> 1.3 --- Log message: Corrected the inclusion of Makefile.FORTRAN, which is not copied into the object tree by configure. --- Diffs of the changes: (+1 -1) Makefile | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm-test/External/SPEC/CFP2000/173.applu/Makefile diff -u llvm-test/External/SPEC/CFP2000/173.applu/Makefile:1.2 llvm-test/External/SPEC/CFP2000/173.applu/Makefile:1.3 --- llvm-test/External/SPEC/CFP2000/173.applu/Makefile:1.2 Tue Jul 19 14:05:46 2005 +++ llvm-test/External/SPEC/CFP2000/173.applu/Makefile Wed Oct 19 13:42:21 2005 @@ -5,5 +5,5 @@ STDIN_FILENAME = applu.in STDOUT_FILENAME = applu.out -include $(LEVEL)/Makefile.FORTRAN include ../../Makefile.spec2000 +include $(PROJ_SRC_ROOT)/Makefile.FORTRAN From criswell at cs.uiuc.edu Wed Oct 19 13:42:51 2005 From: criswell at cs.uiuc.edu (John Criswell) Date: Wed, 19 Oct 2005 13:42:51 -0500 Subject: [llvm-commits] CVS: llvm-test/External/SPEC/CFP2000/200.sixtrack/Makefile Message-ID: <200510191842.NAA19010@choi.cs.uiuc.edu> Changes in directory llvm-test/External/SPEC/CFP2000/200.sixtrack: Makefile updated: 1.1 -> 1.2 --- Log message: Corrected the inclusion of Makefile.FORTRAN, which is not copied into the object tree by configure. --- Diffs of the changes: (+1 -1) Makefile | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm-test/External/SPEC/CFP2000/200.sixtrack/Makefile diff -u llvm-test/External/SPEC/CFP2000/200.sixtrack/Makefile:1.1 llvm-test/External/SPEC/CFP2000/200.sixtrack/Makefile:1.2 --- llvm-test/External/SPEC/CFP2000/200.sixtrack/Makefile:1.1 Tue Jul 19 17:33:11 2005 +++ llvm-test/External/SPEC/CFP2000/200.sixtrack/Makefile Wed Oct 19 13:42:21 2005 @@ -39,7 +39,7 @@ STDOUT_FILENAME = inp.out NAGFORTRAN_FLAGS = -dusty -include $(LEVEL)/Makefile.FORTRAN include ../../Makefile.spec2000 +include $(PROJ_SRC_ROOT)/Makefile.FORTRAN CPPFLAGS += -DINT64='long long' From criswell at cs.uiuc.edu Wed Oct 19 13:42:51 2005 From: criswell at cs.uiuc.edu (John Criswell) Date: Wed, 19 Oct 2005 13:42:51 -0500 Subject: [llvm-commits] CVS: llvm-test/External/SPEC/CFP2000/178.galgel/Makefile Message-ID: <200510191842.NAA19022@choi.cs.uiuc.edu> Changes in directory llvm-test/External/SPEC/CFP2000/178.galgel: Makefile updated: 1.1 -> 1.2 --- Log message: Corrected the inclusion of Makefile.FORTRAN, which is not copied into the object tree by configure. --- Diffs of the changes: (+1 -1) Makefile | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm-test/External/SPEC/CFP2000/178.galgel/Makefile diff -u llvm-test/External/SPEC/CFP2000/178.galgel/Makefile:1.1 llvm-test/External/SPEC/CFP2000/178.galgel/Makefile:1.2 --- llvm-test/External/SPEC/CFP2000/178.galgel/Makefile:1.1 Wed Jul 20 12:05:57 2005 +++ llvm-test/External/SPEC/CFP2000/178.galgel/Makefile Wed Oct 19 13:42:21 2005 @@ -17,8 +17,8 @@ # -I $(SPEC_BENCH_DIR)/src -include $(LEVEL)/Makefile.FORTRAN include ../../Makefile.spec2000 +include $(PROJ_SRC_ROOT)/Makefile.FORTRAN CPPFLAGS += -DINT64='long long' ab.c arhbt.c arhim.c bifg21.c bifgel.c \ From criswell at cs.uiuc.edu Wed Oct 19 13:42:51 2005 From: criswell at cs.uiuc.edu (John Criswell) Date: Wed, 19 Oct 2005 13:42:51 -0500 Subject: [llvm-commits] CVS: llvm-test/External/SPEC/CFP2000/172.mgrid/Makefile Message-ID: <200510191842.NAA19014@choi.cs.uiuc.edu> Changes in directory llvm-test/External/SPEC/CFP2000/172.mgrid: Makefile updated: 1.3 -> 1.4 --- Log message: Corrected the inclusion of Makefile.FORTRAN, which is not copied into the object tree by configure. --- Diffs of the changes: (+1 -1) Makefile | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm-test/External/SPEC/CFP2000/172.mgrid/Makefile diff -u llvm-test/External/SPEC/CFP2000/172.mgrid/Makefile:1.3 llvm-test/External/SPEC/CFP2000/172.mgrid/Makefile:1.4 --- llvm-test/External/SPEC/CFP2000/172.mgrid/Makefile:1.3 Tue Jul 19 14:05:46 2005 +++ llvm-test/External/SPEC/CFP2000/172.mgrid/Makefile Wed Oct 19 13:42:21 2005 @@ -8,5 +8,5 @@ STDIN_FILENAME = mgrid.in STDOUT_FILENAME = mgrid.out -include $(LEVEL)/Makefile.FORTRAN include ../../Makefile.spec2000 +include $(PROJ_SRC_ROOT)/Makefile.FORTRAN From criswell at cs.uiuc.edu Wed Oct 19 13:42:51 2005 From: criswell at cs.uiuc.edu (John Criswell) Date: Wed, 19 Oct 2005 13:42:51 -0500 Subject: [llvm-commits] CVS: llvm-test/External/SPEC/CFP2000/189.lucas/Makefile Message-ID: <200510191842.NAA18997@choi.cs.uiuc.edu> Changes in directory llvm-test/External/SPEC/CFP2000/189.lucas: Makefile updated: 1.1 -> 1.2 --- Log message: Corrected the inclusion of Makefile.FORTRAN, which is not copied into the object tree by configure. --- Diffs of the changes: (+1 -1) Makefile | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm-test/External/SPEC/CFP2000/189.lucas/Makefile diff -u llvm-test/External/SPEC/CFP2000/189.lucas/Makefile:1.1 llvm-test/External/SPEC/CFP2000/189.lucas/Makefile:1.2 --- llvm-test/External/SPEC/CFP2000/189.lucas/Makefile:1.1 Tue Jul 19 20:08:55 2005 +++ llvm-test/External/SPEC/CFP2000/189.lucas/Makefile Wed Oct 19 13:42:21 2005 @@ -9,7 +9,7 @@ STDOUT_FILENAME = lucas2.out #NAGFORTRAN_FLAGS = -dusty -maxcontin=69 -include $(LEVEL)/Makefile.FORTRAN include ../../Makefile.spec2000 +include $(PROJ_SRC_ROOT)/Makefile.FORTRAN CPPFLAGS += -DINT64='long long' From criswell at cs.uiuc.edu Wed Oct 19 13:42:51 2005 From: criswell at cs.uiuc.edu (John Criswell) Date: Wed, 19 Oct 2005 13:42:51 -0500 Subject: [llvm-commits] CVS: llvm-test/External/SPEC/CFP2000/301.apsi/Makefile Message-ID: <200510191842.NAA19012@choi.cs.uiuc.edu> Changes in directory llvm-test/External/SPEC/CFP2000/301.apsi: Makefile updated: 1.1 -> 1.2 --- Log message: Corrected the inclusion of Makefile.FORTRAN, which is not copied into the object tree by configure. --- Diffs of the changes: (+1 -1) Makefile | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm-test/External/SPEC/CFP2000/301.apsi/Makefile diff -u llvm-test/External/SPEC/CFP2000/301.apsi/Makefile:1.1 llvm-test/External/SPEC/CFP2000/301.apsi/Makefile:1.2 --- llvm-test/External/SPEC/CFP2000/301.apsi/Makefile:1.1 Wed Jul 20 20:38:27 2005 +++ llvm-test/External/SPEC/CFP2000/301.apsi/Makefile Wed Oct 19 13:42:21 2005 @@ -9,5 +9,5 @@ STDOUT_FILENAME = apsi.out NAGFORTRAN_FLAGS = -dusty -include $(LEVEL)/Makefile.FORTRAN include ../../Makefile.spec2000 +include $(PROJ_SRC_ROOT)/Makefile.FORTRAN From criswell at cs.uiuc.edu Wed Oct 19 13:42:51 2005 From: criswell at cs.uiuc.edu (John Criswell) Date: Wed, 19 Oct 2005 13:42:51 -0500 Subject: [llvm-commits] CVS: llvm-test/External/SPEC/CFP2000/187.facerec/Makefile Message-ID: <200510191842.NAA19007@choi.cs.uiuc.edu> Changes in directory llvm-test/External/SPEC/CFP2000/187.facerec: Makefile updated: 1.1 -> 1.2 --- Log message: Corrected the inclusion of Makefile.FORTRAN, which is not copied into the object tree by configure. --- Diffs of the changes: (+1 -1) Makefile | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm-test/External/SPEC/CFP2000/187.facerec/Makefile diff -u llvm-test/External/SPEC/CFP2000/187.facerec/Makefile:1.1 llvm-test/External/SPEC/CFP2000/187.facerec/Makefile:1.2 --- llvm-test/External/SPEC/CFP2000/187.facerec/Makefile:1.1 Tue Jul 19 20:33:43 2005 +++ llvm-test/External/SPEC/CFP2000/187.facerec/Makefile Wed Oct 19 13:42:21 2005 @@ -12,8 +12,8 @@ NAGFORTRAN_FLAGS = -kind=byte -dusty -I $(SPEC_BENCH_DIR)/src -include $(LEVEL)/Makefile.FORTRAN include ../../Makefile.spec2000 +include $(PROJ_SRC_ROOT)/Makefile.FORTRAN CPPFLAGS += -DINT64='long long' FaceRec.c: FaceRecTypes.c gaborRoutines.c graphRoutines.c imageRoutines.c parameterRoutines.c From criswell at cs.uiuc.edu Wed Oct 19 13:42:51 2005 From: criswell at cs.uiuc.edu (John Criswell) Date: Wed, 19 Oct 2005 13:42:51 -0500 Subject: [llvm-commits] CVS: llvm-test/External/SPEC/CFP2000/191.fma3d/Makefile Message-ID: <200510191842.NAA19000@choi.cs.uiuc.edu> Changes in directory llvm-test/External/SPEC/CFP2000/191.fma3d: Makefile updated: 1.1 -> 1.2 --- Log message: Corrected the inclusion of Makefile.FORTRAN, which is not copied into the object tree by configure. --- Diffs of the changes: (+1 -1) Makefile | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm-test/External/SPEC/CFP2000/191.fma3d/Makefile diff -u llvm-test/External/SPEC/CFP2000/191.fma3d/Makefile:1.1 llvm-test/External/SPEC/CFP2000/191.fma3d/Makefile:1.2 --- llvm-test/External/SPEC/CFP2000/191.fma3d/Makefile:1.1 Tue Jul 19 20:00:35 2005 +++ llvm-test/External/SPEC/CFP2000/191.fma3d/Makefile Wed Oct 19 13:42:21 2005 @@ -31,8 +31,8 @@ -include $(LEVEL)/Makefile.FORTRAN include ../../Makefile.spec2000 +include $(PROJ_SRC_ROOT)/Makefile.FORTRAN #CPPFLAGS += -DINT64='long long' From criswell at cs.uiuc.edu Wed Oct 19 13:51:22 2005 From: criswell at cs.uiuc.edu (John Criswell) Date: Wed, 19 Oct 2005 13:51:22 -0500 Subject: [llvm-commits] CVS: llvm/test/Regression/CodeGen/Generic/2004-02-08-UnwindSupport.llx Message-ID: <200510191851.NAA19055@choi.cs.uiuc.edu> Changes in directory llvm/test/Regression/CodeGen/Generic: 2004-02-08-UnwindSupport.llx added (r1.1) --- Log message: This is a generic test for all code generators. It originally came from Regression/Codegen/X86. --- Diffs of the changes: (+13 -0) 2004-02-08-UnwindSupport.llx | 13 +++++++++++++ 1 files changed, 13 insertions(+) Index: llvm/test/Regression/CodeGen/Generic/2004-02-08-UnwindSupport.llx diff -c /dev/null llvm/test/Regression/CodeGen/Generic/2004-02-08-UnwindSupport.llx:1.1 *** /dev/null Wed Oct 19 13:51:18 2005 --- llvm/test/Regression/CodeGen/Generic/2004-02-08-UnwindSupport.llx Wed Oct 19 13:51:08 2005 *************** *** 0 **** --- 1,13 ---- + ; RUN: llvm-as < %s | llc -enable-correct-eh-support + + int %test() { + unwind + } + + int %main() { + %X = invoke int %test() to label %cont except label %EH + cont: + ret int 1 + EH: + ret int 0 + } From criswell at cs.uiuc.edu Wed Oct 19 13:53:07 2005 From: criswell at cs.uiuc.edu (John Criswell) Date: Wed, 19 Oct 2005 13:53:07 -0500 Subject: [llvm-commits] CVS: llvm/test/Regression/CodeGen/X86/2004-02-08-UnwindSupport.llx Message-ID: <200510191853.NAA19075@choi.cs.uiuc.edu> Changes in directory llvm/test/Regression/CodeGen/X86: 2004-02-08-UnwindSupport.llx (r1.3) removed --- Log message: Moved to Regression/Codegen/Generic. --- Diffs of the changes: (+0 -0) 0 files changed From jlaskey at apple.com Wed Oct 19 14:51:27 2005 From: jlaskey at apple.com (Jim Laskey) Date: Wed, 19 Oct 2005 14:51:27 -0500 Subject: [llvm-commits] CVS: llvm/lib/Target/Target.td Message-ID: <200510191951.OAA24341@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target: Target.td updated: 1.53 -> 1.54 --- Log message: Added InstrSchedClass to each of the PowerPC Instructions. Note that when adding new instructions that you should refer to the table at the bottom of PPCSchedule.td. --- Diffs of the changes: (+8 -5) Target.td | 13 ++++++++----- 1 files changed, 8 insertions(+), 5 deletions(-) Index: llvm/lib/Target/Target.td diff -u llvm/lib/Target/Target.td:1.53 llvm/lib/Target/Target.td:1.54 --- llvm/lib/Target/Target.td:1.53 Wed Oct 19 08:34:52 2005 +++ llvm/lib/Target/Target.td Wed Oct 19 14:51:16 2005 @@ -113,6 +113,12 @@ //===----------------------------------------------------------------------===// +// Pull in the common support for scheduling +// +include "../TargetSchedule.td" + + +//===----------------------------------------------------------------------===// // Instruction set description - These classes correspond to the C++ classes in // the Target/TargetInstrInfo.h file. // @@ -147,6 +153,8 @@ bit isTerminator = 0; // Is this part of the terminator for a basic block? bit hasDelaySlot = 0; // Does this instruction have an delay slot? bit usesCustomDAGSchedInserter = 0; // Pseudo instr needing special help. + + InstrItinClass Itinerary; // Execution steps used for scheduling. } @@ -242,11 +250,6 @@ } //===----------------------------------------------------------------------===// -// Pull in the common support for scheduling -// -include "../TargetSchedule.td" - -//===----------------------------------------------------------------------===// // SubtargetFeature - A characteristic of the chip set. // class SubtargetFeature { From jlaskey at apple.com Wed Oct 19 14:51:28 2005 From: jlaskey at apple.com (Jim Laskey) Date: Wed, 19 Oct 2005 14:51:28 -0500 Subject: [llvm-commits] CVS: llvm/lib/Target/PowerPC/PPC.td PPCInstrFormats.td PPCInstrInfo.td PPCSchedule.td PPCScheduleG3.td PPCScheduleG4.td PPCScheduleG4Plus.td PPCScheduleG5.td Message-ID: <200510191951.OAA24359@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/PowerPC: PPC.td updated: 1.2 -> 1.3 PPCInstrFormats.td updated: 1.53 -> 1.54 PPCInstrInfo.td updated: 1.129 -> 1.130 PPCSchedule.td updated: 1.2 -> 1.3 PPCScheduleG3.td updated: 1.3 -> 1.4 PPCScheduleG4.td updated: 1.3 -> 1.4 PPCScheduleG4Plus.td updated: 1.3 -> 1.4 PPCScheduleG5.td updated: 1.3 -> 1.4 --- Log message: Added InstrSchedClass to each of the PowerPC Instructions. Note that when adding new instructions that you should refer to the table at the bottom of PPCSchedule.td. --- Diffs of the changes: (+421 -386) PPC.td | 37 +++++ PPCInstrFormats.td | 251 +++++++++++++++++++++---------------- PPCInstrInfo.td | 345 +++++++++++++++++++++++++-------------------------- PPCSchedule.td | 150 ++++++++-------------- PPCScheduleG3.td | 6 PPCScheduleG4.td | 6 PPCScheduleG4Plus.td | 6 PPCScheduleG5.td | 6 8 files changed, 421 insertions(+), 386 deletions(-) Index: llvm/lib/Target/PowerPC/PPC.td diff -u llvm/lib/Target/PowerPC/PPC.td:1.2 llvm/lib/Target/PowerPC/PPC.td:1.3 --- llvm/lib/Target/PowerPC/PPC.td:1.2 Fri Oct 14 18:40:39 2005 +++ llvm/lib/Target/PowerPC/PPC.td Wed Oct 19 14:51:16 2005 @@ -20,8 +20,45 @@ //===----------------------------------------------------------------------===// include "PPCRegisterInfo.td" +include "PPCSchedule.td" include "PPCInstrInfo.td" + + +//===----------------------------------------------------------------------===// +// PowerPC Subtarget features. +// + +def F64Bit : SubtargetFeature<"64bit", + "Should 64 bit instructions be used">; +def F64BitRegs : SubtargetFeature<"64bitregs", + "Should 64 bit registers be used">; +def FAltivec : SubtargetFeature<"altivec", + "Should Altivec instructions be used">; +def FGPUL : SubtargetFeature<"gpul", + "Should GPUL instructions be used">; +def FFSQRT : SubtargetFeature<"fsqrt", + "Should the fsqrt instruction be used">; + +//===----------------------------------------------------------------------===// +// PowerPC chips sets supported +// + +def : Processor<"601", G3Itineraries, []>; +def : Processor<"602", G3Itineraries, []>; +def : Processor<"603", G3Itineraries, []>; +def : Processor<"604", G3Itineraries, []>; +def : Processor<"750", G3Itineraries, []>; +def : Processor<"7400", G4Itineraries, [FAltivec]>; +def : Processor<"g4", G4Itineraries, [FAltivec]>; +def : Processor<"7450", G4PlusItineraries, [FAltivec]>; +def : Processor<"g4+", G4PlusItineraries, [FAltivec]>; +def : Processor<"970", G5Itineraries, + [FAltivec, FGPUL, FFSQRT, F64Bit, F64BitRegs]>; +def : Processor<"g5", G5Itineraries, + [FAltivec, FGPUL, FFSQRT, F64Bit, F64BitRegs]>; + + def PPC : Target { // Pointers on PPC are 32-bits in size. let PointerType = i32; Index: llvm/lib/Target/PowerPC/PPCInstrFormats.td diff -u llvm/lib/Target/PowerPC/PPCInstrFormats.td:1.53 llvm/lib/Target/PowerPC/PPCInstrFormats.td:1.54 --- llvm/lib/Target/PowerPC/PPCInstrFormats.td:1.53 Wed Oct 19 13:42:01 2005 +++ llvm/lib/Target/PowerPC/PPCInstrFormats.td Wed Oct 19 14:51:16 2005 @@ -14,7 +14,8 @@ // // PowerPC instruction formats -class I opcode, dag OL, string asmstr> : Instruction { +class I opcode, dag OL, string asmstr, InstrItinClass itin> + : Instruction { field bits<32> Inst; bit PPC64 = 0; // Default value, override with isPPC64 @@ -25,11 +26,13 @@ let Inst{0-5} = opcode; let OperandList = OL; let AsmString = asmstr; + let Itinerary = itin; } // 1.7.1 I-Form -class IForm opcode, bit aa, bit lk, dag OL, string asmstr> - : I { +class IForm opcode, bit aa, bit lk, dag OL, string asmstr, + InstrItinClass itin> + : I { bits<24> LI; let Inst{6-29} = LI; @@ -39,8 +42,8 @@ // 1.7.2 B-Form class BForm opcode, bit aa, bit lk, bits<5> bo, bits<2> bicode, dag OL, - string asmstr> - : I { + string asmstr, InstrItinClass itin> + : I { bits<3> CR; bits<14> BD; @@ -53,8 +56,9 @@ } // 1.7.4 D-Form -class DForm_base opcode, dag OL, string asmstr, list pattern> - : I { +class DForm_base opcode, dag OL, string asmstr, InstrItinClass itin, + list pattern> + : I { let Pattern = pattern; bits<5> A; bits<5> B; @@ -65,8 +69,8 @@ let Inst{16-31} = C; } -class DForm_1 opcode, dag OL, string asmstr> - : I { +class DForm_1 opcode, dag OL, string asmstr, InstrItinClass itin> + : I { bits<5> A; bits<16> C; bits<5> B; @@ -76,11 +80,13 @@ let Inst{16-31} = C; } -class DForm_2 opcode, dag OL, string asmstr, list pattern> - : DForm_base; +class DForm_2 opcode, dag OL, string asmstr, InstrItinClass itin, + list pattern> + : DForm_base; -class DForm_2_r0 opcode, dag OL, string asmstr, list pattern> - : I { +class DForm_2_r0 opcode, dag OL, string asmstr, InstrItinClass itin, + list pattern> + : I { bits<5> A; bits<16> B; @@ -92,11 +98,12 @@ } // Currently we make the use/def reg distinction in ISel, not tablegen -class DForm_3 opcode, dag OL, string asmstr> - : DForm_1; +class DForm_3 opcode, dag OL, string asmstr, InstrItinClass itin> + : DForm_1; -class DForm_4 opcode, dag OL, string asmstr, list pattern> - : I { +class DForm_4 opcode, dag OL, string asmstr, InstrItinClass itin, + list pattern> + : I { bits<5> B; bits<5> A; bits<16> C; @@ -108,14 +115,15 @@ let Inst{16-31} = C; } -class DForm_4_zero opcode, dag OL, string asmstr> - : DForm_1 { +class DForm_4_zero opcode, dag OL, string asmstr, InstrItinClass itin> + : DForm_1 { let A = 0; let B = 0; let C = 0; } -class DForm_5 opcode, dag OL, string asmstr> : I { +class DForm_5 opcode, dag OL, string asmstr, InstrItinClass itin> + : I { bits<3> BF; bits<1> L; bits<5> RA; @@ -128,30 +136,31 @@ let Inst{16-31} = I; } -class DForm_5_ext opcode, dag OL, string asmstr> - : DForm_5 { +class DForm_5_ext opcode, dag OL, string asmstr, InstrItinClass itin> + : DForm_5 { let L = PPC64; } -class DForm_6 opcode, dag OL, string asmstr> - : DForm_5; +class DForm_6 opcode, dag OL, string asmstr, InstrItinClass itin> + : DForm_5; -class DForm_6_ext opcode, dag OL, string asmstr> - : DForm_6 { +class DForm_6_ext opcode, dag OL, string asmstr, InstrItinClass itin> + : DForm_6 { let L = PPC64; } -class DForm_8 opcode, dag OL, string asmstr> - : DForm_1 { +class DForm_8 opcode, dag OL, string asmstr, InstrItinClass itin> + : DForm_1 { } -class DForm_9 opcode, dag OL, string asmstr> - : DForm_1 { +class DForm_9 opcode, dag OL, string asmstr, InstrItinClass itin> + : DForm_1 { } // 1.7.5 DS-Form -class DSForm_1 opcode, bits<2> xo, dag OL, string asmstr> - : I { +class DSForm_1 opcode, bits<2> xo, dag OL, string asmstr, + InstrItinClass itin> + : I { bits<5> RST; bits<14> DS; bits<5> RA; @@ -162,12 +171,14 @@ let Inst{30-31} = xo; } -class DSForm_2 opcode, bits<2> xo, dag OL, string asmstr> - : DSForm_1; +class DSForm_2 opcode, bits<2> xo, dag OL, string asmstr, + InstrItinClass itin> + : DSForm_1; // 1.7.6 X-Form class XForm_base_r3xo opcode, bits<10> xo, - dag OL, string asmstr> : I { + dag OL, string asmstr, InstrItinClass itin> + : I { bits<5> RST; bits<5> A; bits<5> B; @@ -184,8 +195,9 @@ // This is the same as XForm_base_r3xo, but the first two operands are swapped // when code is emitted. class XForm_base_r3xo_swapped - opcode, bits<10> xo, dag OL, string asmstr> - : I { + opcode, bits<10> xo, dag OL, string asmstr, + InstrItinClass itin> + : I { bits<5> A; bits<5> RST; bits<5> B; @@ -200,32 +212,36 @@ } -class XForm_1 opcode, bits<10> xo, dag OL, string asmstr> - : XForm_base_r3xo; - -class XForm_6 opcode, bits<10> xo, dag OL, string asmstr, - list pattern> - : XForm_base_r3xo_swapped { +class XForm_1 opcode, bits<10> xo, dag OL, string asmstr, + InstrItinClass itin> + : XForm_base_r3xo; + +class XForm_6 opcode, bits<10> xo, dag OL, string asmstr, + InstrItinClass itin, list pattern> + : XForm_base_r3xo_swapped { let Pattern = pattern; } -class XForm_8 opcode, bits<10> xo, dag OL, string asmstr> - : XForm_base_r3xo; - -class XForm_10 opcode, bits<10> xo, dag OL, string asmstr, list pt> - : XForm_base_r3xo_swapped { - let Pattern = pt; +class XForm_8 opcode, bits<10> xo, dag OL, string asmstr, + InstrItinClass itin> + : XForm_base_r3xo; + +class XForm_10 opcode, bits<10> xo, dag OL, string asmstr, + InstrItinClass itin, list pattern> + : XForm_base_r3xo_swapped { + let Pattern = pattern; } class XForm_11 opcode, bits<10> xo, dag OL, string asmstr, - list pattern> - : XForm_base_r3xo_swapped { + InstrItinClass itin, list pattern> + : XForm_base_r3xo_swapped { let B = 0; let Pattern = pattern; } -class XForm_16 opcode, bits<10> xo, dag OL, string asmstr> - : I { +class XForm_16 opcode, bits<10> xo, dag OL, string asmstr, + InstrItinClass itin> + : I { bits<3> BF; bits<1> L; bits<5> RA; @@ -240,13 +256,15 @@ let Inst{31} = 0; } -class XForm_16_ext opcode, bits<10> xo, dag OL, string asmstr> - : XForm_16 { +class XForm_16_ext opcode, bits<10> xo, dag OL, string asmstr, + InstrItinClass itin> + : XForm_16 { let L = PPC64; } -class XForm_17 opcode, bits<10> xo, dag OL, string asmstr> - : I { +class XForm_17 opcode, bits<10> xo, dag OL, string asmstr, + InstrItinClass itin> + : I { bits<3> BF; bits<5> FRA; bits<5> FRB; @@ -259,23 +277,27 @@ let Inst{31} = 0; } -class XForm_25 opcode, bits<10> xo, dag OL, string asmstr> - : XForm_base_r3xo { +class XForm_25 opcode, bits<10> xo, dag OL, string asmstr, + InstrItinClass itin> + : XForm_base_r3xo { } -class XForm_26 opcode, bits<10> xo, dag OL, string asmstr, list pt> - : XForm_base_r3xo { +class XForm_26 opcode, bits<10> xo, dag OL, string asmstr, + InstrItinClass itin, list pattern> + : XForm_base_r3xo { let A = 0; - let Pattern = pt; + let Pattern = pattern; } -class XForm_28 opcode, bits<10> xo, dag OL, string asmstr> - : XForm_base_r3xo { +class XForm_28 opcode, bits<10> xo, dag OL, string asmstr, + InstrItinClass itin> + : XForm_base_r3xo { } // 1.7.7 XL-Form -class XLForm_1 opcode, bits<10> xo, dag OL, string asmstr> - : I { +class XLForm_1 opcode, bits<10> xo, dag OL, string asmstr, + InstrItinClass itin> + : I { bits<3> CRD; bits<2> CRDb; bits<3> CRA; @@ -293,8 +315,9 @@ let Inst{31} = 0; } -class XLForm_2 opcode, bits<10> xo, bit lk, - dag OL, string asmstr> : I { +class XLForm_2 opcode, bits<10> xo, bit lk, dag OL, string asmstr, + InstrItinClass itin> + : I { bits<5> BO; bits<5> BI; bits<2> BH; @@ -307,16 +330,17 @@ let Inst{31} = lk; } -class XLForm_2_ext opcode, bits<10> xo, bits<5> bo, - bits<5> bi, bit lk, dag OL, string asmstr> - : XLForm_2 { +class XLForm_2_ext opcode, bits<10> xo, bits<5> bo, bits<5> bi, bit lk, + dag OL, string asmstr, InstrItinClass itin> + : XLForm_2 { let BO = bo; let BI = bi; let BH = 0; } -class XLForm_3 opcode, bits<10> xo, dag OL, string asmstr> - : I { +class XLForm_3 opcode, bits<10> xo, dag OL, string asmstr, + InstrItinClass itin> + : I { bits<3> BF; bits<3> BFA; @@ -330,8 +354,9 @@ } // 1.7.8 XFX-Form -class XFXForm_1 opcode, bits<10> xo, dag OL, string asmstr> - : I { +class XFXForm_1 opcode, bits<10> xo, dag OL, string asmstr, + InstrItinClass itin> + : I { bits<5> RT; bits<10> SPR; @@ -342,13 +367,14 @@ } class XFXForm_1_ext opcode, bits<10> xo, bits<10> spr, - dag OL, string asmstr> - : XFXForm_1 { + dag OL, string asmstr, InstrItinClass itin> + : XFXForm_1 { let SPR = spr; } -class XFXForm_3 opcode, bits<10> xo, dag OL, string asmstr> - : I { +class XFXForm_3 opcode, bits<10> xo, dag OL, string asmstr, + InstrItinClass itin> + : I { bits<5> RT; let Inst{6-10} = RT; @@ -357,8 +383,9 @@ let Inst{31} = 0; } -class XFXForm_5 opcode, bits<10> xo, dag OL, string asmstr> - : I { +class XFXForm_5 opcode, bits<10> xo, dag OL, string asmstr, + InstrItinClass itin> + : I { bits<8> FXM; bits<5> ST; @@ -370,8 +397,9 @@ let Inst{31} = 0; } -class XFXForm_5a opcode, bits<10> xo, dag OL, string asmstr> - : I { +class XFXForm_5a opcode, bits<10> xo, dag OL, string asmstr, + InstrItinClass itin> + : I { bits<5> ST; bits<8> FXM; @@ -384,18 +412,20 @@ } -class XFXForm_7 opcode, bits<10> xo, dag OL, string asmstr> - : XFXForm_1; +class XFXForm_7 opcode, bits<10> xo, dag OL, string asmstr, + InstrItinClass itin> + : XFXForm_1; class XFXForm_7_ext opcode, bits<10> xo, bits<10> spr, - dag OL, string asmstr> - : XFXForm_7 { + dag OL, string asmstr, InstrItinClass itin> + : XFXForm_7 { let SPR = spr; } // 1.7.10 XS-Form -class XSForm_1 opcode, bits<9> xo, dag OL, string asmstr> - : I { +class XSForm_1 opcode, bits<9> xo, dag OL, string asmstr, + InstrItinClass itin> + : I { bits<5> RS; bits<5> A; bits<6> SH; @@ -412,8 +442,8 @@ // 1.7.11 XO-Form class XOForm_1 opcode, bits<9> xo, bit oe, dag OL, string asmstr, - list pattern> - : I { + InstrItinClass itin, list pattern> + : I { bits<5> RT; bits<5> RA; bits<5> RB; @@ -431,15 +461,15 @@ } class XOForm_3 opcode, bits<9> xo, bit oe, - dag OL, string asmstr, list pattern> - : XOForm_1 { + dag OL, string asmstr, InstrItinClass itin, list pattern> + : XOForm_1 { let RB = 0; } // 1.7.12 A-Form class AForm_1 opcode, bits<5> xo, dag OL, string asmstr, - list pattern> - : I { + InstrItinClass itin, list pattern> + : I { bits<5> FRT; bits<5> FRA; bits<5> FRC; @@ -457,19 +487,22 @@ let Inst{31} = RC; } -class AForm_2 opcode, bits<5> xo, dag OL, string asmstr, list pat> - : AForm_1 { +class AForm_2 opcode, bits<5> xo, dag OL, string asmstr, + InstrItinClass itin, list pattern> + : AForm_1 { let FRC = 0; } -class AForm_3 opcode, bits<5> xo, dag OL, string asmstr, list pat> - : AForm_1 { +class AForm_3 opcode, bits<5> xo, dag OL, string asmstr, + InstrItinClass itin, list pattern> + : AForm_1 { let FRB = 0; } // 1.7.13 M-Form -class MForm_1 opcode, dag OL, string asmstr, list pattern> - : I { +class MForm_1 opcode, dag OL, string asmstr, + InstrItinClass itin, list pattern> + : I { bits<5> RA; bits<5> RS; bits<5> RB; @@ -488,14 +521,15 @@ let Inst{31} = RC; } -class MForm_2 opcode, dag OL, string asmstr, list pattern> - : MForm_1 { +class MForm_2 opcode, dag OL, string asmstr, + InstrItinClass itin, list pattern> + : MForm_1 { } // 1.7.14 MD-Form -class MDForm_1 opcode, bits<3> xo, dag OL, string asmstr, - list pattern> - : I { +class MDForm_1 opcode, bits<3> xo, dag OL, string asmstr, + InstrItinClass itin, list pattern> + : I { bits<5> RS; bits<5> RA; bits<6> SH; @@ -515,8 +549,9 @@ } //===----------------------------------------------------------------------===// - -class Pseudo : I<0, OL, asmstr> { +def NoItin : InstrItinClass; +class Pseudo + : I<0, OL, asmstr, NoItin> { let PPC64 = 0; let VMX = 0; Index: llvm/lib/Target/PowerPC/PPCInstrInfo.td diff -u llvm/lib/Target/PowerPC/PPCInstrInfo.td:1.129 llvm/lib/Target/PowerPC/PPCInstrInfo.td:1.130 --- llvm/lib/Target/PowerPC/PPCInstrInfo.td:1.129 Wed Oct 19 13:42:01 2005 +++ llvm/lib/Target/PowerPC/PPCInstrInfo.td Wed Oct 19 14:51:16 2005 @@ -159,8 +159,8 @@ let isTerminator = 1 in { let isReturn = 1 in - def BLR : XLForm_2_ext<19, 16, 20, 0, 0, (ops), "blr">; - def BCTR : XLForm_2_ext<19, 528, 20, 0, 0, (ops), "bctr">; + def BLR : XLForm_2_ext<19, 16, 20, 0, 0, (ops), "blr", BrB>; + def BCTR : XLForm_2_ext<19, 528, 20, 0, 0, (ops), "bctr", BrB>; } let Defs = [LR] in @@ -170,25 +170,25 @@ def COND_BRANCH : Pseudo<(ops CRRC:$crS, u16imm:$opc, target:$true, target:$false), "; COND_BRANCH">; - def B : IForm<18, 0, 0, (ops target:$func), "b $func">; -//def BA : IForm<18, 1, 0, (ops target:$func), "ba $func">; - def BL : IForm<18, 0, 1, (ops target:$func), "bl $func">; -//def BLA : IForm<18, 1, 1, (ops target:$func), "bla $func">; + def B : IForm<18, 0, 0, (ops target:$func), "b $func", BrB>; +//def BA : IForm<18, 1, 0, (ops target:$func), "ba $func", BrB>; + def BL : IForm<18, 0, 1, (ops target:$func), "bl $func", BrB>; +//def BLA : IForm<18, 1, 1, (ops target:$func), "bla $func", BrB>; // FIXME: 4*CR# needs to be added to the BI field! // This will only work for CR0 as it stands now def BLT : BForm<16, 0, 0, 12, 0, (ops CRRC:$crS, target:$block), - "blt $crS, $block">; + "blt $crS, $block", BrB>; def BLE : BForm<16, 0, 0, 4, 1, (ops CRRC:$crS, target:$block), - "ble $crS, $block">; + "ble $crS, $block", BrB>; def BEQ : BForm<16, 0, 0, 12, 2, (ops CRRC:$crS, target:$block), - "beq $crS, $block">; + "beq $crS, $block", BrB>; def BGE : BForm<16, 0, 0, 4, 0, (ops CRRC:$crS, target:$block), - "bge $crS, $block">; + "bge $crS, $block", BrB>; def BGT : BForm<16, 0, 0, 12, 1, (ops CRRC:$crS, target:$block), - "bgt $crS, $block">; + "bgt $crS, $block", BrB>; def BNE : BForm<16, 0, 0, 4, 2, (ops CRRC:$crS, target:$block), - "bne $crS, $block">; + "bne $crS, $block", BrB>; } let isCall = 1, @@ -198,9 +198,10 @@ LR,CTR, CR0,CR1,CR5,CR6,CR7] in { // Convenient aliases for call instructions - def CALLpcrel : IForm<18, 0, 1, (ops target:$func, variable_ops), "bl $func">; + def CALLpcrel : IForm<18, 0, 1, (ops target:$func, variable_ops), + "bl $func", BrB>; def CALLindirect : XLForm_2_ext<19, 528, 20, 0, 1, - (ops variable_ops), "bctrl">; + (ops variable_ops), "bctrl", BrB>; } // D-Form instructions. Most instructions that perform an operation on a @@ -208,114 +209,114 @@ // let isLoad = 1 in { def LBZ : DForm_1<34, (ops GPRC:$rD, symbolLo:$disp, GPRC:$rA), - "lbz $rD, $disp($rA)">; + "lbz $rD, $disp($rA)", LdStGeneral>; def LHA : DForm_1<42, (ops GPRC:$rD, symbolLo:$disp, GPRC:$rA), - "lha $rD, $disp($rA)">; + "lha $rD, $disp($rA)", LdStLHA>; def LHZ : DForm_1<40, (ops GPRC:$rD, symbolLo:$disp, GPRC:$rA), - "lhz $rD, $disp($rA)">; + "lhz $rD, $disp($rA)", LdStGeneral>; def LMW : DForm_1<46, (ops GPRC:$rD, s16imm:$disp, GPRC:$rA), - "lmw $rD, $disp($rA)">; + "lmw $rD, $disp($rA)", LdStLMW>; def LWZ : DForm_1<32, (ops GPRC:$rD, symbolLo:$disp, GPRC:$rA), - "lwz $rD, $disp($rA)">; + "lwz $rD, $disp($rA)", LdStGeneral>; def LWZU : DForm_1<35, (ops GPRC:$rD, s16imm:$disp, GPRC:$rA), - "lwzu $rD, $disp($rA)">; + "lwzu $rD, $disp($rA)", LdStGeneral>; } def ADDI : DForm_2<14, (ops GPRC:$rD, GPRC:$rA, s16imm:$imm), - "addi $rD, $rA, $imm", + "addi $rD, $rA, $imm", IntGeneral, [(set GPRC:$rD, (add GPRC:$rA, immSExt16:$imm))]>; def ADDIC : DForm_2<12, (ops GPRC:$rD, GPRC:$rA, s16imm:$imm), - "addic $rD, $rA, $imm", + "addic $rD, $rA, $imm", IntGeneral, []>; def ADDICo : DForm_2<13, (ops GPRC:$rD, GPRC:$rA, s16imm:$imm), - "addic. $rD, $rA, $imm", + "addic. $rD, $rA, $imm", IntGeneral, []>; def ADDIS : DForm_2<15, (ops GPRC:$rD, GPRC:$rA, symbolHi:$imm), - "addis $rD, $rA, $imm", + "addis $rD, $rA, $imm", IntGeneral, [(set GPRC:$rD, (add GPRC:$rA, imm16Shifted:$imm))]>; def LA : DForm_2<14, (ops GPRC:$rD, GPRC:$rA, symbolLo:$sym), - "la $rD, $sym($rA)", + "la $rD, $sym($rA)", IntGeneral, []>; def MULLI : DForm_2< 7, (ops GPRC:$rD, GPRC:$rA, s16imm:$imm), - "mulli $rD, $rA, $imm", + "mulli $rD, $rA, $imm", IntMulLI, [(set GPRC:$rD, (mul GPRC:$rA, immSExt16:$imm))]>; def SUBFIC : DForm_2< 8, (ops GPRC:$rD, GPRC:$rA, s16imm:$imm), - "subfic $rD, $rA, $imm", + "subfic $rD, $rA, $imm", IntGeneral, [(set GPRC:$rD, (sub immSExt16:$imm, GPRC:$rA))]>; def LI : DForm_2_r0<14, (ops GPRC:$rD, s16imm:$imm), - "li $rD, $imm", + "li $rD, $imm", IntGeneral, [(set GPRC:$rD, immSExt16:$imm)]>; def LIS : DForm_2_r0<15, (ops GPRC:$rD, symbolHi:$imm), - "lis $rD, $imm", + "lis $rD, $imm", IntGeneral, [(set GPRC:$rD, imm16Shifted:$imm)]>; let isStore = 1 in { def STMW : DForm_3<47, (ops GPRC:$rS, s16imm:$disp, GPRC:$rA), - "stmw $rS, $disp($rA)">; + "stmw $rS, $disp($rA)", LdStLMW>; def STB : DForm_3<38, (ops GPRC:$rS, symbolLo:$disp, GPRC:$rA), - "stb $rS, $disp($rA)">; + "stb $rS, $disp($rA)", LdStGeneral>; def STH : DForm_3<44, (ops GPRC:$rS, symbolLo:$disp, GPRC:$rA), - "sth $rS, $disp($rA)">; + "sth $rS, $disp($rA)", LdStGeneral>; def STW : DForm_3<36, (ops GPRC:$rS, symbolLo:$disp, GPRC:$rA), - "stw $rS, $disp($rA)">; + "stw $rS, $disp($rA)", LdStGeneral>; def STWU : DForm_3<37, (ops GPRC:$rS, s16imm:$disp, GPRC:$rA), - "stwu $rS, $disp($rA)">; + "stwu $rS, $disp($rA)", LdStGeneral>; } def ANDIo : DForm_4<28, (ops GPRC:$dst, GPRC:$src1, u16imm:$src2), - "andi. $dst, $src1, $src2", + "andi. $dst, $src1, $src2", IntGeneral, []>, isDOT; def ANDISo : DForm_4<29, (ops GPRC:$dst, GPRC:$src1, u16imm:$src2), - "andis. $dst, $src1, $src2", + "andis. $dst, $src1, $src2", IntGeneral, []>, isDOT; def ORI : DForm_4<24, (ops GPRC:$dst, GPRC:$src1, u16imm:$src2), - "ori $dst, $src1, $src2", + "ori $dst, $src1, $src2", IntGeneral, [(set GPRC:$dst, (or GPRC:$src1, immZExt16:$src2))]>; def ORIS : DForm_4<25, (ops GPRC:$dst, GPRC:$src1, u16imm:$src2), - "oris $dst, $src1, $src2", + "oris $dst, $src1, $src2", IntGeneral, [(set GPRC:$dst, (or GPRC:$src1, imm16Shifted:$src2))]>; def XORI : DForm_4<26, (ops GPRC:$dst, GPRC:$src1, u16imm:$src2), - "xori $dst, $src1, $src2", + "xori $dst, $src1, $src2", IntGeneral, [(set GPRC:$dst, (xor GPRC:$src1, immZExt16:$src2))]>; def XORIS : DForm_4<27, (ops GPRC:$dst, GPRC:$src1, u16imm:$src2), - "xoris $dst, $src1, $src2", + "xoris $dst, $src1, $src2", IntGeneral, [(set GPRC:$dst, (xor GPRC:$src1, imm16Shifted:$src2))]>; -def NOP : DForm_4_zero<24, (ops), "nop">; +def NOP : DForm_4_zero<24, (ops), "nop", IntGeneral>; def CMPI : DForm_5<11, (ops CRRC:$crD, i1imm:$L, GPRC:$rA, s16imm:$imm), - "cmpi $crD, $L, $rA, $imm">; + "cmpi $crD, $L, $rA, $imm", IntCompare>; def CMPWI : DForm_5_ext<11, (ops CRRC:$crD, GPRC:$rA, s16imm:$imm), - "cmpwi $crD, $rA, $imm">; + "cmpwi $crD, $rA, $imm", IntCompare>; def CMPDI : DForm_5_ext<11, (ops CRRC:$crD, GPRC:$rA, s16imm:$imm), - "cmpdi $crD, $rA, $imm">, isPPC64; + "cmpdi $crD, $rA, $imm", IntCompare>, isPPC64; def CMPLI : DForm_6<10, (ops CRRC:$dst, i1imm:$size, GPRC:$src1, u16imm:$src2), - "cmpli $dst, $size, $src1, $src2">; + "cmpli $dst, $size, $src1, $src2", IntCompare>; def CMPLWI : DForm_6_ext<10, (ops CRRC:$dst, GPRC:$src1, u16imm:$src2), - "cmplwi $dst, $src1, $src2">; + "cmplwi $dst, $src1, $src2", IntCompare>; def CMPLDI : DForm_6_ext<10, (ops CRRC:$dst, GPRC:$src1, u16imm:$src2), - "cmpldi $dst, $src1, $src2">, isPPC64; + "cmpldi $dst, $src1, $src2", IntCompare>, isPPC64; let isLoad = 1 in { def LFS : DForm_8<48, (ops F4RC:$rD, symbolLo:$disp, GPRC:$rA), - "lfs $rD, $disp($rA)">; + "lfs $rD, $disp($rA)", LdStLFDU>; def LFD : DForm_8<50, (ops F8RC:$rD, symbolLo:$disp, GPRC:$rA), - "lfd $rD, $disp($rA)">; + "lfd $rD, $disp($rA)", LdStLFD>; } let isStore = 1 in { def STFS : DForm_9<52, (ops F4RC:$rS, symbolLo:$disp, GPRC:$rA), - "stfs $rS, $disp($rA)">; + "stfs $rS, $disp($rA)", LdStUX>; def STFD : DForm_9<54, (ops F8RC:$rS, symbolLo:$disp, GPRC:$rA), - "stfd $rS, $disp($rA)">; + "stfd $rS, $disp($rA)", LdStUX>; } // DS-Form instructions. Load/Store instructions available in PPC-64 // let isLoad = 1 in { def LWA : DSForm_1<58, 2, (ops GPRC:$rT, s16immX4:$DS, GPRC:$rA), - "lwa $rT, $DS($rA)">, isPPC64; + "lwa $rT, $DS($rA)", LdStLWA>, isPPC64; def LD : DSForm_2<58, 0, (ops GPRC:$rT, s16immX4:$DS, GPRC:$rA), - "ld $rT, $DS($rA)">, isPPC64; + "ld $rT, $DS($rA)", LdStLD>, isPPC64; } let isStore = 1 in { def STD : DSForm_2<62, 0, (ops GPRC:$rT, s16immX4:$DS, GPRC:$rA), - "std $rT, $DS($rA)">, isPPC64; + "std $rT, $DS($rA)", LdStSTD>, isPPC64; def STDU : DSForm_2<62, 1, (ops GPRC:$rT, s16immX4:$DS, GPRC:$rA), - "stdu $rT, $DS($rA)">, isPPC64; + "stdu $rT, $DS($rA)", LdStSTD>, isPPC64; } // X-Form instructions. Most instructions that perform an operation on a @@ -323,270 +324,270 @@ // let isLoad = 1 in { def LBZX : XForm_1<31, 87, (ops GPRC:$dst, GPRC:$base, GPRC:$index), - "lbzx $dst, $base, $index">; + "lbzx $dst, $base, $index", LdStGeneral>; def LHAX : XForm_1<31, 343, (ops GPRC:$dst, GPRC:$base, GPRC:$index), - "lhax $dst, $base, $index">; + "lhax $dst, $base, $index", LdStLHA>; def LHZX : XForm_1<31, 279, (ops GPRC:$dst, GPRC:$base, GPRC:$index), - "lhzx $dst, $base, $index">; + "lhzx $dst, $base, $index", LdStGeneral>; def LWAX : XForm_1<31, 341, (ops GPRC:$dst, GPRC:$base, GPRC:$index), - "lwax $dst, $base, $index">, isPPC64; + "lwax $dst, $base, $index", LdStLHA>, isPPC64; def LWZX : XForm_1<31, 23, (ops GPRC:$dst, GPRC:$base, GPRC:$index), - "lwzx $dst, $base, $index">; + "lwzx $dst, $base, $index", LdStGeneral>; def LDX : XForm_1<31, 21, (ops GPRC:$dst, GPRC:$base, GPRC:$index), - "ldx $dst, $base, $index">, isPPC64; + "ldx $dst, $base, $index", LdStLD>, isPPC64; } def NAND : XForm_6<31, 476, (ops GPRC:$rA, GPRC:$rS, GPRC:$rB), - "nand $rA, $rS, $rB", + "nand $rA, $rS, $rB", IntGeneral, [(set GPRC:$rA, (not (and GPRC:$rS, GPRC:$rB)))]>; def AND : XForm_6<31, 28, (ops GPRC:$rA, GPRC:$rS, GPRC:$rB), - "and $rA, $rS, $rB", + "and $rA, $rS, $rB", IntGeneral, [(set GPRC:$rA, (and GPRC:$rS, GPRC:$rB))]>; def ANDo : XForm_6<31, 28, (ops GPRC:$rA, GPRC:$rS, GPRC:$rB), - "and. $rA, $rS, $rB", + "and. $rA, $rS, $rB", IntGeneral, []>, isDOT; def ANDC : XForm_6<31, 60, (ops GPRC:$rA, GPRC:$rS, GPRC:$rB), - "andc $rA, $rS, $rB", + "andc $rA, $rS, $rB", IntGeneral, [(set GPRC:$rA, (and GPRC:$rS, (not GPRC:$rB)))]>; def OR4 : XForm_6<31, 444, (ops GPRC:$rA, GPRC:$rS, GPRC:$rB), - "or $rA, $rS, $rB", + "or $rA, $rS, $rB", IntGeneral, [(set GPRC:$rA, (or GPRC:$rS, GPRC:$rB))]>; def OR8 : XForm_6<31, 444, (ops G8RC:$rA, G8RC:$rS, G8RC:$rB), - "or $rA, $rS, $rB", + "or $rA, $rS, $rB", IntGeneral, [(set G8RC:$rA, (or G8RC:$rS, G8RC:$rB))]>; def OR4To8 : XForm_6<31, 444, (ops G8RC:$rA, GPRC:$rS, GPRC:$rB), - "or $rA, $rS, $rB", + "or $rA, $rS, $rB", IntGeneral, []>; def OR8To4 : XForm_6<31, 444, (ops GPRC:$rA, G8RC:$rS, G8RC:$rB), - "or $rA, $rS, $rB", + "or $rA, $rS, $rB", IntGeneral, []>; def NOR : XForm_6<31, 124, (ops GPRC:$rA, GPRC:$rS, GPRC:$rB), - "nor $rA, $rS, $rB", + "nor $rA, $rS, $rB", IntGeneral, [(set GPRC:$rA, (not (or GPRC:$rS, GPRC:$rB)))]>; def ORo : XForm_6<31, 444, (ops GPRC:$rA, GPRC:$rS, GPRC:$rB), - "or. $rA, $rS, $rB", + "or. $rA, $rS, $rB", IntGeneral, []>, isDOT; def ORC : XForm_6<31, 412, (ops GPRC:$rA, GPRC:$rS, GPRC:$rB), - "orc $rA, $rS, $rB", + "orc $rA, $rS, $rB", IntGeneral, [(set GPRC:$rA, (or GPRC:$rS, (not GPRC:$rB)))]>; def EQV : XForm_6<31, 284, (ops GPRC:$rA, GPRC:$rS, GPRC:$rB), - "eqv $rA, $rS, $rB", + "eqv $rA, $rS, $rB", IntGeneral, [(set GPRC:$rA, (not (xor GPRC:$rS, GPRC:$rB)))]>; def XOR : XForm_6<31, 316, (ops GPRC:$rA, GPRC:$rS, GPRC:$rB), - "xor $rA, $rS, $rB", + "xor $rA, $rS, $rB", IntGeneral, [(set GPRC:$rA, (xor GPRC:$rS, GPRC:$rB))]>; def SLD : XForm_6<31, 27, (ops G8RC:$rA, G8RC:$rS, G8RC:$rB), - "sld $rA, $rS, $rB", + "sld $rA, $rS, $rB", IntRotateD, [(set G8RC:$rA, (shl G8RC:$rS, G8RC:$rB))]>, isPPC64; def SLW : XForm_6<31, 24, (ops GPRC:$rA, GPRC:$rS, GPRC:$rB), - "slw $rA, $rS, $rB", + "slw $rA, $rS, $rB", IntGeneral, [(set GPRC:$rA, (shl GPRC:$rS, GPRC:$rB))]>; def SRD : XForm_6<31, 539, (ops G8RC:$rA, G8RC:$rS, G8RC:$rB), - "srd $rA, $rS, $rB", + "srd $rA, $rS, $rB", IntRotateD, [(set G8RC:$rA, (srl G8RC:$rS, G8RC:$rB))]>, isPPC64; def SRW : XForm_6<31, 536, (ops GPRC:$rA, GPRC:$rS, GPRC:$rB), - "srw $rA, $rS, $rB", + "srw $rA, $rS, $rB", IntGeneral, [(set GPRC:$rA, (srl GPRC:$rS, GPRC:$rB))]>; def SRAD : XForm_6<31, 794, (ops G8RC:$rA, G8RC:$rS, G8RC:$rB), - "srad $rA, $rS, $rB", + "srad $rA, $rS, $rB", IntRotateD, [(set G8RC:$rA, (sra G8RC:$rS, G8RC:$rB))]>, isPPC64; def SRAW : XForm_6<31, 792, (ops GPRC:$rA, GPRC:$rS, GPRC:$rB), - "sraw $rA, $rS, $rB", + "sraw $rA, $rS, $rB", IntShift, [(set GPRC:$rA, (sra GPRC:$rS, GPRC:$rB))]>; let isStore = 1 in { def STBX : XForm_8<31, 215, (ops GPRC:$rS, GPRC:$rA, GPRC:$rB), - "stbx $rS, $rA, $rB">; + "stbx $rS, $rA, $rB", LdStGeneral>; def STHX : XForm_8<31, 407, (ops GPRC:$rS, GPRC:$rA, GPRC:$rB), - "sthx $rS, $rA, $rB">; + "sthx $rS, $rA, $rB", LdStGeneral>; def STWX : XForm_8<31, 151, (ops GPRC:$rS, GPRC:$rA, GPRC:$rB), - "stwx $rS, $rA, $rB">; + "stwx $rS, $rA, $rB", LdStGeneral>; def STWUX : XForm_8<31, 183, (ops GPRC:$rS, GPRC:$rA, GPRC:$rB), - "stwux $rS, $rA, $rB">; + "stwux $rS, $rA, $rB", LdStGeneral>; def STDX : XForm_8<31, 149, (ops GPRC:$rS, GPRC:$rA, GPRC:$rB), - "stdx $rS, $rA, $rB">, isPPC64; + "stdx $rS, $rA, $rB", LdStSTD>, isPPC64; def STDUX : XForm_8<31, 181, (ops GPRC:$rS, GPRC:$rA, GPRC:$rB), - "stdux $rS, $rA, $rB">, isPPC64; + "stdux $rS, $rA, $rB", LdStSTD>, isPPC64; } def SRAWI : XForm_10<31, 824, (ops GPRC:$rA, GPRC:$rS, u5imm:$SH), - "srawi $rA, $rS, $SH", + "srawi $rA, $rS, $SH", IntShift, [(set GPRC:$rA, (sra GPRC:$rS, imm:$SH))]>; def CNTLZW : XForm_11<31, 26, (ops GPRC:$rA, GPRC:$rS), - "cntlzw $rA, $rS", + "cntlzw $rA, $rS", IntGeneral, [(set GPRC:$rA, (ctlz GPRC:$rS))]>; def EXTSB : XForm_11<31, 954, (ops GPRC:$rA, GPRC:$rS), - "extsb $rA, $rS", + "extsb $rA, $rS", IntGeneral, [(set GPRC:$rA, (sext_inreg GPRC:$rS, i8))]>; def EXTSH : XForm_11<31, 922, (ops GPRC:$rA, GPRC:$rS), - "extsh $rA, $rS", + "extsh $rA, $rS", IntGeneral, [(set GPRC:$rA, (sext_inreg GPRC:$rS, i16))]>; def EXTSW : XForm_11<31, 986, (ops GPRC:$rA, GPRC:$rS), - "extsw $rA, $rS", + "extsw $rA, $rS", IntRotateD, []>, isPPC64; def CMP : XForm_16<31, 0, (ops CRRC:$crD, i1imm:$long, GPRC:$rA, GPRC:$rB), - "cmp $crD, $long, $rA, $rB">; + "cmp $crD, $long, $rA, $rB", IntCompare>; def CMPL : XForm_16<31, 32, (ops CRRC:$crD, i1imm:$long, GPRC:$rA, GPRC:$rB), - "cmpl $crD, $long, $rA, $rB">; + "cmpl $crD, $long, $rA, $rB", IntCompare>; def CMPW : XForm_16_ext<31, 0, (ops CRRC:$crD, GPRC:$rA, GPRC:$rB), - "cmpw $crD, $rA, $rB">; + "cmpw $crD, $rA, $rB", IntCompare>; def CMPD : XForm_16_ext<31, 0, (ops CRRC:$crD, GPRC:$rA, GPRC:$rB), - "cmpd $crD, $rA, $rB">, isPPC64; + "cmpd $crD, $rA, $rB", IntCompare>, isPPC64; def CMPLW : XForm_16_ext<31, 32, (ops CRRC:$crD, GPRC:$rA, GPRC:$rB), - "cmplw $crD, $rA, $rB">; + "cmplw $crD, $rA, $rB", IntCompare>; def CMPLD : XForm_16_ext<31, 32, (ops CRRC:$crD, GPRC:$rA, GPRC:$rB), - "cmpld $crD, $rA, $rB">, isPPC64; + "cmpld $crD, $rA, $rB", IntCompare>, isPPC64; //def FCMPO : XForm_17<63, 32, (ops CRRC:$crD, FPRC:$fA, FPRC:$fB), -// "fcmpo $crD, $fA, $fB">; +// "fcmpo $crD, $fA, $fB", FPCompare>; def FCMPUS : XForm_17<63, 0, (ops CRRC:$crD, F4RC:$fA, F4RC:$fB), - "fcmpu $crD, $fA, $fB">; + "fcmpu $crD, $fA, $fB", FPCompare>; def FCMPUD : XForm_17<63, 0, (ops CRRC:$crD, F8RC:$fA, F8RC:$fB), - "fcmpu $crD, $fA, $fB">; + "fcmpu $crD, $fA, $fB", FPCompare>; let isLoad = 1 in { def LFSX : XForm_25<31, 535, (ops F4RC:$dst, GPRC:$base, GPRC:$index), - "lfsx $dst, $base, $index">; + "lfsx $dst, $base, $index", LdStLFDU>; def LFDX : XForm_25<31, 599, (ops F8RC:$dst, GPRC:$base, GPRC:$index), - "lfdx $dst, $base, $index">; + "lfdx $dst, $base, $index", LdStLFDU>; } def FCFID : XForm_26<63, 846, (ops F8RC:$frD, F8RC:$frB), - "fcfid $frD, $frB", + "fcfid $frD, $frB", FPGeneral, []>, isPPC64; def FCTIDZ : XForm_26<63, 815, (ops F8RC:$frD, F8RC:$frB), - "fctidz $frD, $frB", + "fctidz $frD, $frB", FPGeneral, []>, isPPC64; def FCTIWZ : XForm_26<63, 15, (ops F8RC:$frD, F8RC:$frB), - "fctiwz $frD, $frB", + "fctiwz $frD, $frB", FPGeneral, []>; def FRSP : XForm_26<63, 12, (ops F4RC:$frD, F8RC:$frB), - "frsp $frD, $frB", + "frsp $frD, $frB", FPGeneral, [(set F4RC:$frD, (fround F8RC:$frB))]>; def FSQRT : XForm_26<63, 22, (ops F8RC:$frD, F8RC:$frB), - "fsqrt $frD, $frB", + "fsqrt $frD, $frB", FPSqrt, [(set F8RC:$frD, (fsqrt F8RC:$frB))]>; def FSQRTS : XForm_26<59, 22, (ops F4RC:$frD, F4RC:$frB), - "fsqrts $frD, $frB", + "fsqrts $frD, $frB", FPSqrt, [(set F4RC:$frD, (fsqrt F4RC:$frB))]>; /// FMR is split into 3 versions, one for 4/8 byte FP, and one for extending. def FMRS : XForm_26<63, 72, (ops F4RC:$frD, F4RC:$frB), - "fmr $frD, $frB", + "fmr $frD, $frB", FPGeneral, []>; // (set F4RC:$frD, F4RC:$frB) def FMRD : XForm_26<63, 72, (ops F8RC:$frD, F8RC:$frB), - "fmr $frD, $frB", + "fmr $frD, $frB", FPGeneral, []>; // (set F8RC:$frD, F8RC:$frB) def FMRSD : XForm_26<63, 72, (ops F8RC:$frD, F4RC:$frB), - "fmr $frD, $frB", + "fmr $frD, $frB", FPGeneral, [(set F8RC:$frD, (fextend F4RC:$frB))]>; // These are artificially split into two different forms, for 4/8 byte FP. def FABSS : XForm_26<63, 264, (ops F4RC:$frD, F4RC:$frB), - "fabs $frD, $frB", + "fabs $frD, $frB", FPGeneral, [(set F4RC:$frD, (fabs F4RC:$frB))]>; def FABSD : XForm_26<63, 264, (ops F8RC:$frD, F8RC:$frB), - "fabs $frD, $frB", + "fabs $frD, $frB", FPGeneral, [(set F8RC:$frD, (fabs F8RC:$frB))]>; def FNABSS : XForm_26<63, 136, (ops F4RC:$frD, F4RC:$frB), - "fnabs $frD, $frB", + "fnabs $frD, $frB", FPGeneral, [(set F4RC:$frD, (fneg (fabs F4RC:$frB)))]>; def FNABSD : XForm_26<63, 136, (ops F8RC:$frD, F8RC:$frB), - "fnabs $frD, $frB", + "fnabs $frD, $frB", FPGeneral, [(set F8RC:$frD, (fneg (fabs F8RC:$frB)))]>; def FNEGS : XForm_26<63, 40, (ops F4RC:$frD, F4RC:$frB), - "fneg $frD, $frB", + "fneg $frD, $frB", FPGeneral, [(set F4RC:$frD, (fneg F4RC:$frB))]>; def FNEGD : XForm_26<63, 40, (ops F8RC:$frD, F8RC:$frB), - "fneg $frD, $frB", + "fneg $frD, $frB", FPGeneral, [(set F8RC:$frD, (fneg F8RC:$frB))]>; let isStore = 1 in { def STFSX : XForm_28<31, 663, (ops F4RC:$frS, GPRC:$rA, GPRC:$rB), - "stfsx $frS, $rA, $rB">; + "stfsx $frS, $rA, $rB", LdStUX>; def STFDX : XForm_28<31, 727, (ops F8RC:$frS, GPRC:$rA, GPRC:$rB), - "stfdx $frS, $rA, $rB">; + "stfdx $frS, $rA, $rB", LdStUX>; } // XL-Form instructions. condition register logical ops. // def MCRF : XLForm_3<19, 0, (ops CRRC:$BF, CRRC:$BFA), - "mcrf $BF, $BFA">; + "mcrf $BF, $BFA", BrMCR>; // XFX-Form instructions. Instructions that deal with SPRs // // Note that although LR should be listed as `8' and CTR as `9' in the SPR // field, the manual lists the groups of bits as [5-9] = 0, [0-4] = 8 or 9 // which means the SPR value needs to be multiplied by a factor of 32. -def MFCTR : XFXForm_1_ext<31, 339, 288, (ops GPRC:$rT), "mfctr $rT">; -def MFLR : XFXForm_1_ext<31, 339, 256, (ops GPRC:$rT), "mflr $rT">; -def MFCR : XFXForm_3<31, 19, (ops GPRC:$rT), "mfcr $rT">; +def MFCTR : XFXForm_1_ext<31, 339, 288, (ops GPRC:$rT), "mfctr $rT", SprMFSPR>; +def MFLR : XFXForm_1_ext<31, 339, 256, (ops GPRC:$rT), "mflr $rT", SprMFSPR>; +def MFCR : XFXForm_3<31, 19, (ops GPRC:$rT), "mfcr $rT", SprMFCR>; def MTCRF : XFXForm_5<31, 144, (ops crbitm:$FXM, GPRC:$rS), - "mtcrf $FXM, $rS">; + "mtcrf $FXM, $rS", BrMCRX>; def MFOCRF : XFXForm_5a<31, 19, (ops GPRC:$rT, crbitm:$FXM), - "mfcr $rT, $FXM">; -def MTCTR : XFXForm_7_ext<31, 467, 288, (ops GPRC:$rS), "mtctr $rS">; -def MTLR : XFXForm_7_ext<31, 467, 256, (ops GPRC:$rS), "mtlr $rS">; + "mfcr $rT, $FXM", SprMFCR>; +def MTCTR : XFXForm_7_ext<31, 467, 288, (ops GPRC:$rS), "mtctr $rS", SprMTSPR>; +def MTLR : XFXForm_7_ext<31, 467, 256, (ops GPRC:$rS), "mtlr $rS", SprMTSPR>; // XS-Form instructions. Just 'sradi' // def SRADI : XSForm_1<31, 413, (ops GPRC:$rA, GPRC:$rS, u6imm:$SH), - "sradi $rA, $rS, $SH">, isPPC64; + "sradi $rA, $rS, $SH", IntRotateD>, isPPC64; // XO-Form instructions. Arithmetic instructions that can set overflow bit // def ADD4 : XOForm_1<31, 266, 0, (ops GPRC:$rT, GPRC:$rA, GPRC:$rB), - "add $rT, $rA, $rB", + "add $rT, $rA, $rB", IntGeneral, [(set GPRC:$rT, (add GPRC:$rA, GPRC:$rB))]>; def ADD8 : XOForm_1<31, 266, 0, (ops G8RC:$rT, G8RC:$rA, G8RC:$rB), - "add $rT, $rA, $rB", + "add $rT, $rA, $rB", IntGeneral, [(set G8RC:$rT, (add G8RC:$rA, G8RC:$rB))]>; def ADDC : XOForm_1<31, 10, 0, (ops GPRC:$rT, GPRC:$rA, GPRC:$rB), - "addc $rT, $rA, $rB", + "addc $rT, $rA, $rB", IntGeneral, []>; def ADDE : XOForm_1<31, 138, 0, (ops GPRC:$rT, GPRC:$rA, GPRC:$rB), - "adde $rT, $rA, $rB", + "adde $rT, $rA, $rB", IntGeneral, []>; def DIVD : XOForm_1<31, 489, 0, (ops GPRC:$rT, GPRC:$rA, GPRC:$rB), - "divd $rT, $rA, $rB", + "divd $rT, $rA, $rB", IntDivD, []>, isPPC64; def DIVDU : XOForm_1<31, 457, 0, (ops GPRC:$rT, GPRC:$rA, GPRC:$rB), - "divdu $rT, $rA, $rB", + "divdu $rT, $rA, $rB", IntDivD, []>, isPPC64; def DIVW : XOForm_1<31, 491, 0, (ops GPRC:$rT, GPRC:$rA, GPRC:$rB), - "divw $rT, $rA, $rB", + "divw $rT, $rA, $rB", IntDivW, [(set GPRC:$rT, (sdiv GPRC:$rA, GPRC:$rB))]>; def DIVWU : XOForm_1<31, 459, 0, (ops GPRC:$rT, GPRC:$rA, GPRC:$rB), - "divwu $rT, $rA, $rB", + "divwu $rT, $rA, $rB", IntDivW, [(set GPRC:$rT, (udiv GPRC:$rA, GPRC:$rB))]>; def MULHW : XOForm_1<31, 75, 0, (ops GPRC:$rT, GPRC:$rA, GPRC:$rB), - "mulhw $rT, $rA, $rB", + "mulhw $rT, $rA, $rB", IntMulHW, [(set GPRC:$rT, (mulhs GPRC:$rA, GPRC:$rB))]>; def MULHWU : XOForm_1<31, 11, 0, (ops GPRC:$rT, GPRC:$rA, GPRC:$rB), - "mulhwu $rT, $rA, $rB", + "mulhwu $rT, $rA, $rB", IntMulHWU, [(set GPRC:$rT, (mulhu GPRC:$rA, GPRC:$rB))]>; def MULLD : XOForm_1<31, 233, 0, (ops GPRC:$rT, GPRC:$rA, GPRC:$rB), - "mulld $rT, $rA, $rB", + "mulld $rT, $rA, $rB", IntMulHD, []>, isPPC64; def MULLW : XOForm_1<31, 235, 0, (ops GPRC:$rT, GPRC:$rA, GPRC:$rB), - "mullw $rT, $rA, $rB", + "mullw $rT, $rA, $rB", IntMulHW, [(set GPRC:$rT, (mul GPRC:$rA, GPRC:$rB))]>; def SUBF : XOForm_1<31, 40, 0, (ops GPRC:$rT, GPRC:$rA, GPRC:$rB), - "subf $rT, $rA, $rB", + "subf $rT, $rA, $rB", IntGeneral, [(set GPRC:$rT, (sub GPRC:$rB, GPRC:$rA))]>; def SUBFC : XOForm_1<31, 8, 0, (ops GPRC:$rT, GPRC:$rA, GPRC:$rB), - "subfc $rT, $rA, $rB", + "subfc $rT, $rA, $rB", IntGeneral, []>; def SUBFE : XOForm_1<31, 136, 0, (ops GPRC:$rT, GPRC:$rA, GPRC:$rB), - "subfe $rT, $rA, $rB", + "subfe $rT, $rA, $rB", IntGeneral, []>; def ADDME : XOForm_3<31, 234, 0, (ops GPRC:$rT, GPRC:$rA), - "addme $rT, $rA", + "addme $rT, $rA", IntGeneral, []>; def ADDZE : XOForm_3<31, 202, 0, (ops GPRC:$rT, GPRC:$rA), - "addze $rT, $rA", + "addze $rT, $rA", IntGeneral, []>; def NEG : XOForm_3<31, 104, 0, (ops GPRC:$rT, GPRC:$rA), - "neg $rT, $rA", + "neg $rT, $rA", IntGeneral, [(set GPRC:$rT, (ineg GPRC:$rA))]>; def SUBFZE : XOForm_3<31, 200, 0, (ops GPRC:$rT, GPRC:$rA), - "subfze $rT, $rA", + "subfze $rT, $rA", IntGeneral, []>; // A-Form instructions. Most of the instructions executed in the FPU are of @@ -594,42 +595,42 @@ // def FMADD : AForm_1<63, 29, (ops F8RC:$FRT, F8RC:$FRA, F8RC:$FRC, F8RC:$FRB), - "fmadd $FRT, $FRA, $FRC, $FRB", + "fmadd $FRT, $FRA, $FRC, $FRB", FPFused, [(set F8RC:$FRT, (fadd (fmul F8RC:$FRA, F8RC:$FRC), F8RC:$FRB))]>; def FMADDS : AForm_1<59, 29, (ops F4RC:$FRT, F4RC:$FRA, F4RC:$FRC, F4RC:$FRB), - "fmadds $FRT, $FRA, $FRC, $FRB", + "fmadds $FRT, $FRA, $FRC, $FRB", FPGeneral, [(set F4RC:$FRT, (fadd (fmul F4RC:$FRA, F4RC:$FRC), F4RC:$FRB))]>; def FMSUB : AForm_1<63, 28, (ops F8RC:$FRT, F8RC:$FRA, F8RC:$FRC, F8RC:$FRB), - "fmsub $FRT, $FRA, $FRC, $FRB", + "fmsub $FRT, $FRA, $FRC, $FRB", FPFused, [(set F8RC:$FRT, (fsub (fmul F8RC:$FRA, F8RC:$FRC), F8RC:$FRB))]>; def FMSUBS : AForm_1<59, 28, (ops F4RC:$FRT, F4RC:$FRA, F4RC:$FRC, F4RC:$FRB), - "fmsubs $FRT, $FRA, $FRC, $FRB", + "fmsubs $FRT, $FRA, $FRC, $FRB", FPGeneral, [(set F4RC:$FRT, (fsub (fmul F4RC:$FRA, F4RC:$FRC), F4RC:$FRB))]>; def FNMADD : AForm_1<63, 31, (ops F8RC:$FRT, F8RC:$FRA, F8RC:$FRC, F8RC:$FRB), - "fnmadd $FRT, $FRA, $FRC, $FRB", + "fnmadd $FRT, $FRA, $FRC, $FRB", FPFused, [(set F8RC:$FRT, (fneg (fadd (fmul F8RC:$FRA, F8RC:$FRC), F8RC:$FRB)))]>; def FNMADDS : AForm_1<59, 31, (ops F4RC:$FRT, F4RC:$FRA, F4RC:$FRC, F4RC:$FRB), - "fnmadds $FRT, $FRA, $FRC, $FRB", + "fnmadds $FRT, $FRA, $FRC, $FRB", FPGeneral, [(set F4RC:$FRT, (fneg (fadd (fmul F4RC:$FRA, F4RC:$FRC), F4RC:$FRB)))]>; def FNMSUB : AForm_1<63, 30, (ops F8RC:$FRT, F8RC:$FRA, F8RC:$FRC, F8RC:$FRB), - "fnmsub $FRT, $FRA, $FRC, $FRB", + "fnmsub $FRT, $FRA, $FRC, $FRB", FPFused, [(set F8RC:$FRT, (fneg (fsub (fmul F8RC:$FRA, F8RC:$FRC), F8RC:$FRB)))]>; def FNMSUBS : AForm_1<59, 30, (ops F4RC:$FRT, F4RC:$FRA, F4RC:$FRC, F4RC:$FRB), - "fnmsubs $FRT, $FRA, $FRC, $FRB", + "fnmsubs $FRT, $FRA, $FRC, $FRB", FPGeneral, [(set F4RC:$FRT, (fneg (fsub (fmul F4RC:$FRA, F4RC:$FRC), F4RC:$FRB)))]>; // FSEL is artificially split into 4 and 8-byte forms for the result. To avoid @@ -638,43 +639,43 @@ // and 4/8 byte forms for the result and operand type.. def FSELD : AForm_1<63, 23, (ops F8RC:$FRT, F8RC:$FRA, F8RC:$FRC, F8RC:$FRB), - "fsel $FRT, $FRA, $FRC, $FRB", + "fsel $FRT, $FRA, $FRC, $FRB", FPGeneral, []>; def FSELS : AForm_1<63, 23, (ops F4RC:$FRT, F8RC:$FRA, F4RC:$FRC, F4RC:$FRB), - "fsel $FRT, $FRA, $FRC, $FRB", + "fsel $FRT, $FRA, $FRC, $FRB", FPGeneral, []>; def FADD : AForm_2<63, 21, (ops F8RC:$FRT, F8RC:$FRA, F8RC:$FRB), - "fadd $FRT, $FRA, $FRB", + "fadd $FRT, $FRA, $FRB", FPGeneral, [(set F8RC:$FRT, (fadd F8RC:$FRA, F8RC:$FRB))]>; def FADDS : AForm_2<59, 21, (ops F4RC:$FRT, F4RC:$FRA, F4RC:$FRB), - "fadds $FRT, $FRA, $FRB", + "fadds $FRT, $FRA, $FRB", FPGeneral, [(set F4RC:$FRT, (fadd F4RC:$FRA, F4RC:$FRB))]>; def FDIV : AForm_2<63, 18, (ops F8RC:$FRT, F8RC:$FRA, F8RC:$FRB), - "fdiv $FRT, $FRA, $FRB", + "fdiv $FRT, $FRA, $FRB", FPDivD, [(set F8RC:$FRT, (fdiv F8RC:$FRA, F8RC:$FRB))]>; def FDIVS : AForm_2<59, 18, (ops F4RC:$FRT, F4RC:$FRA, F4RC:$FRB), - "fdivs $FRT, $FRA, $FRB", + "fdivs $FRT, $FRA, $FRB", FPDivS, [(set F4RC:$FRT, (fdiv F4RC:$FRA, F4RC:$FRB))]>; def FMUL : AForm_3<63, 25, (ops F8RC:$FRT, F8RC:$FRA, F8RC:$FRB), - "fmul $FRT, $FRA, $FRB", + "fmul $FRT, $FRA, $FRB", FPFused, [(set F8RC:$FRT, (fmul F8RC:$FRA, F8RC:$FRB))]>; def FMULS : AForm_3<59, 25, (ops F4RC:$FRT, F4RC:$FRA, F4RC:$FRB), - "fmuls $FRT, $FRA, $FRB", + "fmuls $FRT, $FRA, $FRB", FPGeneral, [(set F4RC:$FRT, (fmul F4RC:$FRA, F4RC:$FRB))]>; def FSUB : AForm_2<63, 20, (ops F8RC:$FRT, F8RC:$FRA, F8RC:$FRB), - "fsub $FRT, $FRA, $FRB", + "fsub $FRT, $FRA, $FRB", FPGeneral, [(set F8RC:$FRT, (fsub F8RC:$FRA, F8RC:$FRB))]>; def FSUBS : AForm_2<59, 20, (ops F4RC:$FRT, F4RC:$FRA, F4RC:$FRB), - "fsubs $FRT, $FRA, $FRB", + "fsubs $FRT, $FRA, $FRB", FPGeneral, [(set F4RC:$FRT, (fsub F4RC:$FRA, F4RC:$FRB))]>; // M-Form instructions. rotate and mask instructions. @@ -683,35 +684,35 @@ // RLWIMI can be commuted if the rotate amount is zero. def RLWIMI : MForm_2<20, (ops GPRC:$rA, GPRC:$rSi, GPRC:$rS, u5imm:$SH, u5imm:$MB, - u5imm:$ME), "rlwimi $rA, $rS, $SH, $MB, $ME", + u5imm:$ME), "rlwimi $rA, $rS, $SH, $MB, $ME", IntRotate, []>; def RLDIMI : MDForm_1<30, 3, (ops G8RC:$rA, G8RC:$rSi, G8RC:$rS, u6imm:$SH, u6imm:$MB), - "rldimi $rA, $rS, $SH, $MB", + "rldimi $rA, $rS, $SH, $MB", IntRotateD, []>, isPPC64; } def RLWINM : MForm_2<21, (ops GPRC:$rA, GPRC:$rS, u5imm:$SH, u5imm:$MB, u5imm:$ME), - "rlwinm $rA, $rS, $SH, $MB, $ME", + "rlwinm $rA, $rS, $SH, $MB, $ME", IntGeneral, []>; def RLWINMo : MForm_2<21, (ops GPRC:$rA, GPRC:$rS, u5imm:$SH, u5imm:$MB, u5imm:$ME), - "rlwinm. $rA, $rS, $SH, $MB, $ME", + "rlwinm. $rA, $rS, $SH, $MB, $ME", IntGeneral, []>, isDOT; def RLWNM : MForm_2<23, (ops GPRC:$rA, GPRC:$rS, GPRC:$rB, u5imm:$MB, u5imm:$ME), - "rlwnm $rA, $rS, $rB, $MB, $ME", + "rlwnm $rA, $rS, $rB, $MB, $ME", IntGeneral, []>; // MD-Form instructions. 64 bit rotate instructions. // def RLDICL : MDForm_1<30, 0, (ops G8RC:$rA, G8RC:$rS, u6imm:$SH, u6imm:$MB), - "rldicl $rA, $rS, $SH, $MB", + "rldicl $rA, $rS, $SH, $MB", IntRotateD, []>, isPPC64; def RLDICR : MDForm_1<30, 1, (ops G8RC:$rA, G8RC:$rS, u6imm:$SH, u6imm:$ME), - "rldicr $rA, $rS, $SH, $ME", + "rldicr $rA, $rS, $SH, $ME", IntRotateD, []>, isPPC64; //===----------------------------------------------------------------------===// Index: llvm/lib/Target/PowerPC/PPCSchedule.td diff -u llvm/lib/Target/PowerPC/PPCSchedule.td:1.2 llvm/lib/Target/PowerPC/PPCSchedule.td:1.3 --- llvm/lib/Target/PowerPC/PPCSchedule.td:1.2 Wed Oct 19 08:34:52 2005 +++ llvm/lib/Target/PowerPC/PPCSchedule.td Wed Oct 19 14:51:16 2005 @@ -7,8 +7,6 @@ // //===----------------------------------------------------------------------===// -#include "../Target.td" - //===----------------------------------------------------------------------===// // Functional units across PowerPC chips sets // @@ -55,17 +53,17 @@ def LdStDCBA : InstrItinClass; def LdStDCBF : InstrItinClass; def LdStDCBI : InstrItinClass; -def LdStDCBT : InstrItinClass; +def LdStGeneral : InstrItinClass; def LdStDSS : InstrItinClass; def LdStICBI : InstrItinClass; -def LdStLBZUX : InstrItinClass; +def LdStUX : InstrItinClass; def LdStLD : InstrItinClass; def LdStLDARX : InstrItinClass; def LdStLFD : InstrItinClass; def LdStLFDU : InstrItinClass; def LdStLHA : InstrItinClass; def LdStLMW : InstrItinClass; -def LdStLVEBX : InstrItinClass; +def LdStLVecX : InstrItinClass; def LdStLWA : InstrItinClass; def LdStLWARX : InstrItinClass; def LdStSLBIA : InstrItinClass; @@ -107,10 +105,10 @@ //===----------------------------------------------------------------------===// // Processor instruction itineraries. -#include "PPCScheduleG3.td" -#include "PPCScheduleG4.td" -#include "PPCScheduleG4Plus.td" -#include "PPCScheduleG5.td" +include "PPCScheduleG3.td" +include "PPCScheduleG4.td" +include "PPCScheduleG4Plus.td" +include "PPCScheduleG5.td" //===----------------------------------------------------------------------===// // Instruction to itinerary class map - When add new opcodes to the supported @@ -154,8 +152,8 @@ // dcbf LdStDCBF // dcbi LdStDCBI // dcbst LdStDCBF -// dcbt LdStDCBT -// dcbtst LdStDCBT +// dcbt LdStGeneral +// dcbtst LdStGeneral // dcbz LdStDCBF // divd IntDivD // divdu IntDivD @@ -164,9 +162,9 @@ // dss LdStDSS // dst LdStDSS // dstst LdStDSS -// eciwx LdStDCBT -// ecowx LdStDCBT -// eieio LdStDCBT +// eciwx LdStGeneral +// ecowx LdStGeneral +// eieio LdStGeneral // eqv IntGeneral // extsb IntGeneral // extsh IntGeneral @@ -206,10 +204,10 @@ // fsubs FPGeneral // icbi LdStICBI // isync SprISYNC -// lbz LdStDCBT -// lbzu LdStDCBT -// lbzux LdStLBZUX -// lbzx LdStDCBT +// lbz LdStGeneral +// lbzu LdStGeneral +// lbzux LdStUX +// lbzx LdStGeneral // ld LdStLD // ldarx LdStLDARX // ldu LdStLD @@ -227,30 +225,30 @@ // lhau LdStLHA // lhaux LdStLHA // lhax LdStLHA -// lhbrx LdStDCBT -// lhz LdStDCBT -// lhzu LdStDCBT -// lhzux LdStLBZUX -// lhzx LdStDCBT +// lhbrx LdStGeneral +// lhz LdStGeneral +// lhzu LdStGeneral +// lhzux LdStUX +// lhzx LdStGeneral // lmw LdStLMW // lswi LdStLMW // lswx LdStLMW -// lvebx LdStLVEBX -// lvehx LdStLVEBX -// lvewx LdStLVEBX -// lvsl LdStLVEBX -// lvsr LdStLVEBX -// lvx LdStLVEBX -// lvxl LdStLVEBX +// lvebx LdStLVecX +// lvehx LdStLVecX +// lvewx LdStLVecX +// lvsl LdStLVecX +// lvsr LdStLVecX +// lvx LdStLVecX +// lvxl LdStLVecX // lwa LdStLWA // lwarx LdStLWARX // lwaux LdStLHA // lwax LdStLHA -// lwbrx LdStDCBT -// lwz LdStDCBT -// lwzu LdStDCBT -// lwzux LdStLBZUX -// lwzx LdStDCBT +// lwbrx LdStGeneral +// lwz LdStGeneral +// lwzu LdStGeneral +// lwzux LdStUX +// lwzx LdStGeneral // mcrf BrMCR // mcrfs FPGeneral // mcrxr BrMCRX @@ -311,29 +309,29 @@ // srawi IntShift // srd IntRotateD // srw IntGeneral -// stb LdStDCBT -// stbu LdStDCBT -// stbux LdStDCBT -// stbx LdStDCBT +// stb LdStGeneral +// stbu LdStGeneral +// stbux LdStGeneral +// stbx LdStGeneral // std LdStSTD // stdcx. LdStSTDCX // stdu LdStSTD // stdux LdStSTD // stdx LdStSTD -// stfd LdStLBZUX -// stfdu LdStLBZUX -// stfdux LdStLBZUX -// stfdx LdStLBZUX -// stfiwx LdStLBZUX -// stfs LdStLBZUX -// stfsu LdStLBZUX -// stfsux LdStLBZUX -// stfsx LdStLBZUX -// sth LdStDCBT -// sthbrx LdStDCBT -// sthu LdStDCBT -// sthux LdStDCBT -// sthx LdStDCBT +// stfd LdStUX +// stfdu LdStUX +// stfdux LdStUX +// stfdx LdStUX +// stfiwx LdStUX +// stfs LdStUX +// stfsu LdStUX +// stfsux LdStUX +// stfsx LdStUX +// sth LdStGeneral +// sthbrx LdStGeneral +// sthu LdStGeneral +// sthux LdStGeneral +// sthx LdStGeneral // stmw LdStLMW // stswi LdStLMW // stswx LdStLMW @@ -342,12 +340,12 @@ // stvewx LdStSTVEBX // stvx LdStSTVEBX // stvxl LdStSTVEBX -// stw LdStDCBT -// stwbrx LdStDCBT +// stw LdStGeneral +// stwbrx LdStGeneral // stwcx. LdStSTWCX -// stwu LdStDCBT -// stwux LdStDCBT -// stwx LdStDCBT +// stwu LdStGeneral +// stwux LdStGeneral +// stwx LdStGeneral // subf IntGeneral // subfc IntGeneral // subfe IntGeneral @@ -508,39 +506,3 @@ // xori IntGeneral // xoris IntGeneral // - - -//===----------------------------------------------------------------------===// -// PowerPC Subtarget features. -// - -def F64Bit : SubtargetFeature<"64bit", - "Should 64 bit instructions be used">; -def F64BitRegs : SubtargetFeature<"64bitregs", - "Should 64 bit registers be used">; -def FAltivec : SubtargetFeature<"altivec", - "Should Altivec instructions be used">; -def FGPUL : SubtargetFeature<"gpul", - "Should GPUL instructions be used">; -def FFSQRT : SubtargetFeature<"fsqrt", - "Should the fsqrt instruction be used">; - -//===----------------------------------------------------------------------===// -// PowerPC chips sets supported -// - -def : Processor<"601", G3Itineraries, []>; -def : Processor<"602", G3Itineraries, []>; -def : Processor<"603", G3Itineraries, []>; -def : Processor<"604", G3Itineraries, []>; -def : Processor<"750", G3Itineraries, []>; -def : Processor<"7400", G4Itineraries, [FAltivec]>; -def : Processor<"g4", G4Itineraries, [FAltivec]>; -def : Processor<"7450", G4PlusItineraries, [FAltivec]>; -def : Processor<"g4+", G4PlusItineraries, [FAltivec]>; -def : Processor<"970", G5Itineraries, - [FAltivec, FGPUL, FFSQRT, F64Bit, F64BitRegs]>; -def : Processor<"g5", G5Itineraries, - [FAltivec, FGPUL, FFSQRT, F64Bit, F64BitRegs]>; - - Index: llvm/lib/Target/PowerPC/PPCScheduleG3.td diff -u llvm/lib/Target/PowerPC/PPCScheduleG3.td:1.3 llvm/lib/Target/PowerPC/PPCScheduleG3.td:1.4 --- llvm/lib/Target/PowerPC/PPCScheduleG3.td:1.3 Wed Oct 19 08:34:52 2005 +++ llvm/lib/Target/PowerPC/PPCScheduleG3.td Wed Oct 19 14:51:16 2005 @@ -31,9 +31,9 @@ InstrItinData]>, InstrItinData]>, InstrItinData]>, - InstrItinData]>, + InstrItinData]>, InstrItinData]>, - InstrItinData]>, + InstrItinData]>, InstrItinData]>, InstrItinData]>, InstrItinData]>, @@ -59,5 +59,5 @@ InstrItinData]>, InstrItinData]>, InstrItinData]>, - InstrItinData]>, + InstrItinData]> ]>; Index: llvm/lib/Target/PowerPC/PPCScheduleG4.td diff -u llvm/lib/Target/PowerPC/PPCScheduleG4.td:1.3 llvm/lib/Target/PowerPC/PPCScheduleG4.td:1.4 --- llvm/lib/Target/PowerPC/PPCScheduleG4.td:1.3 Wed Oct 19 08:34:52 2005 +++ llvm/lib/Target/PowerPC/PPCScheduleG4.td Wed Oct 19 14:51:16 2005 @@ -30,15 +30,15 @@ InstrItinData]>, InstrItinData]>, InstrItinData]>, - InstrItinData]>, + InstrItinData]>, InstrItinData]>, InstrItinData]>, - InstrItinData]>, + InstrItinData]>, InstrItinData]>, InstrItinData]>, InstrItinData]>, InstrItinData]>, - InstrItinData]>, + InstrItinData]>, InstrItinData]>, InstrItinData]>, InstrItinData]>, Index: llvm/lib/Target/PowerPC/PPCScheduleG4Plus.td diff -u llvm/lib/Target/PowerPC/PPCScheduleG4Plus.td:1.3 llvm/lib/Target/PowerPC/PPCScheduleG4Plus.td:1.4 --- llvm/lib/Target/PowerPC/PPCScheduleG4Plus.td:1.3 Wed Oct 19 08:34:52 2005 +++ llvm/lib/Target/PowerPC/PPCScheduleG4Plus.td Wed Oct 19 14:51:16 2005 @@ -30,15 +30,15 @@ InstrItinData]>, InstrItinData]>, InstrItinData]>, - InstrItinData]>, + InstrItinData]>, InstrItinData]>, InstrItinData]>, - InstrItinData]>, + InstrItinData]>, InstrItinData]>, InstrItinData]>, InstrItinData]>, InstrItinData]>, - InstrItinData]>, + InstrItinData]>, InstrItinData]>, InstrItinData]>, InstrItinData]>, Index: llvm/lib/Target/PowerPC/PPCScheduleG5.td diff -u llvm/lib/Target/PowerPC/PPCScheduleG5.td:1.3 llvm/lib/Target/PowerPC/PPCScheduleG5.td:1.4 --- llvm/lib/Target/PowerPC/PPCScheduleG5.td:1.3 Wed Oct 19 08:34:52 2005 +++ llvm/lib/Target/PowerPC/PPCScheduleG5.td Wed Oct 19 14:51:16 2005 @@ -34,17 +34,17 @@ InstrItinData]>, InstrItinData]>, InstrItinData]>, - InstrItinData]>, + InstrItinData]>, InstrItinData]>, InstrItinData]>, - InstrItinData]>, + InstrItinData]>, InstrItinData]>, InstrItinData]>, InstrItinData]>, InstrItinData]>, InstrItinData]>, InstrItinData]>, - InstrItinData]>, + InstrItinData]>, InstrItinData]>, InstrItinData]>, InstrItinData]>, // needs work From criswell at cs.uiuc.edu Wed Oct 19 15:07:37 2005 From: criswell at cs.uiuc.edu (John Criswell) Date: Wed, 19 Oct 2005 15:07:37 -0500 Subject: [llvm-commits] CVS: llvm/lib/Target/SparcV9/SparcV9TargetMachine.cpp Message-ID: <200510192007.PAA05090@choi.cs.uiuc.edu> Changes in directory llvm/lib/Target/SparcV9: SparcV9TargetMachine.cpp updated: 1.142 -> 1.143 --- Log message: This fixes PR638: http://llvm.cs.uiuc.edu/PR638 : Regression/CodeGen/Generic/2004-02-08-UnwindSupport.llx --- Diffs of the changes: (+6 -6) SparcV9TargetMachine.cpp | 12 ++++++------ 1 files changed, 6 insertions(+), 6 deletions(-) Index: llvm/lib/Target/SparcV9/SparcV9TargetMachine.cpp diff -u llvm/lib/Target/SparcV9/SparcV9TargetMachine.cpp:1.142 llvm/lib/Target/SparcV9/SparcV9TargetMachine.cpp:1.143 --- llvm/lib/Target/SparcV9/SparcV9TargetMachine.cpp:1.142 Thu Sep 1 16:38:21 2005 +++ llvm/lib/Target/SparcV9/SparcV9TargetMachine.cpp Wed Oct 19 15:07:15 2005 @@ -171,12 +171,12 @@ // Replace malloc and free instructions with library calls. PM.add(createLowerAllocationsPass()); - // FIXME: implement the switch instruction in the instruction selector. - PM.add(createLowerSwitchPass()); - // FIXME: implement the invoke/unwind instructions! PM.add(createLowerInvokePass()); + // FIXME: implement the switch instruction in the instruction selector. + PM.add(createLowerSwitchPass()); + // decompose multi-dimensional array references into single-dim refs PM.add(createDecomposeMultiDimRefsPass()); @@ -262,12 +262,12 @@ // Replace malloc and free instructions with library calls. PM.add(createLowerAllocationsPass()); - // FIXME: implement the switch instruction in the instruction selector. - PM.add(createLowerSwitchPass()); - // FIXME: implement the invoke/unwind instructions! PM.add(createLowerInvokePass()); + // FIXME: implement the switch instruction in the instruction selector. + PM.add(createLowerSwitchPass()); + // decompose multi-dimensional array references into single-dim refs PM.add(createDecomposeMultiDimRefsPass()); From alenhar2 at cs.uiuc.edu Wed Oct 19 19:28:43 2005 From: alenhar2 at cs.uiuc.edu (Andrew Lenharth) Date: Wed, 19 Oct 2005 19:28:43 -0500 Subject: [llvm-commits] CVS: llvm/lib/Target/Alpha/Alpha.h AlphaISelLowering.h AlphaInstrFormats.td AlphaInstrInfo.td AlphaRegisterInfo.cpp AlphaTargetMachine.cpp Makefile Message-ID: <200510200028.TAA25889@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/Alpha: Alpha.h updated: 1.4 -> 1.5 AlphaISelLowering.h updated: 1.1 -> 1.2 AlphaInstrFormats.td updated: 1.6 -> 1.7 AlphaInstrInfo.td updated: 1.59 -> 1.60 AlphaRegisterInfo.cpp updated: 1.28 -> 1.29 AlphaTargetMachine.cpp updated: 1.13 -> 1.14 Makefile updated: 1.2 -> 1.3 --- Log message: ret 0; works, not much else still lots of uglyness. Maybe calls will come soon. Fixing the return value of things will be necessary to make alpha work. --- Diffs of the changes: (+226 -139) Alpha.h | 1 AlphaISelLowering.h | 7 + AlphaInstrFormats.td | 16 +- AlphaInstrInfo.td | 329 +++++++++++++++++++++++++++++-------------------- AlphaRegisterInfo.cpp | 2 AlphaTargetMachine.cpp | 8 + Makefile | 2 7 files changed, 226 insertions(+), 139 deletions(-) Index: llvm/lib/Target/Alpha/Alpha.h diff -u llvm/lib/Target/Alpha/Alpha.h:1.4 llvm/lib/Target/Alpha/Alpha.h:1.5 --- llvm/lib/Target/Alpha/Alpha.h:1.4 Fri Jul 22 15:52:16 2005 +++ llvm/lib/Target/Alpha/Alpha.h Wed Oct 19 19:28:31 2005 @@ -24,6 +24,7 @@ class MachineCodeEmitter; FunctionPass *createAlphaSimpleInstructionSelector(TargetMachine &TM); + FunctionPass *createAlphaISelDag(TargetMachine &TM); FunctionPass *createAlphaCodePrinterPass(std::ostream &OS, TargetMachine &TM); FunctionPass *createAlphaPatternInstructionSelector(TargetMachine &TM); Index: llvm/lib/Target/Alpha/AlphaISelLowering.h diff -u llvm/lib/Target/Alpha/AlphaISelLowering.h:1.1 llvm/lib/Target/Alpha/AlphaISelLowering.h:1.2 --- llvm/lib/Target/Alpha/AlphaISelLowering.h:1.1 Fri Sep 2 13:46:02 2005 +++ llvm/lib/Target/Alpha/AlphaISelLowering.h Wed Oct 19 19:28:31 2005 @@ -21,6 +21,13 @@ namespace llvm { + namespace AlphaISD { + enum NodeType { + // Start the numbering where the builting ops and target ops leave off. + FIRST_NUMBER = ISD::BUILTIN_OP_END+Alpha::INSTRUCTION_LIST_END, + }; + } + class AlphaTargetLowering : public TargetLowering { int VarArgsOffset; // What is the offset to the first vaarg int VarArgsBase; // What is the base FrameIndex Index: llvm/lib/Target/Alpha/AlphaInstrFormats.td diff -u llvm/lib/Target/Alpha/AlphaInstrFormats.td:1.6 llvm/lib/Target/Alpha/AlphaInstrFormats.td:1.7 --- llvm/lib/Target/Alpha/AlphaInstrFormats.td:1.6 Thu Jul 28 13:14:47 2005 +++ llvm/lib/Target/Alpha/AlphaInstrFormats.td Wed Oct 19 19:28:31 2005 @@ -17,10 +17,10 @@ //Floating-point //PALcode -def u8imm : Operand; -def s14imm : Operand; -def s16imm : Operand; -def s21imm : Operand; +def u8imm : Operand; +def s14imm : Operand; +def s16imm : Operand; +def s21imm : Operand; def s64imm : Operand; //===----------------------------------------------------------------------===// @@ -93,8 +93,10 @@ } //3.3.3 -class OForm opcode, bits<7> fun, string asmstr> +class OForm opcode, bits<7> fun, string asmstr, list pattern> : InstAlpha { + let Pattern = pattern; + bits<5> Rc; bits<5> Ra; bits<5> Rb; @@ -124,8 +126,10 @@ } -class OFormL opcode, bits<7> fun, string asmstr> +class OFormL opcode, bits<7> fun, string asmstr, list pattern> : InstAlpha { + let Pattern = pattern; + bits<5> Rc; bits<5> Ra; bits<8> LIT; Index: llvm/lib/Target/Alpha/AlphaInstrInfo.td diff -u llvm/lib/Target/Alpha/AlphaInstrInfo.td:1.59 llvm/lib/Target/Alpha/AlphaInstrInfo.td:1.60 --- llvm/lib/Target/Alpha/AlphaInstrInfo.td:1.59 Thu Oct 6 11:53:32 2005 +++ llvm/lib/Target/Alpha/AlphaInstrInfo.td Wed Oct 19 19:28:31 2005 @@ -12,6 +12,24 @@ include "AlphaInstrFormats.td" +//******************** +//Paterns for matching +//******************** +def immUExt8 : PatLeaf<(imm), [{ + // immUExt8 predicate - True if the immediate fits in a 8-bit zero extended + // field. Used by instructions like 'addi'. + return (unsigned long)N->getValue() == (unsigned char)N->getValue(); +}]>; +def imm2 : PatLeaf<(imm), [{ + // imm2 predicate - True if the immediate is a 2 + return N->getValue() == 2; +}]>; +def imm3 : PatLeaf<(imm), [{ + // imm3 predicate - True if the immediate is a 3 + return N->getValue() == 3; +}]>; + + // //#define FP $15 // //#define RA $26 // //#define PV $27 @@ -112,124 +130,172 @@ "fcmovne $RCOND,$RSRC,$RDEST">; //FCMOVE if != zero } -def ADDL : OForm< 0x10, 0x00, "addl $RA,$RB,$RC">; //Add longword -def ADDLi : OFormL<0x10, 0x00, "addl $RA,$L,$RC">; //Add longword -def ADDQ : OForm< 0x10, 0x20, "addq $RA,$RB,$RC">; //Add quadword -def ADDQi : OFormL<0x10, 0x20, "addq $RA,$L,$RC">; //Add quadword -def AMASK : OForm< 0x11, 0x61, "AMASK $RA,$RB,$RC">; //Architecture mask -def AMASKi : OFormL<0x11, 0x61, "AMASK $RA,$L,$RC">; //Architecture mask -def AND : OForm< 0x11, 0x00, "and $RA,$RB,$RC">; //Logical product -def ANDi : OFormL<0x11, 0x00, "and $RA,$L,$RC">; //Logical product -def BIC : OForm< 0x11, 0x08, "bic $RA,$RB,$RC">; //Bit clear -def BICi : OFormL<0x11, 0x08, "bic $RA,$L,$RC">; //Bit clear -def BIS : OForm< 0x11, 0x20, "bis $RA,$RB,$RC">; //Logical sum -def BISi : OFormL<0x11, 0x20, "bis $RA,$L,$RC">; //Logical sum -def CTLZ : OForm< 0x1C, 0x32, "CTLZ $RB,$RC">; //Count leading zero -def CTPOP : OForm< 0x1C, 0x30, "CTPOP $RB,$RC">; //Count population -def CTTZ : OForm< 0x1C, 0x33, "CTTZ $RB,$RC">; //Count trailing zero -def EQV : OForm< 0x11, 0x48, "eqv $RA,$RB,$RC">; //Logical equivalence -def EQVi : OFormL<0x11, 0x48, "eqv $RA,$L,$RC">; //Logical equivalence -def EXTBL : OForm< 0x12, 0x06, "EXTBL $RA,$RB,$RC">; //Extract byte low -def EXTBLi : OFormL<0x12, 0x06, "EXTBL $RA,$L,$RC">; //Extract byte low -def EXTLH : OForm< 0x12, 0x6A, "EXTLH $RA,$RB,$RC">; //Extract longword high -def EXTLHi : OFormL<0x12, 0x6A, "EXTLH $RA,$L,$RC">; //Extract longword high -def EXTLL : OForm< 0x12, 0x26, "EXTLL $RA,$RB,$RC">; //Extract longword low -def EXTLLi : OFormL<0x12, 0x26, "EXTLL $RA,$L,$RC">; //Extract longword low -def EXTQH : OForm< 0x12, 0x7A, "EXTQH $RA,$RB,$RC">; //Extract quadword high -def EXTQHi : OFormL<0x12, 0x7A, "EXTQH $RA,$L,$RC">; //Extract quadword high -def EXTQ : OForm< 0x12, 0x36, "EXTQ $RA,$RB,$RC">; //Extract quadword low -def EXTQi : OFormL<0x12, 0x36, "EXTQ $RA,$L,$RC">; //Extract quadword low -def EXTWH : OForm< 0x12, 0x5A, "EXTWH $RA,$RB,$RC">; //Extract word high -def EXTWHi : OFormL<0x12, 0x5A, "EXTWH $RA,$L,$RC">; //Extract word high -def EXTWL : OForm< 0x12, 0x16, "EXTWL $RA,$RB,$RC">; //Extract word low -def EXTWLi : OFormL<0x12, 0x16, "EXTWL $RA,$L,$RC">; //Extract word low -def IMPLVER : OForm< 0x11, 0x6C, "IMPLVER $RA,$RB,$RC">; //Implementation version -def IMPLVERi : OFormL<0x11, 0x6C, "IMPLVER $RA,$L,$RC">; //Implementation version -def INSBL : OForm< 0x12, 0x0B, "INSBL $RA,$RB,$RC">; //Insert byte low -def INSBLi : OFormL<0x12, 0x0B, "INSBL $RA,$L,$RC">; //Insert byte low -def INSLH : OForm< 0x12, 0x67, "INSLH $RA,$RB,$RC">; //Insert longword high -def INSLHi : OFormL<0x12, 0x67, "INSLH $RA,$L,$RC">; //Insert longword high -def INSLL : OForm< 0x12, 0x2B, "INSLL $RA,$RB,$RC">; //Insert longword low -def INSLLi : OFormL<0x12, 0x2B, "INSLL $RA,$L,$RC">; //Insert longword low -def INSQH : OForm< 0x12, 0x77, "INSQH $RA,$RB,$RC">; //Insert quadword high -def INSQHi : OFormL<0x12, 0x77, "INSQH $RA,$L,$RC">; //Insert quadword high -def INSQL : OForm< 0x12, 0x3B, "INSQL $RA,$RB,$RC">; //Insert quadword low -def INSQLi : OFormL<0x12, 0x3B, "INSQL $RA,$L,$RC">; //Insert quadword low -def INSWH : OForm< 0x12, 0x57, "INSWH $RA,$RB,$RC">; //Insert word high -def INSWHi : OFormL<0x12, 0x57, "INSWH $RA,$L,$RC">; //Insert word high -def INSWL : OForm< 0x12, 0x1B, "INSWL $RA,$RB,$RC">; //Insert word low -def INSWLi : OFormL<0x12, 0x1B, "INSWL $RA,$L,$RC">; //Insert word low -def MSKBL : OForm< 0x12, 0x02, "MSKBL $RA,$RB,$RC">; //Mask byte low -def MSKBLi : OFormL<0x12, 0x02, "MSKBL $RA,$L,$RC">; //Mask byte low -def MSKLH : OForm< 0x12, 0x62, "MSKLH $RA,$RB,$RC">; //Mask longword high -def MSKLHi : OFormL<0x12, 0x62, "MSKLH $RA,$L,$RC">; //Mask longword high -def MSKLL : OForm< 0x12, 0x22, "MSKLL $RA,$RB,$RC">; //Mask longword low -def MSKLLi : OFormL<0x12, 0x22, "MSKLL $RA,$L,$RC">; //Mask longword low -def MSKQH : OForm< 0x12, 0x72, "MSKQH $RA,$RB,$RC">; //Mask quadword high -def MSKQHi : OFormL<0x12, 0x72, "MSKQH $RA,$L,$RC">; //Mask quadword high -def MSKQL : OForm< 0x12, 0x32, "MSKQL $RA,$RB,$RC">; //Mask quadword low -def MSKQLi : OFormL<0x12, 0x32, "MSKQL $RA,$L,$RC">; //Mask quadword low -def MSKWH : OForm< 0x12, 0x52, "MSKWH $RA,$RB,$RC">; //Mask word high -def MSKWHi : OFormL<0x12, 0x52, "MSKWH $RA,$L,$RC">; //Mask word high -def MSKWL : OForm< 0x12, 0x12, "MSKWL $RA,$RB,$RC">; //Mask word low -def MSKWLi : OFormL<0x12, 0x12, "MSKWL $RA,$L,$RC">; //Mask word low -def MULL : OForm< 0x13, 0x00, "mull $RA,$RB,$RC">; //Multiply longword -def MULLi : OFormL<0x13, 0x00, "mull $RA,$L,$RC">; //Multiply longword -def MULQ : OForm< 0x13, 0x20, "mulq $RA,$RB,$RC">; //Multiply quadword -def MULQi : OFormL<0x13, 0x20, "mulq $RA,$L,$RC">; //Multiply quadword -def ORNOT : OForm< 0x11, 0x28, "ornot $RA,$RB,$RC">; //Logical sum with complement -def ORNOTi : OFormL<0x11, 0x28, "ornot $RA,$L,$RC">; //Logical sum with complement -def S4ADDL : OForm< 0x10, 0x02, "s4addl $RA,$RB,$RC">; //Scaled add longword by 4 -def S4ADDLi : OFormL<0x10, 0x02, "s4addl $RA,$L,$RC">; //Scaled add longword by 4 -def S4ADDQ : OForm< 0x10, 0x22, "s4addq $RA,$RB,$RC">; //Scaled add quadword by 4 -def S4ADDQi : OFormL<0x10, 0x22, "s4addq $RA,$L,$RC">; //Scaled add quadword by 4 -def S4SUBL : OForm< 0x10, 0x0B, "s4subl $RA,$RB,$RC">; //Scaled subtract longword by 4 -def S4SUBLi : OFormL<0x10, 0x0B, "s4subl $RA,$L,$RC">; //Scaled subtract longword by 4 -def S4SUBQ : OForm< 0x10, 0x2B, "s4subq $RA,$RB,$RC">; //Scaled subtract quadword by 4 -def S4SUBQi : OFormL<0x10, 0x2B, "s4subq $RA,$L,$RC">; //Scaled subtract quadword by 4 -def S8ADDL : OForm< 0x10, 0x12, "s8addl $RA,$RB,$RC">; //Scaled add longword by 8 -def S8ADDLi : OFormL<0x10, 0x12, "s8addl $RA,$L,$RC">; //Scaled add longword by 8 -def S8ADDQ : OForm< 0x10, 0x32, "s8addq $RA,$RB,$RC">; //Scaled add quadword by 8 -def S8ADDQi : OFormL<0x10, 0x32, "s8addq $RA,$L,$RC">; //Scaled add quadword by 8 -def S8SUBL : OForm< 0x10, 0x1B, "s8subl $RA,$RB,$RC">; //Scaled subtract longword by 8 -def S8SUBLi : OFormL<0x10, 0x1B, "s8subl $RA,$L,$RC">; //Scaled subtract longword by 8 -def S8SUBQ : OForm< 0x10, 0x3B, "s8subq $RA,$RB,$RC">; //Scaled subtract quadword by 8 -def S8SUBQi : OFormL<0x10, 0x3B, "s8subq $RA,$L,$RC">; //Scaled subtract quadword by 8 -def SEXTB : OForm< 0x1C, 0x00, "sextb $RB,$RC">; //Sign extend byte -def SEXTW : OForm< 0x1C, 0x01, "sextw $RB,$RC">; //Sign extend word -def SL : OForm< 0x12, 0x39, "sll $RA,$RB,$RC">; //Shift left logical -def SLi : OFormL<0x12, 0x39, "sll $RA,$L,$RC">; //Shift left logical -def SRA : OForm< 0x12, 0x3C, "sra $RA,$RB,$RC">; //Shift right arithmetic -def SRAi : OFormL<0x12, 0x3C, "sra $RA,$L,$RC">; //Shift right arithmetic -def SRL : OForm< 0x12, 0x34, "srl $RA,$RB,$RC">; //Shift right logical - -def SRLi : OFormL<0x12, 0x34, "srl $RA,$L,$RC">; //Shift right logical -def SUBL : OForm< 0x10, 0x09, "subl $RA,$RB,$RC">; //Subtract longword -def SUBLi : OFormL<0x10, 0x09, "subl $RA,$L,$RC">; //Subtract longword -def SUBQ : OForm< 0x10, 0x29, "subq $RA,$RB,$RC">; //Subtract quadword -def SUBQi : OFormL<0x10, 0x29, "subq $RA,$L,$RC">; //Subtract quadword -def UMULH : OForm< 0x13, 0x30, "umulh $RA,$RB,$RC">; //Unsigned multiply quadword high -def UMULHi : OFormL<0x13, 0x30, "umulh $RA,$L,$RC">; //Unsigned multiply quadword high -def XOR : OForm< 0x11, 0x40, "xor $RA,$RB,$RC">; //Logical difference -def XORi : OFormL<0x11, 0x40, "xor $RA,$L,$RC">; //Logical difference -def ZAP : OForm< 0x12, 0x30, "zap $RA,$RB,$RC">; //Zero bytes -def ZAPi : OFormL<0x12, 0x30, "zap $RA,$L,$RC">; //Zero bytes -def ZAPNOT : OForm< 0x12, 0x31, "zapnot $RA,$RB,$RC">; //Zero bytes not -def ZAPNOTi : OFormL<0x12, 0x31, "zapnot $RA,$L,$RC">; //Zero bytes not +def ADDL : OForm< 0x10, 0x00, "addl $RA,$RB,$RC", + [(set GPRC:$RC, (sext_inreg (add GPRC:$RA, GPRC:$RB), i32))]>; +def ADDLi : OFormL<0x10, 0x00, "addl $RA,$L,$RC", + [(set GPRC:$RC, (sext_inreg (add GPRC:$RA, immUExt8:$L), i32))]>; +def ADDQ : OForm< 0x10, 0x20, "addq $RA,$RB,$RC", + [(set GPRC:$RC, (add GPRC:$RA, GPRC:$RB))]>; +def ADDQi : OFormL<0x10, 0x20, "addq $RA,$L,$RC", + [(set GPRC:$RC, (add GPRC:$RA, immUExt8:$L))]>; +//def AMASK : OForm< 0x11, 0x61, "AMASK $RA,$RB,$RC", []>; //Architecture mask +//def AMASKi : OFormL<0x11, 0x61, "AMASK $RA,$L,$RC", []>; //Architecture mask +def AND : OForm< 0x11, 0x00, "and $RA,$RB,$RC", + [(set GPRC:$RC, (and GPRC:$RA, GPRC:$RB))]>; +def ANDi : OFormL<0x11, 0x00, "and $RA,$L,$RC", + [(set GPRC:$RC, (and GPRC:$RA, immUExt8:$L))]>; +def BIC : OForm< 0x11, 0x08, "bic $RA,$RB,$RC", + [(set GPRC:$RC, (and GPRC:$RA, (not GPRC:$RB)))]>; +def BICi : OFormL<0x11, 0x08, "bic $RA,$L,$RC", []>; +// [(set GPRC:$RC, (and GPRC:$RA, (not immUExt8:$L)))]>; //FIXME? +def BIS : OForm< 0x11, 0x20, "bis $RA,$RB,$RC", + [(set GPRC:$RC, (or GPRC:$RA, GPRC:$RB))]>; +def BISi : OFormL<0x11, 0x20, "bis $RA,$L,$RC", + [(set GPRC:$RC, (or GPRC:$RA, immUExt8:$L))]>; +def CTLZ : OForm< 0x1C, 0x32, "CTLZ $RB,$RC", []>; +// [(set GPRC:$RC, (ctlz GPRC:$RB))]>; +def CTPOP : OForm< 0x1C, 0x30, "CTPOP $RB,$RC", []>; //Count population +def CTTZ : OForm< 0x1C, 0x33, "CTTZ $RB,$RC", []>; //Count trailing zero +def EQV : OForm< 0x11, 0x48, "eqv $RA,$RB,$RC", + [(set GPRC:$RC, (xor GPRC:$RA, (not GPRC:$RB)))]>; +def EQVi : OFormL<0x11, 0x48, "eqv $RA,$L,$RC", []>; +// [(set GPRC:$RC, (xor GPRC:$RA, (not immUExt8:$L)))]>; +//def EXTBL : OForm< 0x12, 0x06, "EXTBL $RA,$RB,$RC", []>; //Extract byte low +//def EXTBLi : OFormL<0x12, 0x06, "EXTBL $RA,$L,$RC", []>; //Extract byte low +//def EXTLH : OForm< 0x12, 0x6A, "EXTLH $RA,$RB,$RC", []>; //Extract longword high +//def EXTLHi : OFormL<0x12, 0x6A, "EXTLH $RA,$L,$RC", []>; //Extract longword high +//def EXTLL : OForm< 0x12, 0x26, "EXTLL $RA,$RB,$RC", []>; //Extract longword low +//def EXTLLi : OFormL<0x12, 0x26, "EXTLL $RA,$L,$RC", []>; //Extract longword low +//def EXTQH : OForm< 0x12, 0x7A, "EXTQH $RA,$RB,$RC", []>; //Extract quadword high +//def EXTQHi : OFormL<0x12, 0x7A, "EXTQH $RA,$L,$RC", []>; //Extract quadword high +//def EXTQ : OForm< 0x12, 0x36, "EXTQ $RA,$RB,$RC", []>; //Extract quadword low +//def EXTQi : OFormL<0x12, 0x36, "EXTQ $RA,$L,$RC", []>; //Extract quadword low +//def EXTWH : OForm< 0x12, 0x5A, "EXTWH $RA,$RB,$RC", []>; //Extract word high +//def EXTWHi : OFormL<0x12, 0x5A, "EXTWH $RA,$L,$RC", []>; //Extract word high +//def EXTWL : OForm< 0x12, 0x16, "EXTWL $RA,$RB,$RC", []>; //Extract word low +//def EXTWLi : OFormL<0x12, 0x16, "EXTWL $RA,$L,$RC", []>; //Extract word low +//def IMPLVER : OForm< 0x11, 0x6C, "IMPLVER $RA,$RB,$RC", []>; //Implementation version +//def IMPLVERi : OFormL<0x11, 0x6C, "IMPLVER $RA,$L,$RC", []>; //Implementation version +//def INSBL : OForm< 0x12, 0x0B, "INSBL $RA,$RB,$RC", []>; //Insert byte low +//def INSBLi : OFormL<0x12, 0x0B, "INSBL $RA,$L,$RC", []>; //Insert byte low +//def INSLH : OForm< 0x12, 0x67, "INSLH $RA,$RB,$RC", []>; //Insert longword high +//def INSLHi : OFormL<0x12, 0x67, "INSLH $RA,$L,$RC", []>; //Insert longword high +//def INSLL : OForm< 0x12, 0x2B, "INSLL $RA,$RB,$RC", []>; //Insert longword low +//def INSLLi : OFormL<0x12, 0x2B, "INSLL $RA,$L,$RC", []>; //Insert longword low +//def INSQH : OForm< 0x12, 0x77, "INSQH $RA,$RB,$RC", []>; //Insert quadword high +//def INSQHi : OFormL<0x12, 0x77, "INSQH $RA,$L,$RC", []>; //Insert quadword high +//def INSQL : OForm< 0x12, 0x3B, "INSQL $RA,$RB,$RC", []>; //Insert quadword low +//def INSQLi : OFormL<0x12, 0x3B, "INSQL $RA,$L,$RC", []>; //Insert quadword low +//def INSWH : OForm< 0x12, 0x57, "INSWH $RA,$RB,$RC", []>; //Insert word high +//def INSWHi : OFormL<0x12, 0x57, "INSWH $RA,$L,$RC", []>; //Insert word high +//def INSWL : OForm< 0x12, 0x1B, "INSWL $RA,$RB,$RC", []>; //Insert word low +//def INSWLi : OFormL<0x12, 0x1B, "INSWL $RA,$L,$RC", []>; //Insert word low +//def MSKBL : OForm< 0x12, 0x02, "MSKBL $RA,$RB,$RC", []>; //Mask byte low +//def MSKBLi : OFormL<0x12, 0x02, "MSKBL $RA,$L,$RC", []>; //Mask byte low +//def MSKLH : OForm< 0x12, 0x62, "MSKLH $RA,$RB,$RC", []>; //Mask longword high +//def MSKLHi : OFormL<0x12, 0x62, "MSKLH $RA,$L,$RC", []>; //Mask longword high +//def MSKLL : OForm< 0x12, 0x22, "MSKLL $RA,$RB,$RC", []>; //Mask longword low +//def MSKLLi : OFormL<0x12, 0x22, "MSKLL $RA,$L,$RC", []>; //Mask longword low +//def MSKQH : OForm< 0x12, 0x72, "MSKQH $RA,$RB,$RC", []>; //Mask quadword high +//def MSKQHi : OFormL<0x12, 0x72, "MSKQH $RA,$L,$RC", []>; //Mask quadword high +//def MSKQL : OForm< 0x12, 0x32, "MSKQL $RA,$RB,$RC", []>; //Mask quadword low +//def MSKQLi : OFormL<0x12, 0x32, "MSKQL $RA,$L,$RC", []>; //Mask quadword low +//def MSKWH : OForm< 0x12, 0x52, "MSKWH $RA,$RB,$RC", []>; //Mask word high +//def MSKWHi : OFormL<0x12, 0x52, "MSKWH $RA,$L,$RC", []>; //Mask word high +//def MSKWL : OForm< 0x12, 0x12, "MSKWL $RA,$RB,$RC", []>; //Mask word low +//def MSKWLi : OFormL<0x12, 0x12, "MSKWL $RA,$L,$RC", []>; //Mask word low +def MULL : OForm< 0x13, 0x00, "mull $RA,$RB,$RC", + [(set GPRC:$RC, (sext_inreg (mul GPRC:$RA, GPRC:$RB), i32))]>; +def MULLi : OFormL<0x13, 0x00, "mull $RA,$L,$RC", + [(set GPRC:$RC, (sext_inreg (mul GPRC:$RA, immUExt8:$L), i32))]>; +def MULQ : OForm< 0x13, 0x20, "mulq $RA,$RB,$RC", + [(set GPRC:$RC, (mul GPRC:$RA, GPRC:$RB))]>; +def MULQi : OFormL<0x13, 0x20, "mulq $RA,$L,$RC", + [(set GPRC:$RC, (mul GPRC:$RA, immUExt8:$L))]>; +def ORNOT : OForm< 0x11, 0x28, "ornot $RA,$RB,$RC", + [(set GPRC:$RC, (or GPRC:$RA, (not GPRC:$RB)))]>; +def ORNOTi : OFormL<0x11, 0x28, "ornot $RA,$L,$RC", []>; +// [(set GPRC:$RC, (or GPRC:$RA, (not immUExt8:$L)))]>; +def S4ADDL : OForm< 0x10, 0x02, "s4addl $RA,$RB,$RC", + [(set GPRC:$RC, (sext_inreg (add (shl GPRC:$RA, imm2), GPRC:$RB), i32))]>; +def S4ADDLi : OFormL<0x10, 0x02, "s4addl $RA,$L,$RC", + [(set GPRC:$RC, (sext_inreg (add (shl GPRC:$RA, imm2), immUExt8:$L), i32))]>; +def S4ADDQ : OForm< 0x10, 0x22, "s4addq $RA,$RB,$RC", + [(set GPRC:$RC, (add (shl GPRC:$RA, imm2), GPRC:$RB))]>; +def S4ADDQi : OFormL<0x10, 0x22, "s4addq $RA,$L,$RC", + [(set GPRC:$RC, (add (shl GPRC:$RA, imm2), immUExt8:$L))]>; +def S4SUBL : OForm< 0x10, 0x0B, "s4subl $RA,$RB,$RC", + [(set GPRC:$RC, (sext_inreg (sub (shl GPRC:$RA, imm2), GPRC:$RB), i32))]>; +def S4SUBLi : OFormL<0x10, 0x0B, "s4subl $RA,$L,$RC", + [(set GPRC:$RC, (sext_inreg (sub (shl GPRC:$RA, imm2), immUExt8:$L), i32))]>; +def S4SUBQ : OForm< 0x10, 0x2B, "s4subq $RA,$RB,$RC", + [(set GPRC:$RC, (sub (shl GPRC:$RA, imm2), GPRC:$RB))]>; +def S4SUBQi : OFormL<0x10, 0x2B, "s4subq $RA,$L,$RC", + [(set GPRC:$RC, (sub (shl GPRC:$RA, imm2), immUExt8:$L))]>; +def S8ADDL : OForm< 0x10, 0x12, "s8addl $RA,$RB,$RC", + [(set GPRC:$RC, (sext_inreg (add (shl GPRC:$RA, imm3), GPRC:$RB), i32))]>; +def S8ADDLi : OFormL<0x10, 0x12, "s8addl $RA,$L,$RC", + [(set GPRC:$RC, (sext_inreg (add (shl GPRC:$RA, imm3), immUExt8:$L), i32))]>; +def S8ADDQ : OForm< 0x10, 0x32, "s8addq $RA,$RB,$RC", + [(set GPRC:$RC, (add (shl GPRC:$RA, imm3), GPRC:$RB))]>; +def S8ADDQi : OFormL<0x10, 0x32, "s8addq $RA,$L,$RC", + [(set GPRC:$RC, (add (shl GPRC:$RA, imm3), immUExt8:$L))]>; +def S8SUBL : OForm< 0x10, 0x1B, "s8subl $RA,$RB,$RC", + [(set GPRC:$RC, (sext_inreg (sub (shl GPRC:$RA, imm3), GPRC:$RB), i32))]>; +def S8SUBLi : OFormL<0x10, 0x1B, "s8subl $RA,$L,$RC", + [(set GPRC:$RC, (sext_inreg (sub (shl GPRC:$RA, imm3), immUExt8:$L), i32))]>; +def S8SUBQ : OForm< 0x10, 0x3B, "s8subq $RA,$RB,$RC", + [(set GPRC:$RC, (sub (shl GPRC:$RA, imm3), GPRC:$RB))]>; +def S8SUBQi : OFormL<0x10, 0x3B, "s8subq $RA,$L,$RC", + [(set GPRC:$RC, (sub (shl GPRC:$RA, imm3), immUExt8:$L))]>; + +def SEXTB : OForm< 0x1C, 0x00, "sextb $RB,$RC", []>; //Sign extend byte +def SEXTW : OForm< 0x1C, 0x01, "sextw $RB,$RC", []>; //Sign extend word + +def SL : OForm< 0x12, 0x39, "sll $RA,$RB,$RC", + [(set GPRC:$RC, (shl GPRC:$RA, GPRC:$RB))]>; +def SLi : OFormL<0x12, 0x39, "sll $RA,$L,$RC", + [(set GPRC:$RC, (shl GPRC:$RA, immUExt8:$L))]>; +def SRA : OForm< 0x12, 0x3C, "sra $RA,$RB,$RC", + [(set GPRC:$RC, (sra GPRC:$RA, GPRC:$RB))]>; +def SRAi : OFormL<0x12, 0x3C, "sra $RA,$L,$RC", + [(set GPRC:$RC, (sra GPRC:$RA, immUExt8:$L))]>; +def SRL : OForm< 0x12, 0x34, "srl $RA,$RB,$RC", + [(set GPRC:$RC, (srl GPRC:$RA, GPRC:$RB))]>; +def SRLi : OFormL<0x12, 0x34, "srl $RA,$L,$RC", + [(set GPRC:$RC, (srl GPRC:$RA, immUExt8:$L))]>; +def SUBL : OForm< 0x10, 0x09, "subl $RA,$RB,$RC", + [(set GPRC:$RC, (sext_inreg (sub GPRC:$RA, GPRC:$RB), i32))]>; +def SUBLi : OFormL<0x10, 0x09, "subl $RA,$L,$RC", + [(set GPRC:$RC, (sext_inreg (sub GPRC:$RA, immUExt8:$L), i32))]>; +def SUBQ : OForm< 0x10, 0x29, "subq $RA,$RB,$RC", + [(set GPRC:$RC, (sub GPRC:$RA, GPRC:$RB))]>; +def SUBQi : OFormL<0x10, 0x29, "subq $RA,$L,$RC", + [(set GPRC:$RC, (sub GPRC:$RA, immUExt8:$L))]>; +def UMULH : OForm< 0x13, 0x30, "umulh $RA,$RB,$RC", []>; //Unsigned multiply quadword high +def UMULHi : OFormL<0x13, 0x30, "umulh $RA,$L,$RC", []>; //Unsigned multiply quadword high +def XOR : OForm< 0x11, 0x40, "xor $RA,$RB,$RC", + [(set GPRC:$RC, (xor GPRC:$RA, GPRC:$RB))]>; +def XORi : OFormL<0x11, 0x40, "xor $RA,$L,$RC", + [(set GPRC:$RC, (xor GPRC:$RA, immUExt8:$L))]>; +def ZAP : OForm< 0x12, 0x30, "zap $RA,$RB,$RC", []>; //Zero bytes +def ZAPi : OFormL<0x12, 0x30, "zap $RA,$L,$RC", []>; //Zero bytes +def ZAPNOT : OForm< 0x12, 0x31, "zapnot $RA,$RB,$RC", []>; //Zero bytes not +def ZAPNOTi : OFormL<0x12, 0x31, "zapnot $RA,$L,$RC", []>; //Zero bytes not //Comparison, int -def CMPBGE : OForm< 0x10, 0x0F, "cmpbge $RA,$RB,$RC">; //Compare byte -def CMPBGEi : OFormL<0x10, 0x0F, "cmpbge $RA,$L,$RC">; //Compare byte -def CMPEQ : OForm< 0x10, 0x2D, "cmpeq $RA,$RB,$RC">; //Compare signed quadword equal -def CMPEQi : OFormL<0x10, 0x2D, "cmpeq $RA,$L,$RC">; //Compare signed quadword equal -def CMPLE : OForm< 0x10, 0x6D, "cmple $RA,$RB,$RC">; //Compare signed quadword less than or equal -def CMPLEi : OFormL<0x10, 0x6D, "cmple $RA,$L,$RC">; //Compare signed quadword less than or equal -def CMPLT : OForm< 0x10, 0x4D, "cmplt $RA,$RB,$RC">; //Compare signed quadword less than -def CMPLTi : OFormL<0x10, 0x4D, "cmplt $RA,$L,$RC">; //Compare signed quadword less than -def CMPULE : OForm< 0x10, 0x3D, "cmpule $RA,$RB,$RC">; //Compare unsigned quadword less than or equal -def CMPULEi : OFormL<0x10, 0x3D, "cmpule $RA,$L,$RC">; //Compare unsigned quadword less than or equal -def CMPULT : OForm< 0x10, 0x1D, "cmpult $RA,$RB,$RC">; //Compare unsigned quadword less than -def CMPULTi : OFormL<0x10, 0x1D, "cmpult $RA,$L,$RC">; //Compare unsigned quadword less than +def CMPBGE : OForm< 0x10, 0x0F, "cmpbge $RA,$RB,$RC", []>; //Compare byte +def CMPBGEi : OFormL<0x10, 0x0F, "cmpbge $RA,$L,$RC", []>; //Compare byte +def CMPEQ : OForm< 0x10, 0x2D, "cmpeq $RA,$RB,$RC", []>; //Compare signed quadword equal +def CMPEQi : OFormL<0x10, 0x2D, "cmpeq $RA,$L,$RC", []>; //Compare signed quadword equal +def CMPLE : OForm< 0x10, 0x6D, "cmple $RA,$RB,$RC", []>; //Compare signed quadword less than or equal +def CMPLEi : OFormL<0x10, 0x6D, "cmple $RA,$L,$RC", []>; //Compare signed quadword less than or equal +def CMPLT : OForm< 0x10, 0x4D, "cmplt $RA,$RB,$RC", []>; //Compare signed quadword less than +def CMPLTi : OFormL<0x10, 0x4D, "cmplt $RA,$L,$RC", []>; //Compare signed quadword less than +def CMPULE : OForm< 0x10, 0x3D, "cmpule $RA,$RB,$RC", []>; //Compare unsigned quadword less than or equal +def CMPULEi : OFormL<0x10, 0x3D, "cmpule $RA,$L,$RC", []>; //Compare unsigned quadword less than or equal +def CMPULT : OForm< 0x10, 0x1D, "cmpult $RA,$RB,$RC", []>; //Compare unsigned quadword less than +def CMPULTi : OFormL<0x10, 0x1D, "cmpult $RA,$L,$RC", []>; //Compare unsigned quadword less than //Comparison, FP def CMPTEQ : FPForm<0x16, 0x0A5, "cmpteq/su $RA,$RB,$RC">; //Compare T_floating equal @@ -238,24 +304,27 @@ def CMPTUN : FPForm<0x16, 0x0A4, "cmptun/su $RA,$RB,$RC">; //Compare T_floating unordered //There are in the Multimedia extentions, so let's not use them yet -def MAXSB8 : OForm<0x1C, 0x3E, "MAXSB8 $RA,$RB,$RC">; //Vector signed byte maximum -def MAXSW4 : OForm< 0x1C, 0x3F, "MAXSW4 $RA,$RB,$RC">; //Vector signed word maximum -def MAXUB8 : OForm<0x1C, 0x3C, "MAXUB8 $RA,$RB,$RC">; //Vector unsigned byte maximum -def MAXUW4 : OForm< 0x1C, 0x3D, "MAXUW4 $RA,$RB,$RC">; //Vector unsigned word maximum -def MINSB8 : OForm< 0x1C, 0x38, "MINSB8 $RA,$RB,$RC">; //Vector signed byte minimum -def MINSW4 : OForm< 0x1C, 0x39, "MINSW4 $RA,$RB,$RC">; //Vector signed word minimum -def MINUB8 : OForm< 0x1C, 0x3A, "MINUB8 $RA,$RB,$RC">; //Vector unsigned byte minimum -def MINUW4 : OForm< 0x1C, 0x3B, "MINUW4 $RA,$RB,$RC">; //Vector unsigned word minimum -def PERR : OForm< 0x1C, 0x31, "PERR $RA,$RB,$RC">; //Pixel error -def PKLB : OForm< 0x1C, 0x37, "PKLB $RA,$RB,$RC">; //Pack longwords to bytes -def PKWB : OForm<0x1C, 0x36, "PKWB $RA,$RB,$RC">; //Pack words to bytes -def UNPKBL : OForm< 0x1C, 0x35, "UNPKBL $RA,$RB,$RC">; //Unpack bytes to longwords -def UNPKBW : OForm< 0x1C, 0x34, "UNPKBW $RA,$RB,$RC">; //Unpack bytes to words +//def MAXSB8 : OForm<0x1C, 0x3E, "MAXSB8 $RA,$RB,$RC">; //Vector signed byte maximum +//def MAXSW4 : OForm< 0x1C, 0x3F, "MAXSW4 $RA,$RB,$RC">; //Vector signed word maximum +//def MAXUB8 : OForm<0x1C, 0x3C, "MAXUB8 $RA,$RB,$RC">; //Vector unsigned byte maximum +//def MAXUW4 : OForm< 0x1C, 0x3D, "MAXUW4 $RA,$RB,$RC">; //Vector unsigned word maximum +//def MINSB8 : OForm< 0x1C, 0x38, "MINSB8 $RA,$RB,$RC">; //Vector signed byte minimum +//def MINSW4 : OForm< 0x1C, 0x39, "MINSW4 $RA,$RB,$RC">; //Vector signed word minimum +//def MINUB8 : OForm< 0x1C, 0x3A, "MINUB8 $RA,$RB,$RC">; //Vector unsigned byte minimum +//def MINUW4 : OForm< 0x1C, 0x3B, "MINUW4 $RA,$RB,$RC">; //Vector unsigned word minimum +//def PERR : OForm< 0x1C, 0x31, "PERR $RA,$RB,$RC">; //Pixel error +//def PKLB : OForm< 0x1C, 0x37, "PKLB $RA,$RB,$RC">; //Pack longwords to bytes +//def PKWB : OForm<0x1C, 0x36, "PKWB $RA,$RB,$RC">; //Pack words to bytes +//def UNPKBL : OForm< 0x1C, 0x35, "UNPKBL $RA,$RB,$RC">; //Unpack bytes to longwords +//def UNPKBW : OForm< 0x1C, 0x34, "UNPKBW $RA,$RB,$RC">; //Unpack bytes to words //End operate -let isReturn = 1, isTerminator = 1 in +let isReturn = 1, isTerminator = 1 in def RET : MbrForm< 0x1A, 0x02, (ops GPRC:$RD, GPRC:$RS, s64imm:$DISP), "ret $RD,($RS),$DISP">; //Return from subroutine +//DAG Version: +let isReturn = 1, isTerminator = 1, Ra = 31, Rb = 26, disp = 1, Uses = [R26] in + def RETDAG : MbrForm< 0x1A, 0x02, (ops), "ret $$31,($$26),1">; //Return from subroutine def JMP : MbrForm< 0x1A, 0x00, (ops GPRC:$RD, GPRC:$RS, GPRC:$DISP), "jmp $RD,($RS),$DISP">; //Jump let isCall = 1, Index: llvm/lib/Target/Alpha/AlphaRegisterInfo.cpp diff -u llvm/lib/Target/Alpha/AlphaRegisterInfo.cpp:1.28 llvm/lib/Target/Alpha/AlphaRegisterInfo.cpp:1.29 --- llvm/lib/Target/Alpha/AlphaRegisterInfo.cpp:1.28 Sun Oct 9 15:11:35 2005 +++ llvm/lib/Target/Alpha/AlphaRegisterInfo.cpp Wed Oct 19 19:28:31 2005 @@ -314,7 +314,7 @@ MachineBasicBlock &MBB) const { const MachineFrameInfo *MFI = MF.getFrameInfo(); MachineBasicBlock::iterator MBBI = prior(MBB.end()); - assert((MBBI->getOpcode() == Alpha::RET) + assert(((MBBI->getOpcode() == Alpha::RET) || (MBBI->getOpcode() == Alpha::RETDAG)) && "Can only insert epilog into returning blocks"); bool FP = hasFP(MF); Index: llvm/lib/Target/Alpha/AlphaTargetMachine.cpp diff -u llvm/lib/Target/Alpha/AlphaTargetMachine.cpp:1.13 llvm/lib/Target/Alpha/AlphaTargetMachine.cpp:1.14 --- llvm/lib/Target/Alpha/AlphaTargetMachine.cpp:1.13 Thu Sep 29 17:54:56 2005 +++ llvm/lib/Target/Alpha/AlphaTargetMachine.cpp Wed Oct 19 19:28:31 2005 @@ -32,6 +32,9 @@ cl::opt EnableAlphaLSR("enable-lsr-for-alpha", cl::desc("Enable LSR for Alpha (beta option!)"), cl::Hidden); + cl::opt EnableAlphaDAG("enable-dag-isel-for-alpha", + cl::desc("Enable DAG ISEL for Alpha (beta option!)"), + cl::Hidden); } unsigned AlphaTargetMachine::getModuleMatchQuality(const Module &M) { @@ -94,7 +97,10 @@ // Make sure that no unreachable blocks are instruction selected. PM.add(createUnreachableBlockEliminationPass()); - PM.add(createAlphaPatternInstructionSelector(*this)); + if (EnableAlphaDAG) + PM.add(createAlphaISelDag(*this)); + else + PM.add(createAlphaPatternInstructionSelector(*this)); if (PrintMachineCode) PM.add(createMachineFunctionPrinterPass(&std::cerr)); Index: llvm/lib/Target/Alpha/Makefile diff -u llvm/lib/Target/Alpha/Makefile:1.2 llvm/lib/Target/Alpha/Makefile:1.3 --- llvm/lib/Target/Alpha/Makefile:1.2 Mon Feb 21 22:58:26 2005 +++ llvm/lib/Target/Alpha/Makefile Wed Oct 19 19:28:31 2005 @@ -14,6 +14,6 @@ BUILT_SOURCES = AlphaGenRegisterInfo.h.inc AlphaGenRegisterNames.inc \ AlphaGenRegisterInfo.inc AlphaGenInstrNames.inc \ AlphaGenInstrInfo.inc AlphaGenCodeEmitter.inc \ - AlphaGenAsmWriter.inc + AlphaGenAsmWriter.inc AlphaGenDAGISel.inc include $(LEVEL)/Makefile.common From alenhar2 at cs.uiuc.edu Wed Oct 19 19:29:13 2005 From: alenhar2 at cs.uiuc.edu (Andrew Lenharth) Date: Wed, 19 Oct 2005 19:29:13 -0500 Subject: [llvm-commits] CVS: llvm/lib/Target/Alpha/AlphaISelDAGToDAG.cpp Message-ID: <200510200029.TAA25916@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/Alpha: AlphaISelDAGToDAG.cpp added (r1.1) --- Log message: forgot this one --- Diffs of the changes: (+265 -0) AlphaISelDAGToDAG.cpp | 265 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 265 insertions(+) Index: llvm/lib/Target/Alpha/AlphaISelDAGToDAG.cpp diff -c /dev/null llvm/lib/Target/Alpha/AlphaISelDAGToDAG.cpp:1.1 *** /dev/null Wed Oct 19 19:29:12 2005 --- llvm/lib/Target/Alpha/AlphaISelDAGToDAG.cpp Wed Oct 19 19:29:02 2005 *************** *** 0 **** --- 1,265 ---- + //===-- AlphaISelDAGToDAG.cpp - Alpha pattern matching inst selector ------===// + // + // The LLVM Compiler Infrastructure + // + // This file was developed by Andrew Lenharth and is distributed under + // the University of Illinois Open Source License. See LICENSE.TXT for details. + // + //===----------------------------------------------------------------------===// + // + // This file defines a pattern matching instruction selector for Alpha, + // converting from a legalized dag to a Alpha dag. + // + //===----------------------------------------------------------------------===// + + #include "Alpha.h" + #include "AlphaTargetMachine.h" + #include "AlphaISelLowering.h" + #include "llvm/CodeGen/MachineInstrBuilder.h" + #include "llvm/CodeGen/MachineFunction.h" + #include "llvm/CodeGen/SSARegMap.h" + #include "llvm/CodeGen/SelectionDAG.h" + #include "llvm/CodeGen/SelectionDAGISel.h" + #include "llvm/Target/TargetOptions.h" + #include "llvm/ADT/Statistic.h" + #include "llvm/Constants.h" + #include "llvm/GlobalValue.h" + #include "llvm/Support/Debug.h" + #include "llvm/Support/MathExtras.h" + using namespace llvm; + + namespace { + + //===--------------------------------------------------------------------===// + /// AlphaDAGToDAGISel - Alpha specific code to select Alpha machine + /// instructions for SelectionDAG operations. + /// + class AlphaDAGToDAGISel : public SelectionDAGISel { + AlphaTargetLowering AlphaLowering; + + public: + AlphaDAGToDAGISel(TargetMachine &TM) + : SelectionDAGISel(AlphaLowering), AlphaLowering(TM) {} + + /// getI64Imm - Return a target constant with the specified value, of type + /// i64. + inline SDOperand getI64Imm(unsigned Imm) { + return CurDAG->getTargetConstant(Imm, MVT::i64); + } + + virtual bool runOnFunction(Function &Fn) { + return SelectionDAGISel::runOnFunction(Fn); + } + + // Select - Convert the specified operand from a target-independent to a + // target-specific node if it hasn't already been changed. + SDOperand Select(SDOperand Op); + + /// InstructionSelectBasicBlock - This callback is invoked by + /// SelectionDAGISel when it has created a SelectionDAG for us to codegen. + virtual void InstructionSelectBasicBlock(SelectionDAG &DAG); + + virtual const char *getPassName() const { + return "Alpha DAG->DAG Pattern Instruction Selection"; + } + + // Include the pieces autogenerated from the target description. + #include "AlphaGenDAGISel.inc" + + private: + }; + } + + /// InstructionSelectBasicBlock - This callback is invoked by + /// SelectionDAGISel when it has created a SelectionDAG for us to codegen. + void AlphaDAGToDAGISel::InstructionSelectBasicBlock(SelectionDAG &DAG) { + DEBUG(BB->dump()); + + // The selection process is inherently a bottom-up recursive process (users + // select their uses before themselves). Given infinite stack space, we + // could just start selecting on the root and traverse the whole graph. In + // practice however, this causes us to run out of stack space on large basic + // blocks. To avoid this problem, select the entry node, then all its uses, + // iteratively instead of recursively. + std::vector Worklist; + Worklist.push_back(DAG.getEntryNode()); + + // Note that we can do this in the Alpha target (scanning forward across token + // chain edges) because no nodes ever get folded across these edges. On a + // target like X86 which supports load/modify/store operations, this would + // have to be more careful. + while (!Worklist.empty()) { + SDOperand Node = Worklist.back(); + Worklist.pop_back(); + + // Chose from the least deep of the top two nodes. + if (!Worklist.empty() && + Worklist.back().Val->getNodeDepth() < Node.Val->getNodeDepth()) + std::swap(Worklist.back(), Node); + + if ((Node.Val->getOpcode() >= ISD::BUILTIN_OP_END && + Node.Val->getOpcode() < AlphaISD::FIRST_NUMBER) || + CodeGenMap.count(Node)) continue; + + for (SDNode::use_iterator UI = Node.Val->use_begin(), + E = Node.Val->use_end(); UI != E; ++UI) { + // Scan the values. If this use has a value that is a token chain, add it + // to the worklist. + SDNode *User = *UI; + for (unsigned i = 0, e = User->getNumValues(); i != e; ++i) + if (User->getValueType(i) == MVT::Other) { + Worklist.push_back(SDOperand(User, i)); + break; + } + } + + // Finally, legalize this node. + Select(Node); + } + + // Select target instructions for the DAG. + DAG.setRoot(Select(DAG.getRoot())); + CodeGenMap.clear(); + DAG.RemoveDeadNodes(); + + // Emit machine code to BB. + ScheduleAndEmitDAG(DAG); + } + + // Select - Convert the specified operand from a target-independent to a + // target-specific node if it hasn't already been changed. + SDOperand AlphaDAGToDAGISel::Select(SDOperand Op) { + SDNode *N = Op.Val; + if (N->getOpcode() >= ISD::BUILTIN_OP_END && + N->getOpcode() < AlphaISD::FIRST_NUMBER) + return Op; // Already selected. + + // If this has already been converted, use it. + std::map::iterator CGMI = CodeGenMap.find(Op); + if (CGMI != CodeGenMap.end()) return CGMI->second; + + switch (N->getOpcode()) { + default: break; + case ISD::DYNAMIC_STACKALLOC: + case ISD::ADD_PARTS: + case ISD::SUB_PARTS: + case ISD::SETCC: + case ISD::CALL: + case ISD::TAILCALL: + assert(0 && "You want these too?"); + + case ISD::TokenFactor: { + SDOperand New; + if (N->getNumOperands() == 2) { + SDOperand Op0 = Select(N->getOperand(0)); + SDOperand Op1 = Select(N->getOperand(1)); + New = CurDAG->getNode(ISD::TokenFactor, MVT::Other, Op0, Op1); + } else { + std::vector Ops; + for (unsigned i = 0, e = N->getNumOperands(); i != e; ++i) + Ops.push_back(Select(N->getOperand(i))); + New = CurDAG->getNode(ISD::TokenFactor, MVT::Other, Ops); + } + + CodeGenMap[Op] = New; + return New; + } + case ISD::CopyFromReg: { + SDOperand Chain = Select(N->getOperand(0)); + if (Chain == N->getOperand(0)) return Op; // No change + SDOperand New = CurDAG->getCopyFromReg(Chain, + cast(N->getOperand(1))->getReg(), N->getValueType(0)); + return New.getValue(Op.ResNo); + } + case ISD::CopyToReg: { + SDOperand Chain = Select(N->getOperand(0)); + SDOperand Reg = N->getOperand(1); + SDOperand Val = Select(N->getOperand(2)); + SDOperand New = CurDAG->getNode(ISD::CopyToReg, MVT::Other, + Chain, Reg, Val); + CodeGenMap[Op] = New; + return New; + } + case ISD::UNDEF: + if (N->getValueType(0) == MVT::i64) + CurDAG->SelectNodeTo(N, Alpha::IDEF, MVT::i64); + // else if (N->getValueType(0) == MVT::f32) + // CurDAG->SelectNodeTo(N, PPC::IMPLICIT_DEF_F4, MVT::f32); + // else + // CurDAG->SelectNodeTo(N, PPC::IMPLICIT_DEF_F8, MVT::f64); + return SDOperand(N, 0); + case ISD::FrameIndex: { + // int FI = cast(N)->getIndex(); + // CurDAG->SelectNodeTo(N, Alpha::LDA, MVT::i64, + // CurDAG->getTargetFrameIndex(FI, MVT::i32), + // getI32Imm(0)); + // return SDOperand(N, 0); + assert(0 && "Frame?, you are suppose to look through the window, not at the frame!"); + } + case ISD::ConstantPool: { + // Constant *C = cast(N)->get(); + // SDOperand Tmp, CPI = CurDAG->getTargetConstantPool(C, MVT::i32); + // if (PICEnabled) + // Tmp = CurDAG->getTargetNode(PPC::ADDIS, MVT::i32, getGlobalBaseReg(),CPI); + // else + // Tmp = CurDAG->getTargetNode(PPC::LIS, MVT::i32, CPI); + // CurDAG->SelectNodeTo(N, PPC::LA, MVT::i32, Tmp, CPI); + // return SDOperand(N, 0); + assert(0 && "Constants are overrated"); + } + case ISD::GlobalAddress: { + // GlobalValue *GV = cast(N)->getGlobal(); + // SDOperand Tmp; + // SDOperand GA = CurDAG->getTargetGlobalAddress(GV, MVT::i32); + // if (PICEnabled) + // Tmp = CurDAG->getTargetNode(PPC::ADDIS, MVT::i32, getGlobalBaseReg(), GA); + // else + // Tmp = CurDAG->getTargetNode(PPC::LIS, MVT::i32, GA); + + // if (GV->hasWeakLinkage() || GV->isExternal()) + // CurDAG->SelectNodeTo(N, PPC::LWZ, MVT::i32, GA, Tmp); + // else + // CurDAG->SelectNodeTo(N, PPC::LA, MVT::i32, Tmp, GA); + // return SDOperand(N, 0); + assert(0 && "GlobalAddresses are for wimps"); + } + + case ISD::CALLSEQ_START: + case ISD::CALLSEQ_END: { + unsigned Amt = cast(N->getOperand(1))->getValue(); + unsigned Opc = N->getOpcode() == ISD::CALLSEQ_START ? + Alpha::ADJUSTSTACKDOWN : Alpha::ADJUSTSTACKUP; + CurDAG->SelectNodeTo(N, Opc, MVT::Other, + getI64Imm(Amt), Select(N->getOperand(0))); + return SDOperand(N, 0); + } + case ISD::RET: { + SDOperand Chain = Select(N->getOperand(0)); // Token chain. + + if (N->getNumOperands() == 2) { + SDOperand Val = Select(N->getOperand(1)); + if (N->getOperand(1).getValueType() == MVT::i64) { + Chain = CurDAG->getCopyToReg(Chain, Alpha::R0, Val); + } + } + //BuildMI(BB, Alpha::RET, 2, Alpha::R31).addReg(Alpha::R26).addImm(1); + + // FIXME: add restoring of the RA to R26 to the chain + // Finally, select this to a ret instruction. + CurDAG->SelectNodeTo(N, Alpha::RETDAG, MVT::Other, Chain); + return SDOperand(N, 0); + } + + + + } + + return SelectCode(Op); + } + + /// createAlphaISelDag - This pass converts a legalized DAG into a + /// Alpha-specific DAG, ready for instruction scheduling. + /// + FunctionPass *llvm::createAlphaISelDag(TargetMachine &TM) { + return new AlphaDAGToDAGISel(TM); + } From natebegeman at mac.com Wed Oct 19 21:14:25 2005 From: natebegeman at mac.com (Nate Begeman) Date: Wed, 19 Oct 2005 21:14:25 -0500 Subject: [llvm-commits] CVS: llvm/include/llvm/Target/TargetLowering.h Message-ID: <200510200214.VAA26444@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm/Target: TargetLowering.h updated: 1.25 -> 1.26 --- Log message: Enable targets to say that integer divide is expensive, which will trigger an upcoming optimization in the DAG Combiner. --- Diffs of the changes: (+16 -0) TargetLowering.h | 16 ++++++++++++++++ 1 files changed, 16 insertions(+) Index: llvm/include/llvm/Target/TargetLowering.h diff -u llvm/include/llvm/Target/TargetLowering.h:1.25 llvm/include/llvm/Target/TargetLowering.h:1.26 --- llvm/include/llvm/Target/TargetLowering.h:1.25 Tue Oct 18 18:23:37 2005 +++ llvm/include/llvm/Target/TargetLowering.h Wed Oct 19 21:14:14 2005 @@ -83,6 +83,10 @@ /// isSetCCExpensive - Return true if the setcc operation is expensive for /// this target. bool isSetCCExpensive() const { return SetCCIsExpensive; } + + /// isIntDivExpensive() - Return true if integer divide is more expensive than + /// a sequence of several shifts, adds, and multiplies for this target. + bool isIntDivExpensive() const { return IntDivIsExpensive; } /// getSetCCResultTy - Return the ValueType of the result of setcc operations. /// @@ -262,6 +266,11 @@ /// setcc operations into other operations if possible. void setSetCCIsExpensive() { SetCCIsExpensive = true; } + /// setIntDivIsExpensive - Tells the code generator that integer divide is + /// expensive, and if possible, should be replaced by an alternate sequence + /// of instructions not containing an integer divide. + void setIntDivIsExpensive() { IntDivIsExpensive = true; } + /// addRegisterClass - Add the specified register class as an available /// regclass for the specified value type. This indicates the selector can /// handle values of that class natively. @@ -391,6 +400,13 @@ /// setcc operations into other operations if possible. bool SetCCIsExpensive; + /// IntDivIsExpensive - This is a hack until a real costs model is in place + /// that tells the code generator whether integer divide will always be more + /// expensive than a sequence of multiplies, shifts, and adds that performs + /// the same operation. If we ever optimize for size, this will be set to + /// false unconditionally. + bool IntDivIsExpensive; + /// SetCCResultTy - The type that SetCC operations use. This defaults to the /// PointerTy. MVT::ValueType SetCCResultTy; From natebegeman at mac.com Wed Oct 19 21:15:56 2005 From: natebegeman at mac.com (Nate Begeman) Date: Wed, 19 Oct 2005 21:15:56 -0500 Subject: [llvm-commits] CVS: llvm/lib/Target/PowerPC/PPCISelDAGToDAG.cpp PPCISelLowering.cpp PPCISelPattern.cpp Message-ID: <200510200215.VAA26484@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/PowerPC: PPCISelDAGToDAG.cpp updated: 1.113 -> 1.114 PPCISelLowering.cpp updated: 1.34 -> 1.35 PPCISelPattern.cpp updated: 1.190 -> 1.191 --- Log message: Move the target constant divide optimization up into the dag combiner, so that the nodes can be folded with other nodes, and we can not duplicate code in every backend. Alpha will probably want this too. --- Diffs of the changes: (+2 -314) PPCISelDAGToDAG.cpp | 160 ---------------------------------------------------- PPCISelLowering.cpp | 2 PPCISelPattern.cpp | 154 -------------------------------------------------- 3 files changed, 2 insertions(+), 314 deletions(-) Index: llvm/lib/Target/PowerPC/PPCISelDAGToDAG.cpp diff -u llvm/lib/Target/PowerPC/PPCISelDAGToDAG.cpp:1.113 llvm/lib/Target/PowerPC/PPCISelDAGToDAG.cpp:1.114 --- llvm/lib/Target/PowerPC/PPCISelDAGToDAG.cpp:1.113 Wed Oct 19 13:42:01 2005 +++ llvm/lib/Target/PowerPC/PPCISelDAGToDAG.cpp Wed Oct 19 21:15:44 2005 @@ -513,149 +513,6 @@ return 0; } -// Structure used to return the necessary information to codegen an SDIV as -// a multiply. -struct ms { - int m; // magic number - int s; // shift amount -}; - -struct mu { - unsigned int m; // magic number - int a; // add indicator - int s; // shift amount -}; - -/// magic - calculate the magic numbers required to codegen an integer sdiv as -/// a sequence of multiply and shifts. Requires that the divisor not be 0, 1, -/// or -1. -static struct ms magic(int d) { - int p; - unsigned int ad, anc, delta, q1, r1, q2, r2, t; - const unsigned int two31 = 0x80000000U; - struct ms mag; - - ad = abs(d); - t = two31 + ((unsigned int)d >> 31); - anc = t - 1 - t%ad; // absolute value of nc - p = 31; // initialize p - q1 = two31/anc; // initialize q1 = 2p/abs(nc) - r1 = two31 - q1*anc; // initialize r1 = rem(2p,abs(nc)) - q2 = two31/ad; // initialize q2 = 2p/abs(d) - r2 = two31 - q2*ad; // initialize r2 = rem(2p,abs(d)) - do { - p = p + 1; - q1 = 2*q1; // update q1 = 2p/abs(nc) - r1 = 2*r1; // update r1 = rem(2p/abs(nc)) - if (r1 >= anc) { // must be unsigned comparison - q1 = q1 + 1; - r1 = r1 - anc; - } - q2 = 2*q2; // update q2 = 2p/abs(d) - r2 = 2*r2; // update r2 = rem(2p/abs(d)) - if (r2 >= ad) { // must be unsigned comparison - q2 = q2 + 1; - r2 = r2 - ad; - } - delta = ad - r2; - } while (q1 < delta || (q1 == delta && r1 == 0)); - - mag.m = q2 + 1; - if (d < 0) mag.m = -mag.m; // resulting magic number - mag.s = p - 32; // resulting shift - return mag; -} - -/// magicu - calculate the magic numbers required to codegen an integer udiv as -/// a sequence of multiply, add and shifts. Requires that the divisor not be 0. -static struct mu magicu(unsigned d) -{ - int p; - unsigned int nc, delta, q1, r1, q2, r2; - struct mu magu; - magu.a = 0; // initialize "add" indicator - nc = - 1 - (-d)%d; - p = 31; // initialize p - q1 = 0x80000000/nc; // initialize q1 = 2p/nc - r1 = 0x80000000 - q1*nc; // initialize r1 = rem(2p,nc) - q2 = 0x7FFFFFFF/d; // initialize q2 = (2p-1)/d - r2 = 0x7FFFFFFF - q2*d; // initialize r2 = rem((2p-1),d) - do { - p = p + 1; - if (r1 >= nc - r1 ) { - q1 = 2*q1 + 1; // update q1 - r1 = 2*r1 - nc; // update r1 - } - else { - q1 = 2*q1; // update q1 - r1 = 2*r1; // update r1 - } - if (r2 + 1 >= d - r2) { - if (q2 >= 0x7FFFFFFF) magu.a = 1; - q2 = 2*q2 + 1; // update q2 - r2 = 2*r2 + 1 - d; // update r2 - } - else { - if (q2 >= 0x80000000) magu.a = 1; - q2 = 2*q2; // update q2 - r2 = 2*r2 + 1; // update r2 - } - delta = d - 1 - r2; - } while (p < 64 && (q1 < delta || (q1 == delta && r1 == 0))); - magu.m = q2 + 1; // resulting magic number - magu.s = p - 32; // resulting shift - return magu; -} - -/// BuildSDIVSequence - Given an ISD::SDIV node expressing a divide by constant, -/// return a DAG expression to select that will generate the same value by -/// multiplying by a magic number. See: -/// -SDOperand PPCDAGToDAGISel::BuildSDIVSequence(SDNode *N) { - int d = (int)cast(N->getOperand(1))->getValue(); - ms magics = magic(d); - // Multiply the numerator (operand 0) by the magic value - SDOperand Q = CurDAG->getNode(ISD::MULHS, MVT::i32, N->getOperand(0), - CurDAG->getConstant(magics.m, MVT::i32)); - // If d > 0 and m < 0, add the numerator - if (d > 0 && magics.m < 0) - Q = CurDAG->getNode(ISD::ADD, MVT::i32, Q, N->getOperand(0)); - // If d < 0 and m > 0, subtract the numerator. - if (d < 0 && magics.m > 0) - Q = CurDAG->getNode(ISD::SUB, MVT::i32, Q, N->getOperand(0)); - // Shift right algebraic if shift value is nonzero - if (magics.s > 0) - Q = CurDAG->getNode(ISD::SRA, MVT::i32, Q, - CurDAG->getConstant(magics.s, MVT::i32)); - // Extract the sign bit and add it to the quotient - SDOperand T = - CurDAG->getNode(ISD::SRL, MVT::i32, Q, CurDAG->getConstant(31, MVT::i32)); - return CurDAG->getNode(ISD::ADD, MVT::i32, Q, T); -} - -/// BuildUDIVSequence - Given an ISD::UDIV node expressing a divide by constant, -/// return a DAG expression to select that will generate the same value by -/// multiplying by a magic number. See: -/// -SDOperand PPCDAGToDAGISel::BuildUDIVSequence(SDNode *N) { - unsigned d = (unsigned)cast(N->getOperand(1))->getValue(); - mu magics = magicu(d); - // Multiply the numerator (operand 0) by the magic value - SDOperand Q = CurDAG->getNode(ISD::MULHU, MVT::i32, N->getOperand(0), - CurDAG->getConstant(magics.m, MVT::i32)); - if (magics.a == 0) { - return CurDAG->getNode(ISD::SRL, MVT::i32, Q, - CurDAG->getConstant(magics.s, MVT::i32)); - } else { - SDOperand NPQ = CurDAG->getNode(ISD::SUB, MVT::i32, N->getOperand(0), Q); - NPQ = CurDAG->getNode(ISD::SRL, MVT::i32, NPQ, - CurDAG->getConstant(1, MVT::i32)); - NPQ = CurDAG->getNode(ISD::ADD, MVT::i32, NPQ, Q); - return CurDAG->getNode(ISD::SRL, MVT::i32, NPQ, - CurDAG->getConstant(magics.s-1, MVT::i32)); - } -} - SDOperand PPCDAGToDAGISel::SelectDYNAMIC_STACKALLOC(SDOperand Op) { SDNode *N = Op.Val; @@ -1159,29 +1016,12 @@ Op.getValue(1)); CurDAG->SelectNodeTo(N, PPC::NEG, MVT::i32, PT); return SDOperand(N, 0); - } else if (Imm) { - SDOperand Result = Select(BuildSDIVSequence(N)); - CodeGenMap[Op] = Result; - return Result; } } // Other cases are autogenerated. break; } - case ISD::UDIV: { - // If this is a divide by constant, we can emit code using some magic - // constants to implement it as a multiply instead. - unsigned Imm; - if (isIntImmediate(N->getOperand(1), Imm) && Imm) { - SDOperand Result = Select(BuildUDIVSequence(N)); - CodeGenMap[Op] = Result; - return Result; - } - - // Other cases are autogenerated. - break; - } case ISD::AND: { unsigned Imm; // If this is an and of a value rotated between 0 and 31 bits and then and'd Index: llvm/lib/Target/PowerPC/PPCISelLowering.cpp diff -u llvm/lib/Target/PowerPC/PPCISelLowering.cpp:1.34 llvm/lib/Target/PowerPC/PPCISelLowering.cpp:1.35 --- llvm/lib/Target/PowerPC/PPCISelLowering.cpp:1.34 Tue Oct 18 18:23:37 2005 +++ llvm/lib/Target/PowerPC/PPCISelLowering.cpp Wed Oct 19 21:15:44 2005 @@ -27,6 +27,8 @@ // Fold away setcc operations if possible. setSetCCIsExpensive(); + // Fold constant integer div/rem into an alternate sequence of instructions + setIntDivIsExpensive(); // Use _setjmp/_longjmp instead of setjmp/longjmp. setUseUnderscoreSetJmpLongJmp(true); Index: llvm/lib/Target/PowerPC/PPCISelPattern.cpp diff -u llvm/lib/Target/PowerPC/PPCISelPattern.cpp:1.190 llvm/lib/Target/PowerPC/PPCISelPattern.cpp:1.191 --- llvm/lib/Target/PowerPC/PPCISelPattern.cpp:1.190 Mon Oct 17 19:28:58 2005 +++ llvm/lib/Target/PowerPC/PPCISelPattern.cpp Wed Oct 19 21:15:44 2005 @@ -274,151 +274,6 @@ } return 0; } - -// Structure used to return the necessary information to codegen an SDIV as -// a multiply. -struct ms { - int m; // magic number - int s; // shift amount -}; - -struct mu { - unsigned int m; // magic number - int a; // add indicator - int s; // shift amount -}; - -/// magic - calculate the magic numbers required to codegen an integer sdiv as -/// a sequence of multiply and shifts. Requires that the divisor not be 0, 1, -/// or -1. -static struct ms magic(int d) { - int p; - unsigned int ad, anc, delta, q1, r1, q2, r2, t; - const unsigned int two31 = 0x80000000U; - struct ms mag; - - ad = abs(d); - t = two31 + ((unsigned int)d >> 31); - anc = t - 1 - t%ad; // absolute value of nc - p = 31; // initialize p - q1 = two31/anc; // initialize q1 = 2p/abs(nc) - r1 = two31 - q1*anc; // initialize r1 = rem(2p,abs(nc)) - q2 = two31/ad; // initialize q2 = 2p/abs(d) - r2 = two31 - q2*ad; // initialize r2 = rem(2p,abs(d)) - do { - p = p + 1; - q1 = 2*q1; // update q1 = 2p/abs(nc) - r1 = 2*r1; // update r1 = rem(2p/abs(nc)) - if (r1 >= anc) { // must be unsigned comparison - q1 = q1 + 1; - r1 = r1 - anc; - } - q2 = 2*q2; // update q2 = 2p/abs(d) - r2 = 2*r2; // update r2 = rem(2p/abs(d)) - if (r2 >= ad) { // must be unsigned comparison - q2 = q2 + 1; - r2 = r2 - ad; - } - delta = ad - r2; - } while (q1 < delta || (q1 == delta && r1 == 0)); - - mag.m = q2 + 1; - if (d < 0) mag.m = -mag.m; // resulting magic number - mag.s = p - 32; // resulting shift - return mag; -} - -/// magicu - calculate the magic numbers required to codegen an integer udiv as -/// a sequence of multiply, add and shifts. Requires that the divisor not be 0. -static struct mu magicu(unsigned d) -{ - int p; - unsigned int nc, delta, q1, r1, q2, r2; - struct mu magu; - magu.a = 0; // initialize "add" indicator - nc = - 1 - (-d)%d; - p = 31; // initialize p - q1 = 0x80000000/nc; // initialize q1 = 2p/nc - r1 = 0x80000000 - q1*nc; // initialize r1 = rem(2p,nc) - q2 = 0x7FFFFFFF/d; // initialize q2 = (2p-1)/d - r2 = 0x7FFFFFFF - q2*d; // initialize r2 = rem((2p-1),d) - do { - p = p + 1; - if (r1 >= nc - r1 ) { - q1 = 2*q1 + 1; // update q1 - r1 = 2*r1 - nc; // update r1 - } - else { - q1 = 2*q1; // update q1 - r1 = 2*r1; // update r1 - } - if (r2 + 1 >= d - r2) { - if (q2 >= 0x7FFFFFFF) magu.a = 1; - q2 = 2*q2 + 1; // update q2 - r2 = 2*r2 + 1 - d; // update r2 - } - else { - if (q2 >= 0x80000000) magu.a = 1; - q2 = 2*q2; // update q2 - r2 = 2*r2 + 1; // update r2 - } - delta = d - 1 - r2; - } while (p < 64 && (q1 < delta || (q1 == delta && r1 == 0))); - magu.m = q2 + 1; // resulting magic number - magu.s = p - 32; // resulting shift - return magu; -} -} - -/// BuildSDIVSequence - Given an ISD::SDIV node expressing a divide by constant, -/// return a DAG expression to select that will generate the same value by -/// multiplying by a magic number. See: -/// -SDOperand ISel::BuildSDIVSequence(SDOperand N) { - int d = (int)cast(N.getOperand(1))->getSignExtended(); - ms magics = magic(d); - // Multiply the numerator (operand 0) by the magic value - SDOperand Q = ISelDAG->getNode(ISD::MULHS, MVT::i32, N.getOperand(0), - ISelDAG->getConstant(magics.m, MVT::i32)); - // If d > 0 and m < 0, add the numerator - if (d > 0 && magics.m < 0) - Q = ISelDAG->getNode(ISD::ADD, MVT::i32, Q, N.getOperand(0)); - // If d < 0 and m > 0, subtract the numerator. - if (d < 0 && magics.m > 0) - Q = ISelDAG->getNode(ISD::SUB, MVT::i32, Q, N.getOperand(0)); - // Shift right algebraic if shift value is nonzero - if (magics.s > 0) - Q = ISelDAG->getNode(ISD::SRA, MVT::i32, Q, - ISelDAG->getConstant(magics.s, MVT::i32)); - // Extract the sign bit and add it to the quotient - SDOperand T = - ISelDAG->getNode(ISD::SRL, MVT::i32, Q, ISelDAG->getConstant(31, MVT::i32)); - return ISelDAG->getNode(ISD::ADD, MVT::i32, Q, T); -} - -/// BuildUDIVSequence - Given an ISD::UDIV node expressing a divide by constant, -/// return a DAG expression to select that will generate the same value by -/// multiplying by a magic number. See: -/// -SDOperand ISel::BuildUDIVSequence(SDOperand N) { - unsigned d = - (unsigned)cast(N.getOperand(1))->getSignExtended(); - mu magics = magicu(d); - // Multiply the numerator (operand 0) by the magic value - SDOperand Q = ISelDAG->getNode(ISD::MULHU, MVT::i32, N.getOperand(0), - ISelDAG->getConstant(magics.m, MVT::i32)); - if (magics.a == 0) { - Q = ISelDAG->getNode(ISD::SRL, MVT::i32, Q, - ISelDAG->getConstant(magics.s, MVT::i32)); - } else { - SDOperand NPQ = ISelDAG->getNode(ISD::SUB, MVT::i32, N.getOperand(0), Q); - NPQ = ISelDAG->getNode(ISD::SRL, MVT::i32, NPQ, - ISelDAG->getConstant(1, MVT::i32)); - NPQ = ISelDAG->getNode(ISD::ADD, MVT::i32, NPQ, Q); - Q = ISelDAG->getNode(ISD::SRL, MVT::i32, NPQ, - ISelDAG->getConstant(magics.s-1, MVT::i32)); - } - return Q; } /// getGlobalBaseReg - Output the instructions required to put the @@ -1395,19 +1250,10 @@ BuildMI(BB, PPC::ADDZE, 1, Tmp4).addReg(Tmp1); BuildMI(BB, PPC::NEG, 1, Result).addReg(Tmp4); return Result; - } else if (Tmp3) { - ExprMap.erase(N); - return SelectExpr(BuildSDIVSequence(N)); } } // fall thru case ISD::UDIV: - // If this is a divide by constant, we can emit code using some magic - // constants to implement it as a multiply instead. - if (isIntImmediate(N.getOperand(1), Tmp3) && Tmp3) { - ExprMap.erase(N); - return SelectExpr(BuildUDIVSequence(N)); - } Tmp1 = SelectExpr(N.getOperand(0)); Tmp2 = SelectExpr(N.getOperand(1)); Opc = (ISD::UDIV == opcode) ? PPC::DIVWU : PPC::DIVW; break; From natebegeman at mac.com Wed Oct 19 21:15:56 2005 From: natebegeman at mac.com (Nate Begeman) Date: Wed, 19 Oct 2005 21:15:56 -0500 Subject: [llvm-commits] CVS: llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp Message-ID: <200510200215.VAA26488@zion.cs.uiuc.edu> Changes in directory llvm/lib/CodeGen/SelectionDAG: DAGCombiner.cpp updated: 1.47 -> 1.48 --- Log message: Move the target constant divide optimization up into the dag combiner, so that the nodes can be folded with other nodes, and we can not duplicate code in every backend. Alpha will probably want this too. --- Diffs of the changes: (+263 -0) DAGCombiner.cpp | 263 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 263 insertions(+) Index: llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp diff -u llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp:1.47 llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp:1.48 --- llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp:1.47 Tue Oct 18 01:04:22 2005 +++ llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp Wed Oct 19 21:15:44 2005 @@ -180,6 +180,9 @@ SDOperand N3, ISD::CondCode CC); SDOperand SimplifySetCC(MVT::ValueType VT, SDOperand N0, SDOperand N1, ISD::CondCode Cond, bool foldBooleans = true); + + SDOperand BuildSDIV(SDNode *N); + SDOperand BuildUDIV(SDNode *N); public: DAGCombiner(SelectionDAG &D) : DAG(D), TLI(D.getTargetLoweringInfo()), AfterLegalize(false) {} @@ -189,6 +192,178 @@ }; } +struct ms { + int64_t m; // magic number + int64_t s; // shift amount +}; + +struct mu { + uint64_t m; // magic number + int64_t a; // add indicator + int64_t s; // shift amount +}; + +/// magic - calculate the magic numbers required to codegen an integer sdiv as +/// a sequence of multiply and shifts. Requires that the divisor not be 0, 1, +/// or -1. +static ms magic32(int32_t d) { + int32_t p; + uint32_t ad, anc, delta, q1, r1, q2, r2, t; + const uint32_t two31 = 0x80000000U; + struct ms mag; + + ad = abs(d); + t = two31 + ((uint32_t)d >> 31); + anc = t - 1 - t%ad; // absolute value of nc + p = 31; // initialize p + q1 = two31/anc; // initialize q1 = 2p/abs(nc) + r1 = two31 - q1*anc; // initialize r1 = rem(2p,abs(nc)) + q2 = two31/ad; // initialize q2 = 2p/abs(d) + r2 = two31 - q2*ad; // initialize r2 = rem(2p,abs(d)) + do { + p = p + 1; + q1 = 2*q1; // update q1 = 2p/abs(nc) + r1 = 2*r1; // update r1 = rem(2p/abs(nc)) + if (r1 >= anc) { // must be unsigned comparison + q1 = q1 + 1; + r1 = r1 - anc; + } + q2 = 2*q2; // update q2 = 2p/abs(d) + r2 = 2*r2; // update r2 = rem(2p/abs(d)) + if (r2 >= ad) { // must be unsigned comparison + q2 = q2 + 1; + r2 = r2 - ad; + } + delta = ad - r2; + } while (q1 < delta || (q1 == delta && r1 == 0)); + + mag.m = (int32_t)(q2 + 1); // make sure to sign extend + if (d < 0) mag.m = -mag.m; // resulting magic number + mag.s = p - 32; // resulting shift + return mag; +} + +/// magicu - calculate the magic numbers required to codegen an integer udiv as +/// a sequence of multiply, add and shifts. Requires that the divisor not be 0. +static mu magicu32(uint32_t d) { + int32_t p; + uint32_t nc, delta, q1, r1, q2, r2; + struct mu magu; + magu.a = 0; // initialize "add" indicator + nc = - 1 - (-d)%d; + p = 31; // initialize p + q1 = 0x80000000/nc; // initialize q1 = 2p/nc + r1 = 0x80000000 - q1*nc; // initialize r1 = rem(2p,nc) + q2 = 0x7FFFFFFF/d; // initialize q2 = (2p-1)/d + r2 = 0x7FFFFFFF - q2*d; // initialize r2 = rem((2p-1),d) + do { + p = p + 1; + if (r1 >= nc - r1 ) { + q1 = 2*q1 + 1; // update q1 + r1 = 2*r1 - nc; // update r1 + } + else { + q1 = 2*q1; // update q1 + r1 = 2*r1; // update r1 + } + if (r2 + 1 >= d - r2) { + if (q2 >= 0x7FFFFFFF) magu.a = 1; + q2 = 2*q2 + 1; // update q2 + r2 = 2*r2 + 1 - d; // update r2 + } + else { + if (q2 >= 0x80000000) magu.a = 1; + q2 = 2*q2; // update q2 + r2 = 2*r2 + 1; // update r2 + } + delta = d - 1 - r2; + } while (p < 64 && (q1 < delta || (q1 == delta && r1 == 0))); + magu.m = q2 + 1; // resulting magic number + magu.s = p - 32; // resulting shift + return magu; +} + +/// magic - calculate the magic numbers required to codegen an integer sdiv as +/// a sequence of multiply and shifts. Requires that the divisor not be 0, 1, +/// or -1. +static ms magic64(int64_t d) { + int64_t p; + uint64_t ad, anc, delta, q1, r1, q2, r2, t; + const uint64_t two63 = 9223372036854775808ULL; // 2^63 + struct ms mag; + + ad = llabs(d); + t = two63 + ((uint64_t)d >> 63); + anc = t - 1 - t%ad; // absolute value of nc + p = 63; // initialize p + q1 = two63/anc; // initialize q1 = 2p/abs(nc) + r1 = two63 - q1*anc; // initialize r1 = rem(2p,abs(nc)) + q2 = two63/ad; // initialize q2 = 2p/abs(d) + r2 = two63 - q2*ad; // initialize r2 = rem(2p,abs(d)) + do { + p = p + 1; + q1 = 2*q1; // update q1 = 2p/abs(nc) + r1 = 2*r1; // update r1 = rem(2p/abs(nc)) + if (r1 >= anc) { // must be unsigned comparison + q1 = q1 + 1; + r1 = r1 - anc; + } + q2 = 2*q2; // update q2 = 2p/abs(d) + r2 = 2*r2; // update r2 = rem(2p/abs(d)) + if (r2 >= ad) { // must be unsigned comparison + q2 = q2 + 1; + r2 = r2 - ad; + } + delta = ad - r2; + } while (q1 < delta || (q1 == delta && r1 == 0)); + + mag.m = q2 + 1; + if (d < 0) mag.m = -mag.m; // resulting magic number + mag.s = p - 64; // resulting shift + return mag; +} + +/// magicu - calculate the magic numbers required to codegen an integer udiv as +/// a sequence of multiply, add and shifts. Requires that the divisor not be 0. +static mu magicu64(uint64_t d) +{ + int64_t p; + uint64_t nc, delta, q1, r1, q2, r2; + struct mu magu; + magu.a = 0; // initialize "add" indicator + nc = - 1 - (-d)%d; + p = 63; // initialize p + q1 = 0x8000000000000000ull/nc; // initialize q1 = 2p/nc + r1 = 0x8000000000000000ull - q1*nc; // initialize r1 = rem(2p,nc) + q2 = 0x7FFFFFFFFFFFFFFFull/d; // initialize q2 = (2p-1)/d + r2 = 0x7FFFFFFFFFFFFFFFull - q2*d; // initialize r2 = rem((2p-1),d) + do { + p = p + 1; + if (r1 >= nc - r1 ) { + q1 = 2*q1 + 1; // update q1 + r1 = 2*r1 - nc; // update r1 + } + else { + q1 = 2*q1; // update q1 + r1 = 2*r1; // update r1 + } + if (r2 + 1 >= d - r2) { + if (q2 >= 0x7FFFFFFFFFFFFFFFull) magu.a = 1; + q2 = 2*q2 + 1; // update q2 + r2 = 2*r2 + 1 - d; // update r2 + } + else { + if (q2 >= 0x8000000000000000ull) magu.a = 1; + q2 = 2*q2; // update q2 + r2 = 2*r2 + 1; // update r2 + } + delta = d - 1 - r2; + } while (p < 64 && (q1 < delta || (q1 == delta && r1 == 0))); + magu.m = q2 + 1; // resulting magic number + magu.s = p - 64; // resulting shift + return magu; +} + /// MaskedValueIsZero - Return true if 'Op & Mask' is known to be zero. We use /// this predicate to simplify operations downstream. Op and Mask are known to /// be the same type. @@ -608,12 +783,23 @@ if (MaskedValueIsZero(N1, SignBit, TLI) && MaskedValueIsZero(N0, SignBit, TLI)) return DAG.getNode(ISD::UDIV, N1.getValueType(), N0, N1); + // if integer divide is expensive and we satisfy the requirements, emit an + // alternate sequence. + // FIXME: This currently opts out powers of two, since targets can often be + // more clever in those cases. In an idea world, we would have some way to + // detect that too. + if (N1C && !isPowerOf2_64(N1C->getSignExtended()) && + (N1C->getSignExtended() < -1 || N1C->getSignExtended() > 1) && + TLI.isOperationLegal(ISD::MULHS, VT) && TLI.isIntDivExpensive()) { + return BuildSDIV(N); + } return SDOperand(); } SDOperand DAGCombiner::visitUDIV(SDNode *N) { SDOperand N0 = N->getOperand(0); SDOperand N1 = N->getOperand(1); + MVT::ValueType VT = N->getValueType(0); ConstantSDNode *N0C = dyn_cast(N0.Val); ConstantSDNode *N1C = dyn_cast(N1.Val); @@ -626,6 +812,10 @@ return DAG.getNode(ISD::SRL, N->getValueType(0), N0, DAG.getConstant(Log2_64(N1C->getValue()), TLI.getShiftAmountTy())); + // fold (udiv x, c) -> alternate + if (N1C && N1C->getValue() && TLI.isOperationLegal(ISD::MULHU, VT) && + TLI.isIntDivExpensive()) + return BuildUDIV(N); return SDOperand(); } @@ -2356,6 +2546,79 @@ return SDOperand(); } +/// BuildSDIVSequence - Given an ISD::SDIV node expressing a divide by constant, +/// return a DAG expression to select that will generate the same value by +/// multiplying by a magic number. See: +/// +SDOperand DAGCombiner::BuildSDIV(SDNode *N) { + MVT::ValueType VT = N->getValueType(0); + assert((VT == MVT::i32 || VT == MVT::i64) && + "BuildSDIV only operates on i32 or i64!"); + + int64_t d = cast(N->getOperand(1))->getValue(); + ms magics = (VT == MVT::i32) ? magic32(d) : magic64(d); + + // Multiply the numerator (operand 0) by the magic value + SDOperand Q = DAG.getNode(ISD::MULHS, VT, N->getOperand(0), + DAG.getConstant(magics.m, VT)); + // If d > 0 and m < 0, add the numerator + if (d > 0 && magics.m < 0) { + Q = DAG.getNode(ISD::ADD, VT, Q, N->getOperand(0)); + WorkList.push_back(Q.Val); + } + // If d < 0 and m > 0, subtract the numerator. + if (d < 0 && magics.m > 0) { + Q = DAG.getNode(ISD::SUB, VT, Q, N->getOperand(0)); + WorkList.push_back(Q.Val); + } + // Shift right algebraic if shift value is nonzero + if (magics.s > 0) { + Q = DAG.getNode(ISD::SRA, VT, Q, + DAG.getConstant(magics.s, TLI.getShiftAmountTy())); + WorkList.push_back(Q.Val); + } + // Extract the sign bit and add it to the quotient + SDOperand T = + DAG.getNode(ISD::SRL, MVT::i32, Q, + DAG.getConstant(MVT::getSizeInBits(VT)-1, + TLI.getShiftAmountTy())); + WorkList.push_back(T.Val); + return DAG.getNode(ISD::ADD, VT, Q, T); +} + +/// BuildUDIVSequence - Given an ISD::UDIV node expressing a divide by constant, +/// return a DAG expression to select that will generate the same value by +/// multiplying by a magic number. See: +/// +SDOperand DAGCombiner::BuildUDIV(SDNode *N) { + MVT::ValueType VT = N->getValueType(0); + assert((VT == MVT::i32 || VT == MVT::i64) && + "BuildUDIV only operates on i32 or i64!"); + + uint64_t d = cast(N->getOperand(1))->getValue(); + mu magics = (VT == MVT::i32) ? magicu32(d) : magicu64(d); + + // Multiply the numerator (operand 0) by the magic value + SDOperand Q = DAG.getNode(ISD::MULHU, VT, N->getOperand(0), + DAG.getConstant(magics.m, VT)); + WorkList.push_back(Q.Val); + + if (magics.a == 0) { + return DAG.getNode(ISD::SRL, VT, Q, + DAG.getConstant(magics.s, TLI.getShiftAmountTy())); + } else { + SDOperand NPQ = DAG.getNode(ISD::SUB, VT, N->getOperand(0), Q); + WorkList.push_back(NPQ.Val); + NPQ = DAG.getNode(ISD::SRL, VT, NPQ, + DAG.getConstant(1, TLI.getShiftAmountTy())); + WorkList.push_back(NPQ.Val); + NPQ = DAG.getNode(ISD::ADD, VT, NPQ, Q); + WorkList.push_back(NPQ.Val); + return DAG.getNode(ISD::SRL, VT, NPQ, + DAG.getConstant(magics.s-1, TLI.getShiftAmountTy())); + } +} + // SelectionDAG::Combine - This is the entry point for the file. // void SelectionDAG::Combine(bool RunningAfterLegalize) { From lattner at cs.uiuc.edu Wed Oct 19 22:57:15 2005 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Wed, 19 Oct 2005 22:57:15 -0500 Subject: [llvm-commits] CVS: llvm/lib/Target/Alpha/AlphaInstrInfo.td Message-ID: <200510200357.WAA26936@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/Alpha: AlphaInstrInfo.td updated: 1.60 -> 1.61 --- Log message: simplify this a bit by using immediates --- Diffs of the changes: (+16 -24) AlphaInstrInfo.td | 40 ++++++++++++++++------------------------ 1 files changed, 16 insertions(+), 24 deletions(-) Index: llvm/lib/Target/Alpha/AlphaInstrInfo.td diff -u llvm/lib/Target/Alpha/AlphaInstrInfo.td:1.60 llvm/lib/Target/Alpha/AlphaInstrInfo.td:1.61 --- llvm/lib/Target/Alpha/AlphaInstrInfo.td:1.60 Wed Oct 19 19:28:31 2005 +++ llvm/lib/Target/Alpha/AlphaInstrInfo.td Wed Oct 19 22:57:03 2005 @@ -20,14 +20,6 @@ // field. Used by instructions like 'addi'. return (unsigned long)N->getValue() == (unsigned char)N->getValue(); }]>; -def imm2 : PatLeaf<(imm), [{ - // imm2 predicate - True if the immediate is a 2 - return N->getValue() == 2; -}]>; -def imm3 : PatLeaf<(imm), [{ - // imm3 predicate - True if the immediate is a 3 - return N->getValue() == 3; -}]>; // //#define FP $15 @@ -217,37 +209,37 @@ def ORNOTi : OFormL<0x11, 0x28, "ornot $RA,$L,$RC", []>; // [(set GPRC:$RC, (or GPRC:$RA, (not immUExt8:$L)))]>; def S4ADDL : OForm< 0x10, 0x02, "s4addl $RA,$RB,$RC", - [(set GPRC:$RC, (sext_inreg (add (shl GPRC:$RA, imm2), GPRC:$RB), i32))]>; + [(set GPRC:$RC, (sext_inreg (add (shl GPRC:$RA, 2), GPRC:$RB), i32))]>; def S4ADDLi : OFormL<0x10, 0x02, "s4addl $RA,$L,$RC", - [(set GPRC:$RC, (sext_inreg (add (shl GPRC:$RA, imm2), immUExt8:$L), i32))]>; + [(set GPRC:$RC, (sext_inreg (add (shl GPRC:$RA, 2), immUExt8:$L), i32))]>; def S4ADDQ : OForm< 0x10, 0x22, "s4addq $RA,$RB,$RC", - [(set GPRC:$RC, (add (shl GPRC:$RA, imm2), GPRC:$RB))]>; + [(set GPRC:$RC, (add (shl GPRC:$RA, 2), GPRC:$RB))]>; def S4ADDQi : OFormL<0x10, 0x22, "s4addq $RA,$L,$RC", - [(set GPRC:$RC, (add (shl GPRC:$RA, imm2), immUExt8:$L))]>; + [(set GPRC:$RC, (add (shl GPRC:$RA, 2), immUExt8:$L))]>; def S4SUBL : OForm< 0x10, 0x0B, "s4subl $RA,$RB,$RC", - [(set GPRC:$RC, (sext_inreg (sub (shl GPRC:$RA, imm2), GPRC:$RB), i32))]>; + [(set GPRC:$RC, (sext_inreg (sub (shl GPRC:$RA, 2), GPRC:$RB), i32))]>; def S4SUBLi : OFormL<0x10, 0x0B, "s4subl $RA,$L,$RC", - [(set GPRC:$RC, (sext_inreg (sub (shl GPRC:$RA, imm2), immUExt8:$L), i32))]>; + [(set GPRC:$RC, (sext_inreg (sub (shl GPRC:$RA, 2), immUExt8:$L), i32))]>; def S4SUBQ : OForm< 0x10, 0x2B, "s4subq $RA,$RB,$RC", - [(set GPRC:$RC, (sub (shl GPRC:$RA, imm2), GPRC:$RB))]>; + [(set GPRC:$RC, (sub (shl GPRC:$RA, 2), GPRC:$RB))]>; def S4SUBQi : OFormL<0x10, 0x2B, "s4subq $RA,$L,$RC", - [(set GPRC:$RC, (sub (shl GPRC:$RA, imm2), immUExt8:$L))]>; + [(set GPRC:$RC, (sub (shl GPRC:$RA, 2), immUExt8:$L))]>; def S8ADDL : OForm< 0x10, 0x12, "s8addl $RA,$RB,$RC", - [(set GPRC:$RC, (sext_inreg (add (shl GPRC:$RA, imm3), GPRC:$RB), i32))]>; + [(set GPRC:$RC, (sext_inreg (add (shl GPRC:$RA, 3), GPRC:$RB), i32))]>; def S8ADDLi : OFormL<0x10, 0x12, "s8addl $RA,$L,$RC", - [(set GPRC:$RC, (sext_inreg (add (shl GPRC:$RA, imm3), immUExt8:$L), i32))]>; + [(set GPRC:$RC, (sext_inreg (add (shl GPRC:$RA, 3), immUExt8:$L), i32))]>; def S8ADDQ : OForm< 0x10, 0x32, "s8addq $RA,$RB,$RC", - [(set GPRC:$RC, (add (shl GPRC:$RA, imm3), GPRC:$RB))]>; + [(set GPRC:$RC, (add (shl GPRC:$RA, 3), GPRC:$RB))]>; def S8ADDQi : OFormL<0x10, 0x32, "s8addq $RA,$L,$RC", - [(set GPRC:$RC, (add (shl GPRC:$RA, imm3), immUExt8:$L))]>; + [(set GPRC:$RC, (add (shl GPRC:$RA, 3), immUExt8:$L))]>; def S8SUBL : OForm< 0x10, 0x1B, "s8subl $RA,$RB,$RC", - [(set GPRC:$RC, (sext_inreg (sub (shl GPRC:$RA, imm3), GPRC:$RB), i32))]>; + [(set GPRC:$RC, (sext_inreg (sub (shl GPRC:$RA, 3), GPRC:$RB), i32))]>; def S8SUBLi : OFormL<0x10, 0x1B, "s8subl $RA,$L,$RC", - [(set GPRC:$RC, (sext_inreg (sub (shl GPRC:$RA, imm3), immUExt8:$L), i32))]>; + [(set GPRC:$RC, (sext_inreg (sub (shl GPRC:$RA, 3), immUExt8:$L), i32))]>; def S8SUBQ : OForm< 0x10, 0x3B, "s8subq $RA,$RB,$RC", - [(set GPRC:$RC, (sub (shl GPRC:$RA, imm3), GPRC:$RB))]>; + [(set GPRC:$RC, (sub (shl GPRC:$RA, 3), GPRC:$RB))]>; def S8SUBQi : OFormL<0x10, 0x3B, "s8subq $RA,$L,$RC", - [(set GPRC:$RC, (sub (shl GPRC:$RA, imm3), immUExt8:$L))]>; + [(set GPRC:$RC, (sub (shl GPRC:$RA, 3), immUExt8:$L))]>; def SEXTB : OForm< 0x1C, 0x00, "sextb $RB,$RC", []>; //Sign extend byte def SEXTW : OForm< 0x1C, 0x01, "sextw $RB,$RC", []>; //Sign extend word From lattner at cs.uiuc.edu Wed Oct 19 23:21:17 2005 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Wed, 19 Oct 2005 23:21:17 -0500 Subject: [llvm-commits] CVS: llvm/lib/Target/Alpha/AlphaInstrInfo.td Message-ID: <200510200421.XAA27106@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/Alpha: AlphaInstrInfo.td updated: 1.61 -> 1.62 --- Log message: Add some pattern fragments to simplify the repetitive parts of the patterns for some common ops and use them for a few examples. Andrew, if you like this, feel free to convert the rest over, if you hate it, feel free to revert. --- Diffs of the changes: (+22 -3) AlphaInstrInfo.td | 25 ++++++++++++++++++++++--- 1 files changed, 22 insertions(+), 3 deletions(-) Index: llvm/lib/Target/Alpha/AlphaInstrInfo.td diff -u llvm/lib/Target/Alpha/AlphaInstrInfo.td:1.61 llvm/lib/Target/Alpha/AlphaInstrInfo.td:1.62 --- llvm/lib/Target/Alpha/AlphaInstrInfo.td:1.61 Wed Oct 19 22:57:03 2005 +++ llvm/lib/Target/Alpha/AlphaInstrInfo.td Wed Oct 19 23:21:06 2005 @@ -196,8 +196,23 @@ //def MSKWHi : OFormL<0x12, 0x52, "MSKWH $RA,$L,$RC", []>; //Mask word high //def MSKWL : OForm< 0x12, 0x12, "MSKWL $RA,$RB,$RC", []>; //Mask word low //def MSKWLi : OFormL<0x12, 0x12, "MSKWL $RA,$L,$RC", []>; //Mask word low + +// Some Alpha pattern fragments to make things more terse and easier to read. +def intop : PatFrag<(ops node:$op), (sext_inreg node:$op, i32)>; +def add4 : PatFrag<(ops node:$op1, node:$op2), + (add (shl node:$op1, 2), node:$op2)>; +def sub4 : PatFrag<(ops node:$op1, node:$op2), + (sub (shl node:$op1, 2), node:$op2)>; +def add8 : PatFrag<(ops node:$op1, node:$op2), + (add (shl node:$op1, 3), node:$op2)>; +def sub8 : PatFrag<(ops node:$op1, node:$op2), + (sub (shl node:$op1, 3), node:$op2)>; + def MULL : OForm< 0x13, 0x00, "mull $RA,$RB,$RC", - [(set GPRC:$RC, (sext_inreg (mul GPRC:$RA, GPRC:$RB), i32))]>; + [(set GPRC:$RC, (intop (mul GPRC:$RA, GPRC:$RB)))]>; + +//def MULL : OForm< 0x13, 0x00, "mull $RA,$RB,$RC", +// [(set GPRC:$RC, (sext_inreg (mul GPRC:$RA, GPRC:$RB), i32))]>; def MULLi : OFormL<0x13, 0x00, "mull $RA,$L,$RC", [(set GPRC:$RC, (sext_inreg (mul GPRC:$RA, immUExt8:$L), i32))]>; def MULQ : OForm< 0x13, 0x20, "mulq $RA,$RB,$RC", @@ -208,8 +223,10 @@ [(set GPRC:$RC, (or GPRC:$RA, (not GPRC:$RB)))]>; def ORNOTi : OFormL<0x11, 0x28, "ornot $RA,$L,$RC", []>; // [(set GPRC:$RC, (or GPRC:$RA, (not immUExt8:$L)))]>; +//def S4ADDL : OForm< 0x10, 0x02, "s4addl $RA,$RB,$RC", +// [(set GPRC:$RC, (sext_inreg (add (shl GPRC:$RA, 2), GPRC:$RB), i32))]>; def S4ADDL : OForm< 0x10, 0x02, "s4addl $RA,$RB,$RC", - [(set GPRC:$RC, (sext_inreg (add (shl GPRC:$RA, 2), GPRC:$RB), i32))]>; + [(set GPRC:$RC, (intop (add4 GPRC:$RA, GPRC:$RB)))]>; def S4ADDLi : OFormL<0x10, 0x02, "s4addl $RA,$L,$RC", [(set GPRC:$RC, (sext_inreg (add (shl GPRC:$RA, 2), immUExt8:$L), i32))]>; def S4ADDQ : OForm< 0x10, 0x22, "s4addq $RA,$RB,$RC", @@ -233,7 +250,9 @@ def S8ADDQi : OFormL<0x10, 0x32, "s8addq $RA,$L,$RC", [(set GPRC:$RC, (add (shl GPRC:$RA, 3), immUExt8:$L))]>; def S8SUBL : OForm< 0x10, 0x1B, "s8subl $RA,$RB,$RC", - [(set GPRC:$RC, (sext_inreg (sub (shl GPRC:$RA, 3), GPRC:$RB), i32))]>; + [(set GPRC:$RC, (intop (sub8 GPRC:$RA, GPRC:$RB)))]>; +//def S8SUBL : OForm< 0x10, 0x1B, "s8subl $RA,$RB,$RC", +// [(set GPRC:$RC, (sext_inreg (sub (shl GPRC:$RA, 3), GPRC:$RB), i32))]>; def S8SUBLi : OFormL<0x10, 0x1B, "s8subl $RA,$L,$RC", [(set GPRC:$RC, (sext_inreg (sub (shl GPRC:$RA, 3), immUExt8:$L), i32))]>; def S8SUBQ : OForm< 0x10, 0x3B, "s8subq $RA,$RB,$RC", From lattner at cs.uiuc.edu Wed Oct 19 23:47:21 2005 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Wed, 19 Oct 2005 23:47:21 -0500 Subject: [llvm-commits] CVS: llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp Message-ID: <200510200447.XAA27232@zion.cs.uiuc.edu> Changes in directory llvm/lib/Transforms/Scalar: LoopStrengthReduce.cpp updated: 1.68 -> 1.69 --- Log message: Do NOT touch FP ops with LSR. This fixes a testcase Nate sent me from an inner loop like this: LBB_RateConvertMono8AltiVec_2: ; no_exit lis r2, ha16(.CPI_RateConvertMono8AltiVec_0) lfs f3, lo16(.CPI_RateConvertMono8AltiVec_0)(r2) fmr f3, f3 fadd f0, f2, f0 fadd f3, f0, f3 fcmpu cr0, f3, f1 bge cr0, LBB_RateConvertMono8AltiVec_2 ; no_exit to an inner loop like this: LBB_RateConvertMono8AltiVec_1: ; no_exit fsub f2, f2, f1 fcmpu cr0, f2, f1 fmr f0, f2 bge cr0, LBB_RateConvertMono8AltiVec_1 ; no_exit Doh! good catch! --- Diffs of the changes: (+1 -1) LoopStrengthReduce.cpp | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp diff -u llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp:1.68 llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp:1.69 --- llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp:1.68 Tue Oct 11 13:41:04 2005 +++ llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp Wed Oct 19 23:47:10 2005 @@ -372,7 +372,7 @@ /// return true. Otherwise, return false. bool LoopStrengthReduce::AddUsersIfInteresting(Instruction *I, Loop *L, std::set &Processed) { - if (I->getType() == Type::VoidTy) return false; + if (!I->getType()->isInteger()) return false; if (!Processed.insert(I).second) return true; // Instruction already handled. From lattner at cs.uiuc.edu Thu Oct 20 01:06:42 2005 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Thu, 20 Oct 2005 01:06:42 -0500 Subject: [llvm-commits] CVS: llvm/lib/CodeGen/LiveInterval.cpp Message-ID: <200510200606.BAA27522@zion.cs.uiuc.edu> Changes in directory llvm/lib/CodeGen: LiveInterval.cpp updated: 1.22 -> 1.23 --- Log message: Refactor some code, pulling it out into a function. No functionality change. --- Diffs of the changes: (+26 -15) LiveInterval.cpp | 41 ++++++++++++++++++++++++++--------------- 1 files changed, 26 insertions(+), 15 deletions(-) Index: llvm/lib/CodeGen/LiveInterval.cpp diff -u llvm/lib/CodeGen/LiveInterval.cpp:1.22 llvm/lib/CodeGen/LiveInterval.cpp:1.23 --- llvm/lib/CodeGen/LiveInterval.cpp:1.22 Tue Sep 20 23:19:08 2005 +++ llvm/lib/CodeGen/LiveInterval.cpp Thu Oct 20 01:06:30 2005 @@ -101,6 +101,29 @@ return false; } +/// NontrivialOverlap - Check to see if the two live ranges specified by i and j +/// overlap. If so, check to see if they have value numbers that are not +/// iIdx/jIdx respectively. If both conditions are true, return true. +static inline bool NontrivialOverlap(LiveInterval::Ranges::const_iterator i, + LiveInterval::Ranges::const_iterator j, + unsigned iIdx, unsigned jIdx) { + if (i->start == j->start) { + // If this is not the allowed value merge, we cannot join. + if (i->ValId != iIdx || j->ValId != jIdx) + return true; + } else if (i->start < j->start) { + if (i->end > j->start && i->ValId != iIdx || j->ValId != jIdx) { + return true; + } + } else { + if (j->end > i->start && + i->ValId != iIdx || j->ValId != jIdx) + return true; + } + + return false; +} + /// joinable - Two intervals are joinable if the either don't overlap at all /// or if the destination of the copy is a single assignment value, and it /// only overlaps with one value in the source interval. @@ -125,21 +148,9 @@ } while (i != ie && j != je) { - if (i->start == j->start) { - // If this is not the allowed value merge, we cannot join. - if (i->ValId != ThisValIdx || j->ValId != OtherValIdx) - return false; - } else if (i->start < j->start) { - if (i->end > j->start) { - if (i->ValId != ThisValIdx || j->ValId != OtherValIdx) - return false; - } - } else { - if (j->end > i->start) { - if (i->ValId != ThisValIdx || j->ValId != OtherValIdx) - return false; - } - } + if (NontrivialOverlap(i, j, ThisValIdx, OtherValIdx)) + return false; + if (i->end < j->end) ++i; else From lattner at cs.uiuc.edu Thu Oct 20 02:38:10 2005 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Thu, 20 Oct 2005 02:38:10 -0500 Subject: [llvm-commits] CVS: llvm/include/llvm/CodeGen/LiveInterval.h Message-ID: <200510200738.CAA27819@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm/CodeGen: LiveInterval.h updated: 1.14 -> 1.15 --- Log message: add a new method --- Diffs of the changes: (+5 -0) LiveInterval.h | 5 +++++ 1 files changed, 5 insertions(+) Index: llvm/include/llvm/CodeGen/LiveInterval.h diff -u llvm/include/llvm/CodeGen/LiveInterval.h:1.14 llvm/include/llvm/CodeGen/LiveInterval.h:1.15 --- llvm/include/llvm/CodeGen/LiveInterval.h:1.14 Sat May 14 00:34:15 2005 +++ llvm/include/llvm/CodeGen/LiveInterval.h Thu Oct 20 02:37:59 2005 @@ -143,6 +143,11 @@ /// only overlaps with one value in the source interval. bool joinable(const LiveInterval& other, unsigned CopyIdx) const; + /// getOverlapingRanges - Given another live interval which is defined as a + /// copy from this one, return a list of all of the live ranges where the + /// two overlap and have different value numbers. + void getOverlapingRanges(const LiveInterval &Other, unsigned CopyIdx, + std::vector &Ranges); /// overlaps - Return true if the intersection of the two live intervals is /// not empty. From lattner at cs.uiuc.edu Thu Oct 20 02:39:36 2005 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Thu, 20 Oct 2005 02:39:36 -0500 Subject: [llvm-commits] CVS: llvm/lib/CodeGen/LiveInterval.cpp Message-ID: <200510200739.CAA27855@zion.cs.uiuc.edu> Changes in directory llvm/lib/CodeGen: LiveInterval.cpp updated: 1.23 -> 1.24 --- Log message: add a new method, play around with some code. Fix a *bug* in the extendIntervalEndTo method. In particular, if adding [2:10) to an interval containing [0:2),[10:30), we produced [0:10),[10,30). Which is not the most smart thing to do. Now produce [0:30). --- Diffs of the changes: (+56 -10) LiveInterval.cpp | 66 ++++++++++++++++++++++++++++++++++++++++++++++--------- 1 files changed, 56 insertions(+), 10 deletions(-) Index: llvm/lib/CodeGen/LiveInterval.cpp diff -u llvm/lib/CodeGen/LiveInterval.cpp:1.23 llvm/lib/CodeGen/LiveInterval.cpp:1.24 --- llvm/lib/CodeGen/LiveInterval.cpp:1.23 Thu Oct 20 01:06:30 2005 +++ llvm/lib/CodeGen/LiveInterval.cpp Thu Oct 20 02:39:25 2005 @@ -104,20 +104,19 @@ /// NontrivialOverlap - Check to see if the two live ranges specified by i and j /// overlap. If so, check to see if they have value numbers that are not /// iIdx/jIdx respectively. If both conditions are true, return true. -static inline bool NontrivialOverlap(LiveInterval::Ranges::const_iterator i, - LiveInterval::Ranges::const_iterator j, +static inline bool NontrivialOverlap(const LiveRange &I, const LiveRange &J, unsigned iIdx, unsigned jIdx) { - if (i->start == j->start) { + if (I.start == J.start) { // If this is not the allowed value merge, we cannot join. - if (i->ValId != iIdx || j->ValId != jIdx) + if (I.ValId != iIdx || J.ValId != jIdx) return true; - } else if (i->start < j->start) { - if (i->end > j->start && i->ValId != iIdx || j->ValId != jIdx) { + } else if (I.start < J.start) { + if (I.end > J.start && I.ValId != iIdx || J.ValId != jIdx) { return true; } } else { - if (j->end > i->start && - i->ValId != iIdx || j->ValId != jIdx) + if (J.end > I.start && + I.ValId != iIdx || J.ValId != jIdx) return true; } @@ -148,7 +147,7 @@ } while (i != ie && j != je) { - if (NontrivialOverlap(i, j, ThisValIdx, OtherValIdx)) + if (NontrivialOverlap(*i, *j, ThisValIdx, OtherValIdx)) return false; if (i->end < j->end) @@ -160,6 +159,43 @@ return true; } +/// getOverlapingRanges - Given another live interval which is defined as a +/// copy from this one, return a list of all of the live ranges where the +/// two overlap and have different value numbers. +void LiveInterval::getOverlapingRanges(const LiveInterval &other, + unsigned CopyIdx, + std::vector &Ranges) { + const LiveRange *SourceLR = other.getLiveRangeContaining(CopyIdx-1); + const LiveRange *DestLR = getLiveRangeContaining(CopyIdx); + assert(SourceLR && DestLR && "Not joining due to a copy?"); + unsigned OtherValIdx = SourceLR->ValId; + unsigned ThisValIdx = DestLR->ValId; + + Ranges::iterator i = ranges.begin(); + Ranges::iterator ie = ranges.end(); + Ranges::const_iterator j = other.ranges.begin(); + Ranges::const_iterator je = other.ranges.end(); + + if (i->start < j->start) { + i = std::upper_bound(i, ie, j->start); + if (i != ranges.begin()) --i; + } else if (j->start < i->start) { + j = std::upper_bound(j, je, i->start); + if (j != other.ranges.begin()) --j; + } + + while (i != ie && j != je) { + if (NontrivialOverlap(*i, *j, ThisValIdx, OtherValIdx)) + Ranges.push_back(&*i); + + if (i->end < j->end) + ++i; + else + ++j; + } +} + + /// extendIntervalEndTo - This method is used when we want to extend the range /// specified by I to end at the specified endpoint. To do this, we should @@ -178,8 +214,18 @@ // If NewEnd was in the middle of an interval, make sure to get its endpoint. I->end = std::max(NewEnd, prior(MergeTo)->end); - // Erase any dead ranges + // Erase any dead ranges. ranges.erase(next(I), MergeTo); + + // If the newly formed range now touches the range after it and if they have + // the same value number, merge the two ranges into one range. + if (I != ranges.end()) { + Ranges::iterator Next = next(I); + if (Next->start == I->end && Next->ValId == ValId) { + I->end = Next->end; + ranges.erase(Next); + } + } } From natebegeman at mac.com Thu Oct 20 02:51:35 2005 From: natebegeman at mac.com (Nate Begeman) Date: Thu, 20 Oct 2005 02:51:35 -0500 Subject: [llvm-commits] CVS: llvm/lib/Target/PowerPC/PPCInstrInfo.td Message-ID: <200510200751.CAA27888@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/PowerPC: PPCInstrInfo.td updated: 1.130 -> 1.131 --- Log message: Add some more patterns for i64 on ppc --- Diffs of the changes: (+12 -6) PPCInstrInfo.td | 18 ++++++++++++------ 1 files changed, 12 insertions(+), 6 deletions(-) Index: llvm/lib/Target/PowerPC/PPCInstrInfo.td diff -u llvm/lib/Target/PowerPC/PPCInstrInfo.td:1.130 llvm/lib/Target/PowerPC/PPCInstrInfo.td:1.131 --- llvm/lib/Target/PowerPC/PPCInstrInfo.td:1.130 Wed Oct 19 14:51:16 2005 +++ llvm/lib/Target/PowerPC/PPCInstrInfo.td Thu Oct 20 02:51:08 2005 @@ -544,27 +544,33 @@ def ADDE : XOForm_1<31, 138, 0, (ops GPRC:$rT, GPRC:$rA, GPRC:$rB), "adde $rT, $rA, $rB", IntGeneral, []>; -def DIVD : XOForm_1<31, 489, 0, (ops GPRC:$rT, GPRC:$rA, GPRC:$rB), +def DIVD : XOForm_1<31, 489, 0, (ops G8RC:$rT, G8RC:$rA, G8RC:$rB), "divd $rT, $rA, $rB", IntDivD, - []>, isPPC64; -def DIVDU : XOForm_1<31, 457, 0, (ops GPRC:$rT, GPRC:$rA, GPRC:$rB), + [(set G8RC:$rT, (sdiv G8RC:$rA, G8RC:$rB))]>, isPPC64; +def DIVDU : XOForm_1<31, 457, 0, (ops G8RC:$rT, G8RC:$rA, G8RC:$rB), "divdu $rT, $rA, $rB", IntDivD, - []>, isPPC64; + [(set G8RC:$rT, (udiv G8RC:$rA, G8RC:$rB))]>, isPPC64; def DIVW : XOForm_1<31, 491, 0, (ops GPRC:$rT, GPRC:$rA, GPRC:$rB), "divw $rT, $rA, $rB", IntDivW, [(set GPRC:$rT, (sdiv GPRC:$rA, GPRC:$rB))]>; def DIVWU : XOForm_1<31, 459, 0, (ops GPRC:$rT, GPRC:$rA, GPRC:$rB), "divwu $rT, $rA, $rB", IntDivW, [(set GPRC:$rT, (udiv GPRC:$rA, GPRC:$rB))]>; +def MULHD : XOForm_1<31, 73, 0, (ops G8RC:$rT, G8RC:$rA, G8RC:$rB), + "mulhd $rT, $rA, $rB", IntMulHW, + [(set G8RC:$rT, (mulhs G8RC:$rA, G8RC:$rB))]>; +def MULHDU : XOForm_1<31, 9, 0, (ops G8RC:$rT, G8RC:$rA, G8RC:$rB), + "mulhdu $rT, $rA, $rB", IntMulHWU, + [(set G8RC:$rT, (mulhu G8RC:$rA, G8RC:$rB))]>; def MULHW : XOForm_1<31, 75, 0, (ops GPRC:$rT, GPRC:$rA, GPRC:$rB), "mulhw $rT, $rA, $rB", IntMulHW, [(set GPRC:$rT, (mulhs GPRC:$rA, GPRC:$rB))]>; def MULHWU : XOForm_1<31, 11, 0, (ops GPRC:$rT, GPRC:$rA, GPRC:$rB), "mulhwu $rT, $rA, $rB", IntMulHWU, [(set GPRC:$rT, (mulhu GPRC:$rA, GPRC:$rB))]>; -def MULLD : XOForm_1<31, 233, 0, (ops GPRC:$rT, GPRC:$rA, GPRC:$rB), +def MULLD : XOForm_1<31, 233, 0, (ops G8RC:$rT, G8RC:$rA, G8RC:$rB), "mulld $rT, $rA, $rB", IntMulHD, - []>, isPPC64; + [(set G8RC:$rT, (mul G8RC:$rA, G8RC:$rB))]>, isPPC64; def MULLW : XOForm_1<31, 235, 0, (ops GPRC:$rT, GPRC:$rA, GPRC:$rB), "mullw $rT, $rA, $rB", IntMulHW, [(set GPRC:$rT, (mul GPRC:$rA, GPRC:$rB))]>; From alenhar2 at cs.uiuc.edu Thu Oct 20 09:43:06 2005 From: alenhar2 at cs.uiuc.edu (Andrew Lenharth) Date: Thu, 20 Oct 2005 09:43:06 -0500 Subject: [llvm-commits] CVS: llvm/lib/Target/Alpha/AlphaInstrInfo.td Message-ID: <200510201443.JAA28235@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/Alpha: AlphaInstrInfo.td updated: 1.62 -> 1.63 --- Log message: Sounds good, finish the intop conversion. --- Diffs of the changes: (+20 -27) AlphaInstrInfo.td | 47 ++++++++++++++++++++--------------------------- 1 files changed, 20 insertions(+), 27 deletions(-) Index: llvm/lib/Target/Alpha/AlphaInstrInfo.td diff -u llvm/lib/Target/Alpha/AlphaInstrInfo.td:1.62 llvm/lib/Target/Alpha/AlphaInstrInfo.td:1.63 --- llvm/lib/Target/Alpha/AlphaInstrInfo.td:1.62 Wed Oct 19 23:21:06 2005 +++ llvm/lib/Target/Alpha/AlphaInstrInfo.td Thu Oct 20 09:42:48 2005 @@ -20,6 +20,7 @@ // field. Used by instructions like 'addi'. return (unsigned long)N->getValue() == (unsigned char)N->getValue(); }]>; +def intop : PatFrag<(ops node:$op), (sext_inreg node:$op, i32)>; // //#define FP $15 @@ -123,9 +124,9 @@ } def ADDL : OForm< 0x10, 0x00, "addl $RA,$RB,$RC", - [(set GPRC:$RC, (sext_inreg (add GPRC:$RA, GPRC:$RB), i32))]>; + [(set GPRC:$RC, (intop (add GPRC:$RA, GPRC:$RB)))]>; def ADDLi : OFormL<0x10, 0x00, "addl $RA,$L,$RC", - [(set GPRC:$RC, (sext_inreg (add GPRC:$RA, immUExt8:$L), i32))]>; + [(set GPRC:$RC, (intop (add GPRC:$RA, immUExt8:$L)))]>; def ADDQ : OForm< 0x10, 0x20, "addq $RA,$RB,$RC", [(set GPRC:$RC, (add GPRC:$RA, GPRC:$RB))]>; def ADDQi : OFormL<0x10, 0x20, "addq $RA,$L,$RC", @@ -198,7 +199,6 @@ //def MSKWLi : OFormL<0x12, 0x12, "MSKWL $RA,$L,$RC", []>; //Mask word low // Some Alpha pattern fragments to make things more terse and easier to read. -def intop : PatFrag<(ops node:$op), (sext_inreg node:$op, i32)>; def add4 : PatFrag<(ops node:$op1, node:$op2), (add (shl node:$op1, 2), node:$op2)>; def sub4 : PatFrag<(ops node:$op1, node:$op2), @@ -210,11 +210,8 @@ def MULL : OForm< 0x13, 0x00, "mull $RA,$RB,$RC", [(set GPRC:$RC, (intop (mul GPRC:$RA, GPRC:$RB)))]>; - -//def MULL : OForm< 0x13, 0x00, "mull $RA,$RB,$RC", -// [(set GPRC:$RC, (sext_inreg (mul GPRC:$RA, GPRC:$RB), i32))]>; def MULLi : OFormL<0x13, 0x00, "mull $RA,$L,$RC", - [(set GPRC:$RC, (sext_inreg (mul GPRC:$RA, immUExt8:$L), i32))]>; + [(set GPRC:$RC, (intop (mul GPRC:$RA, immUExt8:$L)))]>; def MULQ : OForm< 0x13, 0x20, "mulq $RA,$RB,$RC", [(set GPRC:$RC, (mul GPRC:$RA, GPRC:$RB))]>; def MULQi : OFormL<0x13, 0x20, "mulq $RA,$L,$RC", @@ -223,42 +220,38 @@ [(set GPRC:$RC, (or GPRC:$RA, (not GPRC:$RB)))]>; def ORNOTi : OFormL<0x11, 0x28, "ornot $RA,$L,$RC", []>; // [(set GPRC:$RC, (or GPRC:$RA, (not immUExt8:$L)))]>; -//def S4ADDL : OForm< 0x10, 0x02, "s4addl $RA,$RB,$RC", -// [(set GPRC:$RC, (sext_inreg (add (shl GPRC:$RA, 2), GPRC:$RB), i32))]>; def S4ADDL : OForm< 0x10, 0x02, "s4addl $RA,$RB,$RC", [(set GPRC:$RC, (intop (add4 GPRC:$RA, GPRC:$RB)))]>; def S4ADDLi : OFormL<0x10, 0x02, "s4addl $RA,$L,$RC", - [(set GPRC:$RC, (sext_inreg (add (shl GPRC:$RA, 2), immUExt8:$L), i32))]>; + [(set GPRC:$RC, (intop (add4 GPRC:$RA, immUExt8:$L)))]>; def S4ADDQ : OForm< 0x10, 0x22, "s4addq $RA,$RB,$RC", - [(set GPRC:$RC, (add (shl GPRC:$RA, 2), GPRC:$RB))]>; + [(set GPRC:$RC, (add4 GPRC:$RA, GPRC:$RB))]>; def S4ADDQi : OFormL<0x10, 0x22, "s4addq $RA,$L,$RC", - [(set GPRC:$RC, (add (shl GPRC:$RA, 2), immUExt8:$L))]>; + [(set GPRC:$RC, (add4 GPRC:$RA, immUExt8:$L))]>; def S4SUBL : OForm< 0x10, 0x0B, "s4subl $RA,$RB,$RC", - [(set GPRC:$RC, (sext_inreg (sub (shl GPRC:$RA, 2), GPRC:$RB), i32))]>; + [(set GPRC:$RC, (intop (sub4 GPRC:$RA, GPRC:$RB)))]>; def S4SUBLi : OFormL<0x10, 0x0B, "s4subl $RA,$L,$RC", - [(set GPRC:$RC, (sext_inreg (sub (shl GPRC:$RA, 2), immUExt8:$L), i32))]>; + [(set GPRC:$RC, (intop (sub4 GPRC:$RA, immUExt8:$L)))]>; def S4SUBQ : OForm< 0x10, 0x2B, "s4subq $RA,$RB,$RC", - [(set GPRC:$RC, (sub (shl GPRC:$RA, 2), GPRC:$RB))]>; + [(set GPRC:$RC, (sub4 GPRC:$RA, GPRC:$RB))]>; def S4SUBQi : OFormL<0x10, 0x2B, "s4subq $RA,$L,$RC", - [(set GPRC:$RC, (sub (shl GPRC:$RA, 2), immUExt8:$L))]>; + [(set GPRC:$RC, (sub4 GPRC:$RA, immUExt8:$L))]>; def S8ADDL : OForm< 0x10, 0x12, "s8addl $RA,$RB,$RC", - [(set GPRC:$RC, (sext_inreg (add (shl GPRC:$RA, 3), GPRC:$RB), i32))]>; + [(set GPRC:$RC, (intop (add8 GPRC:$RA, GPRC:$RB)))]>; def S8ADDLi : OFormL<0x10, 0x12, "s8addl $RA,$L,$RC", - [(set GPRC:$RC, (sext_inreg (add (shl GPRC:$RA, 3), immUExt8:$L), i32))]>; + [(set GPRC:$RC, (intop (add8 GPRC:$RA, immUExt8:$L)))]>; def S8ADDQ : OForm< 0x10, 0x32, "s8addq $RA,$RB,$RC", - [(set GPRC:$RC, (add (shl GPRC:$RA, 3), GPRC:$RB))]>; + [(set GPRC:$RC, (add8 GPRC:$RA, GPRC:$RB))]>; def S8ADDQi : OFormL<0x10, 0x32, "s8addq $RA,$L,$RC", - [(set GPRC:$RC, (add (shl GPRC:$RA, 3), immUExt8:$L))]>; + [(set GPRC:$RC, (add8 GPRC:$RA, immUExt8:$L))]>; def S8SUBL : OForm< 0x10, 0x1B, "s8subl $RA,$RB,$RC", [(set GPRC:$RC, (intop (sub8 GPRC:$RA, GPRC:$RB)))]>; -//def S8SUBL : OForm< 0x10, 0x1B, "s8subl $RA,$RB,$RC", -// [(set GPRC:$RC, (sext_inreg (sub (shl GPRC:$RA, 3), GPRC:$RB), i32))]>; def S8SUBLi : OFormL<0x10, 0x1B, "s8subl $RA,$L,$RC", - [(set GPRC:$RC, (sext_inreg (sub (shl GPRC:$RA, 3), immUExt8:$L), i32))]>; + [(set GPRC:$RC, (intop (sub8 GPRC:$RA, immUExt8:$L)))]>; def S8SUBQ : OForm< 0x10, 0x3B, "s8subq $RA,$RB,$RC", - [(set GPRC:$RC, (sub (shl GPRC:$RA, 3), GPRC:$RB))]>; + [(set GPRC:$RC, (sub8 GPRC:$RA, GPRC:$RB))]>; def S8SUBQi : OFormL<0x10, 0x3B, "s8subq $RA,$L,$RC", - [(set GPRC:$RC, (sub (shl GPRC:$RA, 3), immUExt8:$L))]>; + [(set GPRC:$RC, (sub8 GPRC:$RA, immUExt8:$L))]>; def SEXTB : OForm< 0x1C, 0x00, "sextb $RB,$RC", []>; //Sign extend byte def SEXTW : OForm< 0x1C, 0x01, "sextw $RB,$RC", []>; //Sign extend word @@ -276,9 +269,9 @@ def SRLi : OFormL<0x12, 0x34, "srl $RA,$L,$RC", [(set GPRC:$RC, (srl GPRC:$RA, immUExt8:$L))]>; def SUBL : OForm< 0x10, 0x09, "subl $RA,$RB,$RC", - [(set GPRC:$RC, (sext_inreg (sub GPRC:$RA, GPRC:$RB), i32))]>; + [(set GPRC:$RC, (intop (sub GPRC:$RA, GPRC:$RB)))]>; def SUBLi : OFormL<0x10, 0x09, "subl $RA,$L,$RC", - [(set GPRC:$RC, (sext_inreg (sub GPRC:$RA, immUExt8:$L), i32))]>; + [(set GPRC:$RC, (intop (sub GPRC:$RA, immUExt8:$L)))]>; def SUBQ : OForm< 0x10, 0x29, "subq $RA,$RB,$RC", [(set GPRC:$RC, (sub GPRC:$RA, GPRC:$RB))]>; def SUBQi : OFormL<0x10, 0x29, "subq $RA,$L,$RC", From lattner at cs.uiuc.edu Thu Oct 20 11:57:00 2005 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Thu, 20 Oct 2005 11:57:00 -0500 Subject: [llvm-commits] CVS: llvm/lib/CodeGen/LiveInterval.cpp Message-ID: <200510201657.LAA29070@zion.cs.uiuc.edu> Changes in directory llvm/lib/CodeGen: LiveInterval.cpp updated: 1.24 -> 1.25 --- Log message: Fix order of eval problem from when I refactored this into a function. --- Diffs of the changes: (+2 -3) LiveInterval.cpp | 5 ++--- 1 files changed, 2 insertions(+), 3 deletions(-) Index: llvm/lib/CodeGen/LiveInterval.cpp diff -u llvm/lib/CodeGen/LiveInterval.cpp:1.24 llvm/lib/CodeGen/LiveInterval.cpp:1.25 --- llvm/lib/CodeGen/LiveInterval.cpp:1.24 Thu Oct 20 02:39:25 2005 +++ llvm/lib/CodeGen/LiveInterval.cpp Thu Oct 20 11:56:40 2005 @@ -111,12 +111,11 @@ if (I.ValId != iIdx || J.ValId != jIdx) return true; } else if (I.start < J.start) { - if (I.end > J.start && I.ValId != iIdx || J.ValId != jIdx) { + if (I.end > J.start && (I.ValId != iIdx || J.ValId != jIdx)) { return true; } } else { - if (J.end > I.start && - I.ValId != iIdx || J.ValId != jIdx) + if (J.end > I.start && (I.ValId != iIdx || J.ValId != jIdx)) return true; } From lattner at cs.uiuc.edu Thu Oct 20 12:01:12 2005 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Thu, 20 Oct 2005 12:01:12 -0500 Subject: [llvm-commits] CVS: llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp Message-ID: <200510201701.MAA29150@zion.cs.uiuc.edu> Changes in directory llvm/lib/CodeGen/SelectionDAG: DAGCombiner.cpp updated: 1.48 -> 1.49 --- Log message: don't use llabs with apparently VC++ doesn't have --- Diffs of the changes: (+1 -1) DAGCombiner.cpp | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp diff -u llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp:1.48 llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp:1.49 --- llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp:1.48 Wed Oct 19 21:15:44 2005 +++ llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp Thu Oct 20 12:01:00 2005 @@ -292,7 +292,7 @@ const uint64_t two63 = 9223372036854775808ULL; // 2^63 struct ms mag; - ad = llabs(d); + ad = d >= 0 ? d : -d; t = two63 + ((uint64_t)d >> 63); anc = t - 1 - t%ad; // absolute value of nc p = 63; // initialize p From natebegeman at mac.com Thu Oct 20 12:45:14 2005 From: natebegeman at mac.com (Nate Begeman) Date: Thu, 20 Oct 2005 12:45:14 -0500 Subject: [llvm-commits] CVS: llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp Message-ID: <200510201745.MAA29493@zion.cs.uiuc.edu> Changes in directory llvm/lib/CodeGen/SelectionDAG: DAGCombiner.cpp updated: 1.49 -> 1.50 --- Log message: Fix a couple bugs in the const div stuff where we'd generate MULHS/MULHU for types that aren't legal, and fail a divisor is less than zero comparison, which would cause us to drop a subtract. --- Diffs of the changes: (+4 -3) DAGCombiner.cpp | 7 ++++--- 1 files changed, 4 insertions(+), 3 deletions(-) Index: llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp diff -u llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp:1.49 llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp:1.50 --- llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp:1.49 Thu Oct 20 12:01:00 2005 +++ llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp Thu Oct 20 12:45:03 2005 @@ -790,7 +790,8 @@ // detect that too. if (N1C && !isPowerOf2_64(N1C->getSignExtended()) && (N1C->getSignExtended() < -1 || N1C->getSignExtended() > 1) && - TLI.isOperationLegal(ISD::MULHS, VT) && TLI.isIntDivExpensive()) { + TLI.isOperationLegal(ISD::MULHS, VT) && TLI.isTypeLegal(VT) && + TLI.isIntDivExpensive()) { return BuildSDIV(N); } return SDOperand(); @@ -814,7 +815,7 @@ TLI.getShiftAmountTy())); // fold (udiv x, c) -> alternate if (N1C && N1C->getValue() && TLI.isOperationLegal(ISD::MULHU, VT) && - TLI.isIntDivExpensive()) + TLI.isTypeLegal(VT) && TLI.isIntDivExpensive()) return BuildUDIV(N); return SDOperand(); } @@ -2555,7 +2556,7 @@ assert((VT == MVT::i32 || VT == MVT::i64) && "BuildSDIV only operates on i32 or i64!"); - int64_t d = cast(N->getOperand(1))->getValue(); + int64_t d = cast(N->getOperand(1))->getSignExtended(); ms magics = (VT == MVT::i32) ? magic32(d) : magic64(d); // Multiply the numerator (operand 0) by the magic value From alenhar2 at cs.uiuc.edu Thu Oct 20 14:38:23 2005 From: alenhar2 at cs.uiuc.edu (Andrew Lenharth) Date: Thu, 20 Oct 2005 14:38:23 -0500 Subject: [llvm-commits] CVS: llvm/lib/Target/TargetSelectionDAG.td Message-ID: <200510201938.OAA30284@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target: TargetSelectionDAG.td updated: 1.3 -> 1.4 --- Log message: add cttz and ctpop --- Diffs of the changes: (+2 -0) TargetSelectionDAG.td | 2 ++ 1 files changed, 2 insertions(+) Index: llvm/lib/Target/TargetSelectionDAG.td diff -u llvm/lib/Target/TargetSelectionDAG.td:1.3 llvm/lib/Target/TargetSelectionDAG.td:1.4 --- llvm/lib/Target/TargetSelectionDAG.td:1.3 Fri Oct 14 01:40:20 2005 +++ llvm/lib/Target/TargetSelectionDAG.td Thu Oct 20 14:38:11 2005 @@ -146,6 +146,8 @@ def sext_inreg : SDNode<"ISD::SIGN_EXTEND_INREG", SDTExtInreg>; def ctlz : SDNode<"ISD::CTLZ" , SDTIntUnaryOp>; +def cttz : SDNode<"ISD::CTTZ" , SDTIntUnaryOp>; +def ctpop : SDNode<"ISD::CTPOP" , SDTIntUnaryOp>; def sext : SDNode<"ISD::SIGN_EXTEND", SDTIntExtendOp>; def zext : SDNode<"ISD::ZERO_EXTEND", SDTIntExtendOp>; def anyext : SDNode<"ISD::ANY_EXTEND" , SDTIntExtendOp>; From alenhar2 at cs.uiuc.edu Thu Oct 20 14:39:36 2005 From: alenhar2 at cs.uiuc.edu (Andrew Lenharth) Date: Thu, 20 Oct 2005 14:39:36 -0500 Subject: [llvm-commits] CVS: llvm/lib/Target/Alpha/AlphaInstrInfo.td AlphaInstrFormats.td AlphaISelPattern.cpp Message-ID: <200510201939.OAA30317@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/Alpha: AlphaInstrInfo.td updated: 1.63 -> 1.64 AlphaInstrFormats.td updated: 1.7 -> 1.8 AlphaISelPattern.cpp updated: 1.173 -> 1.174 --- Log message: added a few 1 operand form stuff. Seems to break regalloc on alpha. sigh --- Diffs of the changes: (+33 -13) AlphaISelPattern.cpp | 6 +++--- AlphaInstrFormats.td | 16 ++++++++++++++++ AlphaInstrInfo.td | 24 ++++++++++++++---------- 3 files changed, 33 insertions(+), 13 deletions(-) Index: llvm/lib/Target/Alpha/AlphaInstrInfo.td diff -u llvm/lib/Target/Alpha/AlphaInstrInfo.td:1.63 llvm/lib/Target/Alpha/AlphaInstrInfo.td:1.64 --- llvm/lib/Target/Alpha/AlphaInstrInfo.td:1.63 Thu Oct 20 09:42:48 2005 +++ llvm/lib/Target/Alpha/AlphaInstrInfo.td Thu Oct 20 14:39:24 2005 @@ -145,10 +145,12 @@ [(set GPRC:$RC, (or GPRC:$RA, GPRC:$RB))]>; def BISi : OFormL<0x11, 0x20, "bis $RA,$L,$RC", [(set GPRC:$RC, (or GPRC:$RA, immUExt8:$L))]>; -def CTLZ : OForm< 0x1C, 0x32, "CTLZ $RB,$RC", []>; -// [(set GPRC:$RC, (ctlz GPRC:$RB))]>; -def CTPOP : OForm< 0x1C, 0x30, "CTPOP $RB,$RC", []>; //Count population -def CTTZ : OForm< 0x1C, 0x33, "CTTZ $RB,$RC", []>; //Count trailing zero +def CTLZ : OFormT<0x1C, 0x32, "CTLZ $RB,$RC", + [(set GPRC:$RC, (ctlz GPRC:$RB))]>; +def CTPOP : OFormT<0x1C, 0x30, "CTPOP $RB,$RC", + [(set GPRC:$RC, (ctpop GPRC:$RB))]>; +def CTTZ : OFormT<0x1C, 0x33, "CTTZ $RB,$RC", + [(set GPRC:$RC, (cttz GPRC:$RB))]>; def EQV : OForm< 0x11, 0x48, "eqv $RA,$RB,$RC", [(set GPRC:$RC, (xor GPRC:$RA, (not GPRC:$RB)))]>; def EQVi : OFormL<0x11, 0x48, "eqv $RA,$L,$RC", []>; @@ -252,10 +254,10 @@ [(set GPRC:$RC, (sub8 GPRC:$RA, GPRC:$RB))]>; def S8SUBQi : OFormL<0x10, 0x3B, "s8subq $RA,$L,$RC", [(set GPRC:$RC, (sub8 GPRC:$RA, immUExt8:$L))]>; - -def SEXTB : OForm< 0x1C, 0x00, "sextb $RB,$RC", []>; //Sign extend byte -def SEXTW : OForm< 0x1C, 0x01, "sextw $RB,$RC", []>; //Sign extend word - +def SEXTB : OFormT<0x1C, 0x00, "sextb $RB,$RC", + [(set GPRC:$RC, (sext_inreg GPRC:$RB, i8))]>; +def SEXTW : OFormT<0x1C, 0x01, "sextw $RB,$RC", + [(set GPRC:$RC, (sext_inreg GPRC:$RB, i16))]>; def SL : OForm< 0x12, 0x39, "sll $RA,$RB,$RC", [(set GPRC:$RC, (shl GPRC:$RA, GPRC:$RB))]>; def SLi : OFormL<0x12, 0x39, "sll $RA,$L,$RC", @@ -276,8 +278,10 @@ [(set GPRC:$RC, (sub GPRC:$RA, GPRC:$RB))]>; def SUBQi : OFormL<0x10, 0x29, "subq $RA,$L,$RC", [(set GPRC:$RC, (sub GPRC:$RA, immUExt8:$L))]>; -def UMULH : OForm< 0x13, 0x30, "umulh $RA,$RB,$RC", []>; //Unsigned multiply quadword high -def UMULHi : OFormL<0x13, 0x30, "umulh $RA,$L,$RC", []>; //Unsigned multiply quadword high +def UMULH : OForm< 0x13, 0x30, "umulh $RA,$RB,$RC", + [(set GPRC:$RC, (mulhu GPRC:$RA, GPRC:$RB))]>; +def UMULHi : OFormL<0x13, 0x30, "umulh $RA,$L,$RC", + [(set GPRC:$RC, (mulhu GPRC:$RA, immUExt8:$L))]>; def XOR : OForm< 0x11, 0x40, "xor $RA,$RB,$RC", [(set GPRC:$RC, (xor GPRC:$RA, GPRC:$RB))]>; def XORi : OFormL<0x11, 0x40, "xor $RA,$L,$RC", Index: llvm/lib/Target/Alpha/AlphaInstrFormats.td diff -u llvm/lib/Target/Alpha/AlphaInstrFormats.td:1.7 llvm/lib/Target/Alpha/AlphaInstrFormats.td:1.8 --- llvm/lib/Target/Alpha/AlphaInstrFormats.td:1.7 Wed Oct 19 19:28:31 2005 +++ llvm/lib/Target/Alpha/AlphaInstrFormats.td Thu Oct 20 14:39:24 2005 @@ -110,6 +110,22 @@ let Inst{4-0} = Rc; } +class OFormT opcode, bits<7> fun, string asmstr, list pattern> + : InstAlpha { + let Pattern = pattern; + + bits<5> Rc; + bits<5> Rb; + bits<7> Function = fun; + + let Inst{25-21} = 0; + let Inst{20-16} = Rb; + let Inst{15-13} = 0; + let Inst{12} = 0; + let Inst{11-5} = Function; + let Inst{4-0} = Rc; +} + class OcmForm opcode, bits<7> fun, dag OL, string asmstr> : InstAlpha { bits<5> Ra; Index: llvm/lib/Target/Alpha/AlphaISelPattern.cpp diff -u llvm/lib/Target/Alpha/AlphaISelPattern.cpp:1.173 llvm/lib/Target/Alpha/AlphaISelPattern.cpp:1.174 --- llvm/lib/Target/Alpha/AlphaISelPattern.cpp:1.173 Thu Oct 6 11:54:29 2005 +++ llvm/lib/Target/Alpha/AlphaISelPattern.cpp Thu Oct 20 14:39:24 2005 @@ -697,7 +697,7 @@ Opc = opcode == ISD::CTPOP ? Alpha::CTPOP : (opcode == ISD::CTTZ ? Alpha::CTTZ : Alpha::CTLZ); Tmp1 = SelectExpr(N.getOperand(0)); - BuildMI(BB, Opc, 1, Result).addReg(Alpha::R31).addReg(Tmp1); + BuildMI(BB, Opc, 1, Result).addReg(Tmp1); return Result; case ISD::MULHU: @@ -1084,10 +1084,10 @@ break; } case MVT::i16: - BuildMI(BB, Alpha::SEXTW, 1, Result).addReg(Alpha::R31).addReg(Tmp1); + BuildMI(BB, Alpha::SEXTW, 1, Result).addReg(Tmp1); break; case MVT::i8: - BuildMI(BB, Alpha::SEXTB, 1, Result).addReg(Alpha::R31).addReg(Tmp1); + BuildMI(BB, Alpha::SEXTB, 1, Result).addReg(Tmp1); break; case MVT::i1: Tmp2 = MakeReg(MVT::i64); From lattner at cs.uiuc.edu Thu Oct 20 17:50:22 2005 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Thu, 20 Oct 2005 17:50:22 -0500 Subject: [llvm-commits] CVS: llvm/lib/CodeGen/LiveInterval.cpp Message-ID: <200510202250.RAA04989@zion.cs.uiuc.edu> Changes in directory llvm/lib/CodeGen: LiveInterval.cpp updated: 1.25 -> 1.26 --- Log message: Fix a conditional so we don't access past the end of the range. Thanks to Andrew for bringing this to my attn. --- Diffs of the changes: (+4 -6) LiveInterval.cpp | 10 ++++------ 1 files changed, 4 insertions(+), 6 deletions(-) Index: llvm/lib/CodeGen/LiveInterval.cpp diff -u llvm/lib/CodeGen/LiveInterval.cpp:1.25 llvm/lib/CodeGen/LiveInterval.cpp:1.26 --- llvm/lib/CodeGen/LiveInterval.cpp:1.25 Thu Oct 20 11:56:40 2005 +++ llvm/lib/CodeGen/LiveInterval.cpp Thu Oct 20 17:50:10 2005 @@ -218,12 +218,10 @@ // If the newly formed range now touches the range after it and if they have // the same value number, merge the two ranges into one range. - if (I != ranges.end()) { - Ranges::iterator Next = next(I); - if (Next->start == I->end && Next->ValId == ValId) { - I->end = Next->end; - ranges.erase(Next); - } + Ranges::iterator Next = next(I); + if (Next != ranges.end() && Next->start == I->end && Next->ValId == ValId) { + I->end = Next->end; + ranges.erase(Next); } } From lattner at cs.uiuc.edu Thu Oct 20 18:30:48 2005 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Thu, 20 Oct 2005 18:30:48 -0500 Subject: [llvm-commits] CVS: llvm/lib/Target/TargetSelectionDAG.td Message-ID: <200510202330.SAA07077@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target: TargetSelectionDAG.td updated: 1.4 -> 1.5 --- Log message: Use a literal to define ineg instead of immzero --- Diffs of the changes: (+1 -2) TargetSelectionDAG.td | 3 +-- 1 files changed, 1 insertion(+), 2 deletions(-) Index: llvm/lib/Target/TargetSelectionDAG.td diff -u llvm/lib/Target/TargetSelectionDAG.td:1.4 llvm/lib/Target/TargetSelectionDAG.td:1.5 --- llvm/lib/Target/TargetSelectionDAG.td:1.4 Thu Oct 20 14:38:11 2005 +++ llvm/lib/Target/TargetSelectionDAG.td Thu Oct 20 18:30:37 2005 @@ -208,7 +208,6 @@ // Leaf fragments. def immAllOnes : PatLeaf<(imm), [{ return N->isAllOnesValue(); }]>; -def immZero : PatLeaf<(imm), [{ return N->isNullValue(); }]>; def vtInt : PatLeaf<(vt), [{ return MVT::isInteger(N->getVT()); }]>; def vtFP : PatLeaf<(vt), [{ return MVT::isFloatingPoint(N->getVT()); }]>; @@ -216,7 +215,7 @@ // Other helper fragments. def not : PatFrag<(ops node:$in), (xor node:$in, immAllOnes)>; -def ineg : PatFrag<(ops node:$in), (sub immZero, node:$in)>; +def ineg : PatFrag<(ops node:$in), (sub 0, node:$in)>; //===----------------------------------------------------------------------===// // Selection DAG Pattern Support. From alenhar2 at cs.uiuc.edu Thu Oct 20 18:58:48 2005 From: alenhar2 at cs.uiuc.edu (Andrew Lenharth) Date: Thu, 20 Oct 2005 18:58:48 -0500 Subject: [llvm-commits] CVS: llvm/lib/Target/Alpha/AlphaInstrInfo.td AlphaInstrFormats.td Message-ID: <200510202358.SAA07209@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/Alpha: AlphaInstrInfo.td updated: 1.64 -> 1.65 AlphaInstrFormats.td updated: 1.8 -> 1.9 --- Log message: Inst cleanup. As a bonus, operands are in the correct order for cmovs. Expect new stuff to pass in the JIT tonight --- Diffs of the changes: (+33 -47) AlphaInstrFormats.td | 20 +++++++++-------- AlphaInstrInfo.td | 60 ++++++++++++++++++--------------------------------- 2 files changed, 33 insertions(+), 47 deletions(-) Index: llvm/lib/Target/Alpha/AlphaInstrInfo.td diff -u llvm/lib/Target/Alpha/AlphaInstrInfo.td:1.64 llvm/lib/Target/Alpha/AlphaInstrInfo.td:1.65 --- llvm/lib/Target/Alpha/AlphaInstrInfo.td:1.64 Thu Oct 20 14:39:24 2005 +++ llvm/lib/Target/Alpha/AlphaInstrInfo.td Thu Oct 20 18:58:36 2005 @@ -73,41 +73,25 @@ //Operation Form: -let isTwoAddress = 1 in { //conditional moves, int - def CMOVEQ : OcmForm< 0x11, 0x24, (ops GPRC:$RDEST, GPRC:$RSRC2, GPRC:$RSRC, GPRC:$RCOND), - "cmoveq $RCOND,$RSRC,$RDEST">; //CMOVE if RCOND = zero - def CMOVEQi : OcmFormL< 0x11, 0x24, (ops GPRC:$RDEST, GPRC:$RSRC2, u8imm:$L, GPRC:$RCOND), - "cmoveq $RCOND,$L,$RDEST">; //CMOVE if RCOND = zero - def CMOVGE : OcmForm< 0x11, 0x46, (ops GPRC:$RDEST, GPRC:$RSRC2, GPRC:$RSRC, GPRC:$RCOND), - "cmovge $RCOND,$RSRC,$RDEST">; //CMOVE if RCOND >= zero - def CMOVGEi : OcmFormL< 0x11, 0x46, (ops GPRC:$RDEST, GPRC:$RSRC2, u8imm:$L, GPRC:$RCOND), - "cmovge $RCOND,$L,$RDEST">; //CMOVE if RCOND >= zero - def CMOVGT : OcmForm< 0x11, 0x66, (ops GPRC:$RDEST, GPRC:$RSRC2, GPRC:$RSRC, GPRC:$RCOND), - "cmovgt $RCOND,$RSRC,$RDEST">; //CMOVE if RCOND > zero - def CMOVGTi : OcmFormL< 0x11, 0x66, (ops GPRC:$RDEST, GPRC:$RSRC2, u8imm:$L, GPRC:$RCOND), - "cmovgt $RCOND,$L,$RDEST">; //CMOVE if RCOND > zero - def CMOVLBC : OcmForm< 0x11, 0x16, (ops GPRC:$RDEST, GPRC:$RSRC2, GPRC:$RSRC, GPRC:$RCOND), - "cmovlbc $RCOND,$RSRC,$RDEST">; //CMOVE if RCOND low bit clear - def CMOVLBCi : OcmFormL< 0x11, 0x16, (ops GPRC:$RDEST, GPRC:$RSRC2, u8imm:$L, GPRC:$RCOND), - "cmovlbc $RCOND,$L,$RDEST">; //CMOVE if RCOND low bit clear - def CMOVLBS : OcmForm< 0x11, 0x14, (ops GPRC:$RDEST, GPRC:$RSRC2, GPRC:$RSRC, GPRC:$RCOND), - "cmovlbs $RCOND,$RSRC,$RDEST">; //CMOVE if RCOND low bit set - def CMOVLBSi : OcmFormL< 0x11, 0x14, (ops GPRC:$RDEST, GPRC:$RSRC2, u8imm:$L, GPRC:$RCOND), - "cmovlbs $RCOND,$L,$RDEST">; //CMOVE if RCOND low bit set - def CMOVLE : OcmForm< 0x11, 0x64, (ops GPRC:$RDEST, GPRC:$RSRC2, GPRC:$RSRC, GPRC:$RCOND), - "cmovle $RCOND,$RSRC,$RDEST">; //CMOVE if RCOND <= zero - def CMOVLEi : OcmFormL< 0x11, 0x64, (ops GPRC:$RDEST, GPRC:$RSRC2, u8imm:$L, GPRC:$RCOND), - "cmovle $RCOND,$L,$RDEST">; //CMOVE if RCOND <= zero - def CMOVLT : OcmForm< 0x11, 0x44, (ops GPRC:$RDEST, GPRC:$RSRC2, GPRC:$RSRC, GPRC:$RCOND), - "cmovlt $RCOND,$RSRC,$RDEST">; //CMOVE if RCOND < zero - def CMOVLTi : OcmFormL< 0x11, 0x44, (ops GPRC:$RDEST, GPRC:$RSRC2, u8imm:$L, GPRC:$RCOND), - "cmovlt $RCOND,$L,$RDEST">; //CMOVE if RCOND < zero - def CMOVNE : OcmForm< 0x11, 0x26, (ops GPRC:$RDEST, GPRC:$RSRC2, GPRC:$RSRC, GPRC:$RCOND), - "cmovne $RCOND,$RSRC,$RDEST">; //CMOVE if RCOND != zero - def CMOVNEi : OcmFormL< 0x11, 0x26, (ops GPRC:$RDEST, GPRC:$RSRC2, u8imm:$L, GPRC:$RCOND), - "cmovne $RCOND,$L,$RDEST">; //CMOVE if RCOND != zero +def CMOVEQ : OForm4< 0x11, 0x24, "cmoveq $RCOND,$RSRC,$RDEST">; //CMOVE if RCOND = zero +def CMOVEQi : OForm4L< 0x11, 0x24, "cmoveq $RCOND,$L,$RDEST">; //CMOVE if RCOND = zero +def CMOVGE : OForm4< 0x11, 0x46, "cmovge $RCOND,$RSRC,$RDEST">; //CMOVE if RCOND >= zero +def CMOVGEi : OForm4L< 0x11, 0x46, "cmovge $RCOND,$L,$RDEST">; //CMOVE if RCOND >= zero +def CMOVGT : OForm4< 0x11, 0x66, "cmovgt $RCOND,$RSRC,$RDEST">; //CMOVE if RCOND > zero +def CMOVGTi : OForm4L< 0x11, 0x66, "cmovgt $RCOND,$L,$RDEST">; //CMOVE if RCOND > zero +def CMOVLBC : OForm4< 0x11, 0x16, "cmovlbc $RCOND,$RSRC,$RDEST">; //CMOVE if RCOND low bit clear +def CMOVLBCi : OForm4L< 0x11, 0x16, "cmovlbc $RCOND,$L,$RDEST">; //CMOVE if RCOND low bit clear +def CMOVLBS : OForm4< 0x11, 0x14, "cmovlbs $RCOND,$RSRC,$RDEST">; //CMOVE if RCOND low bit set +def CMOVLBSi : OForm4L< 0x11, 0x14, "cmovlbs $RCOND,$L,$RDEST">; //CMOVE if RCOND low bit set +def CMOVLE : OForm4< 0x11, 0x64, "cmovle $RCOND,$RSRC,$RDEST">; //CMOVE if RCOND <= zero +def CMOVLEi : OForm4L< 0x11, 0x64, "cmovle $RCOND,$L,$RDEST">; //CMOVE if RCOND <= zero +def CMOVLT : OForm4< 0x11, 0x44, "cmovlt $RCOND,$RSRC,$RDEST">; //CMOVE if RCOND < zero +def CMOVLTi : OForm4L< 0x11, 0x44, "cmovlt $RCOND,$L,$RDEST">; //CMOVE if RCOND < zero +def CMOVNE : OForm4< 0x11, 0x26, "cmovne $RCOND,$RSRC,$RDEST">; //CMOVE if RCOND != zero +def CMOVNEi : OForm4L< 0x11, 0x26, "cmovne $RCOND,$L,$RDEST">; //CMOVE if RCOND != zero +let isTwoAddress = 1 in { //conditional moves, fp def FCMOVEQ : FPFormCM<0x17, 0x02A, (ops FPRC:$RDEST, FPRC:$RSRC2, FPRC:$RSRC, FPRC:$RCOND), "fcmoveq $RCOND,$RSRC,$RDEST">; //FCMOVE if = zero @@ -145,11 +129,11 @@ [(set GPRC:$RC, (or GPRC:$RA, GPRC:$RB))]>; def BISi : OFormL<0x11, 0x20, "bis $RA,$L,$RC", [(set GPRC:$RC, (or GPRC:$RA, immUExt8:$L))]>; -def CTLZ : OFormT<0x1C, 0x32, "CTLZ $RB,$RC", +def CTLZ : OForm2<0x1C, 0x32, "CTLZ $RB,$RC", [(set GPRC:$RC, (ctlz GPRC:$RB))]>; -def CTPOP : OFormT<0x1C, 0x30, "CTPOP $RB,$RC", +def CTPOP : OForm2<0x1C, 0x30, "CTPOP $RB,$RC", [(set GPRC:$RC, (ctpop GPRC:$RB))]>; -def CTTZ : OFormT<0x1C, 0x33, "CTTZ $RB,$RC", +def CTTZ : OForm2<0x1C, 0x33, "CTTZ $RB,$RC", [(set GPRC:$RC, (cttz GPRC:$RB))]>; def EQV : OForm< 0x11, 0x48, "eqv $RA,$RB,$RC", [(set GPRC:$RC, (xor GPRC:$RA, (not GPRC:$RB)))]>; @@ -254,9 +238,9 @@ [(set GPRC:$RC, (sub8 GPRC:$RA, GPRC:$RB))]>; def S8SUBQi : OFormL<0x10, 0x3B, "s8subq $RA,$L,$RC", [(set GPRC:$RC, (sub8 GPRC:$RA, immUExt8:$L))]>; -def SEXTB : OFormT<0x1C, 0x00, "sextb $RB,$RC", +def SEXTB : OForm2<0x1C, 0x00, "sextb $RB,$RC", [(set GPRC:$RC, (sext_inreg GPRC:$RB, i8))]>; -def SEXTW : OFormT<0x1C, 0x01, "sextw $RB,$RC", +def SEXTW : OForm2<0x1C, 0x01, "sextw $RB,$RC", [(set GPRC:$RC, (sext_inreg GPRC:$RB, i16))]>; def SL : OForm< 0x12, 0x39, "sll $RA,$RB,$RC", [(set GPRC:$RC, (shl GPRC:$RA, GPRC:$RB))]>; Index: llvm/lib/Target/Alpha/AlphaInstrFormats.td diff -u llvm/lib/Target/Alpha/AlphaInstrFormats.td:1.8 llvm/lib/Target/Alpha/AlphaInstrFormats.td:1.9 --- llvm/lib/Target/Alpha/AlphaInstrFormats.td:1.8 Thu Oct 20 14:39:24 2005 +++ llvm/lib/Target/Alpha/AlphaInstrFormats.td Thu Oct 20 18:58:36 2005 @@ -110,7 +110,7 @@ let Inst{4-0} = Rc; } -class OFormT opcode, bits<7> fun, string asmstr, list pattern> +class OForm2 opcode, bits<7> fun, string asmstr, list pattern> : InstAlpha { let Pattern = pattern; @@ -126,13 +126,14 @@ let Inst{4-0} = Rc; } -class OcmForm opcode, bits<7> fun, dag OL, string asmstr> - : InstAlpha { - bits<5> Ra; +class OForm4 opcode, bits<7> fun, string asmstr> + : InstAlpha { + bits<5> Rc; bits<5> Rb; + bits<5> Ra; bits<7> Function = fun; - bits<5> Rc; + let isTwoAddress = 1; let Inst{25-21} = Ra; let Inst{20-16} = Rb; let Inst{15-13} = 0; @@ -158,13 +159,14 @@ let Inst{4-0} = Rc; } -class OcmFormL opcode, bits<7> fun, dag OL, string asmstr> - : InstAlpha { - bits<5> Ra; +class OForm4L opcode, bits<7> fun, string asmstr> + : InstAlpha { + bits<5> Rc; bits<8> LIT; + bits<5> Ra; bits<7> Function = fun; - bits<5> Rc; + let isTwoAddress = 1; let Inst{25-21} = Ra; let Inst{20-13} = LIT; let Inst{12} = 1; From natebegeman at mac.com Thu Oct 20 19:02:54 2005 From: natebegeman at mac.com (Nate Begeman) Date: Thu, 20 Oct 2005 19:02:54 -0500 Subject: [llvm-commits] CVS: llvm/lib/Target/X86/X86ISelPattern.cpp Message-ID: <200510210002.TAA07289@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/X86: X86ISelPattern.cpp updated: 1.183 -> 1.184 --- Log message: Invert the TargetLowering flag that controls divide by consant expansion. Add a new flag to TargetLowering indicating if the target has really cheap signed division by powers of two, make ppc use it. This will probably go away in the future. Implement some more ISD::SDIV folds in the dag combiner Remove now dead code in the x86 backend. --- Diffs of the changes: (+0 -54) X86ISelPattern.cpp | 54 ----------------------------------------------------- 1 files changed, 54 deletions(-) Index: llvm/lib/Target/X86/X86ISelPattern.cpp diff -u llvm/lib/Target/X86/X86ISelPattern.cpp:1.183 llvm/lib/Target/X86/X86ISelPattern.cpp:1.184 --- llvm/lib/Target/X86/X86ISelPattern.cpp:1.183 Sat Oct 15 17:08:02 2005 +++ llvm/lib/Target/X86/X86ISelPattern.cpp Thu Oct 20 19:02:42 2005 @@ -3035,60 +3035,6 @@ return Result; } } - - if (ConstantSDNode *CN = dyn_cast(N.getOperand(1))) { - // FIXME: These special cases should be handled by the lowering impl! - unsigned RHS = CN->getValue(); - bool isNeg = false; - if ((int)RHS < 0) { - isNeg = true; - RHS = -RHS; - } - if (RHS && (RHS & (RHS-1)) == 0) { // Signed division by power of 2? - unsigned Log = Log2_32(RHS); - unsigned SAROpc, SHROpc, ADDOpc, NEGOpc; - switch (N.getValueType()) { - default: assert("Unknown type to signed divide!"); - case MVT::i8: - SAROpc = X86::SAR8ri; - SHROpc = X86::SHR8ri; - ADDOpc = X86::ADD8rr; - NEGOpc = X86::NEG8r; - break; - case MVT::i16: - SAROpc = X86::SAR16ri; - SHROpc = X86::SHR16ri; - ADDOpc = X86::ADD16rr; - NEGOpc = X86::NEG16r; - break; - case MVT::i32: - SAROpc = X86::SAR32ri; - SHROpc = X86::SHR32ri; - ADDOpc = X86::ADD32rr; - NEGOpc = X86::NEG32r; - break; - } - unsigned RegSize = MVT::getSizeInBits(N.getValueType()); - Tmp1 = SelectExpr(N.getOperand(0)); - unsigned TmpReg; - if (Log != 1) { - TmpReg = MakeReg(N.getValueType()); - BuildMI(BB, SAROpc, 2, TmpReg).addReg(Tmp1).addImm(Log-1); - } else { - TmpReg = Tmp1; - } - unsigned TmpReg2 = MakeReg(N.getValueType()); - BuildMI(BB, SHROpc, 2, TmpReg2).addReg(TmpReg).addImm(RegSize-Log); - unsigned TmpReg3 = MakeReg(N.getValueType()); - BuildMI(BB, ADDOpc, 2, TmpReg3).addReg(Tmp1).addReg(TmpReg2); - - unsigned TmpReg4 = isNeg ? MakeReg(N.getValueType()) : Result; - BuildMI(BB, SAROpc, 2, TmpReg4).addReg(TmpReg3).addImm(Log); - if (isNeg) - BuildMI(BB, NEGOpc, 1, Result).addReg(TmpReg4); - return Result; - } - } } if (getRegPressure(N.getOperand(0)) > getRegPressure(N.getOperand(1))) { From natebegeman at mac.com Thu Oct 20 19:02:55 2005 From: natebegeman at mac.com (Nate Begeman) Date: Thu, 20 Oct 2005 19:02:55 -0500 Subject: [llvm-commits] CVS: llvm/lib/Target/TargetLowering.cpp Message-ID: <200510210002.TAA07293@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target: TargetLowering.cpp updated: 1.12 -> 1.13 --- Log message: Invert the TargetLowering flag that controls divide by consant expansion. Add a new flag to TargetLowering indicating if the target has really cheap signed division by powers of two, make ppc use it. This will probably go away in the future. Implement some more ISD::SDIV folds in the dag combiner Remove now dead code in the x86 backend. --- Diffs of the changes: (+2 -0) TargetLowering.cpp | 2 ++ 1 files changed, 2 insertions(+) Index: llvm/lib/Target/TargetLowering.cpp diff -u llvm/lib/Target/TargetLowering.cpp:1.12 llvm/lib/Target/TargetLowering.cpp:1.13 --- llvm/lib/Target/TargetLowering.cpp:1.12 Tue Sep 27 17:13:56 2005 +++ llvm/lib/Target/TargetLowering.cpp Thu Oct 20 19:02:42 2005 @@ -30,6 +30,8 @@ maxStoresPerMemSet = maxStoresPerMemCpy = maxStoresPerMemMove = 8; allowUnalignedMemoryAccesses = false; UseUnderscoreSetJmpLongJmp = false; + IntDivIsCheap = false; + Pow2DivIsCheap = false; } TargetLowering::~TargetLowering() {} From natebegeman at mac.com Thu Oct 20 19:02:55 2005 From: natebegeman at mac.com (Nate Begeman) Date: Thu, 20 Oct 2005 19:02:55 -0500 Subject: [llvm-commits] CVS: llvm/include/llvm/Target/TargetLowering.h Message-ID: <200510210002.TAA07303@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm/Target: TargetLowering.h updated: 1.26 -> 1.27 --- Log message: Invert the TargetLowering flag that controls divide by consant expansion. Add a new flag to TargetLowering indicating if the target has really cheap signed division by powers of two, make ppc use it. This will probably go away in the future. Implement some more ISD::SDIV folds in the dag combiner Remove now dead code in the x86 backend. --- Diffs of the changes: (+23 -10) TargetLowering.h | 33 +++++++++++++++++++++++---------- 1 files changed, 23 insertions(+), 10 deletions(-) Index: llvm/include/llvm/Target/TargetLowering.h diff -u llvm/include/llvm/Target/TargetLowering.h:1.26 llvm/include/llvm/Target/TargetLowering.h:1.27 --- llvm/include/llvm/Target/TargetLowering.h:1.26 Wed Oct 19 21:14:14 2005 +++ llvm/include/llvm/Target/TargetLowering.h Thu Oct 20 19:02:42 2005 @@ -84,10 +84,14 @@ /// this target. bool isSetCCExpensive() const { return SetCCIsExpensive; } - /// isIntDivExpensive() - Return true if integer divide is more expensive than + /// isIntDivCheap() - Return true if integer divide is usually cheaper than /// a sequence of several shifts, adds, and multiplies for this target. - bool isIntDivExpensive() const { return IntDivIsExpensive; } + bool isIntDivCheap() const { return IntDivIsCheap; } + /// isPow2DivCheap() - Return true if pow2 div is cheaper than a chain of + /// srl/add/sra. + bool isPow2DivCheap() const { return Pow2DivIsCheap; } + /// getSetCCResultTy - Return the ValueType of the result of setcc operations. /// MVT::ValueType getSetCCResultTy() const { return SetCCResultTy; } @@ -266,10 +270,15 @@ /// setcc operations into other operations if possible. void setSetCCIsExpensive() { SetCCIsExpensive = true; } - /// setIntDivIsExpensive - Tells the code generator that integer divide is + /// setIntDivIsCheap - Tells the code generator that integer divide is /// expensive, and if possible, should be replaced by an alternate sequence /// of instructions not containing an integer divide. - void setIntDivIsExpensive() { IntDivIsExpensive = true; } + void setIntDivIsCheap(bool isCheap = true) { IntDivIsCheap = isCheap; } + + /// setPow2DivIsCheap - Tells the code generator that it shouldn't generate + /// srl/add/sra for a signed divide by power of two, and let the target handle + /// it. + void setPow2DivIsCheap(bool isCheap = true) { Pow2DivIsCheap = isCheap; } /// addRegisterClass - Add the specified register class as an available /// regclass for the specified value type. This indicates the selector can @@ -400,12 +409,16 @@ /// setcc operations into other operations if possible. bool SetCCIsExpensive; - /// IntDivIsExpensive - This is a hack until a real costs model is in place - /// that tells the code generator whether integer divide will always be more - /// expensive than a sequence of multiplies, shifts, and adds that performs - /// the same operation. If we ever optimize for size, this will be set to - /// false unconditionally. - bool IntDivIsExpensive; + /// IntDivIsCheap - Tells the code generator not to expand integer divides by + /// constants into a sequence of muls, adds, and shifts. This is a hack until + /// a real cost model is in place. If we ever optimize for size, this will be + /// set to true unconditionally. + bool IntDivIsCheap; + + /// Pow2DivIsCheap - Tells the code generator that it shouldn't generate + /// srl/add/sra for a signed divide by power of two, and let the target handle + /// it. + bool Pow2DivIsCheap; /// SetCCResultTy - The type that SetCC operations use. This defaults to the /// PointerTy. From natebegeman at mac.com Thu Oct 20 19:02:55 2005 From: natebegeman at mac.com (Nate Begeman) Date: Thu, 20 Oct 2005 19:02:55 -0500 Subject: [llvm-commits] CVS: llvm/lib/Target/PowerPC/PPCISelDAGToDAG.cpp PPCISelLowering.cpp Message-ID: <200510210002.TAA07299@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/PowerPC: PPCISelDAGToDAG.cpp updated: 1.114 -> 1.115 PPCISelLowering.cpp updated: 1.35 -> 1.36 --- Log message: Invert the TargetLowering flag that controls divide by consant expansion. Add a new flag to TargetLowering indicating if the target has really cheap signed division by powers of two, make ppc use it. This will probably go away in the future. Implement some more ISD::SDIV folds in the dag combiner Remove now dead code in the x86 backend. --- Diffs of the changes: (+6 -2) PPCISelDAGToDAG.cpp | 5 +++++ PPCISelLowering.cpp | 3 +-- 2 files changed, 6 insertions(+), 2 deletions(-) Index: llvm/lib/Target/PowerPC/PPCISelDAGToDAG.cpp diff -u llvm/lib/Target/PowerPC/PPCISelDAGToDAG.cpp:1.114 llvm/lib/Target/PowerPC/PPCISelDAGToDAG.cpp:1.115 --- llvm/lib/Target/PowerPC/PPCISelDAGToDAG.cpp:1.114 Wed Oct 19 21:15:44 2005 +++ llvm/lib/Target/PowerPC/PPCISelDAGToDAG.cpp Thu Oct 20 19:02:42 2005 @@ -996,6 +996,11 @@ return SDOperand(N, 0); } case ISD::SDIV: { + // FIXME: since this depends on the setting of the carry flag from the srawi + // we should really be making notes about that for the scheduler. + // FIXME: It sure would be nice if we could cheaply recognize the + // srl/add/sra pattern the dag combiner will generate for this as + // sra/addze rather than having to handle sdiv ourselves. oh well. unsigned Imm; if (isIntImmediate(N->getOperand(1), Imm)) { if ((signed)Imm > 0 && isPowerOf2_32(Imm)) { Index: llvm/lib/Target/PowerPC/PPCISelLowering.cpp diff -u llvm/lib/Target/PowerPC/PPCISelLowering.cpp:1.35 llvm/lib/Target/PowerPC/PPCISelLowering.cpp:1.36 --- llvm/lib/Target/PowerPC/PPCISelLowering.cpp:1.35 Wed Oct 19 21:15:44 2005 +++ llvm/lib/Target/PowerPC/PPCISelLowering.cpp Thu Oct 20 19:02:42 2005 @@ -27,8 +27,7 @@ // Fold away setcc operations if possible. setSetCCIsExpensive(); - // Fold constant integer div/rem into an alternate sequence of instructions - setIntDivIsExpensive(); + setPow2DivIsCheap(); // Use _setjmp/_longjmp instead of setjmp/longjmp. setUseUnderscoreSetJmpLongJmp(true); From natebegeman at mac.com Thu Oct 20 19:02:55 2005 From: natebegeman at mac.com (Nate Begeman) Date: Thu, 20 Oct 2005 19:02:55 -0500 Subject: [llvm-commits] CVS: llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp Message-ID: <200510210002.TAA07307@zion.cs.uiuc.edu> Changes in directory llvm/lib/CodeGen/SelectionDAG: DAGCombiner.cpp updated: 1.50 -> 1.51 --- Log message: Invert the TargetLowering flag that controls divide by consant expansion. Add a new flag to TargetLowering indicating if the target has really cheap signed division by powers of two, make ppc use it. This will probably go away in the future. Implement some more ISD::SDIV folds in the dag combiner Remove now dead code in the x86 backend. --- Diffs of the changes: (+37 -10) DAGCombiner.cpp | 47 +++++++++++++++++++++++++++++++++++++---------- 1 files changed, 37 insertions(+), 10 deletions(-) Index: llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp diff -u llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp:1.50 llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp:1.51 --- llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp:1.50 Thu Oct 20 12:45:03 2005 +++ llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp Thu Oct 20 19:02:42 2005 @@ -745,8 +745,7 @@ return N1; // fold (mul x, -1) -> 0-x if (N1C && N1C->isAllOnesValue()) - return DAG.getNode(ISD::SUB, N->getValueType(0), - DAG.getConstant(0, N->getValueType(0)), N0); + return DAG.getNode(ISD::SUB, VT, DAG.getConstant(0, VT), N0); // fold (mul x, (1 << c)) -> x << c if (N1C && isPowerOf2_64(N1C->getValue())) return DAG.getNode(ISD::SHL, N->getValueType(0), N0, @@ -777,21 +776,49 @@ if (N0C && N1C && !N1C->isNullValue()) return DAG.getConstant(N0C->getSignExtended() / N1C->getSignExtended(), N->getValueType(0)); + // fold (sdiv X, 1) -> X + if (N1C && N1C->getSignExtended() == 1LL) + return N0; + // fold (sdiv X, -1) -> 0-X + if (N1C && N1C->isAllOnesValue()) + return DAG.getNode(ISD::SUB, VT, DAG.getConstant(0, VT), N0); // If we know the sign bits of both operands are zero, strength reduce to a // udiv instead. Handles (X&15) /s 4 -> X&15 >> 2 uint64_t SignBit = 1ULL << (MVT::getSizeInBits(VT)-1); if (MaskedValueIsZero(N1, SignBit, TLI) && MaskedValueIsZero(N0, SignBit, TLI)) return DAG.getNode(ISD::UDIV, N1.getValueType(), N0, N1); + // fold (sdiv X, pow2) -> (add (sra X, log(pow2)), (srl X, sizeof(X)-1)) + if (N1C && N1C->getValue() && !TLI.isIntDivCheap() && + (isPowerOf2_64(N1C->getSignExtended()) || + isPowerOf2_64(-N1C->getSignExtended()))) { + // If dividing by powers of two is cheap, then don't perform the following + // fold. + if (TLI.isPow2DivCheap()) + return SDOperand(); + int64_t pow2 = N1C->getSignExtended(); + int64_t abs2 = pow2 > 0 ? pow2 : -pow2; + SDOperand SRL = DAG.getNode(ISD::SRL, VT, N0, + DAG.getConstant(MVT::getSizeInBits(VT)-1, + TLI.getShiftAmountTy())); + WorkList.push_back(SRL.Val); + SDOperand SGN = DAG.getNode(ISD::ADD, VT, N0, SRL); + WorkList.push_back(SGN.Val); + SDOperand SRA = DAG.getNode(ISD::SRA, VT, SGN, + DAG.getConstant(Log2_64(abs2), + TLI.getShiftAmountTy())); + // If we're dividing by a positive value, we're done. Otherwise, we must + // negate the result. + if (pow2 > 0) + return SRA; + WorkList.push_back(SRA.Val); + return DAG.getNode(ISD::SUB, VT, DAG.getConstant(0, VT), SRA); + } // if integer divide is expensive and we satisfy the requirements, emit an // alternate sequence. - // FIXME: This currently opts out powers of two, since targets can often be - // more clever in those cases. In an idea world, we would have some way to - // detect that too. - if (N1C && !isPowerOf2_64(N1C->getSignExtended()) && - (N1C->getSignExtended() < -1 || N1C->getSignExtended() > 1) && - TLI.isOperationLegal(ISD::MULHS, VT) && TLI.isTypeLegal(VT) && - TLI.isIntDivExpensive()) { + if (N1C && (N1C->getSignExtended() < -1 || N1C->getSignExtended() > 1) && + !TLI.isIntDivCheap() && + TLI.isOperationLegal(ISD::MULHS, VT) && TLI.isTypeLegal(VT)) { return BuildSDIV(N); } return SDOperand(); @@ -815,7 +842,7 @@ TLI.getShiftAmountTy())); // fold (udiv x, c) -> alternate if (N1C && N1C->getValue() && TLI.isOperationLegal(ISD::MULHU, VT) && - TLI.isTypeLegal(VT) && TLI.isIntDivExpensive()) + TLI.isTypeLegal(VT) && !TLI.isIntDivCheap()) return BuildUDIV(N); return SDOperand(); } From lattner at cs.uiuc.edu Thu Oct 20 20:20:11 2005 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Thu, 20 Oct 2005 20:20:11 -0500 Subject: [llvm-commits] CVS: llvm/utils/TableGen/DAGISelEmitter.cpp DAGISelEmitter.h Message-ID: <200510210120.UAA07802@zion.cs.uiuc.edu> Changes in directory llvm/utils/TableGen: DAGISelEmitter.cpp updated: 1.64 -> 1.65 DAGISelEmitter.h updated: 1.34 -> 1.35 --- Log message: Make tblgen emit: tblgen: In ZAPNOTi: Cannot use 'IZAPX' in an input pattern! for a bad pattern, instead of an ugly assertion. --- Diffs of the changes: (+26 -11) DAGISelEmitter.cpp | 24 ++++++++++++++++-------- DAGISelEmitter.h | 13 ++++++++++--- 2 files changed, 26 insertions(+), 11 deletions(-) Index: llvm/utils/TableGen/DAGISelEmitter.cpp diff -u llvm/utils/TableGen/DAGISelEmitter.cpp:1.64 llvm/utils/TableGen/DAGISelEmitter.cpp:1.65 --- llvm/utils/TableGen/DAGISelEmitter.cpp:1.64 Tue Oct 18 23:41:05 2005 +++ llvm/utils/TableGen/DAGISelEmitter.cpp Thu Oct 20 20:19:59 2005 @@ -573,19 +573,22 @@ // TreePattern implementation // -TreePattern::TreePattern(Record *TheRec, ListInit *RawPat, +TreePattern::TreePattern(Record *TheRec, ListInit *RawPat, bool isInput, DAGISelEmitter &ise) : TheRecord(TheRec), ISE(ise) { + isInputPattern = isInput; for (unsigned i = 0, e = RawPat->getSize(); i != e; ++i) Trees.push_back(ParseTreePattern((DagInit*)RawPat->getElement(i))); } -TreePattern::TreePattern(Record *TheRec, DagInit *Pat, +TreePattern::TreePattern(Record *TheRec, DagInit *Pat, bool isInput, DAGISelEmitter &ise) : TheRecord(TheRec), ISE(ise) { + isInputPattern = isInput; Trees.push_back(ParseTreePattern(Pat)); } -TreePattern::TreePattern(Record *TheRec, TreePatternNode *Pat, +TreePattern::TreePattern(Record *TheRec, TreePatternNode *Pat, bool isInput, DAGISelEmitter &ise) : TheRecord(TheRec), ISE(ise) { + isInputPattern = isInput; Trees.push_back(Pat); } @@ -638,6 +641,11 @@ Operator->getName() != "set") error("Unrecognized node '" + Operator->getName() + "'!"); + // Check to see if this is something that is illegal in an input pattern. + if (isInputPattern && (Operator->isSubClassOf("Instruction") || + Operator->isSubClassOf("SDNodeXForm"))) + error("Cannot use '" + Operator->getName() + "' in an input pattern!"); + std::vector Children; for (unsigned i = 0, e = Dag->getNumArgs(); i != e; ++i) { @@ -780,7 +788,7 @@ OS << "\n// Predicate functions.\n"; for (unsigned i = 0, e = Fragments.size(); i != e; ++i) { DagInit *Tree = Fragments[i]->getValueAsDag("Fragment"); - TreePattern *P = new TreePattern(Fragments[i], Tree, *this); + TreePattern *P = new TreePattern(Fragments[i], Tree, true, *this); PatternFragments[Fragments[i]] = P; // Validate the argument list, converting it to map, to discard duplicates. @@ -1016,7 +1024,7 @@ } // Parse the instruction. - TreePattern *I = new TreePattern(Instrs[i], LI, *this); + TreePattern *I = new TreePattern(Instrs[i], LI, true, *this); // Inline pattern fragments into it. I->InlinePatternFragments(); @@ -1133,7 +1141,7 @@ // Use a temporary tree pattern to infer all types and make sure that the // constructed result is correct. This depends on the instruction already // being inserted into the Instructions map. - TreePattern Temp(I->getRecord(), ResultPattern, *this); + TreePattern Temp(I->getRecord(), ResultPattern, false, *this); Temp.InferAllTypes(); DAGInstruction &TheInsertedInst = Instructions.find(I->getRecord())->second; @@ -1175,7 +1183,7 @@ for (unsigned i = 0, e = Patterns.size(); i != e; ++i) { DagInit *Tree = Patterns[i]->getValueAsDag("PatternToMatch"); - TreePattern *Pattern = new TreePattern(Patterns[i], Tree, *this); + TreePattern *Pattern = new TreePattern(Patterns[i], Tree, true, *this); // Inline pattern fragments into it. Pattern->InlinePatternFragments(); @@ -1189,7 +1197,7 @@ if (LI->getSize() == 0) continue; // no pattern. // Parse the instruction. - TreePattern *Result = new TreePattern(Patterns[i], LI, *this); + TreePattern *Result = new TreePattern(Patterns[i], LI, false, *this); // Inline pattern fragments into it. Result->InlinePatternFragments(); Index: llvm/utils/TableGen/DAGISelEmitter.h diff -u llvm/utils/TableGen/DAGISelEmitter.h:1.34 llvm/utils/TableGen/DAGISelEmitter.h:1.35 --- llvm/utils/TableGen/DAGISelEmitter.h:1.34 Tue Oct 18 23:12:14 2005 +++ llvm/utils/TableGen/DAGISelEmitter.h Thu Oct 20 20:19:59 2005 @@ -258,13 +258,20 @@ /// ISE - the DAG isel emitter coordinating this madness. /// DAGISelEmitter &ISE; + + /// isInputPattern - True if this is an input pattern, something to match. + /// False if this is an output pattern, something to emit. + bool isInputPattern; public: /// TreePattern constructor - Parse the specified DagInits into the /// current record. - TreePattern(Record *TheRec, ListInit *RawPat, DAGISelEmitter &ise); - TreePattern(Record *TheRec, DagInit *Pat, DAGISelEmitter &ise); - TreePattern(Record *TheRec, TreePatternNode *Pat, DAGISelEmitter &ise); + TreePattern(Record *TheRec, ListInit *RawPat, bool isInput, + DAGISelEmitter &ise); + TreePattern(Record *TheRec, DagInit *Pat, bool isInput, + DAGISelEmitter &ise); + TreePattern(Record *TheRec, TreePatternNode *Pat, bool isInput, + DAGISelEmitter &ise); /// getTrees - Return the tree patterns which corresponds to this pattern. /// From alenhar2 at cs.uiuc.edu Thu Oct 20 20:24:16 2005 From: alenhar2 at cs.uiuc.edu (Andrew Lenharth) Date: Thu, 20 Oct 2005 20:24:16 -0500 Subject: [llvm-commits] CVS: llvm/lib/Target/Alpha/AlphaInstrInfo.td Message-ID: <200510210124.UAA07895@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/Alpha: AlphaInstrInfo.td updated: 1.65 -> 1.66 --- Log message: byte zap not immediate goodness --- Diffs of the changes: (+47 -12) AlphaInstrInfo.td | 59 +++++++++++++++++++++++++++++++++++++++++++----------- 1 files changed, 47 insertions(+), 12 deletions(-) Index: llvm/lib/Target/Alpha/AlphaInstrInfo.td diff -u llvm/lib/Target/Alpha/AlphaInstrInfo.td:1.65 llvm/lib/Target/Alpha/AlphaInstrInfo.td:1.66 --- llvm/lib/Target/Alpha/AlphaInstrInfo.td:1.65 Thu Oct 20 18:58:36 2005 +++ llvm/lib/Target/Alpha/AlphaInstrInfo.td Thu Oct 20 20:24:05 2005 @@ -15,13 +15,54 @@ //******************** //Paterns for matching //******************** + +def iZAPX : SDNodeXFormgetValue(); + unsigned int build = 0; + for(int i = 0; i < 8; ++i) + { + if ((UImm & 0x00FF) == 0x00FF) + build |= 1 << i; + else if ((UImm & 0x00FF) != 0) + { build = 0; break; } + UImm >>= 8; + } + return getI64Imm(build); +}]>; + def immUExt8 : PatLeaf<(imm), [{ // immUExt8 predicate - True if the immediate fits in a 8-bit zero extended // field. Used by instructions like 'addi'. return (unsigned long)N->getValue() == (unsigned char)N->getValue(); }]>; -def intop : PatFrag<(ops node:$op), (sext_inreg node:$op, i32)>; +def immZAP : PatLeaf<(imm), [{ + // immZAP predicate - True if the immediate fits is suitable for use in a + // ZAP instruction + uint64_t UImm = (uint64_t)N->getValue(); + unsigned int build = 0; + for(int i = 0; i < 8; ++i) + { + if ((UImm & 0x00FF) == 0x00FF) + build |= 1 << i; + else if ((UImm & 0x00FF) != 0) + { build = 0; break; } + UImm >>= 8; + } + return build != 0; +}]>; + + +def intop : PatFrag<(ops node:$op), (sext_inreg node:$op, i32)>; +def add4 : PatFrag<(ops node:$op1, node:$op2), + (add (shl node:$op1, 2), node:$op2)>; +def sub4 : PatFrag<(ops node:$op1, node:$op2), + (sub (shl node:$op1, 2), node:$op2)>; +def add8 : PatFrag<(ops node:$op1, node:$op2), + (add (shl node:$op1, 3), node:$op2)>; +def sub8 : PatFrag<(ops node:$op1, node:$op2), + (sub (shl node:$op1, 3), node:$op2)>; // //#define FP $15 // //#define RA $26 @@ -184,16 +225,6 @@ //def MSKWL : OForm< 0x12, 0x12, "MSKWL $RA,$RB,$RC", []>; //Mask word low //def MSKWLi : OFormL<0x12, 0x12, "MSKWL $RA,$L,$RC", []>; //Mask word low -// Some Alpha pattern fragments to make things more terse and easier to read. -def add4 : PatFrag<(ops node:$op1, node:$op2), - (add (shl node:$op1, 2), node:$op2)>; -def sub4 : PatFrag<(ops node:$op1, node:$op2), - (sub (shl node:$op1, 2), node:$op2)>; -def add8 : PatFrag<(ops node:$op1, node:$op2), - (add (shl node:$op1, 3), node:$op2)>; -def sub8 : PatFrag<(ops node:$op1, node:$op2), - (sub (shl node:$op1, 3), node:$op2)>; - def MULL : OForm< 0x13, 0x00, "mull $RA,$RB,$RC", [(set GPRC:$RC, (intop (mul GPRC:$RA, GPRC:$RB)))]>; def MULLi : OFormL<0x13, 0x00, "mull $RA,$L,$RC", @@ -270,10 +301,14 @@ [(set GPRC:$RC, (xor GPRC:$RA, GPRC:$RB))]>; def XORi : OFormL<0x11, 0x40, "xor $RA,$L,$RC", [(set GPRC:$RC, (xor GPRC:$RA, immUExt8:$L))]>; +//FIXME: what to do about zap? the cases it catches are very complex def ZAP : OForm< 0x12, 0x30, "zap $RA,$RB,$RC", []>; //Zero bytes +//ZAPi is useless give ZAPNOTi def ZAPi : OFormL<0x12, 0x30, "zap $RA,$L,$RC", []>; //Zero bytes +//FIXME: what to do about zapnot? see ZAP :) def ZAPNOT : OForm< 0x12, 0x31, "zapnot $RA,$RB,$RC", []>; //Zero bytes not -def ZAPNOTi : OFormL<0x12, 0x31, "zapnot $RA,$L,$RC", []>; //Zero bytes not +def ZAPNOTi : OFormL<0x12, 0x31, "zapnot $RA,$L,$RC", []>; +def : Pat<(and GPRC:$OP1, immZAP:$OP2), (ZAPNOTi GPRC:$OP1, (iZAPX immZAP:$OP2))>; //Comparison, int def CMPBGE : OForm< 0x10, 0x0F, "cmpbge $RA,$RB,$RC", []>; //Compare byte From natebegeman at mac.com Thu Oct 20 20:51:56 2005 From: natebegeman at mac.com (Nate Begeman) Date: Thu, 20 Oct 2005 20:51:56 -0500 Subject: [llvm-commits] CVS: llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp Message-ID: <200510210151.UAA08001@zion.cs.uiuc.edu> Changes in directory llvm/lib/CodeGen/SelectionDAG: DAGCombiner.cpp updated: 1.51 -> 1.52 --- Log message: Fix a typo in the dag combiner, so that this can work on i64 targets --- Diffs of the changes: (+2 -3) DAGCombiner.cpp | 5 ++--- 1 files changed, 2 insertions(+), 3 deletions(-) Index: llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp diff -u llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp:1.51 llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp:1.52 --- llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp:1.51 Thu Oct 20 19:02:42 2005 +++ llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp Thu Oct 20 20:51:45 2005 @@ -2607,9 +2607,8 @@ } // Extract the sign bit and add it to the quotient SDOperand T = - DAG.getNode(ISD::SRL, MVT::i32, Q, - DAG.getConstant(MVT::getSizeInBits(VT)-1, - TLI.getShiftAmountTy())); + DAG.getNode(ISD::SRL, VT, Q, DAG.getConstant(MVT::getSizeInBits(VT)-1, + TLI.getShiftAmountTy())); WorkList.push_back(T.Val); return DAG.getNode(ISD::ADD, VT, Q, T); } From natebegeman at mac.com Thu Oct 20 20:52:31 2005 From: natebegeman at mac.com (Nate Begeman) Date: Thu, 20 Oct 2005 20:52:31 -0500 Subject: [llvm-commits] CVS: llvm/lib/Target/Alpha/AlphaISelPattern.cpp Message-ID: <200510210152.UAA08013@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/Alpha: AlphaISelPattern.cpp updated: 1.174 -> 1.175 --- Log message: Kill some now-dead code. --- Diffs of the changes: (+0 -159) AlphaISelPattern.cpp | 159 --------------------------------------------------- 1 files changed, 159 deletions(-) Index: llvm/lib/Target/Alpha/AlphaISelPattern.cpp diff -u llvm/lib/Target/Alpha/AlphaISelPattern.cpp:1.174 llvm/lib/Target/Alpha/AlphaISelPattern.cpp:1.175 --- llvm/lib/Target/Alpha/AlphaISelPattern.cpp:1.174 Thu Oct 20 14:39:24 2005 +++ llvm/lib/Target/Alpha/AlphaISelPattern.cpp Thu Oct 20 20:52:20 2005 @@ -235,152 +235,6 @@ } -//Shamelessly adapted from PPC32 -// Structure used to return the necessary information to codegen an SDIV as -// a multiply. -struct ms { - int64_t m; // magic number - int64_t s; // shift amount -}; - -struct mu { - uint64_t m; // magic number - int64_t a; // add indicator - int64_t s; // shift amount -}; - -/// magic - calculate the magic numbers required to codegen an integer sdiv as -/// a sequence of multiply and shifts. Requires that the divisor not be 0, 1, -/// or -1. -static struct ms magic(int64_t d) { - int64_t p; - uint64_t ad, anc, delta, q1, r1, q2, r2, t; - const uint64_t two63 = 9223372036854775808ULL; // 2^63 - struct ms mag; - - ad = llabs(d); - t = two63 + ((uint64_t)d >> 63); - anc = t - 1 - t%ad; // absolute value of nc - p = 63; // initialize p - q1 = two63/anc; // initialize q1 = 2p/abs(nc) - r1 = two63 - q1*anc; // initialize r1 = rem(2p,abs(nc)) - q2 = two63/ad; // initialize q2 = 2p/abs(d) - r2 = two63 - q2*ad; // initialize r2 = rem(2p,abs(d)) - do { - p = p + 1; - q1 = 2*q1; // update q1 = 2p/abs(nc) - r1 = 2*r1; // update r1 = rem(2p/abs(nc)) - if (r1 >= anc) { // must be unsigned comparison - q1 = q1 + 1; - r1 = r1 - anc; - } - q2 = 2*q2; // update q2 = 2p/abs(d) - r2 = 2*r2; // update r2 = rem(2p/abs(d)) - if (r2 >= ad) { // must be unsigned comparison - q2 = q2 + 1; - r2 = r2 - ad; - } - delta = ad - r2; - } while (q1 < delta || (q1 == delta && r1 == 0)); - - mag.m = q2 + 1; - if (d < 0) mag.m = -mag.m; // resulting magic number - mag.s = p - 64; // resulting shift - return mag; -} - -/// magicu - calculate the magic numbers required to codegen an integer udiv as -/// a sequence of multiply, add and shifts. Requires that the divisor not be 0. -static struct mu magicu(uint64_t d) -{ - int64_t p; - uint64_t nc, delta, q1, r1, q2, r2; - struct mu magu; - magu.a = 0; // initialize "add" indicator - nc = - 1 - (-d)%d; - p = 63; // initialize p - q1 = 0x8000000000000000ull/nc; // initialize q1 = 2p/nc - r1 = 0x8000000000000000ull - q1*nc; // initialize r1 = rem(2p,nc) - q2 = 0x7FFFFFFFFFFFFFFFull/d; // initialize q2 = (2p-1)/d - r2 = 0x7FFFFFFFFFFFFFFFull - q2*d; // initialize r2 = rem((2p-1),d) - do { - p = p + 1; - if (r1 >= nc - r1 ) { - q1 = 2*q1 + 1; // update q1 - r1 = 2*r1 - nc; // update r1 - } - else { - q1 = 2*q1; // update q1 - r1 = 2*r1; // update r1 - } - if (r2 + 1 >= d - r2) { - if (q2 >= 0x7FFFFFFFFFFFFFFFull) magu.a = 1; - q2 = 2*q2 + 1; // update q2 - r2 = 2*r2 + 1 - d; // update r2 - } - else { - if (q2 >= 0x8000000000000000ull) magu.a = 1; - q2 = 2*q2; // update q2 - r2 = 2*r2 + 1; // update r2 - } - delta = d - 1 - r2; - } while (p < 64 && (q1 < delta || (q1 == delta && r1 == 0))); - magu.m = q2 + 1; // resulting magic number - magu.s = p - 64; // resulting shift - return magu; -} - -/// BuildSDIVSequence - Given an ISD::SDIV node expressing a divide by constant, -/// return a DAG expression to select that will generate the same value by -/// multiplying by a magic number. See: -/// -SDOperand AlphaISel::BuildSDIVSequence(SDOperand N) { - int64_t d = (int64_t)cast(N.getOperand(1))->getSignExtended(); - ms magics = magic(d); - // Multiply the numerator (operand 0) by the magic value - SDOperand Q = ISelDAG->getNode(ISD::MULHS, MVT::i64, N.getOperand(0), - ISelDAG->getConstant(magics.m, MVT::i64)); - // If d > 0 and m < 0, add the numerator - if (d > 0 && magics.m < 0) - Q = ISelDAG->getNode(ISD::ADD, MVT::i64, Q, N.getOperand(0)); - // If d < 0 and m > 0, subtract the numerator. - if (d < 0 && magics.m > 0) - Q = ISelDAG->getNode(ISD::SUB, MVT::i64, Q, N.getOperand(0)); - // Shift right algebraic if shift value is nonzero - if (magics.s > 0) - Q = ISelDAG->getNode(ISD::SRA, MVT::i64, Q, - ISelDAG->getConstant(magics.s, MVT::i64)); - // Extract the sign bit and add it to the quotient - SDOperand T = - ISelDAG->getNode(ISD::SRL, MVT::i64, Q, ISelDAG->getConstant(63, MVT::i64)); - return ISelDAG->getNode(ISD::ADD, MVT::i64, Q, T); -} - -/// BuildUDIVSequence - Given an ISD::UDIV node expressing a divide by constant, -/// return a DAG expression to select that will generate the same value by -/// multiplying by a magic number. See: -/// -SDOperand AlphaISel::BuildUDIVSequence(SDOperand N) { - unsigned d = - (unsigned)cast(N.getOperand(1))->getSignExtended(); - mu magics = magicu(d); - // Multiply the numerator (operand 0) by the magic value - SDOperand Q = ISelDAG->getNode(ISD::MULHU, MVT::i64, N.getOperand(0), - ISelDAG->getConstant(magics.m, MVT::i64)); - if (magics.a == 0) { - Q = ISelDAG->getNode(ISD::SRL, MVT::i64, Q, - ISelDAG->getConstant(magics.s, MVT::i64)); - } else { - SDOperand NPQ = ISelDAG->getNode(ISD::SUB, MVT::i64, N.getOperand(0), Q); - NPQ = ISelDAG->getNode(ISD::SRL, MVT::i64, NPQ, - ISelDAG->getConstant(1, MVT::i64)); - NPQ = ISelDAG->getNode(ISD::ADD, MVT::i64, NPQ, Q); - Q = ISelDAG->getNode(ISD::SRL, MVT::i64, NPQ, - ISelDAG->getConstant(magics.s-1, MVT::i64)); - } - return Q; -} - //These describe LDAx static const int IMM_LOW = -32768; static const int IMM_HIGH = 32767; @@ -1390,20 +1244,7 @@ } } //Else fall through - case ISD::UDIV: - { - if (isSIntImmediate(N.getOperand(1), SImm) && (SImm >= 2 || SImm <= -2)) - { - // If this is a divide by constant, we can emit code using some magic - // constants to implement it as a multiply instead. - ExprMap.erase(N); - if (opcode == ISD::SDIV) - return SelectExpr(BuildSDIVSequence(N)); - else - return SelectExpr(BuildUDIVSequence(N)); - } - } //else fall though case ISD::UREM: case ISD::SREM: { From natebegeman at mac.com Thu Oct 20 20:52:56 2005 From: natebegeman at mac.com (Nate Begeman) Date: Thu, 20 Oct 2005 20:52:56 -0500 Subject: [llvm-commits] CVS: llvm/lib/Target/IA64/IA64ISelPattern.cpp Message-ID: <200510210152.UAA08026@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/IA64: IA64ISelPattern.cpp updated: 1.66 -> 1.67 --- Log message: Don't generate operations that aren't yet supported --- Diffs of the changes: (+4 -1) IA64ISelPattern.cpp | 5 ++++- 1 files changed, 4 insertions(+), 1 deletion(-) Index: llvm/lib/Target/IA64/IA64ISelPattern.cpp diff -u llvm/lib/Target/IA64/IA64ISelPattern.cpp:1.66 llvm/lib/Target/IA64/IA64ISelPattern.cpp:1.67 --- llvm/lib/Target/IA64/IA64ISelPattern.cpp:1.66 Thu Oct 6 23:50:48 2005 +++ llvm/lib/Target/IA64/IA64ISelPattern.cpp Thu Oct 20 20:52:45 2005 @@ -84,7 +84,7 @@ setOperationAction(ISD::SINT_TO_FP , MVT::i1 , Promote); setOperationAction(ISD::UINT_TO_FP , MVT::i1 , Promote); - + // We don't support sin/cos/sqrt setOperationAction(ISD::FSIN , MVT::f64, Expand); setOperationAction(ISD::FCOS , MVT::f64, Expand); @@ -96,6 +96,9 @@ //IA64 has these, but they are not implemented setOperationAction(ISD::CTTZ , MVT::i64 , Expand); setOperationAction(ISD::CTLZ , MVT::i64 , Expand); + // FIXME: implement mulhs (xma.h) and mulhu (xma.hu) + setOperationAction(ISD::MULHS , MVT::i64 , Expand); + setOperationAction(ISD::MULHU , MVT::i64 , Expand); computeRegisterProperties(); From lattner at cs.uiuc.edu Fri Oct 21 00:45:52 2005 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Fri, 21 Oct 2005 00:45:52 -0500 Subject: [llvm-commits] CVS: llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp Message-ID: <200510210545.AAA08976@zion.cs.uiuc.edu> Changes in directory llvm/lib/Transforms/Scalar: LoopStrengthReduce.cpp updated: 1.69 -> 1.70 --- Log message: My previous patch was too conservative. Reject FP and void types, but do allow pointer types. --- Diffs of the changes: (+2 -1) LoopStrengthReduce.cpp | 3 ++- 1 files changed, 2 insertions(+), 1 deletion(-) Index: llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp diff -u llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp:1.69 llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp:1.70 --- llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp:1.69 Wed Oct 19 23:47:10 2005 +++ llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp Fri Oct 21 00:45:41 2005 @@ -372,7 +372,8 @@ /// return true. Otherwise, return false. bool LoopStrengthReduce::AddUsersIfInteresting(Instruction *I, Loop *L, std::set &Processed) { - if (!I->getType()->isInteger()) return false; + if (!I->getType()->isInteger() && !isa(I->getType())) + return false; // Void and FP expressions cannot be reduced. if (!Processed.insert(I).second) return true; // Instruction already handled. From lattner at cs.uiuc.edu Fri Oct 21 01:28:05 2005 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Fri, 21 Oct 2005 01:28:05 -0500 Subject: [llvm-commits] CVS: llvm-test/MultiSource/Applications/d/Makefile Message-ID: <200510210628.BAA09158@zion.cs.uiuc.edu> Changes in directory llvm-test/MultiSource/Applications/d: Makefile updated: 1.4 -> 1.5 --- Log message: The variable is Source, not Sources. Also, don't include grammar.g.c: it's not part of the program, it's a file generated by running the test program. This stops the infernal "makedparser rebuilds every time you run tests" issue. --- Diffs of the changes: (+1 -1) Makefile | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm-test/MultiSource/Applications/d/Makefile diff -u llvm-test/MultiSource/Applications/d/Makefile:1.4 llvm-test/MultiSource/Applications/d/Makefile:1.5 --- llvm-test/MultiSource/Applications/d/Makefile:1.4 Sat Jan 15 21:16:09 2005 +++ llvm-test/MultiSource/Applications/d/Makefile Fri Oct 21 01:27:53 2005 @@ -1,6 +1,6 @@ LEVEL = ../../.. PROG = make_dparser -Sources=make_dparser.c write_ctables.c gram.c lex.c lr.c arg.c parse.c scan.c symtab.c util.c grammar.g.c +Source=make_dparser.c write_ctables.c gram.c lex.c lr.c arg.c parse.c scan.c symtab.c util.c CPPFLAGS = -DD_BUILD_VERSION=5725 RUN_OPTIONS="-v $(PROJ_SRC_DIR)/grammar.g" include ../../Makefile.multisrc From lattner at cs.uiuc.edu Fri Oct 21 01:28:44 2005 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Fri, 21 Oct 2005 01:28:44 -0500 Subject: [llvm-commits] CVS: llvm-test/MultiSource/Applications/d/grammar.g.c Message-ID: <200510210628.BAA09214@zion.cs.uiuc.edu> Changes in directory llvm-test/MultiSource/Applications/d: grammar.g.c (r1.1) removed --- Log message: This is not a part of the program, it is generated by running it --- Diffs of the changes: (+0 -0) 0 files changed From lattner at cs.uiuc.edu Fri Oct 21 01:35:41 2005 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Fri, 21 Oct 2005 01:35:41 -0500 Subject: [llvm-commits] CVS: llvm-test/MultiSource/Applications/d/grammar.g.c Message-ID: <200510210635.BAA09379@zion.cs.uiuc.edu> Changes in directory llvm-test/MultiSource/Applications/d: grammar.g.c updated: 1.2 -> 1.3 --- Log message: restore this file --- Diffs of the changes: (+5697 -0) grammar.g.c | 5697 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 5697 insertions(+) Index: llvm-test/MultiSource/Applications/d/grammar.g.c diff -u /dev/null llvm-test/MultiSource/Applications/d/grammar.g.c:1.3 --- /dev/null Fri Oct 21 01:35:40 2005 +++ llvm-test/MultiSource/Applications/d/grammar.g.c Fri Oct 21 01:35:30 2005 @@ -0,0 +1,5697 @@ +#line 4 "grammar.g" + +#include "gramgram.h" +#include "d.h" + +#include "dparse.h" + +D_Reduction d_reduction_0_dparser_gram = {1, 0, NULL, NULL, 0, 0, 0, 0, -1, 0, NULL}; +D_Reduction d_reduction_1_dparser_gram = {1, 1, NULL, NULL, 0, 0, 0, 0, -1, 0, NULL}; +D_Reduction d_reduction_2_dparser_gram = {2, 2, NULL, NULL, 0, 0, 0, 0, 0, 0, NULL}; +D_Reduction d_reduction_3_dparser_gram = {2, 3, NULL, NULL, 0, 0, 0, 0, -1, 0, NULL}; +D_Reduction d_reduction_4_dparser_gram = {1, 3, NULL, NULL, 0, 0, 0, 0, -1, 0, NULL}; +D_Reduction d_reduction_5_dparser_gram = {2, 4, NULL, NULL, 0, 0, 0, 0, -1, 0, NULL}; +D_Reduction d_reduction_6_dparser_gram = {2, 5, NULL, NULL, 0, 0, 0, 0, -1, 0, NULL}; +D_Reduction d_reduction_7_dparser_gram = {0, 5, NULL, NULL, 0, 0, 0, 0, -1, 0, NULL}; +D_Reduction d_reduction_8_dparser_gram = {2, 6, NULL, NULL, 0, 0, 0, 0, -1, 0, NULL}; +D_Reduction d_reduction_9_dparser_gram = {0, 6, NULL, NULL, 0, 0, 0, 0, -1, 0, NULL}; +int d_final_reduction_code_7_10_dparser_gram(void *_ps, void **_children, int _n_children, int _offset, D_Parser *_parser) { +#line 11 "grammar.g" + + add_global_code((D_PN(_ps, _offset)->globals), (*(D_PN(_children[0], _offset))).start_loc.s+1, (*(D_PN(_children[0], _offset))).end-1, + (*(D_PN(_children[0], _offset))).start_loc.line); + return 0;} + +D_Reduction d_reduction_10_dparser_gram = {1, 7, NULL, d_final_reduction_code_7_10_dparser_gram, 0, 0, 0, 0, 0, 0, NULL}; +int d_final_reduction_code_7_11_dparser_gram(void *_ps, void **_children, int _n_children, int _offset, D_Parser *_parser) { +#line 15 "grammar.g" + + (D_PN(_ps, _offset)->globals)->scanner.code = dup_str((*(D_PN(_children[1], _offset))).start_loc.s, (*(D_PN(_children[1], _offset))).end); + (D_PN(_ps, _offset)->globals)->scanner.line = (*(D_PN(_children[0], _offset))).start_loc.line; + return 0;} + +D_Reduction d_reduction_11_dparser_gram = {3, 7, NULL, d_final_reduction_code_7_11_dparser_gram, 0, 0, 0, 0, 0, 0, NULL}; +int d_final_reduction_code_7_12_dparser_gram(void *_ps, void **_children, int _n_children, int _offset, D_Parser *_parser) { +#line 19 "grammar.g" + + if (!d_get_number_of_children(&(*(D_PN(_children[2], _offset))))) + add_declaration((D_PN(_ps, _offset)->globals), (*(D_PN(_children[2], _offset))).start_loc.s, (*(D_PN(_children[2], _offset))).end, (D_PN(_children[1], _offset)->user).kind, (*(D_PN(_children[2], _offset))).start_loc.line); + else { + int i, n = d_get_number_of_children(&(*(D_PN(_children[2], _offset)))); + for (i = 0; i < n; i++) { + D_ParseNode *pn = d_get_child(&(*(D_PN(_children[2], _offset))), i); + add_declaration((D_PN(_ps, _offset)->globals), pn->start_loc.s, pn->end, (D_PN(_children[1], _offset)->user).kind, pn->start_loc.line); + } + } + return 0;} + +D_Reduction d_reduction_12_dparser_gram = {4, 7, NULL, d_final_reduction_code_7_12_dparser_gram, 0, 0, 0, 0, 0, 0, NULL}; +D_Reduction d_reduction_13_dparser_gram = {3, 7, NULL, NULL, 0, 0, 0, 0, 0, 0, NULL}; +int d_final_reduction_code_7_14_dparser_gram(void *_ps, void **_children, int _n_children, int _offset, D_Parser *_parser) { +#line 31 "grammar.g" + (D_PN(_ps, _offset)->globals)->action_index++; return 0;} + +D_Reduction d_reduction_14_dparser_gram = {1, 7, NULL, d_final_reduction_code_7_14_dparser_gram, 0, 0, 0, 0, 0, 0, NULL}; +int d_final_reduction_code_7_15_dparser_gram(void *_ps, void **_children, int _n_children, int _offset, D_Parser *_parser) { +#line 32 "grammar.g" + + add_pass((D_PN(_ps, _offset)->globals), (*(D_PN(_children[1], _offset))).start_loc.s, (*(D_PN(_children[1], _offset))).end, (D_PN(_children[2], _offset)->user).kind, (*(D_PN(_children[1], _offset))).start_loc.line); + return 0;} + +D_Reduction d_reduction_15_dparser_gram = {4, 7, NULL, d_final_reduction_code_7_15_dparser_gram, 0, 0, 0, 0, 0, 0, NULL}; +D_Reduction d_reduction_16_dparser_gram = {2, 8, NULL, NULL, 0, 0, 0, 0, -1, 0, NULL}; +D_Reduction d_reduction_17_dparser_gram = {1, 8, NULL, NULL, 0, 0, 0, 0, -1, 0, NULL}; +D_Reduction d_reduction_18_dparser_gram = {2, 9, NULL, NULL, 0, 0, 0, 0, -1, 0, NULL}; +D_Reduction d_reduction_19_dparser_gram = {0, 9, NULL, NULL, 0, 0, 0, 0, -1, 0, NULL}; +D_Reduction d_reduction_20_dparser_gram = {2, 10, NULL, NULL, 0, 0, 0, 0, -1, 0, NULL}; +D_Reduction d_reduction_21_dparser_gram = {1, 10, NULL, NULL, 0, 0, 0, 0, -1, 0, NULL}; +D_Reduction d_reduction_22_dparser_gram = {0, 11, NULL, NULL, 0, 0, 0, 0, 0, 0, NULL}; +int d_final_reduction_code_11_23_dparser_gram(void *_ps, void **_children, int _n_children, int _offset, D_Parser *_parser) { +#line 38 "grammar.g" + (D_PN(_ps, _offset)->user).kind = (D_PN(_children[0], _offset)->user).kind | (D_PN(_children[1], _offset)->user).kind; return 0;} + +D_Reduction d_reduction_23_dparser_gram = {2, 11, NULL, d_final_reduction_code_11_23_dparser_gram, 0, 0, 0, 0, 0, 0, NULL}; +int d_final_reduction_code_12_24_dparser_gram(void *_ps, void **_children, int _n_children, int _offset, D_Parser *_parser) { +#line 41 "grammar.g" + (D_PN(_ps, _offset)->user).kind |= D_PASS_PRE_ORDER; return 0;} + +D_Reduction d_reduction_24_dparser_gram = {1, 12, NULL, d_final_reduction_code_12_24_dparser_gram, 0, 0, 0, 0, 0, 0, NULL}; +int d_final_reduction_code_12_25_dparser_gram(void *_ps, void **_children, int _n_children, int _offset, D_Parser *_parser) { +#line 42 "grammar.g" + (D_PN(_ps, _offset)->user).kind |= D_PASS_POST_ORDER; return 0;} + +D_Reduction d_reduction_25_dparser_gram = {1, 12, NULL, d_final_reduction_code_12_25_dparser_gram, 0, 0, 0, 0, 0, 0, NULL}; +int d_final_reduction_code_12_26_dparser_gram(void *_ps, void **_children, int _n_children, int _offset, D_Parser *_parser) { +#line 43 "grammar.g" + (D_PN(_ps, _offset)->user).kind |= D_PASS_MANUAL; return 0;} + +D_Reduction d_reduction_26_dparser_gram = {1, 12, NULL, d_final_reduction_code_12_26_dparser_gram, 0, 0, 0, 0, 0, 0, NULL}; +int d_final_reduction_code_12_27_dparser_gram(void *_ps, void **_children, int _n_children, int _offset, D_Parser *_parser) { +#line 44 "grammar.g" + (D_PN(_ps, _offset)->user).kind |= D_PASS_FOR_ALL; return 0;} + +D_Reduction d_reduction_27_dparser_gram = {1, 12, NULL, d_final_reduction_code_12_27_dparser_gram, 0, 0, 0, 0, 0, 0, NULL}; +int d_final_reduction_code_12_28_dparser_gram(void *_ps, void **_children, int _n_children, int _offset, D_Parser *_parser) { +#line 45 "grammar.g" + (D_PN(_ps, _offset)->user).kind |= D_PASS_FOR_UNDEFINED; return 0;} + +D_Reduction d_reduction_28_dparser_gram = {1, 12, NULL, d_final_reduction_code_12_28_dparser_gram, 0, 0, 0, 0, 0, 0, NULL}; +int d_final_reduction_code_13_29_dparser_gram(void *_ps, void **_children, int _n_children, int _offset, D_Parser *_parser) { +#line 48 "grammar.g" + (D_PN(_ps, _offset)->user).kind = DECLARE_TOKENIZE; return 0;} + +D_Reduction d_reduction_29_dparser_gram = {1, 13, NULL, d_final_reduction_code_13_29_dparser_gram, 0, 0, 0, 0, 0, 0, NULL}; +int d_final_reduction_code_13_30_dparser_gram(void *_ps, void **_children, int _n_children, int _offset, D_Parser *_parser) { +#line 49 "grammar.g" + (D_PN(_ps, _offset)->user).kind = DECLARE_LONGEST_MATCH; return 0;} + +D_Reduction d_reduction_30_dparser_gram = {1, 13, NULL, d_final_reduction_code_13_30_dparser_gram, 0, 0, 0, 0, 0, 0, NULL}; +int d_final_reduction_code_13_31_dparser_gram(void *_ps, void **_children, int _n_children, int _offset, D_Parser *_parser) { +#line 50 "grammar.g" + (D_PN(_ps, _offset)->user).kind = DECLARE_WHITESPACE; return 0;} + +D_Reduction d_reduction_31_dparser_gram = {1, 13, NULL, d_final_reduction_code_13_31_dparser_gram, 0, 0, 0, 0, 0, 0, NULL}; +int d_final_reduction_code_13_32_dparser_gram(void *_ps, void **_children, int _n_children, int _offset, D_Parser *_parser) { +#line 51 "grammar.g" + (D_PN(_ps, _offset)->user).kind = DECLARE_ALL_MATCHES; return 0;} + +D_Reduction d_reduction_32_dparser_gram = {1, 13, NULL, d_final_reduction_code_13_32_dparser_gram, 0, 0, 0, 0, 0, 0, NULL}; +int d_final_reduction_code_13_33_dparser_gram(void *_ps, void **_children, int _n_children, int _offset, D_Parser *_parser) { +#line 52 "grammar.g" + (D_PN(_ps, _offset)->user).kind = DECLARE_SET_OP_PRIORITY; return 0;} + +D_Reduction d_reduction_33_dparser_gram = {1, 13, NULL, d_final_reduction_code_13_33_dparser_gram, 0, 0, 0, 0, 0, 0, NULL}; +int d_final_reduction_code_13_34_dparser_gram(void *_ps, void **_children, int _n_children, int _offset, D_Parser *_parser) { +#line 53 "grammar.g" + (D_PN(_ps, _offset)->user).kind = DECLARE_STATES_FOR_ALL_NTERMS; return 0;} + +D_Reduction d_reduction_34_dparser_gram = {1, 13, NULL, d_final_reduction_code_13_34_dparser_gram, 0, 0, 0, 0, 0, 0, NULL}; +int d_final_reduction_code_13_35_dparser_gram(void *_ps, void **_children, int _n_children, int _offset, D_Parser *_parser) { +#line 54 "grammar.g" + (D_PN(_ps, _offset)->user).kind = DECLARE_STATE_FOR; return 0;} + +D_Reduction d_reduction_35_dparser_gram = {1, 13, NULL, d_final_reduction_code_13_35_dparser_gram, 0, 0, 0, 0, 0, 0, NULL}; +int d_final_reduction_code_13_36_dparser_gram(void *_ps, void **_children, int _n_children, int _offset, D_Parser *_parser) { +#line 55 "grammar.g" + (D_PN(_ps, _offset)->user).kind = DECLARE_SAVE_PARSE_TREE; return 0;} + +D_Reduction d_reduction_36_dparser_gram = {1, 13, NULL, d_final_reduction_code_13_36_dparser_gram, 0, 0, 0, 0, 0, 0, NULL}; +int d_final_reduction_code_14_37_dparser_gram(void *_ps, void **_children, int _n_children, int _offset, D_Parser *_parser) { +#line 58 "grammar.g" + new_token((D_PN(_ps, _offset)->globals), (*(D_PN(_children[0], _offset))).start_loc.s, (*(D_PN(_children[0], _offset))).end); return 0;} + +D_Reduction d_reduction_37_dparser_gram = {1, 14, NULL, d_final_reduction_code_14_37_dparser_gram, 0, 0, 0, 0, 0, 0, NULL}; +D_Reduction d_reduction_38_dparser_gram = {4, 15, NULL, NULL, 0, 0, 0, 0, 0, 0, NULL}; +D_Reduction d_reduction_40_dparser_gram = {1, 15, NULL, NULL, 0, 0, 0, 0, 0, 0, NULL}; +int d_final_reduction_code_16_41_dparser_gram(void *_ps, void **_children, int _n_children, int _offset, D_Parser *_parser) { +#line 63 "grammar.g" + (D_PN(_ps, _offset)->globals)->p->regex = 1; return 0;} + +D_Reduction d_reduction_41_dparser_gram = {1, 16, NULL, d_final_reduction_code_16_41_dparser_gram, 0, 0, 0, 0, 0, 0, NULL}; +int d_final_reduction_code_17_42_dparser_gram(void *_ps, void **_children, int _n_children, int _offset, D_Parser *_parser) { +#line 66 "grammar.g" + (D_PN(_ps, _offset)->globals)->p = new_production((D_PN(_ps, _offset)->globals), dup_str((*(D_PN(_children[0], _offset))).start_loc.s, (*(D_PN(_children[0], _offset))).end)); return 0;} + +D_Reduction d_reduction_42_dparser_gram = {1, 17, NULL, d_final_reduction_code_17_42_dparser_gram, 0, 0, 0, 0, 0, 0, NULL}; +D_Reduction d_reduction_43_dparser_gram = {1, 18, NULL, NULL, 0, 0, 0, 0, -1, 0, NULL}; +D_Reduction d_reduction_45_dparser_gram = {2, 19, NULL, NULL, 0, 0, 0, 0, 0, 0, NULL}; +D_Reduction d_reduction_46_dparser_gram = {2, 20, NULL, NULL, 0, 0, 0, 0, -1, 0, NULL}; +D_Reduction d_reduction_47_dparser_gram = {0, 20, NULL, NULL, 0, 0, 0, 0, -1, 0, NULL}; +D_Reduction d_reduction_48_dparser_gram = {2, 21, NULL, NULL, 0, 0, 0, 0, -1, 0, NULL}; +int d_final_reduction_code_22_49_dparser_gram(void *_ps, void **_children, int _n_children, int _offset, D_Parser *_parser) { +#line 71 "grammar.g" + + vec_add(&(D_PN(_ps, _offset)->globals)->p->rules, (D_PN(_ps, _offset)->globals)->r); + return 0;} + +D_Reduction d_reduction_49_dparser_gram = {4, 22, NULL, d_final_reduction_code_22_49_dparser_gram, 0, 0, 0, 0, 0, 0, NULL}; +D_Reduction d_reduction_50_dparser_gram = {2, 23, NULL, NULL, 0, 0, 0, 0, -1, 0, NULL}; +D_Reduction d_reduction_51_dparser_gram = {0, 23, NULL, NULL, 0, 0, 0, 0, -1, 0, NULL}; +D_Reduction d_reduction_52_dparser_gram = {1, 24, NULL, NULL, 0, 0, 0, 0, -1, 0, NULL}; +D_Reduction d_reduction_53_dparser_gram = {0, 24, NULL, NULL, 0, 0, 0, 0, -1, 0, NULL}; +D_Reduction d_reduction_54_dparser_gram = {3, 25, NULL, NULL, 0, 0, 0, 0, -1, 0, NULL}; +D_Reduction d_reduction_55_dparser_gram = {2, 26, NULL, NULL, 0, 0, 0, 0, -1, 0, NULL}; +D_Reduction d_reduction_56_dparser_gram = {0, 26, NULL, NULL, 0, 0, 0, 0, -1, 0, NULL}; +D_Reduction d_reduction_57_dparser_gram = {2, 27, NULL, NULL, 0, 0, 0, 0, -1, 0, NULL}; +D_Reduction d_reduction_58_dparser_gram = {0, 27, NULL, NULL, 0, 0, 0, 0, -1, 0, NULL}; +D_Reduction d_reduction_59_dparser_gram = {2, 28, NULL, NULL, 0, 0, 0, 0, -1, 0, NULL}; +D_Reduction d_reduction_60_dparser_gram = {2, 29, NULL, NULL, 0, 0, 0, 0, -1, 0, NULL}; +D_Reduction d_reduction_61_dparser_gram = {0, 29, NULL, NULL, 0, 0, 0, 0, -1, 0, NULL}; +int d_final_reduction_code_30_62_dparser_gram(void *_ps, void **_children, int _n_children, int _offset, D_Parser *_parser) { +#line 75 "grammar.g" + (D_PN(_ps, _offset)->globals)->r = new_rule((D_PN(_ps, _offset)->globals), (D_PN(_ps, _offset)->globals)->p); return 0;} + +D_Reduction d_reduction_62_dparser_gram = {0, 30, NULL, d_final_reduction_code_30_62_dparser_gram, 0, 0, 0, 0, 0, 0, NULL}; +int d_final_reduction_code_31_63_dparser_gram(void *_ps, void **_children, int _n_children, int _offset, D_Parser *_parser) { +#line 78 "grammar.g" + (D_PN(_ps, _offset)->globals)->e = new_string((D_PN(_ps, _offset)->globals), (*(D_PN(_children[0], _offset))).start_loc.s, (*(D_PN(_children[0], _offset))).end, (D_PN(_ps, _offset)->globals)->r); return 0;} + +D_Reduction d_reduction_63_dparser_gram = {1, 31, NULL, d_final_reduction_code_31_63_dparser_gram, 0, 0, 0, 0, 0, 0, NULL}; +int d_final_reduction_code_31_64_dparser_gram(void *_ps, void **_children, int _n_children, int _offset, D_Parser *_parser) { +#line 79 "grammar.g" + (D_PN(_ps, _offset)->globals)->e = new_string((D_PN(_ps, _offset)->globals), (*(D_PN(_children[0], _offset))).start_loc.s, (*(D_PN(_children[0], _offset))).end, (D_PN(_ps, _offset)->globals)->r); return 0;} + +D_Reduction d_reduction_64_dparser_gram = {1, 31, NULL, d_final_reduction_code_31_64_dparser_gram, 0, 0, 0, 0, 0, 0, NULL}; +int d_final_reduction_code_31_65_dparser_gram(void *_ps, void **_children, int _n_children, int _offset, D_Parser *_parser) { +#line 80 "grammar.g" + (D_PN(_ps, _offset)->globals)->e = new_ident((*(D_PN(_children[0], _offset))).start_loc.s, (*(D_PN(_children[0], _offset))).end, (D_PN(_ps, _offset)->globals)->r); return 0;} + +D_Reduction d_reduction_65_dparser_gram = {1, 31, NULL, d_final_reduction_code_31_65_dparser_gram, 0, 0, 0, 0, 0, 0, NULL}; +int d_final_reduction_code_31_66_dparser_gram(void *_ps, void **_children, int _n_children, int _offset, D_Parser *_parser) { +#line 81 "grammar.g" + (D_PN(_ps, _offset)->globals)->e = new_code((D_PN(_ps, _offset)->globals), (*(D_PN(_children[1], _offset))).start_loc.s, (*(D_PN(_children[1], _offset))).end, (D_PN(_ps, _offset)->globals)->r); return 0;} + +D_Reduction d_reduction_66_dparser_gram = {3, 31, NULL, d_final_reduction_code_31_66_dparser_gram, 0, 0, 0, 0, 0, 0, NULL}; +int d_final_reduction_code_31_67_dparser_gram(void *_ps, void **_children, int _n_children, int _offset, D_Parser *_parser) { +#line 82 "grammar.g" + + (D_PN(_ps, _offset)->globals)->e = new_elem_nterm((D_PN(_ps, _offset)->globals)->p, (D_PN(_children[1], _offset)->user).r); + (D_PN(_ps, _offset)->globals)->p = (D_PN(_children[1], _offset)->user).p; + (D_PN(_ps, _offset)->globals)->r = (D_PN(_children[1], _offset)->user).r; + vec_add(&(D_PN(_ps, _offset)->globals)->r->elems, (D_PN(_ps, _offset)->globals)->e); + return 0;} + +D_Reduction d_reduction_67_dparser_gram = {4, 31, NULL, d_final_reduction_code_31_67_dparser_gram, 0, 0, 0, 0, 0, 0, NULL}; +D_Reduction d_reduction_68_dparser_gram = {2, 32, NULL, NULL, 0, 0, 0, 0, -1, 0, NULL}; +D_Reduction d_reduction_69_dparser_gram = {1, 32, NULL, NULL, 0, 0, 0, 0, -1, 0, NULL}; +D_Reduction d_reduction_70_dparser_gram = {1, 33, NULL, NULL, 0, 0, 0, 0, 0, 0, NULL}; +int d_final_reduction_code_33_71_dparser_gram(void *_ps, void **_children, int _n_children, int _offset, D_Parser *_parser) { +#line 92 "grammar.g" + + Production *p = new_internal_production((D_PN(_ps, _offset)->globals), NULL); + Rule *r = new_rule((D_PN(_ps, _offset)->globals), p); + vec_add(&p->rules, r); + r->speculative_code.code = dup_str((*(D_PN(_children[0], _offset))).start_loc.s + 1, (*(D_PN(_children[0], _offset))).end - 1); + r->speculative_code.line = (*(D_PN(_children[0], _offset))).start_loc.line; + (D_PN(_ps, _offset)->globals)->e = new_elem_nterm(p, (D_PN(_ps, _offset)->globals)->r); + vec_add(&(D_PN(_ps, _offset)->globals)->r->elems, (D_PN(_ps, _offset)->globals)->e); + return 0;} + +D_Reduction d_reduction_71_dparser_gram = {1, 33, NULL, d_final_reduction_code_33_71_dparser_gram, 0, 0, 0, 0, 0, 0, NULL}; +int d_final_reduction_code_33_72_dparser_gram(void *_ps, void **_children, int _n_children, int _offset, D_Parser *_parser) { +#line 101 "grammar.g" + + Production *p = new_internal_production((D_PN(_ps, _offset)->globals), NULL); + Rule *r = new_rule((D_PN(_ps, _offset)->globals), p); + vec_add(&p->rules, r); + r->final_code.code = dup_str((*(D_PN(_children[0], _offset))).start_loc.s + 1, (*(D_PN(_children[0], _offset))).end - 1); + r->final_code.line = (*(D_PN(_children[0], _offset))).start_loc.line; + (D_PN(_ps, _offset)->globals)->e = new_elem_nterm(p, (D_PN(_ps, _offset)->globals)->r); + vec_add(&(D_PN(_ps, _offset)->globals)->r->elems, (D_PN(_ps, _offset)->globals)->e); + return 0;} + +D_Reduction d_reduction_72_dparser_gram = {1, 33, NULL, d_final_reduction_code_33_72_dparser_gram, 0, 0, 0, 0, 0, 0, NULL}; +int d_final_reduction_code_34_73_dparser_gram(void *_ps, void **_children, int _n_children, int _offset, D_Parser *_parser) { +#line 112 "grammar.g" + + (D_PN(_ps, _offset)->user).p = (D_PN(_ps, _offset)->globals)->p; + (D_PN(_ps, _offset)->user).r = (D_PN(_ps, _offset)->globals)->r; + (D_PN(_ps, _offset)->globals)->p = new_internal_production((D_PN(_ps, _offset)->globals), (D_PN(_ps, _offset)->globals)->p); + (D_PN(_ps, _offset)->globals)->r = new_rule((D_PN(_ps, _offset)->globals), (D_PN(_ps, _offset)->globals)->p); + return 0;} + +D_Reduction d_reduction_73_dparser_gram = {0, 34, NULL, d_final_reduction_code_34_73_dparser_gram, 0, 0, 0, 0, 0, 0, NULL}; +int d_final_reduction_code_35_74_dparser_gram(void *_ps, void **_children, int _n_children, int _offset, D_Parser *_parser) { +#line 120 "grammar.g" + + if ((D_PN(_ps, _offset)->globals)->e->kind != ELEM_TERM) + d_fail("terminal priority on non-terminal"); + (D_PN(_ps, _offset)->globals)->e->e.term->term_priority = strtol((*(D_PN(_children[1], _offset))).start_loc.s, NULL, 0); + return 0;} + +D_Reduction d_reduction_74_dparser_gram = {2, 35, NULL, d_final_reduction_code_35_74_dparser_gram, 0, 0, 0, 0, 0, 0, NULL}; +int d_final_reduction_code_35_75_dparser_gram(void *_ps, void **_children, int _n_children, int _offset, D_Parser *_parser) { +#line 125 "grammar.g" + + if ((D_PN(_ps, _offset)->globals)->e->kind != ELEM_TERM) + d_fail("ignore-case (/i) on non-terminal"); + (D_PN(_ps, _offset)->globals)->e->e.term->ignore_case = 1; + return 0;} + +D_Reduction d_reduction_75_dparser_gram = {1, 35, NULL, d_final_reduction_code_35_75_dparser_gram, 0, 0, 0, 0, 0, 0, NULL}; +int d_final_reduction_code_35_76_dparser_gram(void *_ps, void **_children, int _n_children, int _offset, D_Parser *_parser) { +#line 130 "grammar.g" + conditional_EBNF((D_PN(_ps, _offset)->globals)); return 0;} + +D_Reduction d_reduction_76_dparser_gram = {1, 35, NULL, d_final_reduction_code_35_76_dparser_gram, 0, 0, 0, 0, 0, 0, NULL}; +int d_final_reduction_code_35_77_dparser_gram(void *_ps, void **_children, int _n_children, int _offset, D_Parser *_parser) { +#line 131 "grammar.g" + star_EBNF((D_PN(_ps, _offset)->globals)); return 0;} + +D_Reduction d_reduction_77_dparser_gram = {1, 35, NULL, d_final_reduction_code_35_77_dparser_gram, 0, 0, 0, 0, 0, 0, NULL}; +int d_final_reduction_code_35_78_dparser_gram(void *_ps, void **_children, int _n_children, int _offset, D_Parser *_parser) { +#line 132 "grammar.g" + plus_EBNF((D_PN(_ps, _offset)->globals)); return 0;} + +D_Reduction d_reduction_78_dparser_gram = {1, 35, NULL, d_final_reduction_code_35_78_dparser_gram, 0, 0, 0, 0, 0, 0, NULL}; +D_Reduction d_reduction_79_dparser_gram = {2, 36, NULL, NULL, 0, 0, 0, 0, 0, 0, NULL}; +int d_final_reduction_code_37_80_dparser_gram(void *_ps, void **_children, int _n_children, int _offset, D_Parser *_parser) { +#line 137 "grammar.g" + (D_PN(_ps, _offset)->globals)->r->op_assoc = ASSOC_UNARY_RIGHT; return 0;} + +D_Reduction d_reduction_80_dparser_gram = {1, 37, NULL, d_final_reduction_code_37_80_dparser_gram, 0, 0, 0, 0, 0, 0, NULL}; +int d_final_reduction_code_37_81_dparser_gram(void *_ps, void **_children, int _n_children, int _offset, D_Parser *_parser) { +#line 138 "grammar.g" + (D_PN(_ps, _offset)->globals)->r->op_assoc = ASSOC_UNARY_LEFT; return 0;} + +D_Reduction d_reduction_81_dparser_gram = {1, 37, NULL, d_final_reduction_code_37_81_dparser_gram, 0, 0, 0, 0, 0, 0, NULL}; +int d_final_reduction_code_37_82_dparser_gram(void *_ps, void **_children, int _n_children, int _offset, D_Parser *_parser) { +#line 139 "grammar.g" + (D_PN(_ps, _offset)->globals)->r->op_assoc = ASSOC_BINARY_RIGHT; return 0;} + +D_Reduction d_reduction_82_dparser_gram = {1, 37, NULL, d_final_reduction_code_37_82_dparser_gram, 0, 0, 0, 0, 0, 0, NULL}; +int d_final_reduction_code_37_83_dparser_gram(void *_ps, void **_children, int _n_children, int _offset, D_Parser *_parser) { +#line 140 "grammar.g" + (D_PN(_ps, _offset)->globals)->r->op_assoc = ASSOC_BINARY_LEFT; return 0;} + +D_Reduction d_reduction_83_dparser_gram = {1, 37, NULL, d_final_reduction_code_37_83_dparser_gram, 0, 0, 0, 0, 0, 0, NULL}; +int d_final_reduction_code_37_84_dparser_gram(void *_ps, void **_children, int _n_children, int _offset, D_Parser *_parser) { +#line 141 "grammar.g" + (D_PN(_ps, _offset)->globals)->r->rule_assoc = ASSOC_UNARY_RIGHT; return 0;} + +D_Reduction d_reduction_84_dparser_gram = {1, 37, NULL, d_final_reduction_code_37_84_dparser_gram, 0, 0, 0, 0, 0, 0, NULL}; +int d_final_reduction_code_37_85_dparser_gram(void *_ps, void **_children, int _n_children, int _offset, D_Parser *_parser) { +#line 142 "grammar.g" + (D_PN(_ps, _offset)->globals)->r->rule_assoc = ASSOC_UNARY_LEFT; return 0;} + +D_Reduction d_reduction_85_dparser_gram = {1, 37, NULL, d_final_reduction_code_37_85_dparser_gram, 0, 0, 0, 0, 0, 0, NULL}; +int d_final_reduction_code_37_86_dparser_gram(void *_ps, void **_children, int _n_children, int _offset, D_Parser *_parser) { +#line 143 "grammar.g" + (D_PN(_ps, _offset)->globals)->r->rule_assoc = ASSOC_BINARY_RIGHT; return 0;} + +D_Reduction d_reduction_86_dparser_gram = {1, 37, NULL, d_final_reduction_code_37_86_dparser_gram, 0, 0, 0, 0, 0, 0, NULL}; +int d_final_reduction_code_37_87_dparser_gram(void *_ps, void **_children, int _n_children, int _offset, D_Parser *_parser) { +#line 144 "grammar.g" + (D_PN(_ps, _offset)->globals)->r->rule_assoc = ASSOC_BINARY_LEFT; return 0;} + +D_Reduction d_reduction_87_dparser_gram = {1, 37, NULL, d_final_reduction_code_37_87_dparser_gram, 0, 0, 0, 0, 0, 0, NULL}; +int d_final_reduction_code_37_88_dparser_gram(void *_ps, void **_children, int _n_children, int _offset, D_Parser *_parser) { +#line 145 "grammar.g" + (D_PN(_ps, _offset)->globals)->r->rule_assoc = ASSOC_NARY_RIGHT; return 0;} + +D_Reduction d_reduction_88_dparser_gram = {1, 37, NULL, d_final_reduction_code_37_88_dparser_gram, 0, 0, 0, 0, 0, 0, NULL}; +int d_final_reduction_code_37_89_dparser_gram(void *_ps, void **_children, int _n_children, int _offset, D_Parser *_parser) { +#line 146 "grammar.g" + (D_PN(_ps, _offset)->globals)->r->rule_assoc = ASSOC_NARY_LEFT; return 0;} + +D_Reduction d_reduction_89_dparser_gram = {1, 37, NULL, d_final_reduction_code_37_89_dparser_gram, 0, 0, 0, 0, 0, 0, NULL}; +int d_final_reduction_code_38_90_dparser_gram(void *_ps, void **_children, int _n_children, int _offset, D_Parser *_parser) { +#line 149 "grammar.g" + + if ((D_PN(_ps, _offset)->globals)->r->op_assoc) (D_PN(_ps, _offset)->globals)->r->op_priority = strtol((*(D_PN(_children[0], _offset))).start_loc.s, NULL, 0); + else (D_PN(_ps, _offset)->globals)->r->rule_priority = strtol((*(D_PN(_children[0], _offset))).start_loc.s, NULL, 0); + return 0;} + +D_Reduction d_reduction_90_dparser_gram = {1, 38, NULL, d_final_reduction_code_38_90_dparser_gram, 0, 0, 0, 0, 0, 0, NULL}; +D_Reduction d_reduction_91_dparser_gram = {3, 39, NULL, NULL, 0, 0, 0, 0, 0, 0, NULL}; +D_Reduction d_reduction_92_dparser_gram = {2, 40, NULL, NULL, 0, 0, 0, 0, -1, 0, NULL}; +D_Reduction d_reduction_93_dparser_gram = {0, 40, NULL, NULL, 0, 0, 0, 0, -1, 0, NULL}; +D_Reduction d_reduction_94_dparser_gram = {1, 41, NULL, NULL, 0, 0, 0, 0, -1, 0, NULL}; +D_Reduction d_reduction_95_dparser_gram = {0, 41, NULL, NULL, 0, 0, 0, 0, -1, 0, NULL}; +D_Reduction d_reduction_96_dparser_gram = {1, 42, NULL, NULL, 0, 0, 0, 0, -1, 0, NULL}; +D_Reduction d_reduction_97_dparser_gram = {0, 42, NULL, NULL, 0, 0, 0, 0, -1, 0, NULL}; +int d_final_reduction_code_43_98_dparser_gram(void *_ps, void **_children, int _n_children, int _offset, D_Parser *_parser) { +#line 156 "grammar.g" + + (D_PN(_ps, _offset)->globals)->r->speculative_code.code = dup_str((*(D_PN(_children[0], _offset))).start_loc.s + 1, (*(D_PN(_children[0], _offset))).end - 1); + (D_PN(_ps, _offset)->globals)->r->speculative_code.line = (*(D_PN(_children[0], _offset))).start_loc.line; + return 0;} + +D_Reduction d_reduction_98_dparser_gram = {1, 43, NULL, d_final_reduction_code_43_98_dparser_gram, 0, 0, 0, 0, 0, 0, NULL}; +int d_final_reduction_code_44_99_dparser_gram(void *_ps, void **_children, int _n_children, int _offset, D_Parser *_parser) { +#line 161 "grammar.g" + + (D_PN(_ps, _offset)->globals)->r->final_code.code = dup_str((*(D_PN(_children[0], _offset))).start_loc.s + 1, (*(D_PN(_children[0], _offset))).end - 1); + (D_PN(_ps, _offset)->globals)->r->final_code.line = (*(D_PN(_children[0], _offset))).start_loc.line; + return 0;} + +D_Reduction d_reduction_99_dparser_gram = {1, 44, NULL, d_final_reduction_code_44_99_dparser_gram, 0, 0, 0, 0, 0, 0, NULL}; +int d_final_reduction_code_45_100_dparser_gram(void *_ps, void **_children, int _n_children, int _offset, D_Parser *_parser) { +#line 166 "grammar.g" + + add_pass_code((D_PN(_ps, _offset)->globals), (D_PN(_ps, _offset)->globals)->r, (*(D_PN(_children[0], _offset))).start_loc.s, (*(D_PN(_children[0], _offset))).end, (*(D_PN(_children[2], _offset))).start_loc.s+1, + (*(D_PN(_children[2], _offset))).end-1, (*(D_PN(_children[0], _offset))).start_loc.line, (*(D_PN(_children[2], _offset))).start_loc.line); + return 0;} + +D_Reduction d_reduction_100_dparser_gram = {3, 45, NULL, d_final_reduction_code_45_100_dparser_gram, 0, 0, 0, 0, 0, 0, NULL}; +D_Reduction d_reduction_101_dparser_gram = {3, 46, NULL, NULL, 0, 0, 0, 0, 0, 0, NULL}; +D_Reduction d_reduction_102_dparser_gram = {2, 47, NULL, NULL, 0, 0, 0, 0, -1, 0, NULL}; +D_Reduction d_reduction_103_dparser_gram = {0, 47, NULL, NULL, 0, 0, 0, 0, -1, 0, NULL}; +D_Reduction d_reduction_104_dparser_gram = {3, 48, NULL, NULL, 0, 0, 0, 0, 0, 0, NULL}; +D_Reduction d_reduction_105_dparser_gram = {2, 49, NULL, NULL, 0, 0, 0, 0, -1, 0, NULL}; +D_Reduction d_reduction_106_dparser_gram = {0, 49, NULL, NULL, 0, 0, 0, 0, -1, 0, NULL}; +D_Reduction d_reduction_107_dparser_gram = {3, 50, NULL, NULL, 0, 0, 0, 0, 0, 0, NULL}; +D_Reduction d_reduction_110_dparser_gram = {1, 50, NULL, NULL, 0, 0, 0, 0, 0, 0, NULL}; +D_Reduction d_reduction_115_dparser_gram = {2, 51, NULL, NULL, 0, 0, 0, 0, -1, 0, NULL}; +D_Reduction d_reduction_116_dparser_gram = {0, 51, NULL, NULL, 0, 0, 0, 0, -1, 0, NULL}; +D_Reduction d_reduction_117_dparser_gram = {2, 52, NULL, NULL, 0, 0, 0, 0, -1, 0, NULL}; +D_Reduction d_reduction_118_dparser_gram = {0, 52, NULL, NULL, 0, 0, 0, 0, -1, 0, NULL}; +D_Reduction d_reduction_119_dparser_gram = {2, 53, NULL, NULL, 0, 0, 0, 0, -1, 0, NULL}; +D_Reduction d_reduction_120_dparser_gram = {0, 53, NULL, NULL, 0, 0, 0, 0, -1, 0, NULL}; +D_Reduction d_reduction_121_dparser_gram = {1, 54, NULL, NULL, 0, 0, 0, 0, 0, 0, NULL}; +D_Reduction d_reduction_122_dparser_gram = {1, 55, NULL, NULL, 0, 0, 0, 0, 0, 0, NULL}; +D_Reduction d_reduction_123_dparser_gram = {1, 56, NULL, NULL, 0, 0, 0, 0, 0, 0, NULL}; +D_Reduction d_reduction_124_dparser_gram = {1, 57, NULL, NULL, 0, 0, 0, 0, 0, 0, NULL}; +D_Reduction d_reduction_125_dparser_gram = {1, 58, NULL, NULL, 0, 0, 0, 0, 0, 0, NULL}; +D_Reduction d_reduction_128_dparser_gram = {1, 59, NULL, NULL, 0, 0, 0, 0, 0, 0, NULL}; +D_Reduction d_reduction_129_dparser_gram = {1, 60, NULL, NULL, 0, 0, 0, 0, 0, 0, NULL}; +D_Reduction d_reduction_130_dparser_gram = {1, 61, NULL, NULL, 0, 0, 0, 0, 0, 0, NULL}; +D_Shift d_shift_0_dparser_gram = { 62, 0, 0, 0, 0, NULL }; +D_Shift d_shift_1_dparser_gram = { 63, 0, 0, 0, 0, NULL }; +D_Shift d_shift_2_dparser_gram = { 64, 0, 0, 0, 0, NULL }; +D_Shift d_shift_3_dparser_gram = { 65, 0, 0, 0, 0, NULL }; +D_Shift d_shift_4_dparser_gram = { 66, 0, 0, 0, 0, NULL }; +D_Shift d_shift_5_dparser_gram = { 67, 0, 0, 0, 0, NULL }; +D_Shift d_shift_6_dparser_gram = { 68, 0, 0, 0, 0, NULL }; +D_Shift d_shift_7_dparser_gram = { 69, 0, 0, 0, 0, NULL }; +D_Shift d_shift_8_dparser_gram = { 70, 0, 0, 0, 0, NULL }; +D_Shift d_shift_9_dparser_gram = { 71, 0, 0, 0, 0, NULL }; +D_Shift d_shift_10_dparser_gram = { 72, 0, 0, 0, 0, NULL }; +D_Shift d_shift_11_dparser_gram = { 73, 0, 0, 0, 0, NULL }; +D_Shift d_shift_12_dparser_gram = { 74, 0, 0, 0, 0, NULL }; +D_Shift d_shift_13_dparser_gram = { 75, 0, 0, 0, 0, NULL }; +D_Shift d_shift_14_dparser_gram = { 76, 0, 0, 0, 0, NULL }; +D_Shift d_shift_15_dparser_gram = { 77, 0, 0, 0, 0, NULL }; +D_Shift d_shift_16_dparser_gram = { 78, 0, 0, 0, 0, NULL }; +D_Shift d_shift_17_dparser_gram = { 79, 0, 0, 0, 0, NULL }; +D_Shift d_shift_18_dparser_gram = { 80, 0, 0, 0, 0, NULL }; +D_Shift d_shift_19_dparser_gram = { 81, 0, 0, 0, 0, NULL }; +D_Shift d_shift_20_dparser_gram = { 82, 0, 0, 0, 0, NULL }; +D_Shift d_shift_21_dparser_gram = { 83, 0, 0, 0, 0, NULL }; +D_Shift d_shift_22_dparser_gram = { 84, 0, 0, 0, 0, NULL }; +D_Shift d_shift_23_dparser_gram = { 85, 0, 0, 0, 0, NULL }; +D_Shift d_shift_24_dparser_gram = { 86, 0, 0, 0, 0, NULL }; +D_Shift d_shift_25_dparser_gram = { 87, 0, 0, 0, 0, NULL }; +D_Shift d_shift_26_dparser_gram = { 88, 0, 0, 0, 0, NULL }; +D_Shift d_shift_27_dparser_gram = { 89, 0, 0, 0, 0, NULL }; +D_Shift d_shift_28_dparser_gram = { 90, 0, 0, 0, 0, NULL }; +D_Shift d_shift_29_dparser_gram = { 91, 0, 0, 0, 0, NULL }; +D_Shift d_shift_30_dparser_gram = { 92, 0, 0, 0, 0, NULL }; +D_Shift d_shift_31_dparser_gram = { 93, 0, 0, 0, 0, NULL }; +D_Shift d_shift_32_dparser_gram = { 94, 0, 0, 0, 0, NULL }; +D_Shift d_shift_33_dparser_gram = { 95, 0, 0, 0, 0, NULL }; +D_Shift d_shift_34_dparser_gram = { 96, 0, 0, 0, 0, NULL }; +D_Shift d_shift_35_dparser_gram = { 97, 0, 0, 0, 0, NULL }; +D_Shift d_shift_36_dparser_gram = { 98, 0, 0, 0, 0, NULL }; +D_Shift d_shift_37_dparser_gram = { 99, 0, 0, 0, 0, NULL }; +D_Shift d_shift_38_dparser_gram = { 100, 0, 0, 0, 0, NULL }; +D_Shift d_shift_39_dparser_gram = { 101, 0, 0, 0, 0, NULL }; +D_Shift d_shift_40_dparser_gram = { 102, 0, 0, 0, 0, NULL }; +D_Shift d_shift_41_dparser_gram = { 103, 0, 0, 0, 0, NULL }; +D_Shift d_shift_42_dparser_gram = { 104, 0, 0, 0, 0, NULL }; +D_Shift d_shift_43_dparser_gram = { 105, 0, 0, 0, 0, NULL }; +D_Shift d_shift_44_dparser_gram = { 106, 0, 0, 0, 0, NULL }; +D_Shift d_shift_45_dparser_gram = { 107, 0, 0, 0, 0, NULL }; +D_Shift d_shift_46_dparser_gram = { 108, 0, 0, 0, 0, NULL }; +D_Shift d_shift_47_dparser_gram = { 109, 0, 0, 0, 0, NULL }; +D_Shift d_shift_48_dparser_gram = { 110, 0, 0, 0, 0, NULL }; +D_Shift d_shift_49_dparser_gram = { 111, 0, 0, 0, 0, NULL }; +D_Shift d_shift_50_dparser_gram = { 112, 0, 0, 0, 0, NULL }; +D_Shift d_shift_51_dparser_gram = { 113, 0, 0, 0, 0, NULL }; +D_Shift d_shift_52_dparser_gram = { 114, 0, 0, 0, 0, NULL }; +D_Shift d_shift_53_dparser_gram = { 115, 0, 0, 0, 0, NULL }; +D_Shift d_shift_54_dparser_gram = { 116, 0, 0, 0, 0, NULL }; +D_Shift d_shift_55_dparser_gram = { 117, 0, 0, 0, 0, NULL }; +D_Shift d_shift_56_dparser_gram = { 118, 0, 0, 0, 0, NULL }; +D_Shift d_shift_57_dparser_gram = { 119, 0, 0, 0, 0, NULL }; +D_Shift d_shift_58_dparser_gram = { 120, 0, 0, 0, 0, NULL }; +D_Shift d_shift_59_dparser_gram = { 121, 0, 0, 0, 0, NULL }; +D_Shift d_shift_60_dparser_gram = { 122, 0, 0, 0, 0, NULL }; +D_Shift d_shift_61_dparser_gram = { 123, 0, 0, 0, 0, NULL }; +D_Shift d_shift_62_dparser_gram = { 124, 0, 0, 0, -1, NULL }; +D_Shift d_shift_63_dparser_gram = { 125, 0, 0, 0, 0, NULL }; +D_Shift d_shift_64_dparser_gram = { 126, 0, 0, 0, 0, NULL }; +D_Shift d_shift_65_dparser_gram = { 127, 0, 0, 0, 0, NULL }; + +D_Shift *d_shifts_3_dparser_gram[] = { +&d_shift_0_dparser_gram, &d_shift_2_dparser_gram, &d_shift_4_dparser_gram, &d_shift_6_dparser_gram, &d_shift_7_dparser_gram, &d_shift_23_dparser_gram, &d_shift_27_dparser_gram, &d_shift_49_dparser_gram, &d_shift_62_dparser_gram, NULL}; + +D_Shift *d_accepts_diff_3_0_dparser_gram[] = {0}; +D_Shift *d_accepts_diff_3_1_dparser_gram[] = {&d_shift_27_dparser_gram,0}; +D_Shift **d_accepts_diff_3_dparser_gram[] = { +d_accepts_diff_3_0_dparser_gram, +d_accepts_diff_3_1_dparser_gram +}; + +unsigned char d_scanner_3_0_0_dparser_gram[SCANNER_BLOCK_SIZE] = { +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,3,0,0,0,0, +}; + +unsigned char d_accepts_diff_3_0_0_dparser_gram[SCANNER_BLOCK_SIZE] = { +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +}; + +unsigned char d_scanner_3_0_1_dparser_gram[SCANNER_BLOCK_SIZE] = { +0,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4, +4,4,4,4,4,4,4,4,4,4,4,0,0,0,0,5, +0,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4, +4,4,4,4,4,4,4,4,4,4,4,6,0,0,0,0, +}; + +unsigned char d_scanner_3_0_2_dparser_gram[SCANNER_BLOCK_SIZE] = { +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +}; + +unsigned char d_scanner_3_1_1_dparser_gram[SCANNER_BLOCK_SIZE] = { +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,7,0,0,0,0, +}; + +D_Shift *d_shift_3_2_dparser_gram[] = { &d_shift_23_dparser_gram, NULL}; + +unsigned char d_scanner_3_3_0_dparser_gram[SCANNER_BLOCK_SIZE] = { +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +4,4,4,4,4,4,4,4,4,4,0,0,0,0,0,0, +}; + +unsigned char d_scanner_3_3_1_dparser_gram[SCANNER_BLOCK_SIZE] = { +0,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4, +4,4,4,4,4,4,4,4,4,4,4,0,0,0,0,4, +0,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4, +4,4,4,4,4,4,4,4,4,4,4,0,0,0,0,0, +}; + +D_Shift *d_shift_3_3_dparser_gram[] = { &d_shift_62_dparser_gram, NULL}; + +unsigned char d_accepts_diff_3_4_0_dparser_gram[SCANNER_BLOCK_SIZE] = { +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0, +}; + +unsigned char d_accepts_diff_3_4_1_dparser_gram[SCANNER_BLOCK_SIZE] = { +0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, +1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,1, +0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, +1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0, +}; + +D_Shift *d_shift_3_4_dparser_gram[] = { &d_shift_27_dparser_gram, NULL}; + +D_Shift *d_shift_3_5_dparser_gram[] = { &d_shift_49_dparser_gram, NULL}; + +unsigned char d_scanner_3_6_1_dparser_gram[SCANNER_BLOCK_SIZE] = { +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,8,0,0,9,0,0,0,0,0,0,0,0,0,0,0, +10,0,0,11,12,0,0,0,0,0,0,0,0,0,0,0, +}; + +unsigned char d_scanner_3_7_1_dparser_gram[SCANNER_BLOCK_SIZE] = { +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,13,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +}; + +unsigned char d_scanner_3_8_1_dparser_gram[SCANNER_BLOCK_SIZE] = { +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,14,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +}; + +unsigned char d_scanner_3_9_1_dparser_gram[SCANNER_BLOCK_SIZE] = { +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,15,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +}; + +unsigned char d_scanner_3_10_1_dparser_gram[SCANNER_BLOCK_SIZE] = { +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,16,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +}; + +unsigned char d_scanner_3_11_1_dparser_gram[SCANNER_BLOCK_SIZE] = { +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,17, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +}; + +unsigned char d_scanner_3_12_1_dparser_gram[SCANNER_BLOCK_SIZE] = { +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,18,0,0,0,0,0,0,0,0,0,0,0, +}; + +unsigned char d_scanner_3_13_1_dparser_gram[SCANNER_BLOCK_SIZE] = { +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,19,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +}; + +unsigned char d_scanner_3_14_1_dparser_gram[SCANNER_BLOCK_SIZE] = { +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,20,0,0,0,0,0,0,0,0,0,0,0,0, +}; + +unsigned char d_scanner_3_15_1_dparser_gram[SCANNER_BLOCK_SIZE] = { +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,21,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +}; + +unsigned char d_scanner_3_16_1_dparser_gram[SCANNER_BLOCK_SIZE] = { +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,22,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +}; + +unsigned char d_scanner_3_17_1_dparser_gram[SCANNER_BLOCK_SIZE] = { +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,23,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +}; + +unsigned char d_scanner_3_18_1_dparser_gram[SCANNER_BLOCK_SIZE] = { +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,24,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +}; + +unsigned char d_scanner_3_19_1_dparser_gram[SCANNER_BLOCK_SIZE] = { +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,25,0,0,0,0,0,0,0,0,0,0,0,0, +}; + +unsigned char d_scanner_3_20_1_dparser_gram[SCANNER_BLOCK_SIZE] = { +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,26,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +}; + +unsigned char d_scanner_3_21_1_dparser_gram[SCANNER_BLOCK_SIZE] = { +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,27,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +}; + +unsigned char d_scanner_3_22_1_dparser_gram[SCANNER_BLOCK_SIZE] = { +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,28, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +}; + +unsigned char d_scanner_3_23_1_dparser_gram[SCANNER_BLOCK_SIZE] = { +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,29,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +}; + +D_Shift *d_shift_3_24_dparser_gram[] = { &d_shift_7_dparser_gram, NULL}; + +unsigned char d_scanner_3_25_1_dparser_gram[SCANNER_BLOCK_SIZE] = { +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,30,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +}; + +unsigned char d_scanner_3_26_1_dparser_gram[SCANNER_BLOCK_SIZE] = { +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,31,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +}; + +unsigned char d_scanner_3_27_1_dparser_gram[SCANNER_BLOCK_SIZE] = { +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,32,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +}; + +unsigned char d_scanner_3_28_1_dparser_gram[SCANNER_BLOCK_SIZE] = { +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,33,0,0,0,0,0,0,0,0,0,0,0,0,0, +}; + +unsigned char d_scanner_3_29_1_dparser_gram[SCANNER_BLOCK_SIZE] = { +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,34,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +}; + +D_Shift *d_shift_3_30_dparser_gram[] = { &d_shift_4_dparser_gram, NULL}; + +unsigned char d_scanner_3_31_1_dparser_gram[SCANNER_BLOCK_SIZE] = { +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,35,0,0, +}; + +unsigned char d_scanner_3_32_1_dparser_gram[SCANNER_BLOCK_SIZE] = { +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,36,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +}; + +unsigned char d_scanner_3_33_1_dparser_gram[SCANNER_BLOCK_SIZE] = { +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,37,0,0,0,0,0,0,0,0,0,0,0,0,0, +}; + +D_Shift *d_shift_3_34_dparser_gram[] = { &d_shift_6_dparser_gram, NULL}; + +D_Shift *d_shift_3_35_dparser_gram[] = { &d_shift_2_dparser_gram, NULL}; + +D_Shift *d_shift_3_36_dparser_gram[] = { &d_shift_0_dparser_gram, NULL}; + +D_Shift *d_shifts_4_dparser_gram[] = { +&d_shift_31_dparser_gram, &d_shift_49_dparser_gram, &d_shift_51_dparser_gram, &d_shift_59_dparser_gram, &d_shift_60_dparser_gram, &d_shift_61_dparser_gram, &d_shift_62_dparser_gram, &d_shift_63_dparser_gram, &d_shift_64_dparser_gram, &d_shift_65_dparser_gram, NULL}; + +D_Shift *d_accepts_diff_4_0_dparser_gram[] = {0}; +D_Shift *d_accepts_diff_4_1_dparser_gram[] = {&d_shift_59_dparser_gram,0}; +D_Shift *d_accepts_diff_4_2_dparser_gram[] = {&d_shift_65_dparser_gram,0}; +D_Shift **d_accepts_diff_4_dparser_gram[] = { +d_accepts_diff_4_0_dparser_gram, +d_accepts_diff_4_1_dparser_gram, +d_accepts_diff_4_2_dparser_gram +}; + +unsigned char d_scanner_4_0_0_dparser_gram[SCANNER_BLOCK_SIZE] = { +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,2,3,2,2,2,2,4,5,0,2,2,2,6,2,2, +7,8,8,8,8,8,8,8,8,8,2,2,2,2,2,2, +}; + +unsigned char d_scanner_4_0_1_dparser_gram[SCANNER_BLOCK_SIZE] = { +2,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9, +9,9,9,9,9,9,9,9,9,9,9,10,2,0,2,11, +2,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9, +9,9,9,9,9,9,9,9,9,9,9,12,2,0,2,0, +}; + +D_Shift *d_shift_4_1_dparser_gram[] = { &d_shift_59_dparser_gram, NULL}; + +unsigned char d_scanner_4_2_0_dparser_gram[SCANNER_BLOCK_SIZE] = { +0,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13, +13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13, +13,13,14,13,13,13,13,13,13,13,13,13,13,13,13,13, +13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13, +}; + +unsigned char d_scanner_4_2_1_dparser_gram[SCANNER_BLOCK_SIZE] = { +13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13, +13,13,13,13,13,13,13,13,13,13,13,13,15,13,13,13, +13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13, +13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13, +}; + +unsigned char d_scanner_4_2_2_dparser_gram[SCANNER_BLOCK_SIZE] = { +13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13, +13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13, +13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13, +13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13, +}; + +unsigned char d_scanner_4_3_0_dparser_gram[SCANNER_BLOCK_SIZE] = { +0,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, +16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, +16,16,16,16,16,16,16,17,16,16,16,16,16,16,16,16, +16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, +}; + +unsigned char d_scanner_4_3_1_dparser_gram[SCANNER_BLOCK_SIZE] = { +16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, +16,16,16,16,16,16,16,16,16,16,16,16,18,16,16,16, +16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, +16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, +}; + +unsigned char d_scanner_4_3_2_dparser_gram[SCANNER_BLOCK_SIZE] = { +16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, +16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, +16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, +16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, +}; + +D_Shift *d_shift_4_4_dparser_gram[] = { &d_shift_31_dparser_gram, NULL}; + +unsigned char d_scanner_4_5_0_dparser_gram[SCANNER_BLOCK_SIZE] = { +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +7,8,8,8,8,8,8,8,8,8,0,0,0,0,0,0, +}; + +D_Shift *d_shift_4_5_dparser_gram[] = { &d_shift_59_dparser_gram, NULL}; + +unsigned char d_scanner_4_6_0_dparser_gram[SCANNER_BLOCK_SIZE] = { +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +19,19,19,19,19,19,19,19,0,0,0,0,0,0,0,0, +}; + +unsigned char d_scanner_4_6_1_dparser_gram[SCANNER_BLOCK_SIZE] = { +0,0,0,0,0,0,0,0,0,0,0,0,20,0,0,0, +0,0,0,0,0,20,0,0,21,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,20,0,0,0, +0,0,0,0,0,20,0,0,22,0,0,0,0,0,0,0, +}; + +unsigned char d_accepts_diff_4_6_1_dparser_gram[SCANNER_BLOCK_SIZE] = { +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0, +}; + +D_Shift *d_shift_4_6_dparser_gram[] = { &d_shift_65_dparser_gram, NULL}; + +unsigned char d_scanner_4_7_0_dparser_gram[SCANNER_BLOCK_SIZE] = { +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +8,8,8,8,8,8,8,8,8,8,0,0,0,0,0,0, +}; + +unsigned char d_scanner_4_7_1_dparser_gram[SCANNER_BLOCK_SIZE] = { +0,0,0,0,0,0,0,0,0,0,0,0,23,0,0,0, +0,0,0,0,0,23,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,23,0,0,0, +0,0,0,0,0,23,0,0,0,0,0,0,0,0,0,0, +}; + +D_Shift *d_shift_4_7_dparser_gram[] = { &d_shift_63_dparser_gram, NULL}; + +unsigned char d_scanner_4_8_0_dparser_gram[SCANNER_BLOCK_SIZE] = { +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +9,9,9,9,9,9,9,9,9,9,0,0,0,0,0,0, +}; + +unsigned char d_scanner_4_8_1_dparser_gram[SCANNER_BLOCK_SIZE] = { +0,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9, +9,9,9,9,9,9,9,9,9,9,9,0,0,0,0,9, +0,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9, +9,9,9,9,9,9,9,9,9,9,9,0,0,0,0,0, +}; + +D_Shift *d_shift_4_9_dparser_gram[] = { &d_shift_51_dparser_gram, NULL}; + +D_Shift *d_shift_4_10_dparser_gram[] = { &d_shift_59_dparser_gram, NULL}; + +D_Shift *d_shift_4_13_dparser_gram[] = { &d_shift_61_dparser_gram, NULL}; + +unsigned char d_scanner_4_14_0_dparser_gram[SCANNER_BLOCK_SIZE] = { +0,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24, +24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24, +24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24, +24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24, +}; + +unsigned char d_scanner_4_14_1_dparser_gram[SCANNER_BLOCK_SIZE] = { +24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24, +24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24, +24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24, +24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24, +}; + +D_Shift *d_shift_4_16_dparser_gram[] = { &d_shift_60_dparser_gram, NULL}; + +unsigned char d_scanner_4_17_0_dparser_gram[SCANNER_BLOCK_SIZE] = { +0,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25, +25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25, +25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25, +25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25, +}; + +unsigned char d_scanner_4_17_1_dparser_gram[SCANNER_BLOCK_SIZE] = { +25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25, +25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25, +25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25, +25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25, +}; + +unsigned char d_scanner_4_18_1_dparser_gram[SCANNER_BLOCK_SIZE] = { +0,0,0,0,0,0,0,0,0,0,0,0,20,0,0,0, +0,0,0,0,0,20,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,20,0,0,0, +0,0,0,0,0,20,0,0,0,0,0,0,0,0,0,0, +}; + +D_Shift *d_shift_4_18_dparser_gram[] = { &d_shift_65_dparser_gram, NULL}; + +D_Shift *d_shift_4_19_dparser_gram[] = { &d_shift_65_dparser_gram, NULL}; + +unsigned char d_scanner_4_20_0_dparser_gram[SCANNER_BLOCK_SIZE] = { +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +26,26,26,26,26,26,26,26,26,26,0,0,0,0,0,0, +}; + +unsigned char d_scanner_4_20_1_dparser_gram[SCANNER_BLOCK_SIZE] = { +0,26,26,26,26,26,26,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,26,26,26,26,26,26,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +}; + +D_Shift *d_shift_4_22_dparser_gram[] = { &d_shift_63_dparser_gram, NULL}; + +unsigned char d_scanner_4_25_1_dparser_gram[SCANNER_BLOCK_SIZE] = { +0,26,26,26,26,26,26,0,0,0,0,0,27,0,0,0, +0,0,0,0,0,27,0,0,0,0,0,0,0,0,0,0, +0,26,26,26,26,26,26,0,0,0,0,0,27,0,0,0, +0,0,0,0,0,27,0,0,0,0,0,0,0,0,0,0, +}; + +D_Shift *d_shift_4_25_dparser_gram[] = { &d_shift_64_dparser_gram, NULL}; + +D_Shift *d_shift_4_26_dparser_gram[] = { &d_shift_64_dparser_gram, NULL}; + +D_Shift *d_shifts_5_dparser_gram[] = { +&d_shift_14_dparser_gram, &d_shift_15_dparser_gram, &d_shift_16_dparser_gram, &d_shift_17_dparser_gram, &d_shift_18_dparser_gram, &d_shift_19_dparser_gram, &d_shift_20_dparser_gram, &d_shift_21_dparser_gram, NULL}; + +D_Shift *d_accepts_diff_5_0_dparser_gram[] = {0}; +D_Shift **d_accepts_diff_5_dparser_gram[] = { +d_accepts_diff_5_0_dparser_gram +}; + +unsigned char d_scanner_5_0_1_dparser_gram[SCANNER_BLOCK_SIZE] = { +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,2,0,0,0,0,0,0,0,0,0,0,3,0,0,0, +0,0,0,4,5,0,0,6,0,0,0,0,0,0,0,0, +}; + +unsigned char d_scanner_5_1_1_dparser_gram[SCANNER_BLOCK_SIZE] = { +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,7,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +}; + +unsigned char d_scanner_5_2_1_dparser_gram[SCANNER_BLOCK_SIZE] = { +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,8, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +}; + +unsigned char d_scanner_5_3_1_dparser_gram[SCANNER_BLOCK_SIZE] = { +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,9,0,0,0,10,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,11,0,0,0,0,0,0,0,0,0,0, +}; + +unsigned char d_scanner_5_4_1_dparser_gram[SCANNER_BLOCK_SIZE] = { +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,12, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +}; + +unsigned char d_scanner_5_5_1_dparser_gram[SCANNER_BLOCK_SIZE] = { +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,13,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +}; + +unsigned char d_scanner_5_6_1_dparser_gram[SCANNER_BLOCK_SIZE] = { +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,14,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +}; + +unsigned char d_scanner_5_7_1_dparser_gram[SCANNER_BLOCK_SIZE] = { +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,15,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +}; + +unsigned char d_scanner_5_8_1_dparser_gram[SCANNER_BLOCK_SIZE] = { +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,16,0,0,0,0,0,0,0,0,0, +}; + +unsigned char d_scanner_5_9_1_dparser_gram[SCANNER_BLOCK_SIZE] = { +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,17,0,0,0,0,0,0,0,0,0,0,0, +}; + +unsigned char d_scanner_5_10_1_dparser_gram[SCANNER_BLOCK_SIZE] = { +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,18,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +}; + +unsigned char d_scanner_5_11_1_dparser_gram[SCANNER_BLOCK_SIZE] = { +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,19,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +}; + +unsigned char d_scanner_5_12_1_dparser_gram[SCANNER_BLOCK_SIZE] = { +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,20,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +}; + +unsigned char d_scanner_5_13_1_dparser_gram[SCANNER_BLOCK_SIZE] = { +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,21, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +}; + +unsigned char d_scanner_5_14_1_dparser_gram[SCANNER_BLOCK_SIZE] = { +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,22,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +}; + +unsigned char d_scanner_5_15_1_dparser_gram[SCANNER_BLOCK_SIZE] = { +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,23,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +}; + +unsigned char d_scanner_5_16_1_dparser_gram[SCANNER_BLOCK_SIZE] = { +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,24, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +}; + +unsigned char d_scanner_5_17_1_dparser_gram[SCANNER_BLOCK_SIZE] = { +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +25,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +}; + +unsigned char d_scanner_5_18_1_dparser_gram[SCANNER_BLOCK_SIZE] = { +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,26,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +}; + +unsigned char d_scanner_5_19_1_dparser_gram[SCANNER_BLOCK_SIZE] = { +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,27,0,0,0,0,0,0,0,0,0,0,0, +}; + +unsigned char d_scanner_5_20_1_dparser_gram[SCANNER_BLOCK_SIZE] = { +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,28,0,0, +0,0,0,29,0,0,0,0,0,0,0,0,0,0,0,0, +}; + +unsigned char d_scanner_5_21_1_dparser_gram[SCANNER_BLOCK_SIZE] = { +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,30,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +}; + +unsigned char d_scanner_5_22_1_dparser_gram[SCANNER_BLOCK_SIZE] = { +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,31, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +}; + +unsigned char d_scanner_5_23_1_dparser_gram[SCANNER_BLOCK_SIZE] = { +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,32, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +}; + +unsigned char d_scanner_5_24_1_dparser_gram[SCANNER_BLOCK_SIZE] = { +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,33,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +}; + +unsigned char d_scanner_5_25_1_dparser_gram[SCANNER_BLOCK_SIZE] = { +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,34,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +}; + +unsigned char d_scanner_5_26_1_dparser_gram[SCANNER_BLOCK_SIZE] = { +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,35,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +}; + +unsigned char d_scanner_5_27_1_dparser_gram[SCANNER_BLOCK_SIZE] = { +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,36,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +}; + +unsigned char d_scanner_5_28_1_dparser_gram[SCANNER_BLOCK_SIZE] = { +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,37,0,0,0,0,0,0,0,0,0,0, +}; + +unsigned char d_scanner_5_29_1_dparser_gram[SCANNER_BLOCK_SIZE] = { +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,38,0,0,0,0,0,0,0,0,0,0,0,0, +}; + +unsigned char d_scanner_5_30_1_dparser_gram[SCANNER_BLOCK_SIZE] = { +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +39,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +}; + +unsigned char d_scanner_5_31_1_dparser_gram[SCANNER_BLOCK_SIZE] = { +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +40,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +}; + +unsigned char d_scanner_5_32_1_dparser_gram[SCANNER_BLOCK_SIZE] = { +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,41,0,0,0,0,0,0,0,0,0,0,0,0,0, +}; + +unsigned char d_scanner_5_33_1_dparser_gram[SCANNER_BLOCK_SIZE] = { +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,42,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +}; + +unsigned char d_scanner_5_34_1_dparser_gram[SCANNER_BLOCK_SIZE] = { +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,43,0,0,0,0,0,0,0,0,0,0,0,0, +}; + +unsigned char d_scanner_5_35_1_dparser_gram[SCANNER_BLOCK_SIZE] = { +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,44,0,0,0,0,0,0,0,0,0,0,0, +}; + +unsigned char d_scanner_5_36_1_dparser_gram[SCANNER_BLOCK_SIZE] = { +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,45,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +}; + +unsigned char d_scanner_5_37_1_dparser_gram[SCANNER_BLOCK_SIZE] = { +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,46,0,0,0,0,0,0,0,0,0,0,0, +}; + +unsigned char d_scanner_5_38_1_dparser_gram[SCANNER_BLOCK_SIZE] = { +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,47,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +}; + +unsigned char d_scanner_5_39_1_dparser_gram[SCANNER_BLOCK_SIZE] = { +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,48, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +}; + +unsigned char d_scanner_5_40_1_dparser_gram[SCANNER_BLOCK_SIZE] = { +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,49,0,0,0,0,0,0,0,0,0,0,0,0, +}; + +unsigned char d_scanner_5_41_1_dparser_gram[SCANNER_BLOCK_SIZE] = { +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,50,0,0,0,0,0, +}; + +unsigned char d_scanner_5_42_1_dparser_gram[SCANNER_BLOCK_SIZE] = { +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +51,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +}; + +unsigned char d_scanner_5_43_1_dparser_gram[SCANNER_BLOCK_SIZE] = { +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,52,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +}; + +unsigned char d_scanner_5_44_1_dparser_gram[SCANNER_BLOCK_SIZE] = { +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +53,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +}; + +unsigned char d_scanner_5_45_1_dparser_gram[SCANNER_BLOCK_SIZE] = { +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,54, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +}; + +unsigned char d_scanner_5_46_1_dparser_gram[SCANNER_BLOCK_SIZE] = { +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,55,0,0,0,0,0,0,0,0,0,0,0,0,0, +}; + +unsigned char d_scanner_5_47_1_dparser_gram[SCANNER_BLOCK_SIZE] = { +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +56,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +}; + +unsigned char d_scanner_5_48_1_dparser_gram[SCANNER_BLOCK_SIZE] = { +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,57,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +}; + +unsigned char d_scanner_5_49_1_dparser_gram[SCANNER_BLOCK_SIZE] = { +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,58,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +}; + +unsigned char d_scanner_5_50_1_dparser_gram[SCANNER_BLOCK_SIZE] = { +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,59,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +}; + +unsigned char d_scanner_5_51_1_dparser_gram[SCANNER_BLOCK_SIZE] = { +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,60,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +}; + +unsigned char d_scanner_5_52_1_dparser_gram[SCANNER_BLOCK_SIZE] = { +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,61,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +}; + +unsigned char d_scanner_5_53_1_dparser_gram[SCANNER_BLOCK_SIZE] = { +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,62,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +}; + +unsigned char d_scanner_5_54_1_dparser_gram[SCANNER_BLOCK_SIZE] = { +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,63,0,0,0,0,0,0,0,0,0,0,0,0, +}; + +unsigned char d_scanner_5_55_1_dparser_gram[SCANNER_BLOCK_SIZE] = { +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,64,0,0,0,0,0,0,0,0,0,0,0,0,0, +}; + +unsigned char d_scanner_5_56_1_dparser_gram[SCANNER_BLOCK_SIZE] = { +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,65,0,0,0,0,0,0,0,0,0,0,0,0,0, +}; + +D_Shift *d_shift_5_57_dparser_gram[] = { &d_shift_14_dparser_gram, NULL}; + +unsigned char d_scanner_5_58_1_dparser_gram[SCANNER_BLOCK_SIZE] = { +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,66,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +}; + +unsigned char d_scanner_5_59_1_dparser_gram[SCANNER_BLOCK_SIZE] = { +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,67,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +}; + +unsigned char d_scanner_5_60_1_dparser_gram[SCANNER_BLOCK_SIZE] = { +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,68,0,0,0,0,0,0,0,0,0,0,0,0,0, +}; + +unsigned char d_scanner_5_61_1_dparser_gram[SCANNER_BLOCK_SIZE] = { +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,69,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +}; + +unsigned char d_scanner_5_62_1_dparser_gram[SCANNER_BLOCK_SIZE] = { +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,70,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +}; + +unsigned char d_scanner_5_63_1_dparser_gram[SCANNER_BLOCK_SIZE] = { +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,71,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +}; + +D_Shift *d_shift_5_64_dparser_gram[] = { &d_shift_20_dparser_gram, NULL}; + +unsigned char d_scanner_5_65_1_dparser_gram[SCANNER_BLOCK_SIZE] = { +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,72,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +}; + +unsigned char d_scanner_5_66_1_dparser_gram[SCANNER_BLOCK_SIZE] = { +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,73,0,0,0,0,0,0,0,0,0,0,0,0, +}; + +unsigned char d_scanner_5_67_1_dparser_gram[SCANNER_BLOCK_SIZE] = { +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,74,0,0,0,0,0,0,0,0,0,0,0,0, +}; + +unsigned char d_scanner_5_68_1_dparser_gram[SCANNER_BLOCK_SIZE] = { +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,75,0,0,0,0,0,0,0,0,0,0,0, +}; + +unsigned char d_scanner_5_69_1_dparser_gram[SCANNER_BLOCK_SIZE] = { +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,76, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +}; + +unsigned char d_scanner_5_70_1_dparser_gram[SCANNER_BLOCK_SIZE] = { +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,77, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +}; + +D_Shift *d_shift_5_71_dparser_gram[] = { &d_shift_16_dparser_gram, NULL}; + +D_Shift *d_shift_5_72_dparser_gram[] = { &d_shift_17_dparser_gram, NULL}; + +unsigned char d_scanner_5_73_1_dparser_gram[SCANNER_BLOCK_SIZE] = { +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,78,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +}; + +unsigned char d_scanner_5_74_1_dparser_gram[SCANNER_BLOCK_SIZE] = { +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,79,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +}; + +unsigned char d_scanner_5_75_1_dparser_gram[SCANNER_BLOCK_SIZE] = { +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,80,0,0,0,0,0,0,0,0,0,0,0, +}; + +unsigned char d_scanner_5_76_1_dparser_gram[SCANNER_BLOCK_SIZE] = { +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,81,0,0,0,0,0,0,0,0,0,0,0,0,0, +}; + +unsigned char d_scanner_5_77_1_dparser_gram[SCANNER_BLOCK_SIZE] = { +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,82,0,0,0,0,0,0,0,0,0,0,0,0,0, +}; + +unsigned char d_scanner_5_78_1_dparser_gram[SCANNER_BLOCK_SIZE] = { +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,83,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +}; + +unsigned char d_scanner_5_79_1_dparser_gram[SCANNER_BLOCK_SIZE] = { +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,84,0,0,0,0,0,0,0,0,0,0,0,0,0, +}; + +unsigned char d_scanner_5_80_1_dparser_gram[SCANNER_BLOCK_SIZE] = { +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,85,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +}; + +unsigned char d_scanner_5_81_1_dparser_gram[SCANNER_BLOCK_SIZE] = { +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,86,0,0,0,0,0,0,0,0,0,0,0,0, +}; + +D_Shift *d_shift_5_82_dparser_gram[] = { &d_shift_15_dparser_gram, NULL}; + +unsigned char d_scanner_5_83_1_dparser_gram[SCANNER_BLOCK_SIZE] = { +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,87,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +}; + +unsigned char d_scanner_5_84_1_dparser_gram[SCANNER_BLOCK_SIZE] = { +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,88,0,0,0,0,0,0,0,0,0,0,0, +}; + +D_Shift *d_shift_5_85_dparser_gram[] = { &d_shift_19_dparser_gram, NULL}; + +unsigned char d_scanner_5_86_1_dparser_gram[SCANNER_BLOCK_SIZE] = { +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,89,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +}; + +unsigned char d_scanner_5_87_1_dparser_gram[SCANNER_BLOCK_SIZE] = { +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,90,0,0,0,0,0,0, +}; + +D_Shift *d_shift_5_88_dparser_gram[] = { &d_shift_21_dparser_gram, NULL}; + +unsigned char d_scanner_5_89_1_dparser_gram[SCANNER_BLOCK_SIZE] = { +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,91, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +}; + +unsigned char d_scanner_5_90_1_dparser_gram[SCANNER_BLOCK_SIZE] = { +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,92,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +}; + +unsigned char d_scanner_5_91_1_dparser_gram[SCANNER_BLOCK_SIZE] = { +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,93,0,0,0,0,0,0,0,0,0,0,0,0,0, +}; + +unsigned char d_scanner_5_92_1_dparser_gram[SCANNER_BLOCK_SIZE] = { +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,94, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +}; + +unsigned char d_scanner_5_93_1_dparser_gram[SCANNER_BLOCK_SIZE] = { +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,95,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +}; + +unsigned char d_scanner_5_94_1_dparser_gram[SCANNER_BLOCK_SIZE] = { +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,96, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +}; + +unsigned char d_scanner_5_95_1_dparser_gram[SCANNER_BLOCK_SIZE] = { +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,97,0,0,0,0,0,0,0,0,0,0,0,0,0, +}; + +unsigned char d_scanner_5_96_1_dparser_gram[SCANNER_BLOCK_SIZE] = { +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,98,0,0,0,0,0,0,0,0,0,0, +}; + +unsigned char d_scanner_5_97_1_dparser_gram[SCANNER_BLOCK_SIZE] = { +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,99,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +}; + +unsigned char d_scanner_5_98_1_dparser_gram[SCANNER_BLOCK_SIZE] = { +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +}; + +D_Shift *d_shift_5_99_dparser_gram[] = { &d_shift_18_dparser_gram, NULL}; + +D_Shift *d_shifts_6_dparser_gram[] = { +&d_shift_62_dparser_gram, NULL}; + +D_Shift *d_accepts_diff_6_0_dparser_gram[] = {0}; +D_Shift **d_accepts_diff_6_dparser_gram[] = { +d_accepts_diff_6_0_dparser_gram +}; + +unsigned char d_scanner_6_0_1_dparser_gram[SCANNER_BLOCK_SIZE] = { +0,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2, +2,2,2,2,2,2,2,2,2,2,2,0,0,0,0,2, +0,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2, +2,2,2,2,2,2,2,2,2,2,2,0,0,0,0,0, +}; + +unsigned char d_scanner_6_1_0_dparser_gram[SCANNER_BLOCK_SIZE] = { +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +2,2,2,2,2,2,2,2,2,2,0,0,0,0,0,0, +}; + +D_Shift *d_accepts_diff_8_0_dparser_gram[] = {0}; +D_Shift **d_accepts_diff_8_dparser_gram[] = { +d_accepts_diff_8_0_dparser_gram +}; + +D_Shift *d_shifts_13_dparser_gram[] = { +&d_shift_23_dparser_gram, &d_shift_27_dparser_gram, &d_shift_62_dparser_gram, NULL}; + +D_Shift *d_accepts_diff_13_0_dparser_gram[] = {0}; +D_Shift *d_accepts_diff_13_1_dparser_gram[] = {&d_shift_27_dparser_gram,0}; +D_Shift **d_accepts_diff_13_dparser_gram[] = { +d_accepts_diff_13_0_dparser_gram, +d_accepts_diff_13_1_dparser_gram +}; + +unsigned char d_scanner_13_0_0_dparser_gram[SCANNER_BLOCK_SIZE] = { +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0, +}; + +unsigned char d_scanner_13_0_1_dparser_gram[SCANNER_BLOCK_SIZE] = { +0,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3, +3,3,3,3,3,3,3,3,3,3,3,0,0,0,0,4, +0,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3, +3,3,3,3,3,3,3,3,3,3,3,0,0,0,0,0, +}; + +unsigned char d_scanner_13_2_0_dparser_gram[SCANNER_BLOCK_SIZE] = { +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +3,3,3,3,3,3,3,3,3,3,0,0,0,0,0,0, +}; + +unsigned char d_scanner_13_2_1_dparser_gram[SCANNER_BLOCK_SIZE] = { +0,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3, +3,3,3,3,3,3,3,3,3,3,3,0,0,0,0,3, +0,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3, +3,3,3,3,3,3,3,3,3,3,3,0,0,0,0,0, +}; + +D_Shift *d_shifts_17_dparser_gram[] = { +&d_shift_22_dparser_gram, &d_shift_26_dparser_gram, NULL}; + +D_Shift *d_accepts_diff_17_0_dparser_gram[] = {0}; +D_Shift *d_accepts_diff_17_1_dparser_gram[] = {&d_shift_22_dparser_gram,0}; +D_Shift **d_accepts_diff_17_dparser_gram[] = { +d_accepts_diff_17_0_dparser_gram, +d_accepts_diff_17_1_dparser_gram +}; + +unsigned char d_scanner_17_0_0_dparser_gram[SCANNER_BLOCK_SIZE] = { +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0, +}; + +unsigned char d_scanner_17_1_0_dparser_gram[SCANNER_BLOCK_SIZE] = { +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,3,0,0,0,0,0, +}; + +unsigned char d_accepts_diff_17_1_0_dparser_gram[SCANNER_BLOCK_SIZE] = { +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0, +}; + +D_Shift *d_shift_17_1_dparser_gram[] = { &d_shift_22_dparser_gram, NULL}; + +unsigned char d_scanner_17_2_0_dparser_gram[SCANNER_BLOCK_SIZE] = { +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,4,0,0, +}; + +D_Shift *d_shift_17_3_dparser_gram[] = { &d_shift_26_dparser_gram, NULL}; + +D_Shift *d_shifts_30_dparser_gram[] = { +&d_shift_1_dparser_gram, &d_shift_31_dparser_gram, &d_shift_49_dparser_gram, &d_shift_51_dparser_gram, &d_shift_59_dparser_gram, &d_shift_60_dparser_gram, &d_shift_61_dparser_gram, &d_shift_62_dparser_gram, &d_shift_63_dparser_gram, &d_shift_64_dparser_gram, &d_shift_65_dparser_gram, NULL}; + +D_Shift *d_accepts_diff_30_0_dparser_gram[] = {0}; +D_Shift *d_accepts_diff_30_1_dparser_gram[] = {&d_shift_59_dparser_gram,0}; +D_Shift *d_accepts_diff_30_2_dparser_gram[] = {&d_shift_65_dparser_gram,0}; +D_Shift **d_accepts_diff_30_dparser_gram[] = { +d_accepts_diff_30_0_dparser_gram, +d_accepts_diff_30_1_dparser_gram, +d_accepts_diff_30_2_dparser_gram +}; + +unsigned char d_scanner_30_0_1_dparser_gram[SCANNER_BLOCK_SIZE] = { +2,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9, +9,9,9,9,9,9,9,9,9,9,9,10,2,0,2,11, +2,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9, +9,9,9,9,9,9,9,9,9,9,9,12,2,13,2,0, +}; + +unsigned char d_scanner_30_2_0_dparser_gram[SCANNER_BLOCK_SIZE] = { +0,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14, +14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14, +14,14,15,14,14,14,14,14,14,14,14,14,14,14,14,14, +14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14, +}; + +unsigned char d_scanner_30_2_1_dparser_gram[SCANNER_BLOCK_SIZE] = { +14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14, +14,14,14,14,14,14,14,14,14,14,14,14,16,14,14,14, +14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14, +14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14, +}; + +unsigned char d_scanner_30_2_2_dparser_gram[SCANNER_BLOCK_SIZE] = { +14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14, +14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14, +14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14, +14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14, +}; + +unsigned char d_scanner_30_3_0_dparser_gram[SCANNER_BLOCK_SIZE] = { +0,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17, +17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17, +17,17,17,17,17,17,17,18,17,17,17,17,17,17,17,17, +17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17, +}; + +unsigned char d_scanner_30_3_1_dparser_gram[SCANNER_BLOCK_SIZE] = { +17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17, +17,17,17,17,17,17,17,17,17,17,17,17,19,17,17,17, +17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17, +17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17, +}; + +unsigned char d_scanner_30_3_2_dparser_gram[SCANNER_BLOCK_SIZE] = { +17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17, +17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17, +17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17, +17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17, +}; + +unsigned char d_scanner_30_6_0_dparser_gram[SCANNER_BLOCK_SIZE] = { +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +20,20,20,20,20,20,20,20,0,0,0,0,0,0,0,0, +}; + +unsigned char d_scanner_30_6_1_dparser_gram[SCANNER_BLOCK_SIZE] = { +0,0,0,0,0,0,0,0,0,0,0,0,21,0,0,0, +0,0,0,0,0,21,0,0,22,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,21,0,0,0, +0,0,0,0,0,21,0,0,23,0,0,0,0,0,0,0, +}; + +unsigned char d_scanner_30_7_1_dparser_gram[SCANNER_BLOCK_SIZE] = { +0,0,0,0,0,0,0,0,0,0,0,0,24,0,0,0, +0,0,0,0,0,24,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,24,0,0,0, +0,0,0,0,0,24,0,0,0,0,0,0,0,0,0,0, +}; + +D_Shift *d_shift_30_12_dparser_gram[] = { &d_shift_1_dparser_gram, NULL}; + +unsigned char d_scanner_30_18_0_dparser_gram[SCANNER_BLOCK_SIZE] = { +0,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26, +26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26, +26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26, +26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26, +}; + +unsigned char d_scanner_30_18_1_dparser_gram[SCANNER_BLOCK_SIZE] = { +26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26, +26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26, +26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26, +26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26, +}; + +unsigned char d_scanner_30_19_1_dparser_gram[SCANNER_BLOCK_SIZE] = { +0,0,0,0,0,0,0,0,0,0,0,0,21,0,0,0, +0,0,0,0,0,21,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,21,0,0,0, +0,0,0,0,0,21,0,0,0,0,0,0,0,0,0,0, +}; + +unsigned char d_scanner_30_21_0_dparser_gram[SCANNER_BLOCK_SIZE] = { +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +27,27,27,27,27,27,27,27,27,27,0,0,0,0,0,0, +}; + +unsigned char d_scanner_30_21_1_dparser_gram[SCANNER_BLOCK_SIZE] = { +0,27,27,27,27,27,27,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,27,27,27,27,27,27,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +}; + +unsigned char d_scanner_30_26_1_dparser_gram[SCANNER_BLOCK_SIZE] = { +0,27,27,27,27,27,27,0,0,0,0,0,28,0,0,0, +0,0,0,0,0,28,0,0,0,0,0,0,0,0,0,0, +0,27,27,27,27,27,27,0,0,0,0,0,28,0,0,0, +0,0,0,0,0,28,0,0,0,0,0,0,0,0,0,0, +}; + +D_Shift *d_shifts_49_dparser_gram[] = { +&d_shift_1_dparser_gram, &d_shift_62_dparser_gram, NULL}; + +D_Shift *d_accepts_diff_49_0_dparser_gram[] = {0}; +D_Shift **d_accepts_diff_49_dparser_gram[] = { +d_accepts_diff_49_0_dparser_gram +}; + +unsigned char d_scanner_49_0_1_dparser_gram[SCANNER_BLOCK_SIZE] = { +0,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2, +2,2,2,2,2,2,2,2,2,2,2,0,0,0,0,2, +0,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2, +2,2,2,2,2,2,2,2,2,2,2,0,0,3,0,0, +}; + +D_Shift *d_shifts_52_dparser_gram[] = { +&d_shift_9_dparser_gram, &d_shift_10_dparser_gram, &d_shift_11_dparser_gram, &d_shift_12_dparser_gram, &d_shift_13_dparser_gram, NULL}; + +D_Shift *d_accepts_diff_52_0_dparser_gram[] = {0}; +D_Shift **d_accepts_diff_52_dparser_gram[] = { +d_accepts_diff_52_0_dparser_gram +}; + +unsigned char d_scanner_52_0_1_dparser_gram[SCANNER_BLOCK_SIZE] = { +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,2,0,0,0,0,0,0,3,0,0, +4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +}; + +unsigned char d_scanner_52_1_1_dparser_gram[SCANNER_BLOCK_SIZE] = { +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,5, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +}; + +unsigned char d_scanner_52_2_1_dparser_gram[SCANNER_BLOCK_SIZE] = { +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,6,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +}; + +unsigned char d_scanner_52_3_1_dparser_gram[SCANNER_BLOCK_SIZE] = { +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,7, +0,0,8,0,0,0,0,0,0,0,0,0,0,0,0,0, +}; + +unsigned char d_scanner_52_4_1_dparser_gram[SCANNER_BLOCK_SIZE] = { +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,9,0,0,0,0,0,0,0,0,0,0,0,0,0, +}; + +unsigned char d_scanner_52_5_1_dparser_gram[SCANNER_BLOCK_SIZE] = { +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,10,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +}; + +unsigned char d_scanner_52_6_1_dparser_gram[SCANNER_BLOCK_SIZE] = { +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,11,0,0,0,0,0,0,0,0,0,0,0,0, +}; + +unsigned char d_scanner_52_7_1_dparser_gram[SCANNER_BLOCK_SIZE] = { +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,12,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +}; + +unsigned char d_scanner_52_8_1_dparser_gram[SCANNER_BLOCK_SIZE] = { +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,13, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +}; + +unsigned char d_scanner_52_9_1_dparser_gram[SCANNER_BLOCK_SIZE] = { +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,14,0,0,0,0,0,0,0,0,0,0, +}; + +unsigned char d_scanner_52_10_1_dparser_gram[SCANNER_BLOCK_SIZE] = { +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,15,0,0,0,0,0,0,0,0,0,0,0, +}; + +unsigned char d_scanner_52_11_1_dparser_gram[SCANNER_BLOCK_SIZE] = { +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +}; + +unsigned char d_scanner_52_12_1_dparser_gram[SCANNER_BLOCK_SIZE] = { +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,17,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,18,0,0,0,0,0,0,0,0,0,0, +}; + +unsigned char d_scanner_52_13_1_dparser_gram[SCANNER_BLOCK_SIZE] = { +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,19,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +}; + +unsigned char d_scanner_52_14_1_dparser_gram[SCANNER_BLOCK_SIZE] = { +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,20, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +}; + +unsigned char d_scanner_52_15_1_dparser_gram[SCANNER_BLOCK_SIZE] = { +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,21,0,0,0,0,0,0,0,0,0,0,0,0,0, +}; + +unsigned char d_scanner_52_16_1_dparser_gram[SCANNER_BLOCK_SIZE] = { +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,22,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +}; + +unsigned char d_scanner_52_17_1_dparser_gram[SCANNER_BLOCK_SIZE] = { +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,23,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +}; + +unsigned char d_scanner_52_19_1_dparser_gram[SCANNER_BLOCK_SIZE] = { +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,25,0,0,0,0,0,0,0,0,0,0,0,0,0, +}; + +unsigned char d_scanner_52_20_1_dparser_gram[SCANNER_BLOCK_SIZE] = { +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,26,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +}; + +unsigned char d_scanner_52_21_1_dparser_gram[SCANNER_BLOCK_SIZE] = { +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,27,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +}; + +unsigned char d_scanner_52_22_1_dparser_gram[SCANNER_BLOCK_SIZE] = { +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,28,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +}; + +D_Shift *d_shift_52_23_dparser_gram[] = { &d_shift_11_dparser_gram, NULL}; + +unsigned char d_scanner_52_24_1_dparser_gram[SCANNER_BLOCK_SIZE] = { +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,29,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +}; + +D_Shift *d_shift_52_26_dparser_gram[] = { &d_shift_12_dparser_gram, NULL}; + +unsigned char d_scanner_52_27_1_dparser_gram[SCANNER_BLOCK_SIZE] = { +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,31,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +}; + +unsigned char d_scanner_52_28_1_dparser_gram[SCANNER_BLOCK_SIZE] = { +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,32,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +}; + +unsigned char d_scanner_52_30_1_dparser_gram[SCANNER_BLOCK_SIZE] = { +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,34,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +}; + +unsigned char d_scanner_52_31_1_dparser_gram[SCANNER_BLOCK_SIZE] = { +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,35,0,0,0,0,0,0,0,0,0,0,0,0,0, +}; + +D_Shift *d_shift_52_32_dparser_gram[] = { &d_shift_9_dparser_gram, NULL}; + +unsigned char d_scanner_52_33_1_dparser_gram[SCANNER_BLOCK_SIZE] = { +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,36,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +}; + +D_Shift *d_shift_52_34_dparser_gram[] = { &d_shift_10_dparser_gram, NULL}; + +unsigned char d_scanner_52_35_1_dparser_gram[SCANNER_BLOCK_SIZE] = { +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,37,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +}; + +unsigned char d_scanner_52_36_1_dparser_gram[SCANNER_BLOCK_SIZE] = { +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,38,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +}; + +unsigned char d_scanner_52_37_1_dparser_gram[SCANNER_BLOCK_SIZE] = { +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,39,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +}; + +D_Shift *d_shift_52_38_dparser_gram[] = { &d_shift_13_dparser_gram, NULL}; + +D_Shift *d_accepts_diff_53_0_dparser_gram[] = {0}; +D_Shift *d_accepts_diff_53_1_dparser_gram[] = {&d_shift_59_dparser_gram,0}; +D_Shift *d_accepts_diff_53_2_dparser_gram[] = {&d_shift_65_dparser_gram,0}; +D_Shift **d_accepts_diff_53_dparser_gram[] = { +d_accepts_diff_53_0_dparser_gram, +d_accepts_diff_53_1_dparser_gram, +d_accepts_diff_53_2_dparser_gram +}; + +D_Shift *d_shifts_55_dparser_gram[] = { +&d_shift_0_dparser_gram, &d_shift_2_dparser_gram, &d_shift_4_dparser_gram, &d_shift_6_dparser_gram, &d_shift_7_dparser_gram, &d_shift_49_dparser_gram, NULL}; + +D_Shift *d_accepts_diff_55_0_dparser_gram[] = {0}; +D_Shift **d_accepts_diff_55_dparser_gram[] = { +d_accepts_diff_55_0_dparser_gram +}; + +unsigned char d_scanner_55_0_0_dparser_gram[SCANNER_BLOCK_SIZE] = { +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +}; + +unsigned char d_scanner_55_0_1_dparser_gram[SCANNER_BLOCK_SIZE] = { +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,3,0,0,0,0, +}; + +unsigned char d_scanner_55_1_1_dparser_gram[SCANNER_BLOCK_SIZE] = { +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,4,0,0,0,0, +}; + +unsigned char d_scanner_55_3_1_dparser_gram[SCANNER_BLOCK_SIZE] = { +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,5,0,0,6,0,0,0,0,0,0,0,0,0,0,0, +7,0,0,8,9,0,0,0,0,0,0,0,0,0,0,0, +}; + +unsigned char d_scanner_55_4_1_dparser_gram[SCANNER_BLOCK_SIZE] = { +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,10,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +}; + +unsigned char d_scanner_55_5_1_dparser_gram[SCANNER_BLOCK_SIZE] = { +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,11,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +}; + +unsigned char d_scanner_55_6_1_dparser_gram[SCANNER_BLOCK_SIZE] = { +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,12,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +}; + +unsigned char d_scanner_55_8_1_dparser_gram[SCANNER_BLOCK_SIZE] = { +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,14, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +}; + +unsigned char d_scanner_55_11_1_dparser_gram[SCANNER_BLOCK_SIZE] = { +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,17,0,0,0,0,0,0,0,0,0,0,0,0, +}; + +unsigned char d_scanner_55_12_1_dparser_gram[SCANNER_BLOCK_SIZE] = { +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,18,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +}; + +unsigned char d_scanner_55_15_1_dparser_gram[SCANNER_BLOCK_SIZE] = { +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,21,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +}; + +unsigned char d_scanner_55_16_1_dparser_gram[SCANNER_BLOCK_SIZE] = { +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,22,0,0,0,0,0,0,0,0,0,0,0,0, +}; + +unsigned char d_scanner_55_18_1_dparser_gram[SCANNER_BLOCK_SIZE] = { +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,24,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +}; + +unsigned char d_scanner_55_19_1_dparser_gram[SCANNER_BLOCK_SIZE] = { +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,25, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +}; + +unsigned char d_scanner_55_20_1_dparser_gram[SCANNER_BLOCK_SIZE] = { +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,26,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +}; + +unsigned char d_scanner_55_22_1_dparser_gram[SCANNER_BLOCK_SIZE] = { +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,27,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +}; + +unsigned char d_scanner_55_23_1_dparser_gram[SCANNER_BLOCK_SIZE] = { +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,28,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +}; + +unsigned char d_scanner_55_24_1_dparser_gram[SCANNER_BLOCK_SIZE] = { +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,29,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +}; + +unsigned char d_scanner_55_25_1_dparser_gram[SCANNER_BLOCK_SIZE] = { +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,30,0,0,0,0,0,0,0,0,0,0,0,0,0, +}; + +unsigned char d_scanner_55_28_1_dparser_gram[SCANNER_BLOCK_SIZE] = { +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,32,0,0, +}; + +unsigned char d_scanner_55_29_1_dparser_gram[SCANNER_BLOCK_SIZE] = { +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,33,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +}; + +unsigned char d_scanner_55_30_1_dparser_gram[SCANNER_BLOCK_SIZE] = { +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,34,0,0,0,0,0,0,0,0,0,0,0,0,0, +}; + +D_Shift *d_shifts_59_dparser_gram[] = { +&d_shift_31_dparser_gram, &d_shift_32_dparser_gram, &d_shift_49_dparser_gram, &d_shift_51_dparser_gram, &d_shift_59_dparser_gram, &d_shift_60_dparser_gram, &d_shift_61_dparser_gram, &d_shift_62_dparser_gram, &d_shift_63_dparser_gram, &d_shift_64_dparser_gram, &d_shift_65_dparser_gram, NULL}; + +D_Shift *d_accepts_diff_59_0_dparser_gram[] = {0}; +D_Shift *d_accepts_diff_59_1_dparser_gram[] = {&d_shift_59_dparser_gram,0}; +D_Shift *d_accepts_diff_59_2_dparser_gram[] = {&d_shift_65_dparser_gram,0}; +D_Shift **d_accepts_diff_59_dparser_gram[] = { +d_accepts_diff_59_0_dparser_gram, +d_accepts_diff_59_1_dparser_gram, +d_accepts_diff_59_2_dparser_gram +}; + +unsigned char d_scanner_59_0_0_dparser_gram[SCANNER_BLOCK_SIZE] = { +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,2,3,2,2,2,2,4,5,6,2,2,2,7,2,2, +8,9,9,9,9,9,9,9,9,9,2,2,2,2,2,2, +}; + +unsigned char d_scanner_59_0_1_dparser_gram[SCANNER_BLOCK_SIZE] = { +2,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10, +10,10,10,10,10,10,10,10,10,10,10,11,2,0,2,12, +2,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10, +10,10,10,10,10,10,10,10,10,10,10,13,2,0,2,0, +}; + +D_Shift *d_shift_59_5_dparser_gram[] = { &d_shift_32_dparser_gram, NULL}; + +unsigned char d_scanner_59_6_0_dparser_gram[SCANNER_BLOCK_SIZE] = { +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +8,9,9,9,9,9,9,9,9,9,0,0,0,0,0,0, +}; + +unsigned char d_scanner_59_9_0_dparser_gram[SCANNER_BLOCK_SIZE] = { +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +10,10,10,10,10,10,10,10,10,10,0,0,0,0,0,0, +}; + +unsigned char d_scanner_59_9_1_dparser_gram[SCANNER_BLOCK_SIZE] = { +0,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10, +10,10,10,10,10,10,10,10,10,10,10,0,0,0,0,10, +0,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10, +10,10,10,10,10,10,10,10,10,10,10,0,0,0,0,0, +}; + +D_Shift *d_accepts_diff_60_0_dparser_gram[] = {0}; +D_Shift *d_accepts_diff_60_1_dparser_gram[] = {&d_shift_59_dparser_gram,0}; +D_Shift *d_accepts_diff_60_2_dparser_gram[] = {&d_shift_65_dparser_gram,0}; +D_Shift **d_accepts_diff_60_dparser_gram[] = { +d_accepts_diff_60_0_dparser_gram, +d_accepts_diff_60_1_dparser_gram, +d_accepts_diff_60_2_dparser_gram +}; + +D_Shift *d_shifts_61_dparser_gram[] = { +&d_shift_31_dparser_gram, &d_shift_49_dparser_gram, &d_shift_51_dparser_gram, &d_shift_52_dparser_gram, &d_shift_59_dparser_gram, &d_shift_60_dparser_gram, &d_shift_61_dparser_gram, &d_shift_62_dparser_gram, &d_shift_63_dparser_gram, &d_shift_64_dparser_gram, &d_shift_65_dparser_gram, NULL}; + +D_Shift *d_accepts_diff_61_0_dparser_gram[] = {0}; +D_Shift *d_accepts_diff_61_1_dparser_gram[] = {&d_shift_65_dparser_gram,0}; +D_Shift *d_accepts_diff_61_2_dparser_gram[] = {&d_shift_59_dparser_gram,0}; +D_Shift **d_accepts_diff_61_dparser_gram[] = { +d_accepts_diff_61_0_dparser_gram, +d_accepts_diff_61_1_dparser_gram, +d_accepts_diff_61_2_dparser_gram +}; + +unsigned char d_scanner_61_0_1_dparser_gram[SCANNER_BLOCK_SIZE] = { +2,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9, +9,9,9,9,9,9,9,9,9,9,9,10,2,11,2,12, +2,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9, +9,9,9,9,9,9,9,9,9,9,9,13,2,0,2,0, +}; + +unsigned char d_accepts_diff_61_5_0_dparser_gram[SCANNER_BLOCK_SIZE] = { +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +2,2,2,2,2,2,2,2,2,2,0,0,0,0,0,0, +}; + +unsigned char d_accepts_diff_61_6_1_dparser_gram[SCANNER_BLOCK_SIZE] = { +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0, +}; + +D_Shift *d_shift_61_10_dparser_gram[] = { &d_shift_52_dparser_gram, NULL}; + +unsigned char d_accepts_diff_61_11_1_dparser_gram[SCANNER_BLOCK_SIZE] = { +0,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2, +2,2,2,2,2,2,2,2,2,2,2,0,0,0,0,2, +0,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2, +2,2,2,2,2,2,2,2,2,2,2,0,0,0,0,0, +}; + +D_Shift *d_accepts_diff_64_0_dparser_gram[] = {0}; +D_Shift **d_accepts_diff_64_dparser_gram[] = { +d_accepts_diff_64_0_dparser_gram +}; + +D_Shift *d_shifts_72_dparser_gram[] = { +&d_shift_1_dparser_gram, NULL}; + +D_Shift *d_accepts_diff_72_0_dparser_gram[] = {0}; +D_Shift **d_accepts_diff_72_dparser_gram[] = { +d_accepts_diff_72_0_dparser_gram +}; + +unsigned char d_scanner_72_0_1_dparser_gram[SCANNER_BLOCK_SIZE] = { +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0, +}; + +D_Shift *d_accepts_diff_73_0_dparser_gram[] = {0}; +D_Shift **d_accepts_diff_73_dparser_gram[] = { +d_accepts_diff_73_0_dparser_gram +}; + +D_Shift *d_shifts_77_dparser_gram[] = { +&d_shift_23_dparser_gram, NULL}; + +D_Shift *d_accepts_diff_77_0_dparser_gram[] = {0}; +D_Shift **d_accepts_diff_77_dparser_gram[] = { +d_accepts_diff_77_0_dparser_gram +}; + +D_Shift *d_accepts_diff_80_0_dparser_gram[] = {0}; +D_Shift **d_accepts_diff_80_dparser_gram[] = { +d_accepts_diff_80_0_dparser_gram +}; + +D_Shift *d_shifts_92_dparser_gram[] = { +&d_shift_28_dparser_gram, NULL}; + +D_Shift *d_accepts_diff_92_0_dparser_gram[] = {0}; +D_Shift **d_accepts_diff_92_dparser_gram[] = { +d_accepts_diff_92_0_dparser_gram +}; + +unsigned char d_scanner_92_0_1_dparser_gram[SCANNER_BLOCK_SIZE] = { +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0, +}; + +D_Shift *d_shift_92_1_dparser_gram[] = { &d_shift_28_dparser_gram, NULL}; + +D_Shift *d_shifts_95_dparser_gram[] = { +&d_shift_29_dparser_gram, &d_shift_31_dparser_gram, &d_shift_49_dparser_gram, &d_shift_51_dparser_gram, &d_shift_60_dparser_gram, &d_shift_61_dparser_gram, &d_shift_62_dparser_gram, NULL}; + +D_Shift *d_accepts_diff_95_0_dparser_gram[] = {0}; +D_Shift **d_accepts_diff_95_dparser_gram[] = { +d_accepts_diff_95_0_dparser_gram +}; + +unsigned char d_scanner_95_0_0_dparser_gram[SCANNER_BLOCK_SIZE] = { +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,2,0,3,0,0,4,5,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +}; + +unsigned char d_scanner_95_0_1_dparser_gram[SCANNER_BLOCK_SIZE] = { +0,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6, +6,6,6,6,6,6,6,6,6,6,6,7,0,0,0,6, +0,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6, +6,6,6,6,6,6,6,6,6,6,6,8,0,0,0,0, +}; + +unsigned char d_scanner_95_1_0_dparser_gram[SCANNER_BLOCK_SIZE] = { +0,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9, +9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9, +9,9,10,9,9,9,9,9,9,9,9,9,9,9,9,9, +9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9, +}; + +unsigned char d_scanner_95_1_1_dparser_gram[SCANNER_BLOCK_SIZE] = { +9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9, +9,9,9,9,9,9,9,9,9,9,9,9,11,9,9,9, +9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9, +9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9, +}; + +unsigned char d_scanner_95_1_2_dparser_gram[SCANNER_BLOCK_SIZE] = { +9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9, +9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9, +9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9, +9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9, +}; + +unsigned char d_scanner_95_2_1_dparser_gram[SCANNER_BLOCK_SIZE] = { +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,12,0,0,0,0, +}; + +unsigned char d_scanner_95_3_0_dparser_gram[SCANNER_BLOCK_SIZE] = { +0,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13, +13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13, +13,13,13,13,13,13,13,14,13,13,13,13,13,13,13,13, +13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13, +}; + +unsigned char d_scanner_95_5_0_dparser_gram[SCANNER_BLOCK_SIZE] = { +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +6,6,6,6,6,6,6,6,6,6,0,0,0,0,0,0, +}; + +unsigned char d_scanner_95_5_1_dparser_gram[SCANNER_BLOCK_SIZE] = { +0,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6, +6,6,6,6,6,6,6,6,6,6,6,0,0,0,0,6, +0,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6, +6,6,6,6,6,6,6,6,6,6,6,0,0,0,0,0, +}; + +unsigned char d_scanner_95_10_0_dparser_gram[SCANNER_BLOCK_SIZE] = { +0,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, +16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, +16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, +16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, +}; + +unsigned char d_scanner_95_14_0_dparser_gram[SCANNER_BLOCK_SIZE] = { +0,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18, +18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18, +18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18, +18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18, +}; + +unsigned char d_scanner_95_14_1_dparser_gram[SCANNER_BLOCK_SIZE] = { +18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18, +18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18, +18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18, +18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18, +}; + +unsigned char d_scanner_95_18_1_dparser_gram[SCANNER_BLOCK_SIZE] = { +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +}; + +unsigned char d_scanner_95_19_1_dparser_gram[SCANNER_BLOCK_SIZE] = { +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,21,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +}; + +D_Shift *d_shift_95_20_dparser_gram[] = { &d_shift_29_dparser_gram, NULL}; + +D_Shift *d_shifts_99_dparser_gram[] = { +&d_shift_38_dparser_gram, &d_shift_39_dparser_gram, &d_shift_40_dparser_gram, &d_shift_41_dparser_gram, &d_shift_42_dparser_gram, &d_shift_43_dparser_gram, &d_shift_44_dparser_gram, &d_shift_45_dparser_gram, &d_shift_46_dparser_gram, &d_shift_47_dparser_gram, &d_shift_51_dparser_gram, NULL}; + +D_Shift *d_accepts_diff_99_0_dparser_gram[] = {0}; +D_Shift **d_accepts_diff_99_dparser_gram[] = { +d_accepts_diff_99_0_dparser_gram +}; + +unsigned char d_scanner_99_0_1_dparser_gram[SCANNER_BLOCK_SIZE] = { +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,3,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +}; + +unsigned char d_scanner_99_1_1_dparser_gram[SCANNER_BLOCK_SIZE] = { +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,4,0,0,0,0,0,0,0,0,0,5,0,0,0, +0,0,6,0,0,7,0,0,0,0,0,0,0,0,0,0, +}; + +unsigned char d_scanner_99_3_1_dparser_gram[SCANNER_BLOCK_SIZE] = { +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,8,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +}; + +unsigned char d_scanner_99_4_1_dparser_gram[SCANNER_BLOCK_SIZE] = { +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,9,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +}; + +unsigned char d_scanner_99_5_1_dparser_gram[SCANNER_BLOCK_SIZE] = { +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,10,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +}; + +unsigned char d_scanner_99_6_1_dparser_gram[SCANNER_BLOCK_SIZE] = { +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,11,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +}; + +unsigned char d_scanner_99_7_1_dparser_gram[SCANNER_BLOCK_SIZE] = { +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,12,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +}; + +unsigned char d_scanner_99_8_1_dparser_gram[SCANNER_BLOCK_SIZE] = { +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,13,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +}; + +unsigned char d_scanner_99_9_1_dparser_gram[SCANNER_BLOCK_SIZE] = { +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,14,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +}; + +unsigned char d_scanner_99_11_1_dparser_gram[SCANNER_BLOCK_SIZE] = { +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,16,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +}; + +unsigned char d_scanner_99_13_1_dparser_gram[SCANNER_BLOCK_SIZE] = { +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,18,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +}; + +unsigned char d_scanner_99_14_1_dparser_gram[SCANNER_BLOCK_SIZE] = { +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,19,0,0,0,0,0,0,0,0,0,0,0,0,0, +}; + +unsigned char d_scanner_99_15_1_dparser_gram[SCANNER_BLOCK_SIZE] = { +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,20,0,0,0,0,0,0,0,0,0,0,0,0,0, +}; + +D_Shift *d_shift_99_16_dparser_gram[] = { &d_shift_47_dparser_gram, NULL}; + +unsigned char d_scanner_99_17_1_dparser_gram[SCANNER_BLOCK_SIZE] = { +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,21,0,0,0,0,0,0,0,0,0,0,0, +}; + +unsigned char d_scanner_99_18_1_dparser_gram[SCANNER_BLOCK_SIZE] = { +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,22,0,0,0,0,0,0, +}; + +unsigned char d_scanner_99_19_1_dparser_gram[SCANNER_BLOCK_SIZE] = { +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,23,0,0,0,0,0,0, +}; + +D_Shift *d_shift_99_20_dparser_gram[] = { &d_shift_46_dparser_gram, NULL}; + +unsigned char d_scanner_99_22_1_dparser_gram[SCANNER_BLOCK_SIZE] = { +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,25, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +}; + +unsigned char d_scanner_99_23_1_dparser_gram[SCANNER_BLOCK_SIZE] = { +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,26,0,0,27, +0,0,28,0,0,0,0,0,0,0,0,0,0,0,0,0, +}; + +unsigned char d_scanner_99_24_1_dparser_gram[SCANNER_BLOCK_SIZE] = { +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,29,0,0,30, +0,0,31,0,0,0,0,0,0,0,0,0,0,0,0,0, +}; + +unsigned char d_scanner_99_26_1_dparser_gram[SCANNER_BLOCK_SIZE] = { +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +33,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +}; + +unsigned char d_scanner_99_27_1_dparser_gram[SCANNER_BLOCK_SIZE] = { +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,34,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +}; + +unsigned char d_scanner_99_29_1_dparser_gram[SCANNER_BLOCK_SIZE] = { +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +36,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +}; + +unsigned char d_scanner_99_30_1_dparser_gram[SCANNER_BLOCK_SIZE] = { +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,37,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +}; + +unsigned char d_scanner_99_31_1_dparser_gram[SCANNER_BLOCK_SIZE] = { +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,38,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +}; + +unsigned char d_scanner_99_32_1_dparser_gram[SCANNER_BLOCK_SIZE] = { +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,39, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +}; + +unsigned char d_scanner_99_33_1_dparser_gram[SCANNER_BLOCK_SIZE] = { +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,40,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +}; + +unsigned char d_scanner_99_34_1_dparser_gram[SCANNER_BLOCK_SIZE] = { +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,41,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +}; + +unsigned char d_scanner_99_35_1_dparser_gram[SCANNER_BLOCK_SIZE] = { +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,42, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +}; + +unsigned char d_scanner_99_36_1_dparser_gram[SCANNER_BLOCK_SIZE] = { +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,43,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +}; + +unsigned char d_scanner_99_38_1_dparser_gram[SCANNER_BLOCK_SIZE] = { +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,45,0,0,0, +0,0,46,0,0,0,0,0,0,0,0,0,0,0,0,0, +}; + +unsigned char d_scanner_99_39_1_dparser_gram[SCANNER_BLOCK_SIZE] = { +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,47,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +}; + +unsigned char d_scanner_99_40_1_dparser_gram[SCANNER_BLOCK_SIZE] = { +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,48,0,0,0,0,0,0,0,0,0,0,0, +}; + +unsigned char d_scanner_99_41_1_dparser_gram[SCANNER_BLOCK_SIZE] = { +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,49,0,0,0, +0,0,50,0,0,0,0,0,0,0,0,0,0,0,0,0, +}; + +unsigned char d_scanner_99_42_1_dparser_gram[SCANNER_BLOCK_SIZE] = { +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,51,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +}; + +D_Shift *d_shift_99_43_dparser_gram[] = { &d_shift_43_dparser_gram, NULL}; + +unsigned char d_scanner_99_44_1_dparser_gram[SCANNER_BLOCK_SIZE] = { +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,52,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +}; + +unsigned char d_scanner_99_45_1_dparser_gram[SCANNER_BLOCK_SIZE] = { +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,53,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +}; + +unsigned char d_scanner_99_46_1_dparser_gram[SCANNER_BLOCK_SIZE] = { +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,54,0,0,0,0,0,0,0,0,0,0,0, +}; + +D_Shift *d_shift_99_47_dparser_gram[] = { &d_shift_45_dparser_gram, NULL}; + +unsigned char d_scanner_99_48_1_dparser_gram[SCANNER_BLOCK_SIZE] = { +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,55,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +}; + +unsigned char d_scanner_99_49_1_dparser_gram[SCANNER_BLOCK_SIZE] = { +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,56,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +}; + +unsigned char d_scanner_99_50_1_dparser_gram[SCANNER_BLOCK_SIZE] = { +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,57,0,0,0,0,0,0,0,0,0,0,0, +}; + +unsigned char d_scanner_99_51_1_dparser_gram[SCANNER_BLOCK_SIZE] = { +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,58,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +}; + +unsigned char d_scanner_99_52_1_dparser_gram[SCANNER_BLOCK_SIZE] = { +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,59,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +}; + +D_Shift *d_shift_99_53_dparser_gram[] = { &d_shift_42_dparser_gram, NULL}; + +unsigned char d_scanner_99_54_1_dparser_gram[SCANNER_BLOCK_SIZE] = { +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,60,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +}; + +unsigned char d_scanner_99_55_1_dparser_gram[SCANNER_BLOCK_SIZE] = { +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,61,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +}; + +D_Shift *d_shift_99_56_dparser_gram[] = { &d_shift_44_dparser_gram, NULL}; + +unsigned char d_scanner_99_57_1_dparser_gram[SCANNER_BLOCK_SIZE] = { +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,62,0,0,0,0,0,0,0,0,0,0,0, +}; + +unsigned char d_scanner_99_58_1_dparser_gram[SCANNER_BLOCK_SIZE] = { +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,63,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +}; + +unsigned char d_scanner_99_59_1_dparser_gram[SCANNER_BLOCK_SIZE] = { +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,64,0,0,0,0,0,0,0,0,0,0,0, +}; + +unsigned char d_scanner_99_60_1_dparser_gram[SCANNER_BLOCK_SIZE] = { +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,65,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +}; + +D_Shift *d_shift_99_61_dparser_gram[] = { &d_shift_39_dparser_gram, NULL}; + +unsigned char d_scanner_99_62_1_dparser_gram[SCANNER_BLOCK_SIZE] = { +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,66,0,0,0,0,0,0,0,0,0,0,0, +}; + +D_Shift *d_shift_99_63_dparser_gram[] = { &d_shift_41_dparser_gram, NULL}; + +unsigned char d_scanner_99_64_1_dparser_gram[SCANNER_BLOCK_SIZE] = { +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,67,0,0,0,0,0,0,0,0,0,0,0, +}; + +D_Shift *d_shift_99_65_dparser_gram[] = { &d_shift_38_dparser_gram, NULL}; + +D_Shift *d_shift_99_66_dparser_gram[] = { &d_shift_40_dparser_gram, NULL}; + +D_Shift *d_accepts_diff_100_0_dparser_gram[] = {0}; +D_Shift *d_accepts_diff_100_1_dparser_gram[] = {&d_shift_59_dparser_gram,0}; +D_Shift *d_accepts_diff_100_2_dparser_gram[] = {&d_shift_65_dparser_gram,0}; +D_Shift **d_accepts_diff_100_dparser_gram[] = { +d_accepts_diff_100_0_dparser_gram, +d_accepts_diff_100_1_dparser_gram, +d_accepts_diff_100_2_dparser_gram +}; + +D_Shift *d_shifts_123_dparser_gram[] = { +&d_shift_63_dparser_gram, &d_shift_64_dparser_gram, &d_shift_65_dparser_gram, NULL}; + +D_Shift *d_accepts_diff_123_0_dparser_gram[] = {0}; +D_Shift *d_accepts_diff_123_1_dparser_gram[] = {&d_shift_65_dparser_gram,0}; +D_Shift **d_accepts_diff_123_dparser_gram[] = { +d_accepts_diff_123_0_dparser_gram, +d_accepts_diff_123_1_dparser_gram +}; + +unsigned char d_scanner_123_0_0_dparser_gram[SCANNER_BLOCK_SIZE] = { +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0, +3,4,4,4,4,4,4,4,4,4,0,0,0,0,0,0, +}; + +unsigned char d_scanner_123_1_0_dparser_gram[SCANNER_BLOCK_SIZE] = { +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +3,4,4,4,4,4,4,4,4,4,0,0,0,0,0,0, +}; + +unsigned char d_scanner_123_2_0_dparser_gram[SCANNER_BLOCK_SIZE] = { +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +5,5,5,5,5,5,5,5,0,0,0,0,0,0,0,0, +}; + +unsigned char d_scanner_123_2_1_dparser_gram[SCANNER_BLOCK_SIZE] = { +0,0,0,0,0,0,0,0,0,0,0,0,6,0,0,0, +0,0,0,0,0,6,0,0,7,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,6,0,0,0, +0,0,0,0,0,6,0,0,8,0,0,0,0,0,0,0, +}; + +unsigned char d_scanner_123_3_1_dparser_gram[SCANNER_BLOCK_SIZE] = { +0,0,0,0,0,0,0,0,0,0,0,0,9,0,0,0, +0,0,0,0,0,9,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,9,0,0,0, +0,0,0,0,0,9,0,0,0,0,0,0,0,0,0,0, +}; + +unsigned char d_scanner_123_4_1_dparser_gram[SCANNER_BLOCK_SIZE] = { +0,0,0,0,0,0,0,0,0,0,0,0,6,0,0,0, +0,0,0,0,0,6,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,6,0,0,0, +0,0,0,0,0,6,0,0,0,0,0,0,0,0,0,0, +}; + +unsigned char d_scanner_123_6_1_dparser_gram[SCANNER_BLOCK_SIZE] = { +0,10,10,10,10,10,10,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,10,10,10,10,10,10,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +}; + +unsigned char d_scanner_123_9_1_dparser_gram[SCANNER_BLOCK_SIZE] = { +0,10,10,10,10,10,10,0,0,0,0,0,11,0,0,0, +0,0,0,0,0,11,0,0,0,0,0,0,0,0,0,0, +0,10,10,10,10,10,10,0,0,0,0,0,11,0,0,0, +0,0,0,0,0,11,0,0,0,0,0,0,0,0,0,0, +}; + +D_Shift *d_shifts_125_dparser_gram[] = { +&d_shift_49_dparser_gram, NULL}; + +D_Shift *d_accepts_diff_125_0_dparser_gram[] = {0}; +D_Shift **d_accepts_diff_125_dparser_gram[] = { +d_accepts_diff_125_0_dparser_gram +}; + +D_Shift *d_accepts_diff_128_0_dparser_gram[] = {0}; +D_Shift *d_accepts_diff_128_1_dparser_gram[] = {&d_shift_59_dparser_gram,0}; +D_Shift *d_accepts_diff_128_2_dparser_gram[] = {&d_shift_65_dparser_gram,0}; +D_Shift **d_accepts_diff_128_dparser_gram[] = { +d_accepts_diff_128_0_dparser_gram, +d_accepts_diff_128_1_dparser_gram, +d_accepts_diff_128_2_dparser_gram +}; + +D_Shift *d_accepts_diff_131_0_dparser_gram[] = {0}; +D_Shift *d_accepts_diff_131_1_dparser_gram[] = {&d_shift_65_dparser_gram,0}; +D_Shift *d_accepts_diff_131_2_dparser_gram[] = {&d_shift_59_dparser_gram,0}; +D_Shift **d_accepts_diff_131_dparser_gram[] = { +d_accepts_diff_131_0_dparser_gram, +d_accepts_diff_131_1_dparser_gram, +d_accepts_diff_131_2_dparser_gram +}; + +D_Shift *d_shifts_132_dparser_gram[] = { +&d_shift_33_dparser_gram, &d_shift_34_dparser_gram, &d_shift_35_dparser_gram, &d_shift_36_dparser_gram, &d_shift_37_dparser_gram, NULL}; + +D_Shift *d_accepts_diff_132_0_dparser_gram[] = {0}; +D_Shift **d_accepts_diff_132_dparser_gram[] = { +d_accepts_diff_132_0_dparser_gram +}; + +unsigned char d_scanner_132_0_0_dparser_gram[SCANNER_BLOCK_SIZE] = { +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,2,0,0,0,0,0,3,4,0,0,0,5, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,6, +}; + +unsigned char d_scanner_132_1_1_dparser_gram[SCANNER_BLOCK_SIZE] = { +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,7,0,0,0,0,0,0,0,0,0,0,0, +}; + +D_Shift *d_shift_132_2_dparser_gram[] = { &d_shift_36_dparser_gram, NULL}; + +D_Shift *d_shift_132_3_dparser_gram[] = { &d_shift_37_dparser_gram, NULL}; + +D_Shift *d_shift_132_5_dparser_gram[] = { &d_shift_35_dparser_gram, NULL}; + +D_Shift *d_shift_132_7_dparser_gram[] = { &d_shift_34_dparser_gram, NULL}; + +unsigned char d_scanner_132_8_1_dparser_gram[SCANNER_BLOCK_SIZE] = { +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,10,0,0,0,0,0,0,0,0,0,0,0,0,0, +}; + +unsigned char d_scanner_132_9_1_dparser_gram[SCANNER_BLOCK_SIZE] = { +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,11,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +}; + +D_Shift *d_shift_132_10_dparser_gram[] = { &d_shift_33_dparser_gram, NULL}; + +D_Shift *d_accepts_diff_133_0_dparser_gram[] = {0}; +D_Shift **d_accepts_diff_133_dparser_gram[] = { +d_accepts_diff_133_0_dparser_gram +}; + +D_Shift *d_shifts_141_dparser_gram[] = { +&d_shift_32_dparser_gram, NULL}; + +D_Shift *d_accepts_diff_141_0_dparser_gram[] = {0}; +D_Shift **d_accepts_diff_141_dparser_gram[] = { +d_accepts_diff_141_0_dparser_gram +}; + +unsigned char d_scanner_141_0_0_dparser_gram[SCANNER_BLOCK_SIZE] = { +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +}; + +D_Shift *d_accepts_diff_144_0_dparser_gram[] = {0}; +D_Shift *d_accepts_diff_144_1_dparser_gram[] = {&d_shift_65_dparser_gram,0}; +D_Shift **d_accepts_diff_144_dparser_gram[] = { +d_accepts_diff_144_0_dparser_gram, +d_accepts_diff_144_1_dparser_gram +}; + +D_Shift *d_accepts_diff_151_0_dparser_gram[] = {0}; +D_Shift **d_accepts_diff_151_dparser_gram[] = { +d_accepts_diff_151_0_dparser_gram +}; + +D_Shift *d_shifts_155_dparser_gram[] = { +&d_shift_22_dparser_gram, NULL}; + +D_Shift *d_accepts_diff_155_0_dparser_gram[] = {0}; +D_Shift **d_accepts_diff_155_dparser_gram[] = { +d_accepts_diff_155_0_dparser_gram +}; + +D_Shift *d_accepts_diff_156_0_dparser_gram[] = {0}; +D_Shift **d_accepts_diff_156_dparser_gram[] = { +d_accepts_diff_156_0_dparser_gram +}; + +SB_uint8 d_scanner_3_dparser_gram[37] = { +{ NULL, {d_scanner_3_0_0_dparser_gram, d_scanner_3_0_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_3_1_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ d_shift_3_2_dparser_gram, {d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ d_shift_3_3_dparser_gram, {d_scanner_3_3_0_dparser_gram, d_scanner_3_3_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ d_shift_3_4_dparser_gram, {d_scanner_3_3_0_dparser_gram, d_scanner_3_3_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ d_shift_3_5_dparser_gram, {d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_3_6_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_3_7_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_3_8_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_3_9_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_3_10_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_3_11_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_3_12_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_3_13_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_3_14_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_3_15_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_3_16_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_3_17_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_3_18_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_3_19_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_3_20_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_3_21_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_3_22_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_3_23_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ d_shift_3_24_dparser_gram, {d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_3_25_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_3_26_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_3_27_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_3_28_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_3_29_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ d_shift_3_30_dparser_gram, {d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_3_31_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_3_32_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_3_33_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ d_shift_3_34_dparser_gram, {d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ d_shift_3_35_dparser_gram, {d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ d_shift_3_36_dparser_gram, {d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}} +}; + +SB_trans_uint8 d_transition_3_dparser_gram[37] = { +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_4_0_dparser_gram, d_accepts_diff_3_4_1_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}} +}; + +SB_uint8 d_scanner_4_dparser_gram[27] = { +{ NULL, {d_scanner_4_0_0_dparser_gram, d_scanner_4_0_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ d_shift_4_10_dparser_gram, {d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ NULL, {d_scanner_4_2_0_dparser_gram, d_scanner_4_2_1_dparser_gram, + d_scanner_4_2_2_dparser_gram, d_scanner_4_2_2_dparser_gram}}, +{ NULL, {d_scanner_4_3_0_dparser_gram, d_scanner_4_3_1_dparser_gram, + d_scanner_4_3_2_dparser_gram, d_scanner_4_3_2_dparser_gram}}, +{ d_shift_4_4_dparser_gram, {d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ d_shift_4_10_dparser_gram, {d_scanner_4_5_0_dparser_gram, d_scanner_3_0_2_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ d_shift_4_19_dparser_gram, {d_scanner_4_6_0_dparser_gram, d_scanner_4_6_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ d_shift_4_22_dparser_gram, {d_scanner_4_7_0_dparser_gram, d_scanner_4_7_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ d_shift_3_3_dparser_gram, {d_scanner_4_8_0_dparser_gram, d_scanner_4_8_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ d_shift_4_9_dparser_gram, {d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ d_shift_4_10_dparser_gram, {d_scanner_4_8_0_dparser_gram, d_scanner_4_8_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ d_shift_3_5_dparser_gram, {d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ NULL, {d_scanner_4_2_0_dparser_gram, d_scanner_4_2_1_dparser_gram, + d_scanner_4_2_2_dparser_gram, d_scanner_4_2_2_dparser_gram}}, +{ d_shift_4_13_dparser_gram, {d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ NULL, {d_scanner_4_14_0_dparser_gram, d_scanner_4_14_1_dparser_gram, + d_scanner_4_14_1_dparser_gram, d_scanner_4_14_1_dparser_gram}}, +{ NULL, {d_scanner_4_3_0_dparser_gram, d_scanner_4_3_1_dparser_gram, + d_scanner_4_3_2_dparser_gram, d_scanner_4_3_2_dparser_gram}}, +{ d_shift_4_16_dparser_gram, {d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ NULL, {d_scanner_4_17_0_dparser_gram, d_scanner_4_17_1_dparser_gram, + d_scanner_4_17_1_dparser_gram, d_scanner_4_17_1_dparser_gram}}, +{ d_shift_4_19_dparser_gram, {d_scanner_4_6_0_dparser_gram, d_scanner_4_18_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ d_shift_4_19_dparser_gram, {d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ NULL, {d_scanner_4_20_0_dparser_gram, d_scanner_4_20_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ NULL, {d_scanner_4_20_0_dparser_gram, d_scanner_4_20_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ d_shift_4_22_dparser_gram, {d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ NULL, {d_scanner_4_2_0_dparser_gram, d_scanner_4_2_1_dparser_gram, + d_scanner_4_2_2_dparser_gram, d_scanner_4_2_2_dparser_gram}}, +{ NULL, {d_scanner_4_3_0_dparser_gram, d_scanner_4_3_1_dparser_gram, + d_scanner_4_3_2_dparser_gram, d_scanner_4_3_2_dparser_gram}}, +{ d_shift_4_26_dparser_gram, {d_scanner_4_20_0_dparser_gram, d_scanner_4_25_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ d_shift_4_26_dparser_gram, {d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}} +}; + +SB_trans_uint8 d_transition_4_dparser_gram[27] = { +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_4_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_4_6_1_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_4_0_dparser_gram, d_accepts_diff_3_4_1_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}} +}; + +SB_uint8 d_scanner_5_dparser_gram[100] = { +{ NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_5_0_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_5_1_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_5_2_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_5_3_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_5_4_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_5_5_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_5_6_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_5_7_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_5_8_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_5_9_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_5_10_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_5_11_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_5_12_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_5_13_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_5_14_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_5_15_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_5_16_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_5_17_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_5_18_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_5_19_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_5_20_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_5_21_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_5_22_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_5_23_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_5_24_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_5_25_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_5_26_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_5_27_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_5_28_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_5_29_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_5_30_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_5_31_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_5_32_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_5_33_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_5_34_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_5_35_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_5_36_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_5_37_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_5_38_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_5_39_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_5_40_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_5_41_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_5_42_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_5_43_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_5_44_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_5_45_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_5_46_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_5_47_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_5_48_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_5_49_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_5_50_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_5_51_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_5_52_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_5_53_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_5_54_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_5_55_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_5_56_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ d_shift_5_57_dparser_gram, {d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_5_58_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_5_59_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_5_60_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_5_61_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_5_62_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_5_63_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ d_shift_5_64_dparser_gram, {d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_5_65_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_5_66_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_5_67_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_5_68_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_5_69_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_5_70_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ d_shift_5_71_dparser_gram, {d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ d_shift_5_72_dparser_gram, {d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_5_73_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_5_74_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_5_75_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_5_76_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_5_77_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_5_78_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_5_79_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_5_80_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_5_81_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ d_shift_5_82_dparser_gram, {d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_5_83_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_5_84_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ d_shift_5_85_dparser_gram, {d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_5_86_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_5_87_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ d_shift_5_88_dparser_gram, {d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_5_89_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_5_90_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_5_91_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_5_92_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_5_93_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_5_94_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_5_95_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_5_96_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_5_97_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_5_98_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ d_shift_5_99_dparser_gram, {d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}} +}; + +SB_trans_uint8 d_transition_5_dparser_gram[100] = { +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}} +}; + +SB_uint8 d_scanner_6_dparser_gram[2] = { +{ NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_6_0_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ d_shift_3_3_dparser_gram, {d_scanner_6_1_0_dparser_gram, d_scanner_6_0_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}} +}; + +SB_trans_uint8 d_transition_6_dparser_gram[2] = { +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}} +}; + +SB_uint8 d_scanner_13_dparser_gram[4] = { +{ NULL, {d_scanner_13_0_0_dparser_gram, d_scanner_13_0_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ d_shift_3_2_dparser_gram, {d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ d_shift_3_3_dparser_gram, {d_scanner_13_2_0_dparser_gram, d_scanner_13_2_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ d_shift_3_4_dparser_gram, {d_scanner_13_2_0_dparser_gram, d_scanner_13_2_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}} +}; + +SB_trans_uint8 d_transition_13_dparser_gram[4] = { +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_4_0_dparser_gram, d_accepts_diff_3_4_1_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}} +}; + +SB_uint8 d_scanner_17_dparser_gram[4] = { +{ NULL, {d_scanner_17_0_0_dparser_gram, d_scanner_3_0_2_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ d_shift_17_1_dparser_gram, {d_scanner_17_1_0_dparser_gram, d_scanner_3_0_2_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ NULL, {d_scanner_17_2_0_dparser_gram, d_scanner_3_0_2_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ d_shift_17_3_dparser_gram, {d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}} +}; + +SB_trans_uint8 d_transition_17_dparser_gram[4] = { +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_17_1_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}} +}; + +SB_uint8 d_scanner_30_dparser_gram[28] = { +{ NULL, {d_scanner_4_0_0_dparser_gram, d_scanner_30_0_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ d_shift_4_10_dparser_gram, {d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ NULL, {d_scanner_30_2_0_dparser_gram, d_scanner_30_2_1_dparser_gram, + d_scanner_30_2_2_dparser_gram, d_scanner_30_2_2_dparser_gram}}, +{ NULL, {d_scanner_30_3_0_dparser_gram, d_scanner_30_3_1_dparser_gram, + d_scanner_30_3_2_dparser_gram, d_scanner_30_3_2_dparser_gram}}, +{ d_shift_4_4_dparser_gram, {d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ d_shift_4_10_dparser_gram, {d_scanner_4_5_0_dparser_gram, d_scanner_3_0_2_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ d_shift_4_19_dparser_gram, {d_scanner_30_6_0_dparser_gram, d_scanner_30_6_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ d_shift_4_22_dparser_gram, {d_scanner_4_7_0_dparser_gram, d_scanner_30_7_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ d_shift_3_3_dparser_gram, {d_scanner_4_8_0_dparser_gram, d_scanner_4_8_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ d_shift_4_9_dparser_gram, {d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ d_shift_4_10_dparser_gram, {d_scanner_4_8_0_dparser_gram, d_scanner_4_8_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ d_shift_3_5_dparser_gram, {d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ d_shift_30_12_dparser_gram, {d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ NULL, {d_scanner_30_2_0_dparser_gram, d_scanner_30_2_1_dparser_gram, + d_scanner_30_2_2_dparser_gram, d_scanner_30_2_2_dparser_gram}}, +{ d_shift_4_13_dparser_gram, {d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ NULL, {d_scanner_4_17_0_dparser_gram, d_scanner_4_17_1_dparser_gram, + d_scanner_4_17_1_dparser_gram, d_scanner_4_17_1_dparser_gram}}, +{ NULL, {d_scanner_30_3_0_dparser_gram, d_scanner_30_3_1_dparser_gram, + d_scanner_30_3_2_dparser_gram, d_scanner_30_3_2_dparser_gram}}, +{ d_shift_4_16_dparser_gram, {d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ NULL, {d_scanner_30_18_0_dparser_gram, d_scanner_30_18_1_dparser_gram, + d_scanner_30_18_1_dparser_gram, d_scanner_30_18_1_dparser_gram}}, +{ d_shift_4_19_dparser_gram, {d_scanner_30_6_0_dparser_gram, d_scanner_30_19_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ d_shift_4_19_dparser_gram, {d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ NULL, {d_scanner_30_21_0_dparser_gram, d_scanner_30_21_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ NULL, {d_scanner_30_21_0_dparser_gram, d_scanner_30_21_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ d_shift_4_22_dparser_gram, {d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ NULL, {d_scanner_30_2_0_dparser_gram, d_scanner_30_2_1_dparser_gram, + d_scanner_30_2_2_dparser_gram, d_scanner_30_2_2_dparser_gram}}, +{ NULL, {d_scanner_30_3_0_dparser_gram, d_scanner_30_3_1_dparser_gram, + d_scanner_30_3_2_dparser_gram, d_scanner_30_3_2_dparser_gram}}, +{ d_shift_4_26_dparser_gram, {d_scanner_30_21_0_dparser_gram, d_scanner_30_26_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ d_shift_4_26_dparser_gram, {d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}} +}; + +SB_trans_uint8 d_transition_30_dparser_gram[28] = { +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_4_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_4_6_1_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_4_0_dparser_gram, d_accepts_diff_3_4_1_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}} +}; + +SB_uint8 d_scanner_49_dparser_gram[3] = { +{ NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_49_0_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ d_shift_3_3_dparser_gram, {d_scanner_6_1_0_dparser_gram, d_scanner_6_0_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ d_shift_30_12_dparser_gram, {d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}} +}; + +SB_trans_uint8 d_transition_49_dparser_gram[3] = { +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}} +}; + +SB_uint8 d_scanner_52_dparser_gram[39] = { +{ NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_52_0_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_52_1_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_52_2_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_52_3_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_52_4_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_52_5_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_52_6_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_52_7_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_52_8_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_52_9_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_52_10_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_52_11_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_52_12_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_52_13_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_52_14_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_52_15_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_52_16_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_52_17_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_3_18_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_52_19_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_52_20_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_52_21_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_52_22_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ d_shift_52_23_dparser_gram, {d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_52_24_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_5_21_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ d_shift_52_26_dparser_gram, {d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_52_27_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_52_28_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_3_28_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_52_30_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_52_31_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ d_shift_52_32_dparser_gram, {d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_52_33_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ d_shift_52_34_dparser_gram, {d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_52_35_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_52_36_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_52_37_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ d_shift_52_38_dparser_gram, {d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}} +}; + +SB_trans_uint8 d_transition_52_dparser_gram[39] = { +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}} +}; + +SB_uint8 d_scanner_55_dparser_gram[34] = { +{ NULL, {d_scanner_55_0_0_dparser_gram, d_scanner_55_0_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_55_1_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ d_shift_3_5_dparser_gram, {d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_55_3_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_55_4_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_55_5_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_55_6_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_3_7_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_55_8_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_52_10_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_3_10_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_55_11_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_55_12_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_5_11_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_5_12_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_55_15_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_55_16_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_52_17_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_55_18_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_55_19_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_55_20_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ d_shift_3_24_dparser_gram, {d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_55_22_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_55_23_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_55_24_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_55_25_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_52_27_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ d_shift_3_30_dparser_gram, {d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_55_28_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_55_29_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_55_30_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ d_shift_3_34_dparser_gram, {d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ d_shift_3_35_dparser_gram, {d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ d_shift_3_36_dparser_gram, {d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}} +}; + +SB_trans_uint8 d_transition_55_dparser_gram[34] = { +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}} +}; + +SB_uint8 d_scanner_59_dparser_gram[28] = { +{ NULL, {d_scanner_59_0_0_dparser_gram, d_scanner_59_0_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ d_shift_4_10_dparser_gram, {d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ NULL, {d_scanner_30_2_0_dparser_gram, d_scanner_30_2_1_dparser_gram, + d_scanner_30_2_2_dparser_gram, d_scanner_30_2_2_dparser_gram}}, +{ NULL, {d_scanner_30_3_0_dparser_gram, d_scanner_30_3_1_dparser_gram, + d_scanner_30_3_2_dparser_gram, d_scanner_30_3_2_dparser_gram}}, +{ d_shift_4_4_dparser_gram, {d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ d_shift_59_5_dparser_gram, {d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ d_shift_4_10_dparser_gram, {d_scanner_59_6_0_dparser_gram, d_scanner_3_0_2_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ d_shift_4_19_dparser_gram, {d_scanner_30_6_0_dparser_gram, d_scanner_30_6_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ d_shift_4_22_dparser_gram, {d_scanner_4_8_0_dparser_gram, d_scanner_30_7_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ d_shift_3_3_dparser_gram, {d_scanner_59_9_0_dparser_gram, d_scanner_59_9_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ d_shift_4_9_dparser_gram, {d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ d_shift_4_10_dparser_gram, {d_scanner_59_9_0_dparser_gram, d_scanner_59_9_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ d_shift_3_5_dparser_gram, {d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ NULL, {d_scanner_30_2_0_dparser_gram, d_scanner_30_2_1_dparser_gram, + d_scanner_30_2_2_dparser_gram, d_scanner_30_2_2_dparser_gram}}, +{ d_shift_4_13_dparser_gram, {d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ NULL, {d_scanner_4_17_0_dparser_gram, d_scanner_4_17_1_dparser_gram, + d_scanner_4_17_1_dparser_gram, d_scanner_4_17_1_dparser_gram}}, +{ NULL, {d_scanner_30_3_0_dparser_gram, d_scanner_30_3_1_dparser_gram, + d_scanner_30_3_2_dparser_gram, d_scanner_30_3_2_dparser_gram}}, +{ d_shift_4_16_dparser_gram, {d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ NULL, {d_scanner_30_18_0_dparser_gram, d_scanner_30_18_1_dparser_gram, + d_scanner_30_18_1_dparser_gram, d_scanner_30_18_1_dparser_gram}}, +{ d_shift_4_19_dparser_gram, {d_scanner_30_6_0_dparser_gram, d_scanner_30_19_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ d_shift_4_19_dparser_gram, {d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ NULL, {d_scanner_30_21_0_dparser_gram, d_scanner_30_21_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ NULL, {d_scanner_30_21_0_dparser_gram, d_scanner_30_21_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ d_shift_4_22_dparser_gram, {d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ NULL, {d_scanner_30_2_0_dparser_gram, d_scanner_30_2_1_dparser_gram, + d_scanner_30_2_2_dparser_gram, d_scanner_30_2_2_dparser_gram}}, +{ NULL, {d_scanner_30_3_0_dparser_gram, d_scanner_30_3_1_dparser_gram, + d_scanner_30_3_2_dparser_gram, d_scanner_30_3_2_dparser_gram}}, +{ d_shift_4_26_dparser_gram, {d_scanner_30_21_0_dparser_gram, d_scanner_30_26_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ d_shift_4_26_dparser_gram, {d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}} +}; + +SB_trans_uint8 d_transition_59_dparser_gram[28] = { +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_4_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_4_6_1_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_4_0_dparser_gram, d_accepts_diff_3_4_1_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}} +}; + +SB_uint8 d_scanner_61_dparser_gram[28] = { +{ NULL, {d_scanner_4_0_0_dparser_gram, d_scanner_61_0_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ d_shift_4_10_dparser_gram, {d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ NULL, {d_scanner_30_2_0_dparser_gram, d_scanner_30_2_1_dparser_gram, + d_scanner_30_2_2_dparser_gram, d_scanner_30_2_2_dparser_gram}}, +{ NULL, {d_scanner_30_3_0_dparser_gram, d_scanner_30_3_1_dparser_gram, + d_scanner_30_3_2_dparser_gram, d_scanner_30_3_2_dparser_gram}}, +{ d_shift_4_4_dparser_gram, {d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ d_shift_4_10_dparser_gram, {d_scanner_4_5_0_dparser_gram, d_scanner_3_0_2_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ d_shift_4_19_dparser_gram, {d_scanner_30_6_0_dparser_gram, d_scanner_30_6_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ d_shift_4_22_dparser_gram, {d_scanner_4_7_0_dparser_gram, d_scanner_30_7_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ d_shift_3_3_dparser_gram, {d_scanner_4_8_0_dparser_gram, d_scanner_4_8_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ d_shift_4_9_dparser_gram, {d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ d_shift_61_10_dparser_gram, {d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ d_shift_4_10_dparser_gram, {d_scanner_4_8_0_dparser_gram, d_scanner_4_8_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ d_shift_3_5_dparser_gram, {d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ NULL, {d_scanner_30_2_0_dparser_gram, d_scanner_30_2_1_dparser_gram, + d_scanner_30_2_2_dparser_gram, d_scanner_30_2_2_dparser_gram}}, +{ d_shift_4_13_dparser_gram, {d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ NULL, {d_scanner_4_17_0_dparser_gram, d_scanner_4_17_1_dparser_gram, + d_scanner_4_17_1_dparser_gram, d_scanner_4_17_1_dparser_gram}}, +{ NULL, {d_scanner_30_3_0_dparser_gram, d_scanner_30_3_1_dparser_gram, + d_scanner_30_3_2_dparser_gram, d_scanner_30_3_2_dparser_gram}}, +{ d_shift_4_16_dparser_gram, {d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ NULL, {d_scanner_30_18_0_dparser_gram, d_scanner_30_18_1_dparser_gram, + d_scanner_30_18_1_dparser_gram, d_scanner_30_18_1_dparser_gram}}, +{ d_shift_4_19_dparser_gram, {d_scanner_30_6_0_dparser_gram, d_scanner_30_19_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ d_shift_4_19_dparser_gram, {d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ NULL, {d_scanner_30_21_0_dparser_gram, d_scanner_30_21_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ NULL, {d_scanner_30_21_0_dparser_gram, d_scanner_30_21_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ d_shift_4_22_dparser_gram, {d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ NULL, {d_scanner_30_2_0_dparser_gram, d_scanner_30_2_1_dparser_gram, + d_scanner_30_2_2_dparser_gram, d_scanner_30_2_2_dparser_gram}}, +{ NULL, {d_scanner_30_3_0_dparser_gram, d_scanner_30_3_1_dparser_gram, + d_scanner_30_3_2_dparser_gram, d_scanner_30_3_2_dparser_gram}}, +{ d_shift_4_26_dparser_gram, {d_scanner_30_21_0_dparser_gram, d_scanner_30_26_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ d_shift_4_26_dparser_gram, {d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}} +}; + +SB_trans_uint8 d_transition_61_dparser_gram[28] = { +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_61_5_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_61_6_1_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_61_5_0_dparser_gram, d_accepts_diff_61_11_1_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}} +}; + +SB_uint8 d_scanner_72_dparser_gram[2] = { +{ NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_72_0_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ d_shift_30_12_dparser_gram, {d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}} +}; + +SB_trans_uint8 d_transition_72_dparser_gram[2] = { +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}} +}; + +SB_uint8 d_scanner_77_dparser_gram[2] = { +{ NULL, {d_scanner_13_0_0_dparser_gram, d_scanner_3_0_2_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ d_shift_3_2_dparser_gram, {d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}} +}; + +SB_trans_uint8 d_transition_77_dparser_gram[2] = { +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}} +}; + +SB_uint8 d_scanner_92_dparser_gram[2] = { +{ NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_92_0_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ d_shift_92_1_dparser_gram, {d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}} +}; + +SB_trans_uint8 d_transition_92_dparser_gram[2] = { +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}} +}; + +SB_uint8 d_scanner_95_dparser_gram[21] = { +{ NULL, {d_scanner_95_0_0_dparser_gram, d_scanner_95_0_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ NULL, {d_scanner_95_1_0_dparser_gram, d_scanner_95_1_1_dparser_gram, + d_scanner_95_1_2_dparser_gram, d_scanner_95_1_2_dparser_gram}}, +{ NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_95_2_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ NULL, {d_scanner_95_3_0_dparser_gram, d_scanner_4_2_1_dparser_gram, + d_scanner_4_2_2_dparser_gram, d_scanner_4_2_2_dparser_gram}}, +{ d_shift_4_4_dparser_gram, {d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ d_shift_3_3_dparser_gram, {d_scanner_95_5_0_dparser_gram, d_scanner_95_5_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ d_shift_4_9_dparser_gram, {d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ d_shift_3_5_dparser_gram, {d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ NULL, {d_scanner_95_1_0_dparser_gram, d_scanner_95_1_1_dparser_gram, + d_scanner_95_1_2_dparser_gram, d_scanner_95_1_2_dparser_gram}}, +{ d_shift_4_13_dparser_gram, {d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ NULL, {d_scanner_95_10_0_dparser_gram, d_scanner_4_3_2_dparser_gram, + d_scanner_4_3_2_dparser_gram, d_scanner_4_3_2_dparser_gram}}, +{ NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_55_11_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ NULL, {d_scanner_95_3_0_dparser_gram, d_scanner_4_2_1_dparser_gram, + d_scanner_4_2_2_dparser_gram, d_scanner_4_2_2_dparser_gram}}, +{ d_shift_4_16_dparser_gram, {d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ NULL, {d_scanner_95_14_0_dparser_gram, d_scanner_95_14_1_dparser_gram, + d_scanner_95_14_1_dparser_gram, d_scanner_95_14_1_dparser_gram}}, +{ NULL, {d_scanner_95_1_0_dparser_gram, d_scanner_95_1_1_dparser_gram, + d_scanner_95_1_2_dparser_gram, d_scanner_95_1_2_dparser_gram}}, +{ NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_3_13_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ NULL, {d_scanner_95_3_0_dparser_gram, d_scanner_4_2_1_dparser_gram, + d_scanner_4_2_2_dparser_gram, d_scanner_4_2_2_dparser_gram}}, +{ NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_95_18_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_95_19_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ d_shift_95_20_dparser_gram, {d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}} +}; + +SB_trans_uint8 d_transition_95_dparser_gram[21] = { +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}} +}; + +SB_uint8 d_scanner_99_dparser_gram[67] = { +{ NULL, {d_scanner_55_0_0_dparser_gram, d_scanner_99_0_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_99_1_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ d_shift_4_9_dparser_gram, {d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_99_3_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_99_4_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_99_5_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_99_6_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_99_7_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_99_8_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_99_9_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_3_9_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_99_11_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_5_9_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_99_13_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_99_14_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_99_15_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ d_shift_99_16_dparser_gram, {d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_99_17_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_99_18_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_99_19_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ d_shift_99_20_dparser_gram, {d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_5_16_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_99_22_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_99_23_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_99_24_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_52_28_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_99_26_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_99_27_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_5_26_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_99_29_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_99_30_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_99_31_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_99_32_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_99_33_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_99_34_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_99_35_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_99_36_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_5_35_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_99_38_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_99_39_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_99_40_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_99_41_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_99_42_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ d_shift_99_43_dparser_gram, {d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_99_44_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_99_45_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_99_46_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ d_shift_99_47_dparser_gram, {d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_99_48_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_99_49_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_99_50_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_99_51_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_99_52_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ d_shift_99_53_dparser_gram, {d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_99_54_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_99_55_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ d_shift_99_56_dparser_gram, {d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_99_57_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_99_58_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_99_59_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_99_60_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ d_shift_99_61_dparser_gram, {d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_99_62_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ d_shift_99_63_dparser_gram, {d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_99_64_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ d_shift_99_65_dparser_gram, {d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ d_shift_99_66_dparser_gram, {d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}} +}; + +SB_trans_uint8 d_transition_99_dparser_gram[67] = { +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}} +}; + +SB_uint8 d_scanner_123_dparser_gram[11] = { +{ NULL, {d_scanner_123_0_0_dparser_gram, d_scanner_3_0_2_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ NULL, {d_scanner_123_1_0_dparser_gram, d_scanner_3_0_2_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ d_shift_4_19_dparser_gram, {d_scanner_123_2_0_dparser_gram, d_scanner_123_2_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ d_shift_4_22_dparser_gram, {d_scanner_3_3_0_dparser_gram, d_scanner_123_3_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ d_shift_4_19_dparser_gram, {d_scanner_123_2_0_dparser_gram, d_scanner_123_4_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ d_shift_4_19_dparser_gram, {d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ NULL, {d_scanner_59_9_0_dparser_gram, d_scanner_123_6_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ NULL, {d_scanner_59_9_0_dparser_gram, d_scanner_123_6_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ d_shift_4_22_dparser_gram, {d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ d_shift_4_26_dparser_gram, {d_scanner_59_9_0_dparser_gram, d_scanner_123_9_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ d_shift_4_26_dparser_gram, {d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}} +}; + +SB_trans_uint8 d_transition_123_dparser_gram[11] = { +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_61_6_1_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}} +}; + +SB_uint8 d_scanner_125_dparser_gram[2] = { +{ NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_13_0_0_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ d_shift_3_5_dparser_gram, {d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}} +}; + +SB_trans_uint8 d_transition_125_dparser_gram[2] = { +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}} +}; + +SB_uint8 d_scanner_132_dparser_gram[11] = { +{ NULL, {d_scanner_132_0_0_dparser_gram, d_scanner_3_0_2_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_132_1_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ d_shift_132_2_dparser_gram, {d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ d_shift_132_3_dparser_gram, {d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_99_3_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ d_shift_132_5_dparser_gram, {d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_99_4_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ d_shift_132_7_dparser_gram, {d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_132_8_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_132_9_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ d_shift_132_10_dparser_gram, {d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}} +}; + +SB_trans_uint8 d_transition_132_dparser_gram[11] = { +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}} +}; + +SB_uint8 d_scanner_141_dparser_gram[2] = { +{ NULL, {d_scanner_141_0_0_dparser_gram, d_scanner_3_0_2_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ d_shift_59_5_dparser_gram, {d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}} +}; + +SB_trans_uint8 d_transition_141_dparser_gram[2] = { +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}} +}; + +SB_uint8 d_scanner_155_dparser_gram[2] = { +{ NULL, {d_scanner_17_0_0_dparser_gram, d_scanner_3_0_2_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, +{ d_shift_17_1_dparser_gram, {d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}} +}; + +SB_trans_uint8 d_transition_155_dparser_gram[2] = { +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, +{{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}} +}; + +unsigned char d_goto_valid_0_dparser_gram[] = { +0x46, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}; +D_Reduction *d_reductions_0_dparser_gram[] = {&d_reduction_9_dparser_gram}; +D_Reduction *d_reductions_2_dparser_gram[] = {&d_reduction_1_dparser_gram}; +unsigned char d_goto_valid_3_dparser_gram[] = { +0x98, 0x80, 0x6, 0x0, 0x0, 0x40, 0x0, 0x42, 0x35, 0x0, 0x20, 0x2, 0x0, 0x80, 0x0, 0x10}; +unsigned char d_goto_valid_4_dparser_gram[] = { +0x0, 0x4, 0x0, 0x0, 0x0, 0x0, 0xc4, 0x3f, 0x0, 0x0, 0x0, 0x20, 0x0, 0x80, 0x2, 0xfe}; +unsigned char d_goto_valid_5_dparser_gram[] = { +0x0, 0x20, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xf0, 0xf, 0x0, 0x0, 0x0, 0x0, 0x0}; +unsigned char d_goto_valid_6_dparser_gram[] = { +0x0, 0x41, 0x0, 0x0, 0x0, 0x0, 0x0, 0x2, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x10}; +D_Reduction *d_reductions_7_dparser_gram[] = {&d_reduction_14_dparser_gram}; +unsigned char d_goto_valid_8_dparser_gram[] = { +0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x2, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x10}; +D_Reduction *d_reductions_9_dparser_gram[] = {&d_reduction_40_dparser_gram}; +D_Reduction *d_reductions_10_dparser_gram[] = {&d_reduction_43_dparser_gram}; +unsigned char d_goto_valid_11_dparser_gram[] = { +0x0, 0x0, 0x0, 0x0, 0x0, 0x80, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}; +D_Reduction *d_reductions_11_dparser_gram[] = {&d_reduction_103_dparser_gram}; +D_Reduction *d_reductions_12_dparser_gram[] = {&d_reduction_124_dparser_gram}; +unsigned char d_goto_valid_13_dparser_gram[] = { +0x10, 0x80, 0x6, 0x0, 0x0, 0x0, 0x0, 0x2, 0x0, 0x0, 0x20, 0x2, 0x0, 0x0, 0x0, 0x10}; +D_Reduction *d_reductions_13_dparser_gram[] = {&d_reduction_2_dparser_gram}; +D_Reduction *d_reductions_14_dparser_gram[] = {&d_reduction_4_dparser_gram}; +D_Reduction *d_reductions_15_dparser_gram[] = {&d_reduction_8_dparser_gram}; +unsigned char d_goto_valid_16_dparser_gram[] = { +0x20, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}; +D_Reduction *d_reductions_16_dparser_gram[] = {&d_reduction_7_dparser_gram}; +D_RightEpsilonHint d_right_epsilon_hints_16_dparser_gram[] = {{ 0, 55, &d_reduction_5_dparser_gram}}; +unsigned char d_goto_valid_17_dparser_gram[] = { +0x0, 0x0, 0x1, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x10, 0x1, 0x0, 0x0, 0x0, 0x0}; +D_Reduction *d_reductions_18_dparser_gram[] = {&d_reduction_42_dparser_gram}; +D_Reduction *d_reductions_19_dparser_gram[] = {&d_reduction_10_dparser_gram}; +D_Reduction *d_reductions_20_dparser_gram[] = {&d_reduction_43_dparser_gram}; +unsigned char d_goto_valid_21_dparser_gram[] = { +0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x20, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}; +D_Reduction *d_reductions_21_dparser_gram[] = {&d_reduction_120_dparser_gram}; +unsigned char d_goto_valid_22_dparser_gram[] = { +0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x8, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}; +D_Reduction *d_reductions_22_dparser_gram[] = {&d_reduction_116_dparser_gram}; +unsigned char d_goto_valid_23_dparser_gram[] = { +0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x10, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}; +D_Reduction *d_reductions_23_dparser_gram[] = {&d_reduction_118_dparser_gram}; +D_Reduction *d_reductions_24_dparser_gram[] = {&d_reduction_121_dparser_gram}; +D_Reduction *d_reductions_25_dparser_gram[] = {&d_reduction_122_dparser_gram}; +D_Reduction *d_reductions_26_dparser_gram[] = {&d_reduction_123_dparser_gram}; +D_Reduction *d_reductions_27_dparser_gram[] = {&d_reduction_128_dparser_gram}; +D_Reduction *d_reductions_28_dparser_gram[] = {&d_reduction_129_dparser_gram}; +D_Reduction *d_reductions_29_dparser_gram[] = {&d_reduction_130_dparser_gram}; +unsigned char d_goto_valid_30_dparser_gram[] = { +0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xc4, 0xbf, 0x0, 0x0, 0x0, 0x20, 0x0, 0x80, 0x2, 0xfe}; +D_Reduction *d_reductions_31_dparser_gram[] = {&d_reduction_21_dparser_gram}; +D_Reduction *d_reductions_32_dparser_gram[] = {&d_reduction_110_dparser_gram}; +D_Reduction *d_reductions_33_dparser_gram[] = {&d_reduction_110_dparser_gram}; +D_Reduction *d_reductions_34_dparser_gram[] = {&d_reduction_110_dparser_gram}; +D_Reduction *d_reductions_35_dparser_gram[] = {&d_reduction_110_dparser_gram}; +D_Reduction *d_reductions_36_dparser_gram[] = {&d_reduction_110_dparser_gram}; +D_Reduction *d_reductions_37_dparser_gram[] = {&d_reduction_125_dparser_gram}; +D_Reduction *d_reductions_38_dparser_gram[] = {&d_reduction_125_dparser_gram}; +D_Reduction *d_reductions_39_dparser_gram[] = {&d_reduction_125_dparser_gram}; +D_Reduction *d_reductions_40_dparser_gram[] = {&d_reduction_29_dparser_gram}; +D_Reduction *d_reductions_41_dparser_gram[] = {&d_reduction_30_dparser_gram}; +D_Reduction *d_reductions_42_dparser_gram[] = {&d_reduction_31_dparser_gram}; +D_Reduction *d_reductions_43_dparser_gram[] = {&d_reduction_32_dparser_gram}; +D_Reduction *d_reductions_44_dparser_gram[] = {&d_reduction_33_dparser_gram}; +D_Reduction *d_reductions_45_dparser_gram[] = {&d_reduction_34_dparser_gram}; +D_Reduction *d_reductions_46_dparser_gram[] = {&d_reduction_35_dparser_gram}; +D_Reduction *d_reductions_47_dparser_gram[] = {&d_reduction_36_dparser_gram}; +unsigned char d_goto_valid_48_dparser_gram[] = { +0x0, 0x2, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}; +D_Reduction *d_reductions_48_dparser_gram[] = {&d_reduction_19_dparser_gram}; +unsigned char d_goto_valid_49_dparser_gram[] = { +0x0, 0x40, 0x0, 0x0, 0x0, 0x0, 0x0, 0x82, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x10}; +D_Reduction *d_reductions_50_dparser_gram[] = {&d_reduction_17_dparser_gram}; +D_Reduction *d_reductions_51_dparser_gram[] = {&d_reduction_37_dparser_gram}; +unsigned char d_goto_valid_52_dparser_gram[] = { +0x0, 0x18, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x80, 0xf, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}; +D_Reduction *d_reductions_52_dparser_gram[] = {&d_reduction_22_dparser_gram}; +unsigned char d_goto_valid_53_dparser_gram[] = { +0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xc4, 0xbf, 0x0, 0x0, 0x0, 0x20, 0x0, 0x80, 0x2, 0xfe}; +D_Reduction *d_reductions_54_dparser_gram[] = {&d_reduction_3_dparser_gram}; +unsigned char d_goto_valid_55_dparser_gram[] = { +0x80, 0x0, 0x0, 0x0, 0x0, 0x40, 0x0, 0x40, 0x35, 0x0, 0x0, 0x0, 0x0, 0x80, 0x0, 0x0}; +D_Reduction *d_reductions_55_dparser_gram[] = {&d_reduction_5_dparser_gram}; +unsigned char d_goto_valid_56_dparser_gram[] = { +0x0, 0x0, 0x48, 0x40, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}; +D_Reduction *d_reductions_56_dparser_gram[] = {&d_reduction_62_dparser_gram}; +D_RightEpsilonHint d_right_epsilon_hints_56_dparser_gram[] = {{ 1, 92, &d_reduction_45_dparser_gram}, { 3, 124, &d_reduction_49_dparser_gram}}; +D_Reduction *d_reductions_57_dparser_gram[] = {&d_reduction_41_dparser_gram}; +unsigned char d_goto_valid_58_dparser_gram[] = { +0x0, 0x0, 0x48, 0x40, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}; +D_Reduction *d_reductions_58_dparser_gram[] = {&d_reduction_62_dparser_gram}; +D_RightEpsilonHint d_right_epsilon_hints_58_dparser_gram[] = {{ 1, 92, &d_reduction_45_dparser_gram}, { 3, 124, &d_reduction_49_dparser_gram}}; +unsigned char d_goto_valid_59_dparser_gram[] = { +0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xc4, 0x3f, 0x0, 0x0, 0x0, 0x60, 0x0, 0x80, 0x2, 0xfe}; +unsigned char d_goto_valid_60_dparser_gram[] = { +0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xc4, 0xbf, 0x0, 0x0, 0x0, 0x20, 0x0, 0x80, 0x2, 0xfe}; +unsigned char d_goto_valid_61_dparser_gram[] = { +0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xc4, 0x3f, 0x0, 0x0, 0x0, 0x20, 0x0, 0x80, 0x6, 0xfe}; +D_Reduction *d_reductions_62_dparser_gram[] = {&d_reduction_11_dparser_gram}; +D_Reduction *d_reductions_63_dparser_gram[] = {&d_reduction_20_dparser_gram}; +unsigned char d_goto_valid_64_dparser_gram[] = { +0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x82, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x10}; +D_Reduction *d_reductions_65_dparser_gram[] = {&d_reduction_13_dparser_gram}; +D_Reduction *d_reductions_66_dparser_gram[] = {&d_reduction_16_dparser_gram}; +D_Reduction *d_reductions_67_dparser_gram[] = {&d_reduction_24_dparser_gram}; +D_Reduction *d_reductions_68_dparser_gram[] = {&d_reduction_25_dparser_gram}; +D_Reduction *d_reductions_69_dparser_gram[] = {&d_reduction_26_dparser_gram}; +D_Reduction *d_reductions_70_dparser_gram[] = {&d_reduction_27_dparser_gram}; +D_Reduction *d_reductions_71_dparser_gram[] = {&d_reduction_28_dparser_gram}; +unsigned char d_goto_valid_72_dparser_gram[] = { +0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x80, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}; +unsigned char d_goto_valid_73_dparser_gram[] = { +0x0, 0x18, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x80, 0xf, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}; +D_Reduction *d_reductions_73_dparser_gram[] = {&d_reduction_22_dparser_gram}; +D_RightEpsilonHint d_right_epsilon_hints_73_dparser_gram[] = {{ 0, 90, &d_reduction_23_dparser_gram}}; +D_Reduction *d_reductions_74_dparser_gram[] = {&d_reduction_101_dparser_gram}; +D_Reduction *d_reductions_75_dparser_gram[] = {&d_reduction_102_dparser_gram}; +D_Reduction *d_reductions_76_dparser_gram[] = {&d_reduction_6_dparser_gram}; +unsigned char d_goto_valid_77_dparser_gram[] = { +0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x20, 0x0, 0x0, 0x0, 0x0, 0x0}; +unsigned char d_goto_valid_78_dparser_gram[] = { +0x0, 0x0, 0x10, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}; +D_Reduction *d_reductions_78_dparser_gram[] = {&d_reduction_47_dparser_gram}; +D_RightEpsilonHint d_right_epsilon_hints_78_dparser_gram[] = {{ 0, 92, &d_reduction_45_dparser_gram}}; +unsigned char d_goto_valid_79_dparser_gram[] = { +0x0, 0x0, 0x0, 0xb, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}; +D_Reduction *d_reductions_79_dparser_gram[] = {&d_reduction_53_dparser_gram, &d_reduction_58_dparser_gram}; +D_RightEpsilonHint d_right_epsilon_hints_79_dparser_gram[] = {{ 2, 124, &d_reduction_49_dparser_gram}}; +unsigned char d_goto_valid_80_dparser_gram[] = { +0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x20, 0x0, 0x0, 0x0, 0x0, 0x0}; +D_Reduction *d_reductions_81_dparser_gram[] = {&d_reduction_107_dparser_gram}; +D_Reduction *d_reductions_82_dparser_gram[] = {&d_reduction_119_dparser_gram}; +D_Reduction *d_reductions_83_dparser_gram[] = {&d_reduction_107_dparser_gram}; +D_Reduction *d_reductions_84_dparser_gram[] = {&d_reduction_115_dparser_gram}; +D_Reduction *d_reductions_85_dparser_gram[] = {&d_reduction_107_dparser_gram}; +D_Reduction *d_reductions_86_dparser_gram[] = {&d_reduction_117_dparser_gram}; +D_Reduction *d_reductions_87_dparser_gram[] = {&d_reduction_12_dparser_gram}; +D_Reduction *d_reductions_88_dparser_gram[] = {&d_reduction_18_dparser_gram}; +D_Reduction *d_reductions_89_dparser_gram[] = {&d_reduction_15_dparser_gram}; +D_Reduction *d_reductions_90_dparser_gram[] = {&d_reduction_23_dparser_gram}; +D_Reduction *d_reductions_91_dparser_gram[] = {&d_reduction_38_dparser_gram}; +unsigned char d_goto_valid_92_dparser_gram[] = { +0x0, 0x0, 0x20, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x4, 0x0, 0x0, 0x0, 0x0}; +D_Reduction *d_reductions_92_dparser_gram[] = {&d_reduction_45_dparser_gram}; +unsigned char d_goto_valid_93_dparser_gram[] = { +0x0, 0x0, 0x80, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}; +D_Reduction *d_reductions_93_dparser_gram[] = {&d_reduction_51_dparser_gram}; +D_RightEpsilonHint d_right_epsilon_hints_93_dparser_gram[] = {{ 1, 124, &d_reduction_49_dparser_gram}}; +D_Reduction *d_reductions_94_dparser_gram[] = {&d_reduction_52_dparser_gram}; +unsigned char d_goto_valid_95_dparser_gram[] = { +0x0, 0x0, 0x0, 0x90, 0x2, 0x40, 0x81, 0x3, 0x0, 0x0, 0x0, 0x28, 0x0, 0x80, 0x2, 0x1c}; +D_Reduction *d_reductions_96_dparser_gram[] = {&d_reduction_38_dparser_gram}; +unsigned char d_goto_valid_97_dparser_gram[] = { +0x0, 0x0, 0x40, 0x40, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}; +D_Reduction *d_reductions_97_dparser_gram[] = {&d_reduction_62_dparser_gram}; +D_RightEpsilonHint d_right_epsilon_hints_97_dparser_gram[] = {{ 0, 111, &d_reduction_48_dparser_gram}, { 3, 124, &d_reduction_49_dparser_gram}}; +D_Reduction *d_reductions_98_dparser_gram[] = {&d_reduction_46_dparser_gram}; +unsigned char d_goto_valid_99_dparser_gram[] = { +0x0, 0x0, 0x0, 0x0, 0xb0, 0xc, 0x1, 0x0, 0x0, 0x0, 0x0, 0x0, 0xf0, 0x3f, 0x2, 0x0}; +D_Reduction *d_reductions_99_dparser_gram[] = {&d_reduction_97_dparser_gram}; +D_RightEpsilonHint d_right_epsilon_hints_99_dparser_gram[] = {{ 0, 124, &d_reduction_49_dparser_gram}, { 2, 151, &d_reduction_91_dparser_gram}}; +unsigned char d_goto_valid_100_dparser_gram[] = { +0x0, 0x0, 0x0, 0x0, 0x1, 0x0, 0xc4, 0x3f, 0x0, 0x0, 0x0, 0x20, 0x0, 0x80, 0x2, 0xfe}; +unsigned char d_goto_valid_101_dparser_gram[] = { +0x0, 0x0, 0x0, 0x0, 0x4, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}; +D_Reduction *d_reductions_101_dparser_gram[] = {&d_reduction_73_dparser_gram}; +unsigned char d_goto_valid_102_dparser_gram[] = { +0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x2, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}; +D_Reduction *d_reductions_102_dparser_gram[] = {&d_reduction_106_dparser_gram}; +D_Reduction *d_reductions_103_dparser_gram[] = {&d_reduction_57_dparser_gram}; +unsigned char d_goto_valid_104_dparser_gram[] = { +0x0, 0x0, 0x0, 0x4, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}; +D_Reduction *d_reductions_104_dparser_gram[] = {&d_reduction_56_dparser_gram, &d_reduction_70_dparser_gram}; +D_RightEpsilonHint d_right_epsilon_hints_104_dparser_gram[] = {{ 0, 132, &d_reduction_54_dparser_gram}}; +unsigned char d_goto_valid_105_dparser_gram[] = { +0x0, 0x0, 0x0, 0x20, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}; +D_Reduction *d_reductions_105_dparser_gram[] = {&d_reduction_61_dparser_gram}; +D_RightEpsilonHint d_right_epsilon_hints_105_dparser_gram[] = {{ 0, 133, &d_reduction_59_dparser_gram}}; +D_Reduction *d_reductions_106_dparser_gram[] = {&d_reduction_72_dparser_gram}; +D_Reduction *d_reductions_107_dparser_gram[] = {&d_reduction_71_dparser_gram}; +D_Reduction *d_reductions_108_dparser_gram[] = {&d_reduction_63_dparser_gram}; +D_Reduction *d_reductions_109_dparser_gram[] = {&d_reduction_64_dparser_gram}; +D_Reduction *d_reductions_110_dparser_gram[] = {&d_reduction_65_dparser_gram}; +D_Reduction *d_reductions_111_dparser_gram[] = {&d_reduction_48_dparser_gram}; +D_Reduction *d_reductions_112_dparser_gram[] = {&d_reduction_80_dparser_gram}; +D_Reduction *d_reductions_113_dparser_gram[] = {&d_reduction_81_dparser_gram}; +D_Reduction *d_reductions_114_dparser_gram[] = {&d_reduction_82_dparser_gram}; +D_Reduction *d_reductions_115_dparser_gram[] = {&d_reduction_83_dparser_gram}; +D_Reduction *d_reductions_116_dparser_gram[] = {&d_reduction_84_dparser_gram}; +D_Reduction *d_reductions_117_dparser_gram[] = {&d_reduction_85_dparser_gram}; +D_Reduction *d_reductions_118_dparser_gram[] = {&d_reduction_86_dparser_gram}; +D_Reduction *d_reductions_119_dparser_gram[] = {&d_reduction_87_dparser_gram}; +D_Reduction *d_reductions_120_dparser_gram[] = {&d_reduction_88_dparser_gram}; +D_Reduction *d_reductions_121_dparser_gram[] = {&d_reduction_89_dparser_gram}; +D_Reduction *d_reductions_122_dparser_gram[] = {&d_reduction_50_dparser_gram}; +unsigned char d_goto_valid_123_dparser_gram[] = { +0x0, 0x0, 0x0, 0x0, 0x40, 0x0, 0x0, 0x3c, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xe0}; +D_Reduction *d_reductions_124_dparser_gram[] = {&d_reduction_49_dparser_gram}; +unsigned char d_goto_valid_125_dparser_gram[] = { +0x0, 0x0, 0x0, 0x0, 0x0, 0x52, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x80, 0x0, 0x0}; +D_Reduction *d_reductions_125_dparser_gram[] = {&d_reduction_95_dparser_gram}; +D_RightEpsilonHint d_right_epsilon_hints_125_dparser_gram[] = {{ 1, 151, &d_reduction_91_dparser_gram}}; +D_Reduction *d_reductions_126_dparser_gram[] = {&d_reduction_96_dparser_gram}; +D_Reduction *d_reductions_127_dparser_gram[] = {&d_reduction_98_dparser_gram}; +unsigned char d_goto_valid_128_dparser_gram[] = { +0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xc4, 0xbf, 0x0, 0x0, 0x0, 0x20, 0x0, 0x80, 0x2, 0xfe}; +D_Reduction *d_reductions_129_dparser_gram[] = {&d_reduction_69_dparser_gram}; +unsigned char d_goto_valid_130_dparser_gram[] = { +0x0, 0x0, 0x48, 0x40, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}; +D_Reduction *d_reductions_130_dparser_gram[] = {&d_reduction_62_dparser_gram}; +D_RightEpsilonHint d_right_epsilon_hints_130_dparser_gram[] = {{ 1, 92, &d_reduction_45_dparser_gram}, { 3, 124, &d_reduction_49_dparser_gram}}; +unsigned char d_goto_valid_131_dparser_gram[] = { +0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xc4, 0x3f, 0x0, 0x0, 0x0, 0x20, 0x0, 0x80, 0x6, 0xfe}; +unsigned char d_goto_valid_132_dparser_gram[] = { +0x0, 0x0, 0x0, 0x0, 0x8, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x80, 0xf, 0x0, 0x0, 0x0}; +D_Reduction *d_reductions_132_dparser_gram[] = {&d_reduction_54_dparser_gram}; +unsigned char d_goto_valid_133_dparser_gram[] = { +0x0, 0x0, 0x0, 0x0, 0x8, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x80, 0xf, 0x0, 0x0, 0x0}; +D_Reduction *d_reductions_133_dparser_gram[] = {&d_reduction_59_dparser_gram}; +D_Reduction *d_reductions_134_dparser_gram[] = {&d_reduction_79_dparser_gram}; +D_Reduction *d_reductions_135_dparser_gram[] = {&d_reduction_90_dparser_gram}; +unsigned char d_goto_valid_136_dparser_gram[] = { +0x0, 0x0, 0x0, 0x0, 0x0, 0x1, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}; +D_Reduction *d_reductions_136_dparser_gram[] = {&d_reduction_93_dparser_gram}; +D_RightEpsilonHint d_right_epsilon_hints_136_dparser_gram[] = {{ 0, 151, &d_reduction_91_dparser_gram}}; +D_Reduction *d_reductions_137_dparser_gram[] = {&d_reduction_94_dparser_gram}; +D_Reduction *d_reductions_138_dparser_gram[] = {&d_reduction_99_dparser_gram}; +D_Reduction *d_reductions_139_dparser_gram[] = {&d_reduction_66_dparser_gram}; +D_Reduction *d_reductions_140_dparser_gram[] = {&d_reduction_68_dparser_gram}; +unsigned char d_goto_valid_141_dparser_gram[] = { +0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x40, 0x0, 0x0, 0x0, 0x0}; +D_Reduction *d_reductions_142_dparser_gram[] = {&d_reduction_104_dparser_gram}; +D_Reduction *d_reductions_143_dparser_gram[] = {&d_reduction_105_dparser_gram}; +unsigned char d_goto_valid_144_dparser_gram[] = { +0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x3c, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xe0}; +D_Reduction *d_reductions_145_dparser_gram[] = {&d_reduction_75_dparser_gram}; +D_Reduction *d_reductions_146_dparser_gram[] = {&d_reduction_76_dparser_gram}; +D_Reduction *d_reductions_147_dparser_gram[] = {&d_reduction_77_dparser_gram}; +D_Reduction *d_reductions_148_dparser_gram[] = {&d_reduction_78_dparser_gram}; +D_Reduction *d_reductions_149_dparser_gram[] = {&d_reduction_55_dparser_gram}; +D_Reduction *d_reductions_150_dparser_gram[] = {&d_reduction_60_dparser_gram}; +unsigned char d_goto_valid_151_dparser_gram[] = { +0x0, 0x0, 0x0, 0x0, 0x0, 0x20, 0x0, 0x2, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x10}; +D_Reduction *d_reductions_151_dparser_gram[] = {&d_reduction_91_dparser_gram}; +D_Reduction *d_reductions_152_dparser_gram[] = {&d_reduction_67_dparser_gram}; +D_Reduction *d_reductions_153_dparser_gram[] = {&d_reduction_74_dparser_gram}; +D_Reduction *d_reductions_154_dparser_gram[] = {&d_reduction_92_dparser_gram}; +unsigned char d_goto_valid_155_dparser_gram[] = { +0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x10, 0x0, 0x0, 0x0, 0x0, 0x0}; +unsigned char d_goto_valid_156_dparser_gram[] = { +0x0, 0x0, 0x0, 0x0, 0x0, 0x40, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x80, 0x0, 0x0}; +D_Reduction *d_reductions_157_dparser_gram[] = {&d_reduction_100_dparser_gram}; +unsigned short d_gotos_dparser_gram[547] = { +2,3,14,15,31,4,16,49,54,50,56,53,60,55,17,51, +18,19,59,61,62,65,78,90,17,79,18,19,92,89,93,81, +97,80,79,88,67,99,100,73,74,131,80,132,32,20,133,134, +33,34,35,36,37,38,39,40,21,152,52,94,95,5,96,6, +153,7,21,8,9,157,41,42,43,44,45,46,47,48,13,52, +142,112,0,79,10,66,57,22,11,80,58,80,137,0,10,138, +13,139,11,68,69,70,71,72,158,23,98,24,0,77,12,0, +0,0,0,25,26,27,13,28,29,30,0,13,150,13,0,0, +0,0,64,0,155,13,33,34,35,36,37,38,39,40,0,63, +156,0,13,76,20,0,0,33,34,35,36,37,38,39,40,0, +75,0,12,0,5,0,6,151,7,12,8,9,83,22,0,0, +33,34,35,36,37,38,39,40,145,146,147,148,149,0,22,23, +0,24,0,0,0,154,38,39,40,25,26,27,13,28,29,30, +23,0,24,13,0,12,0,22,82,135,25,26,27,13,28,29, +30,91,74,145,146,147,148,149,0,23,0,24,0,136,38,39, +40,0,0,25,26,27,13,28,29,30,85,0,0,0,33,34, +35,36,37,38,39,40,0,84,28,29,30,87,0,0,0,33, +34,35,36,37,38,39,40,0,0,0,0,0,0,68,69,70, +71,72,0,0,0,22,0,123,124,0,125,0,0,126,127,0, +28,29,30,128,0,0,22,23,0,24,0,0,0,0,0,0, +0,25,26,27,13,28,29,30,23,104,24,86,105,0,106,0, +0,0,25,26,27,13,28,29,30,0,0,107,0,108,0,0, +129,0,0,0,109,110,111,113,114,115,116,117,118,119,120,121, +122,0,130,0,103,0,33,34,35,36,37,38,39,40,0,0, +0,0,0,0,0,0,0,141,101,0,102,33,34,35,36,37, +38,39,40,0,140,0,0,0,0,0,0,0,12,22,103,0, +0,0,0,0,0,0,0,26,27,13,0,0,0,0,0,23, +0,24,22,0,0,0,0,0,0,25,26,27,13,28,29,30, +0,0,0,0,23,0,24,0,0,0,0,0,0,0,25,26, +27,13,28,29,30,144,0,0,0,33,34,35,36,37,38,39, +40,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +22,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,23,0,24,143,0,0,0,0,0,0,25,26,27,13, +28,29,30}; + +D_ErrorRecoveryHint d_error_recovery_hints_3_dparser_gram[] = { +{ 0, 7, "}"}, +{ 0, 15, ";"}}; +D_ErrorRecoveryHint d_error_recovery_hints_4_dparser_gram[] = { +{ 0, 7, "}"}, +{ 0, 50, ")"}, +{ 0, 50, "]"}}; +D_ErrorRecoveryHint d_error_recovery_hints_5_dparser_gram[] = {{ 1, 7, "}"}}; +D_ErrorRecoveryHint d_error_recovery_hints_11_dparser_gram[] = {{ 1, 46, "}"}}; +D_ErrorRecoveryHint d_error_recovery_hints_13_dparser_gram[] = {{ 0, 15, ";"}}; +D_ErrorRecoveryHint d_error_recovery_hints_17_dparser_gram[] = {{ 1, 15, ";"}}; +D_ErrorRecoveryHint d_error_recovery_hints_21_dparser_gram[] = {{ 1, 50, ")"}}; +D_ErrorRecoveryHint d_error_recovery_hints_22_dparser_gram[] = {{ 1, 50, "}"}}; +D_ErrorRecoveryHint d_error_recovery_hints_23_dparser_gram[] = {{ 1, 50, "]"}}; +D_ErrorRecoveryHint d_error_recovery_hints_48_dparser_gram[] = {{ 2, 7, "}"}}; +D_ErrorRecoveryHint d_error_recovery_hints_53_dparser_gram[] = { +{ 0, 46, "}"}, +{ 0, 50, ")"}, +{ 0, 50, "]"}}; +D_ErrorRecoveryHint d_error_recovery_hints_55_dparser_gram[] = {{ 0, 7, "}"}}; +D_ErrorRecoveryHint d_error_recovery_hints_56_dparser_gram[] = {{ 2, 15, ";"}}; +D_ErrorRecoveryHint d_error_recovery_hints_59_dparser_gram[] = { +{ 0, 50, ")"}, +{ 0, 50, "]"}, +{ 0, 50, "}"}}; +D_ErrorRecoveryHint d_error_recovery_hints_62_dparser_gram[] = {{ 3, 7, "}"}}; +D_ErrorRecoveryHint d_error_recovery_hints_74_dparser_gram[] = {{ 3, 46, "}"}}; +D_ErrorRecoveryHint d_error_recovery_hints_77_dparser_gram[] = {{ 3, 15, ";"}}; +D_ErrorRecoveryHint d_error_recovery_hints_81_dparser_gram[] = {{ 3, 50, ")"}}; +D_ErrorRecoveryHint d_error_recovery_hints_83_dparser_gram[] = {{ 3, 50, "}"}}; +D_ErrorRecoveryHint d_error_recovery_hints_85_dparser_gram[] = {{ 3, 50, "]"}}; +D_ErrorRecoveryHint d_error_recovery_hints_87_dparser_gram[] = {{ 4, 7, "}"}}; +D_ErrorRecoveryHint d_error_recovery_hints_91_dparser_gram[] = {{ 4, 15, ";"}}; +D_ErrorRecoveryHint d_error_recovery_hints_95_dparser_gram[] = { +{ 0, 31, "}"}, +{ 0, 31, ")"}, +{ 0, 48, "]"}}; +D_ErrorRecoveryHint d_error_recovery_hints_99_dparser_gram[] = {{ 0, 48, "]"}}; +D_ErrorRecoveryHint d_error_recovery_hints_100_dparser_gram[] = { +{ 0, 31, "}"}, +{ 0, 50, ")"}, +{ 0, 50, "]"}}; +D_ErrorRecoveryHint d_error_recovery_hints_101_dparser_gram[] = {{ 1, 31, ")"}}; +D_ErrorRecoveryHint d_error_recovery_hints_102_dparser_gram[] = {{ 1, 48, "]"}}; +D_ErrorRecoveryHint d_error_recovery_hints_125_dparser_gram[] = {{ 0, 46, "}"}}; +D_ErrorRecoveryHint d_error_recovery_hints_130_dparser_gram[] = {{ 2, 31, ")"}}; +D_ErrorRecoveryHint d_error_recovery_hints_131_dparser_gram[] = { +{ 0, 48, "]"}, +{ 0, 50, ")"}, +{ 0, 50, "}"}}; +D_ErrorRecoveryHint d_error_recovery_hints_139_dparser_gram[] = {{ 3, 31, "}"}}; +D_ErrorRecoveryHint d_error_recovery_hints_141_dparser_gram[] = {{ 3, 31, ")"}}; +D_ErrorRecoveryHint d_error_recovery_hints_142_dparser_gram[] = {{ 3, 48, "]"}}; +D_ErrorRecoveryHint d_error_recovery_hints_152_dparser_gram[] = {{ 4, 31, ")"}}; + +D_State d_states_dparser_gram[] = { +{ d_goto_valid_0_dparser_gram, 1, { 1, d_reductions_0_dparser_gram}, { 0, NULL}, { 0, NULL}, NULL, NULL, NULL, sizeof(unsigned char), 0, D_SCAN_ALL, NULL, (D_Shift***)NULL, -1}, +{ NULL, -2147483647, { 0, NULL}, { 0, NULL}, { 0, NULL}, NULL, NULL, NULL, sizeof(unsigned char), 1, D_SCAN_ALL, NULL, (D_Shift***)NULL, -1}, +{ NULL, -2147483647, { 1, d_reductions_2_dparser_gram}, { 0, NULL}, { 0, NULL}, NULL, NULL, NULL, sizeof(unsigned char), 0, D_SCAN_ALL, NULL, (D_Shift***)NULL, -1}, +{ d_goto_valid_3_dparser_gram, 1, { 0, NULL}, { 0, NULL}, { 2, d_error_recovery_hints_3_dparser_gram}, d_shifts_3_dparser_gram, NULL, (void*)d_scanner_3_dparser_gram, sizeof(unsigned char), 0, D_SCAN_ALL, (void*)d_transition_3_dparser_gram, d_accepts_diff_3_dparser_gram, -1}, +{ d_goto_valid_4_dparser_gram, 6, { 0, NULL}, { 0, NULL}, { 3, d_error_recovery_hints_4_dparser_gram}, d_shifts_4_dparser_gram, NULL, (void*)d_scanner_4_dparser_gram, sizeof(unsigned char), 0, D_SCAN_ALL, (void*)d_transition_4_dparser_gram, d_accepts_diff_4_dparser_gram, -1}, +{ d_goto_valid_5_dparser_gram, 6, { 0, NULL}, { 0, NULL}, { 1, d_error_recovery_hints_5_dparser_gram}, d_shifts_5_dparser_gram, NULL, (void*)d_scanner_5_dparser_gram, sizeof(unsigned char), 0, D_SCAN_ALL, (void*)d_transition_5_dparser_gram, d_accepts_diff_5_dparser_gram, -1}, +{ d_goto_valid_6_dparser_gram, -1, { 0, NULL}, { 0, NULL}, { 1, d_error_recovery_hints_5_dparser_gram}, d_shifts_6_dparser_gram, NULL, (void*)d_scanner_6_dparser_gram, sizeof(unsigned char), 0, D_SCAN_ALL, (void*)d_transition_6_dparser_gram, d_accepts_diff_6_dparser_gram, -1}, +{ NULL, -2147483647, { 1, d_reductions_7_dparser_gram}, { 0, NULL}, { 0, NULL}, NULL, NULL, NULL, sizeof(unsigned char), 0, D_SCAN_ALL, NULL, (D_Shift***)NULL, -1}, +{ d_goto_valid_8_dparser_gram, 46, { 0, NULL}, { 0, NULL}, { 1, d_error_recovery_hints_5_dparser_gram}, d_shifts_6_dparser_gram, NULL, (void*)d_scanner_6_dparser_gram, sizeof(unsigned char), 0, D_SCAN_ALL, (void*)d_transition_6_dparser_gram, d_accepts_diff_6_dparser_gram, -1}, +{ NULL, -2147483647, { 1, d_reductions_9_dparser_gram}, { 0, NULL}, { 0, NULL}, NULL, NULL, NULL, sizeof(unsigned char), 0, D_SCAN_ALL, NULL, (D_Shift***)NULL, -1}, +{ NULL, -2147483647, { 1, d_reductions_10_dparser_gram}, { 0, NULL}, { 0, NULL}, NULL, NULL, NULL, sizeof(unsigned char), 0, D_SCAN_ALL, NULL, (D_Shift***)NULL, -1}, +{ d_goto_valid_11_dparser_gram, 39, { 1, d_reductions_11_dparser_gram}, { 0, NULL}, { 1, d_error_recovery_hints_11_dparser_gram}, NULL, NULL, NULL, sizeof(unsigned char), 0, D_SCAN_ALL, NULL, (D_Shift***)NULL, -1}, +{ NULL, -2147483647, { 1, d_reductions_12_dparser_gram}, { 0, NULL}, { 0, NULL}, NULL, NULL, NULL, sizeof(unsigned char), 0, D_SCAN_ALL, NULL, (D_Shift***)NULL, -1}, +{ d_goto_valid_13_dparser_gram, -9, { 1, d_reductions_13_dparser_gram}, { 0, NULL}, { 1, d_error_recovery_hints_13_dparser_gram}, d_shifts_13_dparser_gram, NULL, (void*)d_scanner_13_dparser_gram, sizeof(unsigned char), 0, D_SCAN_ALL, (void*)d_transition_13_dparser_gram, d_accepts_diff_13_dparser_gram, -1}, +{ NULL, -2147483647, { 1, d_reductions_14_dparser_gram}, { 0, NULL}, { 0, NULL}, NULL, NULL, NULL, sizeof(unsigned char), 0, D_SCAN_ALL, NULL, (D_Shift***)NULL, -1}, +{ NULL, -2147483647, { 1, d_reductions_15_dparser_gram}, { 0, NULL}, { 0, NULL}, NULL, NULL, NULL, sizeof(unsigned char), 0, D_SCAN_ALL, NULL, (D_Shift***)NULL, -1}, +{ d_goto_valid_16_dparser_gram, -5, { 1, d_reductions_16_dparser_gram}, { 1, d_right_epsilon_hints_16_dparser_gram}, { 0, NULL}, NULL, NULL, NULL, sizeof(unsigned char), 0, D_SCAN_ALL, NULL, (D_Shift***)NULL, -1}, +{ d_goto_valid_17_dparser_gram, -2, { 0, NULL}, { 0, NULL}, { 1, d_error_recovery_hints_17_dparser_gram}, d_shifts_17_dparser_gram, NULL, (void*)d_scanner_17_dparser_gram, sizeof(unsigned char), 0, D_SCAN_ALL, (void*)d_transition_17_dparser_gram, d_accepts_diff_17_dparser_gram, -1}, +{ NULL, -2147483647, { 1, d_reductions_18_dparser_gram}, { 0, NULL}, { 0, NULL}, NULL, NULL, NULL, sizeof(unsigned char), 0, D_SCAN_ALL, NULL, (D_Shift***)NULL, -1}, +{ NULL, -2147483647, { 1, d_reductions_19_dparser_gram}, { 0, NULL}, { 0, NULL}, NULL, NULL, NULL, sizeof(unsigned char), 0, D_SCAN_ALL, NULL, (D_Shift***)NULL, -1}, +{ NULL, -2147483647, { 1, d_reductions_20_dparser_gram}, { 0, NULL}, { 0, NULL}, NULL, NULL, NULL, sizeof(unsigned char), 0, D_SCAN_ALL, NULL, (D_Shift***)NULL, -1}, +{ d_goto_valid_21_dparser_gram, 41, { 1, d_reductions_21_dparser_gram}, { 0, NULL}, { 1, d_error_recovery_hints_21_dparser_gram}, NULL, NULL, NULL, sizeof(unsigned char), 0, D_SCAN_ALL, NULL, (D_Shift***)NULL, -1}, +{ d_goto_valid_22_dparser_gram, 32, { 1, d_reductions_22_dparser_gram}, { 0, NULL}, { 1, d_error_recovery_hints_22_dparser_gram}, NULL, NULL, NULL, sizeof(unsigned char), 0, D_SCAN_ALL, NULL, (D_Shift***)NULL, -1}, +{ d_goto_valid_23_dparser_gram, 32, { 1, d_reductions_23_dparser_gram}, { 0, NULL}, { 1, d_error_recovery_hints_23_dparser_gram}, NULL, NULL, NULL, sizeof(unsigned char), 0, D_SCAN_ALL, NULL, (D_Shift***)NULL, -1}, +{ NULL, -2147483647, { 1, d_reductions_24_dparser_gram}, { 0, NULL}, { 0, NULL}, NULL, NULL, NULL, sizeof(unsigned char), 0, D_SCAN_ALL, NULL, (D_Shift***)NULL, -1}, +{ NULL, -2147483647, { 1, d_reductions_25_dparser_gram}, { 0, NULL}, { 0, NULL}, NULL, NULL, NULL, sizeof(unsigned char), 0, D_SCAN_ALL, NULL, (D_Shift***)NULL, -1}, +{ NULL, -2147483647, { 1, d_reductions_26_dparser_gram}, { 0, NULL}, { 0, NULL}, NULL, NULL, NULL, sizeof(unsigned char), 0, D_SCAN_ALL, NULL, (D_Shift***)NULL, -1}, +{ NULL, -2147483647, { 1, d_reductions_27_dparser_gram}, { 0, NULL}, { 0, NULL}, NULL, NULL, NULL, sizeof(unsigned char), 0, D_SCAN_ALL, NULL, (D_Shift***)NULL, -1}, +{ NULL, -2147483647, { 1, d_reductions_28_dparser_gram}, { 0, NULL}, { 0, NULL}, NULL, NULL, NULL, sizeof(unsigned char), 0, D_SCAN_ALL, NULL, (D_Shift***)NULL, -1}, +{ NULL, -2147483647, { 1, d_reductions_29_dparser_gram}, { 0, NULL}, { 0, NULL}, NULL, NULL, NULL, sizeof(unsigned char), 0, D_SCAN_ALL, NULL, (D_Shift***)NULL, -1}, +{ d_goto_valid_30_dparser_gram, -80, { 0, NULL}, { 0, NULL}, { 3, d_error_recovery_hints_4_dparser_gram}, d_shifts_30_dparser_gram, NULL, (void*)d_scanner_30_dparser_gram, sizeof(unsigned char), 0, D_SCAN_ALL, (void*)d_transition_30_dparser_gram, d_accepts_diff_30_dparser_gram, -1}, +{ NULL, -2147483647, { 1, d_reductions_31_dparser_gram}, { 0, NULL}, { 0, NULL}, NULL, NULL, NULL, sizeof(unsigned char), 0, D_SCAN_ALL, NULL, (D_Shift***)NULL, -1}, +{ NULL, -2147483647, { 1, d_reductions_32_dparser_gram}, { 0, NULL}, { 0, NULL}, NULL, NULL, NULL, sizeof(unsigned char), 0, D_SCAN_ALL, NULL, (D_Shift***)NULL, -1}, +{ NULL, -2147483647, { 1, d_reductions_33_dparser_gram}, { 0, NULL}, { 0, NULL}, NULL, NULL, NULL, sizeof(unsigned char), 0, D_SCAN_ALL, NULL, (D_Shift***)NULL, -1}, +{ NULL, -2147483647, { 1, d_reductions_34_dparser_gram}, { 0, NULL}, { 0, NULL}, NULL, NULL, NULL, sizeof(unsigned char), 0, D_SCAN_ALL, NULL, (D_Shift***)NULL, -1}, +{ NULL, -2147483647, { 1, d_reductions_35_dparser_gram}, { 0, NULL}, { 0, NULL}, NULL, NULL, NULL, sizeof(unsigned char), 0, D_SCAN_ALL, NULL, (D_Shift***)NULL, -1}, +{ NULL, -2147483647, { 1, d_reductions_36_dparser_gram}, { 0, NULL}, { 0, NULL}, NULL, NULL, NULL, sizeof(unsigned char), 0, D_SCAN_ALL, NULL, (D_Shift***)NULL, -1}, +{ NULL, -2147483647, { 1, d_reductions_37_dparser_gram}, { 0, NULL}, { 0, NULL}, NULL, NULL, NULL, sizeof(unsigned char), 0, D_SCAN_ALL, NULL, (D_Shift***)NULL, -1}, +{ NULL, -2147483647, { 1, d_reductions_38_dparser_gram}, { 0, NULL}, { 0, NULL}, NULL, NULL, NULL, sizeof(unsigned char), 0, D_SCAN_ALL, NULL, (D_Shift***)NULL, -1}, +{ NULL, -2147483647, { 1, d_reductions_39_dparser_gram}, { 0, NULL}, { 0, NULL}, NULL, NULL, NULL, sizeof(unsigned char), 0, D_SCAN_ALL, NULL, (D_Shift***)NULL, -1}, +{ NULL, -2147483647, { 1, d_reductions_40_dparser_gram}, { 0, NULL}, { 0, NULL}, NULL, NULL, NULL, sizeof(unsigned char), 0, D_SCAN_ALL, NULL, (D_Shift***)NULL, -1}, +{ NULL, -2147483647, { 1, d_reductions_41_dparser_gram}, { 0, NULL}, { 0, NULL}, NULL, NULL, NULL, sizeof(unsigned char), 0, D_SCAN_ALL, NULL, (D_Shift***)NULL, -1}, +{ NULL, -2147483647, { 1, d_reductions_42_dparser_gram}, { 0, NULL}, { 0, NULL}, NULL, NULL, NULL, sizeof(unsigned char), 0, D_SCAN_ALL, NULL, (D_Shift***)NULL, -1}, +{ NULL, -2147483647, { 1, d_reductions_43_dparser_gram}, { 0, NULL}, { 0, NULL}, NULL, NULL, NULL, sizeof(unsigned char), 0, D_SCAN_ALL, NULL, (D_Shift***)NULL, -1}, +{ NULL, -2147483647, { 1, d_reductions_44_dparser_gram}, { 0, NULL}, { 0, NULL}, NULL, NULL, NULL, sizeof(unsigned char), 0, D_SCAN_ALL, NULL, (D_Shift***)NULL, -1}, +{ NULL, -2147483647, { 1, d_reductions_45_dparser_gram}, { 0, NULL}, { 0, NULL}, NULL, NULL, NULL, sizeof(unsigned char), 0, D_SCAN_ALL, NULL, (D_Shift***)NULL, -1}, +{ NULL, -2147483647, { 1, d_reductions_46_dparser_gram}, { 0, NULL}, { 0, NULL}, NULL, NULL, NULL, sizeof(unsigned char), 0, D_SCAN_ALL, NULL, (D_Shift***)NULL, -1}, +{ NULL, -2147483647, { 1, d_reductions_47_dparser_gram}, { 0, NULL}, { 0, NULL}, NULL, NULL, NULL, sizeof(unsigned char), 0, D_SCAN_ALL, NULL, (D_Shift***)NULL, -1}, +{ d_goto_valid_48_dparser_gram, -12, { 1, d_reductions_48_dparser_gram}, { 0, NULL}, { 1, d_error_recovery_hints_48_dparser_gram}, NULL, NULL, NULL, sizeof(unsigned char), 0, D_SCAN_ALL, NULL, (D_Shift***)NULL, -1}, +{ d_goto_valid_49_dparser_gram, -22, { 0, NULL}, { 0, NULL}, { 1, d_error_recovery_hints_48_dparser_gram}, d_shifts_49_dparser_gram, NULL, (void*)d_scanner_49_dparser_gram, sizeof(unsigned char), 0, D_SCAN_ALL, (void*)d_transition_49_dparser_gram, d_accepts_diff_49_dparser_gram, -1}, +{ NULL, -2147483647, { 1, d_reductions_50_dparser_gram}, { 0, NULL}, { 0, NULL}, NULL, NULL, NULL, sizeof(unsigned char), 0, D_SCAN_ALL, NULL, (D_Shift***)NULL, -1}, +{ NULL, -2147483647, { 1, d_reductions_51_dparser_gram}, { 0, NULL}, { 0, NULL}, NULL, NULL, NULL, sizeof(unsigned char), 0, D_SCAN_ALL, NULL, (D_Shift***)NULL, -1}, +{ d_goto_valid_52_dparser_gram, -28, { 1, d_reductions_52_dparser_gram}, { 0, NULL}, { 1, d_error_recovery_hints_48_dparser_gram}, d_shifts_52_dparser_gram, NULL, (void*)d_scanner_52_dparser_gram, sizeof(unsigned char), 0, D_SCAN_ALL, (void*)d_transition_52_dparser_gram, d_accepts_diff_52_dparser_gram, -1}, +{ d_goto_valid_53_dparser_gram, -97, { 0, NULL}, { 0, NULL}, { 3, d_error_recovery_hints_53_dparser_gram}, d_shifts_30_dparser_gram, NULL, (void*)d_scanner_30_dparser_gram, sizeof(unsigned char), 0, D_SCAN_ALL, (void*)d_transition_30_dparser_gram, d_accepts_diff_30_dparser_gram, -1}, +{ NULL, -2147483647, { 1, d_reductions_54_dparser_gram}, { 0, NULL}, { 0, NULL}, NULL, NULL, NULL, sizeof(unsigned char), 0, D_SCAN_ALL, NULL, (D_Shift***)NULL, -1}, +{ d_goto_valid_55_dparser_gram, -102, { 1, d_reductions_55_dparser_gram}, { 0, NULL}, { 1, d_error_recovery_hints_55_dparser_gram}, d_shifts_55_dparser_gram, NULL, (void*)d_scanner_55_dparser_gram, sizeof(unsigned char), 0, D_SCAN_ALL, (void*)d_transition_55_dparser_gram, d_accepts_diff_55_dparser_gram, -1}, +{ d_goto_valid_56_dparser_gram, -3, { 1, d_reductions_56_dparser_gram}, { 2, d_right_epsilon_hints_56_dparser_gram}, { 1, d_error_recovery_hints_56_dparser_gram}, NULL, NULL, NULL, sizeof(unsigned char), 0, D_SCAN_ALL, NULL, (D_Shift***)NULL, -1}, +{ NULL, -2147483647, { 1, d_reductions_57_dparser_gram}, { 0, NULL}, { 0, NULL}, NULL, NULL, NULL, sizeof(unsigned char), 0, D_SCAN_ALL, NULL, (D_Shift***)NULL, -1}, +{ d_goto_valid_58_dparser_gram, -12, { 1, d_reductions_58_dparser_gram}, { 2, d_right_epsilon_hints_58_dparser_gram}, { 1, d_error_recovery_hints_56_dparser_gram}, NULL, NULL, NULL, sizeof(unsigned char), 0, D_SCAN_ALL, NULL, (D_Shift***)NULL, -1}, +{ d_goto_valid_59_dparser_gram, -122, { 0, NULL}, { 0, NULL}, { 3, d_error_recovery_hints_59_dparser_gram}, d_shifts_59_dparser_gram, NULL, (void*)d_scanner_59_dparser_gram, sizeof(unsigned char), 0, D_SCAN_ALL, (void*)d_transition_59_dparser_gram, d_accepts_diff_59_dparser_gram, -1}, +{ d_goto_valid_60_dparser_gram, -200, { 0, NULL}, { 0, NULL}, { 3, d_error_recovery_hints_59_dparser_gram}, d_shifts_30_dparser_gram, NULL, (void*)d_scanner_30_dparser_gram, sizeof(unsigned char), 0, D_SCAN_ALL, (void*)d_transition_30_dparser_gram, d_accepts_diff_30_dparser_gram, -1}, +{ d_goto_valid_61_dparser_gram, -217, { 0, NULL}, { 0, NULL}, { 3, d_error_recovery_hints_59_dparser_gram}, d_shifts_61_dparser_gram, NULL, (void*)d_scanner_61_dparser_gram, sizeof(unsigned char), 0, D_SCAN_ALL, (void*)d_transition_61_dparser_gram, d_accepts_diff_61_dparser_gram, -1}, +{ NULL, -2147483647, { 1, d_reductions_62_dparser_gram}, { 0, NULL}, { 1, d_error_recovery_hints_62_dparser_gram}, NULL, NULL, NULL, sizeof(unsigned char), 0, D_SCAN_ALL, NULL, (D_Shift***)NULL, -1}, +{ NULL, -2147483647, { 1, d_reductions_63_dparser_gram}, { 0, NULL}, { 0, NULL}, NULL, NULL, NULL, sizeof(unsigned char), 0, D_SCAN_ALL, NULL, (D_Shift***)NULL, -1}, +{ d_goto_valid_64_dparser_gram, 28, { 0, NULL}, { 0, NULL}, { 1, d_error_recovery_hints_62_dparser_gram}, d_shifts_49_dparser_gram, NULL, (void*)d_scanner_49_dparser_gram, sizeof(unsigned char), 0, D_SCAN_ALL, (void*)d_transition_49_dparser_gram, d_accepts_diff_49_dparser_gram, -1}, +{ NULL, -2147483647, { 1, d_reductions_65_dparser_gram}, { 0, NULL}, { 1, d_error_recovery_hints_62_dparser_gram}, NULL, NULL, NULL, sizeof(unsigned char), 0, D_SCAN_ALL, NULL, (D_Shift***)NULL, -1}, +{ NULL, -2147483647, { 1, d_reductions_66_dparser_gram}, { 0, NULL}, { 0, NULL}, NULL, NULL, NULL, sizeof(unsigned char), 0, D_SCAN_ALL, NULL, (D_Shift***)NULL, -1}, +{ NULL, -2147483647, { 1, d_reductions_67_dparser_gram}, { 0, NULL}, { 0, NULL}, NULL, NULL, NULL, sizeof(unsigned char), 0, D_SCAN_ALL, NULL, (D_Shift***)NULL, -1}, +{ NULL, -2147483647, { 1, d_reductions_68_dparser_gram}, { 0, NULL}, { 0, NULL}, NULL, NULL, NULL, sizeof(unsigned char), 0, D_SCAN_ALL, NULL, (D_Shift***)NULL, -1}, +{ NULL, -2147483647, { 1, d_reductions_69_dparser_gram}, { 0, NULL}, { 0, NULL}, NULL, NULL, NULL, sizeof(unsigned char), 0, D_SCAN_ALL, NULL, (D_Shift***)NULL, -1}, +{ NULL, -2147483647, { 1, d_reductions_70_dparser_gram}, { 0, NULL}, { 0, NULL}, NULL, NULL, NULL, sizeof(unsigned char), 0, D_SCAN_ALL, NULL, (D_Shift***)NULL, -1}, +{ NULL, -2147483647, { 1, d_reductions_71_dparser_gram}, { 0, NULL}, { 0, NULL}, NULL, NULL, NULL, sizeof(unsigned char), 0, D_SCAN_ALL, NULL, (D_Shift***)NULL, -1}, +{ d_goto_valid_72_dparser_gram, 40, { 0, NULL}, { 0, NULL}, { 1, d_error_recovery_hints_62_dparser_gram}, d_shifts_72_dparser_gram, NULL, (void*)d_scanner_72_dparser_gram, sizeof(unsigned char), 0, D_SCAN_ALL, (void*)d_transition_72_dparser_gram, d_accepts_diff_72_dparser_gram, -1}, +{ d_goto_valid_73_dparser_gram, -214, { 1, d_reductions_73_dparser_gram}, { 1, d_right_epsilon_hints_73_dparser_gram}, { 0, NULL}, d_shifts_52_dparser_gram, NULL, (void*)d_scanner_52_dparser_gram, sizeof(unsigned char), 0, D_SCAN_ALL, (void*)d_transition_52_dparser_gram, d_accepts_diff_52_dparser_gram, -1}, +{ NULL, -2147483647, { 1, d_reductions_74_dparser_gram}, { 0, NULL}, { 1, d_error_recovery_hints_74_dparser_gram}, NULL, NULL, NULL, sizeof(unsigned char), 0, D_SCAN_ALL, NULL, (D_Shift***)NULL, -1}, +{ NULL, -2147483647, { 1, d_reductions_75_dparser_gram}, { 0, NULL}, { 0, NULL}, NULL, NULL, NULL, sizeof(unsigned char), 0, D_SCAN_ALL, NULL, (D_Shift***)NULL, -1}, +{ NULL, -2147483647, { 1, d_reductions_76_dparser_gram}, { 0, NULL}, { 0, NULL}, NULL, NULL, NULL, sizeof(unsigned char), 0, D_SCAN_ALL, NULL, (D_Shift***)NULL, -1}, +{ d_goto_valid_77_dparser_gram, 57, { 0, NULL}, { 0, NULL}, { 1, d_error_recovery_hints_77_dparser_gram}, d_shifts_77_dparser_gram, NULL, (void*)d_scanner_77_dparser_gram, sizeof(unsigned char), 0, D_SCAN_ALL, (void*)d_transition_77_dparser_gram, d_accepts_diff_77_dparser_gram, -1}, +{ d_goto_valid_78_dparser_gram, -10, { 1, d_reductions_78_dparser_gram}, { 1, d_right_epsilon_hints_78_dparser_gram}, { 0, NULL}, NULL, NULL, NULL, sizeof(unsigned char), 0, D_SCAN_ALL, NULL, (D_Shift***)NULL, -1}, +{ d_goto_valid_79_dparser_gram, -35, { 2, d_reductions_79_dparser_gram}, { 1, d_right_epsilon_hints_79_dparser_gram}, { 0, NULL}, NULL, NULL, NULL, sizeof(unsigned char), 0, D_SCAN_ALL, NULL, (D_Shift***)NULL, -1}, +{ d_goto_valid_80_dparser_gram, 53, { 0, NULL}, { 0, NULL}, { 1, d_error_recovery_hints_77_dparser_gram}, d_shifts_77_dparser_gram, NULL, (void*)d_scanner_77_dparser_gram, sizeof(unsigned char), 0, D_SCAN_ALL, (void*)d_transition_77_dparser_gram, d_accepts_diff_77_dparser_gram, -1}, +{ NULL, -2147483647, { 1, d_reductions_81_dparser_gram}, { 0, NULL}, { 1, d_error_recovery_hints_81_dparser_gram}, NULL, NULL, NULL, sizeof(unsigned char), 0, D_SCAN_ALL, NULL, (D_Shift***)NULL, -1}, +{ NULL, -2147483647, { 1, d_reductions_82_dparser_gram}, { 0, NULL}, { 0, NULL}, NULL, NULL, NULL, sizeof(unsigned char), 0, D_SCAN_ALL, NULL, (D_Shift***)NULL, -1}, +{ NULL, -2147483647, { 1, d_reductions_83_dparser_gram}, { 0, NULL}, { 1, d_error_recovery_hints_83_dparser_gram}, NULL, NULL, NULL, sizeof(unsigned char), 0, D_SCAN_ALL, NULL, (D_Shift***)NULL, -1}, +{ NULL, -2147483647, { 1, d_reductions_84_dparser_gram}, { 0, NULL}, { 0, NULL}, NULL, NULL, NULL, sizeof(unsigned char), 0, D_SCAN_ALL, NULL, (D_Shift***)NULL, -1}, +{ NULL, -2147483647, { 1, d_reductions_85_dparser_gram}, { 0, NULL}, { 1, d_error_recovery_hints_85_dparser_gram}, NULL, NULL, NULL, sizeof(unsigned char), 0, D_SCAN_ALL, NULL, (D_Shift***)NULL, -1}, +{ NULL, -2147483647, { 1, d_reductions_86_dparser_gram}, { 0, NULL}, { 0, NULL}, NULL, NULL, NULL, sizeof(unsigned char), 0, D_SCAN_ALL, NULL, (D_Shift***)NULL, -1}, +{ NULL, -2147483647, { 1, d_reductions_87_dparser_gram}, { 0, NULL}, { 1, d_error_recovery_hints_87_dparser_gram}, NULL, NULL, NULL, sizeof(unsigned char), 0, D_SCAN_ALL, NULL, (D_Shift***)NULL, -1}, +{ NULL, -2147483647, { 1, d_reductions_88_dparser_gram}, { 0, NULL}, { 0, NULL}, NULL, NULL, NULL, sizeof(unsigned char), 0, D_SCAN_ALL, NULL, (D_Shift***)NULL, -1}, +{ NULL, -2147483647, { 1, d_reductions_89_dparser_gram}, { 0, NULL}, { 1, d_error_recovery_hints_87_dparser_gram}, NULL, NULL, NULL, sizeof(unsigned char), 0, D_SCAN_ALL, NULL, (D_Shift***)NULL, -1}, +{ NULL, -2147483647, { 1, d_reductions_90_dparser_gram}, { 0, NULL}, { 0, NULL}, NULL, NULL, NULL, sizeof(unsigned char), 0, D_SCAN_ALL, NULL, (D_Shift***)NULL, -1}, +{ NULL, -2147483647, { 1, d_reductions_91_dparser_gram}, { 0, NULL}, { 1, d_error_recovery_hints_91_dparser_gram}, NULL, NULL, NULL, sizeof(unsigned char), 0, D_SCAN_ALL, NULL, (D_Shift***)NULL, -1}, +{ d_goto_valid_92_dparser_gram, -16, { 1, d_reductions_92_dparser_gram}, { 0, NULL}, { 0, NULL}, d_shifts_92_dparser_gram, NULL, (void*)d_scanner_92_dparser_gram, sizeof(unsigned char), 0, D_SCAN_ALL, (void*)d_transition_92_dparser_gram, d_accepts_diff_92_dparser_gram, -1}, +{ d_goto_valid_93_dparser_gram, -15, { 1, d_reductions_93_dparser_gram}, { 1, d_right_epsilon_hints_93_dparser_gram}, { 0, NULL}, NULL, NULL, NULL, sizeof(unsigned char), 0, D_SCAN_ALL, NULL, (D_Shift***)NULL, -1}, +{ NULL, -2147483647, { 1, d_reductions_94_dparser_gram}, { 0, NULL}, { 0, NULL}, NULL, NULL, NULL, sizeof(unsigned char), 0, D_SCAN_ALL, NULL, (D_Shift***)NULL, -1}, +{ d_goto_valid_95_dparser_gram, -301, { 0, NULL}, { 0, NULL}, { 3, d_error_recovery_hints_95_dparser_gram}, d_shifts_95_dparser_gram, NULL, (void*)d_scanner_95_dparser_gram, sizeof(unsigned char), 0, D_SCAN_ALL, (void*)d_transition_95_dparser_gram, d_accepts_diff_95_dparser_gram, -1}, +{ NULL, -2147483647, { 1, d_reductions_96_dparser_gram}, { 0, NULL}, { 1, d_error_recovery_hints_91_dparser_gram}, NULL, NULL, NULL, sizeof(unsigned char), 0, D_SCAN_ALL, NULL, (D_Shift***)NULL, -1}, +{ d_goto_valid_97_dparser_gram, -59, { 1, d_reductions_97_dparser_gram}, { 2, d_right_epsilon_hints_97_dparser_gram}, { 0, NULL}, NULL, NULL, NULL, sizeof(unsigned char), 0, D_SCAN_ALL, NULL, (D_Shift***)NULL, -1}, +{ NULL, -2147483647, { 1, d_reductions_98_dparser_gram}, { 0, NULL}, { 0, NULL}, NULL, NULL, NULL, sizeof(unsigned char), 0, D_SCAN_ALL, NULL, (D_Shift***)NULL, -1}, +{ d_goto_valid_99_dparser_gram, -259, { 1, d_reductions_99_dparser_gram}, { 2, d_right_epsilon_hints_99_dparser_gram}, { 1, d_error_recovery_hints_99_dparser_gram}, d_shifts_99_dparser_gram, NULL, (void*)d_scanner_99_dparser_gram, sizeof(unsigned char), 0, D_SCAN_ALL, (void*)d_transition_99_dparser_gram, d_accepts_diff_99_dparser_gram, -1}, +{ d_goto_valid_100_dparser_gram, -320, { 0, NULL}, { 0, NULL}, { 3, d_error_recovery_hints_100_dparser_gram}, d_shifts_4_dparser_gram, NULL, (void*)d_scanner_4_dparser_gram, sizeof(unsigned char), 0, D_SCAN_ALL, (void*)d_transition_4_dparser_gram, d_accepts_diff_4_dparser_gram, -1}, +{ d_goto_valid_101_dparser_gram, -7, { 1, d_reductions_101_dparser_gram}, { 0, NULL}, { 1, d_error_recovery_hints_101_dparser_gram}, NULL, NULL, NULL, sizeof(unsigned char), 0, D_SCAN_ALL, NULL, (D_Shift***)NULL, -1}, +{ d_goto_valid_102_dparser_gram, 6, { 1, d_reductions_102_dparser_gram}, { 0, NULL}, { 1, d_error_recovery_hints_102_dparser_gram}, NULL, NULL, NULL, sizeof(unsigned char), 0, D_SCAN_ALL, NULL, (D_Shift***)NULL, -1}, +{ NULL, -2147483647, { 1, d_reductions_103_dparser_gram}, { 0, NULL}, { 0, NULL}, NULL, NULL, NULL, sizeof(unsigned char), 0, D_SCAN_ALL, NULL, (D_Shift***)NULL, -1}, +{ d_goto_valid_104_dparser_gram, -20, { 2, d_reductions_104_dparser_gram}, { 1, d_right_epsilon_hints_104_dparser_gram}, { 0, NULL}, NULL, NULL, NULL, sizeof(unsigned char), 0, D_SCAN_ALL, NULL, (D_Shift***)NULL, -1}, +{ d_goto_valid_105_dparser_gram, -18, { 1, d_reductions_105_dparser_gram}, { 1, d_right_epsilon_hints_105_dparser_gram}, { 0, NULL}, NULL, NULL, NULL, sizeof(unsigned char), 0, D_SCAN_ALL, NULL, (D_Shift***)NULL, -1}, +{ NULL, -2147483647, { 1, d_reductions_106_dparser_gram}, { 0, NULL}, { 0, NULL}, NULL, NULL, NULL, sizeof(unsigned char), 0, D_SCAN_ALL, NULL, (D_Shift***)NULL, -1}, +{ NULL, -2147483647, { 1, d_reductions_107_dparser_gram}, { 0, NULL}, { 0, NULL}, NULL, NULL, NULL, sizeof(unsigned char), 0, D_SCAN_ALL, NULL, (D_Shift***)NULL, -1}, +{ NULL, -2147483647, { 1, d_reductions_108_dparser_gram}, { 0, NULL}, { 0, NULL}, NULL, NULL, NULL, sizeof(unsigned char), 0, D_SCAN_ALL, NULL, (D_Shift***)NULL, -1}, +{ NULL, -2147483647, { 1, d_reductions_109_dparser_gram}, { 0, NULL}, { 0, NULL}, NULL, NULL, NULL, sizeof(unsigned char), 0, D_SCAN_ALL, NULL, (D_Shift***)NULL, -1}, +{ NULL, -2147483647, { 1, d_reductions_110_dparser_gram}, { 0, NULL}, { 0, NULL}, NULL, NULL, NULL, sizeof(unsigned char), 0, D_SCAN_ALL, NULL, (D_Shift***)NULL, -1}, +{ NULL, -2147483647, { 1, d_reductions_111_dparser_gram}, { 0, NULL}, { 0, NULL}, NULL, NULL, NULL, sizeof(unsigned char), 0, D_SCAN_ALL, NULL, (D_Shift***)NULL, -1}, +{ NULL, -2147483647, { 1, d_reductions_112_dparser_gram}, { 0, NULL}, { 0, NULL}, NULL, NULL, NULL, sizeof(unsigned char), 0, D_SCAN_ALL, NULL, (D_Shift***)NULL, -1}, +{ NULL, -2147483647, { 1, d_reductions_113_dparser_gram}, { 0, NULL}, { 0, NULL}, NULL, NULL, NULL, sizeof(unsigned char), 0, D_SCAN_ALL, NULL, (D_Shift***)NULL, -1}, +{ NULL, -2147483647, { 1, d_reductions_114_dparser_gram}, { 0, NULL}, { 0, NULL}, NULL, NULL, NULL, sizeof(unsigned char), 0, D_SCAN_ALL, NULL, (D_Shift***)NULL, -1}, +{ NULL, -2147483647, { 1, d_reductions_115_dparser_gram}, { 0, NULL}, { 0, NULL}, NULL, NULL, NULL, sizeof(unsigned char), 0, D_SCAN_ALL, NULL, (D_Shift***)NULL, -1}, +{ NULL, -2147483647, { 1, d_reductions_116_dparser_gram}, { 0, NULL}, { 0, NULL}, NULL, NULL, NULL, sizeof(unsigned char), 0, D_SCAN_ALL, NULL, (D_Shift***)NULL, -1}, +{ NULL, -2147483647, { 1, d_reductions_117_dparser_gram}, { 0, NULL}, { 0, NULL}, NULL, NULL, NULL, sizeof(unsigned char), 0, D_SCAN_ALL, NULL, (D_Shift***)NULL, -1}, +{ NULL, -2147483647, { 1, d_reductions_118_dparser_gram}, { 0, NULL}, { 0, NULL}, NULL, NULL, NULL, sizeof(unsigned char), 0, D_SCAN_ALL, NULL, (D_Shift***)NULL, -1}, +{ NULL, -2147483647, { 1, d_reductions_119_dparser_gram}, { 0, NULL}, { 0, NULL}, NULL, NULL, NULL, sizeof(unsigned char), 0, D_SCAN_ALL, NULL, (D_Shift***)NULL, -1}, +{ NULL, -2147483647, { 1, d_reductions_120_dparser_gram}, { 0, NULL}, { 0, NULL}, NULL, NULL, NULL, sizeof(unsigned char), 0, D_SCAN_ALL, NULL, (D_Shift***)NULL, -1}, +{ NULL, -2147483647, { 1, d_reductions_121_dparser_gram}, { 0, NULL}, { 0, NULL}, NULL, NULL, NULL, sizeof(unsigned char), 0, D_SCAN_ALL, NULL, (D_Shift***)NULL, -1}, +{ NULL, -2147483647, { 1, d_reductions_122_dparser_gram}, { 0, NULL}, { 0, NULL}, NULL, NULL, NULL, sizeof(unsigned char), 0, D_SCAN_ALL, NULL, (D_Shift***)NULL, -1}, +{ d_goto_valid_123_dparser_gram, -179, { 0, NULL}, { 0, NULL}, { 0, NULL}, d_shifts_123_dparser_gram, NULL, (void*)d_scanner_123_dparser_gram, sizeof(unsigned char), 0, D_SCAN_ALL, (void*)d_transition_123_dparser_gram, d_accepts_diff_123_dparser_gram, -1}, +{ NULL, -2147483647, { 1, d_reductions_124_dparser_gram}, { 0, NULL}, { 0, NULL}, NULL, NULL, NULL, sizeof(unsigned char), 0, D_SCAN_ALL, NULL, (D_Shift***)NULL, -1}, +{ d_goto_valid_125_dparser_gram, -51, { 1, d_reductions_125_dparser_gram}, { 1, d_right_epsilon_hints_125_dparser_gram}, { 1, d_error_recovery_hints_125_dparser_gram}, d_shifts_125_dparser_gram, NULL, (void*)d_scanner_125_dparser_gram, sizeof(unsigned char), 0, D_SCAN_ALL, (void*)d_transition_125_dparser_gram, d_accepts_diff_125_dparser_gram, -1}, +{ NULL, -2147483647, { 1, d_reductions_126_dparser_gram}, { 0, NULL}, { 0, NULL}, NULL, NULL, NULL, sizeof(unsigned char), 0, D_SCAN_ALL, NULL, (D_Shift***)NULL, -1}, +{ NULL, -2147483647, { 1, d_reductions_127_dparser_gram}, { 0, NULL}, { 0, NULL}, NULL, NULL, NULL, sizeof(unsigned char), 0, D_SCAN_ALL, NULL, (D_Shift***)NULL, -1}, +{ d_goto_valid_128_dparser_gram, -341, { 0, NULL}, { 0, NULL}, { 3, d_error_recovery_hints_100_dparser_gram}, d_shifts_30_dparser_gram, NULL, (void*)d_scanner_30_dparser_gram, sizeof(unsigned char), 0, D_SCAN_ALL, (void*)d_transition_30_dparser_gram, d_accepts_diff_30_dparser_gram, -1}, +{ NULL, -2147483647, { 1, d_reductions_129_dparser_gram}, { 0, NULL}, { 0, NULL}, NULL, NULL, NULL, sizeof(unsigned char), 0, D_SCAN_ALL, NULL, (D_Shift***)NULL, -1}, +{ d_goto_valid_130_dparser_gram, -61, { 1, d_reductions_130_dparser_gram}, { 2, d_right_epsilon_hints_130_dparser_gram}, { 1, d_error_recovery_hints_130_dparser_gram}, NULL, NULL, NULL, sizeof(unsigned char), 0, D_SCAN_ALL, NULL, (D_Shift***)NULL, -1}, +{ d_goto_valid_131_dparser_gram, -419, { 0, NULL}, { 0, NULL}, { 3, d_error_recovery_hints_131_dparser_gram}, d_shifts_61_dparser_gram, NULL, (void*)d_scanner_61_dparser_gram, sizeof(unsigned char), 0, D_SCAN_ALL, (void*)d_transition_61_dparser_gram, d_accepts_diff_61_dparser_gram, -1}, +{ d_goto_valid_132_dparser_gram, -89, { 1, d_reductions_132_dparser_gram}, { 0, NULL}, { 0, NULL}, d_shifts_132_dparser_gram, NULL, (void*)d_scanner_132_dparser_gram, sizeof(unsigned char), 0, D_SCAN_ALL, (void*)d_transition_132_dparser_gram, d_accepts_diff_132_dparser_gram, -1}, +{ d_goto_valid_133_dparser_gram, -132, { 1, d_reductions_133_dparser_gram}, { 0, NULL}, { 0, NULL}, d_shifts_132_dparser_gram, NULL, (void*)d_scanner_132_dparser_gram, sizeof(unsigned char), 0, D_SCAN_ALL, (void*)d_transition_132_dparser_gram, d_accepts_diff_132_dparser_gram, -1}, +{ NULL, -2147483647, { 1, d_reductions_134_dparser_gram}, { 0, NULL}, { 0, NULL}, NULL, NULL, NULL, sizeof(unsigned char), 0, D_SCAN_ALL, NULL, (D_Shift***)NULL, -1}, +{ NULL, -2147483647, { 1, d_reductions_135_dparser_gram}, { 0, NULL}, { 0, NULL}, NULL, NULL, NULL, sizeof(unsigned char), 0, D_SCAN_ALL, NULL, (D_Shift***)NULL, -1}, +{ d_goto_valid_136_dparser_gram, -17, { 1, d_reductions_136_dparser_gram}, { 1, d_right_epsilon_hints_136_dparser_gram}, { 0, NULL}, NULL, NULL, NULL, sizeof(unsigned char), 0, D_SCAN_ALL, NULL, (D_Shift***)NULL, -1}, +{ NULL, -2147483647, { 1, d_reductions_137_dparser_gram}, { 0, NULL}, { 0, NULL}, NULL, NULL, NULL, sizeof(unsigned char), 0, D_SCAN_ALL, NULL, (D_Shift***)NULL, -1}, +{ NULL, -2147483647, { 1, d_reductions_138_dparser_gram}, { 0, NULL}, { 0, NULL}, NULL, NULL, NULL, sizeof(unsigned char), 0, D_SCAN_ALL, NULL, (D_Shift***)NULL, -1}, +{ NULL, -2147483647, { 1, d_reductions_139_dparser_gram}, { 0, NULL}, { 1, d_error_recovery_hints_139_dparser_gram}, NULL, NULL, NULL, sizeof(unsigned char), 0, D_SCAN_ALL, NULL, (D_Shift***)NULL, -1}, +{ NULL, -2147483647, { 1, d_reductions_140_dparser_gram}, { 0, NULL}, { 0, NULL}, NULL, NULL, NULL, sizeof(unsigned char), 0, D_SCAN_ALL, NULL, (D_Shift***)NULL, -1}, +{ d_goto_valid_141_dparser_gram, 30, { 0, NULL}, { 0, NULL}, { 1, d_error_recovery_hints_141_dparser_gram}, d_shifts_141_dparser_gram, NULL, (void*)d_scanner_141_dparser_gram, sizeof(unsigned char), 0, D_SCAN_ALL, (void*)d_transition_141_dparser_gram, d_accepts_diff_141_dparser_gram, -1}, +{ NULL, -2147483647, { 1, d_reductions_142_dparser_gram}, { 0, NULL}, { 1, d_error_recovery_hints_142_dparser_gram}, NULL, NULL, NULL, sizeof(unsigned char), 0, D_SCAN_ALL, NULL, (D_Shift***)NULL, -1}, +{ NULL, -2147483647, { 1, d_reductions_143_dparser_gram}, { 0, NULL}, { 0, NULL}, NULL, NULL, NULL, sizeof(unsigned char), 0, D_SCAN_ALL, NULL, (D_Shift***)NULL, -1}, +{ d_goto_valid_144_dparser_gram, -139, { 0, NULL}, { 0, NULL}, { 0, NULL}, d_shifts_123_dparser_gram, NULL, (void*)d_scanner_123_dparser_gram, sizeof(unsigned char), 0, D_SCAN_ALL, (void*)d_transition_123_dparser_gram, d_accepts_diff_123_dparser_gram, -1}, +{ NULL, -2147483647, { 1, d_reductions_145_dparser_gram}, { 0, NULL}, { 0, NULL}, NULL, NULL, NULL, sizeof(unsigned char), 0, D_SCAN_ALL, NULL, (D_Shift***)NULL, -1}, +{ NULL, -2147483647, { 1, d_reductions_146_dparser_gram}, { 0, NULL}, { 0, NULL}, NULL, NULL, NULL, sizeof(unsigned char), 0, D_SCAN_ALL, NULL, (D_Shift***)NULL, -1}, +{ NULL, -2147483647, { 1, d_reductions_147_dparser_gram}, { 0, NULL}, { 0, NULL}, NULL, NULL, NULL, sizeof(unsigned char), 0, D_SCAN_ALL, NULL, (D_Shift***)NULL, -1}, +{ NULL, -2147483647, { 1, d_reductions_148_dparser_gram}, { 0, NULL}, { 0, NULL}, NULL, NULL, NULL, sizeof(unsigned char), 0, D_SCAN_ALL, NULL, (D_Shift***)NULL, -1}, +{ NULL, -2147483647, { 1, d_reductions_149_dparser_gram}, { 0, NULL}, { 0, NULL}, NULL, NULL, NULL, sizeof(unsigned char), 0, D_SCAN_ALL, NULL, (D_Shift***)NULL, -1}, +{ NULL, -2147483647, { 1, d_reductions_150_dparser_gram}, { 0, NULL}, { 0, NULL}, NULL, NULL, NULL, sizeof(unsigned char), 0, D_SCAN_ALL, NULL, (D_Shift***)NULL, -1}, +{ d_goto_valid_151_dparser_gram, -87, { 1, d_reductions_151_dparser_gram}, { 0, NULL}, { 0, NULL}, d_shifts_6_dparser_gram, NULL, (void*)d_scanner_6_dparser_gram, sizeof(unsigned char), 0, D_SCAN_ALL, (void*)d_transition_6_dparser_gram, d_accepts_diff_6_dparser_gram, -1}, +{ NULL, -2147483647, { 1, d_reductions_152_dparser_gram}, { 0, NULL}, { 1, d_error_recovery_hints_152_dparser_gram}, NULL, NULL, NULL, sizeof(unsigned char), 0, D_SCAN_ALL, NULL, (D_Shift***)NULL, -1}, +{ NULL, -2147483647, { 1, d_reductions_153_dparser_gram}, { 0, NULL}, { 0, NULL}, NULL, NULL, NULL, sizeof(unsigned char), 0, D_SCAN_ALL, NULL, (D_Shift***)NULL, -1}, +{ NULL, -2147483647, { 1, d_reductions_154_dparser_gram}, { 0, NULL}, { 0, NULL}, NULL, NULL, NULL, sizeof(unsigned char), 0, D_SCAN_ALL, NULL, (D_Shift***)NULL, -1}, +{ d_goto_valid_155_dparser_gram, 15, { 0, NULL}, { 0, NULL}, { 0, NULL}, d_shifts_155_dparser_gram, NULL, (void*)d_scanner_155_dparser_gram, sizeof(unsigned char), 0, D_SCAN_ALL, (void*)d_transition_155_dparser_gram, d_accepts_diff_155_dparser_gram, -1}, +{ d_goto_valid_156_dparser_gram, -58, { 0, NULL}, { 0, NULL}, { 1, d_error_recovery_hints_125_dparser_gram}, d_shifts_125_dparser_gram, NULL, (void*)d_scanner_125_dparser_gram, sizeof(unsigned char), 0, D_SCAN_ALL, (void*)d_transition_125_dparser_gram, d_accepts_diff_125_dparser_gram, -1}, +{ NULL, -2147483647, { 1, d_reductions_157_dparser_gram}, { 0, NULL}, { 0, NULL}, NULL, NULL, NULL, sizeof(unsigned char), 0, D_SCAN_ALL, NULL, (D_Shift***)NULL, -1} +}; + +D_Symbol d_symbols_dparser_gram[] = { +{D_SYMBOL_INTERNAL, "0 Start", 7}, +{D_SYMBOL_INTERNAL, "1 Start", 7}, +{D_SYMBOL_NTERM, "grammar", 7}, +{D_SYMBOL_INTERNAL, "grammar.6", 9}, +{D_SYMBOL_INTERNAL, "grammar.4", 9}, +{D_SYMBOL_INTERNAL, "grammar.4.5", 11}, +{D_SYMBOL_INTERNAL, "grammar.3", 9}, +{D_SYMBOL_NTERM, "global_code", 11}, +{D_SYMBOL_INTERNAL, "global_code.10", 14}, +{D_SYMBOL_INTERNAL, "global_code.9", 13}, +{D_SYMBOL_INTERNAL, "global_code.8", 13}, +{D_SYMBOL_NTERM, "pass_types", 10}, +{D_SYMBOL_NTERM, "pass_type", 9}, +{D_SYMBOL_NTERM, "declarationtype", 15}, +{D_SYMBOL_NTERM, "token_identifier", 16}, +{D_SYMBOL_NTERM, "production", 10}, +{D_SYMBOL_NTERM, "regex_production", 16}, +{D_SYMBOL_NTERM, "production_name", 15}, +{D_SYMBOL_INTERNAL, "production_name.18", 18}, +{D_SYMBOL_NTERM, "rules", 5}, +{D_SYMBOL_INTERNAL, "rules.21", 8}, +{D_SYMBOL_INTERNAL, "rules.20", 8}, +{D_SYMBOL_NTERM, "rule", 4}, +{D_SYMBOL_INTERNAL, "rule.29", 7}, +{D_SYMBOL_INTERNAL, "rule.28", 7}, +{D_SYMBOL_INTERNAL, "rule.23", 7}, +{D_SYMBOL_INTERNAL, "rule.23.27", 10}, +{D_SYMBOL_INTERNAL, "rule.23.26", 10}, +{D_SYMBOL_INTERNAL, "rule.23.24", 10}, +{D_SYMBOL_INTERNAL, "rule.23.24.25", 13}, +{D_SYMBOL_NTERM, "new_rule", 8}, +{D_SYMBOL_NTERM, "simple_element", 14}, +{D_SYMBOL_INTERNAL, "simple_element.32", 17}, +{D_SYMBOL_NTERM, "element", 7}, +{D_SYMBOL_NTERM, "new_subrule", 11}, +{D_SYMBOL_NTERM, "element_modifier", 16}, +{D_SYMBOL_NTERM, "rule_modifier", 13}, +{D_SYMBOL_NTERM, "rule_assoc", 10}, +{D_SYMBOL_NTERM, "rule_priority", 13}, +{D_SYMBOL_NTERM, "rule_code", 9}, +{D_SYMBOL_INTERNAL, "rule_code.42", 12}, +{D_SYMBOL_INTERNAL, "rule_code.41", 12}, +{D_SYMBOL_INTERNAL, "rule_code.40", 12}, +{D_SYMBOL_NTERM, "speculative_code", 16}, +{D_SYMBOL_NTERM, "final_code", 10}, +{D_SYMBOL_NTERM, "pass_code", 9}, +{D_SYMBOL_NTERM, "curly_code", 10}, +{D_SYMBOL_INTERNAL, "curly_code.47", 13}, +{D_SYMBOL_NTERM, "bracket_code", 12}, +{D_SYMBOL_INTERNAL, "bracket_code.49", 15}, +{D_SYMBOL_NTERM, "balanced_code", 13}, +{D_SYMBOL_INTERNAL, "balanced_code.53", 16}, +{D_SYMBOL_INTERNAL, "balanced_code.52", 16}, +{D_SYMBOL_INTERNAL, "balanced_code.51", 16}, +{D_SYMBOL_NTERM, "symbols", 7}, +{D_SYMBOL_NTERM, "string", 6}, +{D_SYMBOL_NTERM, "regex", 5}, +{D_SYMBOL_NTERM, "identifier", 10}, +{D_SYMBOL_NTERM, "integer", 7}, +{D_SYMBOL_NTERM, "decimalint", 10}, +{D_SYMBOL_NTERM, "hexint", 6}, +{D_SYMBOL_NTERM, "octalint", 8}, +{D_SYMBOL_STRING, "${scanner", 9}, +{D_SYMBOL_STRING, "}", 1}, +{D_SYMBOL_STRING, "${declare", 9}, +{D_SYMBOL_STRING, "}", 1}, +{D_SYMBOL_STRING, "${token", 7}, +{D_SYMBOL_STRING, "}", 1}, +{D_SYMBOL_STRING, "${action}", 9}, +{D_SYMBOL_STRING, "${pass", 6}, +{D_SYMBOL_STRING, "}", 1}, +{D_SYMBOL_STRING, "preorder", 8}, +{D_SYMBOL_STRING, "postorder", 9}, +{D_SYMBOL_STRING, "manual", 6}, +{D_SYMBOL_STRING, "for_all", 7}, +{D_SYMBOL_STRING, "for_undefined", 13}, +{D_SYMBOL_STRING, "tokenize", 8}, +{D_SYMBOL_STRING, "longest_match", 13}, +{D_SYMBOL_STRING, "whitespace", 10}, +{D_SYMBOL_STRING, "all_matches", 11}, +{D_SYMBOL_STRING, "set_op_priority_from_rule", 25}, +{D_SYMBOL_STRING, "all_subparsers", 14}, +{D_SYMBOL_STRING, "subparser", 9}, +{D_SYMBOL_STRING, "save_parse_tree", 15}, +{D_SYMBOL_STRING, ":", 1}, +{D_SYMBOL_STRING, ";", 1}, +{D_SYMBOL_STRING, ";", 1}, +{D_SYMBOL_STRING, ";", 1}, +{D_SYMBOL_STRING, "::=", 3}, +{D_SYMBOL_STRING, "_", 1}, +{D_SYMBOL_STRING, "|", 1}, +{D_SYMBOL_STRING, "${scan", 6}, +{D_SYMBOL_STRING, "}", 1}, +{D_SYMBOL_STRING, "(", 1}, +{D_SYMBOL_STRING, ")", 1}, +{D_SYMBOL_STRING, "$term", 5}, +{D_SYMBOL_STRING, "/i", 2}, +{D_SYMBOL_STRING, "?", 1}, +{D_SYMBOL_STRING, "*", 1}, +{D_SYMBOL_STRING, "+", 1}, +{D_SYMBOL_STRING, "$unary_op_right", 15}, +{D_SYMBOL_STRING, "$unary_op_left", 14}, +{D_SYMBOL_STRING, "$binary_op_right", 16}, +{D_SYMBOL_STRING, "$binary_op_left", 15}, +{D_SYMBOL_STRING, "$unary_right", 12}, +{D_SYMBOL_STRING, "$unary_left", 11}, +{D_SYMBOL_STRING, "$binary_right", 13}, +{D_SYMBOL_STRING, "$binary_left", 12}, +{D_SYMBOL_STRING, "$right", 6}, +{D_SYMBOL_STRING, "$left", 5}, +{D_SYMBOL_STRING, ":", 1}, +{D_SYMBOL_STRING, "{", 1}, +{D_SYMBOL_STRING, "}", 1}, +{D_SYMBOL_STRING, "[", 1}, +{D_SYMBOL_STRING, "]", 1}, +{D_SYMBOL_STRING, "(", 1}, +{D_SYMBOL_STRING, ")", 1}, +{D_SYMBOL_STRING, "[", 1}, +{D_SYMBOL_STRING, "]", 1}, +{D_SYMBOL_STRING, "{", 1}, +{D_SYMBOL_STRING, "}", 1}, +{D_SYMBOL_REGEX, "[!~`@#$%^&*\\\\-_+=|:;\\\\\\\\<,>.?/]", 37}, +{D_SYMBOL_REGEX, "'([^'\\\\\\\\]|\\\\\\\\[^])*'", 29}, +{D_SYMBOL_REGEX, "\\\"([^\\\"\\\\\\\\]|\\\\\\\\[^])*\\\"", 38}, +{D_SYMBOL_REGEX, "[a-zA-Z_][a-zA-Z_0-9]*", 22}, +{D_SYMBOL_REGEX, "-?[1-9][0-9]*[uUlL]?", 20}, +{D_SYMBOL_REGEX, "-?(0x|0X)[0-9a-fA-F]+[uUlL]?", 28}, +{D_SYMBOL_REGEX, "-?0[0-7]*[uUlL]?", 16}, +}; + +D_ParserTables parser_tables_dparser_gram = { +158, d_states_dparser_gram, d_gotos_dparser_gram, 0, 128, d_symbols_dparser_gram, NULL, 0, NULL, 0}; From natebegeman at mac.com Fri Oct 21 01:36:29 2005 From: natebegeman at mac.com (Nate Begeman) Date: Fri, 21 Oct 2005 01:36:29 -0500 Subject: [llvm-commits] CVS: llvm/lib/Target/PowerPC/PPCInstrInfo.td Message-ID: <200510210636.BAA09392@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/PowerPC: PPCInstrInfo.td updated: 1.131 -> 1.132 --- Log message: Match rotate. This does actually match the rotates in an rc5 cipher, but I haven't seen it fire on our testsuite. --- Diffs of the changes: (+3 -0) PPCInstrInfo.td | 3 +++ 1 files changed, 3 insertions(+) Index: llvm/lib/Target/PowerPC/PPCInstrInfo.td diff -u llvm/lib/Target/PowerPC/PPCInstrInfo.td:1.131 llvm/lib/Target/PowerPC/PPCInstrInfo.td:1.132 --- llvm/lib/Target/PowerPC/PPCInstrInfo.td:1.131 Thu Oct 20 02:51:08 2005 +++ llvm/lib/Target/PowerPC/PPCInstrInfo.td Fri Oct 21 01:36:18 2005 @@ -742,6 +742,9 @@ // XOR an arbitrary immediate. def : Pat<(xor GPRC:$in, imm:$imm), (XORIS (XORI GPRC:$in, (LO16 imm:$imm)), (HI16 imm:$imm))>; +def : Pat<(or (shl GPRC:$rS, GPRC:$rB), + (srl GPRC:$rS, (sub 32, GPRC:$rB))), + (RLWNM GPRC:$rS, GPRC:$rB, 0, 31)>; def : Pat<(zext GPRC:$in), (RLDICL (OR4To8 GPRC:$in, GPRC:$in), 0, 32)>; From lattner at cs.uiuc.edu Fri Oct 21 01:39:07 2005 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Fri, 21 Oct 2005 01:39:07 -0500 Subject: [llvm-commits] CVS: llvm-test/MultiSource/Applications/d/Makefile write_ctables.c Message-ID: <200510210639.BAA09434@zion.cs.uiuc.edu> Changes in directory llvm-test/MultiSource/Applications/d: Makefile updated: 1.5 -> 1.6 write_ctables.c updated: 1.1 -> 1.2 --- Log message: Restore the file generated from the grammar. Instead fix the program to write its output to stdout instead of to a file that clobbers one of its source files. --- Diffs of the changes: (+5 -5) Makefile | 2 +- write_ctables.c | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) Index: llvm-test/MultiSource/Applications/d/Makefile diff -u llvm-test/MultiSource/Applications/d/Makefile:1.5 llvm-test/MultiSource/Applications/d/Makefile:1.6 --- llvm-test/MultiSource/Applications/d/Makefile:1.5 Fri Oct 21 01:27:53 2005 +++ llvm-test/MultiSource/Applications/d/Makefile Fri Oct 21 01:38:55 2005 @@ -1,6 +1,6 @@ LEVEL = ../../.. PROG = make_dparser -Source=make_dparser.c write_ctables.c gram.c lex.c lr.c arg.c parse.c scan.c symtab.c util.c +Source=make_dparser.c write_ctables.c gram.c lex.c lr.c arg.c parse.c scan.c symtab.c util.c version.c grammar.g.c CPPFLAGS = -DD_BUILD_VERSION=5725 RUN_OPTIONS="-v $(PROJ_SRC_DIR)/grammar.g" include ../../Makefile.multisrc Index: llvm-test/MultiSource/Applications/d/write_ctables.c diff -u llvm-test/MultiSource/Applications/d/write_ctables.c:1.1 llvm-test/MultiSource/Applications/d/write_ctables.c:1.2 --- llvm-test/MultiSource/Applications/d/write_ctables.c:1.1 Thu Jan 1 10:50:36 2004 +++ llvm-test/MultiSource/Applications/d/write_ctables.c Fri Oct 21 01:38:55 2005 @@ -958,7 +958,7 @@ if (g->write_header > 0 || (g->write_header < 0 && (tokens || states))) { strcpy(pathname, base_pathname); strcat(pathname, ".d_parser.h"); - hfp = fopen(pathname, "w"); + hfp = stdout; //fopen(pathname, "w"); if (!hfp) d_fail("unable to open `%s` for write\n", pathname); fprintf(hfp, "#ifndef _%s_h\n", tag); @@ -993,7 +993,7 @@ g->productions.v[i]->name, g->productions.v[i]->state->index); } fprintf(hfp, "#endif\n"); - fclose(hfp); + //fclose(hfp); return 1; } return 0; @@ -1049,7 +1049,7 @@ strcpy(pathname, base_pathname); strcat(pathname, ".d_parser.c"); - fp = fopen(pathname, "w"); + fp = stdout; //fopen(pathname, "w"); if (!fp) d_fail("unable to open `%s` for write\n", pathname); @@ -1094,7 +1094,7 @@ else fprintf(fp, "0"); fprintf(fp, "};\n"); - fclose(fp); + //fclose(fp); } int From lattner at cs.uiuc.edu Fri Oct 21 01:41:41 2005 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Fri, 21 Oct 2005 01:41:41 -0500 Subject: [llvm-commits] CVS: llvm/lib/CodeGen/LiveInterval.cpp Message-ID: <200510210641.BAA09503@zion.cs.uiuc.edu> Changes in directory llvm/lib/CodeGen: LiveInterval.cpp updated: 1.26 -> 1.27 --- Log message: Fix LiveInterval::getOverlapingRanges to take things in the right order (an unused method). Fix the merger so that it can merge ranges like this [10:12)[16:40) with [12:38) into [10:40) instead of bogus ranges. This sort of input will be possible for the merger coming shortly --- Diffs of the changes: (+3 -3) LiveInterval.cpp | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) Index: llvm/lib/CodeGen/LiveInterval.cpp diff -u llvm/lib/CodeGen/LiveInterval.cpp:1.26 llvm/lib/CodeGen/LiveInterval.cpp:1.27 --- llvm/lib/CodeGen/LiveInterval.cpp:1.26 Thu Oct 20 17:50:10 2005 +++ llvm/lib/CodeGen/LiveInterval.cpp Fri Oct 21 01:41:30 2005 @@ -164,8 +164,8 @@ void LiveInterval::getOverlapingRanges(const LiveInterval &other, unsigned CopyIdx, std::vector &Ranges) { - const LiveRange *SourceLR = other.getLiveRangeContaining(CopyIdx-1); - const LiveRange *DestLR = getLiveRangeContaining(CopyIdx); + const LiveRange *SourceLR = getLiveRangeContaining(CopyIdx-1); + const LiveRange *DestLR = other.getLiveRangeContaining(CopyIdx); assert(SourceLR && DestLR && "Not joining due to a copy?"); unsigned OtherValIdx = SourceLR->ValId; unsigned ThisValIdx = DestLR->ValId; @@ -219,7 +219,7 @@ // If the newly formed range now touches the range after it and if they have // the same value number, merge the two ranges into one range. Ranges::iterator Next = next(I); - if (Next != ranges.end() && Next->start == I->end && Next->ValId == ValId) { + if (Next != ranges.end() && Next->start <= I->end && Next->ValId == ValId) { I->end = Next->end; ranges.erase(Next); } From lattner at cs.uiuc.edu Fri Oct 21 01:50:01 2005 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Fri, 21 Oct 2005 01:50:01 -0500 Subject: [llvm-commits] CVS: llvm/lib/CodeGen/LiveIntervalAnalysis.cpp Message-ID: <200510210650.BAA09579@zion.cs.uiuc.edu> Changes in directory llvm/lib/CodeGen: LiveIntervalAnalysis.cpp updated: 1.149 -> 1.150 --- Log message: Make the coallescer a bit smarter, allowing it to join more live ranges. For example, we can now join things like [0-30:0)[31-40:1)[52-59:2) with [40:60:0) if the 52-59 range is defined by a copy from the 40-60 range. The resultant range ends up being [0-30:0)[31-60:1). This fires a lot through-out the test suite (e.g. shrinking bc from 19492 -> 18509 machineinstrs) though most gains are smaller (e.g. about 50 copies eliminated from crafty). --- Diffs of the changes: (+85 -30) LiveIntervalAnalysis.cpp | 115 ++++++++++++++++++++++++++++++++++------------- 1 files changed, 85 insertions(+), 30 deletions(-) Index: llvm/lib/CodeGen/LiveIntervalAnalysis.cpp diff -u llvm/lib/CodeGen/LiveIntervalAnalysis.cpp:1.149 llvm/lib/CodeGen/LiveIntervalAnalysis.cpp:1.150 --- llvm/lib/CodeGen/LiveIntervalAnalysis.cpp:1.149 Tue Sep 20 23:19:09 2005 +++ llvm/lib/CodeGen/LiveIntervalAnalysis.cpp Fri Oct 21 01:49:50 2005 @@ -633,6 +633,49 @@ } } +/// IntA is defined as a copy from IntB and we know it only has one value +/// number. If all of the places that IntA and IntB overlap are defined by +/// copies from IntA to IntB, we know that these two ranges can really be +/// merged if we adjust the value numbers. If it is safe, adjust the value +/// numbers and return true, allowing coallescing to occur. +bool LiveIntervals:: +AdjustIfAllOverlappingRangesAreCopiesFrom(LiveInterval &IntA, + LiveInterval &IntB, + unsigned CopyIdx) { + std::vector Ranges; + IntA.getOverlapingRanges(IntB, CopyIdx, Ranges); + + assert(!Ranges.empty() && "Why didn't we do a simple join of this?"); + + unsigned IntBRep = rep(IntB.reg); + + // Check to see if all of the overlaps (entries in Ranges) are defined by a + // copy from IntA. If not, exit. + for (unsigned i = 0, e = Ranges.size(); i != e; ++i) { + unsigned Idx = Ranges[i]->start; + MachineInstr *MI = getInstructionFromIndex(Idx); + unsigned SrcReg, DestReg; + if (!tii_->isMoveInstr(*MI, SrcReg, DestReg)) return false; + + // If this copy isn't actually defining this range, it must be a live + // range spanning basic blocks or something. + if (rep(DestReg) != rep(IntA.reg)) return false; + + // Check to see if this is coming from IntB. If not, bail out. + if (rep(SrcReg) != IntBRep) return false; + } + + // Okay, we can change this one. Get the IntB value number that IntA is + // copied from. + unsigned ActualValNo = IntA.getLiveRangeContaining(CopyIdx-1)->ValId; + + // Change all of the value numbers to the same as what we IntA is copied from. + for (unsigned i = 0, e = Ranges.size(); i != e; ++i) + Ranges[i]->ValId = ActualValNo; + + return true; +} + void LiveIntervals::joinIntervalsInMachineBB(MachineBasicBlock *MBB) { DEBUG(std::cerr << ((Value*)MBB->getBasicBlock())->getName() << ":\n"); @@ -643,60 +686,72 @@ // we only join virtual registers with allocatable // physical registers since we do not have liveness information // on not allocatable physical registers - unsigned regA, regB; - if (tii_->isMoveInstr(*mi, regA, regB) && - (MRegisterInfo::isVirtualRegister(regA) || allocatableRegs_[regA]) && - (MRegisterInfo::isVirtualRegister(regB) || allocatableRegs_[regB])) { + unsigned SrcReg, DestReg; + if (tii_->isMoveInstr(*mi, SrcReg, DestReg) && + (MRegisterInfo::isVirtualRegister(SrcReg) || allocatableRegs_[SrcReg])&& + (MRegisterInfo::isVirtualRegister(DestReg)||allocatableRegs_[DestReg])){ // Get representative registers. - regA = rep(regA); - regB = rep(regB); + SrcReg = rep(SrcReg); + DestReg = rep(DestReg); // If they are already joined we continue. - if (regA == regB) + if (SrcReg == DestReg) continue; // If they are both physical registers, we cannot join them. - if (MRegisterInfo::isPhysicalRegister(regA) && - MRegisterInfo::isPhysicalRegister(regB)) + if (MRegisterInfo::isPhysicalRegister(SrcReg) && + MRegisterInfo::isPhysicalRegister(DestReg)) continue; // If they are not of the same register class, we cannot join them. - if (differingRegisterClasses(regA, regB)) + if (differingRegisterClasses(SrcReg, DestReg)) continue; - LiveInterval &IntA = getInterval(regA); - LiveInterval &IntB = getInterval(regB); - assert(IntA.reg == regA && IntB.reg == regB && + LiveInterval &SrcInt = getInterval(SrcReg); + LiveInterval &DestInt = getInterval(DestReg); + assert(SrcInt.reg == SrcReg && DestInt.reg == DestReg && "Register mapping is horribly broken!"); - DEBUG(std::cerr << "\t\tInspecting " << IntA << " and " << IntB << ": "); + DEBUG(std::cerr << "\t\tInspecting " << SrcInt << " and " << DestInt + << ": "); // If two intervals contain a single value and are joined by a copy, it // does not matter if the intervals overlap, they can always be joined. - bool TriviallyJoinable = - IntA.containsOneValue() && IntB.containsOneValue(); + bool Joinable = SrcInt.containsOneValue() && DestInt.containsOneValue(); unsigned MIDefIdx = getDefIndex(getInstructionIndex(mi)); - if ((TriviallyJoinable || IntB.joinable(IntA, MIDefIdx)) && - !overlapsAliases(&IntA, &IntB)) { - IntB.join(IntA, MIDefIdx); - DEBUG(std::cerr << "Joined. Result = " << IntB << "\n"); - - if (!MRegisterInfo::isPhysicalRegister(regA)) { - r2iMap_.erase(regA); - r2rMap_[regA] = regB; + + // If the intervals think that this is joinable, do so now. + if (!Joinable && DestInt.joinable(SrcInt, MIDefIdx)) + Joinable = true; + + // If DestInt is actually a copy from SrcInt (which we know) that is used + // to define another value of SrcInt, we can change the other range of + // SrcInt to be the value of the range that defines DestInt, allowing a + // coallesce. + if (!Joinable && DestInt.containsOneValue() && + AdjustIfAllOverlappingRangesAreCopiesFrom(SrcInt, DestInt, MIDefIdx)) + Joinable = true; + + if (!Joinable || overlapsAliases(&SrcInt, &DestInt)) { + DEBUG(std::cerr << "Interference!\n"); + } else { + DestInt.join(SrcInt, MIDefIdx); + DEBUG(std::cerr << "Joined. Result = " << DestInt << "\n"); + + if (!MRegisterInfo::isPhysicalRegister(SrcReg)) { + r2iMap_.erase(SrcReg); + r2rMap_[SrcReg] = DestReg; } else { // Otherwise merge the data structures the other way so we don't lose // the physreg information. - r2rMap_[regB] = regA; - IntB.reg = regA; - IntA.swap(IntB); - r2iMap_.erase(regB); + r2rMap_[DestReg] = SrcReg; + DestInt.reg = SrcReg; + SrcInt.swap(DestInt); + r2iMap_.erase(DestReg); } ++numJoins; - } else { - DEBUG(std::cerr << "Interference!\n"); } } } From lattner at cs.uiuc.edu Fri Oct 21 10:49:39 2005 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Fri, 21 Oct 2005 10:49:39 -0500 Subject: [llvm-commits] CVS: llvm/include/llvm/CodeGen/LiveIntervalAnalysis.h Message-ID: <200510211549.KAA24100@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm/CodeGen: LiveIntervalAnalysis.h updated: 1.47 -> 1.48 --- Log message: add missing prototype --- Diffs of the changes: (+4 -0) LiveIntervalAnalysis.h | 4 ++++ 1 files changed, 4 insertions(+) Index: llvm/include/llvm/CodeGen/LiveIntervalAnalysis.h diff -u llvm/include/llvm/CodeGen/LiveIntervalAnalysis.h:1.47 llvm/include/llvm/CodeGen/LiveIntervalAnalysis.h:1.48 --- llvm/include/llvm/CodeGen/LiveIntervalAnalysis.h:1.47 Tue Sep 20 23:18:25 2005 +++ llvm/include/llvm/CodeGen/LiveIntervalAnalysis.h Fri Oct 21 10:49:28 2005 @@ -171,6 +171,10 @@ /// register classes. The registers may be either phys or virt regs. bool differingRegisterClasses(unsigned RegA, unsigned RegB) const; + bool AdjustIfAllOverlappingRangesAreCopiesFrom(LiveInterval &IntA, + LiveInterval &IntB, + unsigned CopyIdx); + bool overlapsAliases(const LiveInterval *lhs, const LiveInterval *rhs) const; From lattner at cs.uiuc.edu Fri Oct 21 11:01:37 2005 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Fri, 21 Oct 2005 11:01:37 -0500 Subject: [llvm-commits] CVS: llvm/lib/Target/Alpha/AlphaISelPattern.cpp Message-ID: <200510211601.LAA24272@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/Alpha: AlphaISelPattern.cpp updated: 1.175 -> 1.176 --- Log message: silence a release mode warning --- Diffs of the changes: (+1 -1) AlphaISelPattern.cpp | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm/lib/Target/Alpha/AlphaISelPattern.cpp diff -u llvm/lib/Target/Alpha/AlphaISelPattern.cpp:1.175 llvm/lib/Target/Alpha/AlphaISelPattern.cpp:1.176 --- llvm/lib/Target/Alpha/AlphaISelPattern.cpp:1.175 Thu Oct 20 20:52:20 2005 +++ llvm/lib/Target/Alpha/AlphaISelPattern.cpp Fri Oct 21 11:01:26 2005 @@ -506,7 +506,7 @@ unsigned Tmp1, Tmp2 = 0, Tmp3; unsigned Opc = 0; unsigned opcode = N.getOpcode(); - int64_t SImm; + int64_t SImm = 0; uint64_t UImm; SDNode *Node = N.Val; From jlaskey at apple.com Fri Oct 21 14:00:15 2005 From: jlaskey at apple.com (Jim Laskey) Date: Fri, 21 Oct 2005 14:00:15 -0500 Subject: [llvm-commits] CVS: llvm/utils/TableGen/SubtargetEmitter.cpp SubtargetEmitter.h Message-ID: <200510211900.OAA25217@zion.cs.uiuc.edu> Changes in directory llvm/utils/TableGen: SubtargetEmitter.cpp added (r1.1) SubtargetEmitter.h added (r1.1) --- Log message: New TableGen backends for subtarget information. Only command line stuff active now. Scheduling itinerary next. --- Diffs of the changes: (+148 -0) SubtargetEmitter.cpp | 111 +++++++++++++++++++++++++++++++++++++++++++++++++++ SubtargetEmitter.h | 37 +++++++++++++++++ 2 files changed, 148 insertions(+) Index: llvm/utils/TableGen/SubtargetEmitter.cpp diff -c /dev/null llvm/utils/TableGen/SubtargetEmitter.cpp:1.1 *** /dev/null Fri Oct 21 14:00:14 2005 --- llvm/utils/TableGen/SubtargetEmitter.cpp Fri Oct 21 14:00:04 2005 *************** *** 0 **** --- 1,111 ---- + //===- SubtargetEmitter.cpp - Generate subtarget enumerations -------------===// + // + // The LLVM Compiler Infrastructure + // + // This file was developed by James M. Laskey and is distributed under + // the University of Illinois Open Source License. See LICENSE.TXT for details. + // + //===----------------------------------------------------------------------===// + // + // This tablegen backend emits subtarget enumerations. + // + //===----------------------------------------------------------------------===// + + #include "SubtargetEmitter.h" + #include "CodeGenTarget.h" + #include "Record.h" + #include "llvm/ADT/StringExtras.h" + #include "llvm/Support/Debug.h" + #include + #include + using namespace llvm; + + // Convenience types + typedef std::vector RecordList; + typedef std::vector::iterator RecordListIter; + + + // SubtargetEmitter::run - Main subtarget enumeration emitter. + // + void SubtargetEmitter::run(std::ostream &OS) { + EmitSourceFileHeader("Subtarget Enumeration Source Fragment", OS); + RecordList Features = Records.getAllDerivedDefinitions("SubtargetFeature"); + RecordList Processors = Records.getAllDerivedDefinitions("Processor"); + + OS << "namespace llvm {\n\n"; + + { // Feature enumeration + int i = 0; + + OS << "enum {\n"; + + for (RecordListIter RI = Features.begin(), E = Features.end(); RI != E;){ + Record *R = *RI++; + std::string Instance = R->getName(); + OS << " " + << Instance + << " = " + << " 1 << " << i++ + << ((RI != E) ? ",\n" : "\n"); + } + + OS << "};\n"; + } + + { // Feature key values + OS << "\n\n" + << "/// Sorted (by key) array of values for CPU features.\n" + << "static SubtargetFeatureKV FeatureKV[] = {\n"; + for (RecordListIter RI = Features.begin(), E = Features.end(); RI != E;) { + Record *R = *RI++; + std::string Instance = R->getName(); + std::string Name = R->getValueAsString("Name"); + std::string Desc = R->getValueAsString("Desc"); + OS << " { " + << "\"" << Name << "\", " + << "\"" << Desc << "\", " + << Instance + << ((RI != E) ? " },\n" : " }\n"); + } + OS << "};\n"; + } + + { // Feature key values + OS << "\n\n" + << "/// Sorted (by key) array of values for CPU subtype.\n" + << "static const SubtargetFeatureKV SubTypeKV[] = {\n"; + for (RecordListIter RI = Processors.begin(), E = Processors.end(); + RI != E;) { + Record *R = *RI++; + std::string Name = R->getValueAsString("Name"); + Record *ProcItin = R->getValueAsDef("ProcItin"); + ListInit *Features = R->getValueAsListInit("Features"); + unsigned N = Features->getSize(); + OS << " { " + << "\"" << Name << "\", " + << "\"Select the " << Name << " processor\", "; + + + if (N == 0) { + OS << "0"; + } else { + for (unsigned i = 0; i < N; ) { + if (DefInit *DI = dynamic_cast(Features->getElement(i++))) { + Record *Feature = DI->getDef(); + std::string Name = Feature->getName(); + OS << Name; + if (i != N) OS << " | "; + } else { + throw "Feature: " + Name + + " expected feature in processor feature list!"; + } + } + } + + OS << ((RI != E) ? " },\n" : " }\n"); + } + OS << "};\n"; + } + + OS << "\n} // End llvm namespace \n"; + } Index: llvm/utils/TableGen/SubtargetEmitter.h diff -c /dev/null llvm/utils/TableGen/SubtargetEmitter.h:1.1 *** /dev/null Fri Oct 21 14:00:15 2005 --- llvm/utils/TableGen/SubtargetEmitter.h Fri Oct 21 14:00:04 2005 *************** *** 0 **** --- 1,37 ---- + //===- SubtargetEmitter.h - Generate subtarget enumerations -----*- C++ -*-===// + // + // The LLVM Compiler Infrastructure + // + // This file was developed by James M. Laskey and is distributed under + // the University of Illinois Open Source License. See LICENSE.TXT for details. + // + //===----------------------------------------------------------------------===// + // + // This tablegen backend emits subtarget enumerations. + // + //===----------------------------------------------------------------------===// + + #ifndef SUBTARGET_EMITTER_H + #define SUBTARGET_EMITTER_H + + #include "TableGenBackend.h" + + namespace llvm { + + class SubtargetEmitter : public TableGenBackend { + RecordKeeper &Records; + public: + SubtargetEmitter(RecordKeeper &R) : Records(R) {} + + // run - Output the subtarget enumerations, returning true on failure. + void run(std::ostream &o); + + }; + + + } // End llvm namespace + + #endif + + + From jlaskey at apple.com Fri Oct 21 14:02:57 2005 From: jlaskey at apple.com (Jim Laskey) Date: Fri, 21 Oct 2005 14:02:57 -0500 Subject: [llvm-commits] CVS: llvm/lib/Target/TargetSchedule.td Message-ID: <200510211902.OAA25259@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target: TargetSchedule.td updated: 1.2 -> 1.3 --- Log message: Plugin new subtarget backend into the build. --- Diffs of the changes: (+2 -2) TargetSchedule.td | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) Index: llvm/lib/Target/TargetSchedule.td diff -u llvm/lib/Target/TargetSchedule.td:1.2 llvm/lib/Target/TargetSchedule.td:1.3 --- llvm/lib/Target/TargetSchedule.td:1.2 Wed Oct 19 08:34:52 2005 +++ llvm/lib/Target/TargetSchedule.td Fri Oct 21 14:02:44 2005 @@ -28,8 +28,8 @@ // need to complete the stage. Units represent the choice of functional units // that can be used to complete the stage. Eg. IntUnit1, IntUnit2. // -class InstrStage units> { - int Latency = latency; // length of stage in machine cycles +class InstrStage units> { + int Cycles = cycles; // length of stage in machine cycles list Units = units; // choice of functional units } From jlaskey at apple.com Fri Oct 21 14:02:57 2005 From: jlaskey at apple.com (Jim Laskey) Date: Fri, 21 Oct 2005 14:02:57 -0500 Subject: [llvm-commits] CVS: llvm/lib/Target/PowerPC/Makefile PPC.td PPCSubtarget.cpp Message-ID: <200510211902.OAA25275@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/PowerPC: Makefile updated: 1.20 -> 1.21 PPC.td updated: 1.3 -> 1.4 PPCSubtarget.cpp updated: 1.10 -> 1.11 --- Log message: Plugin new subtarget backend into the build. --- Diffs of the changes: (+39 -77) Makefile | 2 - PPC.td | 43 +++++++++++++++++++-------------- PPCSubtarget.cpp | 71 ++++++++++--------------------------------------------- 3 files changed, 39 insertions(+), 77 deletions(-) Index: llvm/lib/Target/PowerPC/Makefile diff -u llvm/lib/Target/PowerPC/Makefile:1.20 llvm/lib/Target/PowerPC/Makefile:1.21 --- llvm/lib/Target/PowerPC/Makefile:1.20 Fri Oct 14 18:37:35 2005 +++ llvm/lib/Target/PowerPC/Makefile Fri Oct 21 14:02:44 2005 @@ -14,6 +14,6 @@ BUILT_SOURCES = PPCGenInstrNames.inc PPCGenRegisterNames.inc \ PPCGenAsmWriter.inc PPCGenCodeEmitter.inc \ PPCGenRegisterInfo.h.inc PPCGenRegisterInfo.inc \ - PPCGenInstrInfo.inc PPCGenDAGISel.inc + PPCGenInstrInfo.inc PPCGenDAGISel.inc PPCGenSubtarget.inc include $(LEVEL)/Makefile.common Index: llvm/lib/Target/PowerPC/PPC.td diff -u llvm/lib/Target/PowerPC/PPC.td:1.3 llvm/lib/Target/PowerPC/PPC.td:1.4 --- llvm/lib/Target/PowerPC/PPC.td:1.3 Wed Oct 19 14:51:16 2005 +++ llvm/lib/Target/PowerPC/PPC.td Fri Oct 21 14:02:44 2005 @@ -26,37 +26,44 @@ //===----------------------------------------------------------------------===// -// PowerPC Subtarget features. +// PowerPC Subtarget features (sorted by name). // -def F64Bit : SubtargetFeature<"64bit", - "Should 64 bit instructions be used">; -def F64BitRegs : SubtargetFeature<"64bitregs", - "Should 64 bit registers be used">; -def FAltivec : SubtargetFeature<"altivec", - "Should Altivec instructions be used">; -def FGPUL : SubtargetFeature<"gpul", - "Should GPUL instructions be used">; -def FFSQRT : SubtargetFeature<"fsqrt", - "Should the fsqrt instruction be used">; +def Feature64Bit : SubtargetFeature<"64bit", + "Should 64 bit instructions be used">; +def Feature64BitRegs : SubtargetFeature<"64bitregs", + "Should 64 bit registers be used">; +def FeatureAltivec : SubtargetFeature<"altivec", + "Should Altivec instructions be used">; +def FeatureFSqrt : SubtargetFeature<"fsqrt", + "Should the fsqrt instruction be used">; +def FeatureGPUL : SubtargetFeature<"gpul", + "Should GPUL instructions be used">; //===----------------------------------------------------------------------===// -// PowerPC chips sets supported +// PowerPC chips sets supported (sorted by name) // def : Processor<"601", G3Itineraries, []>; def : Processor<"602", G3Itineraries, []>; def : Processor<"603", G3Itineraries, []>; +def : Processor<"603e", G3Itineraries, []>; +def : Processor<"603ev", G3Itineraries, []>; def : Processor<"604", G3Itineraries, []>; +def : Processor<"604e", G3Itineraries, []>; +def : Processor<"620", G3Itineraries, []>; +def : Processor<"7400", G4Itineraries, [FeatureAltivec]>; +def : Processor<"7450", G4PlusItineraries, [FeatureAltivec]>; def : Processor<"750", G3Itineraries, []>; -def : Processor<"7400", G4Itineraries, [FAltivec]>; -def : Processor<"g4", G4Itineraries, [FAltivec]>; -def : Processor<"7450", G4PlusItineraries, [FAltivec]>; -def : Processor<"g4+", G4PlusItineraries, [FAltivec]>; def : Processor<"970", G5Itineraries, - [FAltivec, FGPUL, FFSQRT, F64Bit, F64BitRegs]>; + [FeatureAltivec, FeatureGPUL, FeatureFSqrt, + Feature64Bit, Feature64BitRegs]>; +def : Processor<"g4", G4Itineraries, [FeatureAltivec]>; +def : Processor<"g4+", G4PlusItineraries, [FeatureAltivec]>; def : Processor<"g5", G5Itineraries, - [FAltivec, FGPUL, FFSQRT, F64Bit, F64BitRegs]>; + [FeatureAltivec, FeatureGPUL, FeatureFSqrt, + Feature64Bit, Feature64BitRegs]>; +def : Processor<"generic", G3Itineraries, []>; def PPC : Target { Index: llvm/lib/Target/PowerPC/PPCSubtarget.cpp diff -u llvm/lib/Target/PowerPC/PPCSubtarget.cpp:1.10 llvm/lib/Target/PowerPC/PPCSubtarget.cpp:1.11 --- llvm/lib/Target/PowerPC/PPCSubtarget.cpp:1.10 Mon Oct 17 19:56:42 2005 +++ llvm/lib/Target/PowerPC/PPCSubtarget.cpp Fri Oct 21 14:02:44 2005 @@ -16,6 +16,7 @@ #include "llvm/Module.h" #include "llvm/Support/CommandLine.h" #include "llvm/Target/SubtargetFeature.h" +#include "PPCGenSubtarget.inc" using namespace llvm; PPCTargetEnum llvm::PPCTarget = TargetDefault; @@ -29,59 +30,14 @@ " Enable Darwin codegen"), clEnumValEnd), cl::location(PPCTarget), cl::init(TargetDefault)); -} - -enum PowerPCFeature { - PowerPCFeature64Bit = 1 << 0, - PowerPCFeatureAltivec = 1 << 1, - PowerPCFeatureFSqrt = 1 << 2, - PowerPCFeatureGPUL = 1 << 3, - PowerPCFeature64BRegs = 1 << 4 -}; - -/// Sorted (by key) array of values for CPU subtype. -static const SubtargetFeatureKV PowerPCSubTypeKV[] = { - { "601" , "Select the PowerPC 601 processor", 0 }, - { "602" , "Select the PowerPC 602 processor", 0 }, - { "603" , "Select the PowerPC 603 processor", 0 }, - { "603e" , "Select the PowerPC 603e processor", 0 }, - { "603ev" , "Select the PowerPC 603ev processor", 0 }, - { "604" , "Select the PowerPC 604 processor", 0 }, - { "604e" , "Select the PowerPC 604e processor", 0 }, - { "620" , "Select the PowerPC 620 processor", 0 }, - { "7400" , "Select the PowerPC 7400 (G4) processor", - PowerPCFeatureAltivec }, - { "7450" , "Select the PowerPC 7450 (G4+) processor", - PowerPCFeatureAltivec }, - { "750" , "Select the PowerPC 750 (G3) processor", 0 }, - { "970" , "Select the PowerPC 970 (G5 - GPUL) processor", - PowerPCFeature64Bit | PowerPCFeatureAltivec | - PowerPCFeatureFSqrt | PowerPCFeatureGPUL }, - { "g3" , "Select the PowerPC G3 (750) processor", 0 }, - { "g4" , "Select the PowerPC G4 (7400) processor", - PowerPCFeatureAltivec }, - { "g4+" , "Select the PowerPC G4+ (7450) processor", - PowerPCFeatureAltivec }, - { "g5" , "Select the PowerPC g5 (970 - GPUL) processor", - PowerPCFeature64Bit | PowerPCFeatureAltivec | - PowerPCFeatureFSqrt | PowerPCFeatureGPUL }, - { "generic", "Select instructions for a generic PowerPC processor", 0 } -}; -/// Length of PowerPCSubTypeKV. -static const unsigned PowerPCSubTypeKVSize = sizeof(PowerPCSubTypeKV) - / sizeof(SubtargetFeatureKV); - -/// Sorted (by key) array of values for CPU features. -static SubtargetFeatureKV PowerPCFeatureKV[] = { - { "64bit" , "Should 64 bit instructions be used" , PowerPCFeature64Bit }, - { "64bitregs", "Should 64 bit registers be used" , PowerPCFeature64BRegs }, - { "altivec", "Should Altivec instructions be used" , PowerPCFeatureAltivec }, - { "fsqrt" , "Should the fsqrt instruction be used", PowerPCFeatureFSqrt }, - { "gpul" , "Should GPUL instructions be used" , PowerPCFeatureGPUL } - }; -/// Length of PowerPCFeatureKV. -static const unsigned PowerPCFeatureKVSize = sizeof(PowerPCFeatureKV) +} + +/// Length of FeatureKV. +static const unsigned FeatureKVSize = sizeof(FeatureKV) / sizeof(SubtargetFeatureKV); +/// Length of SubTypeKV. +static const unsigned SubTypeKVSize = sizeof(SubTypeKV) + / sizeof(SubtargetFeatureKV); #if defined(__APPLE__) @@ -131,12 +87,11 @@ #endif uint32_t Bits = SubtargetFeatures::Parse(FS, CPU, - PowerPCSubTypeKV, PowerPCSubTypeKVSize, - PowerPCFeatureKV, PowerPCFeatureKVSize); - IsGigaProcessor = (Bits & PowerPCFeatureGPUL ) != 0; - Is64Bit = (Bits & PowerPCFeature64Bit) != 0; - HasFSQRT = (Bits & PowerPCFeatureFSqrt) != 0; - Has64BitRegs = (Bits & PowerPCFeature64BRegs) != 0; + SubTypeKV, SubTypeKVSize, FeatureKV, FeatureKVSize); + IsGigaProcessor = (Bits & FeatureGPUL ) != 0; + Is64Bit = (Bits & Feature64Bit) != 0; + HasFSQRT = (Bits & FeatureFSqrt) != 0; + Has64BitRegs = (Bits & Feature64BitRegs) != 0; // Set the boolean corresponding to the current target triple, or the default // if one cannot be determined, to true. From jlaskey at apple.com Fri Oct 21 14:02:57 2005 From: jlaskey at apple.com (Jim Laskey) Date: Fri, 21 Oct 2005 14:02:57 -0500 Subject: [llvm-commits] CVS: llvm/utils/TableGen/TableGen.cpp Message-ID: <200510211902.OAA25267@zion.cs.uiuc.edu> Changes in directory llvm/utils/TableGen: TableGen.cpp updated: 1.39 -> 1.40 --- Log message: Plugin new subtarget backend into the build. --- Diffs of the changes: (+7 -0) TableGen.cpp | 7 +++++++ 1 files changed, 7 insertions(+) Index: llvm/utils/TableGen/TableGen.cpp diff -u llvm/utils/TableGen/TableGen.cpp:1.39 llvm/utils/TableGen/TableGen.cpp:1.40 --- llvm/utils/TableGen/TableGen.cpp:1.39 Fri Sep 2 20:14:03 2005 +++ llvm/utils/TableGen/TableGen.cpp Fri Oct 21 14:02:44 2005 @@ -25,6 +25,7 @@ #include "AsmWriterEmitter.h" #include "InstrSelectorEmitter.h" #include "DAGISelEmitter.h" +#include "SubtargetEmitter.h" #include #include #include @@ -36,6 +37,7 @@ GenRegisterEnums, GenRegister, GenRegisterHeader, GenInstrEnums, GenInstrs, GenAsmWriter, GenInstrSelector, GenDAGISel, + GenSubtarget, PrintEnums, Parse }; @@ -63,6 +65,8 @@ "Generate an instruction selector"), clEnumValN(GenDAGISel, "gen-dag-isel", "Generate a DAG instruction selector"), + clEnumValN(GenSubtarget, "gen-subtarget", + "Generate subtarget enumerations"), clEnumValN(PrintEnums, "print-enums", "Print enum values for a class"), clEnumValN(Parse, "parse", @@ -472,6 +476,9 @@ case GenDAGISel: DAGISelEmitter(Records).run(*Out); break; + case GenSubtarget: + SubtargetEmitter(Records).run(*Out); + break; case PrintEnums: { std::vector Recs = Records.getAllDerivedDefinitions(Class); From jlaskey at apple.com Fri Oct 21 14:02:57 2005 From: jlaskey at apple.com (Jim Laskey) Date: Fri, 21 Oct 2005 14:02:57 -0500 Subject: [llvm-commits] CVS: llvm/Makefile.rules Message-ID: <200510211902.OAA25263@zion.cs.uiuc.edu> Changes in directory llvm: Makefile.rules updated: 1.327 -> 1.328 --- Log message: Plugin new subtarget backend into the build. --- Diffs of the changes: (+4 -0) Makefile.rules | 4 ++++ 1 files changed, 4 insertions(+) Index: llvm/Makefile.rules diff -u llvm/Makefile.rules:1.327 llvm/Makefile.rules:1.328 --- llvm/Makefile.rules:1.327 Fri Oct 14 01:31:58 2005 +++ llvm/Makefile.rules Fri Oct 21 14:02:44 2005 @@ -1162,6 +1162,10 @@ $(Echo) "Building $( Changes in directory llvm/lib/Target: Target.td updated: 1.54 -> 1.55 --- Log message: Plugin new subtarget backend into the build. --- Diffs of the changes: (+1 -1) Target.td | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm/lib/Target/Target.td diff -u llvm/lib/Target/Target.td:1.54 llvm/lib/Target/Target.td:1.55 --- llvm/lib/Target/Target.td:1.54 Wed Oct 19 14:51:16 2005 +++ llvm/lib/Target/Target.td Fri Oct 21 14:05:19 2005 @@ -280,7 +280,7 @@ ProcessorItineraries ProcItin = pi; // Features - list of - list Features; + list Features = f; } //===----------------------------------------------------------------------===// From brukman at cs.uiuc.edu Fri Oct 21 15:29:43 2005 From: brukman at cs.uiuc.edu (Misha Brukman) Date: Fri, 21 Oct 2005 15:29:43 -0500 Subject: [llvm-commits] CVS: llvm-www/OpenProjects.html Message-ID: <200510212029.PAA25983@zion.cs.uiuc.edu> Changes in directory llvm-www: OpenProjects.html updated: 1.8 -> 1.9 --- Log message: "Compiler dependencies" page is now section 38. --- Diffs of the changes: (+2 -2) OpenProjects.html | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) Index: llvm-www/OpenProjects.html diff -u llvm-www/OpenProjects.html:1.8 llvm-www/OpenProjects.html:1.9 --- llvm-www/OpenProjects.html:1.8 Sat Jul 16 00:43:39 2005 +++ llvm-www/OpenProjects.html Fri Oct 21 15:29:32 2005 @@ -349,7 +349,7 @@
  • Write a new frontend for C/C++ in C++, giving us the ability to directly use LLVM C++ classes from within a compiler rather than use C-based wrapper functions a la llvm-gcc. One possible starting point is the C++ +href="http://www.parashift.com/c++-faq-lite/compiler-dependencies.html#faq-38.11">C++ yacc grammar by Ed Willink.
  • Write a new frontend for some other language (Java? OCaml? Forth?)
  • Write a disassembler for machine code that would use TableGen to output @@ -376,7 +376,7 @@ src="http://www.w3.org/Icons/valid-html401" alt="Valid HTML 4.01!"> LLVM Compiler Infrastructure
    - Last modified: $Date: 2005/07/16 05:43:39 $ + Last modified: $Date: 2005/10/21 20:29:32 $ From lattner at cs.uiuc.edu Fri Oct 21 16:09:25 2005 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Fri, 21 Oct 2005 16:09:25 -0500 Subject: [llvm-commits] CVS: llvm/test/Regression/CodeGen/Generic/2005-10-21-longlonggtu.ll Message-ID: <200510212109.QAA26180@zion.cs.uiuc.edu> Changes in directory llvm/test/Regression/CodeGen/Generic: 2005-10-21-longlonggtu.ll added (r1.1) --- Log message: New testcase that crashes the ppc backend --- Diffs of the changes: (+12 -0) 2005-10-21-longlonggtu.ll | 12 ++++++++++++ 1 files changed, 12 insertions(+) Index: llvm/test/Regression/CodeGen/Generic/2005-10-21-longlonggtu.ll diff -c /dev/null llvm/test/Regression/CodeGen/Generic/2005-10-21-longlonggtu.ll:1.1 *** /dev/null Fri Oct 21 16:09:24 2005 --- llvm/test/Regression/CodeGen/Generic/2005-10-21-longlonggtu.ll Fri Oct 21 16:09:14 2005 *************** *** 0 **** --- 1,12 ---- + ; RUN: llvm-as < %s | llc + float %t(long %u) { + %u = cast long %u to ulong ; [#uses=1] + %tmp5 = add ulong %u, 9007199254740991 ; [#uses=1] + %tmp = setgt ulong %tmp5, 18014398509481982 ; [#uses=1] + br bool %tmp, label %T, label %F + T: + ret float 1.0 + F: + call float %t(long 0) + ret float 0.0 + } From lattner at cs.uiuc.edu Fri Oct 21 16:17:21 2005 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Fri, 21 Oct 2005 16:17:21 -0500 Subject: [llvm-commits] CVS: llvm/lib/Target/PowerPC/PPCISelDAGToDAG.cpp PPCInstrInfo.td Message-ID: <200510212117.QAA26302@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/PowerPC: PPCISelDAGToDAG.cpp updated: 1.115 -> 1.116 PPCInstrInfo.td updated: 1.132 -> 1.133 --- Log message: Instead of aborting if not a case we can handle specially, break out and let the generic code handle it. This fixes CodeGen/Generic/2005-10-21-longlonggtu.ll on ppc. also, reindent this code --- Diffs of the changes: (+52 -55) PPCISelDAGToDAG.cpp | 106 +++++++++++++++++++++++++--------------------------- PPCInstrInfo.td | 1 2 files changed, 52 insertions(+), 55 deletions(-) Index: llvm/lib/Target/PowerPC/PPCISelDAGToDAG.cpp diff -u llvm/lib/Target/PowerPC/PPCISelDAGToDAG.cpp:1.115 llvm/lib/Target/PowerPC/PPCISelDAGToDAG.cpp:1.116 --- llvm/lib/Target/PowerPC/PPCISelDAGToDAG.cpp:1.115 Thu Oct 20 19:02:42 2005 +++ llvm/lib/Target/PowerPC/PPCISelDAGToDAG.cpp Fri Oct 21 16:17:10 2005 @@ -621,65 +621,63 @@ if (Imm == 0) { SDOperand Op = Select(N->getOperand(0)); switch (CC) { - default: assert(0 && "Unhandled SetCC condition"); abort(); - case ISD::SETEQ: - Op = CurDAG->getTargetNode(PPC::CNTLZW, MVT::i32, Op); - CurDAG->SelectNodeTo(N, PPC::RLWINM, MVT::i32, Op, getI32Imm(27), - getI32Imm(5), getI32Imm(31)); - break; - case ISD::SETNE: { - SDOperand AD = CurDAG->getTargetNode(PPC::ADDIC, MVT::i32, MVT::Flag, - Op, getI32Imm(~0U)); - CurDAG->SelectNodeTo(N, PPC::SUBFE, MVT::i32, AD, Op, AD.getValue(1)); - break; - } - case ISD::SETLT: - CurDAG->SelectNodeTo(N, PPC::RLWINM, MVT::i32, Op, getI32Imm(1), - getI32Imm(31), getI32Imm(31)); - break; - case ISD::SETGT: { - SDOperand T = CurDAG->getTargetNode(PPC::NEG, MVT::i32, Op); - T = CurDAG->getTargetNode(PPC::ANDC, MVT::i32, T, Op);; - CurDAG->SelectNodeTo(N, PPC::RLWINM, MVT::i32, T, getI32Imm(1), - getI32Imm(31), getI32Imm(31)); - break; - } + default: break; + case ISD::SETEQ: + Op = CurDAG->getTargetNode(PPC::CNTLZW, MVT::i32, Op); + CurDAG->SelectNodeTo(N, PPC::RLWINM, MVT::i32, Op, getI32Imm(27), + getI32Imm(5), getI32Imm(31)); + return SDOperand(N, 0); + case ISD::SETNE: { + SDOperand AD = CurDAG->getTargetNode(PPC::ADDIC, MVT::i32, MVT::Flag, + Op, getI32Imm(~0U)); + CurDAG->SelectNodeTo(N, PPC::SUBFE, MVT::i32, AD, Op, AD.getValue(1)); + return SDOperand(N, 0); + } + case ISD::SETLT: + CurDAG->SelectNodeTo(N, PPC::RLWINM, MVT::i32, Op, getI32Imm(1), + getI32Imm(31), getI32Imm(31)); + return SDOperand(N, 0); + case ISD::SETGT: { + SDOperand T = CurDAG->getTargetNode(PPC::NEG, MVT::i32, Op); + T = CurDAG->getTargetNode(PPC::ANDC, MVT::i32, T, Op);; + CurDAG->SelectNodeTo(N, PPC::RLWINM, MVT::i32, T, getI32Imm(1), + getI32Imm(31), getI32Imm(31)); + return SDOperand(N, 0); + } } - return SDOperand(N, 0); } else if (Imm == ~0U) { // setcc op, -1 SDOperand Op = Select(N->getOperand(0)); switch (CC) { - default: assert(0 && "Unhandled SetCC condition"); abort(); - case ISD::SETEQ: - Op = CurDAG->getTargetNode(PPC::ADDIC, MVT::i32, MVT::Flag, - Op, getI32Imm(1)); - CurDAG->SelectNodeTo(N, PPC::ADDZE, MVT::i32, - CurDAG->getTargetNode(PPC::LI, MVT::i32, - getI32Imm(0)), - Op.getValue(1)); - break; - case ISD::SETNE: { - Op = CurDAG->getTargetNode(PPC::NOR, MVT::i32, Op, Op); - SDOperand AD = CurDAG->getTargetNode(PPC::ADDIC, MVT::i32, MVT::Flag, - Op, getI32Imm(~0U)); - CurDAG->SelectNodeTo(N, PPC::SUBFE, MVT::i32, AD, Op, AD.getValue(1)); - break; - } - case ISD::SETLT: { - SDOperand AD = CurDAG->getTargetNode(PPC::ADDI, MVT::i32, Op, - getI32Imm(1)); - SDOperand AN = CurDAG->getTargetNode(PPC::AND, MVT::i32, AD, Op); - CurDAG->SelectNodeTo(N, PPC::RLWINM, MVT::i32, AN, getI32Imm(1), - getI32Imm(31), getI32Imm(31)); - break; - } - case ISD::SETGT: - Op = CurDAG->getTargetNode(PPC::RLWINM, MVT::i32, Op, getI32Imm(1), - getI32Imm(31), getI32Imm(31)); - CurDAG->SelectNodeTo(N, PPC::XORI, MVT::i32, Op, getI32Imm(1)); - break; + default: break; + case ISD::SETEQ: + Op = CurDAG->getTargetNode(PPC::ADDIC, MVT::i32, MVT::Flag, + Op, getI32Imm(1)); + CurDAG->SelectNodeTo(N, PPC::ADDZE, MVT::i32, + CurDAG->getTargetNode(PPC::LI, MVT::i32, + getI32Imm(0)), + Op.getValue(1)); + return SDOperand(N, 0); + case ISD::SETNE: { + Op = CurDAG->getTargetNode(PPC::NOR, MVT::i32, Op, Op); + SDOperand AD = CurDAG->getTargetNode(PPC::ADDIC, MVT::i32, MVT::Flag, + Op, getI32Imm(~0U)); + CurDAG->SelectNodeTo(N, PPC::SUBFE, MVT::i32, AD, Op, AD.getValue(1)); + return SDOperand(N, 0); + } + case ISD::SETLT: { + SDOperand AD = CurDAG->getTargetNode(PPC::ADDI, MVT::i32, Op, + getI32Imm(1)); + SDOperand AN = CurDAG->getTargetNode(PPC::AND, MVT::i32, AD, Op); + CurDAG->SelectNodeTo(N, PPC::RLWINM, MVT::i32, AN, getI32Imm(1), + getI32Imm(31), getI32Imm(31)); + return SDOperand(N, 0); + } + case ISD::SETGT: + Op = CurDAG->getTargetNode(PPC::RLWINM, MVT::i32, Op, getI32Imm(1), + getI32Imm(31), getI32Imm(31)); + CurDAG->SelectNodeTo(N, PPC::XORI, MVT::i32, Op, getI32Imm(1)); + return SDOperand(N, 0); } - return SDOperand(N, 0); } } Index: llvm/lib/Target/PowerPC/PPCInstrInfo.td diff -u llvm/lib/Target/PowerPC/PPCInstrInfo.td:1.132 llvm/lib/Target/PowerPC/PPCInstrInfo.td:1.133 --- llvm/lib/Target/PowerPC/PPCInstrInfo.td:1.132 Fri Oct 21 01:36:18 2005 +++ llvm/lib/Target/PowerPC/PPCInstrInfo.td Fri Oct 21 16:17:10 2005 @@ -771,7 +771,6 @@ (XORIS GPRC:$tmp, (HI16 imm:$imm))]>; */ - //===----------------------------------------------------------------------===// // PowerPCInstrInfo Definition // From lattner at cs.uiuc.edu Fri Oct 21 16:23:37 2005 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Fri, 21 Oct 2005 16:23:37 -0500 Subject: [llvm-commits] CVS: llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp Message-ID: <200510212123.QAA26446@zion.cs.uiuc.edu> Changes in directory llvm/lib/CodeGen/SelectionDAG: DAGCombiner.cpp updated: 1.52 -> 1.53 --- Log message: add a case missing from the dag combiner that exposed the failure on 2005-10-21-longlonggtu.ll. --- Diffs of the changes: (+3 -0) DAGCombiner.cpp | 3 +++ 1 files changed, 3 insertions(+) Index: llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp diff -u llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp:1.52 llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp:1.53 --- llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp:1.52 Thu Oct 20 20:51:45 2005 +++ llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp Fri Oct 21 16:23:25 2005 @@ -2370,6 +2370,9 @@ // Canonicalize setgt X, Min --> setne X, Min if ((Cond == ISD::SETGT || Cond == ISD::SETUGT) && C1 == MinVal) return DAG.getSetCC(VT, N0, N1, ISD::SETNE); + // Canonicalize setlt X, Max --> setne X, Max + if ((Cond == ISD::SETLT || Cond == ISD::SETULT) && C1 == MaxVal) + return DAG.getSetCC(VT, N0, N1, ISD::SETNE); // If we have setult X, 1, turn it into seteq X, 0 if ((Cond == ISD::SETLT || Cond == ISD::SETULT) && C1 == MinVal+1) From bocchino at cs.uiuc.edu Fri Oct 21 16:33:25 2005 From: bocchino at cs.uiuc.edu (Robert Bocchino) Date: Fri, 21 Oct 2005 16:33:25 -0500 Subject: [llvm-commits] [vector_llvm] CVS: llvm/docs/SIMDCReference.txt VectorCReference.txt Message-ID: <200510212133.QAA26587@zion.cs.uiuc.edu> Changes in directory llvm/docs: SIMDCReference.txt added (r1.1.2.1) VectorCReference.txt added (r1.1.2.1) --- Log message: Initial commit of reference docs for Vector C and SIMD C backends. --- Diffs of the changes: (+588 -0) SIMDCReference.txt | 149 +++++++++++++++++ VectorCReference.txt | 439 +++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 588 insertions(+) Index: llvm/docs/SIMDCReference.txt diff -c /dev/null llvm/docs/SIMDCReference.txt:1.1.2.1 *** /dev/null Fri Oct 21 16:33:23 2005 --- llvm/docs/SIMDCReference.txt Fri Oct 21 16:33:13 2005 *************** *** 0 **** --- 1,149 ---- + SIMD C BACKEND REFERENCE + Vector LLVM + Rob Bocchino + October 21, 2005 + ======================== + + Overview + ======== + + Vector LLVM extends the LLVM C backend to provide rudimentary support + for SIMD (fixed vector) code generation on PowerPC/AltiVec and + Intel/SSE2, via the AltiVec and SSE2 C APIs supported by gcc. This + document describes the features and limitations of the AltiVec and + SSE2 code generators. Note that the limitations are considerable! + This is a research prototype and a work in progress. + + In the discusssion below, $(LLVMSRCDIR) means the "normal" (mainline) + LLVM top-level source directory, and $(VLLVMSRCDIR) means the + top-level source directory for Vector LLVM. + + Backend Source Code + =================== + + Instruction selection for AltiVec and SSE is done via the LLVM-to-LLVM + transformation passes opt -altivec and opt -sse, defined in + $(VLLVMSRCDIR)/lib/Transforms/Vector/AltiVec.cpp and SSE.cpp. These + passes perform pattern matching on Vector LLVM expressions written + with fixed vectors, and insert LLVM functions that can be written out + by the AltiVec and SSE C writers as C API functions, then fed through + gcc with the altivec or sse2 flag enabled. + + The AltiVec and SSE writers subclass the CWriter class defined in + $(LLVMSRCDIR)/lib/Target/CBackend/Writer.cpp in mainline LLVM. To + enable this, Vector LLVM pulls out the class definition for CWriter + into a separate file CWriter.h and makes some functions in CWriter + virtual, so they can be overridden by the SIMD backends. Otherwise, + the functionality of the C backend itself is unchanged (i.e., any + scalar LLVM code will be converted to C by the C backend in the same + way as in mainline LLVM). The SIMD backends themselves are defined in + TargetMachine and Writer files located in + $(VLLVMSRCDIR)/lib/Target/CBackend. They define options + -march=altivec-c and -march=sse-c that can be invoked with llc to + write out C code with gcc vector functions. + + Running the Backends + ==================== + + As an example, code generation for AltiVec (on a PowerPC platform) + might look like this, where foo.vectorc.c is a Vector C program (q.v.) + that uses fixed vectors: + + llvm-gcc -I$(VLLVMSRCDIR)/include/VectorC foo.vectorc.c -o foo + opt -raisevectors -altivec < foo.bc | llc -march=altivec-c \ + > foo.altivec.cbe.c + gcc -faltivec -O2 foo.cbe.c -o foo.altivec + + Code generation for SSE on X86 might look like this: + + llvm-gcc -I$(VLLVMSRCDIR)/include/VectorC foo.vectorc.c -o foo + opt -raisevectors -sse < foo.bc | llc -march=sse-c > foo.sse.cbe.c + gcc -msse2 -O2 foo.cbe.c -o foo.sse + + Note that the -altivec and -sse passes must be explicitly invoked + before the C backend passes. Setting up things + this way makes code generation easier to debug and develop; + unfortunately, it means that if the C backends are run on "raw" Vector + LLVM code (without the appropriate -altivec or -sse transformation + first), they will break. + + What Works + ========== + + Don't expect to run arbitrary Vector LLVM code through the code + generation process described above and have it work. Any legal Vector + LLVM code can be run through the -altivec or -sse passes to produce + more legal Vector LLVM (inapplicable constructs, such as variable + vectors, are just ignored). However, unless the result is in a form + that the AltiVec or SSE backend can understand, the backend will choke + when it tries to write out the C file. For example, if your Vector + LLVM program contains variable vectors, those vectors will be ignored + by the -altivec or -sse passes, but will cause the AltiVec or SSE C + writer to break. + + Ideally, there would be a pass that scalarizes any vector patterns + that cannot be pattern matched and code generated by the -sse and + -altivec passes, but I haven't written that pass yet. The point of + this experiment is to make high performance code, and I am not + interested in running code that I cannot vectorize anyway. The + following sections describe what patterns of code can be successfully + recognized and translated by the AltiVec and SSE code generators. + + Types + ----- + + The AltiVec and SSE2 writers understand the following vector types: + + 1. [vector of 4 int], [vector of 4 uint], [vector of 8 short], + [vector of 8 ushort], [vector of 16 sbyte], and + [vector of 16 ubyte]. + + 2. Pointers to the types listed in (1). + + In particular, this means you must block all loops manually on the + correct vector length. I do not yet have a pass that will take + variable (long) vectors and block them to fixed vectors. + + I have not tried to make arrays of vectors, put vectors in structs, + etc. Such code may work, but I haven't tried it. Any other vector + types (e.g., [vector of int] or [vector of 8 int]) will cause the + writers to break. Any legal LLVM type with no vectors in it is, of + course, allowed, and will be handled by the normal C backend. + + If your code is written with the types listed above only, and uses + patterns that the -altivec or -sse pass recognizes (as discussed + below), then it should go through the writer and produce correct code. + However, if your vector code uses patterns of operations that -altivec + or -sse passes cannot recognize, these passes can introduce types that + will break the writers. + + Instructions + ------------ + + fixed vimm + + You should be able to use any fixed vimm instruction with AltiVec or + SSE, so long as it generates one of the types listed above. Variable + vimm will not work. For AltiVec, a fixed vimm instruction becomes + either a cast (in the case of a constant) or an altivec_splat + intrinsic (in the case of a nonconstant). For SSE, a fixed vimm + becomes an _mm_splat macro, which expands to a _mm_set intrinsic. + + extract + + The AltiVec backend will convert the following pattern + + %lo = extract [vector of 16 sbyte] %val, uint 0, uint 1, uint 8 + %hi = extract [vecotr of 16 sbyte] %val, uint 8, uint 1, uint 8 + %unpklo = cast [vector of 16 sbyte] %lo to [vector of short] + %unpkhi = cast [vector of 16 sbyte] %hi to [vector of short] + + to the altivec_unpack_lo and altivec_unpack_hi intrinsics. This only + works for the types stated above, and it only works on AltiVec. + + combine + + vselect + + vsetcc + Index: llvm/docs/VectorCReference.txt diff -c /dev/null llvm/docs/VectorCReference.txt:1.1.2.1 *** /dev/null Fri Oct 21 16:33:25 2005 --- llvm/docs/VectorCReference.txt Fri Oct 21 16:33:13 2005 *************** *** 0 **** --- 1,439 ---- + VECTOR C REFERENCE + Vector LLVM + Rob Bocchino + October 20, 2005 + ================== + + Overview + ======== + + Vector C is an API that allows you to embed Vector LLVM instructions + in a C program compiled through llvm-gcc. (Without this API, we would + have to either write all the Vector LLVM by hand, or extend llvm-gcc + itself to support Vector LLVM.) The API is similar to the APIs for + AltiVec and SSE provided by gcc. It provides a set of C functions, + each of which corresponds to one or more (but at most a few) LLVM + values (usually instructions). The C functions are compiled to LLVM + functions by llvm-gcc, then converted to Vector LLVM instructions by + an LLVM transformation pass, opt -raisevectors. + + Using the API + ============= + + Let $(LLVMSRCDIR) equal the root of your LLVM source tree. To use the + API, put $(LLVMSRCDIR)/include/VectorC in your include path and put + #include "VectorC.h" in your source file. Write the program as + directed in the next section. Compile your program through llvm-gcc + to generate a bytecode file, say foo.vectorc.bc. Run the program + through opt -raisevectors (i.e., opt -raisevectors < foo.vectorc.bc > + foo.raised.bc). The result will be a program with the Vector C + functions replaced by the corresponding Vector LLVM instructions. The + raisevectors transformation is defined in + $(LLVMSRCDIR)/lib/Transforms/RaiseVector.cpp. + + Writing Vector C Programs + ========================= + + Writing Vector C code consists of writing vector source values (vector + loads or constants), using those values in vector operations, using + those uses in operations, etc., and finally storing values to memory. + Vector values are represented in C as scalar types and raised to + vectors in the LLVM representation according to the following simple + rule: a value is raised to a vector if and only if it is produced by a + Vector C function or at least one of its operands must be raised to a + vector. In vector LLVM, a vector type consists of an element type and + (for fixed vectors) a length. The element type is provided by the C + scalar type declaration. The programmer must supply the vector length + explicitly for vector loads, vector immediates, and fixed combine + instructions. Otherwise, the raise pass can infer the vector length + of the result (or the fact that the vector is variable, and has no + explicit length) from the length of the operands; the programmer need + only supply the scalar type. + + For example, consider the following C code, which uses fixed vectors: + + short x_vec = vllvm_load_short(x, 8, i); + short y_vec = vllvm_load_short(y, 8, i); + short a_vec = vllvm_fixed_vimm_short(a, 8); + short z_vec = a_vec * x_vec + y_vec; + vllvm_store_short(z_vec, z, i); + + The raise pass produces the following Vector LLVM code: + + %tmp0 = cast short* %x to [vector of 8 short] + %tmp1 = getelementptr [vector of 8 short]* %tmp0, int %i + %x_vec = load [vector of 8 short]* %tmp1 + %tmp2 = cast short *%y to [vector of 8 short] + %tmp3 = getelementptr [vector of 8 short]* %tmp2, int %i + %y_vec = load [vector of 8 short]* %tmp3 + %a_vec = fixed vimm short %a, uint 8 + %tmp4 = mul [vector of 8 short] %x_vec, %a_vec + %z_vec = add [vector of 8 short] %tmp4, %y_vec + %tmp6 = cast short* %z to [vector of 8 short]* + %tmp7 = getelementptr [vector of 8 short]* %cast1, int %i + store [vector of 8 short] %z_vec, [vector of 8 short]* %tmp7 + + The type [vector of 8 short] is specified explicitly for the load and + vimm instructions (through the C type short and the argument 8), and + propagated to the other instructions by the chain of defs and uses. + + Note that the vector source values must all be Vector C functions, but + the operations may be either Vector C functions or normal scalar C + operations (as in the above example, where we have used the normal C + operators * and +). In the case of normal C operations, the raise + pass will see that the operands are vectors and raise the operation to + a vector operation. It is illegal, however, to attempt to combine + scalar and vector values. For example, the following would be + illegal: + + short x_vec = vllvm_load_short(x, 8, i); + short y_vec = 2 * x_vec; + + Instead, we must write + + short x_vec = vllvm_load_short(x, 8, i); + short y_vec = vllvm_vimm_short(2, 8) * x_vec; + + Note also that the types must match. If we write + + short x_vec = vllvm_load_short(x, 8, i); + short y_vec = vllvm_vimm_short(2, 16) * x_vec; + + then the raise pass will crash horribly. + + API Reference + ============= + + The following reference describes the functions making up the Vector C + API. It uses the following conventions: + + * CTYPE is one of the C scalar types { char, unsigned uchar (uchar), + short, unsigned short (ushort), int, unsigned int (uint), long, + unsigned long (ulong), float, double }, where the types in + parentheses are optional shorter forms (defined via typedef). + + * LLVMTYPE is one of { sbyte, ubyte, short, ushort, int, uint, long, + ulong, float, double }. + + * If CTYPE is the nth C type listed above, then LLVMTYPE is the nth + LLVM type listed above. + + * CTYPE~ means CTYPE with any spaces replaced by _. For instance, if + CTYPE = unsigned int, then CTYPE~ = unsigned_int. Note that for + the shorter forms (such as uint), CTYPE~ = CTYPE. The shorter + forms are also easier to type and help the API function names from + getting unduly long. + + All function declarations in the API follow the pattern + vllvm_OP-NAME_CTYPE~, where FN-NAME is the name of the operation + (which usually corresponds to a Vector LLVM instruction or intrinsic). + + vllvm_vimm_CTYPE~ + ----------------- + + Purpose: Produce a vimm instruction + + C Declaration: CTYPE vllvm_vimm_CTYPE~(CTYPE, uint) + + C Use: CTYPE res = vllvm_vimm_CTYPE~(val, len) + + Raised To: %res = vimm LLVMTYPE %val, uint len + + Notes: vllvm_vloadi_CTYPE~ is also allowed, for compatibility with an + older form of this instruction. + + vllvm_fixed_vimm_CTYPE~ + ----------------------- + + Purpose: Produce a fixed vimm instruction + + C Declaration: CTYPE vllvm_fixed_vimm_CTYPE~(CTYPE val, uint len) + + C Use: CTYPE res = vllvm_fixed_vimm_CTYPE~(val, len) + + Raised To: %res = fixed vimm LLVMTYPE %val, uint %len + + Notes: len must be a constant, otherwise the raise pass will crash. + + vllvm_vgather_CTYPE~ + -------------------- + + Purpose: Produce a vgather instruction + + C Declaration: CTYPE vllvm_vgather_CTYPE~(const CTYPE*, ...) + + C Use: CTYPE res = vllvm_vgather_CTYPE~(ptr, start, end, stride, mult) + + Raised To: %res = vgather LLVMTYPE* %ptr, long %start, long %end, long + %stride, long %mult + + Notes: An arbitrary number of (start, end, stride, mult) groups are + allowed, and the values must be integers. If the arguments do + not follow this pattern, the raise pass will crash. + + vllvm_vload_CTYPE~ is also allowed, for compatibility with an + older form of this instruction. + + vllvm_vscatter_CTYPE~ + --------------------- + + Purpose: Produce a vscatter instruction + + C Declaration: void vllvm_vscatter_CTYPE~(CTYPE, CTYPE*, ...) + + C Use: vllvm_vscatter_CTYPE~(val, ptr, start, end, stride, mult) + + Raised To: vscatter [vector of LLVMTYPE] %val, LLVMTYPE* %ptr, long + %start, long %end, long %stride, long %mult + + Notes: An arbitrary number of (start, end, stride, mult) groups are + allowed, and the values must be integers. If the arguments do + not follow this pattern, the raise pass will crash. + + vllvm_vstore_CTYPE~ is also allowed, for compatibility with an + older form of this instruction. + + vllvm_load_CTYPE~ + ----------------- + + Purpose: Produce a vector load instruction for a specified pointer and + offset. + + C Declaration: CTYPE vllvm_load_CTYPE~(const CTYPE*, uint, int) + + C Use: CTYPE res = vllvm_load_CTYPE~(ptr, len, idx) + + Raised To: %tmp0 = cast LLVMTYPE* %ptr to [vector of len LLVMTYPE]* + %tmp1 = getelementptr [vector of len LLVMTYPE]* %tmp0, + int %idx + %res = load [vector of len LLVMTYPE]* %tmp1 + + vllvm_store_CTYPE~ + ------------------ + + Purpose: Produce a vector store instruction for a specified value, + pointer, and offset. + + C Declaration: void vllvm_store_CTYPE~(CTYPE, CTYPE*, int) + + C Use: vllvm_store_CTYPE~(val, ptr, idx) + + Raised To: %tmp0 = cast LLVMTYPE* %ptr to [vector of len LLVMTYPE]* + %tmp1 = getelementptr [vector of len LLVMTYPE]* %tmp0, + int %idx + store LLVMTYPE %val, [vector of len LLVMTYPE]* %tmp1 + + vllvm_vselect_CTYPE~ + -------------------- + + Purpose: Produce a vselect instruction. + + C Declaration: CTYPE vllvm_vselect_CTYPE~(int, CTYPE, CTYPE) + + C Use: CTYPE res = vllvm_vselect_CTYPE~(mask, val1, val2) + + Raised To: %res = vselect [vector of bool] %mask, TY %val1, TY %val2 + + where TY = [vector of LLVMTYPE] or [vector of n LLVMTYPE], + and the type is inferred from the instructions producing + %val1 and %val2. + + Notes: If %val1 and %val2 have incompatible lengths (i.e., are not + both variable vectors or both fixed vectors with the same + length), the raise pass will crash. + + vllvm_extract_CTYPE~ + -------------------- + + Purpose: Produce an extract instruction. + + C Declaration: CTYPE vllvm_extract_CTYPE~(CTYPE, unsigned, unsigned, + unsigned) + + C Use: CTYPE res = vllvm_extract_CTYPE~(val, start, stride, len) + + Raised To: %res = extract TY %val, uint %start, uint %stride, + uint %len + + where TY = [vector of LLVMTYPE] or [vector of n LLVMTYPE], + and the type is inferred from the instruction producing + %val + + Notes: In Vector LLVM currently, the result type of the extract is a + fixed vector if and only if TY is a fixed vector and len is a + constant. We will probably add a fixed extract (like fixed + vimm) and a corresponding vimm_fixed_extract_CTYPE~ function. + + vllvm_combine_CTYPE~ + -------------------- + + Purpose: Produce a combine instruction of variable vector type. + + C Declaration: CTYPE vllvm_combine_CTYPE~(CTYPE, CTYPE, unsigned, + unsigned) + + C Use: CTYPE res = vllvm_combine_CTYPE~(val1, val2, start, stride) + + Raised To: %res = combine [vector of LLVMTYPE] %val1, [vector of + LLVMTYPE] %val2, uint %start, uint %stride + + Notes: %val1 and %val2 must be variable vectors; otherwise the raise + pass will crash. For fixed vectors, use fixed_combine. + + vllvm_fixed_combine_CTYPE~ + -------------------------- + + Purpose: Produce a combine instruction of fixed vector type. + + C Declaration: CTYPE vllvm_fixed_combine_CTYPE~(CTYPE, unsigned, CTYPE, + unsigned, unsigned, unsigned) + + C Use: CTYPE res = vllvm_fixed_combine_CTYPE~(val1, len1, val2, len2, + start, stride) + + Raised To: %res = combine [vector of len1 LLVMTYPE] %val1, [vector of + len2 LLVMTYPE] %val2, uint %start, uint %stride + + except that len1 and len2 may both be 0, in which case + %val1 and %val2 are both raised to [vector of LLVMTYPE] + (i.e., this function behaves like combine when len1 = len2 + = 0). + + Notes: %val1 and %val2 must have compatible lengths, otherwise the + raise pass will crash + + vllvm_extractelement_CTYPE~ + --------------------------- + + Purpose: Produce an extractelement instruction. + + C Declaration: CTYPE vllvm_extractelement_CTYPE~(CTYPE, unsigned) + + C Use: CTYPE res = vllvm_extractelement_CTYPE~(val, idx) + + Raised To: %res = extractelement TY %val, uint idx + + where TY = [vector of LLVMTYPE] or [vector of n LLVMTYPE], + depending on the type to which %val is raised + + vllvm_combineelement_CTYPE~ + --------------------------- + + Purpose: Produce a combineelement instruction. + + C Declaration: CTYPE vllvm_combineelement_CTYPE~(CTYPE, CTYPE, + unsigned) + + C Use: CTYPE res = vllvm_combineelement_CTYPE~(val, elt, idx) + + Raised To: %res = combineelement TY %val, LLVMTYPE elt, uint idx + + where TY = [vector of LLVMTYPE] or [vector of n LLVMTYPE], + depending on the type to which %val is raised + + vllvm_constant_CTYPE~ + --------------------- + + Purpose: Produce a vector constant. + + C Declaration: CTYPE vllvm_constant_CTYPE~(CTYPE,...) + + C Use: vllvm_constant_CTYPE~(val1, val2, ... valn) + + Raised To: + + vllvm_permute_CTYPE~ + -------------------- + + Purpose: Produce a permute intrinsic with variable vector type. + + C Declaration: CTYPE vllvm_permute_CTYPE~(CTYPE, unsigned, + CTYPE, unsigned) + + C Use: CTYPE res = vllvm_permute_CTYPE~(val, val_len, idx, + idx_len) + + Raised To: %res = call %permute_CTYPE~_vector([vector of LLVMTYPE] + %val, [vector of LLVMTYPE] %idx) + + Notes: This function is raised to an LLVM function with vector + arguments (rather than an LLVM instruction) because there is + not yet an LLVM instruction for permute. + + vllvm_fixed_permute_CTYPE~ + -------------------------- + + Purpose: Produce a permute intrinsic with fixed vector type. + + C Declaration: CTYPE vllvm_fixed_permute_CTYPE~(CTYPE, unsigned, + CTYPE, unsigned) + + C Use: CTYPE res = vllvm_fixed_permute_CTYPE~(val, val_len, idx, + idx_len) + + Raised To: %res = call %fixed_permute_CTYPE~_vector([vector of val_len + LLVMTYPE] %val, [vector of idx_len LLVMTYPE] %idx) + + Notes: The result type is [vector of idx_len LLVMTYPE] + + This function is raised to an LLVM function with vector + arguments (rather than an LLVM instruction) because there is + not yet an LLVM instruction for permute. + + Extending the API + ================= + + The API is easy to extend in two ways: + + 1. Add a new type for an existing Vector C function. If your program + has renamed a scalar type foo (e.g. typedef foo int), and you want + to use the Vector C functions on vectors of foo, you can declare a + function vllvm_OP-NAME_foo, following the pattern given above for + OP-NAME. As long as OP-NAME and the pattern of parameter types is + legal, the raise pass will correctly raise the function. This is + useful, e.g., in media benchmarks, which often have + platform-specific typedefs for basic types. + + 2. Add a new Vector C intrinsic. vllvm_permute and + vllvm_fixed_permute provide examples of how to do this. Simply + declare a function vllvm_NAME, where NAME is any intrinsic name you + want (and can include any type mangling, such as CTYPE~). Whenever + this function is used with an argument that has been raised to a + vector type, the entire function will be raised to + vllvm_NAME_vector, with all non-constant arguments replaced by + vectors. Constant arguments remain scalars. Thus + vllvm_foo_int(int x, int y) is raised to + + %vllvm_foo_int_vector([vector of int] %x, [vector of int] + %y) + + if called with arguments that are raised to [vector of int], while + it is raised to + + %vllvm_foo_int_vector([vector of int] %x, int %y) + + if called with first argument that is raised to [vector of int] and + second argument a constant scalar. The raise pass will break if a + vllvm_... function is called with one vector argument and another + variable argument that is not a vector, or if any function that + does not begin with vllvm_... is called with a vector argument. + + Limitations + ----------- + + * You must run mem2reg (normally run automatically by llvm-gcc) + before the raise pass. Any loads and stores of scalar values that + are to be raised (other than vector loads and stores indicated with + Vector C function calls) will break the pass. + + * There is currently no way to represent passing vectors to functions + or returning vectors from functions in Vector C (although these + operations are supported in Vector LLVM). + + * As indicated above, the raise pass is not very robust to errors. + It sometimes gives meaningful error messages, but mostly just + breaks when the Vector C program is incorrect. For example, if the + two operands of an add instruction are raised to different vector + types, the raise pass will crash and assert something not + particularly helpful -- for instance, that an illegal add + instruction was created or illegal ReplaceAllUses was performed. From bocchino at persephone.cs.uiuc.edu Fri Oct 21 16:37:25 2005 From: bocchino at persephone.cs.uiuc.edu (Robert L. Bocchino Jr.) Date: Fri, 21 Oct 2005 16:37:25 -0500 (CDT) Subject: [llvm-commits] [vector_llvm] CVS: llvm/docs/SIMDCReference.txt VectorCReference.txt Message-ID: <20051021213725.3C16817DD382@persephone.cs.uiuc.edu> Changes in directory llvm/docs: SIMDCReference.txt updated: 1.1.2.1 -> 1.1.2.2 VectorCReference.txt updated: 1.1.2.1 -> 1.1.2.2 --- Log message: Updated versions of SIMD and Vector C reference docs. --- Diffs of the changes: (+164 -36) SIMDCReference.txt | 186 +++++++++++++++++++++++++++++++++++++++++++-------- VectorCReference.txt | 14 +-- 2 files changed, 164 insertions, 36 deletions Index: llvm/docs/SIMDCReference.txt diff -u llvm/docs/SIMDCReference.txt:1.1.2.1 llvm/docs/SIMDCReference.txt:1.1.2.2 --- llvm/docs/SIMDCReference.txt:1.1.2.1 Fri Oct 21 16:33:13 2005 +++ llvm/docs/SIMDCReference.txt Fri Oct 21 16:37:00 2005 @@ -25,11 +25,11 @@ transformation passes opt -altivec and opt -sse, defined in $(VLLVMSRCDIR)/lib/Transforms/Vector/AltiVec.cpp and SSE.cpp. These passes perform pattern matching on Vector LLVM expressions written -with fixed vectors, and insert LLVM functions that can be written out +with fixed vectors and insert LLVM functions that can be written out by the AltiVec and SSE C writers as C API functions, then fed through gcc with the altivec or sse2 flag enabled. -The AltiVec and SSE writers subclass the CWriter class defined in +The AltiVec and SSE C writers subclass the CWriter class defined in $(LLVMSRCDIR)/lib/Target/CBackend/Writer.cpp in mainline LLVM. To enable this, Vector LLVM pulls out the class definition for CWriter into a separate file CWriter.h and makes some functions in CWriter @@ -40,7 +40,7 @@ TargetMachine and Writer files located in $(VLLVMSRCDIR)/lib/Target/CBackend. They define options -march=altivec-c and -march=sse-c that can be invoked with llc to -write out C code with gcc vector functions. +write out C code with gcc intrinsics. Running the Backends ==================== @@ -67,15 +67,15 @@ LLVM code (without the appropriate -altivec or -sse transformation first), they will break. -What Works -========== +Code Generation Capabilities +============================ Don't expect to run arbitrary Vector LLVM code through the code generation process described above and have it work. Any legal Vector LLVM code can be run through the -altivec or -sse passes to produce more legal Vector LLVM (inapplicable constructs, such as variable vectors, are just ignored). However, unless the result is in a form -that the AltiVec or SSE backend can understand, the backend will choke +that the AltiVec or SSE writer can understand, the writer will choke when it tries to write out the C file. For example, if your Vector LLVM program contains variable vectors, those vectors will be ignored by the -altivec or -sse passes, but will cause the AltiVec or SSE C @@ -102,48 +102,178 @@ In particular, this means you must block all loops manually on the correct vector length. I do not yet have a pass that will take -variable (long) vectors and block them to fixed vectors. +variable (long) vectors and block them to fixed vectors. In what +follows (and in the source code), I refer to the types listed above as +"proper types" for AltiVec and SSE. I have not tried to make arrays of vectors, put vectors in structs, etc. Such code may work, but I haven't tried it. Any other vector -types (e.g., [vector of int] or [vector of 8 int]) will cause the -writers to break. Any legal LLVM type with no vectors in it is, of -course, allowed, and will be handled by the normal C backend. - -If your code is written with the types listed above only, and uses -patterns that the -altivec or -sse pass recognizes (as discussed -below), then it should go through the writer and produce correct code. -However, if your vector code uses patterns of operations that -altivec -or -sse passes cannot recognize, these passes can introduce types that -will break the writers. +types (e.g., [vector of int], [vector of 8 int], or any sort of vector +of float) will cause the writers to break. Any legal LLVM type with +no vectors in it is, of course, allowed, and will be handled by the +normal C backend. Instructions ------------ +Unless otherwise stated, the types given in the examples below are for +illustration only. The types must follow the given pattern, but need +not be exactly as stated. For example, a code example given with +types [vector of 8 short] and [vector of 16 sbyte] should also work +with [vector of 4 int] and [vector of 8 short]. + +load and store + +The AltiVec and SSE backends will correctly translate loads and stores +from/to pointers of proper type. + fixed vimm + +You can use any fixed vimm instruction with AltiVec or SSE, so long as +it generates a proper type. Variable vimm will not work. For +AltiVec, a fixed vimm instruction becomes either a cast (in the case +of a constant) or an altivec_splat intrinsic (in the case of a +nonconstant). For SSE, a fixed vimm becomes an _mm_splat macro, which +expands to a _mm_set intrinsic. + +Arithmetic Operators + +The AltiVec backend will generate altivec_add, altivec_mul, and +altivec_sub intrinsics from the corresponding Vector LLVM +instructions, so long as the types are not promoted. The SSE backend +has better support for type promotion (because it has fewer complex +instructions like mradds). It will generate _mm_add, _mm_mullo, and +_mm_sub correctly even if the types are promoted. For example, + + %tmp1 = cast [vector of 8 short] %op1 to [vector of 8 int] + %tmp2 = cast [vector of 8 short] %op2 to [vector of 8 int] + %tmp3 = mul [vector of 8 int] %tmp1, %tmp2 + +yields two values + + tmp3a = _mm_mulhi_epi16(op1, op2) + tmp3b = _mm_mullo_epi16(op1, op2) + +which are propagated to the uses of %tmp3. Eventually, if a produced +[vector of 8 int] value is cast back to [vector of 8 short], the two +values are merged back into one. However, this merging is only partly +implemented in the opt -sse pass. For now, only multiplication +followed by addition of a constant is supported (as in AltiVec +mradds). If you write code that causes two values to be produced, but +the code generator doesn't know how to merge them, your program will +break. It should be straightforward to generalize this merging +process. + +For AltiVec only, the backend recognizes the following as mladd(op1, +op2, op3), + + %tmp1 = mul [vector of 8 short] %op1, %op2 + %tmp2 = add [vector of 8 short] %tmp1, %op3 + +it will generate mradd(op1, op2, 0) if it sees the following, + + %tmp1 = cast [vector of 8 short] %op1 to [vector of 8 uint] + %tmp3 = cast [vector of 8 short] %op2 to [vector of 8 uint] + %tmp4 = mul [vector of 8 uint] %tmp1, %tmp3 + %tmp8 = shr [vector of 8 uint] %tmp7, ubyte 15 + %tmp9 = cast [vector of 8 uint] %tmp8 to [vector of 8 short] + +and it recognizes the following monstrous pattern as +altivec_mradds(op1, op2, op3) + + %tmp1 = cast [vector of 8 short] %op1 to [vector of 8 uint] + %tmp3 = cast [vector of 8 short] %op2 to [vector of 8 uint] + %tmp4 = mul [vector of 8 uint] %tmp1, %tmp3 + %tmp5 = fixed vimm short 16384, uint 8 + %tmp6 = cast [vector of 8 short] %tmp5 to [vector of 8 uint] + %tmp7 = add [vector of 8 uint] %tmp4, %tmp6 + %tmp8 = shr [vector of 8 uint] %tmp7, ubyte 15 + %tmp9 = cast [vector of 8 uint] %tmp8 to [vector of 8 short] + %res = call [vector of 8 short] %vllvm_adds_short_vector([vector + of 8 short] %tmp9, [vector of 8 short] %op3) + +Logical Operators -You should be able to use any fixed vimm instruction with AltiVec or -SSE, so long as it generates one of the types listed above. Variable -vimm will not work. For AltiVec, a fixed vimm instruction becomes -either a cast (in the case of a constant) or an altivec_splat -intrinsic (in the case of a nonconstant). For SSE, a fixed vimm -becomes an _mm_splat macro, which expands to a _mm_set intrinsic. +Currently, only LLVM and is supported. It becomes altivec_and on +AltiVec and _mm_and on SSE. +vselect + +The AltiVec backend will convert a Vector LLVM vselect instruction to +altivec_sel. The SSE backend will synthesize a vector select using +logical operations (SSE does not provide a native select instruction). + +Conditional Operators (vsetcc) + +The AltiVec backend will convert a Vector LLVM vsetgt instruction to +altivec_cmpgt. The SSE backend will convert vsetgt to _mm_cmpgt. It +is straightforward to extend this to the other vsetcc instructions, +but I haven't done this yet. + +Shift Operators + +The AltiVec backend will convert a Vector LLVM shl instruction to +altivec_sll. It will convert a shr instruction to altivec_sra if the +type is signed and altivec_srl if the type is unsigned. The SSE +backend does the same thing, using the intrinsics _mm_slli, _mm_slli, +and _mm_srai. + extract The AltiVec backend will convert the following pattern %lo = extract [vector of 16 sbyte] %val, uint 0, uint 1, uint 8 - %hi = extract [vecotr of 16 sbyte] %val, uint 8, uint 1, uint 8 + %hi = extract [vector of 16 sbyte] %val, uint 8, uint 1, uint 8 %unpklo = cast [vector of 16 sbyte] %lo to [vector of short] %unpkhi = cast [vector of 16 sbyte] %hi to [vector of short] -to the altivec_unpack_lo and altivec_unpack_hi intrinsics. This only -works for the types stated above, and it only works on AltiVec. +to altivec_unpack_lo and altivec_unpack_hi. This only works for the +types stated above, and it only works on AltiVec. combine -vselect +The AltiVec backend will convert the following pattern -vsetcc + %tmp1 = combine [vector of 16 short] %tmp0, [vector of 8 short] %hi, + uint 0, uint 1 + %tmp2 = combine [vector of 16 short], %tmp1 [vector of 8 short] %lo, + uint 8, uint 1 + %res = cast [vector of 16 short] %tmp2 to [vector of 16 sbyte] + +to altivec_pack. The SSE backend will synthesize an unsaturated pack +(using the SSE saturated pack intrinsic _mm_packs) for signed values +only. + +For AltiVec only, if a vllvm_saturate intrinsic is used instead of the +cast, the result will be altivec_packsu. You can also use a +vllvm_fixed_permute instead of the cast, in which case you will get +altivec_perm. + +The AltiVec backend will also convert the following pattern + + %tmp1 = combine [vector of 16 short] %tmp0, [vector of 8 short] %hi, + uint 0, uint 1 + %tmp2 = combine [vector of 16 short] %tmp1, [vector of 8 short] %lo, + uint 8, uint 1 + %hi = extract [vector of 16 short] %tmp1, uint 0, uint 2, uint 8 + %lo = extract [vector of 16 short] %tmp2, uint 1, uint 2, uint 8 + +to altivec_mergeh and altivec_mergel. The SSE backend will convert +this pattern to _mm_unpackhi and _mm_unpacklo. + +Explicit Intrinsics +------------------- + +You can use any AltiVec or SSE intrinsic by declaring and using the +function vllvm_NAME_CTYPE~, where NAME is the name of the altivec +intrinsic (without the altivec or _mm_ prefix, and without any SSE +suffix such as _epi16) and CTYPE~ follows the convention for type +mangling explained in the Vector C documentation (in fact, the exact +CTYPE~ convention is not required, but some name mangling for the +different types is). Doing this makes the program non-portable, but +it allows you to write AltiVec or SSE programs that are not supported +by the code generators (in essence doing hand instruction selection +for AltiVec or SSE). You can then migrate the AltiVec or SSE +intrinsics to the more portable Vector LLVM constructs as the code +generators improve. Index: llvm/docs/VectorCReference.txt diff -u llvm/docs/VectorCReference.txt:1.1.2.1 llvm/docs/VectorCReference.txt:1.1.2.2 --- llvm/docs/VectorCReference.txt:1.1.2.1 Fri Oct 21 16:33:13 2005 +++ llvm/docs/VectorCReference.txt Fri Oct 21 16:37:00 2005 @@ -1,5 +1,4 @@ VECTOR C REFERENCE -Vector LLVM Rob Bocchino October 20, 2005 ================== @@ -79,7 +78,7 @@ Note that the vector source values must all be Vector C functions, but the operations may be either Vector C functions or normal scalar C -operations (as in the above example, where we have used the normal C +operations (as in the example above, where we have used the normal C operators * and +). In the case of normal C operations, the raise pass will see that the operands are vectors and raise the operation to a vector operation. It is illegal, however, to attempt to combine @@ -104,8 +103,8 @@ API Reference ============= -The following reference describes the functions making up the Vector C -API. It uses the following conventions: +The following reference describes the functions comprising the Vector +C API. It uses the following conventions: * CTYPE is one of the C scalar types { char, unsigned uchar (uchar), short, unsigned short (ushort), int, unsigned int (uint), long, @@ -125,7 +124,7 @@ getting unduly long. All function declarations in the API follow the pattern -vllvm_OP-NAME_CTYPE~, where FN-NAME is the name of the operation +vllvm_OP-NAME_CTYPE~, where OP-NAME is the name of the operation (which usually corresponds to a Vector LLVM instruction or intrinsic). vllvm_vimm_CTYPE~ @@ -404,13 +403,12 @@ vectors. Constant arguments remain scalars. Thus vllvm_foo_int(int x, int y) is raised to - %vllvm_foo_int_vector([vector of int] %x, [vector of int] - %y) + %vllvm_foo_int_vector([vector of int] %x, [vector of int] %y) if called with arguments that are raised to [vector of int], while it is raised to - %vllvm_foo_int_vector([vector of int] %x, int %y) + %vllvm_foo_int_vector([vector of int] %x, int %y) if called with first argument that is raised to [vector of int] and second argument a constant scalar. The raise pass will break if a From lattner at cs.uiuc.edu Fri Oct 21 17:15:54 2005 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Fri, 21 Oct 2005 17:15:54 -0500 Subject: [llvm-commits] CVS: llvm/lib/Target/PowerPC/PPC.td Message-ID: <200510212215.RAA26851@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/PowerPC: PPC.td updated: 1.4 -> 1.5 --- Log message: 64-bit reg support should not be enabled by default, as support isn't complete. --- Diffs of the changes: (+2 -2) PPC.td | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) Index: llvm/lib/Target/PowerPC/PPC.td diff -u llvm/lib/Target/PowerPC/PPC.td:1.4 llvm/lib/Target/PowerPC/PPC.td:1.5 --- llvm/lib/Target/PowerPC/PPC.td:1.4 Fri Oct 21 14:02:44 2005 +++ llvm/lib/Target/PowerPC/PPC.td Fri Oct 21 17:15:43 2005 @@ -57,12 +57,12 @@ def : Processor<"750", G3Itineraries, []>; def : Processor<"970", G5Itineraries, [FeatureAltivec, FeatureGPUL, FeatureFSqrt, - Feature64Bit, Feature64BitRegs]>; + Feature64Bit /*, Feature64BitRegs*/]>; def : Processor<"g4", G4Itineraries, [FeatureAltivec]>; def : Processor<"g4+", G4PlusItineraries, [FeatureAltivec]>; def : Processor<"g5", G5Itineraries, [FeatureAltivec, FeatureGPUL, FeatureFSqrt, - Feature64Bit, Feature64BitRegs]>; + Feature64Bit /*, Feature64BitRegs*/]>; def : Processor<"generic", G3Itineraries, []>; From jlaskey at apple.com Sat Oct 22 03:00:14 2005 From: jlaskey at apple.com (Jim Laskey) Date: Sat, 22 Oct 2005 03:00:14 -0500 Subject: [llvm-commits] CVS: llvm/utils/TableGen/SubtargetEmitter.cpp Message-ID: <200510220800.DAA28976@zion.cs.uiuc.edu> Changes in directory llvm/utils/TableGen: SubtargetEmitter.cpp updated: 1.1 -> 1.2 --- Log message: Sort the features and processor lists for the sake of search (and maintainers.) --- Diffs of the changes: (+27 -2) SubtargetEmitter.cpp | 29 +++++++++++++++++++++++++++-- 1 files changed, 27 insertions(+), 2 deletions(-) Index: llvm/utils/TableGen/SubtargetEmitter.cpp diff -u llvm/utils/TableGen/SubtargetEmitter.cpp:1.1 llvm/utils/TableGen/SubtargetEmitter.cpp:1.2 --- llvm/utils/TableGen/SubtargetEmitter.cpp:1.1 Fri Oct 21 14:00:04 2005 +++ llvm/utils/TableGen/SubtargetEmitter.cpp Sat Oct 22 02:59:56 2005 @@ -20,17 +20,42 @@ #include using namespace llvm; -// Convenience types +// +// Convenience types. +// typedef std::vector RecordList; typedef std::vector::iterator RecordListIter; +// +// Record sort by name function. +// +struct LessRecord { + bool operator()(const Record *Rec1, const Record *Rec2) const { + return Rec1->getName() < Rec2->getName(); + } +}; +// +// Record sort by field "Name" function. +// +struct LessRecordFieldName { + bool operator()(const Record *Rec1, const Record *Rec2) const { + return Rec1->getValueAsString("Name") < Rec2->getValueAsString("Name"); + } +}; + + +// // SubtargetEmitter::run - Main subtarget enumeration emitter. // void SubtargetEmitter::run(std::ostream &OS) { EmitSourceFileHeader("Subtarget Enumeration Source Fragment", OS); + RecordList Features = Records.getAllDerivedDefinitions("SubtargetFeature"); + sort(Features.begin(), Features.end(), LessRecord()); + RecordList Processors = Records.getAllDerivedDefinitions("Processor"); + sort(Processors.begin(), Processors.end(), LessRecordFieldName()); OS << "namespace llvm {\n\n"; @@ -70,7 +95,7 @@ OS << "};\n"; } - { // Feature key values + { // CPU key values OS << "\n\n" << "/// Sorted (by key) array of values for CPU subtype.\n" << "static const SubtargetFeatureKV SubTypeKV[] = {\n"; From jlaskey at apple.com Sat Oct 22 03:04:36 2005 From: jlaskey at apple.com (Jim Laskey) Date: Sat, 22 Oct 2005 03:04:36 -0500 Subject: [llvm-commits] CVS: llvm/lib/Target/PowerPC/PPC.td Message-ID: <200510220804.DAA28998@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/PowerPC: PPC.td updated: 1.5 -> 1.6 --- Log message: Add g3 back to the mix and reorder to irritate them anal folk. Actually, it's to group appropriately and provide cues to maintainers that the lists don't need to be ordered. --- Diffs of the changes: (+10 -9) PPC.td | 19 ++++++++++--------- 1 files changed, 10 insertions(+), 9 deletions(-) Index: llvm/lib/Target/PowerPC/PPC.td diff -u llvm/lib/Target/PowerPC/PPC.td:1.5 llvm/lib/Target/PowerPC/PPC.td:1.6 --- llvm/lib/Target/PowerPC/PPC.td:1.5 Fri Oct 21 17:15:43 2005 +++ llvm/lib/Target/PowerPC/PPC.td Sat Oct 22 03:04:24 2005 @@ -26,7 +26,7 @@ //===----------------------------------------------------------------------===// -// PowerPC Subtarget features (sorted by name). +// PowerPC Subtarget features. // def Feature64Bit : SubtargetFeature<"64bit", @@ -35,15 +35,16 @@ "Should 64 bit registers be used">; def FeatureAltivec : SubtargetFeature<"altivec", "Should Altivec instructions be used">; -def FeatureFSqrt : SubtargetFeature<"fsqrt", - "Should the fsqrt instruction be used">; def FeatureGPUL : SubtargetFeature<"gpul", "Should GPUL instructions be used">; +def FeatureFSqrt : SubtargetFeature<"fsqrt", + "Should the fsqrt instruction be used">; //===----------------------------------------------------------------------===// -// PowerPC chips sets supported (sorted by name) +// PowerPC chips sets supported. // +def : Processor<"generic", G3Itineraries, []>; def : Processor<"601", G3Itineraries, []>; def : Processor<"602", G3Itineraries, []>; def : Processor<"603", G3Itineraries, []>; @@ -52,18 +53,18 @@ def : Processor<"604", G3Itineraries, []>; def : Processor<"604e", G3Itineraries, []>; def : Processor<"620", G3Itineraries, []>; +def : Processor<"g3", G3Itineraries, []>; def : Processor<"7400", G4Itineraries, [FeatureAltivec]>; +def : Processor<"g4", G4Itineraries, [FeatureAltivec]>; def : Processor<"7450", G4PlusItineraries, [FeatureAltivec]>; +def : Processor<"g4+", G4PlusItineraries, [FeatureAltivec]>; def : Processor<"750", G3Itineraries, []>; def : Processor<"970", G5Itineraries, [FeatureAltivec, FeatureGPUL, FeatureFSqrt, - Feature64Bit /*, Feature64BitRegs*/]>; -def : Processor<"g4", G4Itineraries, [FeatureAltivec]>; -def : Processor<"g4+", G4PlusItineraries, [FeatureAltivec]>; + Feature64Bit /*, Feature64BitRegs */]>; def : Processor<"g5", G5Itineraries, [FeatureAltivec, FeatureGPUL, FeatureFSqrt, - Feature64Bit /*, Feature64BitRegs*/]>; -def : Processor<"generic", G3Itineraries, []>; + Feature64Bit /*, Feature64BitRegs */]>; def PPC : Target { From lattner at cs.uiuc.edu Sat Oct 22 13:50:26 2005 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sat, 22 Oct 2005 13:50:26 -0500 Subject: [llvm-commits] CVS: llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp Message-ID: <200510221850.NAA07942@zion.cs.uiuc.edu> Changes in directory llvm/lib/CodeGen/SelectionDAG: DAGCombiner.cpp updated: 1.53 -> 1.54 --- Log message: BuildSDIV and BuildUDIV only work for i32/i64, but they don't check that the input is that type, this caused a failure on gs on X86 last night. Move the hard checks into Build[US]Div since that is where decisions like this should be made. --- Diffs of the changes: (+20 -10) DAGCombiner.cpp | 30 ++++++++++++++++++++---------- 1 files changed, 20 insertions(+), 10 deletions(-) Index: llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp diff -u llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp:1.53 llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp:1.54 --- llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp:1.53 Fri Oct 21 16:23:25 2005 +++ llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp Sat Oct 22 13:50:15 2005 @@ -817,9 +817,9 @@ // if integer divide is expensive and we satisfy the requirements, emit an // alternate sequence. if (N1C && (N1C->getSignExtended() < -1 || N1C->getSignExtended() > 1) && - !TLI.isIntDivCheap() && - TLI.isOperationLegal(ISD::MULHS, VT) && TLI.isTypeLegal(VT)) { - return BuildSDIV(N); + !TLI.isIntDivCheap()) { + SDOperand Op = BuildSDIV(N); + if (Op.Val) return Op; } return SDOperand(); } @@ -841,9 +841,11 @@ DAG.getConstant(Log2_64(N1C->getValue()), TLI.getShiftAmountTy())); // fold (udiv x, c) -> alternate - if (N1C && N1C->getValue() && TLI.isOperationLegal(ISD::MULHU, VT) && - TLI.isTypeLegal(VT) && !TLI.isIntDivCheap()) - return BuildUDIV(N); + if (N1C && N1C->getValue() && !TLI.isIntDivCheap()) { + SDOperand Op = BuildUDIV(N); + if (Op.Val) return Op; + } + return SDOperand(); } @@ -2583,8 +2585,12 @@ /// SDOperand DAGCombiner::BuildSDIV(SDNode *N) { MVT::ValueType VT = N->getValueType(0); - assert((VT == MVT::i32 || VT == MVT::i64) && - "BuildSDIV only operates on i32 or i64!"); + + // Check to see if we can do this. + if (!TLI.isTypeLegal(VT) || (VT != MVT::i32 && VT != MVT::i64)) + return SDOperand(); // BuildSDIV only operates on i32 or i64 + if (!TLI.isOperationLegal(ISD::MULHS, VT)) + return SDOperand(); // Make sure the target supports MULHS. int64_t d = cast(N->getOperand(1))->getSignExtended(); ms magics = (VT == MVT::i32) ? magic32(d) : magic64(d); @@ -2622,8 +2628,12 @@ /// SDOperand DAGCombiner::BuildUDIV(SDNode *N) { MVT::ValueType VT = N->getValueType(0); - assert((VT == MVT::i32 || VT == MVT::i64) && - "BuildUDIV only operates on i32 or i64!"); + + // Check to see if we can do this. + if (!TLI.isTypeLegal(VT) || (VT != MVT::i32 && VT != MVT::i64)) + return SDOperand(); // BuildUDIV only operates on i32 or i64 + if (!TLI.isOperationLegal(ISD::MULHU, VT)) + return SDOperand(); // Make sure the target supports MULHU. uint64_t d = cast(N->getOperand(1))->getValue(); mu magics = (VT == MVT::i32) ? magicu32(d) : magicu64(d); From lattner at cs.uiuc.edu Sat Oct 22 14:37:20 2005 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sat, 22 Oct 2005 14:37:20 -0500 Subject: [llvm-commits] CVS: llvm/lib/Target/SparcV8/SparcV8ISelPattern.cpp Message-ID: <200510221937.OAA08151@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/SparcV8: SparcV8ISelPattern.cpp (r1.7) removed --- Log message: This file is entirely ifdef'd out --- Diffs of the changes: (+0 -0) 0 files changed From lattner at cs.uiuc.edu Sat Oct 22 16:16:22 2005 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sat, 22 Oct 2005 16:16:22 -0500 Subject: [llvm-commits] CVS: llvm-www/pubs/2005-09-25-CASES05-SegmentProtection.html 2005-09-25-CASES05-SegmentProtection.pdf index.html Message-ID: <200510222116.QAA08582@zion.cs.uiuc.edu> Changes in directory llvm-www/pubs: 2005-09-25-CASES05-SegmentProtection.html added (r1.1) 2005-09-25-CASES05-SegmentProtection.pdf added (r1.1) index.html updated: 1.23 -> 1.24 --- Log message: add a new paper that uses LLVM --- Diffs of the changes: (+67 -0) 2005-09-25-CASES05-SegmentProtection.html | 60 ++++++++++++++++++++++++++++++ 2005-09-25-CASES05-SegmentProtection.pdf | 0 index.html | 7 +++ 3 files changed, 67 insertions(+) Index: llvm-www/pubs/2005-09-25-CASES05-SegmentProtection.html diff -c /dev/null llvm-www/pubs/2005-09-25-CASES05-SegmentProtection.html:1.1 *** /dev/null Sat Oct 22 16:16:20 2005 --- llvm-www/pubs/2005-09-25-CASES05-SegmentProtection.html Sat Oct 22 16:16:10 2005 *************** *** 0 **** --- 1,60 ---- + + + + + + Segment Protection for Embedded Systems Using Run-time Checks + + + +
    + Segment Protection for Embedded Systems Using Run-time Checks +
    +
    + Matthew Simpson, Bhuvan Middha and Rajeev Barua +
    + + +

    Abstract:

    +
    + +

    The lack of virtual memory protection is a serious source of unreliability in many embedded systems. Without the segment-level + protection it provides, these systems are subject to memory access + violations, stemming from programmer error, whose results can be + dangerous and catastrophic in safety-critical systems. The traditional method of testing embedded software before its deployment + is an insufficient means of detecting and debugging all software + errors, and the reliance on this practice is a severe gamble when + the reliable performance of the embedded device is critical. Additionally, the use of safe languages and programming semantic restrictions as prevention mechanisms is often infeasible when considering the adoptability and compatibility of these languages since + most embedded applications are written in C and C++.

    + +

    This work improves system reliability by providing a completely + automatic software technique for guaranteeing segment protection + for embedded systems lacking virtual memory. This is done by + inserting optimized run-time checks before memory accesses that + detect segmentation violations in cases in which there would otherwise be no error, enabling remedial action before system failure + or corruption. This feature is invaluable for safety-critical embedded systems. Other advantages of our method include its low overhead, lack of any programming language or semantic restrictions, + and ease of implementation. Our compile-time analysis, known as + intended segment analysis, is a uniquely structured analysis that allows for the realization of optimizations used to reduce the number + of required run-time checks and foster our technique into a truly + viable solution for providing segment protection in embedded systems lacking virtual memory.

    +

    Our experimental results show that these optimizations are effective at reducing the performance overheads associated with providing software segment protection to low, and in many cases, negligible levels. For the eight evaluated embedded benchmarks, the + average increase in run-time is 0.72%, the average increase in energy consumption is 0.44%, and the average increase in code size + is 3.60%.

    +
    + +

    Published:

    +
    + "Segment Protection for Embedded Systems Using Run-time Checks"
    + By Matthew Simpson, Bhuvan Middha and Rajeev Barua.
    + Proceedings of the ACM International Conference on Compilers,
    + Architecture, and Synthesis for Embedded Systems (CASES)
    ,
    + San Francisco, CA, September 25-27, 2005
    +
    + +

    Download:

    + + + + Index: llvm-www/pubs/2005-09-25-CASES05-SegmentProtection.pdf Index: llvm-www/pubs/index.html diff -u llvm-www/pubs/index.html:1.23 llvm-www/pubs/index.html:1.24 --- llvm-www/pubs/index.html:1.23 Fri Jun 24 22:02:17 2005 +++ llvm-www/pubs/index.html Sat Oct 22 16:16:10 2005 @@ -48,6 +48,13 @@
      +
    1. "Segment Protection for + Embedded Systems Using Run-time Checks"
      + By Matthew Simpson, Bhuvan Middha and Rajeev Barua.
      + Proceedings of the ACM International Conference on Compilers, + Architecture, and Synthesis for Embedded Systems (CASES), + San Francisco, CA, September, 2005
    2. +
    3. "An Implementation of Swing Modulo Scheduling with Extensions for Superblocks"
      Tanya M. Lattner. M.S. Thesis, Computer Science Dept., University of Illinois at From lattner at cs.uiuc.edu Sat Oct 22 16:36:47 2005 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sat, 22 Oct 2005 16:36:47 -0500 Subject: [llvm-commits] CVS: llvm-www/pubs/index.html Message-ID: <200510222136.QAA08806@zion.cs.uiuc.edu> Changes in directory llvm-www/pubs: index.html updated: 1.24 -> 1.25 --- Log message: fix run-on link, remove italics --- Diffs of the changes: (+3 -3) index.html | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) Index: llvm-www/pubs/index.html diff -u llvm-www/pubs/index.html:1.24 llvm-www/pubs/index.html:1.25 --- llvm-www/pubs/index.html:1.24 Sat Oct 22 16:16:10 2005 +++ llvm-www/pubs/index.html Sat Oct 22 16:36:35 2005 @@ -49,10 +49,10 @@
      1. "Segment Protection for - Embedded Systems Using Run-time Checks"
        + Embedded Systems Using Run-time Checks
        "
        By Matthew Simpson, Bhuvan Middha and Rajeev Barua.
        - Proceedings of the ACM International Conference on Compilers, - Architecture, and Synthesis for Embedded Systems (CASES), + Proceedings of the ACM International Conference on Compilers, + Architecture, and Synthesis for Embedded Systems (CASES), San Francisco, CA, September, 2005
      2. "An Implementation of Swing Modulo Scheduling with Extensions for Superblocks"
        From lattner at cs.uiuc.edu Sat Oct 22 16:48:14 2005 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sat, 22 Oct 2005 16:48:14 -0500 Subject: [llvm-commits] CVS: llvm-www/pubs/index.html Message-ID: <200510222148.QAA08885@zion.cs.uiuc.edu> Changes in directory llvm-www/pubs: index.html updated: 1.25 -> 1.26 --- Log message: Clean this up significantly, remove all links but those to the paper's page to reduce clutter --- Diffs of the changes: (+38 -48) index.html | 86 ++++++++++++++++++++++++++----------------------------------- 1 files changed, 38 insertions(+), 48 deletions(-) Index: llvm-www/pubs/index.html diff -u llvm-www/pubs/index.html:1.25 llvm-www/pubs/index.html:1.26 --- llvm-www/pubs/index.html:1.25 Sat Oct 22 16:36:35 2005 +++ llvm-www/pubs/index.html Sat Oct 22 16:48:02 2005 @@ -4,41 +4,38 @@
        1. "The LLVM Compiler Framework and -Infrastructure Tutorial"
          Chris Lattner and Vikram Adve. LCPC'04 Mini Workshop on Compiler -Research Infrastructures, West Lafayette, Indiana, Sep. 2004.
        2. +Infrastructure Tutorial"
          Chris Lattner and Vikram Adve
          +LCPC'04 Mini Workshop on Compiler Research Infrastructures, West Lafayette, Indiana, Sep. 2004.
        3. "LLVM: A Compilation Framework for Lifelong Program Analysis & Transformation"
          Chris Lattner and Vikram -Adve. Proc. of the 2004 International Symposium -on Code Generation and Optimization (CGO'04), Palo Alto, California, Mar. +Adve
          Proc. of the 2004 International Symposium +on Code Generation and Optimization (CGO'04), Palo Alto, California, Mar. 2004.
          A previous version is available as:
          "LLVM: A Compilation Framework for Lifelong Program Analysis & Transformation"
          Chris -Lattner & Vikram Adve. Technical Report #UIUCDCS-R-2003-2380, Computer -Science Dept., Univ. of Illinois, Sep. 2003.
        4. +Lattner & Vikram Adve
          Technical Report #UIUCDCS-R-2003-2380, Computer +Science Dept., Univ. of Illinois, Sep. 2003.
        5. "LLVA: A Low-level Virtual Instruction Set Architecture"
          Vikram Adve, Chris Lattner, Michael Brukman, Anand Shukla, -and Brian Gaeke. Proc. of the +and Brian Gaeke
          Proceedings of the 36th annual ACM/IEEE international symposium on Microarchitecture -(MICRO-36)
          , San Diego, CA, December 2003.
        6. +(MICRO-36), San Diego, CA, December 2003.
        7. "Architecture For a Next-Generation -GCC"
          Chris Lattner & Vikram Adve, First Annual GCC Developers' -Summit, Ottawa, Canada, May 2003.
        8. +GCC"
          Chris Lattner & Vikram Adve
          First Annual GCC Developers' +Summit, Ottawa, Canada, May 2003.
        9. "LLVM: An Infrastructure for -Multi-Stage Optimization"
          Chris Lattner. Masters Thesis, +Multi-Stage Optimization"
          Chris Lattner
          Masters Thesis, Computer Science Dept., University of Illinois at Urbana-Champaign, Dec. 2002
        10. "The LLVM Instruction Set -and Compilation Strategy"
          Chris Lattner & Vikram Adve, Technical +and Compilation Strategy"
          Chris Lattner & Vikram Adve
          Technical Report #UIUCDCS-R-2002-2292, Computer Science Dept., Univ. of Illinois, Aug. 2002.
        11. @@ -50,90 +47,83 @@
        12. "Segment Protection for Embedded Systems Using Run-time Checks"
          - By Matthew Simpson, Bhuvan Middha and Rajeev Barua.
          - Proceedings of the ACM International Conference on Compilers, - Architecture, and Synthesis for Embedded Systems (CASES), + By Matthew Simpson, Bhuvan Middha and Rajeev Barua
          + Proc. of the ACM International Conference on Compilers, + Architecture, and Synthesis for Embedded Systems (CASES), San Francisco, CA, September, 2005
        13. "An Implementation of Swing Modulo Scheduling with Extensions for Superblocks"
          -Tanya M. Lattner. M.S. Thesis, Computer -Science Dept., University of Illinois at -Urbana-Champaign, June 2005.
        14. +Tanya M. Lattner.
          M.S. Thesis, Computer Science Dept., University of Illinois at +Urbana-Champaign, June 2005.
        15. "Macroscopic Data Structure Analysis and Optimization"
          -Chris Lattner. Ph.D. Thesis, Computer -Science Dept., University of Illinois at -Urbana-Champaign, May 2005.
        16. +Chris Lattner
          Ph.D. Thesis, Computer Science Dept., University of Illinois at +Urbana-Champaign, May 2005.
        17. "Automatic Pool Allocation: Improving Performance by Controlling Data Structure Layout in the Heap"
          -Chris Lattner and Vikram Adve. Proc. of the 2005 ACM SIGPLAN Conference on -Programming Language Design and Implementation (PLDI'05), Chicago, Illinois, +Chris Lattner and Vikram Adve
          + Proc. of the 2005 ACM SIGPLAN Conference on Programming Language Design and Implementation (PLDI'05), Chicago, Illinois, June, 2005.
          Received PLDI 2005 Best Paper Award.
        18. "Transparent Pointer Compression for Linked Data Structures"
          -Chris Lattner and Vikram Adve. Proceedings of the ACM Workshop on -Memory System Performance (MSP'05), Chicago, Illinois, June, 2005. +Chris Lattner and Vikram Adve
          Proceedings of the +ACM Workshop on Memory System Performance (MSP'05), Chicago, Illinois, June, 2005.
        19. "Memory Safety Without Garbage Collection for Embedded Applications"
          Dinakar - Dhurjati, Sumant Kowshik, Vikram Adve and Chris Lattner. ACM Transactions in - Embedded Computing Systems (TECS) , February 2005.
        20. + Dhurjati, Sumant Kowshik, Vikram Adve and Chris Lattner
          + ACM Transactions in Embedded Computing Systems (TECS), February 2005.
        21. "RubyComp - A Ruby-to-LLVM -Compiler Prototype"
          Anders Alexandersson. Masters Thesis, +Compiler Prototype"
          Anders Alexandersson
          Masters Thesis, Division of Computer Science at the Department of Informatics and Mathematics, University of Trollhättan/Uddevalla, Sweden, Spring 2004
        22. "A Task Optimization Framework for -MSSP"
          Rahul Ulhas Joshi. Masters Thesis, +MSSP"
          Rahul Ulhas Joshi
          Masters Thesis, Computer Science Dept., University of Illinois at Urbana-Champaign, May 2004.
        23. "Coordinating Adaptations in Distributed Systems"
          -Brian Ensink and Vikram Adve. Proc. of the 24th International Conference on -Distributed Computing Systems (ICDCS 2004), Tokyo, Japan, March 2004
        24. +Brian Ensink and Vikram Adve
          Proc. of the 24th International Conference on +Distributed Computing Systems (ICDCS 2004), Tokyo, Japan, March 2004
        25. "Language Extensions for -Performance-Oriented Programming"
          Joel Stanley. Masters Thesis, +Performance-Oriented Programming"
          Joel Stanley
          Masters Thesis, Computer Science Dept., University of Illinois at Urbana-Champaign, July 2003
        26. "Lightweight, Cross-Procedure -Tracing for Runtime Optimization"
          Anand Shukla. Masters Thesis, +Tracing for Runtime Optimization"
          Anand Shukla
          Masters Thesis, Computer Science Dept., University of Illinois at Urbana-Champaign, July 2003
        27. "Memory Safety Without Runtime Checks or Garbage Collection"
          Dinakar Dhurjati, Sumant Kowshik, Vikram -Adve and Chris Lattner. Proc. -Languages Compilers and Tools for Embedded Systems 2003 (LCTES 03), San +Adve and Chris Lattner
          Proceedings of +Languages Compilers and Tools for Embedded Systems 2003 (LCTES 03), San Diego, CA, June 2003.
        28. "Data Structure Analysis: An Efficient Context-Sensitive Heap Analysis"
          Chris Lattner & Vikram -Adve, Technical Report #UIUCDCS-R-2003-2340, Computer Science Dept., Univ. of +Adve
          Technical Report #UIUCDCS-R-2003-2340, Computer Science Dept., Univ. of Illinois, Apr. 2003.
        29. "Ensuring Code Safety Without Runtime Checks for Real-Time Control Systems"
          Sumant Kowshik, Dinakar -Dhurjati, and Vikram Adve. Proc. Int'l Conf. -on Compilers, Architecture and Synthesis for Embedded Systems (CASES02), +Dhurjati, and Vikram Adve
          Proc. Int'l Conf. +on Compilers, Architecture and Synthesis for Embedded Systems (CASES02), Grenoble, France, Oct. 2002.
        30. "Automatic Pool Allocation -for Disjoint Data Structures,"
          Chris Lattner & Vikram Adve, ACM SIGPLAN Workshop -on Memory System Performance (MSP), Berlin, Germany, June 2002.
          +for Disjoint Data Structures,"
          Chris Lattner & Vikram Adve
          +ACM SIGPLAN Workshop on Memory System Performance (MSP), Berlin, Germany, June 2002.
        From lattner at cs.uiuc.edu Sat Oct 22 17:00:56 2005 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sat, 22 Oct 2005 17:00:56 -0500 Subject: [llvm-commits] CVS: llvm/tools/llc/llc.cpp Message-ID: <200510222200.RAA08972@zion.cs.uiuc.edu> Changes in directory llvm/tools/llc: llc.cpp updated: 1.113 -> 1.114 --- Log message: document this as experimental --- Diffs of the changes: (+1 -1) llc.cpp | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm/tools/llc/llc.cpp diff -u llvm/tools/llc/llc.cpp:1.113 llvm/tools/llc/llc.cpp:1.114 --- llvm/tools/llc/llc.cpp:1.113 Fri Sep 2 14:27:43 2005 +++ llvm/tools/llc/llc.cpp Sat Oct 22 17:00:45 2005 @@ -67,7 +67,7 @@ clEnumValN(TargetMachine::AssemblyFile, "asm", " Emit an assembly ('.s') file"), clEnumValN(TargetMachine::ObjectFile, "obj", - " Emit a native object ('.o') file"), + " Emit a native object ('.o') file [experimental]"), clEnumValN(TargetMachine::DynamicLibrary, "dynlib", " Emit a native dynamic library ('.so') file"), clEnumValEnd)); From alenhar2 at cs.uiuc.edu Sat Oct 22 17:07:09 2005 From: alenhar2 at cs.uiuc.edu (Andrew Lenharth) Date: Sat, 22 Oct 2005 17:07:09 -0500 Subject: [llvm-commits] CVS: llvm/lib/Target/Alpha/AlphaISelDAGToDAG.cpp AlphaISelLowering.h AlphaInstrFormats.td AlphaInstrInfo.td Message-ID: <200510222207.RAA09035@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/Alpha: AlphaISelDAGToDAG.cpp updated: 1.1 -> 1.2 AlphaISelLowering.h updated: 1.2 -> 1.3 AlphaInstrFormats.td updated: 1.9 -> 1.10 AlphaInstrInfo.td updated: 1.66 -> 1.67 --- Log message: Well, the Constant matching pattern works. Can't say much about calls or globals yet. --- Diffs of the changes: (+113 -71) AlphaISelDAGToDAG.cpp | 149 ++++++++++++++++++++++++++++---------------------- AlphaISelLowering.h | 2 AlphaInstrFormats.td | 10 +++ AlphaInstrInfo.td | 23 +++++-- 4 files changed, 113 insertions(+), 71 deletions(-) Index: llvm/lib/Target/Alpha/AlphaISelDAGToDAG.cpp diff -u llvm/lib/Target/Alpha/AlphaISelDAGToDAG.cpp:1.1 llvm/lib/Target/Alpha/AlphaISelDAGToDAG.cpp:1.2 --- llvm/lib/Target/Alpha/AlphaISelDAGToDAG.cpp:1.1 Wed Oct 19 19:29:02 2005 +++ llvm/lib/Target/Alpha/AlphaISelDAGToDAG.cpp Sat Oct 22 17:06:58 2005 @@ -26,6 +26,7 @@ #include "llvm/GlobalValue.h" #include "llvm/Support/Debug.h" #include "llvm/Support/MathExtras.h" +#include using namespace llvm; namespace { @@ -43,14 +44,10 @@ /// getI64Imm - Return a target constant with the specified value, of type /// i64. - inline SDOperand getI64Imm(unsigned Imm) { + inline SDOperand getI64Imm(int64_t Imm) { return CurDAG->getTargetConstant(Imm, MVT::i64); } - virtual bool runOnFunction(Function &Fn) { - return SelectionDAGISel::runOnFunction(Fn); - } - // Select - Convert the specified operand from a target-independent to a // target-specific node if it hasn't already been changed. SDOperand Select(SDOperand Op); @@ -67,56 +64,24 @@ #include "AlphaGenDAGISel.inc" private: + SDOperand getGlobalBaseReg(); + SDOperand SelectCALL(SDOperand Op); + }; } +/// getGlobalBaseReg - Output the instructions required to put the +/// GOT address into a register. +/// +SDOperand AlphaDAGToDAGISel::getGlobalBaseReg() { + return CurDAG->getRegister(AlphaLowering.getVRegGP(), MVT::i64); +} + /// InstructionSelectBasicBlock - This callback is invoked by /// SelectionDAGISel when it has created a SelectionDAG for us to codegen. void AlphaDAGToDAGISel::InstructionSelectBasicBlock(SelectionDAG &DAG) { DEBUG(BB->dump()); - // The selection process is inherently a bottom-up recursive process (users - // select their uses before themselves). Given infinite stack space, we - // could just start selecting on the root and traverse the whole graph. In - // practice however, this causes us to run out of stack space on large basic - // blocks. To avoid this problem, select the entry node, then all its uses, - // iteratively instead of recursively. - std::vector Worklist; - Worklist.push_back(DAG.getEntryNode()); - - // Note that we can do this in the Alpha target (scanning forward across token - // chain edges) because no nodes ever get folded across these edges. On a - // target like X86 which supports load/modify/store operations, this would - // have to be more careful. - while (!Worklist.empty()) { - SDOperand Node = Worklist.back(); - Worklist.pop_back(); - - // Chose from the least deep of the top two nodes. - if (!Worklist.empty() && - Worklist.back().Val->getNodeDepth() < Node.Val->getNodeDepth()) - std::swap(Worklist.back(), Node); - - if ((Node.Val->getOpcode() >= ISD::BUILTIN_OP_END && - Node.Val->getOpcode() < AlphaISD::FIRST_NUMBER) || - CodeGenMap.count(Node)) continue; - - for (SDNode::use_iterator UI = Node.Val->use_begin(), - E = Node.Val->use_end(); UI != E; ++UI) { - // Scan the values. If this use has a value that is a token chain, add it - // to the worklist. - SDNode *User = *UI; - for (unsigned i = 0, e = User->getNumValues(); i != e; ++i) - if (User->getValueType(i) == MVT::Other) { - Worklist.push_back(SDOperand(User, i)); - break; - } - } - - // Finally, legalize this node. - Select(Node); - } - // Select target instructions for the DAG. DAG.setRoot(Select(DAG.getRoot())); CodeGenMap.clear(); @@ -140,14 +105,21 @@ switch (N->getOpcode()) { default: break; + case ISD::TAILCALL: + case ISD::CALL: return SelectCALL(Op); + case ISD::DYNAMIC_STACKALLOC: case ISD::ADD_PARTS: case ISD::SUB_PARTS: case ISD::SETCC: - case ISD::CALL: - case ISD::TAILCALL: assert(0 && "You want these too?"); + case ISD::BR: { + CurDAG->SelectNodeTo(N, Alpha::BR_DAG, MVT::Other, N->getOperand(1), + Select(N->getOperand(0))); + return SDOperand(N, 0); + } + case ISD::TokenFactor: { SDOperand New; if (N->getNumOperands() == 2) { @@ -208,20 +180,10 @@ assert(0 && "Constants are overrated"); } case ISD::GlobalAddress: { -// GlobalValue *GV = cast(N)->getGlobal(); -// SDOperand Tmp; -// SDOperand GA = CurDAG->getTargetGlobalAddress(GV, MVT::i32); -// if (PICEnabled) -// Tmp = CurDAG->getTargetNode(PPC::ADDIS, MVT::i32, getGlobalBaseReg(), GA); -// else -// Tmp = CurDAG->getTargetNode(PPC::LIS, MVT::i32, GA); - -// if (GV->hasWeakLinkage() || GV->isExternal()) -// CurDAG->SelectNodeTo(N, PPC::LWZ, MVT::i32, GA, Tmp); -// else -// CurDAG->SelectNodeTo(N, PPC::LA, MVT::i32, Tmp, GA); -// return SDOperand(N, 0); - assert(0 && "GlobalAddresses are for wimps"); + GlobalValue *GV = cast(N)->getGlobal(); + SDOperand GA = CurDAG->getTargetGlobalAddress(GV, MVT::i64); + CurDAG->SelectNodeTo(N, Alpha::LDQl, MVT::i64, GA, getGlobalBaseReg()); + return SDOperand(N, 0); } case ISD::CALLSEQ_START: @@ -257,6 +219,67 @@ return SelectCode(Op); } +SDOperand AlphaDAGToDAGISel::SelectCALL(SDOperand Op) { + SDNode *N = Op.Val; + SDOperand Chain = Select(N->getOperand(0)); + SDOperand InFlag; // Null incoming flag value. + SDOperand Addr = Select(N->getOperand(1)); + +// unsigned CallOpcode; + std::vector CallOperands; + std::vector TypeOperands; + + CallOperands.push_back(CurDAG->getCopyToReg(Chain, Alpha::R27, Addr)); + CallOperands.push_back(getI64Imm(0)); + + //grab the arguments + for(int i = 2, e = N->getNumOperands(); i < e; ++i) { + CallOperands.push_back(Select(N->getOperand(i))); + TypeOperands.push_back(N->getOperand(i).getValueType()); + } + static const unsigned args_int[] = {Alpha::R16, Alpha::R17, Alpha::R18, + Alpha::R19, Alpha::R20, Alpha::R21}; + static const unsigned args_float[] = {Alpha::F16, Alpha::F17, Alpha::F18, + Alpha::F19, Alpha::F20, Alpha::F21}; + + for (unsigned i = 0; i < std::min((size_t)6, CallOperands.size()); ++i) { + if (MVT::isInteger(TypeOperands[i])) { + Chain = CurDAG->getCopyToReg(Chain, args_int[i], CallOperands[i], InFlag); + InFlag = Chain.getValue(1); + CallOperands.push_back(CurDAG->getRegister(args_int[i], TypeOperands[i])); + } else { + assert(0 && "No FP support yet"); + } + } + assert(CallOperands.size() <= 6 && "Too big a call"); + + // Finally, once everything is in registers to pass to the call, emit the + // call itself. + if (InFlag.Val) + CallOperands.push_back(InFlag); // Strong dep on register copies. + else + CallOperands.push_back(Chain); // Weak dep on whatever occurs before + Chain = CurDAG->getTargetNode(Alpha::JSR, MVT::Other, MVT::Flag, CallOperands); + + std::vector CallResults; + + switch (N->getValueType(0)) { + default: assert(0 && "Unexpected ret value!"); + case MVT::Other: break; + case MVT::i64: + Chain = CurDAG->getCopyFromReg(Chain, Alpha::R0, MVT::i64, + Chain.getValue(1)).getValue(1); + CallResults.push_back(Chain.getValue(0)); + break; + } + + CallResults.push_back(Chain); + for (unsigned i = 0, e = CallResults.size(); i != e; ++i) + CodeGenMap[Op.getValue(i)] = CallResults[i]; + return CallResults[Op.ResNo]; +} + + /// createAlphaISelDag - This pass converts a legalized DAG into a /// Alpha-specific DAG, ready for instruction scheduling. /// Index: llvm/lib/Target/Alpha/AlphaISelLowering.h diff -u llvm/lib/Target/Alpha/AlphaISelLowering.h:1.2 llvm/lib/Target/Alpha/AlphaISelLowering.h:1.3 --- llvm/lib/Target/Alpha/AlphaISelLowering.h:1.2 Wed Oct 19 19:28:31 2005 +++ llvm/lib/Target/Alpha/AlphaISelLowering.h Sat Oct 22 17:06:58 2005 @@ -59,6 +59,8 @@ void restoreGP(MachineBasicBlock* BB); void restoreRA(MachineBasicBlock* BB); + unsigned getVRegGP() { return GP; } + unsigned getVRegRA() { return RA; } }; } Index: llvm/lib/Target/Alpha/AlphaInstrFormats.td diff -u llvm/lib/Target/Alpha/AlphaInstrFormats.td:1.9 llvm/lib/Target/Alpha/AlphaInstrFormats.td:1.10 --- llvm/lib/Target/Alpha/AlphaInstrFormats.td:1.9 Thu Oct 20 18:58:36 2005 +++ llvm/lib/Target/Alpha/AlphaInstrFormats.td Sat Oct 22 17:06:58 2005 @@ -81,6 +81,14 @@ let Inst{25-21} = Ra; let Inst{20-0} = disp; } +class BFormD opcode, string asmstr> + : InstAlpha { + bits<5> Ra = 31; + bits<21> disp; + + let Inst{25-21} = Ra; + let Inst{20-0} = disp; +} let isBranch = 1, isTerminator = 1 in class FBForm opcode, string asmstr> @@ -118,7 +126,7 @@ bits<5> Rb; bits<7> Function = fun; - let Inst{25-21} = 0; + let Inst{25-21} = 31; let Inst{20-16} = Rb; let Inst{15-13} = 0; let Inst{12} = 0; Index: llvm/lib/Target/Alpha/AlphaInstrInfo.td diff -u llvm/lib/Target/Alpha/AlphaInstrInfo.td:1.66 llvm/lib/Target/Alpha/AlphaInstrInfo.td:1.67 --- llvm/lib/Target/Alpha/AlphaInstrInfo.td:1.66 Thu Oct 20 20:24:05 2005 +++ llvm/lib/Target/Alpha/AlphaInstrInfo.td Sat Oct 22 17:06:58 2005 @@ -16,6 +16,17 @@ //Paterns for matching //******************** +def immUExt8 : PatLeaf<(imm), [{ + // immUExt8 predicate - True if the immediate fits in a 8-bit zero extended + // field. Used by instructions like 'addi'. + return (unsigned long)N->getValue() == (unsigned char)N->getValue(); +}]>; +def immSExt16 : PatLeaf<(imm), [{ + // immSExt16 predicate - True if the immediate fits in a 16-bit sign extended + // field. Used by instructions like 'lda'. + return (int)N->getValue() == (short)N->getValue(); +}]>; + def iZAPX : SDNodeXFormgetValue(); @@ -30,13 +41,6 @@ } return getI64Imm(build); }]>; - -def immUExt8 : PatLeaf<(imm), [{ - // immUExt8 predicate - True if the immediate fits in a 8-bit zero extended - // field. Used by instructions like 'addi'. - return (unsigned long)N->getValue() == (unsigned char)N->getValue(); -}]>; - def immZAP : PatLeaf<(imm), [{ // immZAP predicate - True if the immediate fits is suitable for use in a // ZAP instruction @@ -369,6 +373,8 @@ def JSR_COROUTINE : MbrForm< 0x1A, 0x03, (ops GPRC:$RD, GPRC:$RS, s14imm:$DISP), "jsr_coroutine $RD,($RS),$DISP">; //Jump to subroutine return def BR : BForm<0x30, "br $RA,$DISP">; //Branch +def BR_DAG : BFormD<0x30, "br $$31,$DISP">; //Branch + //Stores, int def STB : MForm<0x0E, "stb $RA,$DISP($RB)">; // Store byte def STW : MForm<0x0D, "stw $RA,$DISP($RB)">; // Store word @@ -506,3 +512,6 @@ //MF_FPCR F-P 17.025 Move from FPCR //MT_FPCR F-P 17.024 Move to FPCR + +def : Pat<(i64 immSExt16:$imm), + (LDA immSExt16:$imm, R31)>; From jeffc at jolt-lang.org Sat Oct 22 20:22:45 2005 From: jeffc at jolt-lang.org (Jeff Cohen) Date: Sat, 22 Oct 2005 20:22:45 -0500 Subject: [llvm-commits] CVS: llvm/win32/TableGen/TableGen.vcproj Message-ID: <200510230122.UAA09592@zion.cs.uiuc.edu> Changes in directory llvm/win32/TableGen: TableGen.vcproj updated: 1.14 -> 1.15 --- Log message: Add new files to Visual Studio. --- Diffs of the changes: (+6 -0) TableGen.vcproj | 6 ++++++ 1 files changed, 6 insertions(+) Index: llvm/win32/TableGen/TableGen.vcproj diff -u llvm/win32/TableGen/TableGen.vcproj:1.14 llvm/win32/TableGen/TableGen.vcproj:1.15 --- llvm/win32/TableGen/TableGen.vcproj:1.14 Fri Sep 9 21:00:02 2005 +++ llvm/win32/TableGen/TableGen.vcproj Sat Oct 22 20:22:33 2005 @@ -192,6 +192,9 @@ RelativePath="..\..\utils\TableGen\RegisterInfoEmitter.cpp"> + + + + From alenhar2 at cs.uiuc.edu Sat Oct 22 22:38:41 2005 From: alenhar2 at cs.uiuc.edu (Andrew Lenharth) Date: Sat, 22 Oct 2005 22:38:41 -0500 Subject: [llvm-commits] CVS: llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp Message-ID: <200510230338.WAA10382@zion.cs.uiuc.edu> Changes in directory llvm/lib/CodeGen/SelectionDAG: SelectionDAG.cpp updated: 1.206 -> 1.207 --- Log message: add TargetExternalSymbol --- Diffs of the changes: (+13 -1) SelectionDAG.cpp | 14 +++++++++++++- 1 files changed, 13 insertions(+), 1 deletion(-) Index: llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp diff -u llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp:1.206 llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp:1.207 --- llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp:1.206 Wed Oct 12 22:11:28 2005 +++ llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp Sat Oct 22 22:38:30 2005 @@ -312,6 +312,9 @@ case ISD::ExternalSymbol: Erased = ExternalSymbols.erase(cast(N)->getSymbol()); break; + case ISD::TargetExternalSymbol: + Erased = TargetExternalSymbols.erase(cast(N)->getSymbol()); + break; case ISD::VALUETYPE: Erased = ValueTypeNodes[cast(N)->getVT()] != 0; ValueTypeNodes[cast(N)->getVT()] = 0; @@ -551,7 +554,15 @@ SDOperand SelectionDAG::getExternalSymbol(const char *Sym, MVT::ValueType VT) { SDNode *&N = ExternalSymbols[Sym]; if (N) return SDOperand(N, 0); - N = new ExternalSymbolSDNode(Sym, VT); + N = new ExternalSymbolSDNode(false, Sym, VT); + AllNodes.push_back(N); + return SDOperand(N, 0); +} + +SDOperand SelectionDAG::getTargetExternalSymbol(const char *Sym, MVT::ValueType VT) { + SDNode *&N = TargetExternalSymbols[Sym]; + if (N) return SDOperand(N, 0); + N = new ExternalSymbolSDNode(true, Sym, VT); AllNodes.push_back(N); return SDOperand(N, 0); } @@ -1586,6 +1597,7 @@ case ISD::BasicBlock: return "BasicBlock"; case ISD::Register: return "Register"; case ISD::ExternalSymbol: return "ExternalSymbol"; + case ISD::TargetExternalSymbol: return "TargetExternalSymbol"; case ISD::ConstantPool: return "ConstantPool"; case ISD::TargetConstantPool: return "TargetConstantPool"; case ISD::CopyToReg: return "CopyToReg"; From alenhar2 at cs.uiuc.edu Sat Oct 22 22:40:28 2005 From: alenhar2 at cs.uiuc.edu (Andrew Lenharth) Date: Sat, 22 Oct 2005 22:40:28 -0500 Subject: [llvm-commits] CVS: llvm/include/llvm/CodeGen/SelectionDAG.h SelectionDAGNodes.h Message-ID: <200510230340.WAA10437@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm/CodeGen: SelectionDAG.h updated: 1.63 -> 1.64 SelectionDAGNodes.h updated: 1.69 -> 1.70 --- Log message: add TargetExternalSymbol --- Diffs of the changes: (+8 -3) SelectionDAG.h | 2 ++ SelectionDAGNodes.h | 9 ++++++--- 2 files changed, 8 insertions(+), 3 deletions(-) Index: llvm/include/llvm/CodeGen/SelectionDAG.h diff -u llvm/include/llvm/CodeGen/SelectionDAG.h:1.63 llvm/include/llvm/CodeGen/SelectionDAG.h:1.64 --- llvm/include/llvm/CodeGen/SelectionDAG.h:1.63 Wed Oct 12 22:10:46 2005 +++ llvm/include/llvm/CodeGen/SelectionDAG.h Sat Oct 22 22:40:17 2005 @@ -111,6 +111,7 @@ SDOperand getTargetConstantPool(Constant *C, MVT::ValueType VT); SDOperand getBasicBlock(MachineBasicBlock *MBB); SDOperand getExternalSymbol(const char *Sym, MVT::ValueType VT); + SDOperand getTargetExternalSymbol(const char *Sym, MVT::ValueType VT); SDOperand getValueType(MVT::ValueType); SDOperand getRegister(unsigned Reg, MVT::ValueType VT); @@ -382,6 +383,7 @@ std::map BBNodes; std::vector ValueTypeNodes; std::map ExternalSymbols; + std::map TargetExternalSymbols; std::map > >, SDNode*> OneResultNodes; Index: llvm/include/llvm/CodeGen/SelectionDAGNodes.h diff -u llvm/include/llvm/CodeGen/SelectionDAGNodes.h:1.69 llvm/include/llvm/CodeGen/SelectionDAGNodes.h:1.70 --- llvm/include/llvm/CodeGen/SelectionDAGNodes.h:1.69 Wed Oct 5 01:34:34 2005 +++ llvm/include/llvm/CodeGen/SelectionDAGNodes.h Sat Oct 22 22:40:17 2005 @@ -74,6 +74,7 @@ TargetGlobalAddress, TargetFrameIndex, TargetConstantPool, + TargetExternalSymbol, // CopyToReg - This node has three operands: a chain, a register number to // set to this value, and a value. @@ -932,8 +933,9 @@ const char *Symbol; protected: friend class SelectionDAG; - ExternalSymbolSDNode(const char *Sym, MVT::ValueType VT) - : SDNode(ISD::ExternalSymbol, VT), Symbol(Sym) { + ExternalSymbolSDNode(bool isTarget, const char *Sym, MVT::ValueType VT) + : SDNode(isTarget ? ISD::TargetExternalSymbol : ISD::ExternalSymbol, VT), + Symbol(Sym) { } public: @@ -941,7 +943,8 @@ static bool classof(const ExternalSymbolSDNode *) { return true; } static bool classof(const SDNode *N) { - return N->getOpcode() == ISD::ExternalSymbol; + return N->getOpcode() == ISD::ExternalSymbol || + N->getOpcode() == ISD::TargetExternalSymbol; } }; From alenhar2 at cs.uiuc.edu Sat Oct 22 22:43:59 2005 From: alenhar2 at cs.uiuc.edu (Andrew Lenharth) Date: Sat, 22 Oct 2005 22:43:59 -0500 Subject: [llvm-commits] CVS: llvm/lib/Target/Alpha/AlphaISelDAGToDAG.cpp AlphaInstrInfo.td Message-ID: <200510230343.WAA10479@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/Alpha: AlphaISelDAGToDAG.cpp updated: 1.2 -> 1.3 AlphaInstrInfo.td updated: 1.67 -> 1.68 --- Log message: Add several things. loads branches setcc working calls Global address External addresses now I can manage malloc calls. --- Diffs of the changes: (+91 -23) AlphaISelDAGToDAG.cpp | 100 ++++++++++++++++++++++++++++++++++++++++---------- AlphaInstrInfo.td | 14 +++++-- 2 files changed, 91 insertions(+), 23 deletions(-) Index: llvm/lib/Target/Alpha/AlphaISelDAGToDAG.cpp diff -u llvm/lib/Target/Alpha/AlphaISelDAGToDAG.cpp:1.2 llvm/lib/Target/Alpha/AlphaISelDAGToDAG.cpp:1.3 --- llvm/lib/Target/Alpha/AlphaISelDAGToDAG.cpp:1.2 Sat Oct 22 17:06:58 2005 +++ llvm/lib/Target/Alpha/AlphaISelDAGToDAG.cpp Sat Oct 22 22:43:48 2005 @@ -109,11 +109,74 @@ case ISD::CALL: return SelectCALL(Op); case ISD::DYNAMIC_STACKALLOC: - case ISD::ADD_PARTS: - case ISD::SUB_PARTS: - case ISD::SETCC: assert(0 && "You want these too?"); + case ISD::SETCC: { + ISD::CondCode CC = cast(N->getOperand(2))->get(); + assert(MVT::isInteger(N->getOperand(0).getValueType()) && "FP numbers are unnecessary"); + SDOperand Op1 = Select(N->getOperand(0)); + SDOperand Op2 = Select(N->getOperand(1)); + unsigned Opc = Alpha::WTF; + int dir; + switch (CC) { + default: N->dump(); assert(0 && "Unknown integer comparison!"); + case ISD::SETEQ: Opc = Alpha::CMPEQ; dir=1; break; + case ISD::SETLT: Opc = Alpha::CMPLT; dir = 1; break; + case ISD::SETLE: Opc = Alpha::CMPLE; dir = 1; break; + case ISD::SETGT: Opc = Alpha::CMPLT; dir = 0; break; + case ISD::SETGE: Opc = Alpha::CMPLE; dir = 0; break; + case ISD::SETULT: Opc = Alpha::CMPULT; dir = 1; break; + case ISD::SETUGT: Opc = Alpha::CMPULT; dir = 0; break; + case ISD::SETULE: Opc = Alpha::CMPULE; dir = 1; break; + case ISD::SETUGE: Opc = Alpha::CMPULE; dir = 0; break; + case ISD::SETNE: {//Handle this one special + SDOperand Tmp = CurDAG->getTargetNode(Alpha::CMPEQ, MVT::i64, Op1, Op2); + CurDAG->SelectNodeTo(N, Alpha::CMPEQ, MVT::i64, CurDAG->getRegister(Alpha::R31, MVT::i64), Tmp); + return SDOperand(N, 0); + } + } + CurDAG->SelectNodeTo(N, Opc, MVT::i64, dir ? Op1 : Op2, dir ? Op2 : Op1); + return SDOperand(N, 0); + } + + case ISD::BRCOND: { + SDOperand Chain = Select(N->getOperand(0)); + SDOperand CC = Select(N->getOperand(1)); + CurDAG->SelectNodeTo(N, Alpha::BNE, MVT::Other, CC, Chain); + return SDOperand(N, 0); + } + case ISD::LOAD: + case ISD::EXTLOAD: + case ISD::ZEXTLOAD: + case ISD::SEXTLOAD: { + SDOperand Chain = Select(N->getOperand(0)); + SDOperand Address = Select(N->getOperand(1)); + unsigned opcode = N->getOpcode(); + unsigned Opc = Alpha::WTF; + if (opcode == ISD::LOAD) + switch (N->getValueType(0)) { + default: N->dump(); assert(0 && "Bad load!"); + case MVT::i64: Opc = Alpha::LDQ; break; + case MVT::f64: Opc = Alpha::LDT; break; + case MVT::f32: Opc = Alpha::LDS; break; + } + else + switch (cast(N->getOperand(3))->getVT()) { + default: N->dump(); assert(0 && "Bad sign extend!"); + case MVT::i32: Opc = Alpha::LDL; + assert(opcode != ISD::ZEXTLOAD && "Not sext"); break; + case MVT::i16: Opc = Alpha::LDWU; + assert(opcode != ISD::SEXTLOAD && "Not zext"); break; + case MVT::i1: //FIXME: Treat i1 as i8 since there are problems otherwise + case MVT::i8: Opc = Alpha::LDBU; + assert(opcode != ISD::SEXTLOAD && "Not zext"); break; + } + + CurDAG->SelectNodeTo(N, Opc, N->getValueType(0), MVT::Other, + getI64Imm(0), Address, Chain); + return SDOperand(N, Op.ResNo); + } + case ISD::BR: { CurDAG->SelectNodeTo(N, Alpha::BR_DAG, MVT::Other, N->getOperand(1), Select(N->getOperand(0))); @@ -185,6 +248,11 @@ CurDAG->SelectNodeTo(N, Alpha::LDQl, MVT::i64, GA, getGlobalBaseReg()); return SDOperand(N, 0); } + case ISD::ExternalSymbol: + CurDAG->SelectNodeTo(N, Alpha::LDQl, MVT::i64, + CurDAG->getTargetExternalSymbol(cast(N)->getSymbol(), MVT::i64), + CurDAG->getRegister(AlphaLowering.getVRegGP(), MVT::i64)); + return SDOperand(N, 0); case ISD::CALLSEQ_START: case ISD::CALLSEQ_END: { @@ -222,44 +290,37 @@ SDOperand AlphaDAGToDAGISel::SelectCALL(SDOperand Op) { SDNode *N = Op.Val; SDOperand Chain = Select(N->getOperand(0)); - SDOperand InFlag; // Null incoming flag value. SDOperand Addr = Select(N->getOperand(1)); // unsigned CallOpcode; std::vector CallOperands; std::vector TypeOperands; - CallOperands.push_back(CurDAG->getCopyToReg(Chain, Alpha::R27, Addr)); - CallOperands.push_back(getI64Imm(0)); - //grab the arguments for(int i = 2, e = N->getNumOperands(); i < e; ++i) { - CallOperands.push_back(Select(N->getOperand(i))); TypeOperands.push_back(N->getOperand(i).getValueType()); + CallOperands.push_back(Select(N->getOperand(i))); } + int count = N->getNumOperands() - 2; + static const unsigned args_int[] = {Alpha::R16, Alpha::R17, Alpha::R18, Alpha::R19, Alpha::R20, Alpha::R21}; static const unsigned args_float[] = {Alpha::F16, Alpha::F17, Alpha::F18, Alpha::F19, Alpha::F20, Alpha::F21}; - for (unsigned i = 0; i < std::min((size_t)6, CallOperands.size()); ++i) { + for (int i = 0; i < std::min(6, count); ++i) { if (MVT::isInteger(TypeOperands[i])) { - Chain = CurDAG->getCopyToReg(Chain, args_int[i], CallOperands[i], InFlag); - InFlag = Chain.getValue(1); - CallOperands.push_back(CurDAG->getRegister(args_int[i], TypeOperands[i])); + Chain = CurDAG->getCopyToReg(Chain, args_int[i], CallOperands[i]); } else { - assert(0 && "No FP support yet"); + assert(0 && "No FP support yet"); } } assert(CallOperands.size() <= 6 && "Too big a call"); + Chain = CurDAG->getCopyToReg(Chain, Alpha::R27, Addr); // Finally, once everything is in registers to pass to the call, emit the // call itself. - if (InFlag.Val) - CallOperands.push_back(InFlag); // Strong dep on register copies. - else - CallOperands.push_back(Chain); // Weak dep on whatever occurs before - Chain = CurDAG->getTargetNode(Alpha::JSR, MVT::Other, MVT::Flag, CallOperands); + Chain = CurDAG->getTargetNode(Alpha::JSRDAG, MVT::Other, Chain ); std::vector CallResults; @@ -267,8 +328,7 @@ default: assert(0 && "Unexpected ret value!"); case MVT::Other: break; case MVT::i64: - Chain = CurDAG->getCopyFromReg(Chain, Alpha::R0, MVT::i64, - Chain.getValue(1)).getValue(1); + Chain = CurDAG->getCopyFromReg(Chain, Alpha::R0, MVT::i64).getValue(1); CallResults.push_back(Chain.getValue(0)); break; } Index: llvm/lib/Target/Alpha/AlphaInstrInfo.td diff -u llvm/lib/Target/Alpha/AlphaInstrInfo.td:1.67 llvm/lib/Target/Alpha/AlphaInstrInfo.td:1.68 --- llvm/lib/Target/Alpha/AlphaInstrInfo.td:1.67 Sat Oct 22 17:06:58 2005 +++ llvm/lib/Target/Alpha/AlphaInstrInfo.td Sat Oct 22 22:43:48 2005 @@ -55,7 +55,7 @@ UImm >>= 8; } return build != 0; -}]>; +}], iZAPX>; def intop : PatFrag<(ops node:$op), (sext_inreg node:$op, i32)>; @@ -311,8 +311,8 @@ def ZAPi : OFormL<0x12, 0x30, "zap $RA,$L,$RC", []>; //Zero bytes //FIXME: what to do about zapnot? see ZAP :) def ZAPNOT : OForm< 0x12, 0x31, "zapnot $RA,$RB,$RC", []>; //Zero bytes not -def ZAPNOTi : OFormL<0x12, 0x31, "zapnot $RA,$L,$RC", []>; -def : Pat<(and GPRC:$OP1, immZAP:$OP2), (ZAPNOTi GPRC:$OP1, (iZAPX immZAP:$OP2))>; +def ZAPNOTi : OFormL<0x12, 0x31, "zapnot $RA,$L,$RC", + [(set GPRC:$RC, (and GPRC:$RA, immZAP:$L))]>; //Comparison, int def CMPBGE : OForm< 0x10, 0x0F, "cmpbge $RA,$RB,$RC", []>; //Compare byte @@ -367,6 +367,14 @@ def JSR : MbrForm< 0x1A, 0x01, (ops GPRC:$RD, GPRC:$RS, s14imm:$DISP), "jsr $RD,($RS),$DISP">; //Jump to subroutine def BSR : BForm<0x34, "bsr $RA,$DISP">; //Branch to subroutine } +let isCall = 1, + Defs = [R0, R1, R2, R3, R4, R5, R6, R7, R8, R16, R17, R18, R19, + R20, R21, R22, R23, R24, R25, R26, R27, R28, R29, + F0, F1, + F10, F11, F12, F13, F14, F15, F16, F17, F18, F19, + F20, F21, F22, F23, F24, F25, F26, F27, F28, F29, F30], Uses = [R27, R29] in { + def JSRDAG : MbrForm< 0x1A, 0x01, (ops ), "jsr $$26,($$27),0">; //Jump to subroutine +} let isCall = 1, Defs = [R24, R25, R27, R28], Uses = [R24, R25] in def JSRs : MbrForm< 0x1A, 0x01, (ops GPRC:$RD, GPRC:$RS, s14imm:$DISP), "jsr $RD,($RS),$DISP">; //Jump to div or rem From jeffc at jolt-lang.org Sat Oct 22 23:37:37 2005 From: jeffc at jolt-lang.org (Jeff Cohen) Date: Sat, 22 Oct 2005 23:37:37 -0500 Subject: [llvm-commits] CVS: llvm/lib/CodeGen/IntrinsicLowering.cpp Message-ID: <200510230437.XAA10813@zion.cs.uiuc.edu> Changes in directory llvm/lib/CodeGen: IntrinsicLowering.cpp updated: 1.34 -> 1.35 --- Log message: When a function takes a variable number of pointer arguments, with a zero pointer marking the end of the list, the zero *must* be cast to the pointer type. An un-cast zero is a 32-bit int, and at least on x86_64, gcc will not extend the zero to 64 bits, thus allowing the upper 32 bits to be random junk. The new END_WITH_NULL macro may be used to annotate a such a function so that GCC (version 4 or newer) will detect the use of un-casted zero at compile time. --- Diffs of the changes: (+2 -1) IntrinsicLowering.cpp | 3 ++- 1 files changed, 2 insertions(+), 1 deletion(-) Index: llvm/lib/CodeGen/IntrinsicLowering.cpp diff -u llvm/lib/CodeGen/IntrinsicLowering.cpp:1.34 llvm/lib/CodeGen/IntrinsicLowering.cpp:1.35 --- llvm/lib/CodeGen/IntrinsicLowering.cpp:1.34 Wed Jul 27 01:12:33 2005 +++ llvm/lib/CodeGen/IntrinsicLowering.cpp Sat Oct 22 23:37:20 2005 @@ -110,7 +110,8 @@ case Intrinsic::memset: M.getOrInsertFunction("memset", PointerType::get(Type::SByteTy), PointerType::get(Type::SByteTy), - Type::IntTy, (--(--I->arg_end()))->getType(), 0); + Type::IntTy, (--(--I->arg_end()))->getType(), + (Type *)0); break; case Intrinsic::isunordered: EnsureFunctionExists(M, "isunordered", I->arg_begin(), I->arg_end(), From jeffc at jolt-lang.org Sat Oct 22 23:37:40 2005 From: jeffc at jolt-lang.org (Jeff Cohen) Date: Sat, 22 Oct 2005 23:37:40 -0500 Subject: [llvm-commits] CVS: llvm/include/llvm/Module.h Message-ID: <200510230437.XAA10870@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm: Module.h updated: 1.62 -> 1.63 --- Log message: When a function takes a variable number of pointer arguments, with a zero pointer marking the end of the list, the zero *must* be cast to the pointer type. An un-cast zero is a 32-bit int, and at least on x86_64, gcc will not extend the zero to 64 bits, thus allowing the upper 32 bits to be random junk. The new END_WITH_NULL macro may be used to annotate a such a function so that GCC (version 4 or newer) will detect the use of un-casted zero at compile time. --- Diffs of the changes: (+3 -1) Module.h | 4 +++- 1 files changed, 3 insertions(+), 1 deletion(-) Index: llvm/include/llvm/Module.h diff -u llvm/include/llvm/Module.h:1.62 llvm/include/llvm/Module.h:1.63 --- llvm/include/llvm/Module.h:1.62 Sun May 15 20:49:23 2005 +++ llvm/include/llvm/Module.h Sat Oct 22 23:37:19 2005 @@ -22,6 +22,7 @@ #include "llvm/Function.h" #include "llvm/GlobalVariable.h" #include "llvm/ADT/SetVector.h" +#include "llvm/Support/DataTypes.h" namespace llvm { @@ -111,7 +112,8 @@ /// table. If it does not exist, add a prototype for the function and return /// it. This version of the method takes a null terminated list of function /// arguments, which makes it easier for clients to use. - Function *getOrInsertFunction(const std::string &Name, const Type *RetTy,...); + Function *getOrInsertFunction(const std::string &Name, const Type *RetTy,...) + END_WITH_NULL; /// getFunction - Look up the specified function in the module symbol table. /// If it does not exist, return null. From jeffc at jolt-lang.org Sat Oct 22 23:37:39 2005 From: jeffc at jolt-lang.org (Jeff Cohen) Date: Sat, 22 Oct 2005 23:37:39 -0500 Subject: [llvm-commits] CVS: llvm/lib/Bytecode/Reader/Reader.cpp ReaderWrappers.cpp Message-ID: <200510230437.XAA10842@zion.cs.uiuc.edu> Changes in directory llvm/lib/Bytecode/Reader: Reader.cpp updated: 1.167 -> 1.168 ReaderWrappers.cpp updated: 1.51 -> 1.52 --- Log message: When a function takes a variable number of pointer arguments, with a zero pointer marking the end of the list, the zero *must* be cast to the pointer type. An un-cast zero is a 32-bit int, and at least on x86_64, gcc will not extend the zero to 64 bits, thus allowing the upper 32 bits to be random junk. The new END_WITH_NULL macro may be used to annotate a such a function so that GCC (version 4 or newer) will detect the use of un-casted zero at compile time. --- Diffs of the changes: (+7 -5) Reader.cpp | 6 ++++-- ReaderWrappers.cpp | 6 +++--- 2 files changed, 7 insertions(+), 5 deletions(-) Index: llvm/lib/Bytecode/Reader/Reader.cpp diff -u llvm/lib/Bytecode/Reader/Reader.cpp:1.167 llvm/lib/Bytecode/Reader/Reader.cpp:1.168 --- llvm/lib/Bytecode/Reader/Reader.cpp:1.167 Mon Oct 3 16:26:53 2005 +++ llvm/lib/Bytecode/Reader/Reader.cpp Sat Oct 22 23:37:20 2005 @@ -680,7 +680,8 @@ break; case 32: { //VANext_old const Type* ArgTy = getValue(iType, Oprnds[0])->getType(); - Function* NF = TheModule->getOrInsertFunction("llvm.va_copy", ArgTy, ArgTy, 0); + Function* NF = TheModule->getOrInsertFunction("llvm.va_copy", ArgTy, ArgTy, + (Type *)0); //b = vanext a, t -> //foo = alloca 1 of t @@ -700,7 +701,8 @@ } case 33: { //VAArg_old const Type* ArgTy = getValue(iType, Oprnds[0])->getType(); - Function* NF = TheModule->getOrInsertFunction("llvm.va_copy", ArgTy, ArgTy, 0); + Function* NF = TheModule->getOrInsertFunction("llvm.va_copy", ArgTy, ArgTy, + (Type *)0); //b = vaarg a, t -> //foo = alloca 1 of t Index: llvm/lib/Bytecode/Reader/ReaderWrappers.cpp diff -u llvm/lib/Bytecode/Reader/ReaderWrappers.cpp:1.51 llvm/lib/Bytecode/Reader/ReaderWrappers.cpp:1.52 --- llvm/lib/Bytecode/Reader/ReaderWrappers.cpp:1.51 Wed Jul 27 01:12:33 2005 +++ llvm/lib/Bytecode/Reader/ReaderWrappers.cpp Sat Oct 22 23:37:20 2005 @@ -181,7 +181,7 @@ const Type* ArgTy = F->getFunctionType()->getReturnType(); const Type* ArgTyPtr = PointerType::get(ArgTy); Function* NF = M->getOrInsertFunction("llvm.va_start", - RetTy, ArgTyPtr, 0); + RetTy, ArgTyPtr, (Type *)0); for(Value::use_iterator I = F->use_begin(), E = F->use_end(); I != E;) if (CallInst* CI = dyn_cast(*I++)) { @@ -204,7 +204,7 @@ const Type* ArgTy = F->getFunctionType()->getParamType(0); const Type* ArgTyPtr = PointerType::get(ArgTy); Function* NF = M->getOrInsertFunction("llvm.va_end", - RetTy, ArgTyPtr, 0); + RetTy, ArgTyPtr, (Type *)0); for(Value::use_iterator I = F->use_begin(), E = F->use_end(); I != E;) if (CallInst* CI = dyn_cast(*I++)) { @@ -230,7 +230,7 @@ const Type* ArgTy = F->getFunctionType()->getReturnType(); const Type* ArgTyPtr = PointerType::get(ArgTy); Function* NF = M->getOrInsertFunction("llvm.va_copy", - RetTy, ArgTyPtr, ArgTyPtr, 0); + RetTy, ArgTyPtr, ArgTyPtr, (Type *)0); for(Value::use_iterator I = F->use_begin(), E = F->use_end(); I != E;) if (CallInst* CI = dyn_cast(*I++)) { From jeffc at jolt-lang.org Sat Oct 22 23:37:39 2005 From: jeffc at jolt-lang.org (Jeff Cohen) Date: Sat, 22 Oct 2005 23:37:39 -0500 Subject: [llvm-commits] CVS: llvm/lib/Transforms/Instrumentation/ProfilePaths/EdgeCode.cpp InstLoops.cpp ProfilePaths.cpp Message-ID: <200510230437.XAA10838@zion.cs.uiuc.edu> Changes in directory llvm/lib/Transforms/Instrumentation/ProfilePaths: EdgeCode.cpp updated: 1.30 -> 1.31 InstLoops.cpp updated: 1.21 -> 1.22 ProfilePaths.cpp updated: 1.43 -> 1.44 --- Log message: When a function takes a variable number of pointer arguments, with a zero pointer marking the end of the list, the zero *must* be cast to the pointer type. An un-cast zero is a 32-bit int, and at least on x86_64, gcc will not extend the zero to 64 bits, thus allowing the upper 32 bits to be random junk. The new END_WITH_NULL macro may be used to annotate a such a function so that GCC (version 4 or newer) will detect the use of un-casted zero at compile time. --- Diffs of the changes: (+5 -3) EdgeCode.cpp | 2 +- InstLoops.cpp | 3 ++- ProfilePaths.cpp | 3 ++- 3 files changed, 5 insertions(+), 3 deletions(-) Index: llvm/lib/Transforms/Instrumentation/ProfilePaths/EdgeCode.cpp diff -u llvm/lib/Transforms/Instrumentation/ProfilePaths/EdgeCode.cpp:1.30 llvm/lib/Transforms/Instrumentation/ProfilePaths/EdgeCode.cpp:1.31 --- llvm/lib/Transforms/Instrumentation/ProfilePaths/EdgeCode.cpp:1.30 Sat Apr 23 16:38:35 2005 +++ llvm/lib/Transforms/Instrumentation/ProfilePaths/EdgeCode.cpp Sat Oct 22 23:37:20 2005 @@ -40,7 +40,7 @@ const Type *PIntTy = PointerType::get(Type::IntTy); Function *trigMeth = M->getOrInsertFunction("trigger", Type::VoidTy, Type::IntTy, Type::IntTy, - PIntTy, PIntTy, 0); + PIntTy, PIntTy, (Type *)0); assert(trigMeth && "trigger method could not be inserted!"); vector trargs; Index: llvm/lib/Transforms/Instrumentation/ProfilePaths/InstLoops.cpp diff -u llvm/lib/Transforms/Instrumentation/ProfilePaths/InstLoops.cpp:1.21 llvm/lib/Transforms/Instrumentation/ProfilePaths/InstLoops.cpp:1.22 --- llvm/lib/Transforms/Instrumentation/ProfilePaths/InstLoops.cpp:1.21 Sat Apr 23 16:38:35 2005 +++ llvm/lib/Transforms/Instrumentation/ProfilePaths/InstLoops.cpp Sat Oct 22 23:37:20 2005 @@ -156,7 +156,8 @@ } bool InstLoops::doInitialization (Module &M) { - inCountMth = M.getOrInsertFunction("llvm_first_trigger", Type::VoidTy, 0); + inCountMth = M.getOrInsertFunction("llvm_first_trigger", Type::VoidTy, + (Type *)0); return true; // Module was modified. } Index: llvm/lib/Transforms/Instrumentation/ProfilePaths/ProfilePaths.cpp diff -u llvm/lib/Transforms/Instrumentation/ProfilePaths/ProfilePaths.cpp:1.43 llvm/lib/Transforms/Instrumentation/ProfilePaths/ProfilePaths.cpp:1.44 --- llvm/lib/Transforms/Instrumentation/ProfilePaths/ProfilePaths.cpp:1.43 Thu Apr 21 18:40:47 2005 +++ llvm/lib/Transforms/Instrumentation/ProfilePaths/ProfilePaths.cpp Sat Oct 22 23:37:20 2005 @@ -189,7 +189,8 @@ // IN THEIR INITIALIZE METHOD!! Function *initialize = F.getParent()->getOrInsertFunction("reoptimizerInitialize", Type::VoidTy, - PointerType::get(Type::IntTy), 0); + PointerType::get(Type::IntTy), + (Type *)0); std::vector trargs; trargs.push_back(threshold); From jeffc at jolt-lang.org Sat Oct 22 23:37:39 2005 From: jeffc at jolt-lang.org (Jeff Cohen) Date: Sat, 22 Oct 2005 23:37:39 -0500 Subject: [llvm-commits] CVS: llvm/lib/Transforms/Instrumentation/ProfilingUtils.cpp TraceBasicBlocks.cpp TraceValues.cpp Message-ID: <200510230437.XAA10829@zion.cs.uiuc.edu> Changes in directory llvm/lib/Transforms/Instrumentation: ProfilingUtils.cpp updated: 1.6 -> 1.7 TraceBasicBlocks.cpp updated: 1.12 -> 1.13 TraceValues.cpp updated: 1.74 -> 1.75 --- Log message: When a function takes a variable number of pointer arguments, with a zero pointer marking the end of the list, the zero *must* be cast to the pointer type. An un-cast zero is a 32-bit int, and at least on x86_64, gcc will not extend the zero to 64 bits, thus allowing the upper 32 bits to be random junk. The new END_WITH_NULL macro may be used to annotate a such a function so that GCC (version 4 or newer) will detect the use of un-casted zero at compile time. --- Diffs of the changes: (+9 -7) ProfilingUtils.cpp | 3 ++- TraceBasicBlocks.cpp | 2 +- TraceValues.cpp | 11 ++++++----- 3 files changed, 9 insertions(+), 7 deletions(-) Index: llvm/lib/Transforms/Instrumentation/ProfilingUtils.cpp diff -u llvm/lib/Transforms/Instrumentation/ProfilingUtils.cpp:1.6 llvm/lib/Transforms/Instrumentation/ProfilingUtils.cpp:1.7 --- llvm/lib/Transforms/Instrumentation/ProfilingUtils.cpp:1.6 Thu Apr 21 18:40:46 2005 +++ llvm/lib/Transforms/Instrumentation/ProfilingUtils.cpp Sat Oct 22 23:37:20 2005 @@ -26,7 +26,8 @@ const PointerType *UIntPtr = PointerType::get(Type::UIntTy); Module &M = *MainFn->getParent(); Function *InitFn = M.getOrInsertFunction(FnName, Type::IntTy, Type::IntTy, - ArgVTy, UIntPtr, Type::UIntTy, 0); + ArgVTy, UIntPtr, Type::UIntTy, + (Type *)0); // This could force argc and argv into programs that wouldn't otherwise have // them, but instead we just pass null values in. Index: llvm/lib/Transforms/Instrumentation/TraceBasicBlocks.cpp diff -u llvm/lib/Transforms/Instrumentation/TraceBasicBlocks.cpp:1.12 llvm/lib/Transforms/Instrumentation/TraceBasicBlocks.cpp:1.13 --- llvm/lib/Transforms/Instrumentation/TraceBasicBlocks.cpp:1.12 Sat Apr 23 16:38:35 2005 +++ llvm/lib/Transforms/Instrumentation/TraceBasicBlocks.cpp Sat Oct 22 23:37:20 2005 @@ -46,7 +46,7 @@ << "\", \"" << FnName << "\", " << BBNumber << ")\n"); Module &M = *BB->getParent ()->getParent (); Function *InstrFn = M.getOrInsertFunction (FnName, Type::VoidTy, - Type::UIntTy, 0); + Type::UIntTy, (Type *)0); std::vector Args (1); Args[0] = ConstantUInt::get (Type::UIntTy, BBNumber); Index: llvm/lib/Transforms/Instrumentation/TraceValues.cpp diff -u llvm/lib/Transforms/Instrumentation/TraceValues.cpp:1.74 llvm/lib/Transforms/Instrumentation/TraceValues.cpp:1.75 --- llvm/lib/Transforms/Instrumentation/TraceValues.cpp:1.74 Sat Apr 23 16:38:35 2005 +++ llvm/lib/Transforms/Instrumentation/TraceValues.cpp Sat Oct 22 23:37:20 2005 @@ -130,17 +130,18 @@ // uint (sbyte*) HashPtrFunc = M.getOrInsertFunction("HashPointerToSeqNum", Type::UIntTy, SBP, - 0); + (Type *)0); // void (sbyte*) ReleasePtrFunc = M.getOrInsertFunction("ReleasePointerSeqNum", - Type::VoidTy, SBP, 0); + Type::VoidTy, SBP, (Type *)0); RecordPtrFunc = M.getOrInsertFunction("RecordPointer", - Type::VoidTy, SBP, 0); + Type::VoidTy, SBP, (Type *)0); - PushOnEntryFunc = M.getOrInsertFunction("PushPointerSet", Type::VoidTy, 0); + PushOnEntryFunc = M.getOrInsertFunction("PushPointerSet", Type::VoidTy, + (Type *)0); ReleaseOnReturnFunc = M.getOrInsertFunction("ReleasePointersPopSet", - Type::VoidTy, 0); + Type::VoidTy, (Type *)0); } From jeffc at jolt-lang.org Sat Oct 22 23:37:37 2005 From: jeffc at jolt-lang.org (Jeff Cohen) Date: Sat, 22 Oct 2005 23:37:37 -0500 Subject: [llvm-commits] CVS: llvm/lib/AsmParser/llvmAsmParser.cpp llvmAsmParser.h llvmAsmParser.y Message-ID: <200510230437.XAA10811@zion.cs.uiuc.edu> Changes in directory llvm/lib/AsmParser: llvmAsmParser.cpp updated: 1.17 -> 1.18 llvmAsmParser.h updated: 1.9 -> 1.10 llvmAsmParser.y updated: 1.231 -> 1.232 --- Log message: When a function takes a variable number of pointer arguments, with a zero pointer marking the end of the list, the zero *must* be cast to the pointer type. An un-cast zero is a 32-bit int, and at least on x86_64, gcc will not extend the zero to 64 bits, thus allowing the upper 32 bits to be random junk. The new END_WITH_NULL macro may be used to annotate a such a function so that GCC (version 4 or newer) will detect the use of un-casted zero at compile time. --- Diffs of the changes: (+222 -219) llvmAsmParser.cpp | 422 +++++++++++++++++++++++++++--------------------------- llvmAsmParser.h | 8 - llvmAsmParser.y | 11 - 3 files changed, 222 insertions(+), 219 deletions(-) Index: llvm/lib/AsmParser/llvmAsmParser.cpp diff -u llvm/lib/AsmParser/llvmAsmParser.cpp:1.17 llvm/lib/AsmParser/llvmAsmParser.cpp:1.18 --- llvm/lib/AsmParser/llvmAsmParser.cpp:1.17 Sat Aug 27 13:50:38 2005 +++ llvm/lib/AsmParser/llvmAsmParser.cpp Sat Oct 22 23:37:19 2005 @@ -1,7 +1,7 @@ -/* A Bison parser, made by GNU Bison 1.875c. */ +/* A Bison parser, made by GNU Bison 1.875d. */ /* Skeleton parser for Yacc-like parsing with Bison, - Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003 Free Software Foundation, Inc. + Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -251,7 +251,7 @@ /* Copy the first part of user declarations. */ -#line 14 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y" +#line 14 "/usr/home/llvm/obj/../lib/AsmParser/llvmAsmParser.y" #include "ParserInternals.h" #include "llvm/CallingConv.h" @@ -1007,7 +1007,7 @@ const Type* ArgTy = F->getFunctionType()->getReturnType(); const Type* ArgTyPtr = PointerType::get(ArgTy); Function* NF = Result->getOrInsertFunction("llvm.va_start", - RetTy, ArgTyPtr, 0); + RetTy, ArgTyPtr, (Type *)0); while (!F->use_empty()) { CallInst* CI = cast(F->use_back()); @@ -1032,7 +1032,7 @@ const Type* ArgTy = F->getFunctionType()->getParamType(0); const Type* ArgTyPtr = PointerType::get(ArgTy); Function* NF = Result->getOrInsertFunction("llvm.va_end", - RetTy, ArgTyPtr, 0); + RetTy, ArgTyPtr, (Type *)0); while (!F->use_empty()) { CallInst* CI = cast(F->use_back()); @@ -1059,7 +1059,8 @@ const Type* ArgTy = F->getFunctionType()->getReturnType(); const Type* ArgTyPtr = PointerType::get(ArgTy); Function* NF = Result->getOrInsertFunction("llvm.va_copy", - RetTy, ArgTyPtr, ArgTyPtr, 0); + RetTy, ArgTyPtr, ArgTyPtr, + (Type *)0); while (!F->use_empty()) { CallInst* CI = cast(F->use_back()); @@ -1117,7 +1118,7 @@ #endif #if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED) -#line 865 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y" +#line 866 "/usr/home/llvm/obj/../lib/AsmParser/llvmAsmParser.y" typedef union YYSTYPE { llvm::Module *ModuleVal; llvm::Function *FunctionVal; @@ -1158,7 +1159,7 @@ llvm::Module::Endianness Endianness; } YYSTYPE; /* Line 191 of yacc.c. */ -#line 1162 "llvmAsmParser.tab.c" +#line 1163 "llvmAsmParser.tab.c" # define yystype YYSTYPE /* obsolescent; will be withdrawn */ # define YYSTYPE_IS_DECLARED 1 # define YYSTYPE_IS_TRIVIAL 1 @@ -1170,7 +1171,7 @@ /* Line 214 of yacc.c. */ -#line 1174 "llvmAsmParser.tab.c" +#line 1175 "llvmAsmParser.tab.c" #if ! defined (yyoverflow) || YYERROR_VERBOSE @@ -1218,7 +1219,7 @@ /* A type that is properly aligned for any stack member. */ union yyalloc { - short yyss; + short int yyss; YYSTYPE yyvs; }; @@ -1228,7 +1229,7 @@ /* The size of an array large to enough to hold all stacks, each with N elements. */ # define YYSTACK_BYTES(N) \ - ((N) * (sizeof (short) + sizeof (YYSTYPE)) \ + ((N) * (sizeof (short int) + sizeof (YYSTYPE)) \ + YYSTACK_GAP_MAXIMUM) /* Copy COUNT objects from FROM to TO. The source and destination do @@ -1270,7 +1271,7 @@ #if defined (__STDC__) || defined (__cplusplus) typedef signed char yysigned_char; #else - typedef short yysigned_char; + typedef short int yysigned_char; #endif /* YYFINAL -- State number of the termination state. */ @@ -1337,7 +1338,7 @@ #if YYDEBUG /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in YYRHS. */ -static const unsigned short yyprhs[] = +static const unsigned short int yyprhs[] = { 0, 0, 3, 5, 7, 9, 11, 13, 15, 17, 19, 21, 23, 25, 27, 29, 31, 33, 35, 37, @@ -1364,7 +1365,7 @@ }; /* YYRHS -- A `-1'-separated list of the rules' RHS. */ -static const short yyrhs[] = +static const short int yyrhs[] = { 133, 0, -1, 5, -1, 6, -1, 3, -1, 4, -1, 66, -1, 67, -1, 68, -1, 69, -1, 70, @@ -1437,30 +1438,30 @@ }; /* YYRLINE[YYN] -- source line where rule number YYN was defined. */ -static const unsigned short yyrline[] = +static const unsigned short int yyrline[] = { - 0, 982, 982, 983, 990, 991, 1000, 1000, 1000, 1000, - 1000, 1001, 1001, 1001, 1002, 1002, 1002, 1002, 1002, 1002, - 1004, 1004, 1008, 1008, 1008, 1008, 1009, 1009, 1009, 1009, - 1010, 1010, 1011, 1011, 1014, 1017, 1021, 1022, 1023, 1024, - 1025, 1027, 1028, 1029, 1030, 1031, 1044, 1044, 1045, 1045, - 1047, 1056, 1056, 1056, 1056, 1056, 1056, 1056, 1057, 1057, - 1057, 1057, 1057, 1057, 1058, 1061, 1064, 1070, 1077, 1089, - 1093, 1104, 1113, 1116, 1124, 1128, 1133, 1134, 1137, 1140, - 1150, 1175, 1188, 1216, 1241, 1261, 1273, 1282, 1286, 1345, - 1351, 1359, 1364, 1369, 1372, 1375, 1382, 1392, 1423, 1430, - 1451, 1458, 1463, 1473, 1476, 1483, 1483, 1493, 1500, 1504, - 1507, 1510, 1523, 1543, 1545, 1549, 1553, 1555, 1557, 1562, - 1563, 1565, 1568, 1576, 1581, 1583, 1587, 1591, 1599, 1599, - 1600, 1600, 1602, 1608, 1613, 1619, 1622, 1627, 1631, 1635, - 1715, 1715, 1717, 1725, 1725, 1727, 1731, 1731, 1740, 1743, - 1746, 1749, 1752, 1755, 1758, 1761, 1785, 1792, 1795, 1800, - 1800, 1806, 1810, 1813, 1821, 1830, 1834, 1844, 1855, 1858, - 1861, 1864, 1867, 1881, 1885, 1938, 1941, 1947, 1955, 1965, - 1972, 1977, 1984, 1988, 1994, 1994, 1996, 1999, 2005, 2017, - 2025, 2035, 2047, 2054, 2061, 2068, 2073, 2092, 2114, 2128, - 2185, 2191, 2193, 2197, 2200, 2206, 2210, 2214, 2218, 2222, - 2229, 2239, 2252 + 0, 983, 983, 984, 991, 992, 1001, 1001, 1001, 1001, + 1001, 1002, 1002, 1002, 1003, 1003, 1003, 1003, 1003, 1003, + 1005, 1005, 1009, 1009, 1009, 1009, 1010, 1010, 1010, 1010, + 1011, 1011, 1012, 1012, 1015, 1018, 1022, 1023, 1024, 1025, + 1026, 1028, 1029, 1030, 1031, 1032, 1045, 1045, 1046, 1046, + 1048, 1057, 1057, 1057, 1057, 1057, 1057, 1057, 1058, 1058, + 1058, 1058, 1058, 1058, 1059, 1062, 1065, 1071, 1078, 1090, + 1094, 1105, 1114, 1117, 1125, 1129, 1134, 1135, 1138, 1141, + 1151, 1176, 1189, 1217, 1242, 1262, 1274, 1283, 1287, 1346, + 1352, 1360, 1365, 1370, 1373, 1376, 1383, 1393, 1424, 1431, + 1452, 1459, 1464, 1474, 1477, 1484, 1484, 1494, 1501, 1505, + 1508, 1511, 1524, 1544, 1546, 1550, 1554, 1556, 1558, 1563, + 1564, 1566, 1569, 1577, 1582, 1584, 1588, 1592, 1600, 1600, + 1601, 1601, 1603, 1609, 1614, 1620, 1623, 1628, 1632, 1636, + 1716, 1716, 1718, 1726, 1726, 1728, 1732, 1732, 1741, 1744, + 1747, 1750, 1753, 1756, 1759, 1762, 1786, 1793, 1796, 1801, + 1801, 1807, 1811, 1814, 1822, 1831, 1835, 1845, 1856, 1859, + 1862, 1865, 1868, 1882, 1886, 1939, 1942, 1948, 1956, 1966, + 1973, 1978, 1985, 1989, 1995, 1995, 1997, 2000, 2006, 2018, + 2026, 2036, 2048, 2055, 2062, 2069, 2074, 2093, 2115, 2129, + 2186, 2192, 2194, 2198, 2201, 2207, 2211, 2215, 2219, 2223, + 2230, 2240, 2253 }; #endif @@ -1503,7 +1504,7 @@ # ifdef YYPRINT /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to token YYLEX-NUM. */ -static const unsigned short yytoknum[] = +static const unsigned short int yytoknum[] = { 0, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, @@ -1623,7 +1624,7 @@ }; /* YYDEFGOTO[NTERM-NUM]. */ -static const short yydefgoto[] = +static const short int yydefgoto[] = { -1, 69, 222, 235, 236, 237, 238, 166, 167, 196, 168, 20, 11, 28, 70, 71, 169, 73, 74, 98, @@ -1637,7 +1638,7 @@ /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing STATE-NUM. */ #define YYPACT_NINF -383 -static const short yypact[] = +static const short int yypact[] = { -383, 48, 136, 517, -383, -383, -383, -383, -383, -383, -383, 27, 36, -383, -383, -17, -383, -383, 46, -21, @@ -1684,7 +1685,7 @@ }; /* YYPGOTO[NTERM-NUM]. */ -static const short yypgoto[] = +static const short int yypgoto[] = { -383, -383, -383, 254, 262, 264, 272, -106, -105, -372, -383, 313, 333, -101, -38, -383, -28, -383, -56, 255, @@ -1700,7 +1701,7 @@ number is the opposite. If zero, do what YYDEFACT says. If YYTABLE_NINF, syntax error. */ #define YYTABLE_NINF -108 -static const short yytable[] = +static const short int yytable[] = { 72, 170, 194, 195, 87, 77, 30, 21, 197, 291, 293, 397, 97, 33, 72, 403, 299, 42, 216, 88, @@ -1815,7 +1816,7 @@ 67, 0, 68 }; -static const short yycheck[] = +static const short int yycheck[] = { 28, 91, 108, 108, 42, 29, 23, 3, 109, 232, 233, 383, 68, 30, 42, 397, 100, 20, 100, 32, @@ -2089,12 +2090,12 @@ #if defined (__STDC__) || defined (__cplusplus) static void -yy_stack_print (short *bottom, short *top) +yy_stack_print (short int *bottom, short int *top) #else static void yy_stack_print (bottom, top) - short *bottom; - short *top; + short int *bottom; + short int *top; #endif { YYFPRINTF (stderr, "Stack now"); @@ -2361,9 +2362,9 @@ to reallocate them elsewhere. */ /* The state stack. */ - short yyssa[YYINITDEPTH]; - short *yyss = yyssa; - register short *yyssp; + short int yyssa[YYINITDEPTH]; + short int *yyss = yyssa; + register short int *yyssp; /* The semantic value stack. */ YYSTYPE yyvsa[YYINITDEPTH]; @@ -2400,6 +2401,7 @@ yyssp = yyss; yyvsp = yyvs; + goto yysetstate; /*------------------------------------------------------------. @@ -2425,7 +2427,7 @@ these so that the &'s don't force the real ones into memory. */ YYSTYPE *yyvs1 = yyvs; - short *yyss1 = yyss; + short int *yyss1 = yyss; /* Each stack pointer address is followed by the size of the @@ -2453,7 +2455,7 @@ yystacksize = YYMAXDEPTH; { - short *yyss1 = yyss; + short int *yyss1 = yyss; union yyalloc *yyptr = (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize)); if (! yyptr) @@ -2586,7 +2588,7 @@ switch (yyn) { case 3: -#line 983 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y" +#line 984 "/usr/home/llvm/obj/../lib/AsmParser/llvmAsmParser.y" { if (yyvsp[0].UIntVal > (uint32_t)INT32_MAX) // Outside of my range! ThrowException("Value too large for type!"); @@ -2595,7 +2597,7 @@ break; case 5: -#line 991 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y" +#line 992 "/usr/home/llvm/obj/../lib/AsmParser/llvmAsmParser.y" { if (yyvsp[0].UInt64Val > (uint64_t)INT64_MAX) // Outside of my range! ThrowException("Value too large for type!"); @@ -2604,66 +2606,66 @@ break; case 34: -#line 1014 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y" +#line 1015 "/usr/home/llvm/obj/../lib/AsmParser/llvmAsmParser.y" { yyval.StrVal = yyvsp[-1].StrVal; ;} break; case 35: -#line 1017 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y" +#line 1018 "/usr/home/llvm/obj/../lib/AsmParser/llvmAsmParser.y" { yyval.StrVal = 0; ;} break; case 36: -#line 1021 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y" +#line 1022 "/usr/home/llvm/obj/../lib/AsmParser/llvmAsmParser.y" { yyval.Linkage = GlobalValue::InternalLinkage; ;} break; case 37: -#line 1022 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y" +#line 1023 "/usr/home/llvm/obj/../lib/AsmParser/llvmAsmParser.y" { yyval.Linkage = GlobalValue::LinkOnceLinkage; ;} break; case 38: -#line 1023 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y" +#line 1024 "/usr/home/llvm/obj/../lib/AsmParser/llvmAsmParser.y" { yyval.Linkage = GlobalValue::WeakLinkage; ;} break; case 39: -#line 1024 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y" +#line 1025 "/usr/home/llvm/obj/../lib/AsmParser/llvmAsmParser.y" { yyval.Linkage = GlobalValue::AppendingLinkage; ;} break; case 40: -#line 1025 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y" +#line 1026 "/usr/home/llvm/obj/../lib/AsmParser/llvmAsmParser.y" { yyval.Linkage = GlobalValue::ExternalLinkage; ;} break; case 41: -#line 1027 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y" +#line 1028 "/usr/home/llvm/obj/../lib/AsmParser/llvmAsmParser.y" { yyval.UIntVal = CallingConv::C; ;} break; case 42: -#line 1028 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y" +#line 1029 "/usr/home/llvm/obj/../lib/AsmParser/llvmAsmParser.y" { yyval.UIntVal = CallingConv::C; ;} break; case 43: -#line 1029 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y" +#line 1030 "/usr/home/llvm/obj/../lib/AsmParser/llvmAsmParser.y" { yyval.UIntVal = CallingConv::Fast; ;} break; case 44: -#line 1030 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y" +#line 1031 "/usr/home/llvm/obj/../lib/AsmParser/llvmAsmParser.y" { yyval.UIntVal = CallingConv::Cold; ;} break; case 45: -#line 1031 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y" +#line 1032 "/usr/home/llvm/obj/../lib/AsmParser/llvmAsmParser.y" { if ((unsigned)yyvsp[0].UInt64Val != yyvsp[0].UInt64Val) ThrowException("Calling conv too large!"); @@ -2672,17 +2674,17 @@ break; case 47: -#line 1044 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y" +#line 1045 "/usr/home/llvm/obj/../lib/AsmParser/llvmAsmParser.y" { yyval.TypeVal = new PATypeHolder(yyvsp[0].PrimType); ;} break; case 49: -#line 1045 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y" +#line 1046 "/usr/home/llvm/obj/../lib/AsmParser/llvmAsmParser.y" { yyval.TypeVal = new PATypeHolder(yyvsp[0].PrimType); ;} break; case 50: -#line 1047 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y" +#line 1048 "/usr/home/llvm/obj/../lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) ThrowException("Invalid upreference in type: " + (*yyvsp[0].TypeVal)->getDescription()); @@ -2691,28 +2693,28 @@ break; case 64: -#line 1058 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y" +#line 1059 "/usr/home/llvm/obj/../lib/AsmParser/llvmAsmParser.y" { yyval.TypeVal = new PATypeHolder(OpaqueType::get()); ;} break; case 65: -#line 1061 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y" +#line 1062 "/usr/home/llvm/obj/../lib/AsmParser/llvmAsmParser.y" { yyval.TypeVal = new PATypeHolder(yyvsp[0].PrimType); ;} break; case 66: -#line 1064 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y" +#line 1065 "/usr/home/llvm/obj/../lib/AsmParser/llvmAsmParser.y" { // Named types are also simple types... yyval.TypeVal = new PATypeHolder(getTypeVal(yyvsp[0].ValIDVal)); ;} break; case 67: -#line 1070 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y" +#line 1071 "/usr/home/llvm/obj/../lib/AsmParser/llvmAsmParser.y" { // Type UpReference if (yyvsp[0].UInt64Val > (uint64_t)~0U) ThrowException("Value out of range!"); OpaqueType *OT = OpaqueType::get(); // Use temporary placeholder @@ -2723,7 +2725,7 @@ break; case 68: -#line 1077 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y" +#line 1078 "/usr/home/llvm/obj/../lib/AsmParser/llvmAsmParser.y" { // Function derived type? std::vector Params; for (std::list::iterator I = yyvsp[-1].TypeList->begin(), @@ -2739,7 +2741,7 @@ break; case 69: -#line 1089 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y" +#line 1090 "/usr/home/llvm/obj/../lib/AsmParser/llvmAsmParser.y" { // Sized array type? yyval.TypeVal = new PATypeHolder(HandleUpRefs(ArrayType::get(*yyvsp[-1].TypeVal, (unsigned)yyvsp[-3].UInt64Val))); delete yyvsp[-1].TypeVal; @@ -2747,7 +2749,7 @@ break; case 70: -#line 1093 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y" +#line 1094 "/usr/home/llvm/obj/../lib/AsmParser/llvmAsmParser.y" { // Packed array type? const llvm::Type* ElemTy = yyvsp[-1].TypeVal->get(); if ((unsigned)yyvsp[-3].UInt64Val != yyvsp[-3].UInt64Val) { @@ -2762,7 +2764,7 @@ break; case 71: -#line 1104 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y" +#line 1105 "/usr/home/llvm/obj/../lib/AsmParser/llvmAsmParser.y" { // Structure type? std::vector Elements; for (std::list::iterator I = yyvsp[-1].TypeList->begin(), @@ -2775,14 +2777,14 @@ break; case 72: -#line 1113 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y" +#line 1114 "/usr/home/llvm/obj/../lib/AsmParser/llvmAsmParser.y" { // Empty structure type? yyval.TypeVal = new PATypeHolder(StructType::get(std::vector())); ;} break; case 73: -#line 1116 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y" +#line 1117 "/usr/home/llvm/obj/../lib/AsmParser/llvmAsmParser.y" { // Pointer type? yyval.TypeVal = new PATypeHolder(HandleUpRefs(PointerType::get(*yyvsp[-1].TypeVal))); delete yyvsp[-1].TypeVal; @@ -2790,7 +2792,7 @@ break; case 74: -#line 1124 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y" +#line 1125 "/usr/home/llvm/obj/../lib/AsmParser/llvmAsmParser.y" { yyval.TypeList = new std::list(); yyval.TypeList->push_back(*yyvsp[0].TypeVal); delete yyvsp[0].TypeVal; @@ -2798,35 +2800,35 @@ break; case 75: -#line 1128 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y" +#line 1129 "/usr/home/llvm/obj/../lib/AsmParser/llvmAsmParser.y" { (yyval.TypeList=yyvsp[-2].TypeList)->push_back(*yyvsp[0].TypeVal); delete yyvsp[0].TypeVal; ;} break; case 77: -#line 1134 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y" +#line 1135 "/usr/home/llvm/obj/../lib/AsmParser/llvmAsmParser.y" { (yyval.TypeList=yyvsp[-2].TypeList)->push_back(Type::VoidTy); ;} break; case 78: -#line 1137 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y" +#line 1138 "/usr/home/llvm/obj/../lib/AsmParser/llvmAsmParser.y" { (yyval.TypeList = new std::list())->push_back(Type::VoidTy); ;} break; case 79: -#line 1140 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y" +#line 1141 "/usr/home/llvm/obj/../lib/AsmParser/llvmAsmParser.y" { yyval.TypeList = new std::list(); ;} break; case 80: -#line 1150 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y" +#line 1151 "/usr/home/llvm/obj/../lib/AsmParser/llvmAsmParser.y" { // Nonempty unsized arr const ArrayType *ATy = dyn_cast(yyvsp[-3].TypeVal->get()); if (ATy == 0) @@ -2855,7 +2857,7 @@ break; case 81: -#line 1175 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y" +#line 1176 "/usr/home/llvm/obj/../lib/AsmParser/llvmAsmParser.y" { const ArrayType *ATy = dyn_cast(yyvsp[-2].TypeVal->get()); if (ATy == 0) @@ -2872,7 +2874,7 @@ break; case 82: -#line 1188 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y" +#line 1189 "/usr/home/llvm/obj/../lib/AsmParser/llvmAsmParser.y" { const ArrayType *ATy = dyn_cast(yyvsp[-2].TypeVal->get()); if (ATy == 0) @@ -2904,7 +2906,7 @@ break; case 83: -#line 1216 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y" +#line 1217 "/usr/home/llvm/obj/../lib/AsmParser/llvmAsmParser.y" { // Nonempty unsized arr const PackedType *PTy = dyn_cast(yyvsp[-3].TypeVal->get()); if (PTy == 0) @@ -2933,7 +2935,7 @@ break; case 84: -#line 1241 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y" +#line 1242 "/usr/home/llvm/obj/../lib/AsmParser/llvmAsmParser.y" { const StructType *STy = dyn_cast(yyvsp[-3].TypeVal->get()); if (STy == 0) @@ -2957,7 +2959,7 @@ break; case 85: -#line 1261 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y" +#line 1262 "/usr/home/llvm/obj/../lib/AsmParser/llvmAsmParser.y" { const StructType *STy = dyn_cast(yyvsp[-2].TypeVal->get()); if (STy == 0) @@ -2973,7 +2975,7 @@ break; case 86: -#line 1273 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y" +#line 1274 "/usr/home/llvm/obj/../lib/AsmParser/llvmAsmParser.y" { const PointerType *PTy = dyn_cast(yyvsp[-1].TypeVal->get()); if (PTy == 0) @@ -2986,7 +2988,7 @@ break; case 87: -#line 1282 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y" +#line 1283 "/usr/home/llvm/obj/../lib/AsmParser/llvmAsmParser.y" { yyval.ConstVal = UndefValue::get(yyvsp[-1].TypeVal->get()); delete yyvsp[-1].TypeVal; @@ -2994,7 +2996,7 @@ break; case 88: -#line 1286 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y" +#line 1287 "/usr/home/llvm/obj/../lib/AsmParser/llvmAsmParser.y" { const PointerType *Ty = dyn_cast(yyvsp[-1].TypeVal->get()); if (Ty == 0) @@ -3057,7 +3059,7 @@ break; case 89: -#line 1345 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y" +#line 1346 "/usr/home/llvm/obj/../lib/AsmParser/llvmAsmParser.y" { if (yyvsp[-1].TypeVal->get() != yyvsp[0].ConstVal->getType()) ThrowException("Mismatched types for constant expression!"); @@ -3067,7 +3069,7 @@ break; case 90: -#line 1351 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y" +#line 1352 "/usr/home/llvm/obj/../lib/AsmParser/llvmAsmParser.y" { const Type *Ty = yyvsp[-1].TypeVal->get(); if (isa(Ty) || Ty == Type::LabelTy || isa(Ty)) @@ -3078,7 +3080,7 @@ break; case 91: -#line 1359 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y" +#line 1360 "/usr/home/llvm/obj/../lib/AsmParser/llvmAsmParser.y" { // integral constants if (!ConstantSInt::isValueValidForType(yyvsp[-1].PrimType, yyvsp[0].SInt64Val)) ThrowException("Constant value doesn't fit in type!"); @@ -3087,7 +3089,7 @@ break; case 92: -#line 1364 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y" +#line 1365 "/usr/home/llvm/obj/../lib/AsmParser/llvmAsmParser.y" { // integral constants if (!ConstantUInt::isValueValidForType(yyvsp[-1].PrimType, yyvsp[0].UInt64Val)) ThrowException("Constant value doesn't fit in type!"); @@ -3096,21 +3098,21 @@ break; case 93: -#line 1369 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y" +#line 1370 "/usr/home/llvm/obj/../lib/AsmParser/llvmAsmParser.y" { // Boolean constants yyval.ConstVal = ConstantBool::True; ;} break; case 94: -#line 1372 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y" +#line 1373 "/usr/home/llvm/obj/../lib/AsmParser/llvmAsmParser.y" { // Boolean constants yyval.ConstVal = ConstantBool::False; ;} break; case 95: -#line 1375 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y" +#line 1376 "/usr/home/llvm/obj/../lib/AsmParser/llvmAsmParser.y" { // Float & Double constants if (!ConstantFP::isValueValidForType(yyvsp[-1].PrimType, yyvsp[0].FPVal)) ThrowException("Floating point constant invalid for type!!"); @@ -3119,7 +3121,7 @@ break; case 96: -#line 1382 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y" +#line 1383 "/usr/home/llvm/obj/../lib/AsmParser/llvmAsmParser.y" { if (!yyvsp[-3].ConstVal->getType()->isFirstClassType()) ThrowException("cast constant expression from a non-primitive type: '" + @@ -3133,7 +3135,7 @@ break; case 97: -#line 1392 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y" +#line 1393 "/usr/home/llvm/obj/../lib/AsmParser/llvmAsmParser.y" { if (!isa(yyvsp[-2].ConstVal->getType())) ThrowException("GetElementPtr requires a pointer operand!"); @@ -3168,7 +3170,7 @@ break; case 98: -#line 1423 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y" +#line 1424 "/usr/home/llvm/obj/../lib/AsmParser/llvmAsmParser.y" { if (yyvsp[-5].ConstVal->getType() != Type::BoolTy) ThrowException("Select condition must be of boolean type!"); @@ -3179,7 +3181,7 @@ break; case 99: -#line 1430 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y" +#line 1431 "/usr/home/llvm/obj/../lib/AsmParser/llvmAsmParser.y" { if (yyvsp[-3].ConstVal->getType() != yyvsp[-1].ConstVal->getType()) ThrowException("Binary operator types must match!"); @@ -3204,7 +3206,7 @@ break; case 100: -#line 1451 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y" +#line 1452 "/usr/home/llvm/obj/../lib/AsmParser/llvmAsmParser.y" { if (yyvsp[-3].ConstVal->getType() != yyvsp[-1].ConstVal->getType()) ThrowException("Logical operator types must match!"); @@ -3215,7 +3217,7 @@ break; case 101: -#line 1458 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y" +#line 1459 "/usr/home/llvm/obj/../lib/AsmParser/llvmAsmParser.y" { if (yyvsp[-3].ConstVal->getType() != yyvsp[-1].ConstVal->getType()) ThrowException("setcc operand types must match!"); @@ -3224,7 +3226,7 @@ break; case 102: -#line 1463 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y" +#line 1464 "/usr/home/llvm/obj/../lib/AsmParser/llvmAsmParser.y" { if (yyvsp[-1].ConstVal->getType() != Type::UByteTy) ThrowException("Shift count for shift constant must be unsigned byte!"); @@ -3235,14 +3237,14 @@ break; case 103: -#line 1473 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y" +#line 1474 "/usr/home/llvm/obj/../lib/AsmParser/llvmAsmParser.y" { (yyval.ConstVector = yyvsp[-2].ConstVector)->push_back(yyvsp[0].ConstVal); ;} break; case 104: -#line 1476 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y" +#line 1477 "/usr/home/llvm/obj/../lib/AsmParser/llvmAsmParser.y" { yyval.ConstVector = new std::vector(); yyval.ConstVector->push_back(yyvsp[0].ConstVal); @@ -3250,17 +3252,17 @@ break; case 105: -#line 1483 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y" +#line 1484 "/usr/home/llvm/obj/../lib/AsmParser/llvmAsmParser.y" { yyval.BoolVal = false; ;} break; case 106: -#line 1483 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y" +#line 1484 "/usr/home/llvm/obj/../lib/AsmParser/llvmAsmParser.y" { yyval.BoolVal = true; ;} break; case 107: -#line 1493 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y" +#line 1494 "/usr/home/llvm/obj/../lib/AsmParser/llvmAsmParser.y" { yyval.ModuleVal = ParserResult = yyvsp[0].ModuleVal; CurModule.ModuleDone(); @@ -3268,7 +3270,7 @@ break; case 108: -#line 1500 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y" +#line 1501 "/usr/home/llvm/obj/../lib/AsmParser/llvmAsmParser.y" { yyval.ModuleVal = yyvsp[-1].ModuleVal; CurFun.FunctionDone(); @@ -3276,21 +3278,21 @@ break; case 109: -#line 1504 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y" +#line 1505 "/usr/home/llvm/obj/../lib/AsmParser/llvmAsmParser.y" { yyval.ModuleVal = yyvsp[-1].ModuleVal; ;} break; case 110: -#line 1507 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y" +#line 1508 "/usr/home/llvm/obj/../lib/AsmParser/llvmAsmParser.y" { yyval.ModuleVal = yyvsp[-1].ModuleVal; ;} break; case 111: -#line 1510 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y" +#line 1511 "/usr/home/llvm/obj/../lib/AsmParser/llvmAsmParser.y" { yyval.ModuleVal = CurModule.CurrentModule; // Emit an error if there are any unresolved types left. @@ -3305,7 +3307,7 @@ break; case 112: -#line 1523 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y" +#line 1524 "/usr/home/llvm/obj/../lib/AsmParser/llvmAsmParser.y" { // Eagerly resolve types. This is not an optimization, this is a // requirement that is due to the fact that we could have this: @@ -3329,13 +3331,13 @@ break; case 113: -#line 1543 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y" +#line 1544 "/usr/home/llvm/obj/../lib/AsmParser/llvmAsmParser.y" { // Function prototypes can be in const pool ;} break; case 114: -#line 1545 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y" +#line 1546 "/usr/home/llvm/obj/../lib/AsmParser/llvmAsmParser.y" { if (yyvsp[0].ConstVal == 0) ThrowException("Global value initializer is not a constant!"); ParseGlobalVariable(yyvsp[-3].StrVal, yyvsp[-2].Linkage, yyvsp[-1].BoolVal, yyvsp[0].ConstVal->getType(), yyvsp[0].ConstVal); @@ -3343,7 +3345,7 @@ break; case 115: -#line 1549 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y" +#line 1550 "/usr/home/llvm/obj/../lib/AsmParser/llvmAsmParser.y" { ParseGlobalVariable(yyvsp[-3].StrVal, GlobalValue::ExternalLinkage, yyvsp[-1].BoolVal, *yyvsp[0].TypeVal, 0); delete yyvsp[0].TypeVal; @@ -3351,42 +3353,42 @@ break; case 116: -#line 1553 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y" +#line 1554 "/usr/home/llvm/obj/../lib/AsmParser/llvmAsmParser.y" { ;} break; case 117: -#line 1555 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y" +#line 1556 "/usr/home/llvm/obj/../lib/AsmParser/llvmAsmParser.y" { ;} break; case 118: -#line 1557 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y" +#line 1558 "/usr/home/llvm/obj/../lib/AsmParser/llvmAsmParser.y" { ;} break; case 119: -#line 1562 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y" +#line 1563 "/usr/home/llvm/obj/../lib/AsmParser/llvmAsmParser.y" { yyval.Endianness = Module::BigEndian; ;} break; case 120: -#line 1563 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y" +#line 1564 "/usr/home/llvm/obj/../lib/AsmParser/llvmAsmParser.y" { yyval.Endianness = Module::LittleEndian; ;} break; case 121: -#line 1565 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y" +#line 1566 "/usr/home/llvm/obj/../lib/AsmParser/llvmAsmParser.y" { CurModule.CurrentModule->setEndianness(yyvsp[0].Endianness); ;} break; case 122: -#line 1568 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y" +#line 1569 "/usr/home/llvm/obj/../lib/AsmParser/llvmAsmParser.y" { if (yyvsp[0].UInt64Val == 32) CurModule.CurrentModule->setPointerSize(Module::Pointer32); @@ -3398,7 +3400,7 @@ break; case 123: -#line 1576 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y" +#line 1577 "/usr/home/llvm/obj/../lib/AsmParser/llvmAsmParser.y" { CurModule.CurrentModule->setTargetTriple(yyvsp[0].StrVal); free(yyvsp[0].StrVal); @@ -3406,7 +3408,7 @@ break; case 125: -#line 1583 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y" +#line 1584 "/usr/home/llvm/obj/../lib/AsmParser/llvmAsmParser.y" { CurModule.CurrentModule->addLibrary(yyvsp[0].StrVal); free(yyvsp[0].StrVal); @@ -3414,7 +3416,7 @@ break; case 126: -#line 1587 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y" +#line 1588 "/usr/home/llvm/obj/../lib/AsmParser/llvmAsmParser.y" { CurModule.CurrentModule->addLibrary(yyvsp[0].StrVal); free(yyvsp[0].StrVal); @@ -3422,18 +3424,18 @@ break; case 127: -#line 1591 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y" +#line 1592 "/usr/home/llvm/obj/../lib/AsmParser/llvmAsmParser.y" { ;} break; case 131: -#line 1600 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y" +#line 1601 "/usr/home/llvm/obj/../lib/AsmParser/llvmAsmParser.y" { yyval.StrVal = 0; ;} break; case 132: -#line 1602 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y" +#line 1603 "/usr/home/llvm/obj/../lib/AsmParser/llvmAsmParser.y" { if (*yyvsp[-1].TypeVal == Type::VoidTy) ThrowException("void typed arguments are invalid!"); @@ -3442,7 +3444,7 @@ break; case 133: -#line 1608 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y" +#line 1609 "/usr/home/llvm/obj/../lib/AsmParser/llvmAsmParser.y" { yyval.ArgList = yyvsp[-2].ArgList; yyvsp[-2].ArgList->push_back(*yyvsp[0].ArgVal); @@ -3451,7 +3453,7 @@ break; case 134: -#line 1613 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y" +#line 1614 "/usr/home/llvm/obj/../lib/AsmParser/llvmAsmParser.y" { yyval.ArgList = new std::vector >(); yyval.ArgList->push_back(*yyvsp[0].ArgVal); @@ -3460,14 +3462,14 @@ break; case 135: -#line 1619 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y" +#line 1620 "/usr/home/llvm/obj/../lib/AsmParser/llvmAsmParser.y" { yyval.ArgList = yyvsp[0].ArgList; ;} break; case 136: -#line 1622 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y" +#line 1623 "/usr/home/llvm/obj/../lib/AsmParser/llvmAsmParser.y" { yyval.ArgList = yyvsp[-2].ArgList; yyval.ArgList->push_back(std::pair >(); yyval.ArgList->push_back(std::make_pair(new PATypeHolder(Type::VoidTy), (char*)0)); @@ -3484,14 +3486,14 @@ break; case 138: -#line 1631 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y" +#line 1632 "/usr/home/llvm/obj/../lib/AsmParser/llvmAsmParser.y" { yyval.ArgList = 0; ;} break; case 139: -#line 1635 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y" +#line 1636 "/usr/home/llvm/obj/../lib/AsmParser/llvmAsmParser.y" { UnEscapeLexed(yyvsp[-3].StrVal); std::string FunctionName(yyvsp[-3].StrVal); @@ -3574,7 +3576,7 @@ break; case 142: -#line 1717 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y" +#line 1718 "/usr/home/llvm/obj/../lib/AsmParser/llvmAsmParser.y" { yyval.FunctionVal = CurFun.CurrentFunction; @@ -3585,19 +3587,19 @@ break; case 145: -#line 1727 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y" +#line 1728 "/usr/home/llvm/obj/../lib/AsmParser/llvmAsmParser.y" { yyval.FunctionVal = yyvsp[-1].FunctionVal; ;} break; case 146: -#line 1731 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y" +#line 1732 "/usr/home/llvm/obj/../lib/AsmParser/llvmAsmParser.y" { CurFun.isDeclare = true; ;} break; case 147: -#line 1731 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y" +#line 1732 "/usr/home/llvm/obj/../lib/AsmParser/llvmAsmParser.y" { yyval.FunctionVal = CurFun.CurrentFunction; CurFun.FunctionDone(); @@ -3605,56 +3607,56 @@ break; case 148: -#line 1740 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y" +#line 1741 "/usr/home/llvm/obj/../lib/AsmParser/llvmAsmParser.y" { // A reference to a direct constant yyval.ValIDVal = ValID::create(yyvsp[0].SInt64Val); ;} break; case 149: -#line 1743 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y" +#line 1744 "/usr/home/llvm/obj/../lib/AsmParser/llvmAsmParser.y" { yyval.ValIDVal = ValID::create(yyvsp[0].UInt64Val); ;} break; case 150: -#line 1746 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y" +#line 1747 "/usr/home/llvm/obj/../lib/AsmParser/llvmAsmParser.y" { // Perhaps it's an FP constant? yyval.ValIDVal = ValID::create(yyvsp[0].FPVal); ;} break; case 151: -#line 1749 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y" +#line 1750 "/usr/home/llvm/obj/../lib/AsmParser/llvmAsmParser.y" { yyval.ValIDVal = ValID::create(ConstantBool::True); ;} break; case 152: -#line 1752 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y" +#line 1753 "/usr/home/llvm/obj/../lib/AsmParser/llvmAsmParser.y" { yyval.ValIDVal = ValID::create(ConstantBool::False); ;} break; case 153: -#line 1755 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y" +#line 1756 "/usr/home/llvm/obj/../lib/AsmParser/llvmAsmParser.y" { yyval.ValIDVal = ValID::createNull(); ;} break; case 154: -#line 1758 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y" +#line 1759 "/usr/home/llvm/obj/../lib/AsmParser/llvmAsmParser.y" { yyval.ValIDVal = ValID::createUndef(); ;} break; case 155: -#line 1761 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y" +#line 1762 "/usr/home/llvm/obj/../lib/AsmParser/llvmAsmParser.y" { // Nonempty unsized packed vector const Type *ETy = (*yyvsp[-1].ConstVector)[0]->getType(); int NumElements = yyvsp[-1].ConstVector->size(); @@ -3682,49 +3684,49 @@ break; case 156: -#line 1785 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y" +#line 1786 "/usr/home/llvm/obj/../lib/AsmParser/llvmAsmParser.y" { yyval.ValIDVal = ValID::create(yyvsp[0].ConstVal); ;} break; case 157: -#line 1792 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y" +#line 1793 "/usr/home/llvm/obj/../lib/AsmParser/llvmAsmParser.y" { // Is it an integer reference...? yyval.ValIDVal = ValID::create(yyvsp[0].SIntVal); ;} break; case 158: -#line 1795 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y" +#line 1796 "/usr/home/llvm/obj/../lib/AsmParser/llvmAsmParser.y" { // Is it a named reference...? yyval.ValIDVal = ValID::create(yyvsp[0].StrVal); ;} break; case 161: -#line 1806 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y" +#line 1807 "/usr/home/llvm/obj/../lib/AsmParser/llvmAsmParser.y" { yyval.ValueVal = getVal(*yyvsp[-1].TypeVal, yyvsp[0].ValIDVal); delete yyvsp[-1].TypeVal; ;} break; case 162: -#line 1810 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y" +#line 1811 "/usr/home/llvm/obj/../lib/AsmParser/llvmAsmParser.y" { yyval.FunctionVal = yyvsp[-1].FunctionVal; ;} break; case 163: -#line 1813 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y" +#line 1814 "/usr/home/llvm/obj/../lib/AsmParser/llvmAsmParser.y" { // Do not allow functions with 0 basic blocks yyval.FunctionVal = yyvsp[-1].FunctionVal; ;} break; case 164: -#line 1821 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y" +#line 1822 "/usr/home/llvm/obj/../lib/AsmParser/llvmAsmParser.y" { setValueName(yyvsp[0].TermInstVal, yyvsp[-1].StrVal); InsertValue(yyvsp[0].TermInstVal); @@ -3736,7 +3738,7 @@ break; case 165: -#line 1830 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y" +#line 1831 "/usr/home/llvm/obj/../lib/AsmParser/llvmAsmParser.y" { yyvsp[-1].BasicBlockVal->getInstList().push_back(yyvsp[0].InstVal); yyval.BasicBlockVal = yyvsp[-1].BasicBlockVal; @@ -3744,7 +3746,7 @@ break; case 166: -#line 1834 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y" +#line 1835 "/usr/home/llvm/obj/../lib/AsmParser/llvmAsmParser.y" { yyval.BasicBlockVal = CurBB = getBBVal(ValID::create((int)CurFun.NextBBNum++), true); @@ -3758,7 +3760,7 @@ break; case 167: -#line 1844 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y" +#line 1845 "/usr/home/llvm/obj/../lib/AsmParser/llvmAsmParser.y" { yyval.BasicBlockVal = CurBB = getBBVal(ValID::create(yyvsp[0].StrVal), true); @@ -3772,35 +3774,35 @@ break; case 168: -#line 1855 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y" +#line 1856 "/usr/home/llvm/obj/../lib/AsmParser/llvmAsmParser.y" { // Return with a result... yyval.TermInstVal = new ReturnInst(yyvsp[0].ValueVal); ;} break; case 169: -#line 1858 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y" +#line 1859 "/usr/home/llvm/obj/../lib/AsmParser/llvmAsmParser.y" { // Return with no result... yyval.TermInstVal = new ReturnInst(); ;} break; case 170: -#line 1861 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y" +#line 1862 "/usr/home/llvm/obj/../lib/AsmParser/llvmAsmParser.y" { // Unconditional Branch... yyval.TermInstVal = new BranchInst(getBBVal(yyvsp[0].ValIDVal)); ;} break; case 171: -#line 1864 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y" +#line 1865 "/usr/home/llvm/obj/../lib/AsmParser/llvmAsmParser.y" { yyval.TermInstVal = new BranchInst(getBBVal(yyvsp[-3].ValIDVal), getBBVal(yyvsp[0].ValIDVal), getVal(Type::BoolTy, yyvsp[-6].ValIDVal)); ;} break; case 172: -#line 1867 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y" +#line 1868 "/usr/home/llvm/obj/../lib/AsmParser/llvmAsmParser.y" { SwitchInst *S = new SwitchInst(getVal(yyvsp[-7].PrimType, yyvsp[-6].ValIDVal), getBBVal(yyvsp[-3].ValIDVal), yyvsp[-1].JumpTable->size()); yyval.TermInstVal = S; @@ -3818,7 +3820,7 @@ break; case 173: -#line 1881 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y" +#line 1882 "/usr/home/llvm/obj/../lib/AsmParser/llvmAsmParser.y" { SwitchInst *S = new SwitchInst(getVal(yyvsp[-6].PrimType, yyvsp[-5].ValIDVal), getBBVal(yyvsp[-2].ValIDVal), 0); yyval.TermInstVal = S; @@ -3826,7 +3828,7 @@ break; case 174: -#line 1886 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y" +#line 1887 "/usr/home/llvm/obj/../lib/AsmParser/llvmAsmParser.y" { const PointerType *PFTy; const FunctionType *Ty; @@ -3882,21 +3884,21 @@ break; case 175: -#line 1938 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y" +#line 1939 "/usr/home/llvm/obj/../lib/AsmParser/llvmAsmParser.y" { yyval.TermInstVal = new UnwindInst(); ;} break; case 176: -#line 1941 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y" +#line 1942 "/usr/home/llvm/obj/../lib/AsmParser/llvmAsmParser.y" { yyval.TermInstVal = new UnreachableInst(); ;} break; case 177: -#line 1947 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y" +#line 1948 "/usr/home/llvm/obj/../lib/AsmParser/llvmAsmParser.y" { yyval.JumpTable = yyvsp[-5].JumpTable; Constant *V = cast(getValNonImprovising(yyvsp[-4].PrimType, yyvsp[-3].ValIDVal)); @@ -3908,7 +3910,7 @@ break; case 178: -#line 1955 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y" +#line 1956 "/usr/home/llvm/obj/../lib/AsmParser/llvmAsmParser.y" { yyval.JumpTable = new std::vector >(); Constant *V = cast(getValNonImprovising(yyvsp[-4].PrimType, yyvsp[-3].ValIDVal)); @@ -3921,7 +3923,7 @@ break; case 179: -#line 1965 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y" +#line 1966 "/usr/home/llvm/obj/../lib/AsmParser/llvmAsmParser.y" { // Is this definition named?? if so, assign the name... setValueName(yyvsp[0].InstVal, yyvsp[-1].StrVal); @@ -3931,7 +3933,7 @@ break; case 180: -#line 1972 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y" +#line 1973 "/usr/home/llvm/obj/../lib/AsmParser/llvmAsmParser.y" { // Used for PHI nodes yyval.PHIList = new std::list >(); yyval.PHIList->push_back(std::make_pair(getVal(*yyvsp[-5].TypeVal, yyvsp[-3].ValIDVal), getBBVal(yyvsp[-1].ValIDVal))); @@ -3940,7 +3942,7 @@ break; case 181: -#line 1977 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y" +#line 1978 "/usr/home/llvm/obj/../lib/AsmParser/llvmAsmParser.y" { yyval.PHIList = yyvsp[-6].PHIList; yyvsp[-6].PHIList->push_back(std::make_pair(getVal(yyvsp[-6].PHIList->front().first->getType(), yyvsp[-3].ValIDVal), @@ -3949,7 +3951,7 @@ break; case 182: -#line 1984 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y" +#line 1985 "/usr/home/llvm/obj/../lib/AsmParser/llvmAsmParser.y" { // Used for call statements, and memory insts... yyval.ValueList = new std::vector(); yyval.ValueList->push_back(yyvsp[0].ValueVal); @@ -3957,7 +3959,7 @@ break; case 183: -#line 1988 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y" +#line 1989 "/usr/home/llvm/obj/../lib/AsmParser/llvmAsmParser.y" { yyval.ValueList = yyvsp[-2].ValueList; yyvsp[-2].ValueList->push_back(yyvsp[0].ValueVal); @@ -3965,26 +3967,26 @@ break; case 185: -#line 1994 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y" +#line 1995 "/usr/home/llvm/obj/../lib/AsmParser/llvmAsmParser.y" { yyval.ValueList = 0; ;} break; case 186: -#line 1996 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y" +#line 1997 "/usr/home/llvm/obj/../lib/AsmParser/llvmAsmParser.y" { yyval.BoolVal = true; ;} break; case 187: -#line 1999 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y" +#line 2000 "/usr/home/llvm/obj/../lib/AsmParser/llvmAsmParser.y" { yyval.BoolVal = false; ;} break; case 188: -#line 2005 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y" +#line 2006 "/usr/home/llvm/obj/../lib/AsmParser/llvmAsmParser.y" { if (!(*yyvsp[-3].TypeVal)->isInteger() && !(*yyvsp[-3].TypeVal)->isFloatingPoint() && !isa((*yyvsp[-3].TypeVal).get())) @@ -4000,7 +4002,7 @@ break; case 189: -#line 2017 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y" +#line 2018 "/usr/home/llvm/obj/../lib/AsmParser/llvmAsmParser.y" { if (!(*yyvsp[-3].TypeVal)->isIntegral()) ThrowException("Logical operator requires integral operands!"); @@ -4012,7 +4014,7 @@ break; case 190: -#line 2025 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y" +#line 2026 "/usr/home/llvm/obj/../lib/AsmParser/llvmAsmParser.y" { if(isa((*yyvsp[-3].TypeVal).get())) { ThrowException( @@ -4026,7 +4028,7 @@ break; case 191: -#line 2035 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y" +#line 2036 "/usr/home/llvm/obj/../lib/AsmParser/llvmAsmParser.y" { std::cerr << "WARNING: Use of eliminated 'not' instruction:" << " Replacing with 'xor'.\n"; @@ -4042,7 +4044,7 @@ break; case 192: -#line 2047 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y" +#line 2048 "/usr/home/llvm/obj/../lib/AsmParser/llvmAsmParser.y" { if (yyvsp[0].ValueVal->getType() != Type::UByteTy) ThrowException("Shift amount must be ubyte!"); @@ -4053,7 +4055,7 @@ break; case 193: -#line 2054 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y" +#line 2055 "/usr/home/llvm/obj/../lib/AsmParser/llvmAsmParser.y" { if (!yyvsp[0].TypeVal->get()->isFirstClassType()) ThrowException("cast instruction to a non-primitive type: '" + @@ -4064,7 +4066,7 @@ break; case 194: -#line 2061 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y" +#line 2062 "/usr/home/llvm/obj/../lib/AsmParser/llvmAsmParser.y" { if (yyvsp[-4].ValueVal->getType() != Type::BoolTy) ThrowException("select condition must be boolean!"); @@ -4075,7 +4077,7 @@ break; case 195: -#line 2068 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y" +#line 2069 "/usr/home/llvm/obj/../lib/AsmParser/llvmAsmParser.y" { NewVarArgs = true; yyval.InstVal = new VAArgInst(yyvsp[-2].ValueVal, *yyvsp[0].TypeVal); @@ -4084,12 +4086,12 @@ break; case 196: -#line 2073 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y" +#line 2074 "/usr/home/llvm/obj/../lib/AsmParser/llvmAsmParser.y" { ObsoleteVarArgs = true; const Type* ArgTy = yyvsp[-2].ValueVal->getType(); Function* NF = CurModule.CurrentModule-> - getOrInsertFunction("llvm.va_copy", ArgTy, ArgTy, 0); + getOrInsertFunction("llvm.va_copy", ArgTy, ArgTy, (Type *)0); //b = vaarg a, t -> //foo = alloca 1 of t @@ -4107,12 +4109,12 @@ break; case 197: -#line 2092 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y" +#line 2093 "/usr/home/llvm/obj/../lib/AsmParser/llvmAsmParser.y" { ObsoleteVarArgs = true; const Type* ArgTy = yyvsp[-2].ValueVal->getType(); Function* NF = CurModule.CurrentModule-> - getOrInsertFunction("llvm.va_copy", ArgTy, ArgTy, 0); + getOrInsertFunction("llvm.va_copy", ArgTy, ArgTy, (Type *)0); //b = vanext a, t -> //foo = alloca 1 of t @@ -4133,7 +4135,7 @@ break; case 198: -#line 2114 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y" +#line 2115 "/usr/home/llvm/obj/../lib/AsmParser/llvmAsmParser.y" { const Type *Ty = yyvsp[0].PHIList->front().first->getType(); if (!Ty->isFirstClassType()) @@ -4151,7 +4153,7 @@ break; case 199: -#line 2128 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y" +#line 2129 "/usr/home/llvm/obj/../lib/AsmParser/llvmAsmParser.y" { const PointerType *PFTy; const FunctionType *Ty; @@ -4212,42 +4214,42 @@ break; case 200: -#line 2185 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y" +#line 2186 "/usr/home/llvm/obj/../lib/AsmParser/llvmAsmParser.y" { yyval.InstVal = yyvsp[0].InstVal; ;} break; case 201: -#line 2191 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y" +#line 2192 "/usr/home/llvm/obj/../lib/AsmParser/llvmAsmParser.y" { yyval.ValueList = yyvsp[0].ValueList; ;} break; case 202: -#line 2193 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y" +#line 2194 "/usr/home/llvm/obj/../lib/AsmParser/llvmAsmParser.y" { yyval.ValueList = new std::vector(); ;} break; case 203: -#line 2197 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y" +#line 2198 "/usr/home/llvm/obj/../lib/AsmParser/llvmAsmParser.y" { yyval.BoolVal = true; ;} break; case 204: -#line 2200 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y" +#line 2201 "/usr/home/llvm/obj/../lib/AsmParser/llvmAsmParser.y" { yyval.BoolVal = false; ;} break; case 205: -#line 2206 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y" +#line 2207 "/usr/home/llvm/obj/../lib/AsmParser/llvmAsmParser.y" { yyval.InstVal = new MallocInst(*yyvsp[0].TypeVal); delete yyvsp[0].TypeVal; @@ -4255,7 +4257,7 @@ break; case 206: -#line 2210 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y" +#line 2211 "/usr/home/llvm/obj/../lib/AsmParser/llvmAsmParser.y" { yyval.InstVal = new MallocInst(*yyvsp[-3].TypeVal, getVal(yyvsp[-1].PrimType, yyvsp[0].ValIDVal)); delete yyvsp[-3].TypeVal; @@ -4263,7 +4265,7 @@ break; case 207: -#line 2214 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y" +#line 2215 "/usr/home/llvm/obj/../lib/AsmParser/llvmAsmParser.y" { yyval.InstVal = new AllocaInst(*yyvsp[0].TypeVal); delete yyvsp[0].TypeVal; @@ -4271,7 +4273,7 @@ break; case 208: -#line 2218 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y" +#line 2219 "/usr/home/llvm/obj/../lib/AsmParser/llvmAsmParser.y" { yyval.InstVal = new AllocaInst(*yyvsp[-3].TypeVal, getVal(yyvsp[-1].PrimType, yyvsp[0].ValIDVal)); delete yyvsp[-3].TypeVal; @@ -4279,7 +4281,7 @@ break; case 209: -#line 2222 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y" +#line 2223 "/usr/home/llvm/obj/../lib/AsmParser/llvmAsmParser.y" { if (!isa(yyvsp[0].ValueVal->getType())) ThrowException("Trying to free nonpointer type " + @@ -4289,7 +4291,7 @@ break; case 210: -#line 2229 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y" +#line 2230 "/usr/home/llvm/obj/../lib/AsmParser/llvmAsmParser.y" { if (!isa(yyvsp[-1].TypeVal->get())) ThrowException("Can't load from nonpointer type: " + @@ -4303,7 +4305,7 @@ break; case 211: -#line 2239 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y" +#line 2240 "/usr/home/llvm/obj/../lib/AsmParser/llvmAsmParser.y" { const PointerType *PT = dyn_cast(yyvsp[-1].TypeVal->get()); if (!PT) @@ -4320,7 +4322,7 @@ break; case 212: -#line 2252 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y" +#line 2253 "/usr/home/llvm/obj/../lib/AsmParser/llvmAsmParser.y" { if (!isa(yyvsp[-2].TypeVal->get())) ThrowException("getelementptr insn requires pointer operand!"); @@ -4347,8 +4349,8 @@ } -/* Line 1000 of yacc.c. */ -#line 4352 "llvmAsmParser.tab.c" +/* Line 1010 of yacc.c. */ +#line 4354 "llvmAsmParser.tab.c" yyvsp -= yylen; yyssp -= yylen; @@ -4573,7 +4575,7 @@ } -#line 2275 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y" +#line 2276 "/usr/home/llvm/obj/../lib/AsmParser/llvmAsmParser.y" int yyerror(const char *ErrorMsg) { std::string where Index: llvm/lib/AsmParser/llvmAsmParser.h diff -u llvm/lib/AsmParser/llvmAsmParser.h:1.9 llvm/lib/AsmParser/llvmAsmParser.h:1.10 --- llvm/lib/AsmParser/llvmAsmParser.h:1.9 Sat Aug 27 13:50:38 2005 +++ llvm/lib/AsmParser/llvmAsmParser.h Sat Oct 22 23:37:20 2005 @@ -1,7 +1,7 @@ -/* A Bison parser, made by GNU Bison 1.875c. */ +/* A Bison parser, made by GNU Bison 1.875d. */ /* Skeleton parser for Yacc-like parsing with Bison, - Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003 Free Software Foundation, Inc. + Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -218,7 +218,7 @@ #if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED) -#line 865 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y" +#line 866 "/usr/home/llvm/obj/../lib/AsmParser/llvmAsmParser.y" typedef union YYSTYPE { llvm::Module *ModuleVal; llvm::Function *FunctionVal; @@ -258,7 +258,7 @@ llvm::Instruction::OtherOps OtherOpVal; llvm::Module::Endianness Endianness; } YYSTYPE; -/* Line 1275 of yacc.c. */ +/* Line 1285 of yacc.c. */ #line 263 "llvmAsmParser.tab.h" # define yystype YYSTYPE /* obsolescent; will be withdrawn */ # define YYSTYPE_IS_DECLARED 1 Index: llvm/lib/AsmParser/llvmAsmParser.y diff -u llvm/lib/AsmParser/llvmAsmParser.y:1.231 llvm/lib/AsmParser/llvmAsmParser.y:1.232 --- llvm/lib/AsmParser/llvmAsmParser.y:1.231 Fri Jun 24 13:00:40 2005 +++ llvm/lib/AsmParser/llvmAsmParser.y Sat Oct 22 23:37:20 2005 @@ -766,7 +766,7 @@ const Type* ArgTy = F->getFunctionType()->getReturnType(); const Type* ArgTyPtr = PointerType::get(ArgTy); Function* NF = Result->getOrInsertFunction("llvm.va_start", - RetTy, ArgTyPtr, 0); + RetTy, ArgTyPtr, (Type *)0); while (!F->use_empty()) { CallInst* CI = cast(F->use_back()); @@ -791,7 +791,7 @@ const Type* ArgTy = F->getFunctionType()->getParamType(0); const Type* ArgTyPtr = PointerType::get(ArgTy); Function* NF = Result->getOrInsertFunction("llvm.va_end", - RetTy, ArgTyPtr, 0); + RetTy, ArgTyPtr, (Type *)0); while (!F->use_empty()) { CallInst* CI = cast(F->use_back()); @@ -818,7 +818,8 @@ const Type* ArgTy = F->getFunctionType()->getReturnType(); const Type* ArgTyPtr = PointerType::get(ArgTy); Function* NF = Result->getOrInsertFunction("llvm.va_copy", - RetTy, ArgTyPtr, ArgTyPtr, 0); + RetTy, ArgTyPtr, ArgTyPtr, + (Type *)0); while (!F->use_empty()) { CallInst* CI = cast(F->use_back()); @@ -2074,7 +2075,7 @@ ObsoleteVarArgs = true; const Type* ArgTy = $2->getType(); Function* NF = CurModule.CurrentModule-> - getOrInsertFunction("llvm.va_copy", ArgTy, ArgTy, 0); + getOrInsertFunction("llvm.va_copy", ArgTy, ArgTy, (Type *)0); //b = vaarg a, t -> //foo = alloca 1 of t @@ -2093,7 +2094,7 @@ ObsoleteVarArgs = true; const Type* ArgTy = $2->getType(); Function* NF = CurModule.CurrentModule-> - getOrInsertFunction("llvm.va_copy", ArgTy, ArgTy, 0); + getOrInsertFunction("llvm.va_copy", ArgTy, ArgTy, (Type *)0); //b = vanext a, t -> //foo = alloca 1 of t From jeffc at jolt-lang.org Sat Oct 22 23:37:40 2005 From: jeffc at jolt-lang.org (Jeff Cohen) Date: Sat, 22 Oct 2005 23:37:40 -0500 Subject: [llvm-commits] CVS: llvm/examples/Fibonacci/fibonacci.cpp Message-ID: <200510230437.XAA10886@zion.cs.uiuc.edu> Changes in directory llvm/examples/Fibonacci: fibonacci.cpp updated: 1.9 -> 1.10 --- Log message: When a function takes a variable number of pointer arguments, with a zero pointer marking the end of the list, the zero *must* be cast to the pointer type. An un-cast zero is a 32-bit int, and at least on x86_64, gcc will not extend the zero to 64 bits, thus allowing the upper 32 bits to be random junk. The new END_WITH_NULL macro may be used to annotate a such a function so that GCC (version 4 or newer) will detect the use of un-casted zero at compile time. --- Diffs of the changes: (+2 -1) fibonacci.cpp | 3 ++- 1 files changed, 2 insertions(+), 1 deletion(-) Index: llvm/examples/Fibonacci/fibonacci.cpp diff -u llvm/examples/Fibonacci/fibonacci.cpp:1.9 llvm/examples/Fibonacci/fibonacci.cpp:1.10 --- llvm/examples/Fibonacci/fibonacci.cpp:1.9 Fri May 6 01:22:00 2005 +++ llvm/examples/Fibonacci/fibonacci.cpp Sat Oct 22 23:37:19 2005 @@ -37,7 +37,8 @@ static Function *CreateFibFunction(Module *M) { // Create the fib function and insert it into module M. This function is said // to return an int and take an int parameter. - Function *FibF = M->getOrInsertFunction("fib", Type::IntTy, Type::IntTy, 0); + Function *FibF = M->getOrInsertFunction("fib", Type::IntTy, Type::IntTy, + (Type *)0); // Add a basic block to the function. BasicBlock *BB = new BasicBlock("EntryBlock", FibF); From jeffc at jolt-lang.org Sat Oct 22 23:37:40 2005 From: jeffc at jolt-lang.org (Jeff Cohen) Date: Sat, 22 Oct 2005 23:37:40 -0500 Subject: [llvm-commits] CVS: llvm/tools/lli/lli.cpp Message-ID: <200510230437.XAA10868@zion.cs.uiuc.edu> Changes in directory llvm/tools/lli: lli.cpp updated: 1.49 -> 1.50 --- Log message: When a function takes a variable number of pointer arguments, with a zero pointer marking the end of the list, the zero *must* be cast to the pointer type. An un-cast zero is a 32-bit int, and at least on x86_64, gcc will not extend the zero to 64 bits, thus allowing the upper 32 bits to be random junk. The new END_WITH_NULL macro may be used to annotate a such a function so that GCC (version 4 or newer) will detect the use of un-casted zero at compile time. --- Diffs of the changes: (+2 -1) lli.cpp | 3 ++- 1 files changed, 2 insertions(+), 1 deletion(-) Index: llvm/tools/lli/lli.cpp diff -u llvm/tools/lli/lli.cpp:1.49 llvm/tools/lli/lli.cpp:1.50 --- llvm/tools/lli/lli.cpp:1.49 Thu Apr 21 18:59:31 2005 +++ llvm/tools/lli/lli.cpp Sat Oct 22 23:37:20 2005 @@ -96,7 +96,8 @@ // If the program didn't explicitly call exit, call exit now, for the program. // This ensures that any atexit handlers get called correctly. Function *Exit = MP->getModule()->getOrInsertFunction("exit", Type::VoidTy, - Type::IntTy, 0); + Type::IntTy, + (Type *)0); std::vector Args; GenericValue ResultGV; From jeffc at jolt-lang.org Sat Oct 22 23:37:39 2005 From: jeffc at jolt-lang.org (Jeff Cohen) Date: Sat, 22 Oct 2005 23:37:39 -0500 Subject: [llvm-commits] CVS: llvm/lib/Debugger/UnixLocalInferiorProcess.cpp Message-ID: <200510230437.XAA10836@zion.cs.uiuc.edu> Changes in directory llvm/lib/Debugger: UnixLocalInferiorProcess.cpp updated: 1.8 -> 1.9 --- Log message: When a function takes a variable number of pointer arguments, with a zero pointer marking the end of the list, the zero *must* be cast to the pointer type. An un-cast zero is a 32-bit int, and at least on x86_64, gcc will not extend the zero to 64 bits, thus allowing the upper 32 bits to be random junk. The new END_WITH_NULL macro may be used to annotate a such a function so that GCC (version 4 or newer) will detect the use of un-casted zero at compile time. --- Diffs of the changes: (+2 -1) UnixLocalInferiorProcess.cpp | 3 ++- 1 files changed, 2 insertions(+), 1 deletion(-) Index: llvm/lib/Debugger/UnixLocalInferiorProcess.cpp diff -u llvm/lib/Debugger/UnixLocalInferiorProcess.cpp:1.8 llvm/lib/Debugger/UnixLocalInferiorProcess.cpp:1.9 --- llvm/lib/Debugger/UnixLocalInferiorProcess.cpp:1.8 Thu Apr 21 17:36:21 2005 +++ llvm/lib/Debugger/UnixLocalInferiorProcess.cpp Sat Oct 22 23:37:20 2005 @@ -924,7 +924,8 @@ // If the program didn't explicitly call exit, call exit now, for the program. // This ensures that any atexit handlers get called correctly. - Function *Exit = M->getOrInsertFunction("exit", Type::VoidTy, Type::IntTy, 0); + Function *Exit = M->getOrInsertFunction("exit", Type::VoidTy, Type::IntTy, + (Type *)0); std::vector Args; GenericValue ResultGV; From jeffc at jolt-lang.org Sat Oct 22 23:37:40 2005 From: jeffc at jolt-lang.org (Jeff Cohen) Date: Sat, 22 Oct 2005 23:37:40 -0500 Subject: [llvm-commits] CVS: llvm/lib/Transforms/Scalar/LowerAllocations.cpp LowerGC.cpp LowerInvoke.cpp Message-ID: <200510230437.XAA10880@zion.cs.uiuc.edu> Changes in directory llvm/lib/Transforms/Scalar: LowerAllocations.cpp updated: 1.54 -> 1.55 LowerGC.cpp updated: 1.8 -> 1.9 LowerInvoke.cpp updated: 1.33 -> 1.34 --- Log message: When a function takes a variable number of pointer arguments, with a zero pointer marking the end of the list, the zero *must* be cast to the pointer type. An un-cast zero is a 32-bit int, and at least on x86_64, gcc will not extend the zero to 64 bits, thus allowing the upper 32 bits to be random junk. The new END_WITH_NULL macro may be used to annotate a such a function so that GCC (version 4 or newer) will detect the use of un-casted zero at compile time. --- Diffs of the changes: (+8 -7) LowerAllocations.cpp | 2 +- LowerGC.cpp | 5 +++-- LowerInvoke.cpp | 8 ++++---- 3 files changed, 8 insertions(+), 7 deletions(-) Index: llvm/lib/Transforms/Scalar/LowerAllocations.cpp diff -u llvm/lib/Transforms/Scalar/LowerAllocations.cpp:1.54 llvm/lib/Transforms/Scalar/LowerAllocations.cpp:1.55 --- llvm/lib/Transforms/Scalar/LowerAllocations.cpp:1.54 Fri May 6 01:48:21 2005 +++ llvm/lib/Transforms/Scalar/LowerAllocations.cpp Sat Oct 22 23:37:20 2005 @@ -83,7 +83,7 @@ MallocFunc = M.getOrInsertFunction("malloc", FT); } if (FreeFunc == 0) - FreeFunc = M.getOrInsertFunction("free" , Type::VoidTy, SBPTy, 0); + FreeFunc = M.getOrInsertFunction("free" , Type::VoidTy, SBPTy, (Type *)0); return true; } Index: llvm/lib/Transforms/Scalar/LowerGC.cpp diff -u llvm/lib/Transforms/Scalar/LowerGC.cpp:1.8 llvm/lib/Transforms/Scalar/LowerGC.cpp:1.9 --- llvm/lib/Transforms/Scalar/LowerGC.cpp:1.8 Thu Apr 21 18:45:12 2005 +++ llvm/lib/Transforms/Scalar/LowerGC.cpp Sat Oct 22 23:37:20 2005 @@ -109,10 +109,11 @@ // If the program is using read/write barriers, find the implementations of // them from the GC runtime library. if (GCReadInt) // Make: sbyte* %llvm_gc_read(sbyte**) - GCRead = M.getOrInsertFunction("llvm_gc_read", VoidPtr, VoidPtr, VoidPtrPtr, 0); + GCRead = M.getOrInsertFunction("llvm_gc_read", VoidPtr, VoidPtr, VoidPtrPtr, + (Type *)0); if (GCWriteInt) // Make: void %llvm_gc_write(sbyte*, sbyte**) GCWrite = M.getOrInsertFunction("llvm_gc_write", Type::VoidTy, - VoidPtr, VoidPtr, VoidPtrPtr, 0); + VoidPtr, VoidPtr, VoidPtrPtr, (Type *)0); // If the program has GC roots, get or create the global root list. if (GCRootInt) { Index: llvm/lib/Transforms/Scalar/LowerInvoke.cpp diff -u llvm/lib/Transforms/Scalar/LowerInvoke.cpp:1.33 llvm/lib/Transforms/Scalar/LowerInvoke.cpp:1.34 --- llvm/lib/Transforms/Scalar/LowerInvoke.cpp:1.33 Fri Sep 30 22:57:14 2005 +++ llvm/lib/Transforms/Scalar/LowerInvoke.cpp Sat Oct 22 23:37:20 2005 @@ -124,14 +124,14 @@ Constant::getNullValue(PtrJBList), "llvm.sjljeh.jblist", &M); SetJmpFn = M.getOrInsertFunction("llvm.setjmp", Type::IntTy, - PointerType::get(JmpBufTy), NULL); + PointerType::get(JmpBufTy), (Type *)0); LongJmpFn = M.getOrInsertFunction("llvm.longjmp", Type::VoidTy, PointerType::get(JmpBufTy), - Type::IntTy, NULL); + Type::IntTy, (Type *)0); } // We need the 'write' and 'abort' functions for both models. - AbortFn = M.getOrInsertFunction("abort", Type::VoidTy, NULL); + AbortFn = M.getOrInsertFunction("abort", Type::VoidTy, (Type *)0); // Unfortunately, 'write' can end up being prototyped in several different // ways. If the user defines a three (or more) operand function named 'write' @@ -148,7 +148,7 @@ WriteFn = 0; } else { WriteFn = M.getOrInsertFunction("write", Type::VoidTy, Type::IntTy, - VoidPtrTy, Type::IntTy, NULL); + VoidPtrTy, Type::IntTy, (Type *)0); } return true; } From jeffc at jolt-lang.org Sat Oct 22 23:37:39 2005 From: jeffc at jolt-lang.org (Jeff Cohen) Date: Sat, 22 Oct 2005 23:37:39 -0500 Subject: [llvm-commits] CVS: llvm/include/llvm/Support/CommandLine.h DataTypes.h.in Message-ID: <200510230437.XAA10825@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm/Support: CommandLine.h updated: 1.49 -> 1.50 DataTypes.h.in updated: 1.20 -> 1.21 --- Log message: When a function takes a variable number of pointer arguments, with a zero pointer marking the end of the list, the zero *must* be cast to the pointer type. An un-cast zero is a 32-bit int, and at least on x86_64, gcc will not extend the zero to 64 bits, thus allowing the upper 32 bits to be random junk. The new END_WITH_NULL macro may be used to annotate a such a function so that GCC (version 4 or newer) will detect the use of un-casted zero at compile time. --- Diffs of the changes: (+8 -1) CommandLine.h | 3 ++- DataTypes.h.in | 6 ++++++ 2 files changed, 8 insertions(+), 1 deletion(-) Index: llvm/include/llvm/Support/CommandLine.h diff -u llvm/include/llvm/Support/CommandLine.h:1.49 llvm/include/llvm/Support/CommandLine.h:1.50 --- llvm/include/llvm/Support/CommandLine.h:1.49 Thu Oct 13 19:33:05 2005 +++ llvm/include/llvm/Support/CommandLine.h Sat Oct 22 23:37:19 2005 @@ -21,6 +21,7 @@ #define LLVM_SUPPORT_COMMANDLINE_H #include "llvm/Support/type_traits.h" +#include "llvm/Support/DataTypes.h" #include #include #include @@ -335,7 +336,7 @@ template ValuesClass values(const char *Arg, DataType Val, const char *Desc, - ...) { + ...) END_WITH_NULL { va_list ValueArgs; va_start(ValueArgs, Desc); ValuesClass Vals(Arg, Val, Desc, ValueArgs); Index: llvm/include/llvm/Support/DataTypes.h.in diff -u llvm/include/llvm/Support/DataTypes.h.in:1.20 llvm/include/llvm/Support/DataTypes.h.in:1.21 --- llvm/include/llvm/Support/DataTypes.h.in:1.20 Wed Jul 27 00:53:43 2005 +++ llvm/include/llvm/Support/DataTypes.h.in Sat Oct 22 23:37:19 2005 @@ -98,4 +98,10 @@ # define UINT64_MAX 0xffffffffffffffffULL #endif +#if __GNUC__ > 3 +#define END_WITH_NULL __attribute__((sentinel)) +#else +#define END_WITH_NULL +#endif + #endif /* SUPPORT_DATATYPES_H */ From jeffc at jolt-lang.org Sat Oct 22 23:37:40 2005 From: jeffc at jolt-lang.org (Jeff Cohen) Date: Sat, 22 Oct 2005 23:37:40 -0500 Subject: [llvm-commits] CVS: llvm/examples/HowToUseJIT/HowToUseJIT.cpp Message-ID: <200510230437.XAA10864@zion.cs.uiuc.edu> Changes in directory llvm/examples/HowToUseJIT: HowToUseJIT.cpp updated: 1.9 -> 1.10 --- Log message: When a function takes a variable number of pointer arguments, with a zero pointer marking the end of the list, the zero *must* be cast to the pointer type. An un-cast zero is a 32-bit int, and at least on x86_64, gcc will not extend the zero to 64 bits, thus allowing the upper 32 bits to be random junk. The new END_WITH_NULL macro may be used to annotate a such a function so that GCC (version 4 or newer) will detect the use of un-casted zero at compile time. --- Diffs of the changes: (+3 -2) HowToUseJIT.cpp | 5 +++-- 1 files changed, 3 insertions(+), 2 deletions(-) Index: llvm/examples/HowToUseJIT/HowToUseJIT.cpp diff -u llvm/examples/HowToUseJIT/HowToUseJIT.cpp:1.9 llvm/examples/HowToUseJIT/HowToUseJIT.cpp:1.10 --- llvm/examples/HowToUseJIT/HowToUseJIT.cpp:1.9 Fri May 6 00:59:51 2005 +++ llvm/examples/HowToUseJIT/HowToUseJIT.cpp Sat Oct 22 23:37:19 2005 @@ -51,7 +51,8 @@ // Create the add1 function entry and insert this entry into module M. The // function will have a return type of "int" and take an argument of "int". // The '0' terminates the list of argument types. - Function *Add1F = M->getOrInsertFunction("add1", Type::IntTy, Type::IntTy, 0); + Function *Add1F = M->getOrInsertFunction("add1", Type::IntTy, Type::IntTy, + (Type *)0); // Add a basic block to the function. As before, it automatically inserts // because of the last argument. @@ -76,7 +77,7 @@ // Now we going to create function `foo', which returns an int and takes no // arguments. - Function *FooF = M->getOrInsertFunction("foo", Type::IntTy, 0); + Function *FooF = M->getOrInsertFunction("foo", Type::IntTy, (Type *)0); // Add a basic block to the FooF function. BB = new BasicBlock("EntryBlock", FooF); From jeffc at jolt-lang.org Sat Oct 22 23:37:39 2005 From: jeffc at jolt-lang.org (Jeff Cohen) Date: Sat, 22 Oct 2005 23:37:39 -0500 Subject: [llvm-commits] CVS: llvm/examples/ParallelJIT/ParallelJIT.cpp Message-ID: <200510230437.XAA10830@zion.cs.uiuc.edu> Changes in directory llvm/examples/ParallelJIT: ParallelJIT.cpp updated: 1.3 -> 1.4 --- Log message: When a function takes a variable number of pointer arguments, with a zero pointer marking the end of the list, the zero *must* be cast to the pointer type. An un-cast zero is a 32-bit int, and at least on x86_64, gcc will not extend the zero to 64 bits, thus allowing the upper 32 bits to be random junk. The new END_WITH_NULL macro may be used to annotate a such a function so that GCC (version 4 or newer) will detect the use of un-casted zero at compile time. --- Diffs of the changes: (+4 -2) ParallelJIT.cpp | 6 ++++-- 1 files changed, 4 insertions(+), 2 deletions(-) Index: llvm/examples/ParallelJIT/ParallelJIT.cpp diff -u llvm/examples/ParallelJIT/ParallelJIT.cpp:1.3 llvm/examples/ParallelJIT/ParallelJIT.cpp:1.4 --- llvm/examples/ParallelJIT/ParallelJIT.cpp:1.3 Wed Jul 27 01:12:33 2005 +++ llvm/examples/ParallelJIT/ParallelJIT.cpp Sat Oct 22 23:37:19 2005 @@ -33,7 +33,8 @@ // Create the add1 function entry and insert this entry into module M. The // function will have a return type of "int" and take an argument of "int". // The '0' terminates the list of argument types. - Function *Add1F = M->getOrInsertFunction("add1", Type::IntTy, Type::IntTy, 0); + Function *Add1F = M->getOrInsertFunction("add1", Type::IntTy, Type::IntTy, + (Type *)0); // Add a basic block to the function. As before, it automatically inserts // because of the last argument. @@ -61,7 +62,8 @@ { // Create the fib function and insert it into module M. This function is said // to return an int and take an int parameter. - Function *FibF = M->getOrInsertFunction("fib", Type::IntTy, Type::IntTy, 0); + Function *FibF = M->getOrInsertFunction("fib", Type::IntTy, Type::IntTy, + (Type *)0); // Add a basic block to the function. BasicBlock *BB = new BasicBlock("EntryBlock", FibF); From jeffc at jolt-lang.org Sat Oct 22 23:37:39 2005 From: jeffc at jolt-lang.org (Jeff Cohen) Date: Sat, 22 Oct 2005 23:37:39 -0500 Subject: [llvm-commits] CVS: llvm/Makefile.rules Message-ID: <200510230437.XAA10846@zion.cs.uiuc.edu> Changes in directory llvm: Makefile.rules updated: 1.328 -> 1.329 --- Log message: When a function takes a variable number of pointer arguments, with a zero pointer marking the end of the list, the zero *must* be cast to the pointer type. An un-cast zero is a 32-bit int, and at least on x86_64, gcc will not extend the zero to 64 bits, thus allowing the upper 32 bits to be random junk. The new END_WITH_NULL macro may be used to annotate a such a function so that GCC (version 4 or newer) will detect the use of un-casted zero at compile time. --- Diffs of the changes: (+1 -1) Makefile.rules | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm/Makefile.rules diff -u llvm/Makefile.rules:1.328 llvm/Makefile.rules:1.329 --- llvm/Makefile.rules:1.328 Fri Oct 21 14:02:44 2005 +++ llvm/Makefile.rules Sat Oct 22 23:37:19 2005 @@ -221,7 +221,7 @@ endif endif -CXX.Flags += $(CXXFLAGS) +CXX.Flags += $(CXXFLAGS) -Wformat C.Flags += $(CFLAGS) CPP.Flags += $(CPPFLAGS) LD.Flags += $(LDFLAGS) From jeffc at jolt-lang.org Sat Oct 22 23:37:40 2005 From: jeffc at jolt-lang.org (Jeff Cohen) Date: Sat, 22 Oct 2005 23:37:40 -0500 Subject: [llvm-commits] CVS: llvm/lib/Transforms/IPO/LowerSetJmp.cpp SimplifyLibCalls.cpp Message-ID: <200510230437.XAA10888@zion.cs.uiuc.edu> Changes in directory llvm/lib/Transforms/IPO: LowerSetJmp.cpp updated: 1.27 -> 1.28 SimplifyLibCalls.cpp updated: 1.54 -> 1.55 --- Log message: When a function takes a variable number of pointer arguments, with a zero pointer marking the end of the list, the zero *must* be cast to the pointer type. An un-cast zero is a 32-bit int, and at least on x86_64, gcc will not extend the zero to 64 bits, thus allowing the upper 32 bits to be random junk. The new END_WITH_NULL macro may be used to annotate a such a function so that GCC (version 4 or newer) will detect the use of un-casted zero at compile time. --- Diffs of the changes: (+11 -9) LowerSetJmp.cpp | 15 ++++++++------- SimplifyLibCalls.cpp | 5 +++-- 2 files changed, 11 insertions(+), 9 deletions(-) Index: llvm/lib/Transforms/IPO/LowerSetJmp.cpp diff -u llvm/lib/Transforms/IPO/LowerSetJmp.cpp:1.27 llvm/lib/Transforms/IPO/LowerSetJmp.cpp:1.28 --- llvm/lib/Transforms/IPO/LowerSetJmp.cpp:1.27 Wed Jun 15 17:49:30 2005 +++ llvm/lib/Transforms/IPO/LowerSetJmp.cpp Sat Oct 22 23:37:20 2005 @@ -204,32 +204,33 @@ // void __llvm_sjljeh_init_setjmpmap(void**) InitSJMap = M.getOrInsertFunction("__llvm_sjljeh_init_setjmpmap", - Type::VoidTy, SBPPTy, NULL); + Type::VoidTy, SBPPTy, (Type *)0); // void __llvm_sjljeh_destroy_setjmpmap(void**) DestroySJMap = M.getOrInsertFunction("__llvm_sjljeh_destroy_setjmpmap", - Type::VoidTy, SBPPTy, NULL); + Type::VoidTy, SBPPTy, (Type *)0); // void __llvm_sjljeh_add_setjmp_to_map(void**, void*, unsigned) AddSJToMap = M.getOrInsertFunction("__llvm_sjljeh_add_setjmp_to_map", Type::VoidTy, SBPPTy, SBPTy, - Type::UIntTy, NULL); + Type::UIntTy, (Type *)0); // void __llvm_sjljeh_throw_longjmp(int*, int) ThrowLongJmp = M.getOrInsertFunction("__llvm_sjljeh_throw_longjmp", - Type::VoidTy, SBPTy, Type::IntTy, NULL); + Type::VoidTy, SBPTy, Type::IntTy, + (Type *)0); // unsigned __llvm_sjljeh_try_catching_longjmp_exception(void **) TryCatchLJ = M.getOrInsertFunction("__llvm_sjljeh_try_catching_longjmp_exception", - Type::UIntTy, SBPPTy, NULL); + Type::UIntTy, SBPPTy, (Type *)0); // bool __llvm_sjljeh_is_longjmp_exception() IsLJException = M.getOrInsertFunction("__llvm_sjljeh_is_longjmp_exception", - Type::BoolTy, NULL); + Type::BoolTy, (Type *)0); // int __llvm_sjljeh_get_longjmp_value() GetLJValue = M.getOrInsertFunction("__llvm_sjljeh_get_longjmp_value", - Type::IntTy, NULL); + Type::IntTy, (Type *)0); return true; } Index: llvm/lib/Transforms/IPO/SimplifyLibCalls.cpp diff -u llvm/lib/Transforms/IPO/SimplifyLibCalls.cpp:1.54 llvm/lib/Transforms/IPO/SimplifyLibCalls.cpp:1.55 --- llvm/lib/Transforms/IPO/SimplifyLibCalls.cpp:1.54 Thu Sep 29 01:17:27 2005 +++ llvm/lib/Transforms/IPO/SimplifyLibCalls.cpp Sat Oct 22 23:37:20 2005 @@ -311,7 +311,8 @@ if (!memcpy_func) { const Type *SBP = PointerType::get(Type::SByteTy); memcpy_func = M->getOrInsertFunction("llvm.memcpy", Type::VoidTy,SBP, SBP, - Type::UIntTy, Type::UIntTy, 0); + Type::UIntTy, Type::UIntTy, + (Type *)0); } return memcpy_func; } @@ -319,7 +320,7 @@ Function* get_floorf() { if (!floorf_func) floorf_func = M->getOrInsertFunction("floorf", Type::FloatTy, - Type::FloatTy, 0); + Type::FloatTy, (Type *)0); return floorf_func; } From jeffc at jolt-lang.org Sat Oct 22 23:37:40 2005 From: jeffc at jolt-lang.org (Jeff Cohen) Date: Sat, 22 Oct 2005 23:37:40 -0500 Subject: [llvm-commits] CVS: llvm/tools/bugpoint/Miscompilation.cpp Message-ID: <200510230437.XAA10850@zion.cs.uiuc.edu> Changes in directory llvm/tools/bugpoint: Miscompilation.cpp updated: 1.71 -> 1.72 --- Log message: When a function takes a variable number of pointer arguments, with a zero pointer marking the end of the list, the zero *must* be cast to the pointer type. An un-cast zero is a 32-bit int, and at least on x86_64, gcc will not extend the zero to 64 bits, thus allowing the upper 32 bits to be random junk. The new END_WITH_NULL macro may be used to annotate a such a function so that GCC (version 4 or newer) will detect the use of un-casted zero at compile time. --- Diffs of the changes: (+1 -1) Miscompilation.cpp | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm/tools/bugpoint/Miscompilation.cpp diff -u llvm/tools/bugpoint/Miscompilation.cpp:1.71 llvm/tools/bugpoint/Miscompilation.cpp:1.72 --- llvm/tools/bugpoint/Miscompilation.cpp:1.71 Tue Aug 2 18:25:56 2005 +++ llvm/tools/bugpoint/Miscompilation.cpp Sat Oct 22 23:37:20 2005 @@ -666,7 +666,7 @@ Function *resolverFunc = Safe->getOrInsertFunction("getPointerToNamedFunction", PointerType::get(Type::SByteTy), - PointerType::get(Type::SByteTy), 0); + PointerType::get(Type::SByteTy), (Type *)0); // Use the function we just added to get addresses of functions we need. for (Module::iterator F = Safe->begin(), E = Safe->end(); F != E; ++F) { From jeffc at jolt-lang.org Sat Oct 22 23:51:34 2005 From: jeffc at jolt-lang.org (Jeff Cohen) Date: Sat, 22 Oct 2005 23:51:34 -0500 Subject: [llvm-commits] CVS: llvm/Makefile.rules Message-ID: <200510230451.XAA10953@zion.cs.uiuc.edu> Changes in directory llvm: Makefile.rules updated: 1.329 -> 1.330 --- Log message: Remove redundant flag. --- Diffs of the changes: (+1 -1) Makefile.rules | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm/Makefile.rules diff -u llvm/Makefile.rules:1.329 llvm/Makefile.rules:1.330 --- llvm/Makefile.rules:1.329 Sat Oct 22 23:37:19 2005 +++ llvm/Makefile.rules Sat Oct 22 23:51:22 2005 @@ -221,7 +221,7 @@ endif endif -CXX.Flags += $(CXXFLAGS) -Wformat +CXX.Flags += $(CXXFLAGS) C.Flags += $(CFLAGS) CPP.Flags += $(CPPFLAGS) LD.Flags += $(LDFLAGS) From lattner at cs.uiuc.edu Sun Oct 23 00:25:30 2005 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sun, 23 Oct 2005 00:25:30 -0500 Subject: [llvm-commits] CVS: llvm/include/llvm/Target/SubtargetFeature.h Message-ID: <200510230525.AAA11278@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm/Target: SubtargetFeature.h updated: 1.3 -> 1.4 --- Log message: Move static functions to .cpp file, reduce #includes, pass strings by const&. --- Diffs of the changes: (+7 -68) SubtargetFeature.h | 75 ++++------------------------------------------------- 1 files changed, 7 insertions(+), 68 deletions(-) Index: llvm/include/llvm/Target/SubtargetFeature.h diff -u llvm/include/llvm/Target/SubtargetFeature.h:1.3 llvm/include/llvm/Target/SubtargetFeature.h:1.4 --- llvm/include/llvm/Target/SubtargetFeature.h:1.3 Fri Sep 2 14:27:43 2005 +++ llvm/include/llvm/Target/SubtargetFeature.h Sun Oct 23 00:25:19 2005 @@ -18,11 +18,9 @@ #ifndef LLVM_TARGET_SUBTARGETFEATURE_H #define LLVM_TARGET_SUBTARGETFEATURE_H - #include #include -#include -#include +#include #include "llvm/Support/DataTypes.h" namespace llvm { @@ -57,80 +55,21 @@ /// class SubtargetFeatures { -private: std::vector Features; // Subtarget features as a vector - - // Determine if a feature has a flag; '+' or '-' - static inline bool hasFlag(const std::string &Feature) { - assert(!Feature.empty() && "Empty string"); - // Get first character - char Ch = Feature[0]; - // Check if first character is '+' or '-' flag - return Ch == '+' || Ch =='-'; - } - - // Return true if enable flag; '+'. - static inline bool isEnabled(const std::string &Feature) { - assert(!Feature.empty() && "Empty string"); - // Get first character - char Ch = Feature[0]; - // Check if first character is '+' for enabled - return Ch == '+'; - } - - // Return a string with a prepended flag; '+' or '-'. - static inline std::string PrependFlag(const std::string &Feature, - bool IsEnabled) { - assert(!Feature.empty() && "Empty string"); - if (hasFlag(Feature)) return Feature; - return std::string(IsEnabled ? "+" : "-") + Feature; - } - - // Return string stripped of flag. - static inline std::string StripFlag(const std::string &Feature) { - return hasFlag(Feature) ? Feature.substr(1) : Feature; - } - - /// Splits a string of comma separated items in to a vector of strings. - static void Split(std::vector &V, const std::string &S); - - /// Join a vector of strings into a string with a comma separating each - /// item. - static std::string Join(const std::vector &V); - - /// Convert a string to lowercase. - static std::string toLower(const std::string &S); - - /// Find item in array using binary search. - static const SubtargetFeatureKV *Find(const std::string &S, - const SubtargetFeatureKV *A, size_t L); - public: - /// Ctor. - SubtargetFeatures(const std::string Initial = std::string()) { - // Break up string into separate features - Split(Features, Initial); - } + SubtargetFeatures(const std::string &Initial = std::string()); /// Features string accessors. - inline std::string getString() const { return Join(Features); } - void setString(const std::string &Initial) { - // Throw out old features - Features.clear(); - // Break up string into separate features - Split(Features, toLower(Initial)); - } + std::string getString() const; + void setString(const std::string &Initial); /// Setting CPU string. Replaces previous setting. Setting to "" clears CPU. - void setCPU(std::string String) { Features[0] = toLower(String); } + /// + void setCPU(const std::string &String); /// Adding Features. void AddFeature(const std::string &String, bool IsEnabled = true); - - /// Display help for feature choices. - static void Help(const char *Heading, - const SubtargetFeatureKV *Table, size_t TableSize); - + /// Parse feature string for quick usage. static uint32_t Parse(const std::string &String, const std::string &DefaultCPU, From lattner at cs.uiuc.edu Sun Oct 23 00:26:38 2005 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sun, 23 Oct 2005 00:26:38 -0500 Subject: [llvm-commits] CVS: llvm/lib/Target/SubtargetFeature.cpp Message-ID: <200510230526.AAA11335@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target: SubtargetFeature.cpp updated: 1.4 -> 1.5 --- Log message: Move static functions from .h file, reduce #includes, pass strings by const&, use LowercaseString from StringExtras.h, remove extraneous space from help output. --- Diffs of the changes: (+99 -45) SubtargetFeature.cpp | 144 +++++++++++++++++++++++++++++++++++---------------- 1 files changed, 99 insertions(+), 45 deletions(-) Index: llvm/lib/Target/SubtargetFeature.cpp diff -u llvm/lib/Target/SubtargetFeature.cpp:1.4 llvm/lib/Target/SubtargetFeature.cpp:1.5 --- llvm/lib/Target/SubtargetFeature.cpp:1.4 Wed Sep 7 00:44:14 2005 +++ llvm/lib/Target/SubtargetFeature.cpp Sun Oct 23 00:26:26 2005 @@ -12,18 +12,55 @@ //===----------------------------------------------------------------------===// #include "llvm/Target/SubtargetFeature.h" - -#include +#include "llvm/ADT/StringExtras.h" #include -#include #include #include - +#include using namespace llvm; -/// Splits a string of comma separated items in to a vector of strings. -void SubtargetFeatures::Split(std::vector &V, - const std::string &S) { +//===----------------------------------------------------------------------===// +// Static Helper Functions +//===----------------------------------------------------------------------===// + +/// hasFlag - Determine if a feature has a flag; '+' or '-' +/// +static inline bool hasFlag(const std::string &Feature) { + assert(!Feature.empty() && "Empty string"); + // Get first character + char Ch = Feature[0]; + // Check if first character is '+' or '-' flag + return Ch == '+' || Ch =='-'; +} + +/// StripFlag - Return string stripped of flag. +/// +static inline std::string StripFlag(const std::string &Feature) { + return hasFlag(Feature) ? Feature.substr(1) : Feature; +} + +/// isEnabled - Return true if enable flag; '+'. +/// +static inline bool isEnabled(const std::string &Feature) { + assert(!Feature.empty() && "Empty string"); + // Get first character + char Ch = Feature[0]; + // Check if first character is '+' for enabled + return Ch == '+'; +} + +/// PrependFlag - Return a string with a prepended flag; '+' or '-'. +/// +static inline std::string PrependFlag(const std::string &Feature, + bool IsEnabled) { + assert(!Feature.empty() && "Empty string"); + if (hasFlag(Feature)) return Feature; + return std::string(IsEnabled ? "+" : "-") + Feature; +} + +/// Split - Splits a string of comma separated items in to a vector of strings. +/// +static void Split(std::vector &V, const std::string &S) { // Start at beginning of string. size_t Pos = 0; while (true) { @@ -43,7 +80,8 @@ } /// Join a vector of strings to a string with a comma separating each element. -std::string SubtargetFeatures::Join(const std::vector &V) { +/// +static std::string Join(const std::vector &V) { // Start with empty string. std::string Result; // If the vector is not empty @@ -62,33 +100,19 @@ return Result; } -/// Convert a string to lowercase. -std::string SubtargetFeatures::toLower(const std::string &S) { - // Copy the string - std::string Result = S; - // For each character in string - for (size_t i = 0; i < Result.size(); i++) { - // Convert character to lowercase - Result[i] = std::tolower(Result[i]); - } - // Return the lowercased string - return Result; -} - /// Adding features. void SubtargetFeatures::AddFeature(const std::string &String, bool IsEnabled) { // Don't add empty features if (!String.empty()) { // Convert to lowercase, prepend flag and add to vector - Features.push_back(PrependFlag(toLower(String), IsEnabled)); + Features.push_back(PrependFlag(LowercaseString(String), IsEnabled)); } } /// Find item in array using binary search. -const SubtargetFeatureKV * -SubtargetFeatures::Find(const std::string &S, - const SubtargetFeatureKV *A, size_t L) { +static const SubtargetFeatureKV *Find(const std::string &S, + const SubtargetFeatureKV *A, size_t L) { // Determine the end of the array const SubtargetFeatureKV *Hi = A + L; // Binary search the array @@ -100,29 +124,59 @@ } /// Display help for feature choices. -void SubtargetFeatures::Help(const char *Heading, - const SubtargetFeatureKV *Table, size_t TableSize) { - // Determine the length of the longest key - size_t MaxLen = 0; - for (size_t i = 0; i < TableSize; i++) - MaxLen = std::max(MaxLen, std::strlen(Table[i].Key)); - // Print heading - std::cerr << "Help for " << Heading << " choices\n\n"; - // For each feature - for (size_t i = 0; i < TableSize; i++) { - // Compute required padding - size_t Pad = MaxLen - std::strlen(Table[i].Key) + 1; - // Print details - std::cerr << Table[i].Key << std::string(Pad, ' ') << " - " - << Table[i].Desc << "\n"; - } - // Wrap it up - std::cerr << "\n\n"; - // Leave tool - exit(1); +/// +static void Help(const char *Heading, const SubtargetFeatureKV *Table, + size_t TableSize) { + // Determine the length of the longest key + size_t MaxLen = 0; + for (size_t i = 0; i < TableSize; i++) + MaxLen = std::max(MaxLen, std::strlen(Table[i].Key)); + // Print heading + std::cerr << "Help for " << Heading << " choices:\n\n"; + // For each feature + for (size_t i = 0; i < TableSize; i++) { + // Compute required padding + size_t Pad = MaxLen - std::strlen(Table[i].Key); + // Print details + std::cerr << Table[i].Key << std::string(Pad, ' ') << " - " + << Table[i].Desc << "\n"; + } + // Wrap it up + std::cerr << "\n\n"; + // Leave tool + exit(1); +} + +//===----------------------------------------------------------------------===// +// SubtargetFeatures Implementation +//===----------------------------------------------------------------------===// + +SubtargetFeatures::SubtargetFeatures(const std::string &Initial) { + // Break up string into separate features + Split(Features, Initial); +} + + +std::string SubtargetFeatures::getString() const { + return Join(Features); +} +void SubtargetFeatures::setString(const std::string &Initial) { + // Throw out old features + Features.clear(); + // Break up string into separate features + Split(Features, LowercaseString(Initial)); +} + +/// setCPU - Set the CPU string. Replaces previous setting. Setting to "" +/// clears CPU. +void SubtargetFeatures::setCPU(const std::string &String) { + Features[0] = LowercaseString(String); } + + /// Parse feature string for quick usage. +/// uint32_t SubtargetFeatures::Parse(const std::string &String, const std::string &DefaultCPU, const SubtargetFeatureKV *CPUTable, From lattner at cs.uiuc.edu Sun Oct 23 00:29:03 2005 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sun, 23 Oct 2005 00:29:03 -0500 Subject: [llvm-commits] CVS: llvm/lib/Target/PowerPC/PPC.td Message-ID: <200510230529.AAA11372@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/PowerPC: PPC.td updated: 1.6 -> 1.7 --- Log message: improve -help output --- Diffs of the changes: (+5 -5) PPC.td | 10 +++++----- 1 files changed, 5 insertions(+), 5 deletions(-) Index: llvm/lib/Target/PowerPC/PPC.td diff -u llvm/lib/Target/PowerPC/PPC.td:1.6 llvm/lib/Target/PowerPC/PPC.td:1.7 --- llvm/lib/Target/PowerPC/PPC.td:1.6 Sat Oct 22 03:04:24 2005 +++ llvm/lib/Target/PowerPC/PPC.td Sun Oct 23 00:28:51 2005 @@ -30,15 +30,15 @@ // def Feature64Bit : SubtargetFeature<"64bit", - "Should 64 bit instructions be used">; + "Enable 64-bit instructions">; def Feature64BitRegs : SubtargetFeature<"64bitregs", - "Should 64 bit registers be used">; + "Enable 64-bit registers">; def FeatureAltivec : SubtargetFeature<"altivec", - "Should Altivec instructions be used">; + "Enable Altivec instructions">; def FeatureGPUL : SubtargetFeature<"gpul", - "Should GPUL instructions be used">; + "Enable GPUL instructions">; def FeatureFSqrt : SubtargetFeature<"fsqrt", - "Should the fsqrt instruction be used">; + "Enable the fsqrt instruction">; //===----------------------------------------------------------------------===// // PowerPC chips sets supported. From lattner at cs.uiuc.edu Sun Oct 23 00:33:50 2005 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sun, 23 Oct 2005 00:33:50 -0500 Subject: [llvm-commits] CVS: llvm/lib/Target/SubtargetFeature.cpp Message-ID: <200510230533.AAA11422@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target: SubtargetFeature.cpp updated: 1.5 -> 1.6 --- Log message: Improve help output. --- Diffs of the changes: (+16 -12) SubtargetFeature.cpp | 28 ++++++++++++++++------------ 1 files changed, 16 insertions(+), 12 deletions(-) Index: llvm/lib/Target/SubtargetFeature.cpp diff -u llvm/lib/Target/SubtargetFeature.cpp:1.5 llvm/lib/Target/SubtargetFeature.cpp:1.6 --- llvm/lib/Target/SubtargetFeature.cpp:1.5 Sun Oct 23 00:26:26 2005 +++ llvm/lib/Target/SubtargetFeature.cpp Sun Oct 23 00:33:39 2005 @@ -125,25 +125,29 @@ /// Display help for feature choices. /// -static void Help(const char *Heading, const SubtargetFeatureKV *Table, +static void Help(bool isFeature, const SubtargetFeatureKV *Table, size_t TableSize) { - // Determine the length of the longest key + // Determine the length of the longest key. size_t MaxLen = 0; for (size_t i = 0; i < TableSize; i++) MaxLen = std::max(MaxLen, std::strlen(Table[i].Key)); - // Print heading - std::cerr << "Help for " << Heading << " choices:\n\n"; - // For each feature + + std::cerr << "Available " << (isFeature ? "features" : "CPUs") + << " for this target:\n\n"; + for (size_t i = 0; i < TableSize; i++) { // Compute required padding size_t Pad = MaxLen - std::strlen(Table[i].Key); - // Print details std::cerr << Table[i].Key << std::string(Pad, ' ') << " - " - << Table[i].Desc << "\n"; + << Table[i].Desc << ".\n"; + } + + std::cerr << "\n"; + if (isFeature) { + std::cerr + << "Use +feature to enable a feature, or -feature to disable it.\n" + << "For example, llc -mcpu=mycpu -mattr=+feature1,-feature2\n"; } - // Wrap it up - std::cerr << "\n\n"; - // Leave tool exit(1); } @@ -202,7 +206,7 @@ // Check if default is needed if (Features[0].empty()) Features[0] = DefaultCPU; // Check for help - if (Features[0] == "help") Help("CPU", CPUTable, CPUTableSize); + if (Features[0] == "help") Help(false, CPUTable, CPUTableSize); // Find CPU entry const SubtargetFeatureKV *CPUEntry = Find(Features[0], CPUTable, CPUTableSize); @@ -221,7 +225,7 @@ // Get next feature const std::string &Feature = Features[i]; // Check for help - if (Feature == "+help") Help("feature", FeatureTable, FeatureTableSize); + if (Feature == "+help") Help(true, FeatureTable, FeatureTableSize); // Find feature in table. const SubtargetFeatureKV *FeatureEntry = Find(StripFlag(Feature), FeatureTable, FeatureTableSize); From lattner at cs.uiuc.edu Sun Oct 23 00:48:03 2005 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sun, 23 Oct 2005 00:48:03 -0500 Subject: [llvm-commits] CVS: llvm/utils/TableGen/TableGen.cpp InstrSelectorEmitter.cpp InstrSelectorEmitter.h Message-ID: <200510230548.AAA11576@zion.cs.uiuc.edu> Changes in directory llvm/utils/TableGen: TableGen.cpp updated: 1.40 -> 1.41 InstrSelectorEmitter.cpp (r1.45) removed InstrSelectorEmitter.h (r1.27) removed --- Log message: Remove the obsolete instr selector emitter --- Diffs of the changes: (+1 -7) TableGen.cpp | 8 +------- 1 files changed, 1 insertion(+), 7 deletions(-) Index: llvm/utils/TableGen/TableGen.cpp diff -u llvm/utils/TableGen/TableGen.cpp:1.40 llvm/utils/TableGen/TableGen.cpp:1.41 --- llvm/utils/TableGen/TableGen.cpp:1.40 Fri Oct 21 14:02:44 2005 +++ llvm/utils/TableGen/TableGen.cpp Sun Oct 23 00:47:52 2005 @@ -23,7 +23,6 @@ #include "RegisterInfoEmitter.h" #include "InstrInfoEmitter.h" #include "AsmWriterEmitter.h" -#include "InstrSelectorEmitter.h" #include "DAGISelEmitter.h" #include "SubtargetEmitter.h" #include @@ -35,7 +34,7 @@ PrintRecords, GenEmitter, GenRegisterEnums, GenRegister, GenRegisterHeader, - GenInstrEnums, GenInstrs, GenAsmWriter, GenInstrSelector, + GenInstrEnums, GenInstrs, GenAsmWriter, GenDAGISel, GenSubtarget, PrintEnums, @@ -61,8 +60,6 @@ "Generate instruction descriptions"), clEnumValN(GenAsmWriter, "gen-asm-writer", "Generate assembly writer"), - clEnumValN(GenInstrSelector, "gen-instr-selector", - "Generate an instruction selector"), clEnumValN(GenDAGISel, "gen-dag-isel", "Generate a DAG instruction selector"), clEnumValN(GenSubtarget, "gen-subtarget", @@ -470,9 +467,6 @@ AsmWriterEmitter(Records).run(*Out); break; - case GenInstrSelector: - InstrSelectorEmitter(Records).run(*Out); - break; case GenDAGISel: DAGISelEmitter(Records).run(*Out); break; From jlaskey at apple.com Sun Oct 23 07:17:11 2005 From: jlaskey at apple.com (Jim Laskey) Date: Sun, 23 Oct 2005 07:17:11 -0500 Subject: [llvm-commits] CVS: llvm-www/img/PhotoJim.jpg Message-ID: <200510231217.HAA17373@zion.cs.uiuc.edu> Changes in directory llvm-www/img: PhotoJim.jpg added (r1.1) --- Log message: adding to contributors --- Diffs of the changes: (+0 -0) PhotoJim.jpg | 0 1 files changed Index: llvm-www/img/PhotoJim.jpg From jlaskey at apple.com Sun Oct 23 08:43:00 2005 From: jlaskey at apple.com (Jim Laskey) Date: Sun, 23 Oct 2005 08:43:00 -0500 Subject: [llvm-commits] CVS: llvm-www/Developers.html Message-ID: <200510231343.IAA20430@zion.cs.uiuc.edu> Changes in directory llvm-www: Developers.html updated: 1.30 -> 1.31 --- Log message: Added me. Sorry if there is a long standing practice of adding them column major. Row major is just easier to maintain. Ruby rocks. Cheers, -- Jim --- Diffs of the changes: (+48 -46) Developers.html | 94 ++++++++++++++++++++++++++++---------------------------- 1 files changed, 48 insertions(+), 46 deletions(-) Index: llvm-www/Developers.html diff -u llvm-www/Developers.html:1.30 llvm-www/Developers.html:1.31 --- llvm-www/Developers.html:1.30 Thu Sep 1 18:05:51 2005 +++ llvm-www/Developers.html Sun Oct 23 08:42:43 2005 @@ -15,23 +15,56 @@ Name Picture + + Vikram Adve vadve - + Henrik Bach + + Henrik + + + + Nate Begeman + + Sampo + + Rob Bocchino + Rob + + + + + Misha Brukman + + Misha + + Jeff Cohen + jeffc + + + + John Criswell + Dogbert + Alkis Evlogimenos + alkis + + + Brian Gaeke brg - - - Henrik Bach - - Henrik Brad Jones - Nate Begeman - - Sampo - - + Jim Laskey + Jim Chris Lattner Sabre - Rob Bocchino - Rob - - Tanya Lattner tonic - - - - Misha Brukman - - Misha - - - Andrew Lenharth + Andrew Lenharth Andrew - - Jeff Cohen - jeffc Duraid Madina camel_ - - - - - John Criswell - Dogbert - - Reid Spencer + Reid Spencer Reid - Alkis Evlogimenos - alkis - Bill Wendling Bill - - + + + From jlaskey at apple.com Sun Oct 23 09:39:53 2005 From: jlaskey at apple.com (Jim Laskey) Date: Sun, 23 Oct 2005 11:39:53 -0300 Subject: [llvm-commits] CVS: llvm/include/llvm/Support/CommandLine.h DataTypes.h.in In-Reply-To: <200510230437.XAA10825@zion.cs.uiuc.edu> References: <200510230437.XAA10825@zion.cs.uiuc.edu> Message-ID: This doesn't compile for my copy of gcc; > +#if __GNUC__ > 3 > +#define END_WITH_NULL __attribute__((sentinel)) > +#else > +#define END_WITH_NULL > +#endif > ValuesClass values(const char *Arg, DataType Val, const > char *Desc, > - ...) { > + ...) END_WITH_NULL { /llvm/llvm/include/llvm/Support/CommandLine.h:339: error: attributes are not allowed on a function-definition gcc version 4.0.0 (Apple Computer, Inc. build 5026) How about; ValuesClass END_WITH_NULL values(const char *Arg, DataType Val, const char *Desc, Cheers, -- Jim On Oct 23, 2005, at 1:37 AM, Jeff Cohen wrote: > > > Changes in directory llvm/include/llvm/Support: > > CommandLine.h updated: 1.49 -> 1.50 > DataTypes.h.in updated: 1.20 -> 1.21 > --- > Log message: > > When a function takes a variable number of pointer arguments, with > a zero > pointer marking the end of the list, the zero *must* be cast to the > pointer > type. An un-cast zero is a 32-bit int, and at least on x86_64, gcc > will > not extend the zero to 64 bits, thus allowing the upper 32 bits to be > random junk. > > The new END_WITH_NULL macro may be used to annotate a such a function > so that GCC (version 4 or newer) will detect the use of un-casted zero > at compile time. > > > --- > Diffs of the changes: (+8 -1) > > CommandLine.h | 3 ++- > DataTypes.h.in | 6 ++++++ > 2 files changed, 8 insertions(+), 1 deletion(-) > > > Index: llvm/include/llvm/Support/CommandLine.h > diff -u llvm/include/llvm/Support/CommandLine.h:1.49 llvm/include/ > llvm/Support/CommandLine.h:1.50 > --- llvm/include/llvm/Support/CommandLine.h:1.49 Thu Oct 13 > 19:33:05 2005 > +++ llvm/include/llvm/Support/CommandLine.h Sat Oct 22 23:37:19 2005 > @@ -21,6 +21,7 @@ > #define LLVM_SUPPORT_COMMANDLINE_H > > #include "llvm/Support/type_traits.h" > +#include "llvm/Support/DataTypes.h" > #include > #include > #include > @@ -335,7 +336,7 @@ > > template > ValuesClass values(const char *Arg, DataType Val, const > char *Desc, > - ...) { > + ...) END_WITH_NULL { > va_list ValueArgs; > va_start(ValueArgs, Desc); > ValuesClass Vals(Arg, Val, Desc, ValueArgs); > > > Index: llvm/include/llvm/Support/DataTypes.h.in > diff -u llvm/include/llvm/Support/DataTypes.h.in:1.20 llvm/include/ > llvm/Support/DataTypes.h.in:1.21 > --- llvm/include/llvm/Support/DataTypes.h.in:1.20 Wed Jul 27 > 00:53:43 2005 > +++ llvm/include/llvm/Support/DataTypes.h.in Sat Oct 22 23:37:19 2005 > @@ -98,4 +98,10 @@ > # define UINT64_MAX 0xffffffffffffffffULL > #endif > > +#if __GNUC__ > 3 > +#define END_WITH_NULL __attribute__((sentinel)) > +#else > +#define END_WITH_NULL > +#endif > + > #endif /* SUPPORT_DATATYPES_H */ > > > > _______________________________________________ > llvm-commits mailing list > llvm-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.cs.uiuc.edu/pipermail/llvm-commits/attachments/20051023/a1937500/attachment.html From jeffc at jolt-lang.org Sun Oct 23 10:22:03 2005 From: jeffc at jolt-lang.org (Jeff Cohen) Date: Sun, 23 Oct 2005 10:22:03 -0500 Subject: [llvm-commits] CVS: llvm/win32/TableGen/TableGen.vcproj Message-ID: <200510231522.KAA20688@zion.cs.uiuc.edu> Changes in directory llvm/win32/TableGen: TableGen.vcproj updated: 1.15 -> 1.16 --- Log message: Remove deleted files from Visual Studio. --- Diffs of the changes: (+0 -6) TableGen.vcproj | 6 ------ 1 files changed, 6 deletions(-) Index: llvm/win32/TableGen/TableGen.vcproj diff -u llvm/win32/TableGen/TableGen.vcproj:1.15 llvm/win32/TableGen/TableGen.vcproj:1.16 --- llvm/win32/TableGen/TableGen.vcproj:1.15 Sat Oct 22 20:22:33 2005 +++ llvm/win32/TableGen/TableGen.vcproj Sun Oct 23 10:21:52 2005 @@ -183,9 +183,6 @@ RelativePath="..\..\utils\TableGen\InstrInfoEmitter.cpp"> - - - - Changes in directory llvm/include/llvm/Support: CommandLine.h updated: 1.50 -> 1.51 --- Log message: Work around GCC's dislike of attributes on function definitions. --- Diffs of the changes: (+6 -1) CommandLine.h | 7 ++++++- 1 files changed, 6 insertions(+), 1 deletion(-) Index: llvm/include/llvm/Support/CommandLine.h diff -u llvm/include/llvm/Support/CommandLine.h:1.50 llvm/include/llvm/Support/CommandLine.h:1.51 --- llvm/include/llvm/Support/CommandLine.h:1.50 Sat Oct 22 23:37:19 2005 +++ llvm/include/llvm/Support/CommandLine.h Sun Oct 23 10:22:50 2005 @@ -334,9 +334,14 @@ } }; +// Silly GCC doesn't allow attributes on a function definition. template ValuesClass values(const char *Arg, DataType Val, const char *Desc, - ...) END_WITH_NULL { + ...) END_WITH_NULL; + +template +ValuesClass values(const char *Arg, DataType Val, const char *Desc, + ...) { va_list ValueArgs; va_start(ValueArgs, Desc); ValuesClass Vals(Arg, Val, Desc, ValueArgs); From lattner at cs.uiuc.edu Sun Oct 23 12:24:12 2005 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sun, 23 Oct 2005 12:24:12 -0500 Subject: [llvm-commits] CVS: llvm-www/pubs/2005-10-20-LCPC-RegAlloc.html 2005-10-20-LCPC-RegAlloc.pdf index.html Message-ID: <200510231724.MAA21230@zion.cs.uiuc.edu> Changes in directory llvm-www/pubs: 2005-10-20-LCPC-RegAlloc.html added (r1.1) 2005-10-20-LCPC-RegAlloc.pdf added (r1.1) index.html updated: 1.26 -> 1.27 --- Log message: add a new paper that uses LLVM --- Diffs of the changes: (+67 -0) 2005-10-20-LCPC-RegAlloc.html | 60 ++++++++++++++++++++++++++++++++++++++++++ 2005-10-20-LCPC-RegAlloc.pdf | 0 index.html | 7 ++++ 3 files changed, 67 insertions(+) Index: llvm-www/pubs/2005-10-20-LCPC-RegAlloc.html diff -c /dev/null llvm-www/pubs/2005-10-20-LCPC-RegAlloc.html:1.1 *** /dev/null Sun Oct 23 12:24:10 2005 --- llvm-www/pubs/2005-10-20-LCPC-RegAlloc.html Sun Oct 23 12:24:00 2005 *************** *** 0 **** --- 1,60 ---- + + + + + + Revisiting Graph Coloring Register Allocation: A Study of the Chaitin-Briggs + and Callahan-Koblenz Algorithms + + + +
        + Revisiting Graph Coloring Register Allocation: A Study of the Chaitin-Briggs + and Callahan-Koblenz Algorithms
        +
        + Keith Cooper, Anshuman Dasgupta, and Jason Eckhardt +
        + + +

        Abstract:

        +
        + +

        Techniques for global register allocation via graph coloring have + been extensively studied and widely implemented in compiler frameworks. This + paper examines a particular variant - the Callahan Koblenz allocator - and + compares it to the Chaitin-Briggs graph coloring register allocator. Both al- + gorithms were published in the 1990's, yet the academic literature does not + contain an assessment of the Callahan-Koblenz allocator. This paper evaluates + and contrasts the allocation decisions made by both algorithms. In particular, + we focus on two key differences between the allocators: + Spill code: The Callahan-Koblenz allocator attempts to minimize the effect of + spill code by using program structure to guide allocation and spill code place- + ment. We evaluate the impact of this strategy on allocated code. + Copy elimination: Effective register-to-register copy removal is important for + producing good code. The allocators use different techniques to eliminate these + copies. We compare the mechanisms and provide insights into the relative per- + formance of the contrasting techniques. + The Callahan-Koblenz allocator may potentially insert extra branches as part + of the allocation process. We also measure the performance overhead due to + these branches. +

        +
        + +

        Published:

        +
        + "Revisiting Graph Coloring Register Allocation: A Study of the Chaitin-Briggs + and Callahan-Koblenz Algorithms"
        + By Keith Cooper, Anshuman Dasgupta, and Jason Eckhardt.
        + Proceedings of the Workshop on Languages and Compilers for Parallel + Computing (LCPC'05), Hawthorne, NY, October 20-22, 2005 +
        + +

        Download:

        + + + + Index: llvm-www/pubs/2005-10-20-LCPC-RegAlloc.pdf Index: llvm-www/pubs/index.html diff -u llvm-www/pubs/index.html:1.26 llvm-www/pubs/index.html:1.27 --- llvm-www/pubs/index.html:1.26 Sat Oct 22 16:48:02 2005 +++ llvm-www/pubs/index.html Sun Oct 23 12:24:00 2005 @@ -45,6 +45,13 @@
          +
        1. "Revisiting Graph Coloring Register + Allocation: A Study of the Chaitin-Briggs and Callahan-Koblenz + Algorithms"
          + By Keith Cooper, Anshuman Dasgupta, and Jason Eckhardt.
          + Proceedings of the Workshop on Languages and Compilers for Parallel + Computing (LCPC'05), Hawthorne, NY, October 20-22, 2005
        2. +
        3. "Segment Protection for Embedded Systems Using Run-time Checks"
          By Matthew Simpson, Bhuvan Middha and Rajeev Barua
          From lattner at cs.uiuc.edu Sun Oct 23 13:01:20 2005 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sun, 23 Oct 2005 13:01:20 -0500 Subject: [llvm-commits] CVS: llvm-www/pubs/2004-01-30-CGO-LLVM.html index.html Message-ID: <200510231801.NAA21406@zion.cs.uiuc.edu> Changes in directory llvm-www/pubs: 2004-01-30-CGO-LLVM.html updated: 1.3 -> 1.4 index.html updated: 1.27 -> 1.28 --- Log message: remove an old tech report from the main page to reduce clutter --- Diffs of the changes: (+3 -7) 2004-01-30-CGO-LLVM.html | 2 ++ index.html | 8 +------- 2 files changed, 3 insertions(+), 7 deletions(-) Index: llvm-www/pubs/2004-01-30-CGO-LLVM.html diff -u llvm-www/pubs/2004-01-30-CGO-LLVM.html:1.3 llvm-www/pubs/2004-01-30-CGO-LLVM.html:1.4 --- llvm-www/pubs/2004-01-30-CGO-LLVM.html:1.3 Wed Mar 31 22:41:00 2004 +++ llvm-www/pubs/2004-01-30-CGO-LLVM.html Sun Oct 23 13:01:09 2005 @@ -43,6 +43,8 @@ challenging compiler problems. +

          Note this paper supersedes the earlier tech report.

          +

          Published:

          "LLVM: A Compilation Framework for Lifelong Program Analysis & Transformation", Chris Lattner and Vikram Adve.
          Index: llvm-www/pubs/index.html diff -u llvm-www/pubs/index.html:1.27 llvm-www/pubs/index.html:1.28 --- llvm-www/pubs/index.html:1.27 Sun Oct 23 12:24:00 2005 +++ llvm-www/pubs/index.html Sun Oct 23 13:01:09 2005 @@ -11,13 +11,7 @@ Lifelong Program Analysis & Transformation"
          Chris Lattner and Vikram Adve
          Proc. of the 2004 International Symposium on Code Generation and Optimization (CGO'04), Palo Alto, California, Mar. -2004. - -
          A previous version is available as:
          -"LLVM: A Compilation -Framework for Lifelong Program Analysis & Transformation"
          Chris -Lattner & Vikram Adve
          Technical Report #UIUCDCS-R-2003-2380, Computer -Science Dept., Univ. of Illinois, Sep. 2003.
        4. +2004.
        5. "LLVA: A Low-level Virtual Instruction Set Architecture"
          Vikram Adve, Chris Lattner, Michael Brukman, Anand Shukla, From lattner at cs.uiuc.edu Sun Oct 23 13:03:15 2005 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sun, 23 Oct 2005 13:03:15 -0500 Subject: [llvm-commits] CVS: llvm-www/pubs/2002-12-LattnerMSThesis.html index.html Message-ID: <200510231803.NAA21486@zion.cs.uiuc.edu> Changes in directory llvm-www/pubs: 2002-12-LattnerMSThesis.html updated: 1.5 -> 1.6 index.html updated: 1.28 -> 1.29 --- Log message: demote another *really* old tech report from the main page --- Diffs of the changes: (+5 -5) 2002-12-LattnerMSThesis.html | 5 +++++ index.html | 5 ----- 2 files changed, 5 insertions(+), 5 deletions(-) Index: llvm-www/pubs/2002-12-LattnerMSThesis.html diff -u llvm-www/pubs/2002-12-LattnerMSThesis.html:1.5 llvm-www/pubs/2002-12-LattnerMSThesis.html:1.6 --- llvm-www/pubs/2002-12-LattnerMSThesis.html:1.5 Sun Nov 16 13:36:07 2003 +++ llvm-www/pubs/2002-12-LattnerMSThesis.html Sun Oct 23 13:03:03 2005 @@ -52,6 +52,11 @@ href="http://llvm.cs.uiuc.edu/">http://llvm.cs.uiuc.edu/

          +

          +This thesis supercedes an older +technical report. +

          +

          Published:

          "LLVM: An Infrastructure for Multi-Stage Optimization", Chris Lattner.
          Index: llvm-www/pubs/index.html diff -u llvm-www/pubs/index.html:1.28 llvm-www/pubs/index.html:1.29 --- llvm-www/pubs/index.html:1.28 Sun Oct 23 13:01:09 2005 +++ llvm-www/pubs/index.html Sun Oct 23 13:03:03 2005 @@ -28,11 +28,6 @@ Computer Science Dept., University of Illinois at Urbana-Champaign, Dec. 2002
        6. -
        7. "The LLVM Instruction Set -and Compilation Strategy"
          Chris Lattner & Vikram Adve
          Technical -Report #UIUCDCS-R-2002-2292, Computer Science Dept., Univ. of Illinois, Aug. -2002.
        8. -
        Publications using LLVM
        From lattner at cs.uiuc.edu Sun Oct 23 14:52:53 2005 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sun, 23 Oct 2005 14:52:53 -0500 Subject: [llvm-commits] CVS: llvm/lib/Target/X86/README.txt Message-ID: <200510231952.OAA21986@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/X86: README.txt updated: 1.14 -> 1.15 --- Log message: Put some of my random notes somewhere public --- Diffs of the changes: (+70 -0) README.txt | 70 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 70 insertions(+) Index: llvm/lib/Target/X86/README.txt diff -u /dev/null llvm/lib/Target/X86/README.txt:1.15 --- /dev/null Sun Oct 23 14:52:52 2005 +++ llvm/lib/Target/X86/README.txt Sun Oct 23 14:52:42 2005 @@ -0,0 +1,70 @@ +//===---------------------------------------------------------------------===// +// Random ideas for the X86 backend. +//===---------------------------------------------------------------------===// + +Add a MUL2U and MUL2S nodes to represent a multiply that returns both the +Hi and Lo parts (combination of MUL and MULH[SU] into one node). Add this to +X86, & make the dag combiner produce it when needed. This will eliminate one +imul from the code generated for: + +long long test(long long X, long long Y) { return X*Y; } + +by using the EAX result from the mul. We should add a similar node for +DIVREM. + +//===---------------------------------------------------------------------===// + +This should be one DIV/IDIV instruction, not a libcall: + +unsigned test(unsigned long long X, unsigned Y) { + return X/Y; +} + +This can be done trivially with a custom legalizer. What about overflow +though? http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14224 + +//===---------------------------------------------------------------------===// + +Need to add support for rotate instructions. + +//===---------------------------------------------------------------------===// + +Some targets (e.g. athlons) prefer freep to fstp ST(0): +http://gcc.gnu.org/ml/gcc-patches/2004-04/msg00659.html + +//===---------------------------------------------------------------------===// + +This should use faddi on chips where it is profitable: +double foo(double P, int *I) { return P+*I; } + +//===---------------------------------------------------------------------===// + +The FP stackifier needs to be global. Also, it should handle simple permutates +to reduce number of shuffle instructions, e.g. turning: + +fld P -> fld Q +fld Q fld P +fxch + +or: + +fxch -> fucomi +fucomi jl X +jg X + +//===---------------------------------------------------------------------===// + +Improvements to the multiply -> shift/add algorithm: +http://gcc.gnu.org/ml/gcc-patches/2004-08/msg01590.html + +//===---------------------------------------------------------------------===// + +Improve code like this (occurs fairly frequently, e.g. in LLVM): +long long foo(int x) { return 1LL << x; } + +http://gcc.gnu.org/ml/gcc-patches/2004-09/msg01109.html +http://gcc.gnu.org/ml/gcc-patches/2004-09/msg01128.html +http://gcc.gnu.org/ml/gcc-patches/2004-09/msg01136.html + +Another useful one would be ~0ULL >> X and ~0ULL << X. + From lattner at cs.uiuc.edu Sun Oct 23 16:45:11 2005 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sun, 23 Oct 2005 16:45:11 -0500 Subject: [llvm-commits] CVS: llvm/lib/Target/X86/README.txt Message-ID: <200510232145.QAA22687@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/X86: README.txt updated: 1.15 -> 1.16 --- Log message: add a note that Nate mentioned last week --- Diffs of the changes: (+5 -0) README.txt | 5 +++++ 1 files changed, 5 insertions(+) Index: llvm/lib/Target/X86/README.txt diff -u llvm/lib/Target/X86/README.txt:1.15 llvm/lib/Target/X86/README.txt:1.16 --- llvm/lib/Target/X86/README.txt:1.15 Sun Oct 23 14:52:42 2005 +++ llvm/lib/Target/X86/README.txt Sun Oct 23 16:45:00 2005 @@ -68,3 +68,8 @@ Another useful one would be ~0ULL >> X and ~0ULL << X. +//===---------------------------------------------------------------------===// + +Should support emission of the bswap instruction, probably by adding a new +DAG node for byte swapping. Also useful on PPC which has byte-swapping loads. + From lattner at cs.uiuc.edu Sun Oct 23 17:07:32 2005 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sun, 23 Oct 2005 17:07:32 -0500 Subject: [llvm-commits] CVS: llvm/lib/Target/TargetSchedule.td Message-ID: <200510232207.RAA23099@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target: TargetSchedule.td updated: 1.3 -> 1.4 --- Log message: add a marker --- Diffs of the changes: (+5 -0) TargetSchedule.td | 5 +++++ 1 files changed, 5 insertions(+) Index: llvm/lib/Target/TargetSchedule.td diff -u llvm/lib/Target/TargetSchedule.td:1.3 llvm/lib/Target/TargetSchedule.td:1.4 --- llvm/lib/Target/TargetSchedule.td:1.3 Fri Oct 21 14:02:44 2005 +++ llvm/lib/Target/TargetSchedule.td Sun Oct 23 17:07:20 2005 @@ -64,3 +64,8 @@ class ProcessorItineraries iid> { list IID = iid; } + +// NoItineraries - A marker that can be used by processors without schedule +// info. +def NoItineraries : ProcessorItineraries<[]>; + From lattner at cs.uiuc.edu Sun Oct 23 17:08:25 2005 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sun, 23 Oct 2005 17:08:25 -0500 Subject: [llvm-commits] CVS: llvm/lib/Target/PowerPC/PPC.td Message-ID: <200510232208.RAA23156@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/PowerPC: PPC.td updated: 1.7 -> 1.8 --- Log message: rearrange things a bit so that instructions can use subtarget features in the future. --- Diffs of the changes: (+9 -11) PPC.td | 20 +++++++++----------- 1 files changed, 9 insertions(+), 11 deletions(-) Index: llvm/lib/Target/PowerPC/PPC.td diff -u llvm/lib/Target/PowerPC/PPC.td:1.7 llvm/lib/Target/PowerPC/PPC.td:1.8 --- llvm/lib/Target/PowerPC/PPC.td:1.7 Sun Oct 23 00:28:51 2005 +++ llvm/lib/Target/PowerPC/PPC.td Sun Oct 23 17:08:13 2005 @@ -16,16 +16,6 @@ include "../Target.td" //===----------------------------------------------------------------------===// -// Register File Description -//===----------------------------------------------------------------------===// - -include "PPCRegisterInfo.td" -include "PPCSchedule.td" -include "PPCInstrInfo.td" - - - -//===----------------------------------------------------------------------===// // PowerPC Subtarget features. // @@ -41,7 +31,15 @@ "Enable the fsqrt instruction">; //===----------------------------------------------------------------------===// -// PowerPC chips sets supported. +// Register File Description +//===----------------------------------------------------------------------===// + +include "PPCRegisterInfo.td" +include "PPCSchedule.td" +include "PPCInstrInfo.td" + +//===----------------------------------------------------------------------===// +// PowerPC processors supported. // def : Processor<"generic", G3Itineraries, []>; From lattner at cs.uiuc.edu Sun Oct 23 17:08:56 2005 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sun, 23 Oct 2005 17:08:56 -0500 Subject: [llvm-commits] CVS: llvm/lib/Target/Alpha/Alpha.td Message-ID: <200510232208.RAA23225@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/Alpha: Alpha.td updated: 1.4 -> 1.5 --- Log message: Add subtarget feature/processor defns to the .td file --- Diffs of the changes: (+22 -0) Alpha.td | 22 ++++++++++++++++++++++ 1 files changed, 22 insertions(+) Index: llvm/lib/Target/Alpha/Alpha.td diff -u llvm/lib/Target/Alpha/Alpha.td:1.4 llvm/lib/Target/Alpha/Alpha.td:1.5 --- llvm/lib/Target/Alpha/Alpha.td:1.4 Thu Jun 23 18:42:05 2005 +++ llvm/lib/Target/Alpha/Alpha.td Sun Oct 23 17:08:45 2005 @@ -17,6 +17,13 @@ //Alpha is little endian //===----------------------------------------------------------------------===// +// Subtarget Features +//===----------------------------------------------------------------------===// + +def FeatureCIX : SubtargetFeature<"CIX", "Enable CIX extentions">; +def FeatureFIX : SubtargetFeature<"FIX", "Enable FIX extentions">; + +//===----------------------------------------------------------------------===// // Register File Description //===----------------------------------------------------------------------===// @@ -36,6 +43,21 @@ // let TSFlagsShifts = []; } +//===----------------------------------------------------------------------===// +// Alpha Processor Definitions +//===----------------------------------------------------------------------===// + +def : Processor<"generic", NoItineraries, []>; +def : Processor<"pca56" , NoItineraries, []>; +def : Processor<"ev56" , NoItineraries, []>; +def : Processor<"ev6" , NoItineraries, [FeatureFIX]>; +def : Processor<"ev67" , NoItineraries, [FeatureFIX, FeatureCIX]>; + +//===----------------------------------------------------------------------===// +// The Alpha Target +//===----------------------------------------------------------------------===// + + def Alpha : Target { // Pointers on Alpha are 64-bits in size. let PointerType = i64; From lattner at cs.uiuc.edu Sun Oct 23 17:15:45 2005 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sun, 23 Oct 2005 17:15:45 -0500 Subject: [llvm-commits] CVS: llvm/lib/Target/Alpha/AlphaSubtarget.cpp Makefile Message-ID: <200510232215.RAA23374@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/Alpha: AlphaSubtarget.cpp updated: 1.3 -> 1.4 Makefile updated: 1.3 -> 1.4 --- Log message: Autogen subtarget information from .td files. --- Diffs of the changes: (+12 -35) AlphaSubtarget.cpp | 44 ++++++++++---------------------------------- Makefile | 3 ++- 2 files changed, 12 insertions(+), 35 deletions(-) Index: llvm/lib/Target/Alpha/AlphaSubtarget.cpp diff -u llvm/lib/Target/Alpha/AlphaSubtarget.cpp:1.3 llvm/lib/Target/Alpha/AlphaSubtarget.cpp:1.4 --- llvm/lib/Target/Alpha/AlphaSubtarget.cpp:1.3 Sun Oct 2 02:13:52 2005 +++ llvm/lib/Target/Alpha/AlphaSubtarget.cpp Sun Oct 23 17:15:34 2005 @@ -16,46 +16,22 @@ #include "llvm/Module.h" #include "llvm/Support/CommandLine.h" #include "llvm/Target/SubtargetFeature.h" -#include "llvm/Support/Debug.h" - +#include "AlphaGenSubtarget.inc" using namespace llvm; -enum AlphaFeature { - AlphaFeatureCIX = 1 << 0, - AlphaFeatureFIX = 1 << 1, -}; -/// Sorted (by key) array of values for CPU subtype. -static const SubtargetFeatureKV AlphaSubTypeKV[] = { - { "ev56" , "Select the Alpha EV56 processor", 0 }, - { "ev6" , "Select the Alpha EV6 processor", AlphaFeatureFIX }, - { "ev67" , "Select the Alpha EV67 processor", AlphaFeatureFIX | AlphaFeatureCIX }, - { "generic", "Select instructions for a generic Alpha processor (EV56)", 0 }, - { "pca56" , "Select the Alpha PCA56 processor", 0 }, +enum { + FeatureKVSize = sizeof(FeatureKV) / sizeof(SubtargetFeatureKV), + SubTypeKVSize = sizeof(SubTypeKV) / sizeof(SubtargetFeatureKV) }; -/// Length of AlphaSubTypeKV. -static const unsigned AlphaSubTypeKVSize = sizeof(AlphaSubTypeKV) - / sizeof(SubtargetFeatureKV); - -/// Sorted (by key) array of values for CPU features. -static SubtargetFeatureKV AlphaFeatureKV[] = { - { "CIX", "Should CIX extentions be used" , AlphaFeatureCIX }, - { "FIX" , "Should FIX extentions be used" , AlphaFeatureFIX }, - }; -/// Length of AlphaFeatureKV. -static const unsigned AlphaFeatureKVSize = sizeof(AlphaFeatureKV) - / sizeof(SubtargetFeatureKV); - AlphaSubtarget::AlphaSubtarget(const Module &M, const std::string &FS) - :HasF2I(false), HasCT(false) -{ + : HasF2I(false), HasCT(false) { std::string CPU = "generic"; uint32_t Bits = - SubtargetFeatures::Parse(FS, CPU, - AlphaSubTypeKV, AlphaSubTypeKVSize, - AlphaFeatureKV, AlphaFeatureKVSize); - HasF2I = (Bits & AlphaFeatureFIX) != 0; - HasCT = (Bits & AlphaFeatureCIX) != 0; - + SubtargetFeatures::Parse(FS, CPU, + SubTypeKV, SubTypeKVSize, + FeatureKV, FeatureKVSize); + HasF2I = (Bits & FeatureFIX) != 0; + HasCT = (Bits & FeatureCIX) != 0; } Index: llvm/lib/Target/Alpha/Makefile diff -u llvm/lib/Target/Alpha/Makefile:1.3 llvm/lib/Target/Alpha/Makefile:1.4 --- llvm/lib/Target/Alpha/Makefile:1.3 Wed Oct 19 19:28:31 2005 +++ llvm/lib/Target/Alpha/Makefile Sun Oct 23 17:15:34 2005 @@ -14,6 +14,7 @@ BUILT_SOURCES = AlphaGenRegisterInfo.h.inc AlphaGenRegisterNames.inc \ AlphaGenRegisterInfo.inc AlphaGenInstrNames.inc \ AlphaGenInstrInfo.inc AlphaGenCodeEmitter.inc \ - AlphaGenAsmWriter.inc AlphaGenDAGISel.inc + AlphaGenAsmWriter.inc AlphaGenDAGISel.inc \ + AlphaGenSubtarget.inc include $(LEVEL)/Makefile.common From lattner at cs.uiuc.edu Sun Oct 23 17:23:25 2005 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sun, 23 Oct 2005 17:23:25 -0500 Subject: [llvm-commits] CVS: llvm/lib/Target/SubtargetFeature.cpp Message-ID: <200510232223.RAA23429@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target: SubtargetFeature.cpp updated: 1.6 -> 1.7 --- Log message: If a user requests help, give them help on both features and processors --- Diffs of the changes: (+41 -25) SubtargetFeature.cpp | 66 +++++++++++++++++++++++++++++++-------------------- 1 files changed, 41 insertions(+), 25 deletions(-) Index: llvm/lib/Target/SubtargetFeature.cpp diff -u llvm/lib/Target/SubtargetFeature.cpp:1.6 llvm/lib/Target/SubtargetFeature.cpp:1.7 --- llvm/lib/Target/SubtargetFeature.cpp:1.6 Sun Oct 23 00:33:39 2005 +++ llvm/lib/Target/SubtargetFeature.cpp Sun Oct 23 17:23:13 2005 @@ -123,31 +123,42 @@ return F; } -/// Display help for feature choices. +/// getLongestEntryLength - Return the length of the longest entry in the table. /// -static void Help(bool isFeature, const SubtargetFeatureKV *Table, - size_t TableSize) { - // Determine the length of the longest key. +static size_t getLongestEntryLength(const SubtargetFeatureKV *Table, + size_t Size) { size_t MaxLen = 0; - for (size_t i = 0; i < TableSize; i++) + for (size_t i = 0; i < Size; i++) MaxLen = std::max(MaxLen, std::strlen(Table[i].Key)); - - std::cerr << "Available " << (isFeature ? "features" : "CPUs") - << " for this target:\n\n"; - - for (size_t i = 0; i < TableSize; i++) { - // Compute required padding - size_t Pad = MaxLen - std::strlen(Table[i].Key); - std::cerr << Table[i].Key << std::string(Pad, ' ') << " - " - << Table[i].Desc << ".\n"; - } + return MaxLen; +} +/// Display help for feature choices. +/// +static void Help(const SubtargetFeatureKV *CPUTable, size_t CPUTableSize, + const SubtargetFeatureKV *FeatTable, size_t FeatTableSize) { + // Determine the length of the longest CPU and Feature entries. + unsigned MaxCPULen = getLongestEntryLength(CPUTable, CPUTableSize); + unsigned MaxFeatLen = getLongestEntryLength(FeatTable, FeatTableSize); + + // Print the CPU table. + std::cerr << "Available CPUs for this target:\n\n"; + for (size_t i = 0; i != CPUTableSize; i++) + std::cerr << " " << CPUTable[i].Key + << std::string(MaxCPULen - std::strlen(CPUTable[i].Key), ' ') + << " - " << CPUTable[i].Desc << ".\n"; std::cerr << "\n"; - if (isFeature) { - std::cerr - << "Use +feature to enable a feature, or -feature to disable it.\n" - << "For example, llc -mcpu=mycpu -mattr=+feature1,-feature2\n"; - } + + // Print the Feature table. + std::cerr << "Available features for this target:\n\n"; + for (size_t i = 0; i != FeatTableSize; i++) + std::cerr << " " << FeatTable[i].Key + << std::string(MaxFeatLen - std::strlen(FeatTable[i].Key), ' ') + << " - " << FeatTable[i].Desc << ".\n"; + std::cerr << "\n"; + + std::cerr << "Use +feature to enable a feature, or -feature to disable it.\n" + << "For example, llc -mcpu=mycpu -mattr=+feature1,-feature2\n"; exit(1); } @@ -203,10 +214,13 @@ uint32_t Bits = 0; // Resulting bits // Split up features Split(Features, String); + // Check if default is needed - if (Features[0].empty()) Features[0] = DefaultCPU; - // Check for help - if (Features[0] == "help") Help(false, CPUTable, CPUTableSize); + if (Features[0].empty()) + Features[0] = DefaultCPU; + else if (Features[0] == "help") + Help(CPUTable, CPUTableSize, FeatureTable, FeatureTableSize); + // Find CPU entry const SubtargetFeatureKV *CPUEntry = Find(Features[0], CPUTable, CPUTableSize); @@ -222,10 +236,12 @@ } // Iterate through each feature for (size_t i = 1; i < Features.size(); i++) { - // Get next feature const std::string &Feature = Features[i]; + // Check for help - if (Feature == "+help") Help(true, FeatureTable, FeatureTableSize); + if (Feature == "+help") + Help(CPUTable, CPUTableSize, FeatureTable, FeatureTableSize); + // Find feature in table. const SubtargetFeatureKV *FeatureEntry = Find(StripFlag(Feature), FeatureTable, FeatureTableSize); From lattner at cs.uiuc.edu Sun Oct 23 17:23:56 2005 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sun, 23 Oct 2005 17:23:56 -0500 Subject: [llvm-commits] CVS: llvm/lib/Target/PowerPC/PPC.td Message-ID: <200510232223.RAA23462@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/PowerPC: PPC.td updated: 1.8 -> 1.9 --- Log message: mark this as beta --- Diffs of the changes: (+1 -1) PPC.td | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm/lib/Target/PowerPC/PPC.td diff -u llvm/lib/Target/PowerPC/PPC.td:1.8 llvm/lib/Target/PowerPC/PPC.td:1.9 --- llvm/lib/Target/PowerPC/PPC.td:1.8 Sun Oct 23 17:08:13 2005 +++ llvm/lib/Target/PowerPC/PPC.td Sun Oct 23 17:23:45 2005 @@ -22,7 +22,7 @@ def Feature64Bit : SubtargetFeature<"64bit", "Enable 64-bit instructions">; def Feature64BitRegs : SubtargetFeature<"64bitregs", - "Enable 64-bit registers">; + "Enable 64-bit registers [beta]">; def FeatureAltivec : SubtargetFeature<"altivec", "Enable Altivec instructions">; def FeatureGPUL : SubtargetFeature<"gpul", From lattner at cs.uiuc.edu Sun Oct 23 17:33:19 2005 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sun, 23 Oct 2005 17:33:19 -0500 Subject: [llvm-commits] CVS: llvm/utils/TableGen/SubtargetEmitter.cpp Message-ID: <200510232233.RAA23894@zion.cs.uiuc.edu> Changes in directory llvm/utils/TableGen: SubtargetEmitter.cpp updated: 1.2 -> 1.3 --- Log message: Add the needed #include, emit enums with the sizes of tables, remove definitions from the LLVM namespace, since they are all static. --- Diffs of the changes: (+12 -9) SubtargetEmitter.cpp | 21 ++++++++++++--------- 1 files changed, 12 insertions(+), 9 deletions(-) Index: llvm/utils/TableGen/SubtargetEmitter.cpp diff -u llvm/utils/TableGen/SubtargetEmitter.cpp:1.2 llvm/utils/TableGen/SubtargetEmitter.cpp:1.3 --- llvm/utils/TableGen/SubtargetEmitter.cpp:1.2 Sat Oct 22 02:59:56 2005 +++ llvm/utils/TableGen/SubtargetEmitter.cpp Sun Oct 23 17:33:08 2005 @@ -57,7 +57,7 @@ RecordList Processors = Records.getAllDerivedDefinitions("Processor"); sort(Processors.begin(), Processors.end(), LessRecordFieldName()); - OS << "namespace llvm {\n\n"; + OS << "#include \"llvm/Target/SubtargetFeature.h\"\n\n"; { // Feature enumeration int i = 0; @@ -78,9 +78,9 @@ } { // Feature key values - OS << "\n\n" - << "/// Sorted (by key) array of values for CPU features.\n" - << "static SubtargetFeatureKV FeatureKV[] = {\n"; + OS << "\n" + << "// Sorted (by key) array of values for CPU features.\n" + << "static llvm::SubtargetFeatureKV FeatureKV[] = {\n"; for (RecordListIter RI = Features.begin(), E = Features.end(); RI != E;) { Record *R = *RI++; std::string Instance = R->getName(); @@ -96,9 +96,9 @@ } { // CPU key values - OS << "\n\n" - << "/// Sorted (by key) array of values for CPU subtype.\n" - << "static const SubtargetFeatureKV SubTypeKV[] = {\n"; + OS << "\n" + << "// Sorted (by key) array of values for CPU subtype.\n" + << "static const llvm::SubtargetFeatureKV SubTypeKV[] = {\n"; for (RecordListIter RI = Processors.begin(), E = Processors.end(); RI != E;) { Record *R = *RI++; @@ -131,6 +131,9 @@ } OS << "};\n"; } - - OS << "\n} // End llvm namespace \n"; + + OS<<"\nenum {\n"; + OS<<" FeatureKVSize = sizeof(FeatureKV)/sizeof(llvm::SubtargetFeatureKV),\n"; + OS<<" SubTypeKVSize = sizeof(SubTypeKV)/sizeof(llvm::SubtargetFeatureKV)\n"; + OS<<"};\n"; } From lattner at cs.uiuc.edu Sun Oct 23 17:33:33 2005 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sun, 23 Oct 2005 17:33:33 -0500 Subject: [llvm-commits] CVS: llvm/lib/Target/Alpha/AlphaSubtarget.cpp Message-ID: <200510232233.RAA23904@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/Alpha: AlphaSubtarget.cpp updated: 1.4 -> 1.5 --- Log message: Simplify this due to changes in the tblgen side --- Diffs of the changes: (+0 -9) AlphaSubtarget.cpp | 9 --------- 1 files changed, 9 deletions(-) Index: llvm/lib/Target/Alpha/AlphaSubtarget.cpp diff -u llvm/lib/Target/Alpha/AlphaSubtarget.cpp:1.4 llvm/lib/Target/Alpha/AlphaSubtarget.cpp:1.5 --- llvm/lib/Target/Alpha/AlphaSubtarget.cpp:1.4 Sun Oct 23 17:15:34 2005 +++ llvm/lib/Target/Alpha/AlphaSubtarget.cpp Sun Oct 23 17:33:22 2005 @@ -13,18 +13,9 @@ #include "AlphaSubtarget.h" #include "Alpha.h" -#include "llvm/Module.h" -#include "llvm/Support/CommandLine.h" -#include "llvm/Target/SubtargetFeature.h" #include "AlphaGenSubtarget.inc" using namespace llvm; - -enum { - FeatureKVSize = sizeof(FeatureKV) / sizeof(SubtargetFeatureKV), - SubTypeKVSize = sizeof(SubTypeKV) / sizeof(SubtargetFeatureKV) -}; - AlphaSubtarget::AlphaSubtarget(const Module &M, const std::string &FS) : HasF2I(false), HasCT(false) { std::string CPU = "generic"; From lattner at cs.uiuc.edu Sun Oct 23 17:34:36 2005 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sun, 23 Oct 2005 17:34:36 -0500 Subject: [llvm-commits] CVS: llvm/lib/Target/PowerPC/PPCSubtarget.cpp Message-ID: <200510232234.RAA23939@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/PowerPC: PPCSubtarget.cpp updated: 1.11 -> 1.12 --- Log message: Simplify this, matching changes in the tblgen emitter --- Diffs of the changes: (+0 -9) PPCSubtarget.cpp | 9 --------- 1 files changed, 9 deletions(-) Index: llvm/lib/Target/PowerPC/PPCSubtarget.cpp diff -u llvm/lib/Target/PowerPC/PPCSubtarget.cpp:1.11 llvm/lib/Target/PowerPC/PPCSubtarget.cpp:1.12 --- llvm/lib/Target/PowerPC/PPCSubtarget.cpp:1.11 Fri Oct 21 14:02:44 2005 +++ llvm/lib/Target/PowerPC/PPCSubtarget.cpp Sun Oct 23 17:34:25 2005 @@ -15,7 +15,6 @@ #include "PPC.h" #include "llvm/Module.h" #include "llvm/Support/CommandLine.h" -#include "llvm/Target/SubtargetFeature.h" #include "PPCGenSubtarget.inc" using namespace llvm; @@ -32,14 +31,6 @@ cl::location(PPCTarget), cl::init(TargetDefault)); } -/// Length of FeatureKV. -static const unsigned FeatureKVSize = sizeof(FeatureKV) - / sizeof(SubtargetFeatureKV); -/// Length of SubTypeKV. -static const unsigned SubTypeKVSize = sizeof(SubTypeKV) - / sizeof(SubtargetFeatureKV); - - #if defined(__APPLE__) #include #include From lattner at cs.uiuc.edu Sun Oct 23 17:35:53 2005 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sun, 23 Oct 2005 17:35:53 -0500 Subject: [llvm-commits] CVS: llvm/tools/llc/llc.cpp Message-ID: <200510232235.RAA23978@zion.cs.uiuc.edu> Changes in directory llvm/tools/llc: llc.cpp updated: 1.114 -> 1.115 --- Log message: shrinkify the option name a bit --- Diffs of the changes: (+2 -2) llc.cpp | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) Index: llvm/tools/llc/llc.cpp diff -u llvm/tools/llc/llc.cpp:1.114 llvm/tools/llc/llc.cpp:1.115 --- llvm/tools/llc/llc.cpp:1.114 Sat Oct 22 17:00:45 2005 +++ llvm/tools/llc/llc.cpp Sun Oct 23 17:35:42 2005 @@ -50,14 +50,14 @@ static cl::opt MCPU("mcpu", - cl::desc("Target a specific cpu type (-mcpu=help for list of choices)"), + cl::desc("Target a specific cpu type (-mcpu=help for details)"), cl::value_desc("cpu-name"), cl::init("")); static cl::list MAttrs("mattr", cl::CommaSeparated, - cl::desc("Target specific attributes (-mattr=help for list of choices)"), + cl::desc("Target specific attributes (-mattr=help for details)"), cl::value_desc("attr1,+attr2, ..., -attrN")); cl::opt From bocchino at cs.uiuc.edu Sun Oct 23 17:36:40 2005 From: bocchino at cs.uiuc.edu (Robert Bocchino) Date: Sun, 23 Oct 2005 17:36:40 -0500 Subject: [llvm-commits] CVS: llvm/examples/SIMD/ Message-ID: <200510232236.RAA24040@zion.cs.uiuc.edu> Changes in directory llvm/examples/SIMD: --- Log message: Directory /home/vadve/shared/PublicCVS/llvm/examples/SIMD added to the repository --> Using per-directory sticky tag `vector_llvm' --- Diffs of the changes: (+0 -0) 0 files changed From bocchino at cs.uiuc.edu Sun Oct 23 17:36:53 2005 From: bocchino at cs.uiuc.edu (Robert Bocchino) Date: Sun, 23 Oct 2005 17:36:53 -0500 Subject: [llvm-commits] CVS: llvm/examples/SIMD/Saxpy/ Message-ID: <200510232236.RAA24056@zion.cs.uiuc.edu> Changes in directory llvm/examples/SIMD/Saxpy: --- Log message: Directory /home/vadve/shared/PublicCVS/llvm/examples/SIMD/Saxpy added to the repository --> Using per-directory sticky tag `vector_llvm' --- Diffs of the changes: (+0 -0) 0 files changed From bocchino at cs.uiuc.edu Sun Oct 23 17:36:55 2005 From: bocchino at cs.uiuc.edu (Robert Bocchino) Date: Sun, 23 Oct 2005 17:36:55 -0500 Subject: [llvm-commits] CVS: llvm/examples/SIMD/InterQuant/ Message-ID: <200510232236.RAA24060@zion.cs.uiuc.edu> Changes in directory llvm/examples/SIMD/InterQuant: --- Log message: Directory /home/vadve/shared/PublicCVS/llvm/examples/SIMD/InterQuant added to the repository --> Using per-directory sticky tag `vector_llvm' --- Diffs of the changes: (+0 -0) 0 files changed From bocchino at cs.uiuc.edu Sun Oct 23 17:36:58 2005 From: bocchino at cs.uiuc.edu (Robert Bocchino) Date: Sun, 23 Oct 2005 17:36:58 -0500 Subject: [llvm-commits] CVS: llvm/examples/SIMD/MADFilter/ Message-ID: <200510232236.RAA24064@zion.cs.uiuc.edu> Changes in directory llvm/examples/SIMD/MADFilter: --- Log message: Directory /home/vadve/shared/PublicCVS/llvm/examples/SIMD/MADFilter added to the repository --> Using per-directory sticky tag `vector_llvm' --- Diffs of the changes: (+0 -0) 0 files changed From bocchino at cs.uiuc.edu Sun Oct 23 17:37:02 2005 From: bocchino at cs.uiuc.edu (Robert Bocchino) Date: Sun, 23 Oct 2005 17:37:02 -0500 Subject: [llvm-commits] CVS: llvm/examples/SIMD/RGB2YUV/ Message-ID: <200510232237.RAA24073@zion.cs.uiuc.edu> Changes in directory llvm/examples/SIMD/RGB2YUV: --- Log message: Directory /home/vadve/shared/PublicCVS/llvm/examples/SIMD/RGB2YUV added to the repository --> Using per-directory sticky tag `vector_llvm' --- Diffs of the changes: (+0 -0) 0 files changed From bocchino at cs.uiuc.edu Sun Oct 23 17:37:12 2005 From: bocchino at cs.uiuc.edu (Robert Bocchino) Date: Sun, 23 Oct 2005 17:37:12 -0500 Subject: [llvm-commits] CVS: llvm/examples/SIMD/Transpose/ Message-ID: <200510232237.RAA24104@zion.cs.uiuc.edu> Changes in directory llvm/examples/SIMD/Transpose: --- Log message: Directory /home/vadve/shared/PublicCVS/llvm/examples/SIMD/Transpose added to the repository --> Using per-directory sticky tag `vector_llvm' --- Diffs of the changes: (+0 -0) 0 files changed From bocchino at cs.uiuc.edu Sun Oct 23 17:37:21 2005 From: bocchino at cs.uiuc.edu (Robert Bocchino) Date: Sun, 23 Oct 2005 17:37:21 -0500 Subject: [llvm-commits] CVS: llvm/examples/SIMD/DCT/ Message-ID: <200510232237.RAA24112@zion.cs.uiuc.edu> Changes in directory llvm/examples/SIMD/DCT: --- Log message: Directory /home/vadve/shared/PublicCVS/llvm/examples/SIMD/DCT added to the repository --> Using per-directory sticky tag `vector_llvm' --- Diffs of the changes: (+0 -0) 0 files changed From lattner at cs.uiuc.edu Sun Oct 23 17:37:24 2005 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sun, 23 Oct 2005 17:37:24 -0500 Subject: [llvm-commits] CVS: llvm/tools/llc/llc.cpp Message-ID: <200510232237.RAA24120@zion.cs.uiuc.edu> Changes in directory llvm/tools/llc: llc.cpp updated: 1.115 -> 1.116 --- Log message: Shrinkify to make --help output look better --- Diffs of the changes: (+1 -1) llc.cpp | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm/tools/llc/llc.cpp diff -u llvm/tools/llc/llc.cpp:1.115 llvm/tools/llc/llc.cpp:1.116 --- llvm/tools/llc/llc.cpp:1.115 Sun Oct 23 17:35:42 2005 +++ llvm/tools/llc/llc.cpp Sun Oct 23 17:37:13 2005 @@ -58,7 +58,7 @@ MAttrs("mattr", cl::CommaSeparated, cl::desc("Target specific attributes (-mattr=help for details)"), - cl::value_desc("attr1,+attr2, ..., -attrN")); + cl::value_desc("a1,+a2,-a3,...")); cl::opt FileType("filetype", cl::init(TargetMachine::AssemblyFile), From lattner at cs.uiuc.edu Sun Oct 23 17:39:12 2005 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sun, 23 Oct 2005 17:39:12 -0500 Subject: [llvm-commits] CVS: llvm/lib/ExecutionEngine/JIT/TargetSelect.cpp Message-ID: <200510232239.RAA24175@zion.cs.uiuc.edu> Changes in directory llvm/lib/ExecutionEngine/JIT: TargetSelect.cpp updated: 1.9 -> 1.10 --- Log message: Shrinkify to match llc --- Diffs of the changes: (+3 -3) TargetSelect.cpp | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) Index: llvm/lib/ExecutionEngine/JIT/TargetSelect.cpp diff -u llvm/lib/ExecutionEngine/JIT/TargetSelect.cpp:1.9 llvm/lib/ExecutionEngine/JIT/TargetSelect.cpp:1.10 --- llvm/lib/ExecutionEngine/JIT/TargetSelect.cpp:1.9 Fri Sep 2 14:27:43 2005 +++ llvm/lib/ExecutionEngine/JIT/TargetSelect.cpp Sun Oct 23 17:39:01 2005 @@ -26,15 +26,15 @@ static cl::opt MCPU("mcpu", - cl::desc("Target a specific cpu type (-mcpu=help for list of choices)"), + cl::desc("Target a specific cpu type (-mcpu=help for details)"), cl::value_desc("cpu-name"), cl::init("")); static cl::list MAttrs("mattr", cl::CommaSeparated, - cl::desc("Target specific attributes (-mattr=help for list of choices)"), - cl::value_desc("attr1,+attr2, ..., -attrN")); + cl::desc("Target specific attributes (-mattr=help for details)"), + cl::value_desc("a1,+a2,-a3,...")); /// create - Create an return a new JIT compiler if there is one available /// for the current target. Otherwise, return null. From bocchino at persephone.cs.uiuc.edu Sun Oct 23 17:50:20 2005 From: bocchino at persephone.cs.uiuc.edu (Robert L. Bocchino Jr.) Date: Sun, 23 Oct 2005 17:50:20 -0500 (CDT) Subject: [llvm-commits] [vector_llvm] CVS: llvm/examples/SIMD/InterQuant/Makefile interquant.altivec.handwritten.c interquant.sse.handwritten.c interquant.vectorc.c main.c Message-ID: <20051023225020.C72D617FABC0@persephone.cs.uiuc.edu> Changes in directory llvm/examples/SIMD/InterQuant: Makefile added (r1.1.2.1) interquant.altivec.handwritten.c added (r1.1.2.1) interquant.sse.handwritten.c added (r1.1.2.1) interquant.vectorc.c added (r1.1.2.1) main.c added (r1.1.2.1) --- Log message: Examples to illustrate Vector LLVM's SIMD support. --- Diffs of the changes: (+201 -0) Makefile | 4 + interquant.altivec.handwritten.c | 1 interquant.sse.handwritten.c | 40 +++++++++++++ interquant.vectorc.c | 44 +++++++++++++++ main.c | 112 +++++++++++++++++++++++++++++++++++++++ 5 files changed, 201 insertions Index: llvm/examples/SIMD/InterQuant/Makefile diff -c /dev/null llvm/examples/SIMD/InterQuant/Makefile:1.1.2.1 *** /dev/null Sun Oct 23 17:50:00 2005 --- llvm/examples/SIMD/InterQuant/Makefile Sun Oct 23 17:49:40 2005 *************** *** 0 **** --- 1,4 ---- + NAME= interquant + + include ../Makefile.common + Index: llvm/examples/SIMD/InterQuant/interquant.altivec.handwritten.c diff -c /dev/null llvm/examples/SIMD/InterQuant/interquant.altivec.handwritten.c:1.1.2.1 *** /dev/null Sun Oct 23 17:50:17 2005 --- llvm/examples/SIMD/InterQuant/interquant.altivec.handwritten.c Sun Oct 23 17:49:40 2005 *************** *** 0 **** --- 1 ---- + /*************************************************************** * * Copyright: (c) Copyright Motorola Inc. 1998 * * Date: May 18, 1998 * * Function: INTER_Quantization * * Description: The INTER_QUANTIZATION routine will quantize * the predictive frames (P-picture). Coefficients * are quantized to the formula: * C' = sign(C) * ( abs(C) - QP/2 ) / ( 2 * QP ). * To ensure ( abs(C) - QP/2 ) is positive, saturating * unsigned subtraction is used. * * Inputs: input - Pointer to input data (short), which * must be between -2040 and 2040 (as set * up by DCT ). It is assumed that the allocated * array has been 128-bit aligned and contains * 8x8 short elements. * * Outputs: output - Pointer to output area for the transfored * data. The output values are between -127 * and 127. It is assumed that a 128-bit * aligned 8x8 array of signed char has been * pre-allocated. * * QP: QP (quantization parameter?) ranges from 1 to 31 * **************************************************************/ #define INTER_CALC( input, output ) \ t1 = vec_subs( zero, input);\ u1 = (vector unsigned short ) vec_max( input, t1 ); /* ( abs(C)) */ \ t2 = (vector signed short ) vec_subs( u1, qpd2 );/*max(0,(abs(C)-QP/2)) */ \ t3 = vec_madds( t2, dtqp.v, zero ); /* ( (abs(C)-QP/2)/(2*QP) )>>15 ) */ \ t4 = vec_min(maxq,t3); /* peg value at 127 if greater */ \ msk = vec_cmpgt( zero, input ); /* select to find sign of input */ \ t5 = vec_subs( zero, t4 );\ output = vec_sel( t4, t5, msk ); /* ensure result is same sign */ void interquant_vector ( signed short* in, signed char* out, int QP ) { vect or signed short* input = (vector signed short*) in; vector signed char* output = (vector signed char*) out; /* ensure alignment so calculated constant can be propagated into entire vector for calculations */ union{ vector signed short v; signed short s[8]; } dtqp; vector signed short zero, minus1, maxq, parta, partb; vector signed short t1, t2, t3, t4, t5; /* used in macros */ vector unsigned short qpd2, u1; vector bool short msk; /* load the calculated constant into the vector */ dtqp.s[0] = (signed short)((int)((32768+QP)/(2*QP))); dtqp.s[1] = (signed short)(QP/2); qpd2 = (vector unsigned short) vec_splat( dtqp.v, 1); dtqp.v = vec_splat( dtqp.v, 0 ); /* load the static constants used in the macros */ zero = (vector signed short) (0); maxq = (vector signed short) (127); minus1 = (vector signed short) (-1); /* for all input compute: C' = sign(C) * ( (abs(C)-(QP /2) ) / 2*QP ) */ INTER_CALC( input[0], parta ); INTER_CALC( input[1], partb ); output[0] = vec_pack( parta, partb ); INTER_CALC( input[2], parta ); INTER_CALC( input[3], partb ); output[1] = vec_pack( parta, partb ); INTER_CALC( input[4], parta ); INTER_CALC( input[5], partb ); output[2] = vec_pack( parta, partb ); INTER_CALC( input[6], parta ); INTER_CALC( input[7], partb ); output[3] = vec_pack( parta, partb ); } \ No newline at end of file Index: llvm/examples/SIMD/InterQuant/interquant.sse.handwritten.c diff -c /dev/null llvm/examples/SIMD/InterQuant/interquant.sse.handwritten.c:1.1.2.1 *** /dev/null Sun Oct 23 17:50:18 2005 --- llvm/examples/SIMD/InterQuant/interquant.sse.handwritten.c Sun Oct 23 17:49:40 2005 *************** *** 0 **** --- 1,40 ---- + #include "SSE.h" + + void interquant_vector ( signed short* in, + signed char* out, + int qp) { + int i, j, k; + short dtqp = (32768+qp)/(2*qp); + __m128i dtqp_vec = _mm_splat_epi16(dtqp); + __m128i zero = _mm_splat_epi16(0); + __m128i qpd2 = _mm_splat_epi16(qp/2); + __m128i maxq = _mm_splat_epi16(127); + __m128i *in_vp = (__m128i*) in; + __m128i *out_vp = (__m128i*) out; + __m128i result[2]; + + for (i = 0; i < 4; ++i) { + for (j = 0; j < 2; ++j) { + __m128i input = *in_vp++; + __m128i t1 = _mm_subs_epi16(zero, input); + __m128i u1 = _mm_max_epi16(input, t1); + __m128i t2 = _mm_subs_epu16(u1, qpd2); + + // unsigned tmp = (unsigned) t2 * (unsigned) dtqp_vec + __m128i tmp_hi = _mm_mulhi_epi16(t2, dtqp_vec); + __m128i tmp_lo = _mm_mullo_epi16(t2, dtqp_vec); + + // short t3 = tmp >> 15 + __m128i hi = _mm_slli_epi16(tmp_hi, 1); + __m128i lo = _mm_srli_epi16(tmp_lo, 15); + __m128i t3 = _mm_or_si128(hi, lo); + + __m128i t4 = _mm_min_epi16(maxq, t3); + __m128i mask = _mm_cmpgt_epi16(zero, input); + __m128i neg = _mm_subs_epi16(zero, t4); + result[j] = _mm_select_si128(mask, neg, t4); + } + *out_vp++ = _mm_pack_epi16(result[0], result[1]); + } + } + Index: llvm/examples/SIMD/InterQuant/interquant.vectorc.c diff -c /dev/null llvm/examples/SIMD/InterQuant/interquant.vectorc.c:1.1.2.1 *** /dev/null Sun Oct 23 17:50:18 2005 --- llvm/examples/SIMD/InterQuant/interquant.vectorc.c Sun Oct 23 17:49:40 2005 *************** *** 0 **** --- 1,44 ---- + #include "VectorC.h" + #include "Intrinsics.h" + + void interquant_vector(signed short* in, signed char* out, int qp ) { + int i, j; + + short part1, part2; + short t1, t2, t3, t4, t5; + unsigned short u1; + short msk; + + unsigned short qpd2 = vllvm_fixed_vimm_short((short) qp/2, 8); + short v = vllvm_fixed_vimm_short((short)((int)((32768+qp)/(2*qp))), 8); + + short zero = vllvm_fixed_vimm_short(0, 8); + short maxq = vllvm_fixed_vimm_short(127, 8); + + for (i = 0; i < 4; ++i) { + short in_vec = vllvm_load_short(in, 8, 2*i); + t1 = vllvm_subs_short( zero, in_vec); + u1 = (unsigned short) vllvm_max_short( in_vec, t1 ); + t2 = vllvm_subs_ushort( u1, qpd2 ); + t3 = t2*v >> 15; + t4 = vllvm_min_short(maxq,t3); + msk = zero > in_vec; + t5 = vllvm_subs_short( zero, t4 ); + part1 = vllvm_vselect_short(msk, t5, t4); + + in_vec = vllvm_load_short(in, 8, 2*i+1); + t1 = vllvm_subs_short( zero, in_vec); + u1 = (unsigned short) vllvm_max_short( in_vec, t1 ); + t2 = (short) vllvm_subs_ushort( u1, qpd2 ); + t3 = (t2*v) >> 15; + t4 = vllvm_min_short(maxq,t3); + msk = zero > in_vec; + t5 = vllvm_subs_short( zero, t4 ); + part2 = vllvm_vselect_short(msk, t5, t4); + + short out_vec = vllvm_fixed_vimm_short(0, 16); + out_vec = vllvm_fixed_combine_short(out_vec, 16, part1, 8, 0, 1); + out_vec = vllvm_fixed_combine_short(out_vec, 16, part2, 8, 8, 1); + vllvm_store_char(out_vec, out, i); + } + } Index: llvm/examples/SIMD/InterQuant/main.c diff -c /dev/null llvm/examples/SIMD/InterQuant/main.c:1.1.2.1 *** /dev/null Sun Oct 23 17:50:18 2005 --- llvm/examples/SIMD/InterQuant/main.c Sun Oct 23 17:49:40 2005 *************** *** 0 **** --- 1,112 ---- + #define N 1024 //2048*2 + #define MAX_QP 31 + + #include + #include + #include + #include + #include "../_malloc.h" + + void interquant_scalar(short*,signed char*,int); + void interquant_vector(short*,signed char*,int); + + short *in; + char *vector; + char *scalar; + + void init() { + int i; + + // Force 16-byte alignment + // + in = (short*) _malloc(N*sizeof(short)); + vector = (char*) _malloc(N*sizeof(short)); + scalar = (char*) _malloc(N*sizeof(short)); + + // Populate in with a range of values + // + for (i = 0; i < N; ++i) { + in[i] = -(N/2)+i; + } + + } + + void run(long *scalar_time, long *vector_time) { + long t0, t1, t2; + int i,j; + int qp = 10; + struct tms buf_s, buf_e; + + init(); + + times(&buf_s); + for (j = 0; j < 100000; ++j) + for (i = 0; i < N/64; ++i) + interquant_scalar(in+64*i, scalar+64*i, qp); + times(&buf_e); + + *scalar_time = buf_e.tms_utime - buf_s.tms_utime; + printf("scalar time=%d, ", *scalar_time); + + times(&buf_s); + for (j = 0; j < 100000; ++j) + for (i = 0; i < N/64; ++i) + interquant_vector(in+64*i, vector+64*i, qp); + times(&buf_e); + + *vector_time = buf_e.tms_utime - buf_s.tms_utime; + printf("vector time=%d, ", *vector_time); + + for (i = 0; i < N; i++) { + if (vector[i] != scalar[i]) { + printf("FAILED\n"); + exit(1); + } + } + + float speedup = ((float) *scalar_time) / *vector_time; + printf("speedup=%f\n", speedup); + + } + + int + main (void) { + unsigned i; + init(); + + long best_scalar = -1, best_vector = -1; + long scalar, vector; + for (i = 0; i < NRUNS; ++i) { + run (&scalar, &vector); + if (best_scalar < 0 || best_scalar > scalar) + best_scalar = scalar; + if (best_vector < 0 || best_vector > vector) + best_vector = vector; + } + + printf("best scalar=%d, ", best_scalar); + printf("best vector=%d, ", best_vector); + printf("speedup=%f\n", ((float) best_scalar)/best_vector); + printf ("PASSED\n"); + return 0; + } + + void interquant_scalar( signed short* in, signed char* out, int qp) { + int i; + int qpd2 = (32768+qp)/(2*qp); + + for (i = 0; i < 64; ++i) { + short input = in[i]; + short t1 = (input == -32768) ? 32767 : -input; + unsigned short u1 = (unsigned short) ((input > t1) ? input : t1); + short t2 = (short) (u1 - (qp/2)); + t2 = (t2 > 0) ? t2 : 0; + //int t3 = (t2 * ((32768+qp)/(2*qp))) / 32768; + int t3 = (t2 * qpd2) /32768; + t3 = (t3 > 32767) ? 32767 : t3; + t3 = (t3 < -32768) ? -32768 : t3; + short t4 = (t3 < 127) ? t3 : 127; + out[i] = (input < 0) ? -t4 : t4; + } + } + From bocchino at persephone.cs.uiuc.edu Sun Oct 23 17:50:20 2005 From: bocchino at persephone.cs.uiuc.edu (Robert L. Bocchino Jr.) Date: Sun, 23 Oct 2005 17:50:20 -0500 (CDT) Subject: [llvm-commits] [vector_llvm] CVS: llvm/examples/SIMD/RGB2YUV/Makefile main.c rgb2yuv.altivec.handwritten.c rgb2yuv.sse.handwritten.c rgb2yuv.vectorc.c Message-ID: <20051023225020.DC10217FABC2@persephone.cs.uiuc.edu> Changes in directory llvm/examples/SIMD/RGB2YUV: Makefile added (r1.1.2.1) main.c added (r1.1.2.1) rgb2yuv.altivec.handwritten.c added (r1.1.2.1) rgb2yuv.sse.handwritten.c added (r1.1.2.1) rgb2yuv.vectorc.c added (r1.1.2.1) --- Log message: Examples to illustrate Vector LLVM's SIMD support. --- Diffs of the changes: (+384 -0) Makefile | 4 main.c | 148 +++++++++++++++++++++++++++ rgb2yuv.altivec.handwritten.c | 1 rgb2yuv.sse.handwritten.c | 230 ++++++++++++++++++++++++++++++++++++++++++ rgb2yuv.vectorc.c | 1 5 files changed, 384 insertions Index: llvm/examples/SIMD/RGB2YUV/Makefile diff -c /dev/null llvm/examples/SIMD/RGB2YUV/Makefile:1.1.2.1 *** /dev/null Sun Oct 23 17:50:00 2005 --- llvm/examples/SIMD/RGB2YUV/Makefile Sun Oct 23 17:49:41 2005 *************** *** 0 **** --- 1,4 ---- + NAME= rgb2yuv + + include ../Makefile.common + Index: llvm/examples/SIMD/RGB2YUV/main.c diff -c /dev/null llvm/examples/SIMD/RGB2YUV/main.c:1.1.2.1 *** /dev/null Sun Oct 23 17:50:17 2005 --- llvm/examples/SIMD/RGB2YUV/main.c Sun Oct 23 17:49:41 2005 *************** *** 0 **** --- 1,148 ---- + #define N 4800 + + #include + #include + #include + #include + #include + #include "../_malloc.h" + + void rgb2yuv_scalar(unsigned char*, int, unsigned char*); + void rgb2yuv_vector(unsigned char*, int, unsigned char*); + + char *in; + char *out; + char *ref; + + void init() { + int i; + + // Force 16-byte alignment + // + in = (char*) _malloc(N*sizeof(char)); + out = (char*) _malloc(N*sizeof(char)); + ref = (char*) _malloc(N*sizeof(char)); + + // Populate in with a range of values + // + for (i = 0; i < N; ++i) { + in[i] = -(N/2)+i; + out[i] = 1; + ref[i] = 2; + } + + } + + void run(long *scalar_time, long *vector_time) { + long t0, t1, t2; + int i,j; + + struct tms buf_s, buf_e; + + times(&buf_s); + for (i = 0; i < 100000; ++i) + rgb2yuv_scalar(in, N, ref); + times(&buf_e); + *scalar_time = buf_e.tms_utime - buf_s.tms_utime; + printf("scalar time=%d, ", *scalar_time); + + times(&buf_s); + for (i = 0; i < 100000; ++i) + rgb2yuv_vector(in, N, out); + times(&buf_e); + *vector_time = buf_e.tms_utime - buf_s.tms_utime; + printf("vector time=%d, ", *vector_time); + + for (i = 0; i < N; i++) { + if (out[i] != ref[i]) { + printf("FAILED\n"); + exit(1); + } + } + + float speedup = ((float) *scalar_time) / *vector_time; + printf("speedup=%f\n", speedup); + + } + + int + main (void) { + unsigned i; + init(); + + long best_scalar = -1, best_vector = -1; + long scalar, vector; + for (i = 0; i < NRUNS; ++i) { + run (&scalar, &vector); + if (best_scalar < 0 || best_scalar > scalar) + best_scalar = scalar; + if (best_vector < 0 || best_vector > vector) + best_vector = vector; + } + + printf("best scalar=%d, ", best_scalar); + printf("best vector=%d, ", best_vector); + printf("speedup=%f\n", ((float) best_scalar)/best_vector); + printf ("PASSED\n"); + return 0; + } + + inline short saturate(int a) { + if (a > 32767) + return 32767; + if (a < -32768) + return -32768; + return a; + } + + inline short mradds(short a, short b, short c) { + int aint = a, bint = b, cint = c; + assert(((aint*bint)+(1<<14))>>15 == (((short)((aint*bint)>>14))+1)>>1); + return saturate(((aint*bint+(1 << 14)) >> 15) + cint); + } + + inline short adds(short a, short b) { + return saturate(a+b); + } + + inline unsigned char saturate_uchar(unsigned short a) { + if (a > 255) + return 255; + return a; + } + + void rgb2yuv_scalar(unsigned char *RGB_char_ptr, int RGB_size, + unsigned char *YCC_char_ptr) { + short red, green, blue; + short Y, Cb, Cr; + unsigned j, i; + + for (i = 0; i < RGB_size; i += 3*16) { + for (j = 0; j < 16; ++j) { + red = RGB_char_ptr[i+3*j]; + green = RGB_char_ptr[i+3*j+1]; + blue = RGB_char_ptr[i+3*j+2]; + + Y = mradds(red, 8432, 0); + Cb = mradds(red, -4818, 0); + Cr = mradds(red, 14345, 0); + + Y = mradds(green, 16425, Y); + Cb = mradds(green, -9527, Cb); + Cr = mradds(green, -12045, Cr); + + Y = mradds(blue, 3176, Y); + Cb = mradds(blue, 14345, Cb); + Cr = mradds(blue, -2300, Cr); + + Y = adds(Y, 16); + Cb = adds(Cb, 128); + Cr = adds(Cr, 128); + + YCC_char_ptr[i+j] = saturate_uchar(Y); + YCC_char_ptr[i+j+16] = saturate_uchar(Cb); + YCC_char_ptr[i+j+32] = saturate_uchar(Cr); + } + } + } + Index: llvm/examples/SIMD/RGB2YUV/rgb2yuv.altivec.handwritten.c diff -c /dev/null llvm/examples/SIMD/RGB2YUV/rgb2yuv.altivec.handwritten.c:1.1.2.1 *** /dev/null Sun Oct 23 17:50:18 2005 --- llvm/examples/SIMD/RGB2YUV/rgb2yuv.altivec.handwritten.c Sun Oct 23 17:49:41 2005 *************** *** 0 **** --- 1 ---- + void rgb2yuv_vector(unsigned char *RGB_char_ptr, int RGB_size, unsigned char *YCC_char_ptr) { vector unsigned char *RGB_ptr = (vector unsigned char*) RGB_char_ptr; vector unsigned char *YCC_ptr = (vector unsigned char*) YCC_char_ptr; vector signed short r0, r1, r2, g0, g1, g2, b0, b1, b2, c0, c16, c128; vector unsigned char z0, tc0, tc1, tc2, tc3; vector signed short tr0, tr1, tg0, tg1, tb0, tb1, mask; vector signed short t0, t1, t2, t3, t4, t5; int i, j; vector unsigned char vPerm1 = (vector unsigned char)( 0, 3, 6, 9, 12, 15, 18, 21, /* R0..R7 */ 1, 4, 7, 10, 13, 16, 19, 22 /* G0..G7 */); vector unsigned char vPerm2 = (vector unsigned char)( 2, 5, 8, 11, 14, 17, 20, 23, /* B0..B7 */ 0, 0, 0, 0, 0, 0, 0, 0 /* dont care */); vector unsigned char vPerm3 = (vector unsigned char)( 8, 11, 14, 17, 20, 23, 26, 29, /* R8..R15 */ 9 , 12, 15, 18, 21, 24, 27, 30 /* G8..G15 */); vector unsigned char vPerm4 = (vector unsigned char)(10, 13, 16, 19, 22, 25, 28, 31, /* B8..B15 */ 0, 0, 0, 0, 0, 0, 0, 0 /* dont care */); vector signed short vConst1 = (vector signed short)( 8432, 16425, 3176, -4818, -9527, 14345, 0, 0 ); vector signed short vConst2 = (vector signed short)( 14345, -12045, -2300, 16, 128, 0, 0, 0 ); r0 = vec_splat( vConst1, 0 ); /* 8432 */ g0 = vec_splat( vConst1, 1 ); /* 16425 */ b0 = vec_splat( vConst1, 2 ); /* 3176 */ r1 = vec_splat( vConst1, 3 ); /* -4818 */ g1 = vec_splat( vConst1, 4 ); /* -9527 */ b1 = vec_splat( vConst1, 5 ); /* 14345 */ r2 = vec_splat( vConst2, 0 ); /* 14345 */ g2 = vec_splat( vConst2, 1 ); /*-12045 */ b2 = vec_splat( vConst2, 2 ); /* -2300 */ c16 = vec_splat( vConst2, 3 ); /* 16 */ c128 = vec _splat( vConst2, 4 ); /* 128 */ c0 = (vector signed short) (0); /* 0 */ z0 = (vector unsigned char) (0); /* 0 */ mask = (vector signed short) (0x00FF); vector unsigned char Ys; vector unsigned char Cbs; vector unsigned char Crs; for ( i = 0; i < (RGB_size/sizeof(vector unsigned char)); i+=3 ) { tc0 = vec_perm( RGB_ptr[i], RGB_ptr[i+1], vPerm1 ); /* R0..R7 G0..G7 */ tc1 = vec_perm( RGB_ptr[i], RGB_ptr[i+1], vPerm2 ); /* B0..B7 */ tc2 = vec_perm( RGB_ptr[i+1], RGB_ptr[i+2], vPerm3 ); /* R8..R15 G8..G15 */ tc3 = vec_perm( RGB_ptr[i+1], RGB_ptr[i+2], vPerm4 ); /* B8..B15 */ tr0 = vec_and(vec_unpackh( (vector signed char) tc0 ), mask); /* tr0 = R0 .. R7 */ tg0 = vec_and(vec_unpackl( (vector signed char) tc0 ), mask); /* tg0 = G0 .. G7 */ tb0 = vec_and(vec_unpackh( (vector signed char) tc1 ), mask); /* tb0 = B0 .. B7 */ tr1 = vec_and(vec_unpackh( (vector signed char) tc2 ), mask); /* tr0 = R8 .. R15 */ tg1 = vec_and(vec_unpackl( (vector signed char) tc2 ), mask); /* tg0 = G8 .. G15 */ tb1 = vec_and(vec_unpackh( (vector signed char) tc3 ), mask); /* tb0 = B8 .. B15 */ t0 = vec_mradds( tr0, r0, c0 ); /* (R0 .. R7) * 8432 */ t1 = vec_mradds( tr0, r1, c0 ); /* (R0 .. R7) * -4818 */ t2 = vec_mradds( tr0, r2, c0 ); /* (R0 .. R7) * 14345 */ t0 = vec_mradds( tg0, g0, t0 ); /* += (G0 .. G7) * 16425 */ t1 = vec_mradds( tg0, g1, t1 ); /* += (G0 .. G7) * -9527 */ t2 = vec_mradds( tg0, g2, t2 ); /* += (G0 .. G7) * -12045 */ t0 = vec_mradds( tb0, b0, t0 ); /* += (B0 .. B7) * 3176 */ t1 = vec_mradds( tb0, b1, t1 ); /* += (B0 .. B7) * 14345 */ t2 = vec_mradds( tb0, b2, t2 ); /* += (B0 .. B7) * -2300 */ /* Convert the next three input vectors. */ t3 = vec_mradds( tr1, r0, c0 ); /* (R8 .. R15) * 8432 */ t4 = vec_mradds( tr1, r1, c0 ); /* (R8 .. R15) * -4818 */ t5 = vec_mradds( tr1, r2, c0 ); /* (R8 .. R15) * 14345 */ t3 = vec_mradds( tg1, g0, t3 ); /* += (G8 .. G15) * 16425 */ t4 = vec_mradds( tg1, g1, t4 ); /* += (G8 .. G15) * -9527 */ t5 = vec_mradds( tg1, g2, t5 ); /* += (G8 .. G15) * -12045 */ t3 = vec_mradds( tb1, b0, t3 ); /* += (B8 .. B15) * 3176 */ t4 = vec_mradds( tb1, b1, t4 ); /* += (B8 .. B15) * 14345 */ t5 = vec_mradds( tb1, b2, t5 ); /* += (B8 .. B15) * -2300 */ t0 = vec_adds( t0, c16 ); t3 = vec_adds( t3, c16 ); t1 = vec_adds( t1, c128 ); t4 = vec_adds( t4, c128 ); t2 = vec_adds( t2, c128 ); t5 = vec_adds( t5, c128 ); YCC_ptr[i] = vec_packsu( t0, t3 ); /* Y0 .. Y15 */ YCC_ptr[i+1] = vec_packsu( t1, t4 ); /* Cb0 .. Cb15 */ YCC_ptr[i+2] = vec_packsu( t2, t5 ); /* Cr0 .. Cr15 */ } } \ No newline at end of file Index: llvm/examples/SIMD/RGB2YUV/rgb2yuv.sse.handwritten.c diff -c /dev/null llvm/examples/SIMD/RGB2YUV/rgb2yuv.sse.handwritten.c:1.1.2.1 *** /dev/null Sun Oct 23 17:50:18 2005 --- llvm/examples/SIMD/RGB2YUV/rgb2yuv.sse.handwritten.c Sun Oct 23 17:49:41 2005 *************** *** 0 **** --- 1,230 ---- + #include + + #define VECTOR(x) *((__m128i*) &x) + #define CONSTANT(x) _mm_set_epi16(x,x,x,x,x,x,x,x) + + inline __m128i vec_mr(__m128i x, short y) { + __m128i const_1 = _mm_set_epi16(1,1,1,1,1,1,1,1); + __m128i y_vec = _mm_set_epi16(y, y, y, y,y, y, y, y); + __m128i tmp_hi = _mm_mulhi_epi16(x, y_vec); + __m128i tmp_lo = _mm_mullo_epi16(x, y_vec); + __m128i hi = _mm_slli_epi16(tmp_hi, 2); + __m128i lo = _mm_srli_epi16(tmp_lo, 14); + __m128i tmp_vec = _mm_or_si128(hi, lo); + tmp_vec = _mm_add_epi16(tmp_vec, const_1); + tmp_vec = _mm_srai_epi16(tmp_vec, 1); + return tmp_vec; + } + + inline __m128i vec_mradds(__m128i x, short y, __m128i z) { + return _mm_adds_epi16(vec_mr(x,y),z); + } + + #define MRADDS(x,y,z) _mm_adds_epi16(vec_mr(x,y),z) + + void print_quaternary(unsigned char ch) { + unsigned i; + for (i = 0; i < 4; ++i) + printf("%d ", (ch >> (2*i)) & 3); + printf("\n"); + } + + void print_vector_128(__m128i vec) { + __m128i tmp = vec; + unsigned char *p = (unsigned char*) &tmp; + unsigned i; + for (i = 0; i < 16; ++i) + printf("%02X ", p[i]); + printf("\n"); + } + + #define idx(idx0, idx1, idx2, idx3) \ + idx0 | (idx1 << 2) | (idx2 << 4) | (idx3 << 6) + + #define extract(source, idx0, idx1, idx2, idx3) \ + _mm_shuffle_epi32(source, idx0 | (idx1 << 2) | (idx2 << 4) | (idx3 << 6)) \ + + #define mask(source, idx0, idx1, idx2, idx3) \ + _mm_and_si128(source, _mm_set_epi32(idx3 * ~0U, idx2 * ~0U, idx1 * ~0U, idx0 * ~0U)) + + #define msk(idx0, idx1, idx2, idx3) \ + _mm_set_epi32(idx3 * ~0U, idx2 * ~0U, idx1 * ~0U, idx0 * ~0U) + + void rgb2yuv_vector(unsigned char *RGB_char_ptr, int RGB_size, + unsigned char *YCC_char_ptr) { + + __m128i* RGB_ptr = (__m128i*) RGB_char_ptr; + __m128i zero = _mm_set_epi8(0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0); + __m128i constant_16 = CONSTANT(16); + __m128i constant_128 = CONSTANT(128); + + unsigned j, i; + + __m128i in0123, in01, in0, in1, in23, in2, in3; + __m128i in4567, in45, in4, in5, in67, in6, in7; + __m128i in89AB, in89, in8, in9, inAB, inA, inB; + + __m128i red0, red1, red2, red_lo, red_hi; + __m128i green0, green1, green_lo, green_hi; + __m128i blue0, blue1, blue_lo, blue_hi; + + __m128i red_16_lo, red_16_hi; + __m128i green_16_lo, green_16_hi; + __m128i blue_16_lo, blue_16_hi; + + __m128i Y_lo, Y_hi; + __m128i Cb_lo, Cb_hi; + __m128i Cr_lo, Cr_hi; + + __m128i Ys_char, Cbs_char, Crs_char; + + for (i = 0; i < RGB_size; i += 3*16) { + in0123 = RGB_ptr[i/16]; + in01 = _mm_unpacklo_epi8(in0123, zero); + in0 = _mm_unpacklo_epi16(in01, zero); + in1 = _mm_unpackhi_epi16(in01, zero); + in23 = _mm_unpackhi_epi8(in0123, zero); + in2 = _mm_unpacklo_epi16(in23, zero); + in3 = _mm_unpackhi_epi16(in23, zero); + in4567 = RGB_ptr[i/16+1]; + in45 = _mm_unpacklo_epi8(in4567, zero); + in4 = _mm_unpacklo_epi16(in45, zero); + in5 = _mm_unpackhi_epi16(in45, zero); + in67 = _mm_unpackhi_epi8(in4567, zero); + in6 = _mm_unpacklo_epi16(in67, zero); + in7 = _mm_unpackhi_epi16(in67, zero); + in89AB = RGB_ptr[i/16+2]; + in89 = _mm_unpacklo_epi8(in89AB, zero); + in8 = _mm_unpacklo_epi16(in89, zero); + in9 = _mm_unpackhi_epi16(in89, zero); + inAB = _mm_unpackhi_epi8(in89AB, zero); + inA = _mm_unpacklo_epi16(inAB, zero); + inB = _mm_unpackhi_epi16(inAB, zero); + + red0 = _mm_and_si128(_mm_shuffle_epi32(in0, idx(0,3,0,0)), msk(1,1,0,0)); + red1 = _mm_and_si128(in1, msk(0,0,1,0)); + red2 = _mm_and_si128(_mm_shuffle_epi32(in2, idx(0,0,0,1)), msk(0,0,0,1)); + red_lo = _mm_or_si128(_mm_or_si128(red0, red1), red2); + + red0 = _mm_and_si128(_mm_shuffle_epi32(in3, idx(0,3,0,0)), msk(1,1,0,0)); + red1 = _mm_and_si128(in4, msk(0,0,1,0)); + red2 = _mm_and_si128(_mm_shuffle_epi32(in5, idx(0,0,0,1)), msk(0,0,0,1)); + red_hi = _mm_or_si128(_mm_or_si128(red0, red1), red2); + red_16_lo = _mm_packs_epi32(red_lo, red_hi); + + red0 = _mm_and_si128(_mm_shuffle_epi32(in6, idx(0,3,0,0)), msk(1,1,0,0)); + red1 = _mm_and_si128(in7, msk(0,0,1,0)); + red0 = _mm_or_si128(red0, red1); + red1 = _mm_and_si128(_mm_shuffle_epi32(in8, idx(0,0,0,1)), msk(0,0,0,1)); + red_lo = _mm_or_si128(red0, red1); + + red0 = _mm_and_si128(_mm_shuffle_epi32(in9, idx(0,3,0,0)), msk(1,1,0,0)); + red1 = _mm_and_si128(inA, msk(0,0,1,0)); + red0 = _mm_or_si128(red0, red1); + red1 = _mm_and_si128(_mm_shuffle_epi32(inB, idx(0,0,0,1)), msk(0,0,0,1)); + red_hi = _mm_or_si128(red0, red1); + red_16_hi = _mm_packs_epi32(red_lo, red_hi); + + green0 = mask(extract(in0, 1,0,0,0), 1, 0, 0, 0); + green1 = mask(extract(in1, 0, 0, 3, 0), 0, 1, 1, 0); + green0 = _mm_or_si128(green0, green1); + green1 = mask(extract(in2, 0, 0, 0, 2), 0, 0, 0, 1); + green_lo = _mm_or_si128(green0, green1); + + green0 = mask(extract(in3, 1,0,0,0), 1, 0, 0, 0); + green1 = mask(extract(in4, 0, 0, 3, 0), 0, 1, 1, 0); + green0 = _mm_or_si128(green0, green1); + green1 = mask(extract(in5, 0, 0, 0, 2), 0, 0, 0, 1); + green_hi = _mm_or_si128(green0, green1); + green_16_lo = _mm_packs_epi32(green_lo, green_hi); + + green0 = mask(extract(in6, 1,0,0,0), 1, 0, 0, 0); + green1 = mask(extract(in7, 0, 0, 3, 0), 0, 1, 1, 0); + green0 = _mm_or_si128(green0, green1); + green1 = mask(extract(in8, 0, 0, 0, 2), 0, 0, 0, 1); + green_lo = _mm_or_si128(green0, green1); + + green0 = mask(extract(in9, 1,0,0,0), 1, 0, 0, 0); + green1 = mask(extract(inA, 0, 0, 3, 0), 0, 1, 1, 0); + green0 = _mm_or_si128(green0, green1); + green1 = mask(extract(inB, 0, 0, 0, 2), 0, 0, 0, 1); + green_hi = _mm_or_si128(green0, green1); + green_16_hi = _mm_packs_epi32(green_lo, green_hi); + + blue0 = mask(extract(in0, 2,0,0,0), 1, 0, 0, 0); + blue1 = mask(extract(in1, 0, 1, 0, 0), 0, 1, 0, 0); + blue0 = _mm_or_si128(blue0, blue1); + blue1 = mask(extract(in2, 0, 0, 0, 3), 0, 0, 1, 1); + blue_lo = _mm_or_si128(blue0, blue1); + + blue0 = mask(extract(in3, 2,0,0,0), 1, 0, 0, 0); + blue1 = mask(extract(in4, 0, 1, 0, 0), 0, 1, 0, 0); + blue0 = _mm_or_si128(blue0, blue1); + blue1 = mask(extract(in5, 0, 0, 0, 3), 0, 0, 1, 1); + blue_hi = _mm_or_si128(blue0, blue1); + blue_16_lo = _mm_packs_epi32(blue_lo, blue_hi); + + blue0 = mask(extract(in6, 2,0,0,0), 1, 0, 0, 0); + blue1 = mask(extract(in7, 0, 1, 0, 0), 0, 1, 0, 0); + blue0 = _mm_or_si128(blue0, blue1); + blue1 = mask(extract(in8, 0, 0, 0, 3), 0, 0, 1, 1); + blue_lo = _mm_or_si128(blue0, blue1); + + blue0 = mask(extract(in9, 2,0,0,0), 1, 0, 0, 0); + blue1 = mask(extract(inA, 0, 1, 0, 0), 0, 1, 0, 0); + blue0 = _mm_or_si128(blue0, blue1); + blue1 = mask(extract(inB, 0, 0, 0, 3), 0, 0, 1, 1); + blue_hi = _mm_or_si128(blue0, blue1); + blue_16_hi = _mm_packs_epi32(blue_lo, blue_hi); + + Y_lo = vec_mr(red_16_lo, 8432); + Y_hi = vec_mr(red_16_hi, 8432); + + Cb_lo = vec_mr(red_16_lo, -4818); + Cb_hi = vec_mr(red_16_hi, -4818); + + Cr_lo = vec_mr(red_16_lo, 14345); + Cr_hi = vec_mr(red_16_hi, 14345); + + Y_lo = vec_mradds(green_16_lo, 16425, Y_lo); + Y_hi = vec_mradds(green_16_hi, 16425, Y_hi); + + Cb_lo = vec_mradds(green_16_lo, -9527, Cb_lo); + Cb_hi = vec_mradds(green_16_hi, -9527, Cb_hi); + + Cr_lo = vec_mradds(green_16_lo, -12045, Cr_lo); + Cr_hi = vec_mradds(green_16_hi, -12045, Cr_hi); + + Y_lo = vec_mradds(blue_16_lo, 3176, Y_lo); + Y_hi = vec_mradds(blue_16_hi, 3176, Y_hi); + + Cb_lo = vec_mradds(blue_16_lo, 14345, Cb_lo); + Cb_hi = vec_mradds(blue_16_hi, 14345, Cb_hi); + + Cr_lo = vec_mradds(blue_16_lo, -2300, Cr_lo); + Cr_hi = vec_mradds(blue_16_hi, -2300, Cr_hi); + + Y_lo = _mm_adds_epi16(Y_lo, constant_16); + Y_hi = _mm_adds_epi16(Y_hi, constant_16); + + Cb_lo = _mm_adds_epi16(Cb_lo, constant_128); + Cb_hi = _mm_adds_epi16(Cb_hi, constant_128); + + Cr_lo = _mm_adds_epi16(Cr_lo, constant_128); + Cr_hi = _mm_adds_epi16(Cr_hi, constant_128); + + Ys_char = _mm_packus_epi16(Y_lo, Y_hi); + Cbs_char = _mm_packus_epi16(Cb_lo, Cb_hi); + Crs_char = _mm_packus_epi16(Cr_lo, Cr_hi); + + for (j = 0; j < 16; ++j) { + YCC_char_ptr[i+3*j] = ((unsigned char*) &Ys_char)[j]; + YCC_char_ptr[i+1+3*j] = ((unsigned char*) &Cbs_char)[j]; + YCC_char_ptr[i+2+3*j] = ((unsigned char*) &Crs_char)[j]; + } + } + + malloc(0); + + } Index: llvm/examples/SIMD/RGB2YUV/rgb2yuv.vectorc.c diff -c /dev/null llvm/examples/SIMD/RGB2YUV/rgb2yuv.vectorc.c:1.1.2.1 *** /dev/null Sun Oct 23 17:50:18 2005 --- llvm/examples/SIMD/RGB2YUV/rgb2yuv.vectorc.c Sun Oct 23 17:49:41 2005 *************** *** 0 **** --- 1 ---- + #include "VectorC.h" #include "Intrinsics.h" // Selects whether to use vllvm_mradds with third argument c0 // (constant 0), or vllvm_mr instead. Using c0 may be slightly faster // on AltiVec. Not using c0 saves an "adds x, 0" op and may be // slightly faster on architectures (e.g., SSE2) that don't support // mradds as a single op. Smarter code generation can make USE_C0 0 // just as fast on AltiVec as USE_C0 1. // #define USE_C0 1 // Note that both vllvm_mr and vllvm_mradds are defined in // "Intrinsics.h" and expand to patterns of more primitive Vector LLVM // instructions // void rgb2yuv_vector(unsigned char *RGB_ptr, int RGB_size, unsigned char *YCC_ptr) { signed short r0, r1, r2, g0, g1, g2, b0, b1, b2, c16, c128; unsigned char z0, tc0, tc1, tc2, tc3; signed short tr0, tr1, tg0, tg1, tb0, tb1; signed short t0, t1, t2, t3, t4, t5; int i; unsigned char vPerm1 = vllvm_constant_unsigned_char( 0, 3, 6, 9, 12, 15, 18, 21, 1, 4, 7, 10, 13, 16, 19, 22); unsigned char vPerm2 = vllvm_constant_unsigned_char( 2, 5, 8, 11, 14, 17, 20, 23, 0, 0, 0, 0, 0, 0, 0, 0); unsigned char vPerm3 = vllvm_constant_unsigned_char( 8, 11, 14, 17, 20, 23, 26, 29, 9, 12, 15, 18, 21, 24, 27, 30); unsigned char vPerm4 = vllvm_constant_unsigned_char(10, 13, 16, 19, 22, 25, 28, 31, 0, 0, 0, 0, 0, 0, 0, 0); r0 = vllvm_fixed_vimm_short(8432, 8); g0 = vllvm_fixed_vimm_short(16425, 8); b0 = vllvm_fixed_vimm_short(3176, 8); r1 = vllvm_fixed_vimm_short(-4818, 8); g1 = vllvm_fixed_vimm_short(-9527, 8); b1 = vllvm_fixed_vimm_short(14345, 8); r2 = vllvm_fixed_vimm_short(14345, 8); g2 = vllvm_fixed_vimm_short(-12045, 8); b2 = vllvm_fixed_vimm_short(-2300, 8); c16 = vllvm_fixed_vimm_short(16, 8); c128 = vllvm_fixed_vimm_short(128, 8); #if USE_C0 signed short c0 = vllvm_fixed_vimm_short(0, 8); #endif for ( i = 0; i < (RGB_size/16); i+=3 ) { unsigned char v0 = v llvm_load_unsigned_char(RGB_ptr, 16, i); unsigned char v1 = vllvm_load_unsigned_char(RGB_ptr, 16, i+1); unsigned char v2 = vllvm_load_unsigned_char(RGB_ptr, 16, i+2); char tmp = vllvm_fixed_vimm_char(0, 32); tmp = vllvm_fixed_combine_unsigned_char(tmp, 32, v0, 16, 0, 1); tmp = vllvm_fixed_combine_unsigned_char(tmp, 32, v1, 16, 16, 1); tc0 = vllvm_fixed_permute_unsigned_char(tmp, 32, vPerm1, 16); char tmp1 = vllvm_fixed_vimm_char(0, 32); tmp1 = vllvm_fixed_combine_unsigned_char(tmp1, 32, v0, 16, 0, 1); tmp1 = vllvm_fixed_combine_unsigned_char(tmp1, 32, v1, 16, 16, 1); tc1 = vllvm_fixed_permute_unsigned_char(tmp1, 32, vPerm2, 16); char tmp2 = vllvm_fixed_vimm_char(0, 32); tmp2 = vllvm_fixed_combine_unsigned_char(tmp2, 32, v1, 16, 0, 1); tmp2 = vllvm_fixed_combine_unsigned_char(tmp2, 32, v2, 16, 16, 1); tc2 = vllvm_fixed_permute_unsigned_char(tmp2, 32, vPerm3, 16); char tmp3 = vllvm_fixed_vimm_char(0, 32); tmp3 = vllvm_fixed_combine_unsigned_char(tmp3, 32, v1, 16, 0, 1); tmp3 = vllvm_fixed_combine_unsigned_char(tmp3, 32, v2, 16, 16, 1); tc3 = vllvm_fixed_permute_unsigned_char(tmp3, 32, vPerm4, 16); tr0 = _extract_unsigned_char(tc0, 0, 1, 8); tg0 = _extract_unsigned_char(tc0, 8, 1, 8); tb0 = _extract_unsigned_char(tc1, 0, 1, 8); tr1 = _extract_unsigned_char(tc2, 0, 1, 8); tg1 = _extract_unsigned_char(tc2, 8, 1, 8); tb1 = _extract_unsigned_char(tc3, 0, 1, 8); #if USE_C0 t0 = vllvm_mradds_short( tr0, r0, c0 ); t1 = vllvm_mradds_short( tr0, r1, c0 ); t2 = vllvm_mradds_short( tr0, r2, c0 ); #else t0 = vllvm_mr_short( tr0, r0 ); t1 = vllvm_mr_short( tr0, r1 ); t2 = vllvm_mr_short( tr0, r2 ); #endif t0 = vllvm_mradds_short( tg0, g0, t0 ); t1 = vllvm_mradds_short( tg0, g1, t1 ); t2 = vllvm_mradds_short( tg0, g2, t2 ); t0 = vllvm_mradds_short( tb0, b0, t0 ); t1 = vllvm_mradds_short( tb0, b1, t1 ); t2 = vllv m_mradds_short( tb0, b2, t2 ); #if USE_C0 t3 = vllvm_mradds_short( tr1, r0, c0 ); t4 = vllvm_mradds_short( tr1, r1, c0 ); t5 = vllvm_mradds_short( tr1, r2, c0 ); #else t3 = vllvm_mr_short( tr1, r0 ); t4 = vllvm_mr_short( tr1, r1 ); t5 = vllvm_mr_short( tr1, r2 ); #endif t3 = vllvm_mradds_short( tg1, g0, t3 ); t4 = vllvm_mradds_short( tg1, g1, t4 ); t5 = vllvm_mradds_short( tg1, g2, t5 ); t3 = vllvm_mradds_short( tb1, b0, t3 ); t4 = vllvm_mradds_short( tb1, b1, t4 ); t5 = vllvm_mradds_short( tb1, b2, t5 ); t0 = vllvm_adds_short( t0, c16 ); t3 = vllvm_adds_short( t3, c16 ); t1 = vllvm_adds_short( t1, c128 ); t4 = vllvm_adds_short( t4, c128 ); t2 = vllvm_adds_short( t2, c128 ); t5 = vllvm_adds_short( t5, c128 ); short out0 = vllvm_fixed_vimm_short(0, 16); short out1 = vllvm_fixed_combine_short(out0, 16, t0, 8, 0, 1); short out2 = vllvm_fixed_combine_short(out1, 16, t3, 8, 8, 1); unsigne d char out3 = vllvm_saturate_short_uchar(out2); vllvm_store_unsigned_char(out3, YCC_ptr, i); out1 = vllvm_fixed_combine_short(out0, 16, t1, 8, 0, 1); out2 = vllvm_fixed_combine_short(out1, 16, t4, 8, 8, 1); out3 = vllvm_saturate_short_uchar(out2); vllvm_store_unsigned_char(out3, YCC_ptr, i+1); out1 = vllvm_fixed_combine_short(out0, 16, t2, 8, 0, 1); out2 = vllvm_fixed_combine_short(out1, 16, t5, 8, 8, 1); out3 = vllvm_saturate_short_uchar(out2); vllvm_store_unsigned_char(out3, YCC_ptr, i+2); } } \ No newline at end of file From bocchino at persephone.cs.uiuc.edu Sun Oct 23 17:50:20 2005 From: bocchino at persephone.cs.uiuc.edu (Robert L. Bocchino Jr.) Date: Sun, 23 Oct 2005 17:50:20 -0500 (CDT) Subject: [llvm-commits] [vector_llvm] CVS: llvm/examples/SIMD/DCT/Makefile dct.altivec.handwritten.c dct.sse.handwritten.c dct.vectorc.c main.c Message-ID: <20051023225020.D6C0717FABC1@persephone.cs.uiuc.edu> Changes in directory llvm/examples/SIMD/DCT: Makefile added (r1.1.2.1) dct.altivec.handwritten.c added (r1.1.2.1) dct.sse.handwritten.c added (r1.1.2.1) dct.vectorc.c added (r1.1.2.1) main.c added (r1.1.2.1) --- Log message: Examples to illustrate Vector LLVM's SIMD support. --- Diffs of the changes: (+646 -0) Makefile | 4 dct.altivec.handwritten.c | 198 ++++++++++++++++++++++++++++++++++++++++++++++ dct.sse.handwritten.c | 129 +++++++++++++++++++++++++++++ dct.vectorc.c | 140 ++++++++++++++++++++++++++++++++ main.c | 175 ++++++++++++++++++++++++++++++++++++++++ 5 files changed, 646 insertions Index: llvm/examples/SIMD/DCT/Makefile diff -c /dev/null llvm/examples/SIMD/DCT/Makefile:1.1.2.1 *** /dev/null Sun Oct 23 17:49:50 2005 --- llvm/examples/SIMD/DCT/Makefile Sun Oct 23 17:49:39 2005 *************** *** 0 **** --- 1,4 ---- + NAME= dct + + include ../Makefile.common + Index: llvm/examples/SIMD/DCT/dct.altivec.handwritten.c diff -c /dev/null llvm/examples/SIMD/DCT/dct.altivec.handwritten.c:1.1.2.1 *** /dev/null Sun Oct 23 17:50:17 2005 --- llvm/examples/SIMD/DCT/dct.altivec.handwritten.c Sun Oct 23 17:49:39 2005 *************** *** 0 **** --- 1,198 ---- + static inline void Matrix_Transpose ( vector signed short *input, vector signed short *output) + { + vector signed short a0, a1, a2, a3, a4, a5, a6, a7; + vector signed short b0, b1, b2, b3, b4, b5, b6, b7; + + b0 = vec_mergeh( input[0], input[4] ); /* [ 00 40 01 41 02 42 03 43 ]*/ + b1 = vec_mergel( input[0], input[4] ); /* [ 04 44 05 45 06 46 07 47 ]*/ + b2 = vec_mergeh( input[1], input[5] ); /* [ 10 50 11 51 12 52 13 53 ]*/ + b3 = vec_mergel( input[1], input[5] ); /* [ 14 54 15 55 16 56 17 57 ]*/ + b4 = vec_mergeh( input[2], input[6] ); /* [ 20 60 21 61 22 62 23 63 ]*/ + b5 = vec_mergel( input[2], input[6] ); /* [ 24 64 25 65 26 66 27 67 ]*/ + b6 = vec_mergeh( input[3], input[7] ); /* [ 30 70 31 71 32 72 33 73 ]*/ + b7 = vec_mergel( input[3], input[7] ); /* [ 34 74 35 75 36 76 37 77 ]*/ + + a0 = vec_mergeh( b0, b4 ); /* [ 00 20 40 60 01 21 41 61 ]*/ + a1 = vec_mergel( b0, b4 ); /* [ 02 22 42 62 03 23 43 63 ]*/ + a2 = vec_mergeh( b1, b5 ); /* [ 04 24 44 64 05 25 45 65 ]*/ + a3 = vec_mergel( b1, b5 ); /* [ 06 26 46 66 07 27 47 67 ]*/ + a4 = vec_mergeh( b2, b6 ); /* [ 10 30 50 70 11 31 51 71 ]*/ + a5 = vec_mergel( b2, b6 ); /* [ 12 32 52 72 13 33 53 73 ]*/ + a6 = vec_mergeh( b3, b7 ); /* [ 14 34 54 74 15 35 55 75 ]*/ + a7 = vec_mergel( b3, b7 ); /* [ 16 36 56 76 17 37 57 77 ]*/ + + output[0] = vec_mergeh( a0, a4 ); /* [ 00 10 20 30 40 50 60 70 ]*/ + output[1] = vec_mergel( a0, a4 ); /* [ 01 11 21 31 41 51 61 71 ]*/ + output[2] = vec_mergeh( a1, a5 ); /* [ 02 12 22 32 42 52 62 72 ]*/ + output[3] = vec_mergel( a1, a5 ); /* [ 03 13 23 33 43 53 63 73 ]*/ + output[4] = vec_mergeh( a2, a6 ); /* [ 04 14 24 34 44 54 64 74 ]*/ + output[5] = vec_mergel( a2, a6 ); /* [ 05 15 25 35 45 55 65 75 ]*/ + output[6] = vec_mergeh( a3, a7 ); /* [ 06 16 26 36 46 56 66 76 ]*/ + output[7] = vec_mergel( a3, a7 ); /* [ 07 17 27 37 47 57 67 77 ]*/ + + } + + /*************************************************************** + * + * Copyright: (c) Copyright Motorola Inc. 1998 + * + * Date: April 15, 1998 + * + * Macro: DCT_Transform + * + * Description: Discrete Cosign Transform implemented by the + * Scaled Chen (II) Algorithm developed by Haifa + * Research Lab. The major differnce between this + * algorithm and the Scaled Chen (I) is that + * certain multiply-subtracts are replaced by + * multiply adds. A full description of the + * Scaled Chen (I) algorithm can be found in: + * W.C.Chen, C.H.Smith and S.C.Fralick, "A Fast + * Computational Algorithm for the Discrete Cosine + * Transform", IEEE Transactions on Cummnuications, + * Vol. COM-25, No. 9, pp 1004-1009, Sept. 1997. + * + * Inputs: vx : array of vector short + * t1-t10 : temporary vector variables set up by caller + * c4 : cos(4*pi/16) + * mc4 : -c4 + * a0 : c6/c2 + * a1 : c7/c1 + * a2 : c5/c3 + * ma2 : -a2 + * zero : an array of zero elements + * + * Outputs: vy : array of vector short + * + **************************************************************/ + + #define DCT_Transform(vx,vy) \ + \ + /* 1st stage. */ \ + t8 = vec_adds( vx[0], vx[7] ); /* t0 + t7 */ \ + t9 = vec_subs( vx[0], vx[7] ); /* t0 - t7 */ \ + t0 = vec_adds( vx[1], vx[6] ); /* t1 + t6 */ \ + t7 = vec_subs( vx[1], vx[6] ); /* t1 - t6 */ \ + t1 = vec_adds( vx[2], vx[5] ); /* t2 + t6 */ \ + t6 = vec_subs( vx[2], vx[5] ); /* t2 - t6 */ \ + t2 = vec_adds( vx[3], vx[4] ); /* t3 + t4 */ \ + t5 = vec_subs( vx[3], vx[4] ); /* t3 - t4 */ \ + \ + /* 2nd stage. */ \ + t3 = vec_adds( t8, t2 ); /* (t0+t7) + (t3+t4) */ \ + t4 = vec_subs( t8, t2 ); /* (t0+t7) - (t3+t4) */ \ + t2 = vec_adds( t0, t1 ); /* (t1+t6) + (t2+t5) */ \ + t8 = vec_subs( t0, t1 ); /* (t1+t6) - (t2+t5) */ \ + \ + t1 = vec_adds( t7, t6 ); /* (t1-t6) + (t2-t5) */ \ + t0 = vec_subs( t7, t6 ); /* (t1-t6) - (t2-t5) */ \ + \ + /* 3rd stage */ \ + vy[0] = vec_adds( t3, t2 ); /* y0 = t3 + t2 */ \ + vy[4] = vec_subs( t3, t2 ); /* y4 = t3 + t2 */ \ + vy[2] = vec_mradds( t8, a0, t4 ); /* y2 = t8 * (a0) + t4 */ \ + t10 = vec_mradds( t4, a0, zero ); \ + vy[6] = vec_subs( t10, t8 ); /* y6 = t4 * (a0) - t8 */ \ + \ + t6 = vec_mradds( t0, c4, t5 ); /* t6 = t0 * (c4) + t5 */ \ + t7 = vec_mradds( t0, mc4, t5 ); /* t7 = t0 * (-c4) + t5 */ \ + t2 = vec_mradds( t1, mc4, t9 ); /* t2 = t1 * (-c4) + t9 */ \ + t3 = vec_mradds( t1, c4, t9 ); /* t3 = t1 * (c4) + t9 */ \ + \ + /* 4th stage. */ \ + vy[1] = vec_mradds( t6, a1, t3 ); /* y1 = t6 * (a1) + t3 */ \ + t9 = vec_mradds( t3, a1, zero ); \ + vy[7] = vec_subs( t9, t6 ) ; /* y7 = t3 * (a1) - t6 */ \ + vy[5] = vec_mradds( t2, a2, t7 ); /* y5 = t2 + (a2) + t7 */ \ + vy[3] = vec_mradds( t7, ma2, t2 ); /* y3 = t7 * (-a2) + t2 */ + + /* Post-scaling matrix -- scaled by 1 */ + vector signed short PostScale[8] = { + (vector signed short)( 4095, 5681, 5351, 4816, 4095, 4816, 5351, 5681 ), + (vector signed short)( 5681, 7880, 7422, 6680, 5681, 6680, 7422, 7880 ), + (vector signed short)( 5351, 7422, 6992, 6292, 5351, 6292, 6992, 7422 ), + (vector signed short)( 4816, 6680, 6292, 5663, 4816, 5663, 6292, 6680 ), + (vector signed short)( 4095, 5681, 5351, 4816, 4095, 4816, 5351, 5681 ), + (vector signed short)( 4816, 6680, 6292, 5663, 4816, 5663, 6292, 6680 ), + (vector signed short)( 5351, 7422, 6992, 6292, 5351, 6292, 6992, 7422 ), + (vector signed short)( 5681, 7880, 7422, 6680, 5681, 6680, 7422, 7880 ) + }; + + /*************************************************************** + * + * Copyright: (c) Copyright Motorola Inc. 1998 + * + * Date: April 17, 1998 + * + * Function: DCT + * + * Description: Scaled Chen (II) algorithm for DCT + * Arithmetic is 16-bit fixed point. + * + * Inputs: input - Pointer to input data (short), which + * must be between -255 to +255. + * It is assumed that the allocated array + * has been 128-bit aligned and contains + * 8x8 short elements. + * + * Outputs: output - Pointer to output area for the transfored + * data. The output values are between -2040 + * and 2040. It is assumed that a 128-bit + * aligned 8x8 array of short has been + * pre-allocated. + * + * Return: None + * + ***************************************************************/ + + void dct_vector(short *input, short *output) { + + vector signed short t0, t1, t2, t3, t4, t5, t6, t7, t8, t9, t10; + vector signed short a0, a1, a2, ma2, c4, mc4, zero; + vector signed short vx[8], vy[8]; + vector signed short *vec_ptr; /* used for conversion between + arrays of short and vector + signed short array. */ + + /* load the multiplication constants */ + c4 = (vector signed short)(23170); /* c4 = cos(4*pi/16) */ + a0 = (vector signed short)(13573); /* a0 = c6/c2 */ + a1 = (vector signed short)(6518); /* a1 = c7/c1 */ + a2 = (vector signed short)(21895); /* a2 = c5/c3 */ + mc4 = (vector signed short)(-23170); /* -c4 */ + ma2 = (vector signed short)(-21895); /* -a2 */ + zero = (vector signed short)(0); /* 0 */ + + /* copy the rows of input data */ + vec_ptr = ( vector signed short * ) input; + vx[0] = vec_ptr[0]; + vx[1] = vec_ptr[1]; + vx[2] = vec_ptr[2]; + vx[3] = vec_ptr[3]; + vx[4] = vec_ptr[4]; + vx[5] = vec_ptr[5]; + vx[6] = vec_ptr[6]; + vx[7] = vec_ptr[7]; + + /* Perform DCT first on the 8 columns */ + DCT_Transform( vx, vy ); + + /* Transpose matrix to work on rows */ + Matrix_Transpose( vy, vx ); + + /* Perform DCT first on the 8 rows */ + DCT_Transform( vx, vy ); + + /* Post-scale and store result. */ + vec_ptr = (vector signed short *) output; + + vec_ptr[0] = vec_mradds( PostScale[0], vy[0], zero ); + vec_ptr[1] = vec_mradds( PostScale[1], vy[1], zero ); + vec_ptr[2] = vec_mradds( PostScale[2], vy[2], zero ); + vec_ptr[3] = vec_mradds( PostScale[3], vy[3], zero ); + vec_ptr[4] = vec_mradds( PostScale[4], vy[4], zero ); + vec_ptr[5] = vec_mradds( PostScale[5], vy[5], zero ); + vec_ptr[6] = vec_mradds( PostScale[6], vy[6], zero ); + vec_ptr[7] = vec_mradds( PostScale[7], vy[7], zero ); + + } Index: llvm/examples/SIMD/DCT/dct.sse.handwritten.c diff -c /dev/null llvm/examples/SIMD/DCT/dct.sse.handwritten.c:1.1.2.1 *** /dev/null Sun Oct 23 17:50:18 2005 --- llvm/examples/SIMD/DCT/dct.sse.handwritten.c Sun Oct 23 17:49:39 2005 *************** *** 0 **** --- 1,129 ---- + #include "Scalar.h" + #include "SSE.h" + + extern short *PostScalePtr; + + static inline void Matrix_Transpose ( short *input_scalar, short *output_scalar) + { + __m128i *input = (__m128i*) input_scalar; + __m128i *output = (__m128i*) output_scalar; + + __m128i a0, a1, a2, a3, a4, a5, a6, a7; + __m128i b0, b1, b2, b3, b4, b5, b6, b7; + + b0 = _mm_unpacklo_epi16( input[0], input[4] ); /* [ 00 40 01 41 02 42 03 43 ]*/ + b1 = _mm_unpackhi_epi16( input[0], input[4] ); /* [ 04 44 05 45 06 46 07 47 ]*/ + b2 = _mm_unpacklo_epi16( input[1], input[5] ); /* [ 10 50 11 51 12 52 13 53 ]*/ + b3 = _mm_unpackhi_epi16( input[1], input[5] ); /* [ 14 54 15 55 16 56 17 57 ]*/ + b4 = _mm_unpacklo_epi16( input[2], input[6] ); /* [ 20 60 21 61 22 62 23 63 ]*/ + b5 = _mm_unpackhi_epi16( input[2], input[6] ); /* [ 24 64 25 65 26 66 27 67 ]*/ + b6 = _mm_unpacklo_epi16( input[3], input[7] ); /* [ 30 70 31 71 32 72 33 73 ]*/ + b7 = _mm_unpackhi_epi16( input[3], input[7] ); /* [ 34 74 35 75 36 76 37 77 ]*/ + + a0 = _mm_unpacklo_epi16( b0, b4 ); /* [ 00 20 40 60 01 21 41 61 ]*/ + a1 = _mm_unpackhi_epi16( b0, b4 ); /* [ 02 22 42 62 03 23 43 63 ]*/ + a2 = _mm_unpacklo_epi16( b1, b5 ); /* [ 04 24 44 64 05 25 45 65 ]*/ + a3 = _mm_unpackhi_epi16( b1, b5 ); /* [ 06 26 46 66 07 27 47 67 ]*/ + a4 = _mm_unpacklo_epi16( b2, b6 ); /* [ 10 30 50 70 11 31 51 71 ]*/ + a5 = _mm_unpackhi_epi16( b2, b6 ); /* [ 12 32 52 72 13 33 53 73 ]*/ + a6 = _mm_unpacklo_epi16( b3, b7 ); /* [ 14 34 54 74 15 35 55 75 ]*/ + a7 = _mm_unpackhi_epi16( b3, b7 ); /* [ 16 36 56 76 17 37 57 77 ]*/ + + output[0] = _mm_unpacklo_epi16( a0, a4 ); /* [ 00 10 20 30 40 50 60 70 ]*/ + output[1] = _mm_unpackhi_epi16( a0, a4 ); /* [ 01 11 21 31 41 51 61 71 ]*/ + output[2] = _mm_unpacklo_epi16( a1, a5 ); /* [ 02 12 22 32 42 52 62 72 ]*/ + output[3] = _mm_unpackhi_epi16( a1, a5 ); /* [ 03 13 23 33 43 53 63 73 ]*/ + output[4] = _mm_unpacklo_epi16( a2, a6 ); /* [ 04 14 24 34 44 54 64 74 ]*/ + output[5] = _mm_unpackhi_epi16( a2, a6 ); /* [ 05 15 25 35 45 55 65 75 ]*/ + output[6] = _mm_unpacklo_epi16( a3, a7 ); /* [ 06 16 26 36 46 56 66 76 ]*/ + output[7] = _mm_unpackhi_epi16( a3, a7 ); /* [ 07 17 27 37 47 57 67 77 ]*/ + + } + + static inline void DCT_Transform ( short *x, short *y) { + __m128i *vx = (__m128i*) x; + __m128i *vy = (__m128i*) y; + + __m128i t0, t1, t2, t3, t4, t5, t6, t7, t8, t9, t10; + + __m128i c13573 = _mm_splat_epi16(13573); + __m128i c21895 = _mm_splat_epi16(21895); + __m128i cNeg21895 = _mm_splat_epi16(-21895); + __m128i c23170 = _mm_splat_epi16(23170); + __m128i cNeg23170 = _mm_splat_epi16(-23170); + __m128i c6518 = _mm_splat_epi16(6518); + + t8 = _mm_adds_epi16(vx[0], vx[7]); + t9 = _mm_subs_epi16(vx[0], vx[7]); + t0 = _mm_adds_epi16(vx[1], vx[6]); + t7 = _mm_subs_epi16(vx[1], vx[6]); + t1 = _mm_adds_epi16(vx[2], vx[5]); + t6 = _mm_subs_epi16(vx[2], vx[5]); + t2 = _mm_adds_epi16(vx[3], vx[4]); + t5 = _mm_subs_epi16(vx[3], vx[4]); + + t3 = _mm_adds_epi16(t8, t2); + t4 = _mm_subs_epi16(t8, t2); + t2 = _mm_adds_epi16(t0, t1); + t8 = _mm_subs_epi16(t0, t1); + + t1 = _mm_adds_epi16(t7, t6); + t0 = _mm_subs_epi16(t7, t6); + + vy[0] = _mm_adds_epi16(t3, t2); + vy[4] = _mm_subs_epi16(t3, t2); + + vy[2] = _mm_mradds_epi16(t8, c13573, t4); + t10 = _mm_mr_epi16(t4, c13573); + + vy[6] = _mm_subs_epi16(t10, t8); + + t6 = _mm_mradds_epi16(t0, c23170, t5); + t7 = _mm_mradds_epi16(t0, cNeg23170, t5); + t2 = _mm_mradds_epi16(t1, cNeg23170, t9); + t3 = _mm_mradds_epi16(t1, c23170, t9); + + vy[1] = _mm_mradds_epi16(t6, c6518, t3); + t9 = _mm_mr_epi16(t3, c6518); + + vy[7] = _mm_subs_epi16(t9, t6); + vy[5] = _mm_mradds_epi16(t2, c21895, t7); + vy[3] = _mm_mradds_epi16(t7, cNeg21895, t2); + + } + + #define STORE(i) \ + outputv[i] = _mm_mradds_epi16(PostScalev[i], yv[i], _mm_splat_epi16(0)); + + void dct_vector(short *input, short *output, short *x, short *y) { + + __m128i *xv = (__m128i*) x; + __m128i *yv = (__m128i*) y; + __m128i *inputv = (__m128i*) input; + __m128i *outputv = (__m128i*) output; + __m128i *PostScalev = (__m128i*) PostScalePtr; + + xv[0] = inputv[0]; + xv[1] = inputv[1]; + xv[2] = inputv[2]; + xv[3] = inputv[3]; + xv[4] = inputv[4]; + xv[5] = inputv[5]; + xv[6] = inputv[6]; + xv[7] = inputv[7]; + + DCT_Transform( x, y ); + Matrix_Transpose( y, x ); + DCT_Transform( x, y ); + + STORE(0); + STORE(1); + STORE(2); + STORE(3); + STORE(4); + STORE(5); + STORE(6); + STORE(7); + + } + Index: llvm/examples/SIMD/DCT/dct.vectorc.c diff -c /dev/null llvm/examples/SIMD/DCT/dct.vectorc.c:1.1.2.1 *** /dev/null Sun Oct 23 17:50:18 2005 --- llvm/examples/SIMD/DCT/dct.vectorc.c Sun Oct 23 17:49:39 2005 *************** *** 0 **** --- 1,140 ---- + #include "Scalar.h" + #include "VectorC.h" + #include "Intrinsics.h" + + // See the rgb2yuv benchmark for a description of USE_C0. For some + // reason, USE_C0 1 seems to be slightly *faster* on SSE! I'm + // investigating why this is. + // + #define USE_C0 1 + + short vllvm_adds_short(short,short); + + #define MERGE(out01, out0, out1, in0, in1) \ + short out01 = vllvm_fixed_vimm_short(0, 16); \ + out01 = _fixed_combine_short(out01, 16, in0, 8, 0, 1); \ + out01 = _fixed_combine_short(out01, 16, in1, 8, 8, 1); \ + short out0 = _extract_short(out01, 0, 2, 8); \ + short out1 = _extract_short(out01, 1, 2, 8) + + #define IN(x) \ + vllvm_load_short(input_scalar, 8, x) + + #define STORE(out, idx) \ + vllvm_store_short(out, output_scalar, idx) + + static inline void Matrix_Transpose_VectorC (short *input_scalar, short *output_scalar) { + MERGE(b01, b0, b1, IN(0), IN(4)); + MERGE(b23, b2, b3, IN(1), IN(5)); + MERGE(b45, b4, b5, IN(2), IN(6)); + MERGE(b67, b6, b7, IN(3), IN(7)); + + MERGE(a01, a0, a1, b0, b4); + MERGE(a23, a2, a3, b1, b5); + MERGE(a45, a4, a5, b2, b6); + MERGE(a67, a6, a7, b3, b7); + + MERGE(out01, out0, out1, a0, a4); + MERGE(out23, out2, out3, a1, a5); + MERGE(out45, out4, out5, a2, a6); + MERGE(out67, out6, out7, a3, a7); + + STORE(out0, 0); + STORE(out1, 1); + STORE(out2, 2); + STORE(out3, 3); + STORE(out4, 4); + STORE(out5, 5); + STORE(out6, 6); + STORE(out7, 7); + } + + static inline void DCT_Transform_VectorC ( short *x, short *y) { + signed short t0, t1, t2, t3, t4, t5, t6, t7, t8, t9, t10; + + t8 = vllvm_adds_short(vllvm_load_short(x, 8, 0), vllvm_load_short(x, 8, 7)); + t9 = vllvm_subs_short(vllvm_load_short(x, 8, 0), vllvm_load_short(x, 8, 7)); + t0 = vllvm_adds_short(vllvm_load_short(x, 8, 1), vllvm_load_short(x, 8, 6)); + t7 = vllvm_subs_short(vllvm_load_short(x, 8, 1), vllvm_load_short(x, 8, 6)); + t1 = vllvm_adds_short(vllvm_load_short(x, 8, 2), vllvm_load_short(x, 8, 5)); + t6 = vllvm_subs_short(vllvm_load_short(x, 8, 2), vllvm_load_short(x, 8, 5)); + t2 = vllvm_adds_short(vllvm_load_short(x, 8, 3), vllvm_load_short(x, 8, 4)); + t5 = vllvm_subs_short(vllvm_load_short(x, 8, 3), vllvm_load_short(x, 8, 4)); + + t3 = vllvm_adds_short(t8, t2); + t4 = vllvm_subs_short(t8, t2); + t2 = vllvm_adds_short(t0, t1); + t8 = vllvm_subs_short(t0, t1); + + t1 = vllvm_adds_short(t7, t6); + t0 = vllvm_subs_short(t7, t6); + + vllvm_store_short(vllvm_adds_short(t3, t2), y, 0); + vllvm_store_short(vllvm_subs_short(t3, t2), y, 4); + + short c13573 = vllvm_fixed_vimm_short(13573, 8); + #if USE_C0 + short c0 = vllvm_fixed_vimm_short(0, 8); + #endif + short c23170 = vllvm_fixed_vimm_short(23170, 8); + short cneg23170 = vllvm_fixed_vimm_short(-23170, 8); + short c6518 = vllvm_fixed_vimm_short(6518, 8); + + vllvm_store_short(vllvm_mradds_short(t8, c13573, t4), y, 2); + #if USE_C0 + t10 = vllvm_mradds_short(t4, c13573, c0); + #else + t10 = vllvm_mr_short(t4, c13573); + #endif + vllvm_store_short(vllvm_subs_short(t10, t8), y, 6); + + t6 = vllvm_mradds_short(t0, c23170, t5); + t7 = vllvm_mradds_short(t0, cneg23170, t5); + t2 = vllvm_mradds_short(t1, cneg23170, t9); + t3 = vllvm_mradds_short(t1, c23170, t9); + + vllvm_store_short(vllvm_mradds_short(t6, c6518, t3), y, 1); + #if USE_C0 + t9 = vllvm_mradds_short(t3, c6518, c0); + #else + t9 = vllvm_mr_short(t3, c6518); + #endif + vllvm_store_short(vllvm_subs_short(t9, t6), y, 7); + vllvm_store_short(vllvm_mradds_short(t2, vllvm_fixed_vimm_short(21895, 8), t7), y, 5); + vllvm_store_short(vllvm_mradds_short(t7, vllvm_fixed_vimm_short(-21895, 8), t2), y, 3); + + } + + extern short *PostScalePtr; + + #define STORE2(i) \ + vllvm_store_short(vllvm_mradds_short(vllvm_load_short(PostScalePtr, 8, i), \ + vllvm_load_short(y, 8, i), \ + vllvm_fixed_vimm_short(0, 8)), \ + output, i); + + void dct_vector(short *input, short *output, short *x, short *y) { + + vllvm_store_short(vllvm_load_short(input, 8, 0), x, 0); + vllvm_store_short(vllvm_load_short(input, 8, 1), x, 1); + vllvm_store_short(vllvm_load_short(input, 8, 2), x, 2); + vllvm_store_short(vllvm_load_short(input, 8, 3), x, 3); + vllvm_store_short(vllvm_load_short(input, 8, 4), x, 4); + vllvm_store_short(vllvm_load_short(input, 8, 5), x, 5); + vllvm_store_short(vllvm_load_short(input, 8, 6), x, 6); + vllvm_store_short(vllvm_load_short(input, 8, 7), x, 7); + DCT_Transform_VectorC( x, y ); + Matrix_Transpose_VectorC( y, x ); + DCT_Transform_VectorC( x, y ); + + STORE2(0); + STORE2(1); + STORE2(2); + STORE2(3); + STORE2(4); + STORE2(5); + STORE2(6); + STORE2(7); + + } + Index: llvm/examples/SIMD/DCT/main.c diff -c /dev/null llvm/examples/SIMD/DCT/main.c:1.1.2.1 *** /dev/null Sun Oct 23 17:50:18 2005 --- llvm/examples/SIMD/DCT/main.c Sun Oct 23 17:49:39 2005 *************** *** 0 **** --- 1,175 ---- + #define N 1024 + + #include + #include + #include + #include + #include + #include "../_malloc.h" + #include "Scalar.h" + + inline void dct_scalar(short*, short*); + void dct_vector(short*, short*, short*, short*); + + short *in; + short *out_vector; + short *out_scalar; + + static short PostScaleArray[64] = { + 4095, 5681, 5351, 4816, 4095, 4816, 5351, 5681, + 5681, 7880, 7422, 6680, 5681, 6680, 7422, 7880, + 5351, 7422, 6992, 6292, 5351, 6292, 6992, 7422, + 4816, 6680, 6292, 5663, 4816, 5663, 6292, 6680, + 4095, 5681, 5351, 4816, 4095, 4816, 5351, 5681, + 4816, 6680, 6292, 5663, 4816, 5663, 6292, 6680, + 5351, 7422, 6992, 6292, 5351, 6292, 6992, 7422, + 5681, 7880, 7422, 6680, 5681, 6680, 7422, 7880 + }; + + short *PostScalePtr; + + void init() { + int i; + + // Force 16-byte alignment + // + in = (short*) _malloc(N*sizeof(short)); + out_vector = (short*) _malloc(N*sizeof(short)); + out_scalar = (short*) _malloc(N*sizeof(short)); + PostScalePtr = (short*) _malloc(64*sizeof(short)); + memcpy(PostScalePtr, PostScaleArray, 64*sizeof(short)); + + // Populate in with a range of values + // + for (i = 0; i < N; ++i) { + in[i] = N/2-i; + } + + } + + float run() { + long t0, t1, t2; + int i,j; + struct tms buf_s, buf_e; + long scalar_time = 0, vector_time = 0; + + times(&buf_s); + for (i = 0; i < 100000; ++i) + for (j = 0; j < N; j +=64) + dct_scalar(in+j, out_scalar+j); + times(&buf_e); + scalar_time = buf_e.tms_utime - buf_s.tms_utime; + printf("scalar time=%d, ", scalar_time); + + short *x = (short*) _malloc(64*sizeof(short)); + short *y = (short*) _malloc(64*sizeof(short)); + times(&buf_s); + for (i = 0; i < 100000; ++i) + for (j = 0; j < N; j +=64) + dct_vector(in+j, out_vector+j, x, y); + times(&buf_e); + vector_time = buf_e.tms_utime - buf_s.tms_utime; + printf("vector time=%d, ", vector_time); + + float speedup = ((float) scalar_time)/vector_time; + printf("speedup=%f\n", speedup); + + for (i = 0; i < N; i++) { + if (out_vector[i] != out_scalar[i]) { + printf("FAILED\n"); + exit(1); + } + } + + return speedup; + } + + int main (void) { + unsigned i; + + init(); + + float best = 0; + for (i = 0; i < NRUNS; ++i) { + float speedup = run(); + if (speedup > best) + best = speedup; + } + printf("best speedup=%f\n", best); + + printf ("PASSED\n"); + return 0; + + } + + static inline void Matrix_Transpose ( short *input, short *output) { + unsigned i; + for (i = 0; i < 8; ++i) { + output[i] = input[8*i]; + output[8+i] = input[8*i+1]; + output[16+i] = input[8*i+2]; + output[24+i] = input[8*i+3]; + output[32+i] = input[8*i+4]; + output[40+i] = input[8*i+5]; + output[48+i] = input[8*i+6]; + output[56+i] = input[8*i+7]; + } + } + + static inline void DCT_Transform ( short *x, short *y) { + signed short t0, t1, t2, t3, t4, t5, t6, t7, t8, t9, t10; + + unsigned i; + for (i = 0; i < 8; ++i) { + t8 = adds_short(x[i], x[56+i]); + t9 = subs_short(x[i], x[56+i]); + t0 = adds_short(x[8+i], x[48+i]); + t7 = subs_short(x[8+i], x[48+i]); + t1 = adds_short(x[16+i], x[40+i]); + t6 = subs_short(x[16+i], x[40+i]); + t2 = adds_short(x[24+i], x[32+i]); + t5 = subs_short(x[24+i], x[32+i]); + + t3 = adds_short(t8, t2); + t4 = subs_short(t8, t2); + t2 = adds_short(t0, t1); + t8 = subs_short(t0, t1); + + t1 = adds_short(t7, t6); + t0 = subs_short(t7, t6); + + y[i] = adds_short(t3, t2); + y[32+i] = subs_short(t3, t2); + y[16+i] = mradds_short(t8, 13573, t4); + t10 = mradds_short(t4, 13573, 0); + y[48+i] = subs_short(t10, t8); + + t6 = mradds_short(t0, 23170, t5); + t7 = mradds_short(t0, -23170, t5); + t2 = mradds_short(t1, -23170, t9); + t3 = mradds_short(t1, 23170, t9); + + y[8+i] = mradds_short(t6, 6518, t3); + t9 = mradds_short(t3, 6518, 0); + y[56+i] = subs_short(t9, t6); + y[40+i] = mradds_short(t2, 21895, t7); + y[24+i] = mradds_short(t7, -21895, t2); + } + + } + + void dct_scalar(short *input, short *output) { + + short x[64], y[64]; + unsigned i, j; + + memcpy(x, input, 64*sizeof(short)); + DCT_Transform( x, y ); + Matrix_Transpose( y, x ); + DCT_Transform( x, y ); + + for (i = 0; i < 8; ++i) + for (j = 0; j < 8; ++j) + output[8*i+j] = mradds_short(PostScaleArray[8*i+j], y[8*i+j], 0); + } + From bocchino at persephone.cs.uiuc.edu Sun Oct 23 17:50:20 2005 From: bocchino at persephone.cs.uiuc.edu (Robert L. Bocchino Jr.) Date: Sun, 23 Oct 2005 17:50:20 -0500 (CDT) Subject: [llvm-commits] [vector_llvm] CVS: llvm/examples/SIMD/MADFilter/Makefile mad.h mad_filter.altivec.handwritten.c mad_filter.sse.handwritten.c mad_filter.vectorc.c main.c Message-ID: <20051023225020.A88EA17FABBF@persephone.cs.uiuc.edu> Changes in directory llvm/examples/SIMD/MADFilter: Makefile added (r1.1.2.1) mad.h added (r1.1.2.1) mad_filter.altivec.handwritten.c added (r1.1.2.1) mad_filter.sse.handwritten.c added (r1.1.2.1) mad_filter.vectorc.c added (r1.1.2.1) main.c added (r1.1.2.1) --- Log message: Examples to illustrate Vector LLVM's SIMD support. --- Diffs of the changes: (+1109 -0) Makefile | 4 mad.h | 932 +++++++++++++++++++++++++++++++++++++++ mad_filter.altivec.handwritten.c | 15 mad_filter.sse.handwritten.c | 16 mad_filter.vectorc.c | 13 main.c | 129 +++++ 6 files changed, 1109 insertions Index: llvm/examples/SIMD/MADFilter/Makefile diff -c /dev/null llvm/examples/SIMD/MADFilter/Makefile:1.1.2.1 *** /dev/null Sun Oct 23 17:50:00 2005 --- llvm/examples/SIMD/MADFilter/Makefile Sun Oct 23 17:49:40 2005 *************** *** 0 **** --- 1,4 ---- + NAME= mad_filter + + include ../Makefile.common + Index: llvm/examples/SIMD/MADFilter/mad.h diff -c /dev/null llvm/examples/SIMD/MADFilter/mad.h:1.1.2.1 *** /dev/null Sun Oct 23 17:50:17 2005 --- llvm/examples/SIMD/MADFilter/mad.h Sun Oct 23 17:49:40 2005 *************** *** 0 **** --- 1,932 ---- + /* + * libmad - MPEG audio decoder library + * Copyright (C) 2000-2001 Robert Leslie + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * If you would like to negotiate alternate licensing terms, you may do + * so by contacting the author: Robert Leslie + */ + + # ifdef __cplusplus + extern "C" { + # endif + + # define FPM_INTEL + + # define SIZEOF_INT 4 + # define SIZEOF_LONG 4 + # define SIZEOF_LONG_LONG 8 + + /* Id: version.h,v 1.20 2001/10/27 22:47:32 rob Exp */ + + # ifndef LIBMAD_VERSION_H + # define LIBMAD_VERSION_H + + # define MAD_VERSION_MAJOR 0 + # define MAD_VERSION_MINOR 14 + # define MAD_VERSION_PATCH 2 + # define MAD_VERSION_EXTRA " (beta)" + + # define MAD_VERSION_STRINGIZE(str) #str + # define MAD_VERSION_STRING(num) MAD_VERSION_STRINGIZE(num) + + # define MAD_VERSION MAD_VERSION_STRING(MAD_VERSION_MAJOR) "." \ + MAD_VERSION_STRING(MAD_VERSION_MINOR) "." \ + MAD_VERSION_STRING(MAD_VERSION_PATCH) \ + MAD_VERSION_EXTRA + + # define MAD_PUBLISHYEAR "2000-2001" + # define MAD_AUTHOR "Robert Leslie" + # define MAD_EMAIL "rob at mars.org" + + extern char const mad_version[]; + extern char const mad_copyright[]; + extern char const mad_author[]; + extern char const mad_build[]; + + # endif + + /* Id: fixed.h,v 1.30 2001/11/02 09:51:06 rob Exp */ + + # ifndef LIBMAD_FIXED_H + # define LIBMAD_FIXED_H + + # if SIZEOF_INT >= 4 + typedef signed int mad_fixed_t; + + typedef signed int mad_fixed64hi_t; + typedef unsigned int mad_fixed64lo_t; + # else + typedef signed long mad_fixed_t; + + typedef signed long mad_fixed64hi_t; + typedef unsigned long mad_fixed64lo_t; + # endif + + # if defined(_MSC_VER) + # define mad_fixed64_t signed __int64 + # elif 1 || defined(__GNUC__) + # define mad_fixed64_t signed long long + # endif + + # if defined(FPM_FLOAT) + typedef double mad_sample_t; + # else + typedef mad_fixed_t mad_sample_t; + # endif + + /* + * Fixed-point format: 0xABBBBBBB + * A == whole part (sign + 3 bits) + * B == fractional part (28 bits) + * + * Values are signed two's complement, so the effective range is: + * 0x80000000 to 0x7fffffff + * -8.0 to +7.9999999962747097015380859375 + * + * The smallest representable value is: + * 0x00000001 == 0.0000000037252902984619140625 (i.e. about 3.725e-9) + * + * 28 bits of fractional accuracy represent about + * 8.6 digits of decimal accuracy. + * + * Fixed-point numbers can be added or subtracted as normal + * integers, but multiplication requires shifting the 64-bit result + * from 56 fractional bits back to 28 (and rounding.) + * + * Changing the definition of MAD_F_FRACBITS is only partially + * supported, and must be done with care. + */ + + # define MAD_F_FRACBITS 28 + + # if MAD_F_FRACBITS == 28 + # define MAD_F(x) ((mad_fixed_t) (x##L)) + # else + # if MAD_F_FRACBITS < 28 + # warning "MAD_F_FRACBITS < 28" + # define MAD_F(x) ((mad_fixed_t) \ + (((x##L) + \ + (1L << (28 - MAD_F_FRACBITS - 1))) >> \ + (28 - MAD_F_FRACBITS))) + # elif MAD_F_FRACBITS > 28 + # error "MAD_F_FRACBITS > 28 not currently supported" + # define MAD_F(x) ((mad_fixed_t) \ + ((x##L) << (MAD_F_FRACBITS - 28))) + # endif + # endif + + # define MAD_F_MIN ((mad_fixed_t) -0x80000000L) + # define MAD_F_MAX ((mad_fixed_t) +0x7fffffffL) + + # define MAD_F_ONE MAD_F(0x10000000) + + # define mad_f_tofixed(x) ((mad_fixed_t) \ + ((x) * (double) (1L << MAD_F_FRACBITS) + 0.5)) + # define mad_f_todouble(x) ((double) \ + ((x) / (double) (1L << MAD_F_FRACBITS))) + + # define mad_f_intpart(x) ((x) >> MAD_F_FRACBITS) + # define mad_f_fracpart(x) ((x) & ((1L << MAD_F_FRACBITS) - 1)) + /* (x should be positive) */ + + # define mad_f_fromint(x) ((x) << MAD_F_FRACBITS) + + # define mad_f_add(x, y) ((x) + (y)) + # define mad_f_sub(x, y) ((x) - (y)) + + # if defined(FPM_FLOAT) + # error "FPM_FLOAT not yet supported" + + # undef MAD_F + # define MAD_F(x) mad_f_todouble(x) + + # define mad_f_mul(x, y) ((x) * (y)) + # define mad_f_scale64 + + # undef ASO_ZEROCHECK + + # elif defined(FPM_64BIT) + + /* + * This version should be the most accurate if 64-bit types are supported by + * the compiler, although it may not be the most efficient. + */ + # if defined(OPT_ACCURACY) + # define mad_f_mul(x, y) \ + ((mad_fixed_t) \ + ((((mad_fixed64_t) (x) * (y)) + \ + (1L << (MAD_F_SCALEBITS - 1))) >> MAD_F_SCALEBITS)) + # else + # define mad_f_mul(x, y) \ + ((mad_fixed_t) (((mad_fixed64_t) (x) * (y)) >> MAD_F_SCALEBITS)) + # endif + + # define MAD_F_SCALEBITS MAD_F_FRACBITS + + /* --- Intel --------------------------------------------------------------- */ + + # elif defined(FPM_INTEL) + + # if defined(_MSC_VER) + # pragma warning(push) + # pragma warning(disable: 4035) /* no return value */ + static __forceinline + mad_fixed_t mad_f_mul_inline(mad_fixed_t x, mad_fixed_t y) + { + enum { + fracbits = MAD_F_FRACBITS + }; + + __asm { + mov eax, x + imul y + shrd eax, edx, fracbits + } + + /* implicit return of eax */ + } + # pragma warning(pop) + + # define mad_f_mul mad_f_mul_inline + # define mad_f_scale64 + # else + /* + * This Intel version is fast and accurate; the disposition of the least + * significant bit depends on OPT_ACCURACY via mad_f_scale64(). + */ + # define MAD_F_MLX(hi, lo, x, y) \ + asm ("imull %3" \ + : "=a" (lo), "=d" (hi) \ + : "%a" (x), "rm" (y) \ + : "cc") + + # if defined(OPT_ACCURACY) + /* + * This gives best accuracy but is not very fast. + */ + # define MAD_F_MLA(hi, lo, x, y) \ + ({ mad_fixed64hi_t __hi; \ + mad_fixed64lo_t __lo; \ + MAD_F_MLX(__hi, __lo, (x), (y)); \ + asm ("addl %2,%0\n\t" \ + "adcl %3,%1" \ + : "=rm" (lo), "=rm" (hi) \ + : "r" (__lo), "r" (__hi), "0" (lo), "1" (hi) \ + : "cc"); \ + }) + # endif /* OPT_ACCURACY */ + + # if defined(OPT_ACCURACY) + /* + * Surprisingly, this is faster than SHRD followed by ADC. + */ + # define mad_f_scale64(hi, lo) \ + ({ mad_fixed64hi_t __hi_; \ + mad_fixed64lo_t __lo_; \ + mad_fixed_t __result; \ + asm ("addl %4,%2\n\t" \ + "adcl %5,%3" \ + : "=rm" (__lo_), "=rm" (__hi_) \ + : "0" (lo), "1" (hi), \ + "ir" (1L << (MAD_F_SCALEBITS - 1)), "ir" (0) \ + : "cc"); \ + asm ("shrdl %3,%2,%1" \ + : "=rm" (__result) \ + : "0" (__lo_), "r" (__hi_), "I" (MAD_F_SCALEBITS) \ + : "cc"); \ + __result; \ + }) + # else + # define mad_f_scale64(hi, lo) \ + ({ mad_fixed_t __result; \ + asm ("shrdl %3,%2,%1" \ + : "=rm" (__result) \ + : "0" (lo), "r" (hi), "I" (MAD_F_SCALEBITS) \ + : "cc"); \ + __result; \ + }) + # endif /* OPT_ACCURACY */ + + # define MAD_F_SCALEBITS MAD_F_FRACBITS + # endif + + /* --- ARM ----------------------------------------------------------------- */ + + # elif defined(FPM_ARM) + + /* + * This ARM V4 version is as accurate as FPM_64BIT but much faster. The + * least significant bit is properly rounded at no CPU cycle cost! + */ + # if 1 + /* + * There's a bug somewhere, possibly in the compiler, that sometimes makes + * this necessary instead of the default implementation via MAD_F_MLX and + * mad_f_scale64. It may be related to the use (or lack) of + * -finline-functions and/or -fstrength-reduce. + * + * This is also apparently faster than MAD_F_MLX/mad_f_scale64. + */ + # define mad_f_mul(x, y) \ + ({ mad_fixed64hi_t __hi; \ + mad_fixed64lo_t __lo; \ + mad_fixed_t __result; \ + asm ("smull %0, %1, %3, %4\n\t" \ + "movs %0, %0, lsr %5\n\t" \ + "adc %2, %0, %1, lsl %6" \ + : "=&r" (__lo), "=&r" (__hi), "=r" (__result) \ + : "%r" (x), "r" (y), \ + "M" (MAD_F_SCALEBITS), "M" (32 - MAD_F_SCALEBITS) \ + : "cc"); \ + __result; \ + }) + # endif + + # define MAD_F_MLX(hi, lo, x, y) \ + asm ("smull %0, %1, %2, %3" \ + : "=&r" (lo), "=&r" (hi) \ + : "%r" (x), "r" (y)) + + # define MAD_F_MLA(hi, lo, x, y) \ + asm ("smlal %0, %1, %2, %3" \ + : "+r" (lo), "+r" (hi) \ + : "%r" (x), "r" (y)) + + # define MAD_F_MLN(hi, lo) \ + asm ("rsbs %0, %2, #0\n\t" \ + "rsc %1, %3, #0" \ + : "=r" (lo), "=r" (hi) \ + : "0" (lo), "1" (hi) \ + : "cc") + + # define mad_f_scale64(hi, lo) \ + ({ mad_fixed_t __result; \ + asm ("movs %0, %1, lsr %3\n\t" \ + "adc %0, %0, %2, lsl %4" \ + : "=r" (__result) \ + : "r" (lo), "r" (hi), \ + "M" (MAD_F_SCALEBITS), "M" (32 - MAD_F_SCALEBITS) \ + : "cc"); \ + __result; \ + }) + + # define MAD_F_SCALEBITS MAD_F_FRACBITS + + /* --- MIPS ---------------------------------------------------------------- */ + + # elif defined(FPM_MIPS) + + /* + * This MIPS version is fast and accurate; the disposition of the least + * significant bit depends on OPT_ACCURACY via mad_f_scale64(). + */ + # define MAD_F_MLX(hi, lo, x, y) \ + asm ("mult %2,%3" \ + : "=l" (lo), "=h" (hi) \ + : "%r" (x), "r" (y)) + + # if defined(HAVE_MADD_ASM) + # define MAD_F_MLA(hi, lo, x, y) \ + asm ("madd %2,%3" \ + : "+l" (lo), "+h" (hi) \ + : "%r" (x), "r" (y)) + # elif defined(HAVE_MADD16_ASM) + /* + * This loses significant accuracy due to the 16-bit integer limit in the + * multiply/accumulate instruction. + */ + # define MAD_F_ML0(hi, lo, x, y) \ + asm ("mult %2,%3" \ + : "=l" (lo), "=h" (hi) \ + : "%r" ((x) >> 12), "r" ((y) >> 16)) + # define MAD_F_MLA(hi, lo, x, y) \ + asm ("madd16 %2,%3" \ + : "+l" (lo), "+h" (hi) \ + : "%r" ((x) >> 12), "r" ((y) >> 16)) + # define MAD_F_MLZ(hi, lo) ((mad_fixed_t) (lo)) + # endif + + # if defined(OPT_SPEED) + # define mad_f_scale64(hi, lo) \ + ((mad_fixed_t) ((hi) << (32 - MAD_F_SCALEBITS))) + # define MAD_F_SCALEBITS MAD_F_FRACBITS + # endif + + /* --- SPARC --------------------------------------------------------------- */ + + # elif defined(FPM_SPARC) + + /* + * This SPARC V8 version is fast and accurate; the disposition of the least + * significant bit depends on OPT_ACCURACY via mad_f_scale64(). + */ + # define MAD_F_MLX(hi, lo, x, y) \ + asm ("smul %2, %3, %0\n\t" \ + "rd %%y, %1" \ + : "=r" (lo), "=r" (hi) \ + : "%r" (x), "rI" (y)) + + /* --- PowerPC ------------------------------------------------------------- */ + + # elif defined(FPM_PPC) + + /* + * This PowerPC version is tuned for the 4xx embedded processors. It is + * effectively a tuned version of FPM_64BIT. It is a little faster and just + * as accurate. The disposition of the least significant bit depends on + * OPT_ACCURACY via mad_f_scale64(). + */ + # define MAD_F_MLX(hi, lo, x, y) \ + asm ("mulhw %1, %2, %3\n\t" \ + "mullw %0, %2, %3" \ + : "=&r" (lo), "=&r" (hi) \ + : "%r" (x), "r" (y)) + + # define MAD_F_MLA(hi, lo, x, y) \ + ({ mad_fixed64hi_t __hi; \ + mad_fixed64lo_t __lo; \ + MAD_F_MLX(__hi, __lo, (x), (y)); \ + asm ("addc %0, %2, %3\n\t" \ + "adde %1, %4, %5" \ + : "=r" (lo), "=r" (hi) \ + : "%r" (__lo), "0" (lo), "%r" (__hi), "1" (hi)); \ + }) + + # if defined(OPT_ACCURACY) + /* + * This is accurate and ~2 - 2.5 times slower than the unrounded version. + * + * The __volatile__ improves the generated code by another 5% (fewer spills + * to memory); eventually they should be removed. + */ + # define mad_f_scale64(hi, lo) \ + ({ mad_fixed_t __result; \ + mad_fixed64hi_t __hi_; \ + mad_fixed64lo_t __lo_; \ + asm __volatile__ ("addc %0, %2, %4\n\t" \ + "addze %1, %3" \ + : "=r" (__lo_), "=r" (__hi_) \ + : "r" (lo), "r" (hi), "r" (1 << (MAD_F_SCALEBITS - 1))); \ + asm __volatile__ ("rlwinm %0, %2,32-%3,0,%3-1\n\t" \ + "rlwimi %0, %1,32-%3,%3,31" \ + : "=&r" (__result) \ + : "r" (__lo_), "r" (__hi_), "I" (MAD_F_SCALEBITS)); \ + __result; \ + }) + # else + # define mad_f_scale64(hi, lo) \ + ({ mad_fixed_t __result; \ + asm ("rlwinm %0, %2,32-%3,0,%3-1\n\t" \ + "rlwimi %0, %1,32-%3,%3,31" \ + : "=r" (__result) \ + : "r" (lo), "r" (hi), "I" (MAD_F_SCALEBITS)); \ + __result; \ + }) + # endif /* OPT_ACCURACY */ + + # define MAD_F_SCALEBITS MAD_F_FRACBITS + + /* --- Default ------------------------------------------------------------- */ + + # elif defined(FPM_DEFAULT) + + /* + * This version is the most portable but it loses significant accuracy. + * Furthermore, accuracy is biased against the second argument, so care + * should be taken when ordering operands. + * + * The scale factors are constant as this is not used with SSO. + * + * Pre-rounding is required to stay within the limits of compliance. + */ + # if defined(OPT_SPEED) + # define mad_f_mul(x, y) (((x) >> 12) * ((y) >> 16)) + # else + # define mad_f_mul(x, y) ((((x) + (1L << 11)) >> 12) * \ + (((y) + (1L << 15)) >> 16)) + # endif + + /* ------------------------------------------------------------------------- */ + + # else + # error "no FPM selected" + # endif + + /* default implementations */ + + # if !defined(mad_f_mul) + # define mad_f_mul(x, y) \ + ({ mad_fixed64hi_t __hi; \ + mad_fixed64lo_t __lo; \ + MAD_F_MLX(__hi, __lo, (x), (y)); \ + mad_f_scale64(__hi, __lo); \ + }) + # endif + + # if !defined(MAD_F_MLA) + # define MAD_F_ML0(hi, lo, x, y) ((lo) = mad_f_mul((x), (y))) + # define MAD_F_MLA(hi, lo, x, y) ((lo) += mad_f_mul((x), (y))) + # define MAD_F_MLN(hi, lo) ((lo) = -(lo)) + # define MAD_F_MLZ(hi, lo) ((void) (hi), (mad_fixed_t) (lo)) + # endif + + # if !defined(MAD_F_ML0) + # define MAD_F_ML0(hi, lo, x, y) MAD_F_MLX((hi), (lo), (x), (y)) + # endif + + # if !defined(MAD_F_MLN) + # define MAD_F_MLN(hi, lo) ((hi) = ((lo) = -(lo)) ? ~(hi) : -(hi)) + # endif + + # if !defined(MAD_F_MLZ) + # define MAD_F_MLZ(hi, lo) mad_f_scale64((hi), (lo)) + # endif + + # if !defined(mad_f_scale64) + # if defined(OPT_ACCURACY) + # define mad_f_scale64(hi, lo) \ + ((((mad_fixed_t) \ + (((hi) << (32 - (MAD_F_SCALEBITS - 1))) | \ + ((lo) >> (MAD_F_SCALEBITS - 1)))) + 1) >> 1) + # else + # define mad_f_scale64(hi, lo) \ + ((mad_fixed_t) \ + (((hi) << (32 - MAD_F_SCALEBITS)) | \ + ((lo) >> MAD_F_SCALEBITS))) + # endif + # define MAD_F_SCALEBITS MAD_F_FRACBITS + # endif + + /* miscellaneous C routines */ + + mad_fixed_t mad_f_abs(mad_fixed_t); + + # endif + + /* Id: bit.h,v 1.8 2001/10/17 19:14:47 rob Exp */ + + # ifndef LIBMAD_BIT_H + # define LIBMAD_BIT_H + + struct mad_bitptr { + unsigned char const *byte; + unsigned short cache; + unsigned short left; + }; + + void mad_bit_init(struct mad_bitptr *, unsigned char const *); + + # define mad_bit_finish(bitptr) /* nothing */ + + unsigned int mad_bit_length(struct mad_bitptr const *, + struct mad_bitptr const *); + + # define mad_bit_bitsleft(bitptr) ((bitptr)->left) + unsigned char const *mad_bit_nextbyte(struct mad_bitptr const *); + + void mad_bit_skip(struct mad_bitptr *, unsigned int); + unsigned long mad_bit_read(struct mad_bitptr *, unsigned int); + void mad_bit_write(struct mad_bitptr *, unsigned int, unsigned long); + + unsigned short mad_bit_crc(struct mad_bitptr, unsigned int, unsigned short); + + # endif + + /* Id: timer.h,v 1.12 2001/11/03 03:57:11 rob Exp */ + + # ifndef LIBMAD_TIMER_H + # define LIBMAD_TIMER_H + + typedef struct { + signed long seconds; /* whole seconds */ + unsigned long fraction; /* 1/MAD_TIMER_RESOLUTION seconds */ + } mad_timer_t; + + extern mad_timer_t const mad_timer_zero; + + # define MAD_TIMER_RESOLUTION 352800000UL + + enum mad_units { + MAD_UNITS_HOURS = -2, + MAD_UNITS_MINUTES = -1, + MAD_UNITS_SECONDS = 0, + + /* metric units */ + + MAD_UNITS_DECISECONDS = 10, + MAD_UNITS_CENTISECONDS = 100, + MAD_UNITS_MILLISECONDS = 1000, + + /* audio sample units */ + + MAD_UNITS_8000_HZ = 8000, + MAD_UNITS_11025_HZ = 11025, + MAD_UNITS_12000_HZ = 12000, + + MAD_UNITS_16000_HZ = 16000, + MAD_UNITS_22050_HZ = 22050, + MAD_UNITS_24000_HZ = 24000, + + MAD_UNITS_32000_HZ = 32000, + MAD_UNITS_44100_HZ = 44100, + MAD_UNITS_48000_HZ = 48000, + + /* video frame/field units */ + + MAD_UNITS_24_FPS = 24, + MAD_UNITS_25_FPS = 25, + MAD_UNITS_30_FPS = 30, + MAD_UNITS_48_FPS = 48, + MAD_UNITS_50_FPS = 50, + MAD_UNITS_60_FPS = 60, + + /* CD audio frames */ + + MAD_UNITS_75_FPS = 75, + + /* video drop-frame units */ + + MAD_UNITS_23_976_FPS = -24, + MAD_UNITS_24_975_FPS = -25, + MAD_UNITS_29_97_FPS = -30, + MAD_UNITS_47_952_FPS = -48, + MAD_UNITS_49_95_FPS = -50, + MAD_UNITS_59_94_FPS = -60 + }; + + # define mad_timer_reset(timer) ((void) (*(timer) = mad_timer_zero)) + + int mad_timer_compare(mad_timer_t, mad_timer_t); + + # define mad_timer_sign(timer) mad_timer_compare((timer), mad_timer_zero) + + void mad_timer_negate(mad_timer_t *); + mad_timer_t mad_timer_abs(mad_timer_t); + + void mad_timer_set(mad_timer_t *, unsigned long, unsigned long, unsigned long); + void mad_timer_add(mad_timer_t *, mad_timer_t); + void mad_timer_multiply(mad_timer_t *, signed long); + + signed long mad_timer_count(mad_timer_t, enum mad_units); + unsigned long mad_timer_fraction(mad_timer_t, unsigned long); + void mad_timer_string(mad_timer_t, char *, char const *, + enum mad_units, enum mad_units, unsigned long); + + # endif + + /* Id: stream.h,v 1.15 2001/11/08 23:28:03 rob Exp */ + + # ifndef LIBMAD_STREAM_H + # define LIBMAD_STREAM_H + + # define MAD_BUFFER_GUARD 8 + # define MAD_BUFFER_MDLEN (511 + 2048 + MAD_BUFFER_GUARD) + + enum mad_error { + MAD_ERROR_NONE = 0x0000, /* no error */ + + MAD_ERROR_BUFLEN = 0x0001, /* input buffer too small (or EOF) */ + MAD_ERROR_BUFPTR = 0x0002, /* invalid (null) buffer pointer */ + + MAD_ERROR_NOMEM = 0x0031, /* not enough memory */ + + MAD_ERROR_LOSTSYNC = 0x0101, /* lost synchronization */ + MAD_ERROR_BADLAYER = 0x0102, /* reserved header layer value */ + MAD_ERROR_BADBITRATE = 0x0103, /* forbidden bitrate value */ + MAD_ERROR_BADSAMPLERATE = 0x0104, /* reserved sample frequency value */ + MAD_ERROR_BADEMPHASIS = 0x0105, /* reserved emphasis value */ + + MAD_ERROR_BADCRC = 0x0201, /* CRC check failed */ + MAD_ERROR_BADBITALLOC = 0x0211, /* forbidden bit allocation value */ + MAD_ERROR_BADSCALEFACTOR = 0x0221, /* bad scalefactor index */ + MAD_ERROR_BADFRAMELEN = 0x0231, /* bad frame length */ + MAD_ERROR_BADBIGVALUES = 0x0232, /* bad big_values count */ + MAD_ERROR_BADBLOCKTYPE = 0x0233, /* reserved block_type */ + MAD_ERROR_BADSCFSI = 0x0234, /* bad scalefactor selection info */ + MAD_ERROR_BADDATAPTR = 0x0235, /* bad main_data_begin pointer */ + MAD_ERROR_BADPART3LEN = 0x0236, /* bad audio data length */ + MAD_ERROR_BADHUFFTABLE = 0x0237, /* bad Huffman table select */ + MAD_ERROR_BADHUFFDATA = 0x0238, /* Huffman data overrun */ + MAD_ERROR_BADSTEREO = 0x0239 /* incompatible block_type for JS */ + }; + + # define MAD_RECOVERABLE(error) ((error) & 0xff00) + + struct mad_stream { + unsigned char const *buffer; /* input bitstream buffer */ + unsigned char const *bufend; /* end of buffer */ + unsigned long skiplen; /* bytes to skip before next frame */ + + int sync; /* stream sync found */ + unsigned long freerate; /* free bitrate (fixed) */ + + unsigned char const *this_frame; /* start of current frame */ + unsigned char const *next_frame; /* start of next frame */ + struct mad_bitptr ptr; /* current processing bit pointer */ + + struct mad_bitptr anc_ptr; /* ancillary bits pointer */ + unsigned int anc_bitlen; /* number of ancillary bits */ + + unsigned char (*main_data)[MAD_BUFFER_MDLEN]; + /* Layer III main_data() */ + unsigned int md_len; /* bytes in main_data */ + + int options; /* decoding options (see below) */ + enum mad_error error; /* error code (see above) */ + }; + + enum { + MAD_OPTION_IGNORECRC = 0x0001, /* ignore CRC errors */ + MAD_OPTION_HALFSAMPLERATE = 0x0002 /* generate PCM at 1/2 sample rate */ + # if 0 /* not yet implemented */ + MAD_OPTION_LEFTCHANNEL = 0x0010, /* decode left channel only */ + MAD_OPTION_RIGHTCHANNEL = 0x0020, /* decode right channel only */ + MAD_OPTION_SINGLECHANNEL = 0x0030 /* combine channels */ + # endif + }; + + void mad_stream_init(struct mad_stream *); + void mad_stream_finish(struct mad_stream *); + + # define mad_stream_options(stream, opts) \ + ((void) ((stream)->options = (opts))) + + void mad_stream_buffer(struct mad_stream *, + unsigned char const *, unsigned long); + void mad_stream_skip(struct mad_stream *, unsigned long); + + int mad_stream_sync(struct mad_stream *); + + char const *mad_stream_errorstr(struct mad_stream const *); + + # endif + + /* Id: frame.h,v 1.16 2001/10/17 19:13:41 rob Exp */ + + # ifndef LIBMAD_FRAME_H + # define LIBMAD_FRAME_H + + enum mad_layer { + MAD_LAYER_I = 1, /* Layer I */ + MAD_LAYER_II = 2, /* Layer II */ + MAD_LAYER_III = 3 /* Layer III */ + }; + + enum mad_mode { + MAD_MODE_SINGLE_CHANNEL = 0, /* single channel */ + MAD_MODE_DUAL_CHANNEL = 1, /* dual channel */ + MAD_MODE_JOINT_STEREO = 2, /* joint (MS/intensity) stereo */ + MAD_MODE_STEREO = 3 /* normal LR stereo */ + }; + + enum mad_emphasis { + MAD_EMPHASIS_NONE = 0, /* no emphasis */ + MAD_EMPHASIS_50_15_US = 1, /* 50/15 microseconds emphasis */ + MAD_EMPHASIS_CCITT_J_17 = 3 /* CCITT J.17 emphasis */ + }; + + struct mad_header { + enum mad_layer layer; /* audio layer (1, 2, or 3) */ + enum mad_mode mode; /* channel mode (see above) */ + int mode_extension; /* additional mode info */ + enum mad_emphasis emphasis; /* de-emphasis to use (see above) */ + + unsigned long bitrate; /* stream bitrate (bps) */ + unsigned int samplerate; /* sampling frequency (Hz) */ + + unsigned short crc_check; /* frame CRC accumulator */ + unsigned short crc_target; /* final target CRC checksum */ + + int flags; /* flags (see below) */ + int private_bits; /* private bits (see below) */ + + mad_timer_t duration; /* audio playing time of frame */ + }; + + struct mad_frame { + struct mad_header header; /* MPEG audio header */ + + int options; /* decoding options (from stream) */ + + mad_fixed_t sbsample[2][36][32]; /* synthesis subband filter samples */ + mad_fixed_t (*overlap)[2][32][18]; /* Layer III block overlap data */ + }; + + # define MAD_NCHANNELS(header) ((header)->mode ? 2 : 1) + # define MAD_NSBSAMPLES(header) \ + ((header)->layer == MAD_LAYER_I ? 12 : \ + (((header)->layer == MAD_LAYER_III && \ + ((header)->flags & MAD_FLAG_LSF_EXT)) ? 18 : 36)) + + enum { + MAD_FLAG_NPRIVATE_III = 0x0007, /* number of Layer III private bits */ + MAD_FLAG_INCOMPLETE = 0x0008, /* header but not data is decoded */ + + MAD_FLAG_PROTECTION = 0x0010, /* frame has CRC protection */ + MAD_FLAG_COPYRIGHT = 0x0020, /* frame is copyright */ + MAD_FLAG_ORIGINAL = 0x0040, /* frame is original (else copy) */ + MAD_FLAG_PADDING = 0x0080, /* frame has additional slot */ + + MAD_FLAG_I_STEREO = 0x0100, /* uses intensity joint stereo */ + MAD_FLAG_MS_STEREO = 0x0200, /* uses middle/side joint stereo */ + MAD_FLAG_FREEFORMAT = 0x0400, /* uses free format bitrate */ + + MAD_FLAG_LSF_EXT = 0x1000, /* lower sampling freq. extension */ + MAD_FLAG_MC_EXT = 0x2000, /* multichannel audio extension */ + MAD_FLAG_MPEG_2_5_EXT = 0x4000 /* MPEG 2.5 (unofficial) extension */ + }; + + enum { + MAD_PRIVATE_HEADER = 0x0100, /* header private bit */ + MAD_PRIVATE_III = 0x001f /* Layer III private bits (up to 5) */ + }; + + void mad_header_init(struct mad_header *); + + # define mad_header_finish(header) /* nothing */ + + int mad_header_decode(struct mad_header *, struct mad_stream *); + + void mad_frame_init(struct mad_frame *); + void mad_frame_finish(struct mad_frame *); + + int mad_frame_decode(struct mad_frame *, struct mad_stream *); + + void mad_frame_mute(struct mad_frame *); + + # endif + + /* Id: synth.h,v 1.11 2001/11/08 23:28:03 rob Exp */ + + # ifndef LIBMAD_SYNTH_H + # define LIBMAD_SYNTH_H + + struct mad_pcm { + unsigned int samplerate; /* sampling frequency (Hz) */ + unsigned short channels; /* number of channels */ + unsigned short length; /* number of samples per channel */ + mad_fixed_t samples[2][1152]; /* PCM output samples [ch][sample] */ + }; + + struct mad_synth { + mad_fixed_t filter[2][2][2][16][8]; /* polyphase filterbank outputs */ + /* [ch][eo][peo][s][v] */ + + unsigned int phase; /* current processing phase */ + + struct mad_pcm pcm; /* PCM output */ + }; + + /* single channel PCM selector */ + enum { + MAD_PCM_CHANNEL_SINGLE = 0 + }; + + /* dual channel PCM selector */ + enum { + MAD_PCM_CHANNEL_DUAL_1 = 0, + MAD_PCM_CHANNEL_DUAL_2 = 1 + }; + + /* stereo PCM selector */ + enum { + MAD_PCM_CHANNEL_STEREO_LEFT = 0, + MAD_PCM_CHANNEL_STEREO_RIGHT = 1 + }; + + void mad_synth_init(struct mad_synth *); + + # define mad_synth_finish(synth) /* nothing */ + + void mad_synth_mute(struct mad_synth *); + + void mad_synth_frame(struct mad_synth *, struct mad_frame const *); + + # endif + + /* Id: decoder.h,v 1.13 2001/11/03 03:57:11 rob Exp */ + + # ifndef LIBMAD_DECODER_H + # define LIBMAD_DECODER_H + + enum mad_decoder_mode { + MAD_DECODER_MODE_SYNC = 0, + MAD_DECODER_MODE_ASYNC + }; + + enum mad_flow { + MAD_FLOW_CONTINUE = 0x0000, /* continue normally */ + MAD_FLOW_STOP = 0x0010, /* stop decoding normally */ + MAD_FLOW_BREAK = 0x0011, /* stop decoding and signal an error */ + MAD_FLOW_IGNORE = 0x0020 /* ignore the current frame */ + }; + + struct mad_decoder { + enum mad_decoder_mode mode; + + int options; + + struct { + long pid; + int in; + int out; + } async; + + struct { + struct mad_stream stream; + struct mad_frame frame; + struct mad_synth synth; + } *sync; + + void *cb_data; + + enum mad_flow (*input_func)(void *, struct mad_stream *); + enum mad_flow (*header_func)(void *, struct mad_header const *); + enum mad_flow (*filter_func)(void *, + struct mad_stream const *, struct mad_frame *); + enum mad_flow (*output_func)(void *, + struct mad_header const *, struct mad_pcm *); + enum mad_flow (*error_func)(void *, struct mad_stream *, struct mad_frame *); + enum mad_flow (*message_func)(void *, void *, unsigned int *); + }; + + void mad_decoder_init(struct mad_decoder *, void *, + enum mad_flow (*)(void *, struct mad_stream *), + enum mad_flow (*)(void *, struct mad_header const *), + enum mad_flow (*)(void *, + struct mad_stream const *, + struct mad_frame *), + enum mad_flow (*)(void *, + struct mad_header const *, + struct mad_pcm *), + enum mad_flow (*)(void *, + struct mad_stream *, + struct mad_frame *), + enum mad_flow (*)(void *, void *, unsigned int *)); + int mad_decoder_finish(struct mad_decoder *); + + # define mad_decoder_options(decoder, opts) \ + ((void) ((decoder)->options = (opts))) + + int mad_decoder_run(struct mad_decoder *, enum mad_decoder_mode); + int mad_decoder_message(struct mad_decoder *, void *, unsigned int *); + + # endif + + # ifdef __cplusplus + } + # endif Index: llvm/examples/SIMD/MADFilter/mad_filter.altivec.handwritten.c diff -c /dev/null llvm/examples/SIMD/MADFilter/mad_filter.altivec.handwritten.c:1.1.2.1 *** /dev/null Sun Oct 23 17:50:18 2005 --- llvm/examples/SIMD/MADFilter/mad_filter.altivec.handwritten.c Sun Oct 23 17:49:40 2005 *************** *** 0 **** --- 1,15 ---- + void experimental_filter_vector(short *left_ch, short *right_ch, unsigned n) { + vector signed short *left_vp = (vector signed short*) left_ch; + vector signed short *right_vp = (vector signed short*) right_ch; + unsigned i; + vector unsigned short two = (vector unsigned short) (2); + + for (i = 0; i < n/8; ++i) { + vector signed short left = left_vp[i]; + vector signed short right = right_vp[i]; + vector signed short left_sub = vec_sub(left, vec_sra(right, two)); + vector signed short right_sub = vec_sub(right, vec_sra(left, two)); + right_vp[i] = right_sub; + left_vp[i] = left_sub; + } + } Index: llvm/examples/SIMD/MADFilter/mad_filter.sse.handwritten.c diff -c /dev/null llvm/examples/SIMD/MADFilter/mad_filter.sse.handwritten.c:1.1.2.1 *** /dev/null Sun Oct 23 17:50:18 2005 --- llvm/examples/SIMD/MADFilter/mad_filter.sse.handwritten.c Sun Oct 23 17:49:40 2005 *************** *** 0 **** --- 1,16 ---- + #include "SSE.h" + + void experimental_filter_vector(short *left_ch, short *right_ch, unsigned n) { + unsigned int i, j; + __m128i *left_vp = (__m128i*) left_ch; + __m128i *right_vp = (__m128i*) right_ch; + + for (i = 0; i < n/8; ++i) { + __m128i left = left_vp[i]; + __m128i right = right_vp[i]; + __m128i left_sub = _mm_sub_epi16(left, _mm_srai_epi16(right, 2)); + __m128i right_sub = _mm_sub_epi16(right, _mm_srai_epi16(left, 2)); + right_vp[i] = right_sub; + left_vp[i] = left_sub; + } + } Index: llvm/examples/SIMD/MADFilter/mad_filter.vectorc.c diff -c /dev/null llvm/examples/SIMD/MADFilter/mad_filter.vectorc.c:1.1.2.1 *** /dev/null Sun Oct 23 17:50:18 2005 --- llvm/examples/SIMD/MADFilter/mad_filter.vectorc.c Sun Oct 23 17:49:40 2005 *************** *** 0 **** --- 1,13 ---- + #include "VectorC.h" + + void experimental_filter_vector(short *left_ch, short *right_ch, unsigned n) { + unsigned i; + for (i = 0; i < n/8; ++i) { + short left = vllvm_load_short(left_ch, 8, i); + short right = vllvm_load_short(right_ch, 8, i); + short left_sub = left - (right >> 2); + short right_sub = right - (left >> 2); + vllvm_store_short(right_sub, right_ch, i); + vllvm_store_short(left_sub, left_ch, i); + } + } Index: llvm/examples/SIMD/MADFilter/main.c diff -c /dev/null llvm/examples/SIMD/MADFilter/main.c:1.1.2.1 *** /dev/null Sun Oct 23 17:50:18 2005 --- llvm/examples/SIMD/MADFilter/main.c Sun Oct 23 17:49:41 2005 *************** *** 0 **** --- 1,129 ---- + /* + * This program adapted from + * mad - MPEG audio decoder + * Copyright (C) 2000-2001 Robert Leslie + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * $Id: main.c,v 1.1.2.1 2005/10/23 22:49:41 bocchino Exp $ + */ + + # include + # include + + # include "mad.h" + #include "../_malloc.h" + #include + #include + + void experimental_filter_scalar(short*, short*, unsigned); + void experimental_filter_vector(short*, short*, unsigned); + void init_channel(short*, unsigned); + int compare_channels(short *ch1, short *ch2, unsigned); + + short *scalar_left, *scalar_right; + short *vector_left, *vector_right; + + #define CHANNEL_SIZE 1152 + #define ARRAY_SIZE CHANNEL_SIZE*sizeof(short) + + void run(long *scalar_time, long *vector_time) { + struct tms buf_s, buf_e; + unsigned i; + + scalar_left = _malloc(ARRAY_SIZE); + scalar_right = _malloc(ARRAY_SIZE); + vector_left = _malloc(ARRAY_SIZE); + vector_right = _malloc(ARRAY_SIZE); + + init_channel(scalar_left, CHANNEL_SIZE); + init_channel(scalar_right, CHANNEL_SIZE); + + times(&buf_s); + for (i = 0; i < 1000000; ++i) + experimental_filter_scalar(scalar_left, scalar_right, CHANNEL_SIZE); + times(&buf_e); + *scalar_time = buf_e.tms_utime - buf_s.tms_utime; + printf("scalar time=%d, ", *scalar_time); + + init_channel(vector_left, CHANNEL_SIZE); + init_channel(vector_right, CHANNEL_SIZE); + + times(&buf_s); + for (i = 0; i < 1000000; ++i) + experimental_filter_vector(vector_left, vector_right, CHANNEL_SIZE); + times(&buf_e); + *vector_time = buf_e.tms_utime - buf_s.tms_utime; + printf("vector time=%d, ", *vector_time); + + float speedup = (float) *scalar_time / *vector_time; + printf("speedup=%f\n", speedup); + + if (!compare_channels(scalar_left, vector_left, CHANNEL_SIZE) || + !compare_channels(scalar_right, vector_right, CHANNEL_SIZE)) { + printf("FAILED\n"); + exit(1); + } + + } + + int + main (void) { + unsigned i; + + long best_scalar = -1, best_vector = -1; + long scalar, vector; + for (i = 0; i < NRUNS; ++i) { + run (&scalar, &vector); + if (best_scalar < 0 || best_scalar > scalar) + best_scalar = scalar; + if (best_vector < 0 || best_vector > vector) + best_vector = vector; + } + + printf("best scalar=%d, ", best_scalar); + printf("best vector=%d, ", best_vector); + printf("speedup=%f\n", ((float) best_scalar)/best_vector); + printf ("PASSED\n"); + return 0; + } + + void init_channel(short *channel, unsigned n) { + unsigned i, j; + for (i = 0; i < n; ++i) + channel[i] = i; + } + + int compare_channels(short *ch1, short *ch2, unsigned n) { + unsigned i, j; + for (i = 0; i < n; ++i) + if(ch1[i] != ch2[i]) + return 0; + return 1; + } + + void experimental_filter_scalar(short *left_ch, short *right_ch, unsigned n) { + unsigned int i, j; + + for (i = 0; i < n; ++i) { + short left, right; + + left = left_ch[i]; + right = right_ch[i]; + right_ch[i] -= left >> 2; + left_ch[i] -= right >> 2; + } + } + From bocchino at persephone.cs.uiuc.edu Sun Oct 23 17:50:24 2005 From: bocchino at persephone.cs.uiuc.edu (Robert L. Bocchino Jr.) Date: Sun, 23 Oct 2005 17:50:24 -0500 (CDT) Subject: [llvm-commits] [vector_llvm] CVS: llvm/examples/SIMD/Transpose/Makefile main.c transpose.altivec.handwritten.c transpose.sse.handwritten.c transpose.vectorc.c Message-ID: <20051023225024.9D4A717FABD0@persephone.cs.uiuc.edu> Changes in directory llvm/examples/SIMD/Transpose: Makefile added (r1.1.2.1) main.c added (r1.1.2.1) transpose.altivec.handwritten.c added (r1.1.2.1) transpose.sse.handwritten.c added (r1.1.2.1) transpose.vectorc.c added (r1.1.2.1) --- Log message: Examples to illustrate Vector LLVM's SIMD support. --- Diffs of the changes: (+226 -0) Makefile | 4 + main.c | 98 ++++++++++++++++++++++++++++++++++++++++ transpose.altivec.handwritten.c | 44 +++++++++++++++++ transpose.sse.handwritten.c | 38 +++++++++++++++ transpose.vectorc.c | 42 +++++++++++++++++ 5 files changed, 226 insertions Index: llvm/examples/SIMD/Transpose/Makefile diff -c /dev/null llvm/examples/SIMD/Transpose/Makefile:1.1.2.1 *** /dev/null Sun Oct 23 17:50:00 2005 --- llvm/examples/SIMD/Transpose/Makefile Sun Oct 23 17:49:42 2005 *************** *** 0 **** --- 1,4 ---- + NAME= transpose + + include ../Makefile.common + Index: llvm/examples/SIMD/Transpose/main.c diff -c /dev/null llvm/examples/SIMD/Transpose/main.c:1.1.2.1 *** /dev/null Sun Oct 23 17:50:24 2005 --- llvm/examples/SIMD/Transpose/main.c Sun Oct 23 17:49:42 2005 *************** *** 0 **** --- 1,98 ---- + #define N 1024 + + #include + #include + #include + #include + #include + #include "../_malloc.h" + + inline void transpose_scalar(short*, short*); + void transpose_vector(short*, short*); + + short *in; + short *out_vector; + short *out_scalar; + + void init() { + int i; + + // Force 16-byte alignment + // + in = (short*) _malloc(N*sizeof(short)); + out_vector = (short*) _malloc(N*sizeof(short)); + out_scalar = (short*) _malloc(N*sizeof(short)); + + // Populate in with a range of values + // + for (i = 0; i < N; ++i) { + in[i] = N/2-i; + } + + } + + float run() { + long t0, t1, t2; + int i,j; + struct tms buf_s, buf_e; + long scalar_time = 0, vector_time = 0; + + times(&buf_s); + for (i = 0; i < 1000000; ++i) + for (j = 0; j < N/64; ++j) + transpose_scalar(in+64*j, out_scalar+64*j); + times(&buf_e); + scalar_time = buf_e.tms_utime - buf_s.tms_utime; + printf("scalar time=%d, ", scalar_time); + + times(&buf_s); + for (i = 0; i < 1000000; ++i) + for (j = 0; j < N/64; ++j) + transpose_vector(in+64*j, out_vector+64*j); + times(&buf_e); + vector_time = buf_e.tms_utime - buf_s.tms_utime; + printf("vector time=%d, ", vector_time); + + float speedup = ((float) scalar_time)/vector_time; + printf("speedup=%f\n", speedup); + + for (i = 0; i < N; i++) { + if (out_vector[i] != out_scalar[i]) { + printf("FAILED\n"); + exit(1); + } + } + + return speedup; + } + + int + main (void) + { + unsigned i; + init(); + float best = 0; + for (i = 0; i < NRUNS; ++i) { + float speedup = run(); + if (speedup > best) + best = speedup; + } + printf("best speedup=%f\n", best); + + printf ("PASSED\n"); + return 0; + } + + void transpose_scalar ( short *input_scalar, short *output_scalar) { + unsigned i; + for (i = 0; i < 8; ++i) { + output_scalar[i] = input_scalar[8*i]; + output_scalar[8+i] = input_scalar[8*i+1]; + output_scalar[16+i] = input_scalar[8*i+2]; + output_scalar[24+i] = input_scalar[8*i+3]; + output_scalar[32+i] = input_scalar[8*i+4]; + output_scalar[40+i] = input_scalar[8*i+5]; + output_scalar[48+i] = input_scalar[8*i+6]; + output_scalar[56+i] = input_scalar[8*i+7]; + } + } Index: llvm/examples/SIMD/Transpose/transpose.altivec.handwritten.c diff -c /dev/null llvm/examples/SIMD/Transpose/transpose.altivec.handwritten.c:1.1.2.1 *** /dev/null Sun Oct 23 17:50:24 2005 --- llvm/examples/SIMD/Transpose/transpose.altivec.handwritten.c Sun Oct 23 17:49:42 2005 *************** *** 0 **** --- 1,44 ---- + void print_vector(vector short v) { + unsigned i; + short *p = ((short*) &v); + for (i = 0; i < 8; ++i) + printf("%04X ", p[i]); + printf("\n"); + } + + inline void transpose_vector ( short *input_scalar, short *output_scalar) + { + vector signed short *input = (vector signed short*) input_scalar; + vector signed short *output = (vector signed short*) output_scalar; + + vector signed short a0, a1, a2, a3, a4, a5, a6, a7; + vector signed short b0, b1, b2, b3, b4, b5, b6, b7; + + b0 = vec_mergeh( input[0], input[4] ); /* [ 00 40 01 41 02 42 03 43 ]*/ + b1 = vec_mergel( input[0], input[4] ); /* [ 04 44 05 45 06 46 07 47 ]*/ + b2 = vec_mergeh( input[1], input[5] ); /* [ 10 50 11 51 12 52 13 53 ]*/ + b3 = vec_mergel( input[1], input[5] ); /* [ 14 54 15 55 16 56 17 57 ]*/ + b4 = vec_mergeh( input[2], input[6] ); /* [ 20 60 21 61 22 62 23 63 ]*/ + b5 = vec_mergel( input[2], input[6] ); /* [ 24 64 25 65 26 66 27 67 ]*/ + b6 = vec_mergeh( input[3], input[7] ); /* [ 30 70 31 71 32 72 33 73 ]*/ + b7 = vec_mergel( input[3], input[7] ); /* [ 34 74 35 75 36 76 37 77 ]*/ + + a0 = vec_mergeh( b0, b4 ); /* [ 00 20 40 60 01 21 41 61 ]*/ + a1 = vec_mergel( b0, b4 ); /* [ 02 22 42 62 03 23 43 63 ]*/ + a2 = vec_mergeh( b1, b5 ); /* [ 04 24 44 64 05 25 45 65 ]*/ + a3 = vec_mergel( b1, b5 ); /* [ 06 26 46 66 07 27 47 67 ]*/ + a4 = vec_mergeh( b2, b6 ); /* [ 10 30 50 70 11 31 51 71 ]*/ + a5 = vec_mergel( b2, b6 ); /* [ 12 32 52 72 13 33 53 73 ]*/ + a6 = vec_mergeh( b3, b7 ); /* [ 14 34 54 74 15 35 55 75 ]*/ + a7 = vec_mergel( b3, b7 ); /* [ 16 36 56 76 17 37 57 77 ]*/ + + output[0] = vec_mergeh( a0, a4 ); /* [ 00 10 20 30 40 50 60 70 ]*/ + output[1] = vec_mergel( a0, a4 ); /* [ 01 11 21 31 41 51 61 71 ]*/ + output[2] = vec_mergeh( a1, a5 ); /* [ 02 12 22 32 42 52 62 72 ]*/ + output[3] = vec_mergel( a1, a5 ); /* [ 03 13 23 33 43 53 63 73 ]*/ + output[4] = vec_mergeh( a2, a6 ); /* [ 04 14 24 34 44 54 64 74 ]*/ + output[5] = vec_mergel( a2, a6 ); /* [ 05 15 25 35 45 55 65 75 ]*/ + output[6] = vec_mergeh( a3, a7 ); /* [ 06 16 26 36 46 56 66 76 ]*/ + output[7] = vec_mergel( a3, a7 ); /* [ 07 17 27 37 47 57 67 77 ]*/ + + } Index: llvm/examples/SIMD/Transpose/transpose.sse.handwritten.c diff -c /dev/null llvm/examples/SIMD/Transpose/transpose.sse.handwritten.c:1.1.2.1 *** /dev/null Sun Oct 23 17:50:24 2005 --- llvm/examples/SIMD/Transpose/transpose.sse.handwritten.c Sun Oct 23 17:49:42 2005 *************** *** 0 **** --- 1,38 ---- + #include "SSE.h" + + inline void transpose_vector ( short *input_scalar, short *output_scalar) + { + __m128i *input = (__m128i*) input_scalar; + __m128i *output = (__m128i*) output_scalar; + + __m128i a0, a1, a2, a3, a4, a5, a6, a7; + __m128i b0, b1, b2, b3, b4, b5, b6, b7; + + b0 = _mm_unpacklo_epi16( input[0], input[4] ); /* [ 00 40 01 41 02 42 03 43 ]*/ + b1 = _mm_unpackhi_epi16( input[0], input[4] ); /* [ 04 44 05 45 06 46 07 47 ]*/ + b2 = _mm_unpacklo_epi16( input[1], input[5] ); /* [ 10 50 11 51 12 52 13 53 ]*/ + b3 = _mm_unpackhi_epi16( input[1], input[5] ); /* [ 14 54 15 55 16 56 17 57 ]*/ + b4 = _mm_unpacklo_epi16( input[2], input[6] ); /* [ 20 60 21 61 22 62 23 63 ]*/ + b5 = _mm_unpackhi_epi16( input[2], input[6] ); /* [ 24 64 25 65 26 66 27 67 ]*/ + b6 = _mm_unpacklo_epi16( input[3], input[7] ); /* [ 30 70 31 71 32 72 33 73 ]*/ + b7 = _mm_unpackhi_epi16( input[3], input[7] ); /* [ 34 74 35 75 36 76 37 77 ]*/ + + a0 = _mm_unpacklo_epi16( b0, b4 ); /* [ 00 20 40 60 01 21 41 61 ]*/ + a1 = _mm_unpackhi_epi16( b0, b4 ); /* [ 02 22 42 62 03 23 43 63 ]*/ + a2 = _mm_unpacklo_epi16( b1, b5 ); /* [ 04 24 44 64 05 25 45 65 ]*/ + a3 = _mm_unpackhi_epi16( b1, b5 ); /* [ 06 26 46 66 07 27 47 67 ]*/ + a4 = _mm_unpacklo_epi16( b2, b6 ); /* [ 10 30 50 70 11 31 51 71 ]*/ + a5 = _mm_unpackhi_epi16( b2, b6 ); /* [ 12 32 52 72 13 33 53 73 ]*/ + a6 = _mm_unpacklo_epi16( b3, b7 ); /* [ 14 34 54 74 15 35 55 75 ]*/ + a7 = _mm_unpackhi_epi16( b3, b7 ); /* [ 16 36 56 76 17 37 57 77 ]*/ + + output[0] = _mm_unpacklo_epi16( a0, a4 ); /* [ 00 10 20 30 40 50 60 70 ]*/ + output[1] = _mm_unpackhi_epi16( a0, a4 ); /* [ 01 11 21 31 41 51 61 71 ]*/ + output[2] = _mm_unpacklo_epi16( a1, a5 ); /* [ 02 12 22 32 42 52 62 72 ]*/ + output[3] = _mm_unpackhi_epi16( a1, a5 ); /* [ 03 13 23 33 43 53 63 73 ]*/ + output[4] = _mm_unpacklo_epi16( a2, a6 ); /* [ 04 14 24 34 44 54 64 74 ]*/ + output[5] = _mm_unpackhi_epi16( a2, a6 ); /* [ 05 15 25 35 45 55 65 75 ]*/ + output[6] = _mm_unpacklo_epi16( a3, a7 ); /* [ 06 16 26 36 46 56 66 76 ]*/ + output[7] = _mm_unpackhi_epi16( a3, a7 ); /* [ 07 17 27 37 47 57 67 77 ]*/ + + } Index: llvm/examples/SIMD/Transpose/transpose.vectorc.c diff -c /dev/null llvm/examples/SIMD/Transpose/transpose.vectorc.c:1.1.2.1 *** /dev/null Sun Oct 23 17:50:24 2005 --- llvm/examples/SIMD/Transpose/transpose.vectorc.c Sun Oct 23 17:49:42 2005 *************** *** 0 **** --- 1,42 ---- + #include "VectorC.h" + + #define MERGE(out01, out0, out1, in0, in1) \ + short out01 = vllvm_fixed_vimm_short(0, 16); \ + out01 = vllvm_fixed_combine_short(out01, 16, in0, 8, 0, 1); \ + out01 = vllvm_fixed_combine_short(out01, 16, in1, 8, 8, 1); \ + short out0 = vllvm_extract_short(out01, 0, 2, 8); \ + short out1 = vllvm_extract_short(out01, 1, 2, 8) + + #define IN(x) \ + vllvm_load_short(input_scalar, 8, x) + + #define STORE(out, idx) \ + vllvm_store_short(out, output_scalar, idx) + + inline void transpose_vector (short *input_scalar, short *output_scalar) { + MERGE(b01, b0, b1, IN(0), IN(4)); + MERGE(b23, b2, b3, IN(1), IN(5)); + MERGE(b45, b4, b5, IN(2), IN(6)); + MERGE(b67, b6, b7, IN(3), IN(7)); + + MERGE(a01, a0, a1, b0, b4); + MERGE(a23, a2, a3, b1, b5); + MERGE(a45, a4, a5, b2, b6); + MERGE(a67, a6, a7, b3, b7); + + MERGE(out01, out0, out1, a0, a4); + MERGE(out23, out2, out3, a1, a5); + MERGE(out45, out4, out5, a2, a6); + MERGE(out67, out6, out7, a3, a7); + + STORE(out0, 0); + STORE(out1, 1); + STORE(out2, 2); + STORE(out3, 3); + STORE(out4, 4); + STORE(out5, 5); + STORE(out6, 6); + STORE(out7, 7); + + } + From bocchino at persephone.cs.uiuc.edu Sun Oct 23 17:50:25 2005 From: bocchino at persephone.cs.uiuc.edu (Robert L. Bocchino Jr.) Date: Sun, 23 Oct 2005 17:50:25 -0500 (CDT) Subject: [llvm-commits] [vector_llvm] CVS: llvm/examples/SIMD/Saxpy/Makefile main.c saxpy.altivec.handwritten.c saxpy.h saxpy.sse.handwritten.c saxpy.vectorc.c Message-ID: <20051023225025.1E22A17FABE1@persephone.cs.uiuc.edu> Changes in directory llvm/examples/SIMD/Saxpy: Makefile added (r1.1.2.1) main.c added (r1.1.2.1) saxpy.altivec.handwritten.c added (r1.1.2.1) saxpy.h added (r1.1.2.1) saxpy.sse.handwritten.c added (r1.1.2.1) saxpy.vectorc.c added (r1.1.2.1) --- Log message: Examples to illustrate Vector LLVM's SIMD support. --- Diffs of the changes: (+132 -0) Makefile | 4 ++ main.c | 81 ++++++++++++++++++++++++++++++++++++++++++++ saxpy.altivec.handwritten.c | 12 ++++++ saxpy.h | 5 ++ saxpy.sse.handwritten.c | 16 ++++++++ saxpy.vectorc.c | 14 +++++++ 6 files changed, 132 insertions Index: llvm/examples/SIMD/Saxpy/Makefile diff -c /dev/null llvm/examples/SIMD/Saxpy/Makefile:1.1.2.1 *** /dev/null Sun Oct 23 17:50:00 2005 --- llvm/examples/SIMD/Saxpy/Makefile Sun Oct 23 17:49:41 2005 *************** *** 0 **** --- 1,4 ---- + NAME= saxpy + + include ../Makefile.common + Index: llvm/examples/SIMD/Saxpy/main.c diff -c /dev/null llvm/examples/SIMD/Saxpy/main.c:1.1.2.1 *** /dev/null Sun Oct 23 17:50:24 2005 --- llvm/examples/SIMD/Saxpy/main.c Sun Oct 23 17:49:41 2005 *************** *** 0 **** --- 1,81 ---- + #include + #include + #include + #include + #include + #include "../_malloc.h" + #include + + #include "saxpy.h" + + short *in1, *in2, *vector, *scalar; + + void init() { + unsigned i; + in1 = _malloc(N*sizeof(short)); + for (i = 0; i < N; ++i) + in1[i] = N/2 - i; + in2 = _malloc(N*sizeof(short)); + for (i = 0; i < N; ++i) + in2[i] = i - N/2; + vector = _malloc(N*sizeof(short)); + scalar = _malloc(N*sizeof(short)); + } + + void run(long *scalar_time, long *vector_time) { + unsigned i; + struct tms buf_s, buf_e; + + times(&buf_s); + for (i = 0; i < 1000000; ++i) + saxpy_scalar(scalar, in1, in2, A, N); + times(&buf_e); + *scalar_time = buf_e.tms_utime - buf_s.tms_utime; + printf("scalar time=%d, ", *scalar_time); + + times(&buf_s); + for (i = 0; i < 1000000; ++i) + saxpy_vector (vector, in1, in2, A, N); + times(&buf_e); + *vector_time = buf_e.tms_utime - buf_s.tms_utime; + printf("vector time=%d, ", *vector_time); + + for (i = 0; i < N; i++) { + if (vector[i] != scalar[i]) { + printf ("FAILED\n"); + exit(1); + } + } + + float speedup = ((float) *scalar_time) / *vector_time; + printf("speedup=%f\n", speedup); + + } + + int + main (void) { + unsigned i; + init(); + + long best_scalar = -1, best_vector = -1; + long scalar, vector; + for (i = 0; i < NRUNS; ++i) { + run (&scalar, &vector); + if (best_scalar < 0 || best_scalar > scalar) + best_scalar = scalar; + if (best_vector < 0 || best_vector > vector) + best_vector = vector; + } + + printf("best scalar=%d, ", best_scalar); + printf("best vector=%d, ", best_vector); + printf("speedup=%f\n", ((float) best_scalar)/best_vector); + printf ("PASSED\n"); + return 0; + } + + void saxpy_scalar (short *z, const short *x, const short *y, short a, unsigned n) { + int i; + for (i = 0; i < n; ++i) + *z++ = a * *x++ + *y++; + } Index: llvm/examples/SIMD/Saxpy/saxpy.altivec.handwritten.c diff -c /dev/null llvm/examples/SIMD/Saxpy/saxpy.altivec.handwritten.c:1.1.2.1 *** /dev/null Sun Oct 23 17:50:24 2005 --- llvm/examples/SIMD/Saxpy/saxpy.altivec.handwritten.c Sun Oct 23 17:49:41 2005 *************** *** 0 **** --- 1,12 ---- + void saxpy_vector (vector short *z, const vector short *x, const vector short *y, + short a, unsigned n) { + unsigned i; + vector short a_vec; + *((short*) &a_vec) = a; + a_vec = vec_splat(a_vec, 0); + + for (i = 0; i < n/8; ++i) + *z++ = vec_mladd(a_vec, *x++, *y++); + + } + Index: llvm/examples/SIMD/Saxpy/saxpy.h diff -c /dev/null llvm/examples/SIMD/Saxpy/saxpy.h:1.1.2.1 *** /dev/null Sun Oct 23 17:50:24 2005 --- llvm/examples/SIMD/Saxpy/saxpy.h Sun Oct 23 17:49:41 2005 *************** *** 0 **** --- 1,5 ---- + #define N 1024 + #define A 10 + + void saxpy_vector(short *z, const short *x, const short *y, short a, unsigned n); + void saxpy_scalar(short *z, const short *x, const short *y, short a, unsigned n); Index: llvm/examples/SIMD/Saxpy/saxpy.sse.handwritten.c diff -c /dev/null llvm/examples/SIMD/Saxpy/saxpy.sse.handwritten.c:1.1.2.1 *** /dev/null Sun Oct 23 17:50:24 2005 --- llvm/examples/SIMD/Saxpy/saxpy.sse.handwritten.c Sun Oct 23 17:49:42 2005 *************** *** 0 **** --- 1,16 ---- + #include "SSE.h" + + void saxpy_vector(short *z, short *x, short *y, short a, unsigned n) { + __m128i* x_ptr = (__m128i*) x; + __m128i* y_ptr = (__m128i*) y; + __m128i* z_ptr = (__m128i*) z; + __m128i a_vec = _mm_splat_epi16(a); + int i; + for (i = 0; i < n/8; ++i) { + __m128i x_vec = x_ptr[i]; + __m128i y_vec = y_ptr[i]; + __m128i z_vec = _mm_add_epi16( _mm_mullo_epi16(x_vec,a_vec),y_vec); + z_ptr[i] = z_vec; + } + } + Index: llvm/examples/SIMD/Saxpy/saxpy.vectorc.c diff -c /dev/null llvm/examples/SIMD/Saxpy/saxpy.vectorc.c:1.1.2.1 *** /dev/null Sun Oct 23 17:50:25 2005 --- llvm/examples/SIMD/Saxpy/saxpy.vectorc.c Sun Oct 23 17:49:42 2005 *************** *** 0 **** --- 1,14 ---- + #include "VectorC.h" + + void saxpy_vector(short *z, short *x, short *y, + short a, unsigned n) { + short a_vec = vllvm_fixed_vimm_short(a,8); + int i; + for (i = 0; i < n/8; ++i) { + short x_vec = vllvm_load_short(x, 8, i); + short y_vec = vllvm_load_short(y, 8, i); + short z_vec = a_vec * x_vec + y_vec; + vllvm_store_short(z_vec, z, i); + } + } + From lattner at cs.uiuc.edu Sun Oct 23 18:54:08 2005 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sun, 23 Oct 2005 18:54:08 -0500 Subject: [llvm-commits] CVS: llvm-www/pubs/2005-03-14-ACP4IS-AspectsKernel.html 2005-03-14-ACP4IS-AspectsKernel.pdf index.html Message-ID: <200510232354.SAA24944@zion.cs.uiuc.edu> Changes in directory llvm-www/pubs: 2005-03-14-ACP4IS-AspectsKernel.html added (r1.1) 2005-03-14-ACP4IS-AspectsKernel.pdf added (r1.1) index.html updated: 1.29 -> 1.30 --- Log message: Add another paper --- Diffs of the changes: (+57 -0) 2005-03-14-ACP4IS-AspectsKernel.html | 50 +++++++++++++++++++++++++++++++++++ 2005-03-14-ACP4IS-AspectsKernel.pdf | 0 index.html | 7 ++++ 3 files changed, 57 insertions(+) Index: llvm-www/pubs/2005-03-14-ACP4IS-AspectsKernel.html diff -c /dev/null llvm-www/pubs/2005-03-14-ACP4IS-AspectsKernel.html:1.1 *** /dev/null Sun Oct 23 18:54:06 2005 --- llvm-www/pubs/2005-03-14-ACP4IS-AspectsKernel.html Sun Oct 23 18:53:56 2005 *************** *** 0 **** --- 1,50 ---- + + + + + + Using a Low-Level Virtual Machine to Improve Dynamic Aspect Support in Operating System Kernels + + + +
        + Using a Low-Level Virtual Machine to Improve Dynamic Aspect Support in + Operating System Kernels
        +
        + Michael Engel and Bernd Freisleben +
        + + +

        Abstract:

        +
        + +

        Current implementations of software providing dynamic aspect functionality in operating system (OS) kernels are quite + restricted in the possible joinpoint types for native code they + are able to support. Most of the pro jects implementing advice for native code use basic technologies adopted from instrumentation methods which allow to provide before, after + and around joinpoints for functions. More elaborate join-points, however, are not available since support for monitoring native code execution in current CPUs is very restricted + without extensive extensions of the compiler toolchain. To + realize improved ways of aspect activation in OS kernels, we + present an architecture that provides an efficient low-level + virtual machine running on top of a microkernel system in + cooperation with an aspect deployment service to provide + novel ways of aspect activation in kernel environments. +

        +
        + +

        Published:

        +
        + "Using a Low-Level Virtual Machine to Improve Dynamic Aspect Support in + Operating System Kernels"
        + By Michael Engel and Bernd Freisleben.
        + Proceedings of the 4th AOSD Workshop on Aspects, Components, and Patterns + for Infrastructure Software (ACP4IS), March 14-18, Chicago, 2005 +
        + +

        Download:

        + + + + Index: llvm-www/pubs/2005-03-14-ACP4IS-AspectsKernel.pdf Index: llvm-www/pubs/index.html diff -u llvm-www/pubs/index.html:1.29 llvm-www/pubs/index.html:1.30 --- llvm-www/pubs/index.html:1.29 Sun Oct 23 13:03:03 2005 +++ llvm-www/pubs/index.html Sun Oct 23 18:53:56 2005 @@ -70,6 +70,13 @@ ACM Workshop on Memory System Performance (MSP'05)
        , Chicago, Illinois, June, 2005.
      3. +
      4. Using a Low-Level Virtual + Machine to Improve Dynamic Aspect Support in Operating System Kernels
        + By Michael Engel and Bernd Freisleben. +Proceedings of the 4th AOSD Workshop on Aspects, Components, and Patterns for + Infrastructure Software (ACP4IS), March 14-18, Chicago, 2005 +
      5. +
      6. "Memory Safety Without Garbage Collection for Embedded Applications"
        Dinakar Dhurjati, Sumant Kowshik, Vikram Adve and Chris Lattner
        From lattner at cs.uiuc.edu Sun Oct 23 18:55:08 2005 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sun, 23 Oct 2005 18:55:08 -0500 Subject: [llvm-commits] CVS: llvm/lib/ExecutionEngine/ExecutionEngine.cpp Message-ID: <200510232355.SAA25008@zion.cs.uiuc.edu> Changes in directory llvm/lib/ExecutionEngine: ExecutionEngine.cpp updated: 1.71 -> 1.72 --- Log message: Fix a nasty bug that was causing miscompilation of global variables on big endian 32-bit targets in some cases (e.g. PPC). This fixes several PPC JIT failures. --- Diffs of the changes: (+4 -1) ExecutionEngine.cpp | 5 ++++- 1 files changed, 4 insertions(+), 1 deletion(-) Index: llvm/lib/ExecutionEngine/ExecutionEngine.cpp diff -u llvm/lib/ExecutionEngine/ExecutionEngine.cpp:1.71 llvm/lib/ExecutionEngine/ExecutionEngine.cpp:1.72 --- llvm/lib/ExecutionEngine/ExecutionEngine.cpp:1.71 Tue Jul 12 10:51:55 2005 +++ llvm/lib/ExecutionEngine/ExecutionEngine.cpp Sun Oct 23 18:54:56 2005 @@ -189,7 +189,10 @@ uint64_t Offset = TD->getIndexedOffset(CE->getOperand(0)->getType(), Indexes); - Result.LongVal += Offset; + if (getTargetData().getPointerSize() == 4) + Result.IntVal += Offset; + else + Result.LongVal += Offset; return Result; } case Instruction::Cast: { From lattner at cs.uiuc.edu Sun Oct 23 18:59:24 2005 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sun, 23 Oct 2005 18:59:24 -0500 Subject: [llvm-commits] CVS: llvm-www/pubs/index.html Message-ID: <200510232359.SAA25065@zion.cs.uiuc.edu> Changes in directory llvm-www/pubs: index.html updated: 1.30 -> 1.31 --- Log message: add a missing
        --- Diffs of the changes: (+8 -8) index.html | 16 ++++++++-------- 1 files changed, 8 insertions(+), 8 deletions(-) Index: llvm-www/pubs/index.html diff -u llvm-www/pubs/index.html:1.30 llvm-www/pubs/index.html:1.31 --- llvm-www/pubs/index.html:1.30 Sun Oct 23 18:53:56 2005 +++ llvm-www/pubs/index.html Sun Oct 23 18:59:11 2005 @@ -15,7 +15,7 @@
      7. "LLVA: A Low-level Virtual Instruction Set Architecture"
        Vikram Adve, Chris Lattner, Michael Brukman, Anand Shukla, -and Brian Gaeke
        Proceedings of the +and Brian Gaeke
        Proc. of the 36th annual ACM/IEEE international symposium on Microarchitecture (MICRO-36), San Diego, CA, December 2003.
      8. @@ -38,14 +38,14 @@ Allocation: A Study of the Chaitin-Briggs and Callahan-Koblenz Algorithms"
        By Keith Cooper, Anshuman Dasgupta, and Jason Eckhardt.
        - Proceedings of the Workshop on Languages and Compilers for Parallel + Proc. of the Workshop on Languages and Compilers for Parallel Computing (LCPC'05), Hawthorne, NY, October 20-22, 2005
      9. "Segment Protection for Embedded Systems Using Run-time Checks"
        By Matthew Simpson, Bhuvan Middha and Rajeev Barua
        Proc. of the ACM International Conference on Compilers, - Architecture, and Synthesis for Embedded Systems (CASES), + Architecture, and Synthesis for Embedded Systems (CASES'05)
        , San Francisco, CA, September, 2005
      10. "An Implementation of Swing Modulo Scheduling with Extensions for Superblocks"
        @@ -66,15 +66,15 @@
      11. "Transparent Pointer Compression for Linked Data Structures"
        -Chris Lattner and Vikram Adve
        Proceedings of the +Chris Lattner and Vikram Adve
        Proc. of the ACM Workshop on Memory System Performance (MSP'05), Chicago, Illinois, June, 2005.
      12. Using a Low-Level Virtual Machine to Improve Dynamic Aspect Support in Operating System Kernels
        - By Michael Engel and Bernd Freisleben. -Proceedings of the 4th AOSD Workshop on Aspects, Components, and Patterns for - Infrastructure Software (ACP4IS), March 14-18, Chicago, 2005 + By Michael Engel and Bernd Freisleben.
        +Proc. of the 4th AOSD Workshop on Aspects, Components, and Patterns for + Infrastructure Software (ACP4IS'05), March 14-18, Chicago, 2005
      13. "Memory Safety Without @@ -109,7 +109,7 @@
      14. "Memory Safety Without Runtime Checks or Garbage Collection"
        Dinakar Dhurjati, Sumant Kowshik, Vikram -Adve and Chris Lattner
        Proceedings of +Adve and Chris Lattner
        Proc. of Languages Compilers and Tools for Embedded Systems 2003 (LCTES 03), San Diego, CA, June 2003.
      15. From lattner at cs.uiuc.edu Sun Oct 23 19:09:02 2005 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sun, 23 Oct 2005 19:09:02 -0500 Subject: [llvm-commits] CVS: llvm/include/llvm/Transforms/LinkAllPasses.h Message-ID: <200510240009.TAA25173@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm/Transforms: LinkAllPasses.h updated: 1.20 -> 1.21 --- Log message: There is no need for this to be VC++ only --- Diffs of the changes: (+6 -15) LinkAllPasses.h | 21 ++++++--------------- 1 files changed, 6 insertions(+), 15 deletions(-) Index: llvm/include/llvm/Transforms/LinkAllPasses.h diff -u llvm/include/llvm/Transforms/LinkAllPasses.h:1.20 llvm/include/llvm/Transforms/LinkAllPasses.h:1.21 --- llvm/include/llvm/Transforms/LinkAllPasses.h:1.20 Tue Oct 18 20:41:47 2005 +++ llvm/include/llvm/Transforms/LinkAllPasses.h Sun Oct 23 19:08:51 2005 @@ -7,17 +7,14 @@ // //===----------------------------------------------------------------------===// // -// This header file is required for building with Microsoft's VC++, as it has -// no way of linking all registered passes into executables other than by -// explicit use. +// This header file pulls in all transformation passes for tools like opts and +// bugpoint that need this functionality. // //===----------------------------------------------------------------------===// #ifndef LLVM_TRANSFORMS_LINKALLPASSES_H #define LLVM_TRANSFORMS_LINKALLPASSES_H -#ifdef _MSC_VER - #include "llvm/Analysis/Passes.h" #include "llvm/Analysis/LoadValueNumbering.h" #include "llvm/CodeGen/Passes.h" @@ -25,20 +22,16 @@ #include "llvm/Transforms/IPO.h" #include "llvm/Transforms/Scalar.h" #include "llvm/Transforms/Utils/UnifyFunctionExitNodes.h" - -// Trying not to include , though maybe we should... Problem is, -// it pollutes the global namespace in some really nasty ways. -extern "C" __declspec(dllimport) void* __stdcall GetCurrentProcess(); +#include namespace { struct ForcePassLinking { ForcePassLinking() { - // We must reference the passes in such a way that VC++ will not + // We must reference the passes in such a way that compilers will not // delete it all as dead code, even with whole program optimization, // yet is effectively a NO-OP. As the compiler isn't smart enough - // to know that GetCurrentProcess() never returns - // INVALID_HANDLE_VALUE, this will do the job. - if (GetCurrentProcess() != (void *) -1) + // to know that getenv() never returns -1, this will do the job. + if (std::getenv("bar") != (char*) -1) return; (void) llvm::createAAEvalPass(); @@ -120,6 +113,4 @@ } _ForcePassLinking; }; -#endif // _MSC_VER - #endif From lattner at cs.uiuc.edu Sun Oct 23 19:12:32 2005 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sun, 23 Oct 2005 19:12:32 -0500 Subject: [llvm-commits] CVS: llvm/tools/opt/Makefile Message-ID: <200510240012.TAA25283@zion.cs.uiuc.edu> Changes in directory llvm/tools/opt: Makefile updated: 1.49 -> 1.50 --- Log message: Use archive versions of these libraries, using the LinkAllPasses header. --- Diffs of the changes: (+3 -3) Makefile | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) Index: llvm/tools/opt/Makefile diff -u llvm/tools/opt/Makefile:1.49 llvm/tools/opt/Makefile:1.50 --- llvm/tools/opt/Makefile:1.49 Fri Apr 22 12:14:14 2005 +++ llvm/tools/opt/Makefile Sun Oct 23 19:12:20 2005 @@ -9,9 +9,9 @@ LEVEL = ../.. TOOLNAME = opt -USEDLIBS = LLVMBCReader LLVMBCWriter LLVMInstrumentation LLVMProfilePaths \ - LLVMScalarOpts LLVMipo LLVMipa LLVMDataStructure LLVMTransforms \ - LLVMTarget.a LLVMAnalysis LLVMTransformUtils LLVMCore LLVMSupport.a \ +USEDLIBS = LLVMBCReader LLVMBCWriter LLVMInstrumentation.a LLVMProfilePaths \ + LLVMScalarOpts.a LLVMipo.a LLVMipa.a LLVMDataStructure LLVMTransforms.a \ + LLVMTarget.a LLVMAnalysis.a LLVMTransformUtils.a LLVMCore LLVMSupport.a \ LLVMbzip2 LLVMSystem.a include $(LEVEL)/Makefile.common From lattner at cs.uiuc.edu Sun Oct 23 19:16:15 2005 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sun, 23 Oct 2005 19:16:15 -0500 Subject: [llvm-commits] CVS: llvm/include/llvm/Transforms/LinkAllPasses.h Message-ID: <200510240016.TAA25347@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm/Transforms: LinkAllPasses.h updated: 1.21 -> 1.22 --- Log message: Don't invade the system namespace --- Diffs of the changes: (+1 -1) LinkAllPasses.h | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm/include/llvm/Transforms/LinkAllPasses.h diff -u llvm/include/llvm/Transforms/LinkAllPasses.h:1.21 llvm/include/llvm/Transforms/LinkAllPasses.h:1.22 --- llvm/include/llvm/Transforms/LinkAllPasses.h:1.21 Sun Oct 23 19:08:51 2005 +++ llvm/include/llvm/Transforms/LinkAllPasses.h Sun Oct 23 19:16:03 2005 @@ -110,7 +110,7 @@ (void) llvm::createUnifyFunctionExitNodesPass(); (void) llvm::createCondPropagationPass(); } - } _ForcePassLinking; + } ForcePassLinking; }; #endif From lattner at cs.uiuc.edu Sun Oct 23 19:27:48 2005 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sun, 23 Oct 2005 19:27:48 -0500 Subject: [llvm-commits] CVS: llvm/lib/Analysis/IPA/PrintSCC.cpp Message-ID: <200510240027.TAA25521@zion.cs.uiuc.edu> Changes in directory llvm/lib/Analysis/IPA: PrintSCC.cpp (r1.14) removed --- Log message: move this to the analyze tool --- Diffs of the changes: (+0 -0) 0 files changed From lattner at cs.uiuc.edu Sun Oct 23 19:38:37 2005 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sun, 23 Oct 2005 19:38:37 -0500 Subject: [llvm-commits] CVS: llvm/include/llvm/Analysis/DataStructure/DataStructure.h Message-ID: <200510240038.TAA25647@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm/Analysis/DataStructure: DataStructure.h updated: 1.94 -> 1.95 --- Log message: add some prototypes --- Diffs of the changes: (+4 -0) DataStructure.h | 4 ++++ 1 files changed, 4 insertions(+) Index: llvm/include/llvm/Analysis/DataStructure/DataStructure.h diff -u llvm/include/llvm/Analysis/DataStructure/DataStructure.h:1.94 llvm/include/llvm/Analysis/DataStructure/DataStructure.h:1.95 --- llvm/include/llvm/Analysis/DataStructure/DataStructure.h:1.94 Thu Apr 21 15:18:05 2005 +++ llvm/include/llvm/Analysis/DataStructure/DataStructure.h Sun Oct 23 19:38:25 2005 @@ -31,6 +31,10 @@ class DSNode; class DSNodeHandle; +FunctionPass *createDataStructureStatsPass(); +FunctionPass *createDataStructureGraphCheckerPass(); + + // FIXME: move this stuff to a private header namespace DataStructureAnalysis { /// isPointerType - Return true if this first class type is big enough to hold From lattner at cs.uiuc.edu Sun Oct 23 19:38:49 2005 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sun, 23 Oct 2005 19:38:49 -0500 Subject: [llvm-commits] CVS: llvm/lib/Analysis/DataStructure/DataStructureStats.cpp GraphChecker.cpp Message-ID: <200510240038.TAA25659@zion.cs.uiuc.edu> Changes in directory llvm/lib/Analysis/DataStructure: DataStructureStats.cpp updated: 1.18 -> 1.19 GraphChecker.cpp updated: 1.18 -> 1.19 --- Log message: implement some prototypes --- Diffs of the changes: (+10 -0) DataStructureStats.cpp | 5 +++++ GraphChecker.cpp | 5 +++++ 2 files changed, 10 insertions(+) Index: llvm/lib/Analysis/DataStructure/DataStructureStats.cpp diff -u llvm/lib/Analysis/DataStructure/DataStructureStats.cpp:1.18 llvm/lib/Analysis/DataStructure/DataStructureStats.cpp:1.19 --- llvm/lib/Analysis/DataStructure/DataStructureStats.cpp:1.18 Thu Apr 21 16:07:28 2005 +++ llvm/lib/Analysis/DataStructure/DataStructureStats.cpp Sun Oct 23 19:38:38 2005 @@ -63,6 +63,11 @@ static RegisterAnalysis Z("dsstats", "DS Graph Statistics"); } +FunctionPass *llvm::createDataStructureStatsPass() { + return new DSGraphStats(); +} + + static bool isIndirectCallee(Value *V) { if (isa(V)) return false; Index: llvm/lib/Analysis/DataStructure/GraphChecker.cpp diff -u llvm/lib/Analysis/DataStructure/GraphChecker.cpp:1.18 llvm/lib/Analysis/DataStructure/GraphChecker.cpp:1.19 --- llvm/lib/Analysis/DataStructure/GraphChecker.cpp:1.18 Thu Apr 21 16:07:28 2005 +++ llvm/lib/Analysis/DataStructure/GraphChecker.cpp Sun Oct 23 19:38:38 2005 @@ -77,6 +77,11 @@ RegisterAnalysis X("datastructure-gc", "DSA Graph Checking Pass"); } +FunctionPass *llvm::createDataStructureGraphCheckerPass() { + return new DSGC(); +} + + DSGC::DSGC() { if (!AbortIfAnyCollapsed && AbortIfCollapsed.empty() && CheckFlags.empty() && AbortIfMerged.empty()) { From lattner at cs.uiuc.edu Sun Oct 23 20:00:00 2005 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sun, 23 Oct 2005 20:00:00 -0500 Subject: [llvm-commits] CVS: llvm/include/llvm/Analysis/LinkAllAnalyses.h Message-ID: <200510240100.UAA25854@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm/Analysis: LinkAllAnalyses.h added (r1.1) --- Log message: new header --- Diffs of the changes: (+64 -0) LinkAllAnalyses.h | 64 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 64 insertions(+) Index: llvm/include/llvm/Analysis/LinkAllAnalyses.h diff -c /dev/null llvm/include/llvm/Analysis/LinkAllAnalyses.h:1.1 *** /dev/null Sun Oct 23 19:59:59 2005 --- llvm/include/llvm/Analysis/LinkAllAnalyses.h Sun Oct 23 19:59:49 2005 *************** *** 0 **** --- 1,64 ---- + //===- LinkAllAnalyses.h - Reference All Analysis Passes --------*- C++ -*-===// + // + // The LLVM Compiler Infrastructure + // + // This file was developed by Chris Lattner and is distributed under the + // University of Illinois Open Source License. See LICENSE.TXT for details. + // + //===----------------------------------------------------------------------===// + // + // This header file pulls in all analysis passes for tools like analyze and + // bugpoint that need this functionality. + // + //===----------------------------------------------------------------------===// + + #ifndef LLVM_ANALYSIS_LINKALLANALYSES_H + #define LLVM_ANALYSIS_LINKALLANALYSES_H + + #include "llvm/Analysis/AliasSetTracker.h" + #include "llvm/Analysis/CallGraph.h" + #include "llvm/Analysis/FindUnsafePointerTypes.h" + #include "llvm/Analysis/FindUsedTypes.h" + #include "llvm/Analysis/IntervalPartition.h" + #include "llvm/Analysis/PostDominators.h" + #include "llvm/Analysis/Passes.h" + #include "llvm/Analysis/ScalarEvolution.h" + #include "llvm/Analysis/DataStructure/DataStructure.h" + #include "llvm/Function.h" + #include + + namespace { + struct ForceAnalysisPassLinking { + ForceAnalysisPassLinking() { + // We must reference the passes in such a way that compilers will not + // delete it all as dead code, even with whole program optimization, + // yet is effectively a NO-OP. As the compiler isn't smart enough + // to know that getenv() never returns -1, this will do the job. + if (std::getenv("bar") != (char*) -1) + return; + + (void)new llvm::LocalDataStructures(); + (void)new llvm::BUDataStructures(); + (void)new llvm::TDDataStructures(); + (void)new llvm::CompleteBUDataStructures(); + (void)new llvm::EquivClassGraphs(); + (void)llvm::createDataStructureStatsPass(); + (void)llvm::createDataStructureGraphCheckerPass(); + (void)llvm::createProfileLoaderPass(); + (void)llvm::createNoProfileInfoPass(); + (void)llvm::createInstCountPass(); + (void)new llvm::IntervalPartition(); + (void)new llvm::ImmediateDominators(); + (void)new llvm::PostDominatorSet(); + (void)new llvm::CallGraph(); + (void)new llvm::FindUsedTypes(); + (void)new llvm::FindUnsafePointerTypes(); + (void)new llvm::ScalarEvolution(); + ((llvm::Function*)0)->viewCFGOnly(); + llvm::AliasSetTracker X(*(llvm::AliasAnalysis*)0); + X.add((llvm::Value*)0, 0); // for -print-alias-sets + } + } ForceAnalysisPassLinking; + }; + + #endif From lattner at cs.uiuc.edu Sun Oct 23 20:00:24 2005 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sun, 23 Oct 2005 20:00:24 -0500 Subject: [llvm-commits] CVS: llvm/tools/analyze/Makefile analyze.cpp Message-ID: <200510240100.UAA25917@zion.cs.uiuc.edu> Changes in directory llvm/tools/analyze: Makefile updated: 1.26 -> 1.27 analyze.cpp updated: 1.64 -> 1.65 --- Log message: Use the new LinkAllAnalyses.h header instead of forcing passes to be in relinked object files --- Diffs of the changes: (+3 -1) Makefile | 3 ++- analyze.cpp | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) Index: llvm/tools/analyze/Makefile diff -u llvm/tools/analyze/Makefile:1.26 llvm/tools/analyze/Makefile:1.27 --- llvm/tools/analyze/Makefile:1.26 Fri Apr 22 12:14:14 2005 +++ llvm/tools/analyze/Makefile Sun Oct 23 20:00:13 2005 @@ -8,7 +8,8 @@ ##===----------------------------------------------------------------------===## LEVEL = ../.. TOOLNAME = analyze -USEDLIBS = LLVMAsmParser LLVMBCReader LLVMAnalysis LLVMipa LLVMDataStructure \ +USEDLIBS = LLVMAsmParser LLVMBCReader LLVMAnalysis.a LLVMipa.a \ + LLVMDataStructure.a \ LLVMScalarOpts.a LLVMTransforms.a LLVMTarget.a LLVMScalarOpts.a \ LLVMTransformUtils.a LLVMCore LLVMSupport.a LLVMbzip2 LLVMSystem.a Index: llvm/tools/analyze/analyze.cpp diff -u llvm/tools/analyze/analyze.cpp:1.64 llvm/tools/analyze/analyze.cpp:1.65 --- llvm/tools/analyze/analyze.cpp:1.64 Thu Apr 21 18:59:21 2005 +++ llvm/tools/analyze/analyze.cpp Sun Oct 23 20:00:13 2005 @@ -21,6 +21,7 @@ #include "llvm/Bytecode/Reader.h" #include "llvm/Assembly/Parser.h" #include "llvm/Analysis/Verifier.h" +#include "llvm/Analysis/LinkAllAnalyses.h" #include "llvm/Target/TargetData.h" #include "llvm/Support/PassNameParser.h" #include "llvm/System/Signals.h" From lattner at cs.uiuc.edu Sun Oct 23 20:00:43 2005 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sun, 23 Oct 2005 20:00:43 -0500 Subject: [llvm-commits] CVS: llvm/include/llvm/Analysis/Passes.h Message-ID: <200510240100.UAA25998@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm/Analysis: Passes.h updated: 1.6 -> 1.7 --- Log message: add a proto --- Diffs of the changes: (+4 -0) Passes.h | 4 ++++ 1 files changed, 4 insertions(+) Index: llvm/include/llvm/Analysis/Passes.h diff -u llvm/include/llvm/Analysis/Passes.h:1.6 llvm/include/llvm/Analysis/Passes.h:1.7 --- llvm/include/llvm/Analysis/Passes.h:1.6 Thu Apr 21 15:16:32 2005 +++ llvm/include/llvm/Analysis/Passes.h Sun Oct 23 20:00:32 2005 @@ -102,6 +102,10 @@ // simple context insensitive alias analysis. // ModulePass *createSteensgaardPass(); + + // Minor pass prototypes, allowing us to expose them through bugpoint and + // analyze. + FunctionPass *createInstCountPass(); } #endif From lattner at cs.uiuc.edu Sun Oct 23 20:00:56 2005 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sun, 23 Oct 2005 20:00:56 -0500 Subject: [llvm-commits] CVS: llvm/lib/Analysis/InstCount.cpp Message-ID: <200510240100.UAA26008@zion.cs.uiuc.edu> Changes in directory llvm/lib/Analysis: InstCount.cpp updated: 1.12 -> 1.13 --- Log message: expose a ctor --- Diffs of the changes: (+3 -0) InstCount.cpp | 3 +++ 1 files changed, 3 insertions(+) Index: llvm/lib/Analysis/InstCount.cpp diff -u llvm/lib/Analysis/InstCount.cpp:1.12 llvm/lib/Analysis/InstCount.cpp:1.13 --- llvm/lib/Analysis/InstCount.cpp:1.12 Thu Apr 21 16:04:58 2005 +++ llvm/lib/Analysis/InstCount.cpp Sun Oct 23 20:00:45 2005 @@ -11,6 +11,7 @@ // //===----------------------------------------------------------------------===// +#include "llvm/Analysis/Passes.h" #include "llvm/Pass.h" #include "llvm/Function.h" #include "llvm/Support/InstVisitor.h" @@ -57,6 +58,8 @@ "Counts the various types of Instructions"); } +FunctionPass *llvm::createInstCountPass() { return new InstCount(); } + // InstCount::run - This is the main Analysis entry point for a // function. // From lattner at cs.uiuc.edu Sun Oct 23 20:06:04 2005 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sun, 23 Oct 2005 20:06:04 -0500 Subject: [llvm-commits] CVS: llvm/tools/bugpoint/Makefile bugpoint.cpp Message-ID: <200510240106.UAA26080@zion.cs.uiuc.edu> Changes in directory llvm/tools/bugpoint: Makefile updated: 1.12 -> 1.13 bugpoint.cpp updated: 1.25 -> 1.26 --- Log message: Link to archive versions of libraries instead of the relinked ones --- Diffs of the changes: (+6 -4) Makefile | 8 ++++---- bugpoint.cpp | 2 ++ 2 files changed, 6 insertions(+), 4 deletions(-) Index: llvm/tools/bugpoint/Makefile diff -u llvm/tools/bugpoint/Makefile:1.12 llvm/tools/bugpoint/Makefile:1.13 --- llvm/tools/bugpoint/Makefile:1.12 Fri Apr 22 12:14:14 2005 +++ llvm/tools/bugpoint/Makefile Sun Oct 23 20:05:53 2005 @@ -10,11 +10,11 @@ TOOLNAME = bugpoint -OPTLIBS = LLVMTransforms LLVMInstrumentation LLVMProfilePaths -ANALIBS = LLVMDataStructure LLVMipa LLVMTarget.a +OPTLIBS = LLVMTransforms.a LLVMInstrumentation.a LLVMProfilePaths +ANALIBS = LLVMDataStructure LLVMipa.a LLVMTarget.a -USEDLIBS = LLVMipo LLVMScalarOpts LLVMAnalysis $(OPTLIBS) $(ANALIBS) \ - LLVMTransformUtils \ +USEDLIBS = LLVMipo.a LLVMScalarOpts.a $(OPTLIBS) $(ANALIBS) LLVMAnalysis.a \ + LLVMTransformUtils.a \ LLVMAsmParser LLVMLinker.a LLVMBCReader LLVMBCWriter \ LLVMCore LLVMSupport.a LLVMbzip2 LLVMSystem.a Index: llvm/tools/bugpoint/bugpoint.cpp diff -u llvm/tools/bugpoint/bugpoint.cpp:1.25 llvm/tools/bugpoint/bugpoint.cpp:1.26 --- llvm/tools/bugpoint/bugpoint.cpp:1.25 Mon Aug 1 21:16:17 2005 +++ llvm/tools/bugpoint/bugpoint.cpp Sun Oct 23 20:05:53 2005 @@ -14,6 +14,8 @@ //===----------------------------------------------------------------------===// #include "BugDriver.h" +#include "llvm/Analysis/LinkAllAnalyses.h" +#include "llvm/Transforms/LinkAllPasses.h" #include "llvm/Support/PassNameParser.h" #include "llvm/Support/ToolRunner.h" #include "llvm/Support/CommandLine.h" From lattner at cs.uiuc.edu Sun Oct 23 20:08:07 2005 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sun, 23 Oct 2005 20:08:07 -0500 Subject: [llvm-commits] CVS: llvm/tools/analyze/Makefile Message-ID: <200510240108.UAA26137@zion.cs.uiuc.edu> Changes in directory llvm/tools/analyze: Makefile updated: 1.27 -> 1.28 --- Log message: Link in datastructure as a relinked o file --- Diffs of the changes: (+1 -1) Makefile | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm/tools/analyze/Makefile diff -u llvm/tools/analyze/Makefile:1.27 llvm/tools/analyze/Makefile:1.28 --- llvm/tools/analyze/Makefile:1.27 Sun Oct 23 20:00:13 2005 +++ llvm/tools/analyze/Makefile Sun Oct 23 20:07:56 2005 @@ -9,7 +9,7 @@ LEVEL = ../.. TOOLNAME = analyze USEDLIBS = LLVMAsmParser LLVMBCReader LLVMAnalysis.a LLVMipa.a \ - LLVMDataStructure.a \ + LLVMDataStructure \ LLVMScalarOpts.a LLVMTransforms.a LLVMTarget.a LLVMScalarOpts.a \ LLVMTransformUtils.a LLVMCore LLVMSupport.a LLVMbzip2 LLVMSystem.a From lattner at cs.uiuc.edu Sun Oct 23 20:08:32 2005 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sun, 23 Oct 2005 20:08:32 -0500 Subject: [llvm-commits] CVS: llvm/lib/Analysis/DataStructure/Makefile Message-ID: <200510240108.UAA26194@zion.cs.uiuc.edu> Changes in directory llvm/lib/Analysis/DataStructure: Makefile updated: 1.4 -> 1.5 --- Log message: don't bother building the archive version of this library --- Diffs of the changes: (+1 -1) Makefile | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm/lib/Analysis/DataStructure/Makefile diff -u llvm/lib/Analysis/DataStructure/Makefile:1.4 llvm/lib/Analysis/DataStructure/Makefile:1.5 --- llvm/lib/Analysis/DataStructure/Makefile:1.4 Thu Oct 28 00:36:48 2004 +++ llvm/lib/Analysis/DataStructure/Makefile Sun Oct 23 20:08:20 2005 @@ -6,9 +6,9 @@ # the University of Illinois Open Source License. See LICENSE.TXT for details. # ##===----------------------------------------------------------------------===## + LEVEL = ../../.. LIBRARYNAME = LLVMDataStructure -BUILD_ARCHIVE = 1 include $(LEVEL)/Makefile.common From lattner at cs.uiuc.edu Sun Oct 23 20:12:26 2005 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sun, 23 Oct 2005 20:12:26 -0500 Subject: [llvm-commits] CVS: llvm/tools/gccas/Makefile Message-ID: <200510240112.UAA26234@zion.cs.uiuc.edu> Changes in directory llvm/tools/gccas: Makefile updated: 1.21 -> 1.22 --- Log message: Pull in the archive versions of these libs to reduce executable size --- Diffs of the changes: (+2 -2) Makefile | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) Index: llvm/tools/gccas/Makefile diff -u llvm/tools/gccas/Makefile:1.21 llvm/tools/gccas/Makefile:1.22 --- llvm/tools/gccas/Makefile:1.21 Sun Apr 24 12:43:37 2005 +++ llvm/tools/gccas/Makefile Sun Oct 23 20:12:14 2005 @@ -9,8 +9,8 @@ LEVEL = ../.. TOOLNAME = gccas -USEDLIBS = LLVMAsmParser LLVMBCWriter LLVMTransforms LLVMipo.a LLVMipa.a \ - LLVMScalarOpts LLVMAnalysis.a LLVMTarget.a LLVMTransformUtils \ +USEDLIBS = LLVMAsmParser LLVMBCWriter LLVMTransforms.a LLVMipo.a LLVMipa.a \ + LLVMScalarOpts.a LLVMAnalysis.a LLVMTarget.a LLVMTransformUtils.a \ LLVMCore LLVMSupport.a LLVMbzip2 LLVMSystem.a include $(LEVEL)/Makefile.common From lattner at cs.uiuc.edu Sun Oct 23 20:13:32 2005 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sun, 23 Oct 2005 20:13:32 -0500 Subject: [llvm-commits] CVS: llvm/tools/llc/Makefile Message-ID: <200510240113.UAA26267@zion.cs.uiuc.edu> Changes in directory llvm/tools/llc: Makefile updated: 1.73 -> 1.74 --- Log message: pull in the archive version of this lib to reduce exe size --- Diffs of the changes: (+1 -1) Makefile | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm/tools/llc/Makefile diff -u llvm/tools/llc/Makefile:1.73 llvm/tools/llc/Makefile:1.74 --- llvm/tools/llc/Makefile:1.73 Wed Jun 8 17:32:51 2005 +++ llvm/tools/llc/Makefile Sun Oct 23 20:13:21 2005 @@ -69,7 +69,7 @@ LLVMTarget.a \ LLVMipa.a \ LLVMTransforms.a \ - LLVMScalarOpts \ + LLVMScalarOpts.a \ LLVMAnalysis.a \ LLVMTransformUtils.a \ LLVMBCReader \ From lattner at cs.uiuc.edu Sun Oct 23 20:15:26 2005 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sun, 23 Oct 2005 20:15:26 -0500 Subject: [llvm-commits] CVS: llvm/Makefile.rules Message-ID: <200510240115.UAA26330@zion.cs.uiuc.edu> Changes in directory llvm: Makefile.rules updated: 1.330 -> 1.331 --- Log message: pull in the .a version of scalaropts lib to reduce the size of programs using the JIT --- Diffs of the changes: (+1 -1) Makefile.rules | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm/Makefile.rules diff -u llvm/Makefile.rules:1.330 llvm/Makefile.rules:1.331 --- llvm/Makefile.rules:1.330 Sat Oct 22 23:51:22 2005 +++ llvm/Makefile.rules Sun Oct 23 20:15:14 2005 @@ -617,7 +617,7 @@ JIT_LIBS += LLVMAlpha LLVMSelectionDAG endif -LLVMLIBS := $(JIT_LIBS) LLVMScalarOpts LLVMAnalysis.a LLVMTransformUtils.a \ +LLVMLIBS := $(JIT_LIBS) LLVMScalarOpts.a LLVMAnalysis.a LLVMTransformUtils.a \ LLVMBCReader LLVMCore LLVMSupport.a LLVMTarget.a LLVMbzip2 \ LLVMSystem.a $(PLATFORMLIBDL) endif From lattner at cs.uiuc.edu Sun Oct 23 20:40:34 2005 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sun, 23 Oct 2005 20:40:34 -0500 Subject: [llvm-commits] CVS: llvm/lib/Transforms/Scalar/ADCE.cpp Message-ID: <200510240140.UAA26411@zion.cs.uiuc.edu> Changes in directory llvm/lib/Transforms/Scalar: ADCE.cpp updated: 1.93 -> 1.94 --- Log message: Make sure that anything using the ADCE pass pulls in the UnifyFunctionExitNodes code --- Diffs of the changes: (+2 -0) ADCE.cpp | 2 ++ 1 files changed, 2 insertions(+) Index: llvm/lib/Transforms/Scalar/ADCE.cpp diff -u llvm/lib/Transforms/Scalar/ADCE.cpp:1.93 llvm/lib/Transforms/Scalar/ADCE.cpp:1.94 --- llvm/lib/Transforms/Scalar/ADCE.cpp:1.93 Sat May 14 07:25:31 2005 +++ llvm/lib/Transforms/Scalar/ADCE.cpp Sun Oct 23 20:40:23 2005 @@ -29,6 +29,8 @@ #include using namespace llvm; +static IncludeFile X((void*)createUnifyFunctionExitNodesPass); + namespace { Statistic<> NumBlockRemoved("adce", "Number of basic blocks removed"); Statistic<> NumInstRemoved ("adce", "Number of instructions removed"); From lattner at cs.uiuc.edu Sun Oct 23 20:52:27 2005 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sun, 23 Oct 2005 20:52:27 -0500 Subject: [llvm-commits] CVS: llvm/projects/Stacker/tools/stkrc/Makefile Message-ID: <200510240152.UAA26628@zion.cs.uiuc.edu> Changes in directory llvm/projects/Stacker/tools/stkrc: Makefile updated: 1.7 -> 1.8 --- Log message: use archives when possible --- Diffs of the changes: (+2 -2) Makefile | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) Index: llvm/projects/Stacker/tools/stkrc/Makefile diff -u llvm/projects/Stacker/tools/stkrc/Makefile:1.7 llvm/projects/Stacker/tools/stkrc/Makefile:1.8 --- llvm/projects/Stacker/tools/stkrc/Makefile:1.7 Wed May 18 19:54:10 2005 +++ llvm/projects/Stacker/tools/stkrc/Makefile Sun Oct 23 20:52:15 2005 @@ -9,8 +9,8 @@ # Give the name of a library. This will build a dynamic version. # TOOLNAME = stkrc -LLVMLIBS = LLVMAsmParser LLVMBCWriter LLVMTransforms LLVMipo.a LLVMipa.a \ - LLVMScalarOpts LLVMAnalysis.a LLVMTarget.a LLVMTransformUtils \ +LLVMLIBS = LLVMAsmParser LLVMBCWriter LLVMTransforms.a LLVMipo.a LLVMipa.a \ + LLVMScalarOpts.a LLVMAnalysis.a LLVMTarget.a LLVMTransformUtils.a \ LLVMCore LLVMSupport.a LLVMbzip2 LLVMSystem.a CONFIG_FILES = st EXTRA_DIST = st From lattner at cs.uiuc.edu Sun Oct 23 20:57:02 2005 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sun, 23 Oct 2005 20:57:02 -0500 Subject: [llvm-commits] CVS: llvm/lib/Transforms/Makefile Message-ID: <200510240157.UAA26856@zion.cs.uiuc.edu> Changes in directory llvm/lib/Transforms: Makefile updated: 1.9 -> 1.10 --- Log message: Only build .a file versions of these libraries, instead of .a and .o versions. This should speed up build times. --- Diffs of the changes: (+1 -0) Makefile | 1 + 1 files changed, 1 insertion(+) Index: llvm/lib/Transforms/Makefile diff -u llvm/lib/Transforms/Makefile:1.9 llvm/lib/Transforms/Makefile:1.10 --- llvm/lib/Transforms/Makefile:1.9 Wed Oct 27 18:18:45 2004 +++ llvm/lib/Transforms/Makefile Sun Oct 23 20:56:50 2005 @@ -10,6 +10,7 @@ PARALLEL_DIRS = Utils Instrumentation Scalar IPO LIBRARYNAME = LLVMTransforms BUILD_ARCHIVE = 1 +DONT_BUILD_RELINKED = 1 include $(LEVEL)/Makefile.common From lattner at cs.uiuc.edu Sun Oct 23 20:57:32 2005 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sun, 23 Oct 2005 20:57:32 -0500 Subject: [llvm-commits] CVS: llvm/lib/Transforms/Scalar/Makefile Message-ID: <200510240157.UAA26889@zion.cs.uiuc.edu> Changes in directory llvm/lib/Transforms/Scalar: Makefile updated: 1.4 -> 1.5 --- Log message: Only build .a file versions of these libraries, instead of .a and .o versions. This should speed up build times. --- Diffs of the changes: (+1 -0) Makefile | 1 + 1 files changed, 1 insertion(+) Index: llvm/lib/Transforms/Scalar/Makefile diff -u llvm/lib/Transforms/Scalar/Makefile:1.4 llvm/lib/Transforms/Scalar/Makefile:1.5 --- llvm/lib/Transforms/Scalar/Makefile:1.4 Wed Oct 27 18:18:45 2004 +++ llvm/lib/Transforms/Scalar/Makefile Sun Oct 23 20:57:21 2005 @@ -9,6 +9,7 @@ LEVEL = ../../.. LIBRARYNAME = LLVMScalarOpts BUILD_ARCHIVE = 1 +DONT_BUILD_RELINKED = 1 include $(LEVEL)/Makefile.common From lattner at cs.uiuc.edu Sun Oct 23 20:57:52 2005 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sun, 23 Oct 2005 20:57:52 -0500 Subject: [llvm-commits] CVS: llvm/lib/Transforms/IPO/Makefile Message-ID: <200510240157.UAA26922@zion.cs.uiuc.edu> Changes in directory llvm/lib/Transforms/IPO: Makefile updated: 1.4 -> 1.5 --- Log message: Only build .a file versions of these libraries, instead of .a and .o versions. This should speed up build times. --- Diffs of the changes: (+1 -0) Makefile | 1 + 1 files changed, 1 insertion(+) Index: llvm/lib/Transforms/IPO/Makefile diff -u llvm/lib/Transforms/IPO/Makefile:1.4 llvm/lib/Transforms/IPO/Makefile:1.5 --- llvm/lib/Transforms/IPO/Makefile:1.4 Wed Oct 27 18:18:45 2004 +++ llvm/lib/Transforms/IPO/Makefile Sun Oct 23 20:57:40 2005 @@ -9,6 +9,7 @@ LEVEL = ../../.. LIBRARYNAME = LLVMipo BUILD_ARCHIVE = 1 +DONT_BUILD_RELINKED = 1 include $(LEVEL)/Makefile.common From lattner at cs.uiuc.edu Sun Oct 23 20:58:57 2005 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sun, 23 Oct 2005 20:58:57 -0500 Subject: [llvm-commits] CVS: llvm/lib/Transforms/Instrumentation/Makefile Message-ID: <200510240158.UAA26956@zion.cs.uiuc.edu> Changes in directory llvm/lib/Transforms/Instrumentation: Makefile updated: 1.6 -> 1.7 --- Log message: Only build .a file versions of these libraries, instead of .a and .o versions. This should speed up build times. --- Diffs of the changes: (+1 -0) Makefile | 1 + 1 files changed, 1 insertion(+) Index: llvm/lib/Transforms/Instrumentation/Makefile diff -u llvm/lib/Transforms/Instrumentation/Makefile:1.6 llvm/lib/Transforms/Instrumentation/Makefile:1.7 --- llvm/lib/Transforms/Instrumentation/Makefile:1.6 Wed Oct 27 18:18:45 2004 +++ llvm/lib/Transforms/Instrumentation/Makefile Sun Oct 23 20:58:46 2005 @@ -10,6 +10,7 @@ LIBRARYNAME = LLVMInstrumentation PARALLEL_DIRS = ProfilePaths BUILD_ARCHIVE = 1 +DONT_BUILD_RELINKED = 1 include $(LEVEL)/Makefile.common From lattner at cs.uiuc.edu Sun Oct 23 20:59:13 2005 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sun, 23 Oct 2005 20:59:13 -0500 Subject: [llvm-commits] CVS: llvm/lib/Transforms/Utils/Makefile Message-ID: <200510240159.UAA26989@zion.cs.uiuc.edu> Changes in directory llvm/lib/Transforms/Utils: Makefile updated: 1.4 -> 1.5 --- Log message: Only build .a file versions of these libraries, instead of .a and .o versions. This should speed up build times. --- Diffs of the changes: (+2 -0) Makefile | 2 ++ 1 files changed, 2 insertions(+) Index: llvm/lib/Transforms/Utils/Makefile diff -u llvm/lib/Transforms/Utils/Makefile:1.4 llvm/lib/Transforms/Utils/Makefile:1.5 --- llvm/lib/Transforms/Utils/Makefile:1.4 Wed Oct 27 18:18:45 2004 +++ llvm/lib/Transforms/Utils/Makefile Sun Oct 23 20:59:02 2005 @@ -6,9 +6,11 @@ # the University of Illinois Open Source License. See LICENSE.TXT for details. # ##===----------------------------------------------------------------------===## + LEVEL = ../../.. LIBRARYNAME = LLVMTransformUtils BUILD_ARCHIVE = 1 +DONT_BUILD_RELINKED = 1 include $(LEVEL)/Makefile.common From lattner at cs.uiuc.edu Sun Oct 23 20:59:59 2005 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sun, 23 Oct 2005 20:59:59 -0500 Subject: [llvm-commits] CVS: llvm/lib/Analysis/Makefile Message-ID: <200510240159.UAA27076@zion.cs.uiuc.edu> Changes in directory llvm/lib/Analysis: Makefile updated: 1.9 -> 1.10 --- Log message: Only build .a file versions of these libraries, instead of .a and .o versions. This should speed up build times. --- Diffs of the changes: (+1 -0) Makefile | 1 + 1 files changed, 1 insertion(+) Index: llvm/lib/Analysis/Makefile diff -u llvm/lib/Analysis/Makefile:1.9 llvm/lib/Analysis/Makefile:1.10 --- llvm/lib/Analysis/Makefile:1.9 Wed Oct 27 18:18:44 2004 +++ llvm/lib/Analysis/Makefile Sun Oct 23 20:59:48 2005 @@ -11,6 +11,7 @@ LIBRARYNAME = LLVMAnalysis PARALLEL_DIRS = IPA DataStructure BUILD_ARCHIVE = 1 +DONT_BUILD_RELINKED = 1 include $(LEVEL)/Makefile.common From lattner at cs.uiuc.edu Sun Oct 23 21:00:00 2005 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sun, 23 Oct 2005 21:00:00 -0500 Subject: [llvm-commits] CVS: llvm/lib/Analysis/IPA/Makefile Message-ID: <200510240200.VAA27096@zion.cs.uiuc.edu> Changes in directory llvm/lib/Analysis/IPA: Makefile updated: 1.4 -> 1.5 --- Log message: Only build .a file versions of these libraries, instead of .a and .o versions. This should speed up build times. --- Diffs of the changes: (+1 -0) Makefile | 1 + 1 files changed, 1 insertion(+) Index: llvm/lib/Analysis/IPA/Makefile diff -u llvm/lib/Analysis/IPA/Makefile:1.4 llvm/lib/Analysis/IPA/Makefile:1.5 --- llvm/lib/Analysis/IPA/Makefile:1.4 Thu Oct 28 00:36:47 2004 +++ llvm/lib/Analysis/IPA/Makefile Sun Oct 23 20:59:48 2005 @@ -9,6 +9,7 @@ LEVEL = ../../.. LIBRARYNAME = LLVMipa BUILD_ARCHIVE = 1 +DONT_BUILD_RELINKED = 1 include $(LEVEL)/Makefile.common From lattner at cs.uiuc.edu Sun Oct 23 21:05:47 2005 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sun, 23 Oct 2005 21:05:47 -0500 Subject: [llvm-commits] CVS: llvm/lib/Support/Makefile Message-ID: <200510240205.VAA27179@zion.cs.uiuc.edu> Changes in directory llvm/lib/Support: Makefile updated: 1.8 -> 1.9 --- Log message: Only build .a file versions of these libraries, instead of .a and .o versions. This should speed up build times. --- Diffs of the changes: (+1 -0) Makefile | 1 + 1 files changed, 1 insertion(+) Index: llvm/lib/Support/Makefile diff -u llvm/lib/Support/Makefile:1.8 llvm/lib/Support/Makefile:1.9 --- llvm/lib/Support/Makefile:1.8 Thu Nov 25 13:38:28 2004 +++ llvm/lib/Support/Makefile Sun Oct 23 21:05:35 2005 @@ -10,5 +10,6 @@ PARALLEL_DIRS=bzip2 LIBRARYNAME = LLVMSupport BUILD_ARCHIVE = 1 +DONT_BUILD_RELINKED := 1 include $(LEVEL)/Makefile.common From lattner at cs.uiuc.edu Sun Oct 23 21:07:19 2005 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sun, 23 Oct 2005 21:07:19 -0500 Subject: [llvm-commits] CVS: llvm/lib/Target/SparcV9/RegAlloc/Notes.txt Message-ID: <200510240207.VAA27234@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/SparcV9/RegAlloc: Notes.txt (r1.2) removed --- Log message: This file is hopelessly out of date --- Diffs of the changes: (+0 -0) 0 files changed From lattner at cs.uiuc.edu Sun Oct 23 21:09:14 2005 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sun, 23 Oct 2005 21:09:14 -0500 Subject: [llvm-commits] CVS: llvm/lib/Target/SparcV9/RegAlloc/Makefile Message-ID: <200510240209.VAA27291@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/SparcV9/RegAlloc: Makefile updated: 1.7 -> 1.8 --- Log message: There is no need to build an archive version of this library --- Diffs of the changes: (+0 -1) Makefile | 1 - 1 files changed, 1 deletion(-) Index: llvm/lib/Target/SparcV9/RegAlloc/Makefile diff -u llvm/lib/Target/SparcV9/RegAlloc/Makefile:1.7 llvm/lib/Target/SparcV9/RegAlloc/Makefile:1.8 --- llvm/lib/Target/SparcV9/RegAlloc/Makefile:1.7 Wed Oct 27 18:18:45 2004 +++ llvm/lib/Target/SparcV9/RegAlloc/Makefile Sun Oct 23 21:09:03 2005 @@ -10,6 +10,5 @@ LEVEL = ../../../.. DIRS = LIBRARYNAME = LLVMSparcV9RegAlloc -BUILD_ARCHIVE = 1 include $(LEVEL)/Makefile.common From lattner at cs.uiuc.edu Sun Oct 23 21:12:02 2005 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sun, 23 Oct 2005 21:12:02 -0500 Subject: [llvm-commits] CVS: llvm/lib/System/Makefile Message-ID: <200510240212.VAA27353@zion.cs.uiuc.edu> Changes in directory llvm/lib/System: Makefile updated: 1.7 -> 1.8 --- Log message: Only build .a file versions of these libraries, instead of .a and .o versions. This should speed up build times. --- Diffs of the changes: (+1 -0) Makefile | 1 + 1 files changed, 1 insertion(+) Index: llvm/lib/System/Makefile diff -u llvm/lib/System/Makefile:1.7 llvm/lib/System/Makefile:1.8 --- llvm/lib/System/Makefile:1.7 Fri Jan 14 16:43:01 2005 +++ llvm/lib/System/Makefile Sun Oct 23 21:11:51 2005 @@ -9,6 +9,7 @@ LEVEL = ../.. LIBRARYNAME = LLVMSystem BUILD_ARCHIVE = 1 +DONT_BUILD_RELINKED = 1 EXTRA_DIST = Unix Win32 From lattner at cs.uiuc.edu Sun Oct 23 21:15:00 2005 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sun, 23 Oct 2005 21:15:00 -0500 Subject: [llvm-commits] CVS: llvm/lib/Target/Makefile Message-ID: <200510240215.VAA27415@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target: Makefile updated: 1.24 -> 1.25 --- Log message: only build .a version of this library --- Diffs of the changes: (+1 -0) Makefile | 1 + 1 files changed, 1 insertion(+) Index: llvm/lib/Target/Makefile diff -u llvm/lib/Target/Makefile:1.24 llvm/lib/Target/Makefile:1.25 --- llvm/lib/Target/Makefile:1.24 Fri Apr 22 12:20:11 2005 +++ llvm/lib/Target/Makefile Sun Oct 23 21:14:49 2005 @@ -9,6 +9,7 @@ LEVEL = ../.. LIBRARYNAME = LLVMTarget BUILD_ARCHIVE = 1 +DONT_BUILD_RELINKED = 1 # We include this early so we can access the value of TARGETS_TO_BUILD as the # value for PARALLEL_DIRS which must be set before Makefile.rules is included From lattner at cs.uiuc.edu Sun Oct 23 21:21:56 2005 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sun, 23 Oct 2005 21:21:56 -0500 Subject: [llvm-commits] CVS: llvm/Makefile.rules Message-ID: <200510240221.VAA27495@zion.cs.uiuc.edu> Changes in directory llvm: Makefile.rules updated: 1.331 -> 1.332 --- Log message: Now that all libraries are built in either .o or .a form, make BUILD_ARCHIVE default to turning off building of relinked objects. --- Diffs of the changes: (+10 -2) Makefile.rules | 12 ++++++++++-- 1 files changed, 10 insertions(+), 2 deletions(-) Index: llvm/Makefile.rules diff -u llvm/Makefile.rules:1.331 llvm/Makefile.rules:1.332 --- llvm/Makefile.rules:1.331 Sun Oct 23 20:15:14 2005 +++ llvm/Makefile.rules Sun Oct 23 21:21:45 2005 @@ -824,10 +824,18 @@ #--------------------------------------------------------- # ReLinked Library Targets: -# If the user didn't explicitly forbid building a -# relinked then we provide targets for building them. +# If the user explicitly requests a relinked library with +# BUILD_RELINKED, provide it. Otherwise, if they specify +# neither of BUILD_ARCHIVE or DONT_BUILD_RELINKED, give +# them one. #--------------------------------------------------------- +ifndef BUILD_ARCHIVE ifndef DONT_BUILD_RELINKED +BUILD_RELINKED = 1 +endif +endif + +ifdef BUILD_RELINKED all-local:: $(LibName.O) From lattner at cs.uiuc.edu Sun Oct 23 21:25:06 2005 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sun, 23 Oct 2005 21:25:06 -0500 Subject: [llvm-commits] CVS: llvm/lib/Analysis/Makefile Message-ID: <200510240225.VAA27545@zion.cs.uiuc.edu> Changes in directory llvm/lib/Analysis: Makefile updated: 1.10 -> 1.11 --- Log message: DONT_BUILD_RELINKED is gone and implied by BUILD_ARCHIVE now --- Diffs of the changes: (+0 -1) Makefile | 1 - 1 files changed, 1 deletion(-) Index: llvm/lib/Analysis/Makefile diff -u llvm/lib/Analysis/Makefile:1.10 llvm/lib/Analysis/Makefile:1.11 --- llvm/lib/Analysis/Makefile:1.10 Sun Oct 23 20:59:48 2005 +++ llvm/lib/Analysis/Makefile Sun Oct 23 21:24:54 2005 @@ -11,7 +11,6 @@ LIBRARYNAME = LLVMAnalysis PARALLEL_DIRS = IPA DataStructure BUILD_ARCHIVE = 1 -DONT_BUILD_RELINKED = 1 include $(LEVEL)/Makefile.common From lattner at cs.uiuc.edu Sun Oct 23 21:25:06 2005 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sun, 23 Oct 2005 21:25:06 -0500 Subject: [llvm-commits] CVS: llvm/lib/Bytecode/Archive/Makefile Message-ID: <200510240225.VAA27541@zion.cs.uiuc.edu> Changes in directory llvm/lib/Bytecode/Archive: Makefile updated: 1.1 -> 1.2 --- Log message: DONT_BUILD_RELINKED is gone and implied by BUILD_ARCHIVE now --- Diffs of the changes: (+0 -1) Makefile | 1 - 1 files changed, 1 deletion(-) Index: llvm/lib/Bytecode/Archive/Makefile diff -u llvm/lib/Bytecode/Archive/Makefile:1.1 llvm/lib/Bytecode/Archive/Makefile:1.2 --- llvm/lib/Bytecode/Archive/Makefile:1.1 Sat Nov 6 02:52:36 2004 +++ llvm/lib/Bytecode/Archive/Makefile Sun Oct 23 21:24:54 2005 @@ -13,6 +13,5 @@ # We only want an archive so only those modules actually used by a tool are # included. BUILD_ARCHIVE = 1 -DONT_BUILD_RELINKED = 1 include $(LEVEL)/Makefile.common From lattner at cs.uiuc.edu Sun Oct 23 21:25:06 2005 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sun, 23 Oct 2005 21:25:06 -0500 Subject: [llvm-commits] CVS: llvm/lib/Analysis/IPA/Makefile Message-ID: <200510240225.VAA27549@zion.cs.uiuc.edu> Changes in directory llvm/lib/Analysis/IPA: Makefile updated: 1.5 -> 1.6 --- Log message: DONT_BUILD_RELINKED is gone and implied by BUILD_ARCHIVE now --- Diffs of the changes: (+1 -2) Makefile | 3 +-- 1 files changed, 1 insertion(+), 2 deletions(-) Index: llvm/lib/Analysis/IPA/Makefile diff -u llvm/lib/Analysis/IPA/Makefile:1.5 llvm/lib/Analysis/IPA/Makefile:1.6 --- llvm/lib/Analysis/IPA/Makefile:1.5 Sun Oct 23 20:59:48 2005 +++ llvm/lib/Analysis/IPA/Makefile Sun Oct 23 21:24:54 2005 @@ -6,10 +6,9 @@ # the University of Illinois Open Source License. See LICENSE.TXT for details. # ##===----------------------------------------------------------------------===## + LEVEL = ../../.. LIBRARYNAME = LLVMipa BUILD_ARCHIVE = 1 -DONT_BUILD_RELINKED = 1 - include $(LEVEL)/Makefile.common From lattner at cs.uiuc.edu Sun Oct 23 21:26:02 2005 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sun, 23 Oct 2005 21:26:02 -0500 Subject: [llvm-commits] CVS: llvm/lib/Transforms/IPO/Makefile Message-ID: <200510240226.VAA27617@zion.cs.uiuc.edu> Changes in directory llvm/lib/Transforms/IPO: Makefile updated: 1.5 -> 1.6 --- Log message: DONT_BUILD_RELINKED is gone and implied by BUILD_ARCHIVE now --- Diffs of the changes: (+1 -1) Makefile | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm/lib/Transforms/IPO/Makefile diff -u llvm/lib/Transforms/IPO/Makefile:1.5 llvm/lib/Transforms/IPO/Makefile:1.6 --- llvm/lib/Transforms/IPO/Makefile:1.5 Sun Oct 23 20:57:40 2005 +++ llvm/lib/Transforms/IPO/Makefile Sun Oct 23 21:25:48 2005 @@ -6,10 +6,10 @@ # the University of Illinois Open Source License. See LICENSE.TXT for details. # ##===----------------------------------------------------------------------===## + LEVEL = ../../.. LIBRARYNAME = LLVMipo BUILD_ARCHIVE = 1 -DONT_BUILD_RELINKED = 1 include $(LEVEL)/Makefile.common From lattner at cs.uiuc.edu Sun Oct 23 21:26:03 2005 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sun, 23 Oct 2005 21:26:03 -0500 Subject: [llvm-commits] CVS: llvm/lib/Support/Makefile Message-ID: <200510240226.VAA27629@zion.cs.uiuc.edu> Changes in directory llvm/lib/Support: Makefile updated: 1.9 -> 1.10 --- Log message: DONT_BUILD_RELINKED is gone and implied by BUILD_ARCHIVE now --- Diffs of the changes: (+1 -1) Makefile | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm/lib/Support/Makefile diff -u llvm/lib/Support/Makefile:1.9 llvm/lib/Support/Makefile:1.10 --- llvm/lib/Support/Makefile:1.9 Sun Oct 23 21:05:35 2005 +++ llvm/lib/Support/Makefile Sun Oct 23 21:25:48 2005 @@ -6,10 +6,10 @@ # the University of Illinois Open Source License. See LICENSE.TXT for details. # ##===----------------------------------------------------------------------===## + LEVEL = ../.. PARALLEL_DIRS=bzip2 LIBRARYNAME = LLVMSupport BUILD_ARCHIVE = 1 -DONT_BUILD_RELINKED := 1 include $(LEVEL)/Makefile.common From lattner at cs.uiuc.edu Sun Oct 23 21:26:03 2005 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sun, 23 Oct 2005 21:26:03 -0500 Subject: [llvm-commits] CVS: llvm/lib/Transforms/Instrumentation/Makefile Message-ID: <200510240226.VAA27625@zion.cs.uiuc.edu> Changes in directory llvm/lib/Transforms/Instrumentation: Makefile updated: 1.7 -> 1.8 --- Log message: DONT_BUILD_RELINKED is gone and implied by BUILD_ARCHIVE now --- Diffs of the changes: (+1 -1) Makefile | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm/lib/Transforms/Instrumentation/Makefile diff -u llvm/lib/Transforms/Instrumentation/Makefile:1.7 llvm/lib/Transforms/Instrumentation/Makefile:1.8 --- llvm/lib/Transforms/Instrumentation/Makefile:1.7 Sun Oct 23 20:58:46 2005 +++ llvm/lib/Transforms/Instrumentation/Makefile Sun Oct 23 21:25:48 2005 @@ -6,11 +6,11 @@ # the University of Illinois Open Source License. See LICENSE.TXT for details. # ##===----------------------------------------------------------------------===## + LEVEL = ../../.. LIBRARYNAME = LLVMInstrumentation PARALLEL_DIRS = ProfilePaths BUILD_ARCHIVE = 1 -DONT_BUILD_RELINKED = 1 include $(LEVEL)/Makefile.common From lattner at cs.uiuc.edu Sun Oct 23 21:26:03 2005 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sun, 23 Oct 2005 21:26:03 -0500 Subject: [llvm-commits] CVS: llvm/lib/Target/Makefile Message-ID: <200510240226.VAA27637@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target: Makefile updated: 1.25 -> 1.26 --- Log message: DONT_BUILD_RELINKED is gone and implied by BUILD_ARCHIVE now --- Diffs of the changes: (+1 -1) Makefile | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm/lib/Target/Makefile diff -u llvm/lib/Target/Makefile:1.25 llvm/lib/Target/Makefile:1.26 --- llvm/lib/Target/Makefile:1.25 Sun Oct 23 21:14:49 2005 +++ llvm/lib/Target/Makefile Sun Oct 23 21:25:48 2005 @@ -6,10 +6,10 @@ # the University of Illinois Open Source License. See LICENSE.TXT for details. # ##===----------------------------------------------------------------------===## + LEVEL = ../.. LIBRARYNAME = LLVMTarget BUILD_ARCHIVE = 1 -DONT_BUILD_RELINKED = 1 # We include this early so we can access the value of TARGETS_TO_BUILD as the # value for PARALLEL_DIRS which must be set before Makefile.rules is included From lattner at cs.uiuc.edu Sun Oct 23 21:26:03 2005 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sun, 23 Oct 2005 21:26:03 -0500 Subject: [llvm-commits] CVS: llvm/lib/Transforms/Makefile Message-ID: <200510240226.VAA27633@zion.cs.uiuc.edu> Changes in directory llvm/lib/Transforms: Makefile updated: 1.10 -> 1.11 --- Log message: DONT_BUILD_RELINKED is gone and implied by BUILD_ARCHIVE now --- Diffs of the changes: (+1 -1) Makefile | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm/lib/Transforms/Makefile diff -u llvm/lib/Transforms/Makefile:1.10 llvm/lib/Transforms/Makefile:1.11 --- llvm/lib/Transforms/Makefile:1.10 Sun Oct 23 20:56:50 2005 +++ llvm/lib/Transforms/Makefile Sun Oct 23 21:25:48 2005 @@ -6,11 +6,11 @@ # the University of Illinois Open Source License. See LICENSE.TXT for details. # ##===----------------------------------------------------------------------===## + LEVEL = ../.. PARALLEL_DIRS = Utils Instrumentation Scalar IPO LIBRARYNAME = LLVMTransforms BUILD_ARCHIVE = 1 -DONT_BUILD_RELINKED = 1 include $(LEVEL)/Makefile.common From lattner at cs.uiuc.edu Sun Oct 23 21:26:03 2005 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sun, 23 Oct 2005 21:26:03 -0500 Subject: [llvm-commits] CVS: llvm/lib/Linker/Makefile Message-ID: <200510240226.VAA27641@zion.cs.uiuc.edu> Changes in directory llvm/lib/Linker: Makefile updated: 1.2 -> 1.3 --- Log message: DONT_BUILD_RELINKED is gone and implied by BUILD_ARCHIVE now --- Diffs of the changes: (+1 -1) Makefile | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm/lib/Linker/Makefile diff -u llvm/lib/Linker/Makefile:1.2 llvm/lib/Linker/Makefile:1.3 --- llvm/lib/Linker/Makefile:1.2 Sun Nov 14 16:03:14 2004 +++ llvm/lib/Linker/Makefile Sun Oct 23 21:25:48 2005 @@ -6,10 +6,10 @@ # University of Illinois Open Source License. See LICENSE.TXT for details. # ##===----------------------------------------------------------------------===## + LEVEL = ../.. LIBRARYNAME = LLVMLinker BUILD_ARCHIVE := 1 -DONT_BUILD_RELINKED := 1 include $(LEVEL)/Makefile.common From lattner at cs.uiuc.edu Sun Oct 23 21:26:03 2005 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sun, 23 Oct 2005 21:26:03 -0500 Subject: [llvm-commits] CVS: llvm/lib/System/Makefile Message-ID: <200510240226.VAA27621@zion.cs.uiuc.edu> Changes in directory llvm/lib/System: Makefile updated: 1.8 -> 1.9 --- Log message: DONT_BUILD_RELINKED is gone and implied by BUILD_ARCHIVE now --- Diffs of the changes: (+1 -1) Makefile | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm/lib/System/Makefile diff -u llvm/lib/System/Makefile:1.8 llvm/lib/System/Makefile:1.9 --- llvm/lib/System/Makefile:1.8 Sun Oct 23 21:11:51 2005 +++ llvm/lib/System/Makefile Sun Oct 23 21:25:48 2005 @@ -6,10 +6,10 @@ # University of Illinois Open Source License. See LICENSE.TXT for details. # ##===----------------------------------------------------------------------===## + LEVEL = ../.. LIBRARYNAME = LLVMSystem BUILD_ARCHIVE = 1 -DONT_BUILD_RELINKED = 1 EXTRA_DIST = Unix Win32 From lattner at cs.uiuc.edu Sun Oct 23 21:26:04 2005 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sun, 23 Oct 2005 21:26:04 -0500 Subject: [llvm-commits] CVS: llvm/lib/Transforms/Scalar/Makefile Message-ID: <200510240226.VAA27645@zion.cs.uiuc.edu> Changes in directory llvm/lib/Transforms/Scalar: Makefile updated: 1.5 -> 1.6 --- Log message: DONT_BUILD_RELINKED is gone and implied by BUILD_ARCHIVE now --- Diffs of the changes: (+1 -1) Makefile | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm/lib/Transforms/Scalar/Makefile diff -u llvm/lib/Transforms/Scalar/Makefile:1.5 llvm/lib/Transforms/Scalar/Makefile:1.6 --- llvm/lib/Transforms/Scalar/Makefile:1.5 Sun Oct 23 20:57:21 2005 +++ llvm/lib/Transforms/Scalar/Makefile Sun Oct 23 21:25:48 2005 @@ -6,10 +6,10 @@ # the University of Illinois Open Source License. See LICENSE.TXT for details. # ##===----------------------------------------------------------------------===## + LEVEL = ../../.. LIBRARYNAME = LLVMScalarOpts BUILD_ARCHIVE = 1 -DONT_BUILD_RELINKED = 1 include $(LEVEL)/Makefile.common From lattner at cs.uiuc.edu Sun Oct 23 21:26:24 2005 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sun, 23 Oct 2005 21:26:24 -0500 Subject: [llvm-commits] CVS: llvm/lib/Transforms/Utils/Makefile Message-ID: <200510240226.VAA27678@zion.cs.uiuc.edu> Changes in directory llvm/lib/Transforms/Utils: Makefile updated: 1.5 -> 1.6 --- Log message: DONT_BUILD_RELINKED is gone and implied by BUILD_ARCHIVE now --- Diffs of the changes: (+0 -1) Makefile | 1 - 1 files changed, 1 deletion(-) Index: llvm/lib/Transforms/Utils/Makefile diff -u llvm/lib/Transforms/Utils/Makefile:1.5 llvm/lib/Transforms/Utils/Makefile:1.6 --- llvm/lib/Transforms/Utils/Makefile:1.5 Sun Oct 23 20:59:02 2005 +++ llvm/lib/Transforms/Utils/Makefile Sun Oct 23 21:26:13 2005 @@ -10,7 +10,6 @@ LEVEL = ../../.. LIBRARYNAME = LLVMTransformUtils BUILD_ARCHIVE = 1 -DONT_BUILD_RELINKED = 1 include $(LEVEL)/Makefile.common From lattner at cs.uiuc.edu Sun Oct 23 21:30:36 2005 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sun, 23 Oct 2005 21:30:36 -0500 Subject: [llvm-commits] CVS: llvm/include/llvm/Transforms/LinkAllPasses.h Message-ID: <200510240230.VAA27769@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm/Transforms: LinkAllPasses.h updated: 1.22 -> 1.23 --- Log message: Don't link these three passes in anymore --- Diffs of the changes: (+0 -3) LinkAllPasses.h | 3 --- 1 files changed, 3 deletions(-) Index: llvm/include/llvm/Transforms/LinkAllPasses.h diff -u llvm/include/llvm/Transforms/LinkAllPasses.h:1.22 llvm/include/llvm/Transforms/LinkAllPasses.h:1.23 --- llvm/include/llvm/Transforms/LinkAllPasses.h:1.22 Sun Oct 23 19:16:03 2005 +++ llvm/include/llvm/Transforms/LinkAllPasses.h Sun Oct 23 21:30:25 2005 @@ -45,7 +45,6 @@ (void) llvm::createBlockProfilerPass(); (void) llvm::createBreakCriticalEdgesPass(); (void) llvm::createCFGSimplificationPass(); - (void) llvm::createCombineBranchesPass(); (void) llvm::createConstantMergePass(); (void) llvm::createConstantPropagationPass(); (void) llvm::createCorrelatedExpressionEliminationPass(); @@ -73,7 +72,6 @@ (void) llvm::createLICMPass(); (void) llvm::createLoadValueNumberingPass(); (void) llvm::createLoopExtractorPass(); - (void) llvm::createLoopInstrumentationPass(); (void) llvm::createLoopSimplifyPass(); (void) llvm::createLoopStrengthReducePass(); (void) llvm::createLoopUnrollPass(); @@ -90,7 +88,6 @@ (void) llvm::createNoProfileInfoPass(); (void) llvm::createPREPass(); (void) llvm::createProfileLoaderPass(); - (void) llvm::createProfilePathsPass(); (void) llvm::createPromoteMemoryToRegisterPass(); (void) llvm::createPruneEHPass(); (void) llvm::createRaiseAllocationsPass(); From lattner at cs.uiuc.edu Sun Oct 23 21:31:17 2005 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sun, 23 Oct 2005 21:31:17 -0500 Subject: [llvm-commits] CVS: llvm/tools/bugpoint/Makefile Message-ID: <200510240231.VAA27833@zion.cs.uiuc.edu> Changes in directory llvm/tools/bugpoint: Makefile updated: 1.13 -> 1.14 --- Log message: Remove a now-unneeded library --- Diffs of the changes: (+1 -1) Makefile | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm/tools/bugpoint/Makefile diff -u llvm/tools/bugpoint/Makefile:1.13 llvm/tools/bugpoint/Makefile:1.14 --- llvm/tools/bugpoint/Makefile:1.13 Sun Oct 23 20:05:53 2005 +++ llvm/tools/bugpoint/Makefile Sun Oct 23 21:31:05 2005 @@ -10,7 +10,7 @@ TOOLNAME = bugpoint -OPTLIBS = LLVMTransforms.a LLVMInstrumentation.a LLVMProfilePaths +OPTLIBS = LLVMTransforms.a LLVMInstrumentation.a ANALIBS = LLVMDataStructure LLVMipa.a LLVMTarget.a USEDLIBS = LLVMipo.a LLVMScalarOpts.a $(OPTLIBS) $(ANALIBS) LLVMAnalysis.a \ From lattner at cs.uiuc.edu Sun Oct 23 21:31:17 2005 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sun, 23 Oct 2005 21:31:17 -0500 Subject: [llvm-commits] CVS: llvm/tools/opt/Makefile Message-ID: <200510240231.VAA27837@zion.cs.uiuc.edu> Changes in directory llvm/tools/opt: Makefile updated: 1.50 -> 1.51 --- Log message: Remove a now-unneeded library --- Diffs of the changes: (+1 -1) Makefile | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm/tools/opt/Makefile diff -u llvm/tools/opt/Makefile:1.50 llvm/tools/opt/Makefile:1.51 --- llvm/tools/opt/Makefile:1.50 Sun Oct 23 19:12:20 2005 +++ llvm/tools/opt/Makefile Sun Oct 23 21:31:05 2005 @@ -9,7 +9,7 @@ LEVEL = ../.. TOOLNAME = opt -USEDLIBS = LLVMBCReader LLVMBCWriter LLVMInstrumentation.a LLVMProfilePaths \ +USEDLIBS = LLVMBCReader LLVMBCWriter LLVMInstrumentation.a \ LLVMScalarOpts.a LLVMipo.a LLVMipa.a LLVMDataStructure LLVMTransforms.a \ LLVMTarget.a LLVMAnalysis.a LLVMTransformUtils.a LLVMCore LLVMSupport.a \ LLVMbzip2 LLVMSystem.a From lattner at cs.uiuc.edu Sun Oct 23 21:32:00 2005 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sun, 23 Oct 2005 21:32:00 -0500 Subject: [llvm-commits] CVS: llvm/lib/Transforms/Instrumentation/Makefile Message-ID: <200510240232.VAA27894@zion.cs.uiuc.edu> Changes in directory llvm/lib/Transforms/Instrumentation: Makefile updated: 1.8 -> 1.9 --- Log message: Do not build the ProfilePaths directory anymore --- Diffs of the changes: (+0 -1) Makefile | 1 - 1 files changed, 1 deletion(-) Index: llvm/lib/Transforms/Instrumentation/Makefile diff -u llvm/lib/Transforms/Instrumentation/Makefile:1.8 llvm/lib/Transforms/Instrumentation/Makefile:1.9 --- llvm/lib/Transforms/Instrumentation/Makefile:1.8 Sun Oct 23 21:25:48 2005 +++ llvm/lib/Transforms/Instrumentation/Makefile Sun Oct 23 21:31:49 2005 @@ -9,7 +9,6 @@ LEVEL = ../../.. LIBRARYNAME = LLVMInstrumentation -PARALLEL_DIRS = ProfilePaths BUILD_ARCHIVE = 1 include $(LEVEL)/Makefile.common From lattner at cs.uiuc.edu Sun Oct 23 21:33:03 2005 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sun, 23 Oct 2005 21:33:03 -0500 Subject: [llvm-commits] CVS: llvm/lib/Transforms/Instrumentation/ProfilePaths/CombineBranch.cpp EdgeCode.cpp Graph.cpp Graph.h GraphAuxiliary.cpp InstLoops.cpp Makefile ProfilePaths.cpp RetracePath.cpp Message-ID: <200510240233.VAA27960@zion.cs.uiuc.edu> Changes in directory llvm/lib/Transforms/Instrumentation/ProfilePaths: CombineBranch.cpp (r1.15) removed EdgeCode.cpp (r1.31) removed Graph.cpp (r1.21) removed Graph.h (r1.14) removed GraphAuxiliary.cpp (r1.28) removed InstLoops.cpp (r1.22) removed Makefile (r1.6) removed ProfilePaths.cpp (r1.44) removed RetracePath.cpp (r1.13) removed --- Log message: Remove some beta code that no longer has an owner. --- Diffs of the changes: (+0 -0) 0 files changed From lattner at cs.uiuc.edu Sun Oct 23 21:33:56 2005 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sun, 23 Oct 2005 21:33:56 -0500 Subject: [llvm-commits] CVS: llvm/docs/ReleaseNotes.html Message-ID: <200510240233.VAA28033@zion.cs.uiuc.edu> Changes in directory llvm/docs: ReleaseNotes.html updated: 1.333 -> 1.334 --- Log message: Three of these have been removed, as warned --- Diffs of the changes: (+2 -2) ReleaseNotes.html | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) Index: llvm/docs/ReleaseNotes.html diff -u llvm/docs/ReleaseNotes.html:1.333 llvm/docs/ReleaseNotes.html:1.334 --- llvm/docs/ReleaseNotes.html:1.333 Tue Jul 12 11:36:24 2005 +++ llvm/docs/ReleaseNotes.html Sun Oct 23 21:33:44 2005 @@ -168,7 +168,7 @@
        • The following passes are incomplete or buggy, and may be removed in future - releases: -cee, -branch-combine, -instloops, -paths, -pre
        • + releases: -cee, -pre
        • The llvm-db tool is in a very early stage of development, but can be used to step through programs and inspect the stack.
        • The "iterative scan" register allocator (enabled with @@ -588,7 +588,7 @@ src="http://www.w3.org/Icons/valid-html401" alt="Valid HTML 4.01!" /> The LLVM Compiler Infrastructure
          - Last modified: $Date: 2005/07/12 16:36:24 $ + Last modified: $Date: 2005/10/24 02:33:44 $ From lattner at cs.uiuc.edu Sun Oct 23 21:35:36 2005 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sun, 23 Oct 2005 21:35:36 -0500 Subject: [llvm-commits] CVS: llvm/include/llvm/Analysis/LinkAllAnalyses.h FindUnsafePointerTypes.h Message-ID: <200510240235.VAA28141@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm/Analysis: LinkAllAnalyses.h updated: 1.1 -> 1.2 FindUnsafePointerTypes.h (r1.18) removed --- Log message: This pass is very old and quite useless, remove it. --- Diffs of the changes: (+0 -2) LinkAllAnalyses.h | 2 -- 1 files changed, 2 deletions(-) Index: llvm/include/llvm/Analysis/LinkAllAnalyses.h diff -u llvm/include/llvm/Analysis/LinkAllAnalyses.h:1.1 llvm/include/llvm/Analysis/LinkAllAnalyses.h:1.2 --- llvm/include/llvm/Analysis/LinkAllAnalyses.h:1.1 Sun Oct 23 19:59:49 2005 +++ llvm/include/llvm/Analysis/LinkAllAnalyses.h Sun Oct 23 21:35:25 2005 @@ -17,7 +17,6 @@ #include "llvm/Analysis/AliasSetTracker.h" #include "llvm/Analysis/CallGraph.h" -#include "llvm/Analysis/FindUnsafePointerTypes.h" #include "llvm/Analysis/FindUsedTypes.h" #include "llvm/Analysis/IntervalPartition.h" #include "llvm/Analysis/PostDominators.h" @@ -52,7 +51,6 @@ (void)new llvm::PostDominatorSet(); (void)new llvm::CallGraph(); (void)new llvm::FindUsedTypes(); - (void)new llvm::FindUnsafePointerTypes(); (void)new llvm::ScalarEvolution(); ((llvm::Function*)0)->viewCFGOnly(); llvm::AliasSetTracker X(*(llvm::AliasAnalysis*)0); From lattner at cs.uiuc.edu Sun Oct 23 21:35:54 2005 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sun, 23 Oct 2005 21:35:54 -0500 Subject: [llvm-commits] CVS: llvm/lib/Analysis/IPA/FindUnsafePointerTypes.cpp Message-ID: <200510240235.VAA28152@zion.cs.uiuc.edu> Changes in directory llvm/lib/Analysis/IPA: FindUnsafePointerTypes.cpp (r1.28) removed --- Log message: Remove this pass, it is not useful --- Diffs of the changes: (+0 -0) 0 files changed From jeffc at jolt-lang.org Sun Oct 23 21:57:37 2005 From: jeffc at jolt-lang.org (Jeff Cohen) Date: Sun, 23 Oct 2005 21:57:37 -0500 Subject: [llvm-commits] CVS: llvm/win32/analyze/analyze.vcproj Message-ID: <200510240257.VAA28219@zion.cs.uiuc.edu> Changes in directory llvm/win32/analyze: analyze.vcproj updated: 1.4 -> 1.5 --- Log message: Update Visual Studio projects to account for recent changes. --- Diffs of the changes: (+0 -2) analyze.vcproj | 2 -- 1 files changed, 2 deletions(-) Index: llvm/win32/analyze/analyze.vcproj diff -u llvm/win32/analyze/analyze.vcproj:1.4 llvm/win32/analyze/analyze.vcproj:1.5 --- llvm/win32/analyze/analyze.vcproj:1.4 Sun Jan 30 11:54:12 2005 +++ llvm/win32/analyze/analyze.vcproj Sun Oct 23 21:57:24 2005 @@ -36,7 +36,6 @@ Name="VCCustomBuildTool"/> Changes in directory llvm/win32/Analysis: Analysis.vcproj updated: 1.12 -> 1.13 --- Log message: Update Visual Studio projects to account for recent changes. --- Diffs of the changes: (+0 -9) Analysis.vcproj | 9 --------- 1 files changed, 9 deletions(-) Index: llvm/win32/Analysis/Analysis.vcproj diff -u llvm/win32/Analysis/Analysis.vcproj:1.12 llvm/win32/Analysis/Analysis.vcproj:1.13 --- llvm/win32/Analysis/Analysis.vcproj:1.12 Sat Jul 30 13:22:27 2005 +++ llvm/win32/Analysis/Analysis.vcproj Sun Oct 23 21:57:24 2005 @@ -179,17 +179,11 @@ RelativePath="..\..\lib\Analysis\Ipa\CallGraphSCCPass.cpp"> - - - - - - Changes in directory llvm/win32/Transforms: Transforms.vcproj updated: 1.13 -> 1.14 --- Log message: Update Visual Studio projects to account for recent changes. --- Diffs of the changes: (+0 -28) Transforms.vcproj | 28 ---------------------------- 1 files changed, 28 deletions(-) Index: llvm/win32/Transforms/Transforms.vcproj diff -u llvm/win32/Transforms/Transforms.vcproj:1.13 llvm/win32/Transforms/Transforms.vcproj:1.14 --- llvm/win32/Transforms/Transforms.vcproj:1.13 Mon Apr 25 21:57:49 2005 +++ llvm/win32/Transforms/Transforms.vcproj Sun Oct 23 21:57:24 2005 @@ -142,34 +142,6 @@ - - - - - - - - - - - - - - - - - - Changes in directory llvm/include/llvm/CodeGen: Passes.h updated: 1.20 -> 1.21 --- Log message: Remove a prototype --- Diffs of the changes: (+0 -5) Passes.h | 5 ----- 1 files changed, 5 deletions(-) Index: llvm/include/llvm/CodeGen/Passes.h diff -u llvm/include/llvm/CodeGen/Passes.h:1.20 llvm/include/llvm/CodeGen/Passes.h:1.21 --- llvm/include/llvm/CodeGen/Passes.h:1.20 Sun May 1 11:14:34 2005 +++ llvm/include/llvm/CodeGen/Passes.h Sun Oct 23 23:13:21 2005 @@ -70,11 +70,6 @@ /// FunctionPass *createLinearScanRegisterAllocator(); - /// IterativeScanRegisterAllocation Pass - This pass implements the iterative - /// scan register allocation algorithm, a global register allocator. - /// - FunctionPass *createIterativeScanRegisterAllocator(); - /// PrologEpilogCodeInserter Pass - This pass inserts prolog and epilog code, /// and eliminates abstract frame references. /// From lattner at cs.uiuc.edu Sun Oct 23 23:14:41 2005 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sun, 23 Oct 2005 23:14:41 -0500 Subject: [llvm-commits] CVS: llvm/lib/CodeGen/Passes.cpp RegAllocIterativeScan.cpp Message-ID: <200510240414.XAA29022@zion.cs.uiuc.edu> Changes in directory llvm/lib/CodeGen: Passes.cpp updated: 1.15 -> 1.16 RegAllocIterativeScan.cpp (r1.22) removed --- Log message: Alkis agrees that that iterative scan allocator isn't going to be worked on in the future, remove it. --- Diffs of the changes: (+1 -4) Passes.cpp | 5 +---- 1 files changed, 1 insertion(+), 4 deletions(-) Index: llvm/lib/CodeGen/Passes.cpp diff -u llvm/lib/CodeGen/Passes.cpp:1.15 llvm/lib/CodeGen/Passes.cpp:1.16 --- llvm/lib/CodeGen/Passes.cpp:1.15 Thu Apr 21 17:33:33 2005 +++ llvm/lib/CodeGen/Passes.cpp Sun Oct 23 23:14:30 2005 @@ -18,7 +18,7 @@ using namespace llvm; namespace { - enum RegAllocName { simple, local, linearscan, iterativescan }; + enum RegAllocName { simple, local, linearscan }; cl::opt RegAlloc( @@ -29,7 +29,6 @@ clEnumVal(simple, " simple register allocator"), clEnumVal(local, " local register allocator"), clEnumVal(linearscan, " linear scan register allocator"), - clEnumVal(iterativescan, " iterative scan register allocator"), clEnumValEnd), cl::init(linearscan)); } @@ -45,8 +44,6 @@ return createLocalRegisterAllocator(); case linearscan: return createLinearScanRegisterAllocator(); - case iterativescan: - return createIterativeScanRegisterAllocator(); } } From lattner at cs.uiuc.edu Sun Oct 23 23:15:21 2005 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sun, 23 Oct 2005 23:15:21 -0500 Subject: [llvm-commits] CVS: llvm/docs/ReleaseNotes.html Message-ID: <200510240415.XAA29077@zion.cs.uiuc.edu> Changes in directory llvm/docs: ReleaseNotes.html updated: 1.334 -> 1.335 --- Log message: This RA no longer exists --- Diffs of the changes: (+1 -3) ReleaseNotes.html | 4 +--- 1 files changed, 1 insertion(+), 3 deletions(-) Index: llvm/docs/ReleaseNotes.html diff -u llvm/docs/ReleaseNotes.html:1.334 llvm/docs/ReleaseNotes.html:1.335 --- llvm/docs/ReleaseNotes.html:1.334 Sun Oct 23 21:33:44 2005 +++ llvm/docs/ReleaseNotes.html Sun Oct 23 23:15:09 2005 @@ -171,8 +171,6 @@ releases: -cee, -pre
        • The llvm-db tool is in a very early stage of development, but can be used to step through programs and inspect the stack.
        • -
        • The "iterative scan" register allocator (enabled with - -regalloc=iterativescan) is not stable.
        • The SparcV8, Alpha, and IA64 code generators are experimental.
        @@ -588,7 +586,7 @@ src="http://www.w3.org/Icons/valid-html401" alt="Valid HTML 4.01!" /> The LLVM Compiler Infrastructure
        - Last modified: $Date: 2005/10/24 02:33:44 $ + Last modified: $Date: 2005/10/24 04:15:09 $ From lattner at cs.uiuc.edu Sun Oct 23 23:17:43 2005 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sun, 23 Oct 2005 23:17:43 -0500 Subject: [llvm-commits] CVS: llvm/test/Regression/Transforms/ProfilePaths/2002-05-22-CastCrash.ll dg.exp Message-ID: <200510240417.XAA29141@zion.cs.uiuc.edu> Changes in directory llvm/test/Regression/Transforms/ProfilePaths: 2002-05-22-CastCrash.ll (r1.2) removed dg.exp (r1.2) removed --- Log message: this pass is gone --- Diffs of the changes: (+0 -0) 0 files changed From lattner at cs.uiuc.edu Sun Oct 23 23:18:18 2005 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sun, 23 Oct 2005 23:18:18 -0500 Subject: [llvm-commits] CVS: llvm/test/Regression/Transforms/BranchCombine/2004-06-01-Simple.ll dg.exp Message-ID: <200510240418.XAA29202@zion.cs.uiuc.edu> Changes in directory llvm/test/Regression/Transforms/BranchCombine: 2004-06-01-Simple.ll (r1.1) removed dg.exp (r1.2) removed --- Log message: This pass is gone --- Diffs of the changes: (+0 -0) 0 files changed From lattner at cs.uiuc.edu Sun Oct 23 23:51:47 2005 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sun, 23 Oct 2005 23:51:47 -0500 Subject: [llvm-commits] CVS: llvm/lib/Target/SparcV8/SparcV8CodeEmitter.cpp Message-ID: <200510240451.XAA29349@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/SparcV8: SparcV8CodeEmitter.cpp updated: 1.4 -> 1.5 --- Log message: Make this build with GCC 4.1, patch contributed by Vladimir A. Merzliakov! --- Diffs of the changes: (+2 -2) SparcV8CodeEmitter.cpp | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) Index: llvm/lib/Target/SparcV8/SparcV8CodeEmitter.cpp diff -u llvm/lib/Target/SparcV8/SparcV8CodeEmitter.cpp:1.4 llvm/lib/Target/SparcV8/SparcV8CodeEmitter.cpp:1.5 --- llvm/lib/Target/SparcV8/SparcV8CodeEmitter.cpp:1.4 Thu Apr 21 18:21:30 2005 +++ llvm/lib/Target/SparcV8/SparcV8CodeEmitter.cpp Sun Oct 23 23:51:35 2005 @@ -181,6 +181,6 @@ abort(); } -#include "SparcV8GenCodeEmitter.inc" - } // end llvm namespace + +#include "SparcV8GenCodeEmitter.inc" From bocchino at persephone.cs.uiuc.edu Sun Oct 23 17:50:25 2005 From: bocchino at persephone.cs.uiuc.edu (Robert L. Bocchino Jr.) Date: Sun, 23 Oct 2005 17:50:25 -0500 (CDT) Subject: [llvm-commits] [vector_llvm] CVS: llvm/examples/SIMD/Makefile Makefile.common README.txt _malloc.c _malloc.h Message-ID: <20051023225025.26495180C0D2@persephone.cs.uiuc.edu> Changes in directory llvm/examples/SIMD: Makefile added (r1.1.2.1) Makefile.common added (r1.1.2.1) README.txt added (r1.1.2.1) _malloc.c added (r1.1.2.1) _malloc.h added (r1.1.2.1) --- Log message: Examples to illustrate Vector LLVM's SIMD support. --- Diffs of the changes: (+150 -0) Makefile | 28 ++++++++++++++++++ Makefile.common | 85 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ README.txt | 21 +++++++++++++ _malloc.c | 15 +++++++++ _malloc.h | 1 5 files changed, 150 insertions Index: llvm/examples/SIMD/Makefile diff -c /dev/null llvm/examples/SIMD/Makefile:1.1.2.1 *** /dev/null Sun Oct 23 17:50:11 2005 --- llvm/examples/SIMD/Makefile Sun Oct 23 17:49:30 2005 *************** *** 0 **** --- 1,28 ---- + all: + # Please specify altivec or sse! + + altivec: + make -C Saxpy altivec + make -C InterQuant altivec + make -C MADFilter altivec + make -C RGB2YUV altivec + make -C Transpose altivec + make -C DCT altivec + + sse: + make -C Saxpy sse + make -C InterQuant sse + make -C MADFilter sse + # Note that RGB2YUV doesn't currently work on SSE because of + # SSE's limited support for permute operations + make -C Transpose sse + make -C DCT sse + + clean: + make -C Saxpy clean + make -C InterQuant clean + make -C MADFilter clean + make -C RGB2YUV clean + make -C Transpose clean + make -C DCT clean + Index: llvm/examples/SIMD/Makefile.common diff -c /dev/null llvm/examples/SIMD/Makefile.common:1.1.2.1 *** /dev/null Sun Oct 23 17:50:25 2005 --- llvm/examples/SIMD/Makefile.common Sun Oct 23 17:49:30 2005 *************** *** 0 **** --- 1,85 ---- + LLVMSRCDIR= $(HOME)/llvm/src + LLVMGCCFLAGS += -I$(LLVMSRCDIR)/include/VectorC -I$(LLVMSRCDIR)/include/SIMD #-Wa,-unroll-threshold=200 + SSECFLAGS += -I$(LLVMSRCDIR)/include/SIMD -msse2 -O2 + ALTIVECCFLAGS += -I$(LLVMSRCDIR)/include/SIMD -faltivec -O2 + + + # Specify how many runs you want here (for timing). You can also say + # NRUNS=n on the command line. + # + ifndef $(NRUNS) + NRUNS= 1 + endif + + all: + # Please specify altivec or sse! + + altivec: altivec.handwritten altivec.vectorc + ./altivec.handwritten + ./altivec.vectorc + + sse: sse.handwritten sse.vectorc + ./sse.handwritten + ./sse.vectorc + + # + # General stuff + # + main.bc : main.c + llvm-gcc $(LLVMGCCFLAGS) -DNRUNS=$(NRUNS) -c -o $@ $< + + $(NAME).vectorc.bc : $(NAME).vectorc.c + llvm-gcc $(LLVMGCCFLAGS) -c $< -o $@ + + $(NAME).raised.bc : $(NAME).vectorc.bc + opt -raisevectors < $< > $@ + + %.ll : %.bc + llvm-dis < $< > $@ + + clean: + rm -f altivec.handwritten sse.handwritten altivec.vectorc sse.vectorc *.o *.s *.bc *.exe *.ll *.cbe.c + + # + # AltiVec-specific stuff + # + ../_malloc.bc : ../_malloc.c + llvm-gcc $(LLVMGCCFLAGS) -DMEMALIGN=0 -c -o $@ $< + + altivec.handwritten: $(NAME).altivec.handwritten.c ../_malloc.c main.c + gcc $(ALTIVECCFLAGS) -DMEMALIGN=0 -DNRUNS=$(NRUNS) -o $@ $+ + + $(NAME).altivec.bc : $(NAME).raised.bc + opt < $< -altivec > $@ + + altivec.vectorc.bc: $(NAME).altivec.bc ../_malloc.bc main.bc + llvm-gcc $(LLVMGCCFLAGS) $+ -o altivec.vectorc + + altivec.vectorc.cbe.c: altivec.vectorc.bc + llc -march=altivec-c < $< | sed 's/_2E_/_/g' > $@ + + altivec.vectorc: altivec.vectorc.cbe.c + gcc $(ALTIVECCFLAGS) -o $@ $< + + # + # SSE-specific stuff + # + ../_malloc.memalign.bc : ../_malloc.c + llvm-gcc $(LLVMGCCFLAGS) -DMEMALIGN=1 -c -o $@ $< + + sse.handwritten: $(NAME).sse.handwritten.c ../_malloc.c main.c + gcc $(SSECFLAGS) -DMEMALIGN=1 -DNRUNS=$(NRUNS) -o $@ $+ + + $(NAME).sse.bc : $(NAME).raised.bc + opt < $< -sse > $@ + + sse.vectorc.bc: $(NAME).sse.bc ../_malloc.memalign.bc main.bc + llvm-gcc $(LLVMGCCFLAGS) $+ -o sse.vectorc + + sse.vectorc.cbe.c: sse.vectorc.bc + llc -march=sse-c < $< | sed 's/_2E_/_/g' > $@ + + sse.vectorc: sse.vectorc.cbe.c + gcc $(SSECFLAGS) -o $@ $< + + Index: llvm/examples/SIMD/README.txt diff -c /dev/null llvm/examples/SIMD/README.txt:1.1.2.1 *** /dev/null Sun Oct 23 17:50:25 2005 --- llvm/examples/SIMD/README.txt Sun Oct 23 17:49:30 2005 *************** *** 0 **** --- 1,21 ---- + SIMD Examples + ============= + + Rob Bocchino + October 23, 2005 + + This directory illustrates the enhanced support for SIMD operations + provided by Vector LLVM. It provides several benchmarks handcoded in + Vector C, AltiVec-C, and SSE-C, together with a build environment for + running and timing all three versions. Except for RGB2YUV (which + works only for AltiVec, because of SSE's limited support for permute + operations), the same Vector C version compiles to both AltiVec and + SSE. + + To run the benchmarks on AltiVec, type make altivec in this directory. + To run the benchmarks on SSE, type make sse. To run the benchmarks on + SSE, your platform must support SSE2. + + For more information on Vector C and the AltiVec and SSE C backends, + see the documents VectorCReference.txt and SIMDCReference.txt in the + directory ../../docs. Index: llvm/examples/SIMD/_malloc.c diff -c /dev/null llvm/examples/SIMD/_malloc.c:1.1.2.1 *** /dev/null Sun Oct 23 17:50:25 2005 --- llvm/examples/SIMD/_malloc.c Sun Oct 23 17:49:30 2005 *************** *** 0 **** --- 1,15 ---- + #ifndef MEMALIGN + #error MEMALIGN must be defined on compiler command line! + #endif + + #if MEMALIGN + #include + #endif + + void *_malloc(unsigned int len) { + #if MEMALIGN + return memalign(16, len); + #else + return malloc(len); + #endif + } Index: llvm/examples/SIMD/_malloc.h diff -c /dev/null llvm/examples/SIMD/_malloc.h:1.1.2.1 *** /dev/null Sun Oct 23 17:50:25 2005 --- llvm/examples/SIMD/_malloc.h Sun Oct 23 17:49:30 2005 *************** *** 0 **** --- 1 ---- + void *_malloc(unsigned int);