aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/Target/X86/X86InstrInfo.cpp15
-rw-r--r--lib/Target/X86/X86InstrInfo.h54
2 files changed, 59 insertions, 10 deletions
diff --git a/lib/Target/X86/X86InstrInfo.cpp b/lib/Target/X86/X86InstrInfo.cpp
index f7185348ef..06abb4dbf7 100644
--- a/lib/Target/X86/X86InstrInfo.cpp
+++ b/lib/Target/X86/X86InstrInfo.cpp
@@ -5,25 +5,26 @@
//===----------------------------------------------------------------------===//
#include "X86InstructionInfo.h"
-#include "llvm/CodeGen/MInstruction.h"
-#include <ostream>
+#include "llvm/CodeGen/MachineInstr.h"
+#include <iostream>
// X86Insts - Turn the InstructionInfo.def file into a bunch of instruction
// descriptors
//
-static const MInstructionDesc X86Insts[] = {
-#define I(ENUM, NAME, FLAGS, TSFLAGS) { NAME, FLAGS, TSFLAGS },
+static const MachineInstrDescriptor X86Insts[] = {
+#define I(ENUM, NAME, FLAGS, TSFLAGS) \
+ { NAME, -1, -1, 0, false, 0, 0, TSFLAGS, FLAGS },
#include "X86InstructionInfo.def"
};
X86InstructionInfo::X86InstructionInfo()
- : MInstructionInfo(X86Insts, sizeof(X86Insts)/sizeof(X86Insts[0])) {
+ : MachineInstrInfo(X86Insts, sizeof(X86Insts)/sizeof(X86Insts[0]), 0) {
}
// print - Print out an x86 instruction in GAS syntax
-void X86InstructionInfo::print(const MInstruction *MI, std::ostream &O) const {
+void X86InstructionInfo::print(const MachineInstr *MI, std::ostream &O) const {
// FIXME: This sucks.
- O << get(MI->getOpcode()).Name << "\n";
+ O << getName(MI->getOpCode()) << "\n";
}
diff --git a/lib/Target/X86/X86InstrInfo.h b/lib/Target/X86/X86InstrInfo.h
index 95c292523e..d9a9de1765 100644
--- a/lib/Target/X86/X86InstrInfo.h
+++ b/lib/Target/X86/X86InstrInfo.h
@@ -7,10 +7,10 @@
#ifndef X86INSTRUCTIONINFO_H
#define X86INSTRUCTIONINFO_H
-#include "llvm/Target/InstructionInfo.h"
+#include "llvm/Target/MachineInstrInfo.h"
#include "X86RegisterInfo.h"
-class X86InstructionInfo : public MInstructionInfo {
+class X86InstructionInfo : public MachineInstrInfo {
const X86RegisterInfo RI;
public:
X86InstructionInfo();
@@ -23,7 +23,55 @@ public:
/// print - Print out an x86 instruction in GAS syntax
///
- virtual void print(const MInstruction *MI, std::ostream &O) const;
+ virtual void print(const MachineInstr *MI, std::ostream &O) const;
+
+
+ //===--------------------------------------------------------------------===//
+ //
+ // These are stubs for pure virtual methods that should be factored out of
+ // MachineInstrInfo. We never call them, we don't want them, but we need
+ // stubs so that we can instatiate our class.
+ //
+ MachineOpCode getNOPOpCode() const { abort(); }
+ void CreateCodeToLoadConst(const TargetMachine& target, Function* F,
+ Value *V, Instruction *I,
+ std::vector<MachineInstr*>& mvec,
+ MachineCodeForInstruction& mcfi) const { abort(); }
+ void CreateCodeToCopyIntToFloat(const TargetMachine& target,
+ Function* F, Value* val, Instruction* dest,
+ std::vector<MachineInstr*>& mvec,
+ MachineCodeForInstruction& mcfi) const {
+ abort();
+ }
+ void CreateCodeToCopyFloatToInt(const TargetMachine& target, Function* F,
+ Value* val, Instruction* dest,
+ std::vector<MachineInstr*>& mvec,
+ MachineCodeForInstruction& mcfi)const {
+ abort();
+ }
+ void CreateCopyInstructionsByType(const TargetMachine& target,
+ Function* F, Value* src,
+ Instruction* dest,
+ std::vector<MachineInstr*>& mvec,
+ MachineCodeForInstruction& mcfi)const {
+ abort();
+ }
+
+ void CreateSignExtensionInstructions(const TargetMachine& target,
+ Function* F, Value* srcVal,
+ Value* destVal, unsigned numLowBits,
+ std::vector<MachineInstr*>& mvec,
+ MachineCodeForInstruction& mcfi) const {
+ abort();
+ }
+
+ void CreateZeroExtensionInstructions(const TargetMachine& target,
+ Function* F, Value* srcVal,
+ Value* destVal, unsigned srcSizeInBits,
+ std::vector<MachineInstr*>& mvec,
+ MachineCodeForInstruction& mcfi) const {
+ abort();
+ }
};