Chris Lattner | 7261408 | 2002-10-25 22:55:53 +0000 | [diff] [blame] | 1 | //===- X86InstructionInfo.h - X86 Instruction Information ---------*-C++-*-===// |
| 2 | // |
Chris Lattner | 33f53b5 | 2002-10-29 20:48:56 +0000 | [diff] [blame] | 3 | // This file contains the X86 implementation of the MachineInstrInfo class. |
Chris Lattner | 7261408 | 2002-10-25 22:55:53 +0000 | [diff] [blame] | 4 | // |
| 5 | //===----------------------------------------------------------------------===// |
| 6 | |
| 7 | #ifndef X86INSTRUCTIONINFO_H |
| 8 | #define X86INSTRUCTIONINFO_H |
| 9 | |
Chris Lattner | 9bbf439 | 2002-10-29 17:43:19 +0000 | [diff] [blame] | 10 | #include "llvm/Target/MachineInstrInfo.h" |
Chris Lattner | 7261408 | 2002-10-25 22:55:53 +0000 | [diff] [blame] | 11 | #include "X86RegisterInfo.h" |
| 12 | |
Chris Lattner | 9d17740 | 2002-10-30 01:09:34 +0000 | [diff] [blame^] | 13 | /// X86II - This namespace holds all of the target specific flags that |
| 14 | /// instruction info tracks. |
| 15 | /// |
| 16 | namespace X86II { |
| 17 | enum { |
| 18 | Void = 1 << 0, // Set if this instruction produces no value |
| 19 | }; |
| 20 | } |
| 21 | |
Chris Lattner | 055c965 | 2002-10-29 21:05:24 +0000 | [diff] [blame] | 22 | class X86InstrInfo : public MachineInstrInfo { |
Chris Lattner | 7261408 | 2002-10-25 22:55:53 +0000 | [diff] [blame] | 23 | const X86RegisterInfo RI; |
| 24 | public: |
Chris Lattner | 055c965 | 2002-10-29 21:05:24 +0000 | [diff] [blame] | 25 | X86InstrInfo(); |
Chris Lattner | 7261408 | 2002-10-25 22:55:53 +0000 | [diff] [blame] | 26 | |
Chris Lattner | 33f53b5 | 2002-10-29 20:48:56 +0000 | [diff] [blame] | 27 | /// getRegisterInfo - MachineInstrInfo is a superset of MRegister info. As |
Chris Lattner | 7261408 | 2002-10-25 22:55:53 +0000 | [diff] [blame] | 28 | /// such, whenever a client has an instance of instruction info, it should |
| 29 | /// always be able to get register info as well (through this method). |
| 30 | /// |
| 31 | virtual const MRegisterInfo &getRegisterInfo() const { return RI; } |
| 32 | |
| 33 | /// print - Print out an x86 instruction in GAS syntax |
| 34 | /// |
Chris Lattner | 9bbf439 | 2002-10-29 17:43:19 +0000 | [diff] [blame] | 35 | virtual void print(const MachineInstr *MI, std::ostream &O) const; |
| 36 | |
| 37 | |
| 38 | //===--------------------------------------------------------------------===// |
| 39 | // |
| 40 | // These are stubs for pure virtual methods that should be factored out of |
| 41 | // MachineInstrInfo. We never call them, we don't want them, but we need |
| 42 | // stubs so that we can instatiate our class. |
| 43 | // |
| 44 | MachineOpCode getNOPOpCode() const { abort(); } |
| 45 | void CreateCodeToLoadConst(const TargetMachine& target, Function* F, |
| 46 | Value *V, Instruction *I, |
| 47 | std::vector<MachineInstr*>& mvec, |
| 48 | MachineCodeForInstruction& mcfi) const { abort(); } |
| 49 | void CreateCodeToCopyIntToFloat(const TargetMachine& target, |
| 50 | Function* F, Value* val, Instruction* dest, |
| 51 | std::vector<MachineInstr*>& mvec, |
| 52 | MachineCodeForInstruction& mcfi) const { |
| 53 | abort(); |
| 54 | } |
| 55 | void CreateCodeToCopyFloatToInt(const TargetMachine& target, Function* F, |
| 56 | Value* val, Instruction* dest, |
| 57 | std::vector<MachineInstr*>& mvec, |
| 58 | MachineCodeForInstruction& mcfi)const { |
| 59 | abort(); |
| 60 | } |
| 61 | void CreateCopyInstructionsByType(const TargetMachine& target, |
| 62 | Function* F, Value* src, |
| 63 | Instruction* dest, |
| 64 | std::vector<MachineInstr*>& mvec, |
| 65 | MachineCodeForInstruction& mcfi)const { |
| 66 | abort(); |
| 67 | } |
| 68 | |
| 69 | void CreateSignExtensionInstructions(const TargetMachine& target, |
| 70 | Function* F, Value* srcVal, |
| 71 | Value* destVal, unsigned numLowBits, |
| 72 | std::vector<MachineInstr*>& mvec, |
| 73 | MachineCodeForInstruction& mcfi) const { |
| 74 | abort(); |
| 75 | } |
| 76 | |
| 77 | void CreateZeroExtensionInstructions(const TargetMachine& target, |
| 78 | Function* F, Value* srcVal, |
| 79 | Value* destVal, unsigned srcSizeInBits, |
| 80 | std::vector<MachineInstr*>& mvec, |
| 81 | MachineCodeForInstruction& mcfi) const { |
| 82 | abort(); |
| 83 | } |
Chris Lattner | 7261408 | 2002-10-25 22:55:53 +0000 | [diff] [blame] | 84 | }; |
| 85 | |
| 86 | |
| 87 | #endif |