From 9864b08f94188e2921df93062e431aa0e8bb833f Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Wed, 12 Jan 2005 18:19:52 +0000 Subject: Fix sign extend to long. When coming from sbyte, we used to generate: movsbl 4(%esp), %eax movl %eax, %edx sarl $7, %edx Now we generate: movsbl 4(%esp), %eax movl %eax, %edx sarl $31, %edx Which is right. llvm-svn: 19515 --- llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp') diff --git a/llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp b/llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp index f3b344bb8c1..64c686efc67 100644 --- a/llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp @@ -805,8 +805,8 @@ void SelectionDAGLegalize::ExpandOp(SDOperand Op, SDOperand &Lo, SDOperand &Hi){ // The high part is obtained by SRA'ing all but one of the bits of the lo // part. - unsigned SrcSize = MVT::getSizeInBits(Node->getOperand(0).getValueType()); - Hi = DAG.getNode(ISD::SRA, NVT, Lo, DAG.getConstant(SrcSize-1, MVT::i8)); + unsigned LoSize = MVT::getSizeInBits(Lo.getValueType()); + Hi = DAG.getNode(ISD::SRA, NVT, Lo, DAG.getConstant(LoSize-1, MVT::i8)); break; } case ISD::ZERO_EXTEND: -- cgit v1.2.3