summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBill Wendling <isanbard@gmail.com>2010-11-02 22:44:12 +0000
committerBill Wendling <isanbard@gmail.com>2010-11-02 22:44:12 +0000
commit91da9abbee316acbed7831d07a707bd67fb94d6b (patch)
treeaaa9bc78b1311f0f53b3c448cce0cd77477ab5ac
parent7c30390277344f8d289228378035c19ed3f9f067 (diff)
downloadbcm5719-llvm-91da9abbee316acbed7831d07a707bd67fb94d6b.tar.gz
bcm5719-llvm-91da9abbee316acbed7831d07a707bd67fb94d6b.zip
Simplify the EncodeInstruction method now that a lot of the special case stuff
is handled with the MC encoder. llvm-svn: 118098
-rw-r--r--llvm/lib/Target/ARM/ARMMCCodeEmitter.cpp19
1 files changed, 6 insertions, 13 deletions
diff --git a/llvm/lib/Target/ARM/ARMMCCodeEmitter.cpp b/llvm/lib/Target/ARM/ARMMCCodeEmitter.cpp
index bc16fe04c38..86c9330e303 100644
--- a/llvm/lib/Target/ARM/ARMMCCodeEmitter.cpp
+++ b/llvm/lib/Target/ARM/ARMMCCodeEmitter.cpp
@@ -323,22 +323,15 @@ unsigned ARMMCCodeEmitter::getAddrMode6OffsetOpValue(const MCInst &MI,
void ARMMCCodeEmitter::
EncodeInstruction(const MCInst &MI, raw_ostream &OS,
SmallVectorImpl<MCFixup> &Fixups) const {
- unsigned Opcode = MI.getOpcode();
- const TargetInstrDesc &Desc = TII.get(Opcode);
- uint64_t TSFlags = Desc.TSFlags;
- // Keep track of the current byte being emitted.
- unsigned CurByte = 0;
-
// Pseudo instructions don't get encoded.
- if ((TSFlags & ARMII::FormMask) == ARMII::Pseudo)
+ const TargetInstrDesc &Desc = TII.get(MI.getOpcode());
+ if ((Desc.TSFlags & ARMII::FormMask) == ARMII::Pseudo)
return;
- ++MCNumEmitted; // Keep track of the # of mi's emitted
- unsigned Value = getBinaryCodeForInstr(MI);
- switch (Opcode) {
- default: break;
- }
- EmitConstant(Value, 4, CurByte, OS);
+ // Keep track of the current byte being emitted.
+ unsigned CurByte = 0;
+ EmitConstant(getBinaryCodeForInstr(MI), 4, CurByte, OS);
+ ++MCNumEmitted; // Keep track of the # of mi's emitted.
}
// FIXME: These #defines shouldn't be necessary. Instead, tblgen should
OpenPOWER on IntegriCloud