diff options
author | Dan Gohman <gohman@apple.com> | 2008-09-12 16:56:44 +0000 |
---|---|---|
committer | Dan Gohman <gohman@apple.com> | 2008-09-12 16:56:44 +0000 |
commit | f5aeb1a8e4cf272c7348376d185ef8d8267653e0 (patch) | |
tree | 26c1d701871fd86197411a728c2dfde5c805254b /lib/Target/Sparc | |
parent | 0e3b7b2f91427807c3f544e96818072cc804e1d3 (diff) | |
download | external_llvm-f5aeb1a8e4cf272c7348376d185ef8d8267653e0.zip external_llvm-f5aeb1a8e4cf272c7348376d185ef8d8267653e0.tar.gz external_llvm-f5aeb1a8e4cf272c7348376d185ef8d8267653e0.tar.bz2 |
Rename ConstantSDNode::getValue to getZExtValue, for consistency
with ConstantInt. This led to fixing a bug in TargetLowering.cpp
using getValue instead of getAPIntValue.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56159 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/Sparc')
-rw-r--r-- | lib/Target/Sparc/SparcISelDAGToDAG.cpp | 2 | ||||
-rw-r--r-- | lib/Target/Sparc/SparcISelLowering.cpp | 13 | ||||
-rw-r--r-- | lib/Target/Sparc/SparcInstrInfo.td | 14 |
3 files changed, 17 insertions, 12 deletions
diff --git a/lib/Target/Sparc/SparcISelDAGToDAG.cpp b/lib/Target/Sparc/SparcISelDAGToDAG.cpp index f9baa3b..4a3ca7f 100644 --- a/lib/Target/Sparc/SparcISelDAGToDAG.cpp +++ b/lib/Target/Sparc/SparcISelDAGToDAG.cpp @@ -91,7 +91,7 @@ bool SparcDAGToDAGISel::SelectADDRri(SDValue Op, SDValue Addr, } else { Base = Addr.getOperand(0); } - Offset = CurDAG->getTargetConstant(CN->getValue(), MVT::i32); + Offset = CurDAG->getTargetConstant(CN->getZExtValue(), MVT::i32); return true; } } diff --git a/lib/Target/Sparc/SparcISelLowering.cpp b/lib/Target/Sparc/SparcISelLowering.cpp index e469422..07b108d 100644 --- a/lib/Target/Sparc/SparcISelLowering.cpp +++ b/lib/Target/Sparc/SparcISelLowering.cpp @@ -224,10 +224,10 @@ SparcTargetLowering::LowerArguments(Function &F, SelectionDAG &DAG, } static SDValue LowerCALL(SDValue Op, SelectionDAG &DAG) { - unsigned CallingConv = cast<ConstantSDNode>(Op.getOperand(1))->getValue(); + unsigned CallingConv = cast<ConstantSDNode>(Op.getOperand(1))->getZExtValue(); SDValue Chain = Op.getOperand(0); SDValue Callee = Op.getOperand(4); - bool isVarArg = cast<ConstantSDNode>(Op.getOperand(2))->getValue() != 0; + bool isVarArg = cast<ConstantSDNode>(Op.getOperand(2))->getZExtValue() != 0; #if 0 // Analyze operands of the call, assigning locations to each operand. @@ -691,7 +691,8 @@ void SparcTargetLowering::computeMaskedBitsForTargetNode(const SDValue Op, // set LHS/RHS and SPCC to the LHS/RHS of the setcc and SPCC to the condition. static void LookThroughSetCC(SDValue &LHS, SDValue &RHS, ISD::CondCode CC, unsigned &SPCC) { - if (isa<ConstantSDNode>(RHS) && cast<ConstantSDNode>(RHS)->getValue() == 0 && + if (isa<ConstantSDNode>(RHS) && + cast<ConstantSDNode>(RHS)->getZExtValue() == 0 && CC == ISD::SETNE && ((LHS.getOpcode() == SPISD::SELECT_ICC && LHS.getOperand(3).getOpcode() == SPISD::CMPICC) || @@ -699,10 +700,10 @@ static void LookThroughSetCC(SDValue &LHS, SDValue &RHS, LHS.getOperand(3).getOpcode() == SPISD::CMPFCC)) && isa<ConstantSDNode>(LHS.getOperand(0)) && isa<ConstantSDNode>(LHS.getOperand(1)) && - cast<ConstantSDNode>(LHS.getOperand(0))->getValue() == 1 && - cast<ConstantSDNode>(LHS.getOperand(1))->getValue() == 0) { + cast<ConstantSDNode>(LHS.getOperand(0))->getZExtValue() == 1 && + cast<ConstantSDNode>(LHS.getOperand(1))->getZExtValue() == 0) { SDValue CMPCC = LHS.getOperand(3); - SPCC = cast<ConstantSDNode>(LHS.getOperand(2))->getValue(); + SPCC = cast<ConstantSDNode>(LHS.getOperand(2))->getZExtValue(); LHS = CMPCC.getOperand(0); RHS = CMPCC.getOperand(1); } diff --git a/lib/Target/Sparc/SparcInstrInfo.td b/lib/Target/Sparc/SparcInstrInfo.td index 3ceaf55..94d0859 100644 --- a/lib/Target/Sparc/SparcInstrInfo.td +++ b/lib/Target/Sparc/SparcInstrInfo.td @@ -45,25 +45,29 @@ def UseDeprecatedInsts : Predicate<"Subtarget.useDeprecatedV8Instructions()">; def simm11 : PatLeaf<(imm), [{ // simm11 predicate - True if the imm fits in a 11-bit sign extended field. - return (((int)N->getValue() << (32-11)) >> (32-11)) == (int)N->getValue(); + return (((int)N->getZExtValue() << (32-11)) >> (32-11)) == + (int)N->getZExtValue(); }]>; def simm13 : PatLeaf<(imm), [{ // simm13 predicate - True if the imm fits in a 13-bit sign extended field. - return (((int)N->getValue() << (32-13)) >> (32-13)) == (int)N->getValue(); + return (((int)N->getZExtValue() << (32-13)) >> (32-13)) == + (int)N->getZExtValue(); }]>; def LO10 : SDNodeXForm<imm, [{ - return CurDAG->getTargetConstant((unsigned)N->getValue() & 1023, MVT::i32); + return CurDAG->getTargetConstant((unsigned)N->getZExtValue() & 1023, + MVT::i32); }]>; def HI22 : SDNodeXForm<imm, [{ // Transformation function: shift the immediate value down into the low bits. - return CurDAG->getTargetConstant((unsigned)N->getValue() >> 10, MVT::i32); + return CurDAG->getTargetConstant((unsigned)N->getZExtValue() >> 10, MVT::i32); }]>; def SETHIimm : PatLeaf<(imm), [{ - return (((unsigned)N->getValue() >> 10) << 10) == (unsigned)N->getValue(); + return (((unsigned)N->getZExtValue() >> 10) << 10) == + (unsigned)N->getZExtValue(); }], HI22>; // Addressing modes. |