[llvm-commits] [llvm] r58642 - /llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeFloatTypes.cpp

Dale Johannesen dalej at apple.com
Mon Nov 3 12:47:45 PST 2008


Author: johannes
Date: Mon Nov  3 14:47:45 2008
New Revision: 58642

URL: http://llvm.org/viewvc/llvm-project?rev=58642&view=rev
Log:
Fix some ppcf128 regressions:  make ExpandFloatRes_LOAD
work correctly, and bring over a late change to ppcf128
SetCC handling.


Modified:
    llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeFloatTypes.cpp

Modified: llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeFloatTypes.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeFloatTypes.cpp?rev=58642&r1=58641&r2=58642&view=diff

==============================================================================
--- llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeFloatTypes.cpp (original)
+++ llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeFloatTypes.cpp Mon Nov  3 14:47:45 2008
@@ -885,16 +885,16 @@
   assert(NVT.isByteSized() && "Expanded type not byte sized!");
   assert(LD->getMemoryVT().bitsLE(NVT) && "Float type not round?");
 
-  Lo = DAG.getExtLoad(LD->getExtensionType(), NVT, Chain, Ptr,
+  Hi = DAG.getExtLoad(LD->getExtensionType(), NVT, Chain, Ptr,
                       LD->getSrcValue(), LD->getSrcValueOffset(),
                       LD->getMemoryVT(),
                       LD->isVolatile(), LD->getAlignment());
 
   // Remember the chain.
-  Chain = Lo.getValue(1);
+  Chain = Hi.getValue(1);
 
-  // The high part is undefined.
-  Hi = DAG.getNode(ISD::UNDEF, NVT);
+  // The low part is zero.
+  Lo = DAG.getConstantFP(APFloat(APInt(NVT.getSizeInBits(), 0)), NVT);
 
   // Modified the chain - switch anything that used the old chain to use the
   // new one.
@@ -1039,15 +1039,15 @@
   assert(VT == MVT::ppcf128 && "Unsupported setcc type!");
 
   // FIXME:  This generated code sucks.  We want to generate
-  //         FCMP crN, hi1, hi2
+  //         FCMPU crN, hi1, hi2
   //         BNE crN, L:
-  //         FCMP crN, lo1, lo2
+  //         FCMPU crN, lo1, lo2
   // The following can be improved, but not that much.
   SDValue Tmp1, Tmp2, Tmp3;
-  Tmp1 = DAG.getSetCC(TLI.getSetCCResultType(LHSHi), LHSHi, RHSHi, ISD::SETEQ);
+  Tmp1 = DAG.getSetCC(TLI.getSetCCResultType(LHSHi), LHSHi, RHSHi, ISD::SETOEQ);
   Tmp2 = DAG.getSetCC(TLI.getSetCCResultType(LHSLo), LHSLo, RHSLo, CCCode);
   Tmp3 = DAG.getNode(ISD::AND, Tmp1.getValueType(), Tmp1, Tmp2);
-  Tmp1 = DAG.getSetCC(TLI.getSetCCResultType(LHSHi), LHSHi, RHSHi, ISD::SETNE);
+  Tmp1 = DAG.getSetCC(TLI.getSetCCResultType(LHSHi), LHSHi, RHSHi, ISD::SETUNE);
   Tmp2 = DAG.getSetCC(TLI.getSetCCResultType(LHSHi), LHSHi, RHSHi, CCCode);
   Tmp1 = DAG.getNode(ISD::AND, Tmp1.getValueType(), Tmp1, Tmp2);
   NewLHS = DAG.getNode(ISD::OR, Tmp1.getValueType(), Tmp1, Tmp3);





More information about the llvm-commits mailing list