blob: d8cf29c16a0f780af645e8dee3b0752fcd4b8688 [file] [log] [blame]
Chris Lattneree6b5f62003-07-29 23:07:13 +00001//===- Target.td - Target Independent TableGen interface --------*- C++ -*-===//
2//
3// This file defines the target-independent interfaces which should be
4// implemented by each target which is using a TableGen based code generator.
5//
Misha Brukman01c16382003-05-29 18:48:17 +00006//===----------------------------------------------------------------------===//
7
Chris Lattnerb3aa3192003-07-28 04:24:59 +00008// Value types - These values correspond to the register types defined in the
Chris Lattner84c40c12003-07-29 23:02:49 +00009// ValueTypes.h file.
10class ValueType { string Namespace = "MVT"; }
Chris Lattnerb3aa3192003-07-28 04:24:59 +000011def i1 : ValueType; // One bit boolean value
12def i8 : ValueType; // 8-bit integer value
13def i16 : ValueType; // 16-bit integer value
14def i32 : ValueType; // 32-bit integer value
15def i64 : ValueType; // 64-bit integer value
16def i128 : ValueType; // 128-bit integer value
17def f32 : ValueType; // 32-bit floating point value
18def f64 : ValueType; // 64-bit floating point value
19def f80 : ValueType; // 80-bit floating point value
20def f128 : ValueType; // 128-bit floating point value
21
Misha Brukman01c16382003-05-29 18:48:17 +000022class Register {
23 string Namespace = "";
Chris Lattnerb3aa3192003-07-28 04:24:59 +000024 ValueType RegType;
Misha Brukman01c16382003-05-29 18:48:17 +000025}
26
27class Instruction {
28 string Name; // The opcode string for this instruction
29 string Namespace = "";
30
31 list<Register> Uses = []; // Default to using no non-operand registers
32 list<Register> Defs = []; // Default to modifying no non-operand registers
33
34 // These bits capture information about the high-level semantics of the
35 // instruction.
Chris Lattner84c40c12003-07-29 23:02:49 +000036 bit isReturn = 0; // Is this instruction a return instruction?
37 bit isBranch = 0; // Is this instruction a branch instruction?
38 bit isCall = 0; // Is this instruction a call instruction?
39 bit isTwoAddress = 0; // Is this a two address instruction?
40 bit isTerminator = 0; // Is this part of the terminator for a basic block?
Misha Brukman01c16382003-05-29 18:48:17 +000041}