blob: b31278a6a35f9a846d8f8c357ef9c85d97edb81e [file] [log] [blame]
Chris Lattnerd92fb002002-10-25 22:55:53 +00001//===- X86InstructionInfo.h - X86 Instruction Information ---------*-C++-*-===//
2//
Chris Lattnerf57420e2002-10-29 20:48:56 +00003// This file contains the X86 implementation of the MachineInstrInfo class.
Chris Lattnerd92fb002002-10-25 22:55:53 +00004//
5//===----------------------------------------------------------------------===//
6
7#ifndef X86INSTRUCTIONINFO_H
8#define X86INSTRUCTIONINFO_H
9
Chris Lattner16cbd412002-10-29 17:43:19 +000010#include "llvm/Target/MachineInstrInfo.h"
Chris Lattnerd92fb002002-10-25 22:55:53 +000011#include "X86RegisterInfo.h"
12
Chris Lattner60c59d52002-10-30 01:09:34 +000013/// X86II - This namespace holds all of the target specific flags that
14/// instruction info tracks.
15///
16namespace X86II {
17 enum {
18 Void = 1 << 0, // Set if this instruction produces no value
19 };
20}
21
Chris Lattner27d24792002-10-29 21:05:24 +000022class X86InstrInfo : public MachineInstrInfo {
Chris Lattnerd92fb002002-10-25 22:55:53 +000023 const X86RegisterInfo RI;
24public:
Chris Lattner27d24792002-10-29 21:05:24 +000025 X86InstrInfo();
Chris Lattnerd92fb002002-10-25 22:55:53 +000026
Chris Lattnerf57420e2002-10-29 20:48:56 +000027 /// getRegisterInfo - MachineInstrInfo is a superset of MRegister info. As
Chris Lattnerd92fb002002-10-25 22:55:53 +000028 /// 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
Chris Lattner9289d7d2002-11-17 22:53:13 +000033 /// print - Print out an x86 instruction in intel syntax
Chris Lattnerd92fb002002-10-25 22:55:53 +000034 ///
Chris Lattner5fd53042002-11-17 23:20:37 +000035 virtual void print(const MachineInstr *MI, std::ostream &O,
36 const TargetMachine &TM) const;
Chris Lattner16cbd412002-10-29 17:43:19 +000037
38
39 //===--------------------------------------------------------------------===//
40 //
41 // These are stubs for pure virtual methods that should be factored out of
42 // MachineInstrInfo. We never call them, we don't want them, but we need
43 // stubs so that we can instatiate our class.
44 //
45 MachineOpCode getNOPOpCode() const { abort(); }
46 void CreateCodeToLoadConst(const TargetMachine& target, Function* F,
47 Value *V, Instruction *I,
48 std::vector<MachineInstr*>& mvec,
49 MachineCodeForInstruction& mcfi) const { abort(); }
50 void CreateCodeToCopyIntToFloat(const TargetMachine& target,
51 Function* F, Value* val, Instruction* dest,
52 std::vector<MachineInstr*>& mvec,
53 MachineCodeForInstruction& mcfi) const {
54 abort();
55 }
56 void CreateCodeToCopyFloatToInt(const TargetMachine& target, Function* F,
57 Value* val, Instruction* dest,
58 std::vector<MachineInstr*>& mvec,
59 MachineCodeForInstruction& mcfi)const {
60 abort();
61 }
62 void CreateCopyInstructionsByType(const TargetMachine& target,
63 Function* F, Value* src,
64 Instruction* dest,
65 std::vector<MachineInstr*>& mvec,
66 MachineCodeForInstruction& mcfi)const {
67 abort();
68 }
69
70 void CreateSignExtensionInstructions(const TargetMachine& target,
71 Function* F, Value* srcVal,
72 Value* destVal, unsigned numLowBits,
73 std::vector<MachineInstr*>& mvec,
74 MachineCodeForInstruction& mcfi) const {
75 abort();
76 }
77
78 void CreateZeroExtensionInstructions(const TargetMachine& target,
79 Function* F, Value* srcVal,
80 Value* destVal, unsigned srcSizeInBits,
81 std::vector<MachineInstr*>& mvec,
82 MachineCodeForInstruction& mcfi) const {
83 abort();
84 }
Chris Lattnerd92fb002002-10-25 22:55:53 +000085};
86
87
88#endif