Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 27 Jun 2014 20:41:13 +0000 (UTC)
From:      Dimitry Andric <dim@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r267981 - head/contrib/llvm/lib/Target/PowerPC
Message-ID:  <201406272041.s5RKfDgg095096@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: dim
Date: Fri Jun 27 20:41:12 2014
New Revision: 267981
URL: http://svnweb.freebsd.org/changeset/base/267981

Log:
  Pull in r211627 from upstream llvm trunk (by Bill Schmidt):
  
    [PPC64] Fix PR20071 (fctiduz generated for targets lacking that
    instruction)
  
    PR20071 identifies a problem in PowerPC's fast-isel implementation
    for floating-point conversion to integer.  The fctiduz instruction
    was added in Power ISA 2.06 (i.e., Power7 and later).  However, this
    instruction is being generated regardless of which 64-bit PowerPC
    target is selected.
  
    The intent is for fast-isel to punt to DAG selection when this
    instruction is not available.  This patch implements that change.
    For testing purposes, the existing fast-isel-conversion.ll test adds
    a RUN line for -mcpu=970 and tests for the expected code generation.
    Additionally, the existing test fast-isel-conversion-p5.ll was found
    to be incorrectly expecting the unavailable instruction to be
    generated.  I've removed these test variants since we have adequate
    coverage in fast-isel-conversion.ll.
  
  This is needed to compile clang with debug+asserts on older powerpc64
  and ppc970 targets.
  
  Requested by:	jhibbits
  MFC after:	3 days

Modified:
  head/contrib/llvm/lib/Target/PowerPC/PPCFastISel.cpp

Modified: head/contrib/llvm/lib/Target/PowerPC/PPCFastISel.cpp
==============================================================================
--- head/contrib/llvm/lib/Target/PowerPC/PPCFastISel.cpp	Fri Jun 27 20:39:45 2014	(r267980)
+++ head/contrib/llvm/lib/Target/PowerPC/PPCFastISel.cpp	Fri Jun 27 20:41:12 2014	(r267981)
@@ -1026,6 +1026,10 @@ bool PPCFastISel::SelectFPToI(const Inst
   if (DstVT != MVT::i32 && DstVT != MVT::i64)
     return false;
 
+  // If we don't have FCTIDUZ and we need it, punt to SelectionDAG.
+  if (DstVT == MVT::i64 && !IsSigned && !PPCSubTarget->hasFPCVT())
+    return false;
+
   Value *Src = I->getOperand(0);
   Type *SrcTy = Src->getType();
   if (!isTypeLegal(SrcTy, SrcVT))



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201406272041.s5RKfDgg095096>