Fix for PR 26381
authorNemanja Ivanovic <nemanja.i.ibm@gmail.com>
Wed, 3 Feb 2016 12:53:38 +0000 (12:53 +0000)
committerNemanja Ivanovic <nemanja.i.ibm@gmail.com>
Wed, 3 Feb 2016 12:53:38 +0000 (12:53 +0000)
Simple fix - Constant values were not being sign extended in FastIsel.

llvm-svn: 259645

llvm/lib/Target/PowerPC/PPCFastISel.cpp

index c4090fb..795fd6d 100644 (file)
@@ -2105,7 +2105,7 @@ unsigned PPCFastISel::PPCMaterializeInt(const ConstantInt *CI, MVT VT,
   }
 
   // Construct the constant piecewise.
-  int64_t Imm = CI->getZExtValue();
+  int64_t Imm = UseSExt ? CI->getSExtValue() : CI->getZExtValue();
   if (VT == MVT::i64)
     return PPCMaterialize64BitInt(Imm, RC);
   else if (VT == MVT::i32)