summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/Mips/InstPrinter/MipsInstPrinter.cpp
diff options
context:
space:
mode:
authorAkira Hatanaka <ahatanaka@mips.com>2013-07-29 19:08:34 +0000
committerAkira Hatanaka <ahatanaka@mips.com>2013-07-29 19:08:34 +0000
commit52dd808bc361353d51f6f1bc166c3ff2afa00589 (patch)
tree687b04556f1120c19ea4867947d50ab5b9e0c605 /llvm/lib/Target/Mips/InstPrinter/MipsInstPrinter.cpp
parent7c6e79f39597f4876c8c18d93add252b8b5e9138 (diff)
downloadbcm5719-llvm-52dd808bc361353d51f6f1bc166c3ff2afa00589.tar.gz
bcm5719-llvm-52dd808bc361353d51f6f1bc166c3ff2afa00589.zip
[mips] Add comment and simplify function.
llvm-svn: 187371
Diffstat (limited to 'llvm/lib/Target/Mips/InstPrinter/MipsInstPrinter.cpp')
-rw-r--r--llvm/lib/Target/Mips/InstPrinter/MipsInstPrinter.cpp37
1 files changed, 14 insertions, 23 deletions
diff --git a/llvm/lib/Target/Mips/InstPrinter/MipsInstPrinter.cpp b/llvm/lib/Target/Mips/InstPrinter/MipsInstPrinter.cpp
index 6babb74ba00..a2098a0f8c0 100644
--- a/llvm/lib/Target/Mips/InstPrinter/MipsInstPrinter.cpp
+++ b/llvm/lib/Target/Mips/InstPrinter/MipsInstPrinter.cpp
@@ -230,35 +230,26 @@ bool MipsInstPrinter::printAlias(const char *Str, const MCInst &MI,
bool MipsInstPrinter::printAlias(const MCInst &MI, raw_ostream &OS) {
switch (MI.getOpcode()) {
case Mips::BEQ:
- if (isReg<Mips::ZERO>(MI, 1) && printAlias("beqz", MI, 0, 2, OS))
- return true;
- break;
+ // beq $r0, $zero, $L2 => beqz $r0, $L2
+ return isReg<Mips::ZERO>(MI, 1) && printAlias("beqz", MI, 0, 2, OS);
case Mips::BEQ64:
- if (isReg<Mips::ZERO_64>(MI, 1) && printAlias("beqz", MI, 0, 2, OS))
- return true;
- break;
+ // beq $r0, $zero, $L2 => beqz $r0, $L2
+ return isReg<Mips::ZERO_64>(MI, 1) && printAlias("beqz", MI, 0, 2, OS);
case Mips::BNE:
- if (isReg<Mips::ZERO>(MI, 1) && printAlias("bnez", MI, 0, 2, OS))
- return true;
- break;
+ // bne $r0, $zero, $L2 => bnez $r0, $L2
+ return isReg<Mips::ZERO>(MI, 1) && printAlias("bnez", MI, 0, 2, OS);
case Mips::BNE64:
- if (isReg<Mips::ZERO_64>(MI, 1) && printAlias("bnez", MI, 0, 2, OS))
- return true;
- break;
+ // bne $r0, $zero, $L2 => bnez $r0, $L2
+ return isReg<Mips::ZERO_64>(MI, 1) && printAlias("bnez", MI, 0, 2, OS);
case Mips::BC1T:
- if (isReg<Mips::FCC0>(MI, 0) && printAlias("bc1t", MI, 1, OS))
- return true;
- break;
+ // bc1t $fcc0, $L1 => bc1t $L1
+ return isReg<Mips::FCC0>(MI, 0) && printAlias("bc1t", MI, 1, OS);
case Mips::BC1F:
- if (isReg<Mips::FCC0>(MI, 0) && printAlias("bc1f", MI, 1, OS))
- return true;
- break;
+ // bc1f $fcc0, $L1 => bc1f $L1
+ return isReg<Mips::FCC0>(MI, 0) && printAlias("bc1f", MI, 1, OS);
case Mips::OR:
- if (isReg<Mips::ZERO>(MI, 2) && printAlias("move", MI, 0, 1, OS))
- return true;
- break;
+ // or $r0, $r1, $zero => move $r0, $r1
+ return isReg<Mips::ZERO>(MI, 2) && printAlias("move", MI, 0, 1, OS);
default: return false;
}
-
- return false;
}
OpenPOWER on IntegriCloud