Implement MachineInstrInfo interface
authorChris Lattner <sabre@nondot.org>
Tue, 29 Oct 2002 17:43:19 +0000 (17:43 +0000)
committerChris Lattner <sabre@nondot.org>
Tue, 29 Oct 2002 17:43:19 +0000 (17:43 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4394 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/X86/X86InstrInfo.cpp
lib/Target/X86/X86InstrInfo.h

index f7185348ef96adf3d50c4f071bcca08e6ae0f8b7..06abb4dbf7bd6e8f1976965988a05ffeda2f13e9 100644 (file)
@@ -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";
 }
 
index 95c292523e37f6e71d51882c9b67c86e1e2289f2..d9a9de1765da161d40d6eab8cf3026cced7e6b30 100644 (file)
@@ -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();
+  }
 };