[llvm-commits] CVS: llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp

Chris Lattner lattner at cs.uiuc.edu
Wed Jan 12 10:20:06 PST 2005



Changes in directory llvm/lib/CodeGen/SelectionDAG:

LegalizeDAG.cpp updated: 1.22 -> 1.23
---
Log message:

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.



---
Diffs of the changes:  (+2 -2)

Index: llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
diff -u llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp:1.22 llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp:1.23
--- llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp:1.22	Wed Jan 12 08:53:45 2005
+++ llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp	Wed Jan 12 12:19:52 2005
@@ -805,8 +805,8 @@
     
     // 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:






More information about the llvm-commits mailing list