teach the encoder to handle pseudo instructions like FP_REG_KILL,
authorChris Lattner <sabre@nondot.org>
Sat, 13 Feb 2010 19:16:53 +0000 (19:16 +0000)
committerChris Lattner <sabre@nondot.org>
Sat, 13 Feb 2010 19:16:53 +0000 (19:16 +0000)
encoding them into nothing.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96110 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/X86/X86MCCodeEmitter.cpp

index 4ac51fc981d2e88fb2ed56a72f3ab6806d6849c5..d0ec0de6913083906c7e7f1ef7b83716c9c760ae 100644 (file)
@@ -303,9 +303,9 @@ void X86MCCodeEmitter::EmitMemModRMByte(const MCInst &MI, unsigned Op,
 /// size, and 3) use of X86-64 extended registers.
 static unsigned DetermineREXPrefix(const MCInst &MI, unsigned TSFlags,
                                    const TargetInstrDesc &Desc) {
-  // Pseudo instructions shouldn't get here.
-  assert((TSFlags & X86II::FormMask) != X86II::Pseudo &&
-         "Can't encode pseudo instrs");
+  // Pseudo instructions never have a rex byte.
+  if ((TSFlags & X86II::FormMask) == X86II::Pseudo)
+    return 0;
   
   unsigned REX = 0;
   if (TSFlags & X86II::REX_W)
@@ -506,6 +506,7 @@ EncodeInstruction(const MCInst &MI, raw_ostream &OS,
     assert(0 && "FIXME: Remove this form when the JIT moves to MCCodeEmitter!");
   default: errs() << "FORM: " << (TSFlags & X86II::FormMask) << "\n";
     assert(0 && "Unknown FormMask value in X86MCCodeEmitter!");
+  case X86II::Pseudo: return; // Pseudo instructions encode to nothing.
   case X86II::RawFrm:
     EmitByte(BaseOpcode, CurByte, OS);
     break;