Enable printing of immediates that do not fit in 16-bit. .cprestore can have

offsets that are larger than 0x10000.

llvm-svn: 132003
This commit is contained in:
Akira Hatanaka 2011-05-24 21:22:21 +00:00
parent 685b2b080f
commit 2db176c4c1
4 changed files with 4 additions and 4 deletions

View 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:

View 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);

View 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

View 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);