summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/Mips/InstPrinter/MipsInstPrinter.cpp
diff options
context:
space:
mode:
authorAkira Hatanaka <ahatanaka@mips.com>2012-07-05 19:26:38 +0000
committerAkira Hatanaka <ahatanaka@mips.com>2012-07-05 19:26:38 +0000
commit7d33c78e3ba084dc608432db1189aad63e005215 (patch)
tree696568073d0d7202fb70142e1e5b3ba0f7de3044 /llvm/lib/Target/Mips/InstPrinter/MipsInstPrinter.cpp
parent9c6f1f7f2387bd708d37ddc9c64d56fec96602f9 (diff)
downloadbcm5719-llvm-7d33c78e3ba084dc608432db1189aad63e005215.tar.gz
bcm5719-llvm-7d33c78e3ba084dc608432db1189aad63e005215.zip
Enclose instruction rdhwr with directives, which are needed when target is
mips32 rev1 (the directives are emitted when target is mips32r2 too). llvm-svn: 159770
Diffstat (limited to 'llvm/lib/Target/Mips/InstPrinter/MipsInstPrinter.cpp')
-rw-r--r--llvm/lib/Target/Mips/InstPrinter/MipsInstPrinter.cpp18
1 files changed, 18 insertions, 0 deletions
diff --git a/llvm/lib/Target/Mips/InstPrinter/MipsInstPrinter.cpp b/llvm/lib/Target/Mips/InstPrinter/MipsInstPrinter.cpp
index 6886b174524..227fd387f2c 100644
--- a/llvm/lib/Target/Mips/InstPrinter/MipsInstPrinter.cpp
+++ b/llvm/lib/Target/Mips/InstPrinter/MipsInstPrinter.cpp
@@ -13,6 +13,7 @@
#define DEBUG_TYPE "asm-printer"
#include "MipsInstPrinter.h"
+#include "MipsInstrInfo.h"
#include "llvm/ADT/StringExtras.h"
#include "llvm/MC/MCExpr.h"
#include "llvm/MC/MCInst.h"
@@ -68,8 +69,25 @@ void MipsInstPrinter::printRegName(raw_ostream &OS, unsigned RegNo) const {
void MipsInstPrinter::printInst(const MCInst *MI, raw_ostream &O,
StringRef Annot) {
+ switch (MI->getOpcode()) {
+ default:
+ break;
+ case Mips::RDHWR:
+ case Mips::RDHWR64:
+ O << "\t.set\tpush\n";
+ O << "\t.set\tmips32r2\n";
+ }
+
printInstruction(MI, O);
printAnnotation(O, Annot);
+
+ switch (MI->getOpcode()) {
+ default:
+ break;
+ case Mips::RDHWR:
+ case Mips::RDHWR64:
+ O << "\n\t.set\tpop";
+ }
}
static void printExpr(const MCExpr *Expr, raw_ostream &OS) {
OpenPOWER on IntegriCloud