commit | 5990bd7ba645d6fd067d9f015f4f48a9b8bf872b | [log] [tgz] |
---|---|---|
author | Akira Hatanaka <ahatanaka@mips.com> | Wed Feb 22 00:16:54 2012 +0000 |
committer | Akira Hatanaka <ahatanaka@mips.com> | Wed Feb 22 00:16:54 2012 +0000 |
tree | 2cfcf19059823383d6775cc32163e73ec2f701e4 | |
parent | c76ad82140761093df698e1c959d79eba73f67d0 [diff] |
Use a function in MathExtras to do sign extension. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151107 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Target/Mips/MipsAnalyzeImmediate.cpp b/lib/Target/Mips/MipsAnalyzeImmediate.cpp index 26c7196..44c7769 100644 --- a/lib/Target/Mips/MipsAnalyzeImmediate.cpp +++ b/lib/Target/Mips/MipsAnalyzeImmediate.cpp
@@ -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))