Chris Lattner | 7261408 | 2002-10-25 22:55:53 +0000 | [diff] [blame] | 1 | //===- X86InstructionInfo.cpp - X86 Instruction Information ---------------===// |
| 2 | // |
| 3 | // This file contains the X86 implementation of the MInstructionInfo class. |
| 4 | // |
| 5 | //===----------------------------------------------------------------------===// |
| 6 | |
| 7 | #include "X86InstructionInfo.h" |
Chris Lattner | 9bbf439 | 2002-10-29 17:43:19 +0000 | [diff] [blame^] | 8 | #include "llvm/CodeGen/MachineInstr.h" |
| 9 | #include <iostream> |
Chris Lattner | 7261408 | 2002-10-25 22:55:53 +0000 | [diff] [blame] | 10 | |
| 11 | // X86Insts - Turn the InstructionInfo.def file into a bunch of instruction |
| 12 | // descriptors |
| 13 | // |
Chris Lattner | 9bbf439 | 2002-10-29 17:43:19 +0000 | [diff] [blame^] | 14 | static const MachineInstrDescriptor X86Insts[] = { |
| 15 | #define I(ENUM, NAME, FLAGS, TSFLAGS) \ |
| 16 | { NAME, -1, -1, 0, false, 0, 0, TSFLAGS, FLAGS }, |
Chris Lattner | 7261408 | 2002-10-25 22:55:53 +0000 | [diff] [blame] | 17 | #include "X86InstructionInfo.def" |
| 18 | }; |
| 19 | |
| 20 | X86InstructionInfo::X86InstructionInfo() |
Chris Lattner | 9bbf439 | 2002-10-29 17:43:19 +0000 | [diff] [blame^] | 21 | : MachineInstrInfo(X86Insts, sizeof(X86Insts)/sizeof(X86Insts[0]), 0) { |
Chris Lattner | 7261408 | 2002-10-25 22:55:53 +0000 | [diff] [blame] | 22 | } |
| 23 | |
| 24 | |
| 25 | // print - Print out an x86 instruction in GAS syntax |
Chris Lattner | 9bbf439 | 2002-10-29 17:43:19 +0000 | [diff] [blame^] | 26 | void X86InstructionInfo::print(const MachineInstr *MI, std::ostream &O) const { |
Chris Lattner | 7261408 | 2002-10-25 22:55:53 +0000 | [diff] [blame] | 27 | // FIXME: This sucks. |
Chris Lattner | 9bbf439 | 2002-10-29 17:43:19 +0000 | [diff] [blame^] | 28 | O << getName(MI->getOpCode()) << "\n"; |
Chris Lattner | 7261408 | 2002-10-25 22:55:53 +0000 | [diff] [blame] | 29 | } |
| 30 | |