Add lots more info
[oota-llvm.git] / lib / Target / X86 / X86InstrInfo.def
1 //===-- X86InstructionInfo.def - X86 Instruction Information ----*- C++ -*-===//
2 //
3 // This file describes all of the instructions that the X86 backend uses.  It
4 // relys on an external 'I' macro being defined that takes the arguments
5 // specified below, and is used to make all of the information relevant to an
6 // instruction be in one place.
7 //
8 // Note that X86 Instructions always have the destination register listed as
9 // operand 0, unless it does not produce a value (in which case the TSFlags will
10 // include X86II::Void).
11 //
12 //===----------------------------------------------------------------------===//
13
14 // NOTE: No include guards desired
15
16 #ifndef I
17 #errror "Must define I macro before including X86/X86InstructionInfo.def!"
18 #endif
19
20 // Arguments to be passed into the I macro
21 //  #1: Enum name - This ends up being the opcode symbol in the X86 namespace
22 //  #2: Opcode name, as used by the gnu assembler
23 //  #3: Instruction Flags - This should be a field or'd together that contains
24 //      constants from the MachineInstrInfo.h file.
25 //  #4: Target Specific Flags - Another bitfield containing X86 specific flags
26 //      that we are interested in for each instruction.  These should be flags
27 //      defined in X86InstrInfo.h in the X86II namespace.
28 //
29
30 // The first instruction must always be the PHI instruction: (FIXME, not yet)
31 I(PHI         , "phi",                0, 0)
32
33 // The second instruction must always be the noop instruction: (FIXME, not yet)
34 I(NOOP        , "nop",                0, X86II::Void) // nop          90
35
36 // Miscellaneous instructions
37 I(RET         , "ret",       M_RET_FLAG, X86II::Void) // ret          CB
38
39 // Move instructions
40 I(MOVir8      , "movb",               0, 0)           // R = imm8     B0+ rb
41 I(MOVir16     , "movw",               0, 0)           // R = imm16    B8+ rw
42 I(MOVir32     , "movl",               0, 0)           // R = imm32    B8+ rd
43
44 // Arithmetic instructions
45 I(ADDrr8      , "addb",               0, 0)           // R8  += R8    00/r
46 I(ADDrr16     , "addw",               0, 0)           // R16 += R16   01/r
47 I(ADDrr32     , "addl",               0, 0)           // R32 += R32   02/r
48
49
50 // At this point, I is dead, so undefine the macro
51 #undef I