Open64 (mfef90, whirl2f, and IR tools)  TAG: version-openad; SVN changeset: 916
isa_registers_gen.h
Go to the documentation of this file.
00001 /*
00002 
00003   Copyright (C) 2000, 2001 Silicon Graphics, Inc.  All Rights Reserved.
00004 
00005   This program is free software; you can redistribute it and/or modify it
00006   under the terms of version 2 of the GNU General Public License as
00007   published by the Free Software Foundation.
00008 
00009   This program is distributed in the hope that it would be useful, but
00010   WITHOUT ANY WARRANTY; without even the implied warranty of
00011   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
00012 
00013   Further, this software is distributed without any warranty that it is
00014   free of the rightful claim of any third person regarding infringement 
00015   or the like.  Any license provided herein, whether implied or 
00016   otherwise, applies only to this software file.  Patent licenses, if 
00017   any, provided herein do not apply to combinations of this program with 
00018   other software, or any other product whatsoever.  
00019 
00020   You should have received a copy of the GNU General Public License along
00021   with this program; if not, write the Free Software Foundation, Inc., 59
00022   Temple Place - Suite 330, Boston MA 02111-1307, USA.
00023 
00024   Contact information:  Silicon Graphics, Inc., 1600 Amphitheatre Pky,
00025   Mountain View, CA 94043, or:
00026 
00027   http://www.sgi.com
00028 
00029   For further information regarding this notice, see:
00030 
00031   http://oss.sgi.com/projects/GenInfo/NoticeExplan
00032 
00033 */
00034 
00035 
00036 // isa_registers_gen.h
00038 //
00039 //  Interface for describing registers.
00040 //
00041 //  void ISA_Registers_Begin( const char* archname )
00042 //      Initialize to generate register information for the architecture
00043 //      with the given <archname>. The information will be written
00044 //      to the files targ_isa_registers.[ch].
00045 //
00046 //  ISA_REGISTER_CLASS
00047 //      An abstract type that holds the properties of a class of
00048 //      registers.
00049 //
00050 //  ISA_REGISTER_CLASS ISA_Register_Class_Create( const char *name,
00051 //                                                int bit_size,
00052 //                                                bool can_store,
00053 //                                                bool multiple_save )
00054 //      Create a new register class. <name> is used to construct
00055 //      an enumeration constant for this register class in the generated
00056 //      output of the form: ISA_REGISTER_CLASS_<name>. <bit_size>
00057 //      specifies the size, in bits, of the registers in the class.
00058 //      <can_store> flags if there exists load and store instructions
00059 //      for registers of this class. <multiple_save> flags if it is
00060 //      possible to save/restore multiple registers of this class at once.
00061 //
00062 //  void ISA_Register_Set( ISA_REGISTER_CLASS rclass,
00063 //                         int min_regnum,
00064 //                         int max_regnum,
00065 //                         const char *def_name_format,
00066 //                         const char **names,
00067 //                         int isa_mask )
00068 //      Describe the registers of a class. <rclass> specifies the register
00069 //      class. <min_regnum> specifies the lowest numbered register.
00070 //      <max_regnum> specifies the highest numbered register.
00071 //      <def_name_format> specifies a printf style format string for 
00072 //      generating the default a register name given a register number.
00073 //      <names> is an array, with index 0 corresponding to <min_regnum>,
00074 //      which specifies reg names -- if an index is NULL, the name
00075 //      is generated using <def_name_format>. <names> itself may be
00076 //      NULL if <def_name_format> is valid for all registes.
00077 //      <isa_mask> indicates which ISA levels this description is valid 
00078 //      for. ISA_Register_Set may be called multiple times for a given 
00079 //      register class if the register usage differs amoung the ISA levels.
00080 //
00081 //  void ISA_Register_Subclass_Create( const char *name,
00082 //                                     ISA_REGISTER_CLASS rclass,
00083 //                                     int count,
00084 //                                     const int *members,
00085 //                                     const char **names )
00086 //      Describes a subclass of registers. <name> names the subclass
00087 //      and is used to form an enum identifying the subclass. 
00088 //      <rclass> is the base register class. <count> is the number of
00089 //      members of registers in the subclass. <members> is an array
00090 //      containing the register numbers of the subclass members.
00091 //      <names> contains the assembly language names of the subclass
00092 //      members. The names correspond one-to-one with the <members>
00093 //      elements. If the subclass register name is not different,
00094 //      NULL can be specified in place of the name. Additionaly,
00095 //      NULL can be passed in place of the entire array if there are
00096 //      no subclass specific names.
00097 //
00098 //  void ISA_Registers_End( void )
00099 //      Complete processing.
00100 //
00101 //
00103 
00104 
00105 
00106 
00107 #ifndef ISA_REGISTERS_GEN_INCLUDED
00108 #define ISA_REGISTERS_GEN_INCLUDED
00109 #ifdef __cplusplus
00110 extern "C" {
00111 #endif
00112 #ifndef ISA_REGISTERS_GEN_RCS_ID
00113 #define ISA_REGISTERS_GEN_RCS_ID
00114 #ifdef _KEEP_RCS_ID
00115 #endif
00116 #endif
00117 
00118 typedef struct isa_register_class *ISA_REGISTER_CLASS;
00119 
00120 void ISA_Registers_Begin( const char* archname );
00121 ISA_REGISTER_CLASS ISA_Register_Class_Create( const char *name,
00122                                               int bit_size,
00123                                               bool can_store,
00124                                               bool multiple_save );
00125 void ISA_Register_Set( ISA_REGISTER_CLASS rclass,
00126                        int min_regnum,
00127                        int max_regnum,
00128                        const char *def_name_format,
00129                        const char **names,
00130                        int isa_mask );
00131 void ISA_Register_Subclass_Create( const char *name,
00132                                    ISA_REGISTER_CLASS rclass,
00133                                    int count,
00134                                    const int *members,
00135                                    const char **names );
00136 void ISA_Registers_End( void );
00137 
00138 #ifdef __cplusplus
00139 }
00140 #endif
00141 #endif
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines