[mips] Correct -Woverflow warning in r245208 without changing signedness of the constant.
authorDaniel Sanders <daniel.sanders@imgtec.com>
Tue, 18 Aug 2015 09:55:57 +0000 (09:55 +0000)
committerDaniel Sanders <daniel.sanders@imgtec.com>
Tue, 18 Aug 2015 09:55:57 +0000 (09:55 +0000)
This was supposed to have been committed as part of r245208

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@245285 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/Mips/AsmParser/MipsAsmParser.cpp

index 393c9e79cfbee1701383f3086a18247a243ad560..2d82b35cc6e7a6c1754273cf31f8f19e9ecb775c 100644 (file)
@@ -1755,7 +1755,7 @@ void emitRX(unsigned Opcode, unsigned Reg0, MCOperand Op1, SMLoc IDLoc,
   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_t ImmValue, unsigned DstReg,
       // 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);