[llvm-commits] [llvm] r151107 - /llvm/trunk/lib/Target/Mips/MipsAnalyzeImmediate.cpp
Akira Hatanaka
ahatanaka at mips.com
Tue Feb 21 16:16:54 PST 2012
Author: ahatanak
Date: Tue Feb 21 18:16:54 2012
New Revision: 151107
URL: http://llvm.org/viewvc/llvm-project?rev=151107&view=rev
Log:
Use a function in MathExtras to do sign extension.
Modified:
llvm/trunk/lib/Target/Mips/MipsAnalyzeImmediate.cpp
Modified: llvm/trunk/lib/Target/Mips/MipsAnalyzeImmediate.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Mips/MipsAnalyzeImmediate.cpp?rev=151107&r1=151106&r2=151107&view=diff
==============================================================================
--- llvm/trunk/lib/Target/Mips/MipsAnalyzeImmediate.cpp (original)
+++ llvm/trunk/lib/Target/Mips/MipsAnalyzeImmediate.cpp Tue Feb 21 18:16:54 2012
@@ -90,7 +90,7 @@
return;
// Sign-extend and shift operand of ADDiu and see if it still fits in 16-bit.
- int64_t Imm = (((int64_t)Seq[0].ImmOpnd) << 48) >> 48;
+ int64_t Imm = SignExtend64<16>(Seq[0].ImmOpnd);
int64_t ShiftedImm = Imm << (Seq[1].ImmOpnd - 16);
if (!isInt<16>(ShiftedImm))
More information about the llvm-commits
mailing list