From de04dd746fce692a56a5fe6ce8532b2dc13756b6 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Fri, 1 Aug 2003 05:18:03 +0000 Subject: [PATCH] encode size information into each ValueType Add new RegisterInfo class git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7469 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Target/Target.td | 44 +++++++++++++++++++++++++++++++++----------- 1 file changed, 33 insertions(+), 11 deletions(-) diff --git a/lib/Target/Target.td b/lib/Target/Target.td index e63cd635ccc..2dec163c9a9 100644 --- a/lib/Target/Target.td +++ b/lib/Target/Target.td @@ -11,18 +11,18 @@ // Value types - These values correspond to the register types defined in the // ValueTypes.h file. // -class ValueType { string Namespace = "MVT"; } +class ValueType { string Namespace = "MVT"; int Size = size; } -def i1 : ValueType; // One bit boolean value -def i8 : ValueType; // 8-bit integer value -def i16 : ValueType; // 16-bit integer value -def i32 : ValueType; // 32-bit integer value -def i64 : ValueType; // 64-bit integer value -def i128 : ValueType; // 128-bit integer value -def f32 : ValueType; // 32-bit floating point value -def f64 : ValueType; // 64-bit floating point value -def f80 : ValueType; // 80-bit floating point value -def f128 : ValueType; // 128-bit floating point value +def i1 : ValueType<1>; // One bit boolean value +def i8 : ValueType<8>; // 8-bit integer value +def i16 : ValueType<16>; // 16-bit integer value +def i32 : ValueType<32>; // 32-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 f64 : ValueType<64>; // 64-bit floating point value +def f80 : ValueType<80>; // 80-bit floating point value +def f128 : ValueType<128>; // 128-bit floating point value //===----------------------------------------------------------------------===// @@ -61,6 +61,7 @@ class RegisterClass regList> { // Alignment - Specify the alignment required of the registers when they are // stored or loaded to memory. // + int Size = RegType.Size; int Alignment = alignment; // MemberList - Specify which registers are in this class. If the @@ -76,6 +77,27 @@ class RegisterClass regList> { code allocation_order_end; } +// RegisterInfo - This class should only be instantiated once to provide +// parameters which are global to the the target machine, such as callee safed +// registers. +// +class RegisterInfo { + // ClassName - Specify the name of the class that should be generated by the + // register info emitter. This class may be further subclasses by custom + // target code to implement virtual methods as necessary. Targets must + // specify a value for this. + // + string ClassName; + + // CalleeSavedRegisters - As you might guess, this is a list of the callee + // saved registers for a target. + list CalleeSavedRegisters = []; + + // PointerType - Specify the value type to be used to represent pointers in + // this target. Typically this is an i32 or i64 type. + ValueType PointerType; +} + //===----------------------------------------------------------------------===// // Instruction set description -