db5372f904f3fecf243965089139df62dddf2a83
[oota-llvm.git] / lib / Target / X86 / X86InstrInfo.h
1 //===- X86InstructionInfo.h - X86 Instruction Information ---------*-C++-*-===//
2 //
3 // This file contains the X86 implementation of the MachineInstrInfo class.
4 //
5 //===----------------------------------------------------------------------===//
6
7 #ifndef X86INSTRUCTIONINFO_H
8 #define X86INSTRUCTIONINFO_H
9
10 #include "llvm/Target/MachineInstrInfo.h"
11 #include "X86RegisterInfo.h"
12
13 class X86InstrInfo : public MachineInstrInfo {
14   const X86RegisterInfo RI;
15 public:
16   X86InstrInfo();
17
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).
21   ///
22   virtual const MRegisterInfo &getRegisterInfo() const { return RI; }
23
24   /// print - Print out an x86 instruction in GAS syntax
25   ///
26   virtual void print(const MachineInstr *MI, std::ostream &O) const;
27
28
29   //===--------------------------------------------------------------------===//
30   //
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.
34   //
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 {
44     abort();
45   }
46   void CreateCodeToCopyFloatToInt(const TargetMachine& target, Function* F,
47                                   Value* val, Instruction* dest,
48                                   std::vector<MachineInstr*>& mvec,
49                                   MachineCodeForInstruction& mcfi)const {
50     abort();
51   }
52   void CreateCopyInstructionsByType(const TargetMachine& target,
53                                     Function* F, Value* src,
54                                     Instruction* dest,
55                                     std::vector<MachineInstr*>& mvec,
56                                     MachineCodeForInstruction& mcfi)const {
57     abort();
58   }
59   
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 {
65     abort();
66   }
67
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 {
73     abort();
74   }
75 };
76
77
78 #endif