1 //===- X86InstructionInfo.h - X86 Instruction Information ---------*-C++-*-===//
3 // This file contains the X86 implementation of the MachineInstrInfo class.
5 //===----------------------------------------------------------------------===//
7 #ifndef X86INSTRUCTIONINFO_H
8 #define X86INSTRUCTIONINFO_H
10 #include "llvm/Target/MachineInstrInfo.h"
11 #include "X86RegisterInfo.h"
13 class X86InstrInfo : public MachineInstrInfo {
14 const X86RegisterInfo RI;
18 /// getRegisterInfo - MachineInstrInfo is a superset of MRegister info. As
19 /// such, whenever a client has an instance of instruction info, it should
20 /// always be able to get register info as well (through this method).
22 virtual const MRegisterInfo &getRegisterInfo() const { return RI; }
24 /// print - Print out an x86 instruction in GAS syntax
26 virtual void print(const MachineInstr *MI, std::ostream &O) const;
29 //===--------------------------------------------------------------------===//
31 // These are stubs for pure virtual methods that should be factored out of
32 // MachineInstrInfo. We never call them, we don't want them, but we need
33 // stubs so that we can instatiate our class.
35 MachineOpCode getNOPOpCode() const { abort(); }
36 void CreateCodeToLoadConst(const TargetMachine& target, Function* F,
37 Value *V, Instruction *I,
38 std::vector<MachineInstr*>& mvec,
39 MachineCodeForInstruction& mcfi) const { abort(); }
40 void CreateCodeToCopyIntToFloat(const TargetMachine& target,
41 Function* F, Value* val, Instruction* dest,
42 std::vector<MachineInstr*>& mvec,
43 MachineCodeForInstruction& mcfi) const {
46 void CreateCodeToCopyFloatToInt(const TargetMachine& target, Function* F,
47 Value* val, Instruction* dest,
48 std::vector<MachineInstr*>& mvec,
49 MachineCodeForInstruction& mcfi)const {
52 void CreateCopyInstructionsByType(const TargetMachine& target,
53 Function* F, Value* src,
55 std::vector<MachineInstr*>& mvec,
56 MachineCodeForInstruction& mcfi)const {
60 void CreateSignExtensionInstructions(const TargetMachine& target,
61 Function* F, Value* srcVal,
62 Value* destVal, unsigned numLowBits,
63 std::vector<MachineInstr*>& mvec,
64 MachineCodeForInstruction& mcfi) const {
68 void CreateZeroExtensionInstructions(const TargetMachine& target,
69 Function* F, Value* srcVal,
70 Value* destVal, unsigned srcSizeInBits,
71 std::vector<MachineInstr*>& mvec,
72 MachineCodeForInstruction& mcfi) const {