fix a regression that I introduced. stdu should scale the offset by 4

before printing it.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31791 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Chris Lattner 2006-11-16 21:45:30 +00:00
parent 73b00947e7
commit 1b0a2d8370
2 changed files with 11 additions and 2 deletions

View File

@ -127,7 +127,16 @@ namespace {
O << (unsigned short)MI->getOperand(OpNo).getImmedValue();
}
void printS16X4ImmOperand(const MachineInstr *MI, unsigned OpNo) {
O << (short)(MI->getOperand(OpNo).getImmedValue()*4);
if (MI->getOperand(OpNo).isImmediate()) {
O << (short)(MI->getOperand(OpNo).getImmedValue()*4);
} else {
O << "lo16(";
printOp(MI->getOperand(OpNo));
if (TM.getRelocationModel() == Reloc::PIC_)
O << "-\"L" << getFunctionNumber() << "$pb\")";
else
O << ')';
}
}
void printBranchOperand(const MachineInstr *MI, unsigned OpNo) {
// Branches can take an immediate operand. This is used by the branch

View File

@ -413,7 +413,7 @@ def STWU8 : DForm_1<37, (ops ptr_rc:$ea_res, G8RC:$rS,
def STDU : DSForm_1<62, 1, (ops ptr_rc:$ea_res, G8RC:$rS,
symbolLo:$ptroff, ptr_rc:$ptrreg),
s16immX4:$ptroff, ptr_rc:$ptrreg),
"stdu $rS, $ptroff($ptrreg)", LdStSTD,
[(set ptr_rc:$ea_res, (pre_store G8RC:$rS, ptr_rc:$ptrreg,
iaddroff:$ptroff))]>,