[llvm] r245285 - [mips] Correct -Woverflow warning in r245208 without changing signedness of the constant.

Daniel Sanders via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 18 02:55:58 PDT 2015


Author: dsanders
Date: Tue Aug 18 04:55:57 2015
New Revision: 245285

URL: http://llvm.org/viewvc/llvm-project?rev=245285&view=rev
Log:
[mips] Correct -Woverflow warning in r245208 without changing signedness of the constant.

This was supposed to have been committed as part of r245208

Modified:
    llvm/trunk/lib/Target/Mips/AsmParser/MipsAsmParser.cpp

Modified: llvm/trunk/lib/Target/Mips/AsmParser/MipsAsmParser.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Mips/AsmParser/MipsAsmParser.cpp?rev=245285&r1=245284&r2=245285&view=diff
==============================================================================
--- llvm/trunk/lib/Target/Mips/AsmParser/MipsAsmParser.cpp (original)
+++ llvm/trunk/lib/Target/Mips/AsmParser/MipsAsmParser.cpp Tue Aug 18 04:55:57 2015
@@ -1755,7 +1755,7 @@ void emitRX(unsigned Opcode, unsigned Re
   Instructions.push_back(tmpInst);
 }
 
-void emitRI(unsigned Opcode, unsigned Reg0, int16_t Imm, SMLoc IDLoc,
+void emitRI(unsigned Opcode, unsigned Reg0, int32_t Imm, SMLoc IDLoc,
             SmallVectorImpl<MCInst> &Instructions) {
   emitRX(Opcode, Reg0, MCOperand::createImm(Imm), IDLoc, Instructions);
 }
@@ -1934,7 +1934,7 @@ bool MipsAsmParser::loadImmediate(int64_
       // Traditional behaviour seems to special case this particular value. It's
       // not clear why other masks are handled differently.
       if (ImmValue == 0xffffffff) {
-        emitRI(Mips::LUi, TmpReg, -1, IDLoc, Instructions);
+        emitRI(Mips::LUi, TmpReg, 0xffff, IDLoc, Instructions);
         emitRRI(Mips::DSRL32, TmpReg, TmpReg, 0, IDLoc, Instructions);
         if (UseSrcReg)
           emitRRR(AdduOp, DstReg, TmpReg, SrcReg, IDLoc, Instructions);




More information about the llvm-commits mailing list