summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/Mips/MipsAsmPrinter.cpp
diff options
context:
space:
mode:
authorBruno Cardoso Lopes <bruno.cardoso@gmail.com>2008-08-13 07:13:40 +0000
committerBruno Cardoso Lopes <bruno.cardoso@gmail.com>2008-08-13 07:13:40 +0000
commit92c64ae2d04126ad84f71cd749324db2b3e6a2cd (patch)
tree859697860ffe502cafd0a03960c27beb47dbf655 /llvm/lib/Target/Mips/MipsAsmPrinter.cpp
parent703a64c38de654831d53d2d29484995c3e6aca87 (diff)
downloadbcm5719-llvm-92c64ae2d04126ad84f71cd749324db2b3e6a2cd.tar.gz
bcm5719-llvm-92c64ae2d04126ad84f71cd749324db2b3e6a2cd.zip
Removed SELECT_CC custom lowering. This is not needed anymore, the SELECT node
is lowered properly and covers everything LowerSELECT_CC did. Added method printUnsignedImm in AsmPrinter to print uimm16 operands. This avoid the ugly instruction by instruction checking in printOperand. Added a swap instruction present in the allegrex core. Added two conditional instructions present in the allegrex core : MOVZ and MOVN. They both allow a more efficient SELECT operation for integers. Also added SELECT patterns to optimize MOVZ and MOVN usage. The brcond and setcc patterns were cleaned: redundant and suboptimal patterns were removed. The suboptimals were replaced by more efficient ones. Fixed some instructions that were using immZExt16 instead of immSExt16. llvm-svn: 54724
Diffstat (limited to 'llvm/lib/Target/Mips/MipsAsmPrinter.cpp')
-rw-r--r--llvm/lib/Target/Mips/MipsAsmPrinter.cpp18
1 files changed, 12 insertions, 6 deletions
diff --git a/llvm/lib/Target/Mips/MipsAsmPrinter.cpp b/llvm/lib/Target/Mips/MipsAsmPrinter.cpp
index 42979fc1475..6d502acec16 100644
--- a/llvm/lib/Target/Mips/MipsAsmPrinter.cpp
+++ b/llvm/lib/Target/Mips/MipsAsmPrinter.cpp
@@ -62,6 +62,7 @@ namespace {
bool PrintAsmOperand(const MachineInstr *MI, unsigned OpNo,
unsigned AsmVariant, const char *ExtraCode);
void printOperand(const MachineInstr *MI, int opNum);
+ void printUnsignedImm(const MachineInstr *MI, int opNum);
void printMemOperand(const MachineInstr *MI, int opNum,
const char *Modifier = 0);
void printFCCOperand(const MachineInstr *MI, int opNum,
@@ -383,11 +384,7 @@ printOperand(const MachineInstr *MI, int opNum)
break;
case MachineOperand::MO_Immediate:
- if ((MI->getOpcode() == Mips::SLTiu) || (MI->getOpcode() == Mips::ORi) ||
- (MI->getOpcode() == Mips::LUi) || (MI->getOpcode() == Mips::ANDi))
- O << (unsigned short int)MO.getImm();
- else
- O << (short int)MO.getImm();
+ O << (short int)MO.getImm();
break;
case MachineOperand::MO_MachineBasicBlock:
@@ -407,7 +404,6 @@ printOperand(const MachineInstr *MI, int opNum)
<< '_' << MO.getIndex();
break;
- // FIXME: Verify correct
case MachineOperand::MO_ConstantPoolIndex:
O << TAI->getPrivateGlobalPrefix() << "CPI"
<< getFunctionNumber() << "_" << MO.getIndex();
@@ -421,6 +417,16 @@ printOperand(const MachineInstr *MI, int opNum)
}
void MipsAsmPrinter::
+printUnsignedImm(const MachineInstr *MI, int opNum)
+{
+ const MachineOperand &MO = MI->getOperand(opNum);
+ if (MO.getType() == MachineOperand::MO_Immediate)
+ O << (unsigned short int)MO.getImm();
+ else
+ printOperand(MI, opNum);
+}
+
+void MipsAsmPrinter::
printMemOperand(const MachineInstr *MI, int opNum, const char *Modifier)
{
// when using stack locations for not load/store instructions
OpenPOWER on IntegriCloud