Open64 (mfef90, whirl2f, and IR tools)  TAG: version-openad; SVN changeset: 916
isa_bundle_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_bundle_gen.h
00038 //
00039 //  Interface for packing instructions into an instruction word for all
00040 //  instructions in the ISA.
00041 //
00042 //  void ISA_Bundle_Begin( const char* archname, int bundle_width )
00043 //      Initialize to generate bundle (or template) information for the 
00044 //      architecture with the given <archname>.  The information will be 
00045 //      written to the files targ_isa_bundle.[ch].  The width of the
00046 //      bundle, in bits, is specified by <bundle_width>.
00047 //
00048 //  void ISA_Bundle_End(void)
00049 //      Complete processing of bundle (or template) encoding.
00050 //
00052 //
00053 //  TYPE ISA_EXEC_UNIT_TYPE
00054 //      An abstract type that describes the different execution unit types.
00055 //
00056 //  ISA_EXEC_UNIT_TYPE ISA_Exec_Unit_Type_Create (const char* name)
00057 //      Used to create a new ISA_EXEC_UNIT_TYPE. <name> is the execution_type
00058 //      name. 
00059 //  
00060 //  Instruction_Exec_Unit_Group (ISA_EXEC_UNIT_TYPE unit_type, ....)
00061 //      Used to group all TOPs which can execute in <unit_type>.
00062 //
00063 //  TYPE ISA_BUNDLE_TYPE
00064 //      An abstract type that describes different types of bundle encodings.
00065 //
00066 //  ISA_BUNDLE_TYPE ISA_Bundle_Type_Create( const char* name,
00067 //                                          const char* asm_name,
00068 //                                          int slot_count )
00069 //      Used to create a new ISA_BUNDLE_TYPE.  <name> is the bundle_type name.
00070 //      <asm_name> is the bundle's assembly language name.
00071 //      The rules to encode the execution types within a bundle are described
00072 //      by the routine below. <slot_count> specifies the number of intruction
00073 //      slots in this bundle type. 
00074 //
00075 //  void Slot (int slot_index, Exec_Unit_Type type)
00076 //      The <slot_index> of the current bundling type is reserved for 
00077 //      execution unit <type>.
00078 //
00079 //  void Stop (int slot_index)
00080 //      The <slot_index> of the current bundling type is a stop bit.
00081 //
00083 //
00084 //  void ISA_Bundle_Pack_Create (ISA_BUNDLE_PACK_ENDIAN endian)
00085 //      Start the specification of how the fields of a bundle are packed.
00086 //      <endian> specifies if the bundle should be in little or big endian
00087 //      format. The generator handles and cross-endian issues.
00088 //
00089 //  void Pack_Template (int comp_pos, int bundle_pos, int width)
00090 //  void Pack_Slot (int slot, int comp_pos, int bundle_pos, int width)
00091 //      Specify packing for a bundle field. <comp_pos> specifies the
00092 //      the start of the field in the input component value. <bundle_pos>
00093 //      specifies the start of the field in the bundle. <width> specifies
00094 //      the width of the field.
00095 //
00097 
00098 
00099 
00100 #ifndef isa_bundle_gen_INCLUDED
00101 #define isa_bundle_gen_INCLUDED
00102 
00103 #ifdef __cplusplus
00104 extern "C" {
00105 #endif
00106 
00107 typedef struct isa_exec_unit_type *ISA_EXEC_UNIT_TYPE;
00108 typedef struct isa_bundle_type *ISA_BUNDLE_TYPE;
00109 
00110 typedef enum {
00111   ISA_Bundle_Pack_Little_Endian,
00112   ISA_Bundle_Pack_Big_Endian
00113 } ISA_BUNDLE_PACK_ENDIAN;
00114 
00115 extern void ISA_Bundle_Begin ( const char* archname, int bundle_width );
00116 
00117 extern ISA_EXEC_UNIT_TYPE ISA_Exec_Unit_Type_Create ( 
00118         const char* name,
00119         ISA_EXEC_UNIT_TYPE base_unit );
00120 extern void Instruction_Exec_Unit_Group (ISA_EXEC_UNIT_TYPE unit_type, ...);
00121 
00122 extern void ISA_Bundle_Pack_Create (ISA_BUNDLE_PACK_ENDIAN endian);
00123 extern void Pack_Template (int comp_pos, int bundle_pos, int width);
00124 extern void Pack_Slot (int slot, int comp_pos, int bundle_pos, int width);
00125 
00126 extern void ISA_Bundle_Type_Create ( const char* name,
00127                                      const char* asm_name,
00128                                      int slot_count );
00129 extern void Slot (int slot_index, ISA_EXEC_UNIT_TYPE type);
00130 extern void Stop (int slot_index);
00131 
00132 extern void ISA_Bundle_End(void);
00133 
00134 #ifdef __cplusplus
00135 }
00136 #endif
00137 #endif /* isa_bundle_gen_INCLUDED */
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines