Merging r259645:
authorHans Wennborg <hans@hanshq.net>
Wed, 3 Feb 2016 21:18:35 +0000 (21:18 +0000)
committerHans Wennborg <hans@hanshq.net>
Wed, 3 Feb 2016 21:18:35 +0000 (21:18 +0000)
------------------------------------------------------------------------
r259645 | nemanjai | 2016-02-03 04:53:38 -0800 (Wed, 03 Feb 2016) | 4 lines

Fix for PR 26381

Simple fix - Constant values were not being sign extended in FastIsel.

------------------------------------------------------------------------

git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_38@259698 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/PowerPC/PPCFastISel.cpp

index b451ebf..188c8e8 100644 (file)
@@ -2108,7 +2108,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);