summaryrefslogtreecommitdiff
path: root/lib/Target/MBlaze/InstPrinter/MBlazeInstPrinter.cpp
diff options
context:
space:
mode:
authorWesley Peck <peckw@wesleypeck.com>2010-11-12 23:30:17 +0000
committerWesley Peck <peckw@wesleypeck.com>2010-11-12 23:30:17 +0000
commit41400da31ead2f61d171381c0945dceddd8fc786 (patch)
tree898cd0b814424757ed392088391a3a6b946c97e9 /lib/Target/MBlaze/InstPrinter/MBlazeInstPrinter.cpp
parent522ad74e4bd27e9156916ed58dd5c7f1a17a541d (diff)
downloadllvm-41400da31ead2f61d171381c0945dceddd8fc786.tar.gz
llvm-41400da31ead2f61d171381c0945dceddd8fc786.tar.bz2
llvm-41400da31ead2f61d171381c0945dceddd8fc786.tar.xz
1. Finishing MBlaze MC asm parser test cases
2. Parsing .word directive in MBlaze asm parser 3. Fixing hack where memory instructions reversed order of last two parameters 4. Fixing many improperly encoded instructions 5. Support parsing special instructions (MFS,MTS,etc.) 6. Removing unused functions from inst printer git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118941 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/MBlaze/InstPrinter/MBlazeInstPrinter.cpp')
-rw-r--r--lib/Target/MBlaze/InstPrinter/MBlazeInstPrinter.cpp75
1 files changed, 2 insertions, 73 deletions
diff --git a/lib/Target/MBlaze/InstPrinter/MBlazeInstPrinter.cpp b/lib/Target/MBlaze/InstPrinter/MBlazeInstPrinter.cpp
index 30745c694b..704f81cfd8 100644
--- a/lib/Target/MBlaze/InstPrinter/MBlazeInstPrinter.cpp
+++ b/lib/Target/MBlaze/InstPrinter/MBlazeInstPrinter.cpp
@@ -29,17 +29,6 @@ void MBlazeInstPrinter::printInst(const MCInst *MI, raw_ostream &O) {
printInstruction(MI, O);
}
-void MBlazeInstPrinter::printPCRelImmOperand(const MCInst *MI, unsigned OpNo,
- raw_ostream &O) {
- const MCOperand &Op = MI->getOperand(OpNo);
- if (Op.isImm())
- O << Op.getImm();
- else {
- assert(Op.isExpr() && "unknown pcrel immediate operand");
- O << *Op.getExpr();
- }
-}
-
void MBlazeInstPrinter::printOperand(const MCInst *MI, unsigned OpNo,
raw_ostream &O, const char *Modifier) {
assert((Modifier == 0 || Modifier[0] == 0) && "No modifiers supported");
@@ -54,35 +43,6 @@ void MBlazeInstPrinter::printOperand(const MCInst *MI, unsigned OpNo,
}
}
-void MBlazeInstPrinter::printSrcMemOperand(const MCInst *MI, unsigned OpNo,
- raw_ostream &O,
- const char *Modifier) {
- const MCOperand &Base = MI->getOperand(OpNo);
- const MCOperand &Disp = MI->getOperand(OpNo+1);
-
- // Print displacement first
-
- // If the global address expression is a part of displacement field with a
- // register base, we should not emit any prefix symbol here, e.g.
- // mov.w &foo, r1
- // vs
- // mov.w glb(r1), r2
- // Otherwise (!) msp430-as will silently miscompile the output :(
- if (!Base.getReg())
- O << '&';
-
- if (Disp.isExpr())
- O << *Disp.getExpr();
- else {
- assert(Disp.isImm() && "Expected immediate in displacement field");
- O << Disp.getImm();
- }
-
- // Print register base field
- if (Base.getReg())
- O << getRegisterName(Base.getReg());
-}
-
void MBlazeInstPrinter::printFSLImm(const MCInst *MI, int OpNo,
raw_ostream &O) {
const MCOperand &MO = MI->getOperand(OpNo);
@@ -103,38 +63,7 @@ void MBlazeInstPrinter::printUnsignedImm(const MCInst *MI, int OpNo,
void MBlazeInstPrinter::printMemOperand(const MCInst *MI, int OpNo,
raw_ostream &O, const char *Modifier) {
- printOperand(MI, OpNo+1, O, NULL);
- O << ", ";
printOperand(MI, OpNo, O, NULL);
+ O << ", ";
+ printOperand(MI, OpNo+1, O, NULL);
}
-
-/*
-void MBlazeInstPrinter::printCCOperand(const MCInst *MI, unsigned OpNo,
- raw_ostream &O) {
- unsigned CC = MI->getOperand(OpNo).getImm();
-
- switch (CC) {
- default:
- llvm_unreachable("Unsupported CC code");
- break;
- case MBlazeCC::COND_E:
- O << "eq";
- break;
- case MBlazeCC::COND_NE:
- O << "ne";
- break;
- case MBlazeCC::COND_HS:
- O << "hs";
- break;
- case MBlazeCC::COND_LO:
- O << "lo";
- break;
- case MBlazeCC::COND_GE:
- O << "ge";
- break;
- case MBlazeCC::COND_L:
- O << 'l';
- break;
- }
-}
-*/