[llvm-commits] [llvm] r171261 - in /llvm/trunk: lib/CodeGen/SelectionDAG/SelectionDAG.cpp test/CodeGen/PowerPC/sdag-ppcf128.ll

Hal Finkel hfinkel at anl.gov
Sun Dec 30 11:03:32 PST 2012


Author: hfinkel
Date: Sun Dec 30 13:03:32 2012
New Revision: 171261

URL: http://llvm.org/viewvc/llvm-project?rev=171261&view=rev
Log:
Support ppcf128 in SelectionDAG::getConstantFP

Fixes pr14751.

Patch by Kai; Thanks!

Added:
    llvm/trunk/test/CodeGen/PowerPC/sdag-ppcf128.ll
Modified:
    llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp

Modified: llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp?rev=171261&r1=171260&r2=171261&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp (original)
+++ llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp Sun Dec 30 13:03:32 2012
@@ -1075,7 +1075,8 @@
     return getConstantFP(APFloat((float)Val), VT, isTarget);
   else if (EltVT==MVT::f64)
     return getConstantFP(APFloat(Val), VT, isTarget);
-  else if (EltVT==MVT::f80 || EltVT==MVT::f128 || EltVT==MVT::f16) {
+  else if (EltVT==MVT::f80 || EltVT==MVT::f128 || EltVT==MVT::ppcf128 ||
+           EltVT==MVT::f16) {
     bool ignored;
     APFloat apf = APFloat(Val);
     apf.convert(*EVTToAPFloatSemantics(EltVT), APFloat::rmNearestTiesToEven,

Added: llvm/trunk/test/CodeGen/PowerPC/sdag-ppcf128.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/PowerPC/sdag-ppcf128.ll?rev=171261&view=auto
==============================================================================
--- llvm/trunk/test/CodeGen/PowerPC/sdag-ppcf128.ll (added)
+++ llvm/trunk/test/CodeGen/PowerPC/sdag-ppcf128.ll Sun Dec 30 13:03:32 2012
@@ -0,0 +1,15 @@
+; RUN: llc -mtriple=powerpc64-unknown-linux-gnu < %s | FileCheck %s
+;
+; PR14751: Unsupported type in SelectionDAG::getConstantFP()
+
+define fastcc void @_D3std4math4sqrtFNaNbNfcZc() {
+entry:
+  br i1 undef, label %if, label %else
+; CHECK: cmplwi 0, 3, 0
+if:                                               ; preds = %entry
+  store { ppc_fp128, ppc_fp128 } zeroinitializer, { ppc_fp128, ppc_fp128 }* undef
+  ret void
+
+else:                                             ; preds = %entry
+  unreachable
+}





More information about the llvm-commits mailing list