Enable printing of immediates that do not fit in 16-bit. .cprestore can have
authorAkira Hatanaka <ahatanak@gmail.com>
Tue, 24 May 2011 21:22:21 +0000 (21:22 +0000)
committerAkira Hatanaka <ahatanak@gmail.com>
Tue, 24 May 2011 21:22:21 +0000 (21:22 +0000)
offsets that are larger than 0x10000.

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

lib/Target/Mips/MipsAsmPrinter.cpp
lib/Target/Mips/MipsFrameLowering.cpp
lib/Target/Mips/MipsInstrInfo.td
lib/Target/Mips/MipsRegisterInfo.cpp

index c03428af2664ae7d436ed73a97932f15b1dd7b0f..565e02ac74b4497cae438845d59afcd282015665 100644 (file)
@@ -326,7 +326,7 @@ void MipsAsmPrinter::printOperand(const MachineInstr *MI, int opNum,
       break;
 
     case MachineOperand::MO_Immediate:
-      O << (short int)MO.getImm();
+      O << MO.getImm();
       break;
 
     case MachineOperand::MO_MachineBasicBlock:
index ff86ec68d34627d87c8c254fe98f900e897fb0fc..3291853bf891cd82eebea8174fdac7772b5992bf 100644 (file)
@@ -119,7 +119,7 @@ static bool expandRegLargeImmPair(unsigned OrigReg, int OrigImm,
   MachineFunction* MF = MBB.getParent();
   const TargetInstrInfo *TII = MF->getTarget().getInstrInfo();
   DebugLoc DL = I->getDebugLoc();
-  int ImmLo = OrigImm & 0xffff;
+  int ImmLo = (short)(OrigImm & 0xffff);
   int ImmHi = (((unsigned)OrigImm & 0xffff0000) >> 16) +
               ((OrigImm & 0x8000) != 0);
 
index 07be0ac6976388c3ec102fe89bfe1242f3a7f832..eff28b5b91136315917705180131bcc483934998 100644 (file)
@@ -380,7 +380,7 @@ def ATMACRO   : MipsPseudo<(outs), (ins), ".set\tat", []>;
 // are used, we have the same behavior, but get also a bunch of warnings
 // from the assembler.
 def CPLOAD : MipsPseudo<(outs), (ins CPURegs:$picreg), ".cpload\t$picreg", []>;
-def CPRESTORE : MipsPseudo<(outs), (ins uimm16:$loc), ".cprestore\t$loc\n", []>;
+def CPRESTORE : MipsPseudo<(outs), (ins i32imm:$loc), ".cprestore\t$loc\n", []>;
 
 //===----------------------------------------------------------------------===//
 // Instruction definition
index 00e2063798b523b450c0926d012a2399767150dd..be6706544c2bcdd23996269577d2b5f7133dfadc 100644 (file)
@@ -234,7 +234,7 @@ eliminateFrameIndex(MachineBasicBlock::iterator II, int SPAdj,
   else {
     const TargetInstrInfo *TII = MF.getTarget().getInstrInfo();
     DebugLoc DL = II->getDebugLoc();
-    int ImmLo = Offset & 0xffff;
+    int ImmLo = (short)(Offset & 0xffff);
     int ImmHi = (((unsigned)Offset & 0xffff0000) >> 16) +
                 ((Offset & 0x8000) != 0);