Enable binary encoding of some simple instructions.
authorJim Grosbach <grosbach@apple.com>
Fri, 8 Oct 2010 00:39:21 +0000 (00:39 +0000)
committerJim Grosbach <grosbach@apple.com>
Fri, 8 Oct 2010 00:39:21 +0000 (00:39 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@116022 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/ARM/ARMMCCodeEmitter.cpp

index 908f6f08b9ab63f41f9a58b7e55cddac56242cff..5ccc8f5f7d1d8bc6d07ce21737a490259f741803 100644 (file)
@@ -112,6 +112,8 @@ EncodeInstruction(const MCInst &MI, raw_ostream &OS,
   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)
@@ -119,6 +121,12 @@ EncodeInstruction(const MCInst &MI, raw_ostream &OS,
 
   ++MCNumEmitted;  // Keep track of the # of mi's emitted
   switch (TSFlags & ARMII::FormMask) {
+  case ARMII::BrMiscFrm:
+  case ARMII::MiscFrm: {
+    unsigned Value = getBinaryCodeForInstr(MI);
+    EmitConstant(Value, 4, CurByte, OS);
+    break;
+  }
   default: {
     llvm_unreachable("Unhandled instruction encoding format!");
     break;