diff options
| author | Jim Grosbach <grosbach@apple.com> | 2010-11-11 23:41:09 +0000 |
|---|---|---|
| committer | Jim Grosbach <grosbach@apple.com> | 2010-11-11 23:41:09 +0000 |
| commit | e50e6bcd901ebb1cfc42fe9ca0796ae303d7f1a1 (patch) | |
| tree | 683a991dad62093c2bf5a994a5703b9d82e551b3 /lib/Target/ARM/ARMMCCodeEmitter.cpp | |
| parent | 8f143913141991baaa535ca0da7c8a81606d6392 (diff) | |
Start of support for binary emit of 16-it Thumb instructions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118859 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/ARM/ARMMCCodeEmitter.cpp')
| -rw-r--r-- | lib/Target/ARM/ARMMCCodeEmitter.cpp | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/lib/Target/ARM/ARMMCCodeEmitter.cpp b/lib/Target/ARM/ARMMCCodeEmitter.cpp index ebd0d9b559..96da945f60 100644 --- a/lib/Target/ARM/ARMMCCodeEmitter.cpp +++ b/lib/Target/ARM/ARMMCCodeEmitter.cpp @@ -608,10 +608,17 @@ EncodeInstruction(const MCInst &MI, raw_ostream &OS, SmallVectorImpl<MCFixup> &Fixups) const { // Pseudo instructions don't get encoded. const TargetInstrDesc &Desc = TII.get(MI.getOpcode()); - if ((Desc.TSFlags & ARMII::FormMask) == ARMII::Pseudo) + uint64_t TSFlags = Desc.TSFlags; + if ((TSFlags & ARMII::FormMask) == ARMII::Pseudo) return; - - EmitConstant(getBinaryCodeForInstr(MI, Fixups), 4, OS); + int Size; + // Basic size info comes from the TSFlags field. + switch ((TSFlags & ARMII::SizeMask) >> ARMII::SizeShift) { + default: llvm_unreachable("Unexpected instruction size!"); + case ARMII::Size2Bytes: Size = 2; break; + case ARMII::Size4Bytes: Size = 4; break; + } + EmitConstant(getBinaryCodeForInstr(MI, Fixups), Size, OS); ++MCNumEmitted; // Keep track of the # of mi's emitted. } |
