mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-08-17 21:29:20 +00:00
Start adding usefulness to the DAG node definitions, add a new Expander
class git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7634 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
2787d1a34b
commit
3e77d6e44c
@ -18,12 +18,9 @@ def i8 : ValueType<8>; // 8-bit integer value
|
|||||||
def i16 : ValueType<16>; // 16-bit integer value
|
def i16 : ValueType<16>; // 16-bit integer value
|
||||||
def i32 : ValueType<32>; // 32-bit integer value
|
def i32 : ValueType<32>; // 32-bit integer value
|
||||||
def i64 : ValueType<64>; // 64-bit integer value
|
def i64 : ValueType<64>; // 64-bit integer value
|
||||||
def i128 : ValueType<128>; // 128-bit integer value
|
|
||||||
def f32 : ValueType<32>; // 32-bit floating point value
|
def f32 : ValueType<32>; // 32-bit floating point value
|
||||||
def f64 : ValueType<64>; // 64-bit floating point value
|
def f64 : ValueType<64>; // 64-bit floating point value
|
||||||
def f80 : ValueType<80>; // 80-bit floating point value
|
def f80 : ValueType<80>; // 80-bit floating point value
|
||||||
def f128 : ValueType<128>; // 128-bit floating point value
|
|
||||||
|
|
||||||
|
|
||||||
//===----------------------------------------------------------------------===//
|
//===----------------------------------------------------------------------===//
|
||||||
// Register file description - These classes are used to fill in the target
|
// Register file description - These classes are used to fill in the target
|
||||||
@ -109,6 +106,12 @@ class Instruction {
|
|||||||
dag Pattern;
|
dag Pattern;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
class Expander<dag pattern, list<dag> result> {
|
||||||
|
dag Pattern = pattern;
|
||||||
|
list<dag> Result = result;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// InstrInfo - This class should only be instantiated once to provide parameters
|
// InstrInfo - This class should only be instantiated once to provide parameters
|
||||||
// which are global to the the target machine.
|
// which are global to the the target machine.
|
||||||
//
|
//
|
||||||
@ -144,14 +147,48 @@ class Target {
|
|||||||
//===----------------------------------------------------------------------===//
|
//===----------------------------------------------------------------------===//
|
||||||
// DAG node definitions used by the instruction selector...
|
// DAG node definitions used by the instruction selector...
|
||||||
//
|
//
|
||||||
def set; // FIXME: these are subject to substantial change
|
class DagNodeResultType;
|
||||||
def plus;
|
def DNRT_void : DagNodeResultType; // Tree node always returns void
|
||||||
def minus;
|
def DNRT_val : DagNodeResultType; // A non-void type
|
||||||
def mult;
|
def DNRT_arg0 : DagNodeResultType; // Tree node returns same type as Arg0
|
||||||
def div;
|
|
||||||
def udiv;
|
class DagNodeArgType;
|
||||||
def mod;
|
def DNAT_val : DagNodeArgType; // Any value
|
||||||
def umod;
|
def DNAT_arg0 : DagNodeArgType; // Same as for arg #0
|
||||||
def imm8;
|
def DNAT_ptr : DagNodeArgType; // Returns the target pointer type
|
||||||
def imm16;
|
|
||||||
def imm32;
|
class DagNode<DagNodeResultType ret, list<DagNodeArgType> args> {
|
||||||
|
DagNodeResultType RetType = ret;
|
||||||
|
list<DagNodeArgType> ArgTypes = args;
|
||||||
|
string EnumName = ?;
|
||||||
|
}
|
||||||
|
|
||||||
|
// BuiltinDagNodes are built into the instruction selector and correspond to
|
||||||
|
// enum values.
|
||||||
|
class BuiltinDagNode<DagNodeResultType Ret, list<DagNodeArgType> Args,
|
||||||
|
string Ename> : DagNode<Ret, Args> {
|
||||||
|
let EnumName = Ename;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Magic nodes...
|
||||||
|
def set : DagNode<DNRT_void, [DNAT_val, DNAT_arg0]>;
|
||||||
|
|
||||||
|
// Terminals...
|
||||||
|
def imm : DagNode<DNRT_val, []>;
|
||||||
|
|
||||||
|
// Arithmetic...
|
||||||
|
def plus : BuiltinDagNode<DNRT_arg0, [DNAT_val, DNAT_arg0], "Plus">;
|
||||||
|
def minus : BuiltinDagNode<DNRT_arg0, [DNAT_val, DNAT_arg0], "Minus">;
|
||||||
|
//def mult : DagNode<2, DNRT_arg0>;
|
||||||
|
//def div : DagNode<2, DNRT_arg0>;
|
||||||
|
//def udiv : DagNode<2, DNRT_arg0>;
|
||||||
|
//def mod : DagNode<2, DNRT_arg0>;
|
||||||
|
//def umod : DagNode<2, DNRT_arg0>;
|
||||||
|
|
||||||
|
//def load : DagNode<1, DNRT_val>;
|
||||||
|
//def store : DagNode<2, DNRT_Void>;
|
||||||
|
|
||||||
|
// Other...
|
||||||
|
def ret : BuiltinDagNode<DNRT_void, [DNAT_val], "Ret">;
|
||||||
|
def retvoid : BuiltinDagNode<DNRT_void, [], "RetVoid">;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user