forked from OSchip/llvm-project
[X86] Add interface X86II::isPseudo
Avoid duplicate code in X86MCCodeEmitter, NFCI.
This commit is contained in:
parent
e13a8a1fc5
commit
71303b753c
|
@ -942,6 +942,11 @@ namespace X86II {
|
|||
return (TSFlags & X86II::FormMask) == PrefixByte;
|
||||
}
|
||||
|
||||
/// \returns true if the instruction with given opcode is a pseudo.
|
||||
inline bool isPseudo(uint64_t TSFlags) {
|
||||
return (TSFlags & X86II::FormMask) == Pseudo;
|
||||
}
|
||||
|
||||
/// \returns the "base" X86 opcode for the specified machine
|
||||
/// instruction.
|
||||
inline uint8_t getBaseOpcodeFor(uint64_t TSFlags) {
|
||||
|
|
|
@ -1362,7 +1362,7 @@ void X86MCCodeEmitter::emitPrefix(const MCInst &MI, raw_ostream &OS,
|
|||
uint64_t TSFlags = Desc.TSFlags;
|
||||
|
||||
// Pseudo instructions don't get encoded.
|
||||
if ((TSFlags & X86II::FormMask) == X86II::Pseudo)
|
||||
if (X86II::isPseudo(TSFlags))
|
||||
return;
|
||||
|
||||
unsigned CurOp = X86II::getOperandBias(Desc);
|
||||
|
@ -1382,7 +1382,7 @@ void X86MCCodeEmitter::encodeInstruction(const MCInst &MI, raw_ostream &OS,
|
|||
uint64_t TSFlags = Desc.TSFlags;
|
||||
|
||||
// Pseudo instructions don't get encoded.
|
||||
if ((TSFlags & X86II::FormMask) == X86II::Pseudo)
|
||||
if (X86II::isPseudo(TSFlags))
|
||||
return;
|
||||
|
||||
unsigned NumOps = Desc.getNumOperands();
|
||||
|
|
Loading…
Reference in New Issue