diff options
| author | Chris Lattner <sabre@nondot.org> | 2010-02-05 19:24:13 +0000 |
|---|---|---|
| committer | Chris Lattner <sabre@nondot.org> | 2010-02-05 19:24:13 +0000 |
| commit | 503243559add764cfad8eb656bd36bf1e80dba99 (patch) | |
| tree | 4179f2242f924c2c98c88786be095d6850f54c1e /llvm/lib/Target/X86/X86InstrInfo.h | |
| parent | 4739e41ce91ccff84e94c6689b37030267edaaf5 (diff) | |
| download | bcm5719-llvm-503243559add764cfad8eb656bd36bf1e80dba99.tar.gz bcm5719-llvm-503243559add764cfad8eb656bd36bf1e80dba99.zip | |
move functions for decoding X86II values into the X86II namespace.
llvm-svn: 95410
Diffstat (limited to 'llvm/lib/Target/X86/X86InstrInfo.h')
| -rw-r--r-- | llvm/lib/Target/X86/X86InstrInfo.h | 35 |
1 files changed, 19 insertions, 16 deletions
diff --git a/llvm/lib/Target/X86/X86InstrInfo.h b/llvm/lib/Target/X86/X86InstrInfo.h index 2307723de55..0ddb32d660a 100644 --- a/llvm/lib/Target/X86/X86InstrInfo.h +++ b/llvm/lib/Target/X86/X86InstrInfo.h @@ -389,6 +389,25 @@ namespace X86II { OpcodeShift = 24, OpcodeMask = 0xFF << OpcodeShift }; + + // getBaseOpcodeFor - This function returns the "base" X86 opcode for the + // specified machine instruction. + // + static inline unsigned char getBaseOpcodeFor(unsigned TSFlags) { + return TSFlags >> X86II::OpcodeShift; + } + + /// getSizeOfImm - Decode the "size of immediate" field from the TSFlags field + /// of the specified instruction. + static inline unsigned getSizeOfImm(unsigned TSFlags) { + switch (TSFlags & X86II::ImmMask) { + default: assert(0 && "Unknown immediate size"); + case X86II::Imm8: return 1; + case X86II::Imm16: return 2; + case X86II::Imm32: return 4; + case X86II::Imm64: return 8; + } + } } const int X86AddrNumOperands = 5; @@ -637,27 +656,11 @@ public: /// instruction that defines the specified register class. bool isSafeToMoveRegClassDefs(const TargetRegisterClass *RC) const; - // getBaseOpcodeFor - This function returns the "base" X86 opcode for the - // specified machine instruction. - // - static unsigned char getBaseOpcodeFor(unsigned TSFlags) { - return TSFlags >> X86II::OpcodeShift; - } - static bool isX86_64NonExtLowByteReg(unsigned reg) { return (reg == X86::SPL || reg == X86::BPL || reg == X86::SIL || reg == X86::DIL); } - static unsigned getSizeOfImm(unsigned TSFlags) { - switch (TSFlags & X86II::ImmMask) { - default: assert(0 && "Unknown immediate size"); - case X86II::Imm8: return 1; - case X86II::Imm16: return 2; - case X86II::Imm32: return 4; - case X86II::Imm64: return 8; - } - } static bool isX86_64ExtendedReg(const MachineOperand &MO); static unsigned determineREX(const MachineInstr &MI); |

