blob: db5372f904f3fecf243965089139df62dddf2a83 [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 Lattner27d24792002-10-29 21:05:24 +000013class X86InstrInfo : public MachineInstrInfo {
Chris Lattnerd92fb002002-10-25 22:55:53 +000014 const X86RegisterInfo RI;
15public:
Chris Lattner27d24792002-10-29 21:05:24 +000016 X86InstrInfo();
Chris Lattnerd92fb002002-10-25 22:55:53 +000017
Chris Lattnerf57420e2002-10-29 20:48:56 +000018 /// getRegisterInfo - MachineInstrInfo is a superset of MRegister info. As
Chris Lattnerd92fb002002-10-25 22:55:53 +000019 /// 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 ///
Chris Lattner16cbd412002-10-29 17:43:19 +000026 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 }
Chris Lattnerd92fb002002-10-25 22:55:53 +000075};
76
77
78#endif