[llvm-commits] [llvm] r53435 - /llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
Chris Lattner
sabre at nondot.org
Thu Jul 10 16:46:13 PDT 2008
Author: lattner
Date: Thu Jul 10 18:46:13 2008
New Revision: 53435
URL: http://llvm.org/viewvc/llvm-project?rev=53435&view=rev
Log:
Fix a bug in the soft-float handling of FCOPYSIGN that Duncan noticed
when working on legalizetypes. Both legalizetypes and legalizeops now
produce hte same code for CodeGen/ARM/fcopysign.ll.
Modified:
llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
Modified: llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp?rev=53435&r1=53434&r2=53435&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp (original)
+++ llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp Thu Jul 10 18:46:13 2008
@@ -547,8 +547,11 @@
SignBit = DAG.getNode(ISD::SRL, SrcNVT, SignBit,
DAG.getConstant(SizeDiff, TLI.getShiftAmountTy()));
SignBit = DAG.getNode(ISD::TRUNCATE, NVT, SignBit);
- } else if (SizeDiff < 0)
- SignBit = DAG.getNode(ISD::SIGN_EXTEND, NVT, SignBit);
+ } else if (SizeDiff < 0) {
+ SignBit = DAG.getNode(ISD::ZERO_EXTEND, NVT, SignBit);
+ SignBit = DAG.getNode(ISD::SHL, NVT, SignBit,
+ DAG.getConstant(-SizeDiff, TLI.getShiftAmountTy()));
+ }
// Clear the sign bit of first operand.
SDOperand Mask2 = (VT == MVT::f64)
More information about the llvm-commits
mailing list