Chris Lattner | 055c965 | 2002-10-29 21:05:24 +0000 | [diff] [blame] | 1 | //===- X86InstrInfo.cpp - X86 Instruction Information ---------------===// |
Chris Lattner | 7261408 | 2002-10-25 22:55:53 +0000 | [diff] [blame] | 2 | // |
Chris Lattner | 33f53b5 | 2002-10-29 20:48:56 +0000 | [diff] [blame] | 3 | // This file contains the X86 implementation of the MachineInstrInfo class. |
Chris Lattner | 7261408 | 2002-10-25 22:55:53 +0000 | [diff] [blame] | 4 | // |
| 5 | //===----------------------------------------------------------------------===// |
| 6 | |
Chris Lattner | 055c965 | 2002-10-29 21:05:24 +0000 | [diff] [blame] | 7 | #include "X86InstrInfo.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 | |
Chris Lattner | 055c965 | 2002-10-29 21:05:24 +0000 | [diff] [blame] | 11 | // X86Insts - Turn the InstrInfo.def file into a bunch of instruction |
Chris Lattner | 7261408 | 2002-10-25 22:55:53 +0000 | [diff] [blame] | 12 | // descriptors |
| 13 | // |
Chris Lattner | 9bbf439 | 2002-10-29 17:43:19 +0000 | [diff] [blame] | 14 | static const MachineInstrDescriptor X86Insts[] = { |
Chris Lattner | b752e9a | 2002-10-30 01:15:31 +0000 | [diff] [blame^] | 15 | #define I(ENUM, NAME, FLAGS, TSFLAGS) \ |
| 16 | { NAME, \ |
| 17 | -1, /* Always vararg */ \ |
| 18 | ((TSFLAGS) & X86II::Void) ? -1 : 0, /* Result is in 0 */ \ |
| 19 | 0, false, 0, 0, TSFLAGS, FLAGS, TSFLAGS }, |
Chris Lattner | 055c965 | 2002-10-29 21:05:24 +0000 | [diff] [blame] | 20 | #include "X86InstrInfo.def" |
Chris Lattner | 7261408 | 2002-10-25 22:55:53 +0000 | [diff] [blame] | 21 | }; |
| 22 | |
Chris Lattner | 055c965 | 2002-10-29 21:05:24 +0000 | [diff] [blame] | 23 | X86InstrInfo::X86InstrInfo() |
Chris Lattner | 9bbf439 | 2002-10-29 17:43:19 +0000 | [diff] [blame] | 24 | : MachineInstrInfo(X86Insts, sizeof(X86Insts)/sizeof(X86Insts[0]), 0) { |
Chris Lattner | 7261408 | 2002-10-25 22:55:53 +0000 | [diff] [blame] | 25 | } |
| 26 | |
| 27 | |
| 28 | // print - Print out an x86 instruction in GAS syntax |
Chris Lattner | 055c965 | 2002-10-29 21:05:24 +0000 | [diff] [blame] | 29 | void X86InstrInfo::print(const MachineInstr *MI, std::ostream &O) const { |
Chris Lattner | 7261408 | 2002-10-25 22:55:53 +0000 | [diff] [blame] | 30 | // FIXME: This sucks. |
Chris Lattner | 9bbf439 | 2002-10-29 17:43:19 +0000 | [diff] [blame] | 31 | O << getName(MI->getOpCode()) << "\n"; |
Chris Lattner | 7261408 | 2002-10-25 22:55:53 +0000 | [diff] [blame] | 32 | } |
| 33 | |