aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Target/X86/X86InstrInfo.h
diff options
context:
space:
mode:
authorNicolas Geoffray <nicolas.geoffray@lip6.fr>2008-04-16 20:10:13 +0000
committerNicolas Geoffray <nicolas.geoffray@lip6.fr>2008-04-16 20:10:13 +0000
commit52e724ad7e679ee590f4bd763d55280586a8f1bc (patch)
tree17e026641b730ae73981f77df025c5543c674201 /lib/Target/X86/X86InstrInfo.h
parentdc00858e11d243bd2c7cb39bbb92c557b123573e (diff)
downloadexternal_llvm-52e724ad7e679ee590f4bd763d55280586a8f1bc.tar.gz
external_llvm-52e724ad7e679ee590f4bd763d55280586a8f1bc.tar.bz2
external_llvm-52e724ad7e679ee590f4bd763d55280586a8f1bc.zip
Infrastructure for getting the machine code size of a function and an instruction. X86, PowerPC and ARM are implemented
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49809 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/X86/X86InstrInfo.h')
-rw-r--r--lib/Target/X86/X86InstrInfo.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/lib/Target/X86/X86InstrInfo.h b/lib/Target/X86/X86InstrInfo.h
index ce525e43bc..5f09241f16 100644
--- a/lib/Target/X86/X86InstrInfo.h
+++ b/lib/Target/X86/X86InstrInfo.h
@@ -15,6 +15,7 @@
#define X86INSTRUCTIONINFO_H
#include "llvm/Target/TargetInstrInfo.h"
+#include "X86.h"
#include "X86RegisterInfo.h"
#include "llvm/ADT/IndexedMap.h"
#include "llvm/Target/TargetRegisterInfo.h"
@@ -380,6 +381,20 @@ public:
unsigned char getBaseOpcodeFor(unsigned Opcode) const {
return getBaseOpcodeFor(&get(Opcode));
}
+
+ static bool isX86_64NonExtLowByteReg(unsigned reg) {
+ return (reg == X86::SPL || reg == X86::BPL ||
+ reg == X86::SIL || reg == X86::DIL);
+ }
+
+ static unsigned sizeOfImm(const TargetInstrDesc *Desc);
+ static unsigned getX86RegNum(unsigned RegNo);
+ static bool isX86_64ExtendedReg(const MachineOperand &MO);
+ static unsigned determineREX(const MachineInstr &MI);
+
+ /// GetInstSize - Returns the size of the specified MachineInstr.
+ ///
+ virtual unsigned GetInstSizeInBytes(const MachineInstr *MI) const;
private:
MachineInstr* foldMemoryOperand(MachineInstr* MI,