Open64 (mfef90, whirl2f, and IR tools)  TAG: version-openad; SVN changeset: 916
cwh_types.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 /* ====================================================================
00037  * ====================================================================
00038  *
00039  *
00040  * Revision history:
00041  *  dd-mmm-95 - Original Version
00042  *
00043  * Description: prototypes for entry points into cwh_types.c
00044  *
00045  * ====================================================================
00046  * ====================================================================
00047  */
00048 
00049 #ifndef CWH_TYPES_INCLUDED
00050 #define CWH_TYPES_INCLUDED
00051 
00052 #ifdef _KEEP_RCS_ID
00053 #endif /* _KEEP_RCS_ID */
00054 
00055 enum ty_bound_enum {
00056   LOW,
00057   UPPER,
00058   STRIDE
00059 };
00060 
00061 extern TY_IDX  cwh_types_mk_procedure_TY (TY_IDX ret_typ,INT32 nparms, BOOL global, BOOL host) ;
00062 
00063 extern TY_IDX  cwh_types_scalar_TY(TY_IDX ty) ;
00064 extern TY_IDX  cwh_types_array_TY(TY_IDX ty) ;
00065 extern TY_IDX  cwh_types_WN_TY(WN * wn, BOOL addr) ;
00066 extern TY_IDX  cwh_types_dope_TY(INT32 num_dims,TY_IDX base, BOOL host, BOOL ptr);
00067 
00068 extern TY_IDX  cwh_types_ch_parm_TY(WN *ln) ;
00069 extern ST *  cwh_types_character_extra(ST *dummy) ;
00070 extern BOOL  cwh_types_is_character(TY_IDX ty) ;
00071 extern BOOL  cwh_types_is_logical(TY_IDX ty) ;
00072 extern BOOL  cwh_types_is_character_function(TY_IDX ty) ;
00073 
00074 extern TY_IDX  cwh_types_mk_common_TY(INT64 size, mUINT16 al);
00075 extern TY_IDX  cwh_types_mk_module_TY(INT64 size, mUINT16 al);  
00076 
00077 extern void  cwh_types_mk_element(ST *c, ST * st);
00078 extern TY_IDX  cwh_types_mk_namelist_TY(INT32 nitems) ;
00079 
00080 extern FLD_HANDLE cwh_types_fld_dummy(INT64  off,TY_IDX ty) ;
00081 extern void  cwh_types_get_dope_info(INT32 crayfield, INT32 *offset, INT32 *rshift, 
00082                                      INT64 *mask, TYPE_ID *ty);
00083 extern INT32 cwh_types_dope_rank(TY_IDX ty);
00084 extern TY_IDX  cwh_types_dope_basic_TY(TY_IDX ty);
00085 
00086 extern WN *  cwh_types_size_WN(TY_IDX, WN *e_sz) ;
00087 extern TY_IDX  cwh_types_array_temp_TY(WN *ar, TY_IDX sc) ;
00088 extern WN *  cwh_types_bound_WN(TY_IDX ty, INT16 i, enum ty_bound_enum  b) ;
00089 
00090 extern INT64 cwh_cray_type_from_TY(TY_IDX ty);
00091 extern INT64 cwh_cray_type_from_MTYPE(TYPE_ID ty);
00092 extern BOOL  cwh_types_is_dope(TY_IDX ty) ;
00093 extern FLD_HANDLE cwh_types_dope_dims_FLD(TY_IDX ty);
00094 
00095 extern char * cwh_types_mk_anon_name (char * p) ;
00096 extern TY_IDX cwh_types_array_util(INT16 rank, TY_IDX ta, INT32 align, INT64 size,char *name, 
00097                                    BOOL alloc_arbs);
00098 
00099 extern void  cwh_types_init_target(void);
00100 extern TY_IDX  cwh_types_mk_pointer_TY(TY_IDX ty, BOOL host) ;
00101 extern TY_IDX  cwh_types_mk_f90_pointer_ty (TY_IDX ty);
00102 extern TY_IDX  cwh_types_mk_logical_TY(INT32 sz, mUINT16 align) ;
00103 extern TY_IDX  cwh_types_form_misaligned_TY(TY_IDX ty,mUINT16 align) ;
00104 extern TY_IDX  cwh_types_make_pointer_type(TY_IDX ty, BOOL f90_pointer);
00105 extern TY_IDX  cwh_types_enter_TY(TY_IDX can) ;
00106 extern TY_IDX  cwh_types_mk_equiv_TY(INT64 size);
00107 extern TY_IDX  cwh_types_mk_character_TY (WN * sz, ST *st, BOOL is_wn);
00108 extern TY_IDX  cwh_types_unique_TY(TY_IDX ty_idx); 
00109 extern void    cwh_types_enter_common_element(ST *c, ST * st);
00110 extern TY_IDX  cwh_types_mk_result_temp_TY(void) ;
00111 extern   void  cwh_types_copyin_pragma(ST *st) ; 
00112 extern bool    cwh_types_contains_dope(TY_IDX ty) ;
00113 
00114 
00115 /* access to TY idx */
00116 
00117 #define t_TY(x) (x.table_index)  
00118 
00119 
00120 /* dope vector size definitions */
00121 extern INT32 DOPE_bound_sz;
00122 extern INT32 DOPE_dim_offset;
00123 extern INT32 DOPE_sz;
00124 
00125 #define DOPE_NM  11
00126 #define DOPE_USED  DOPE_NM-1
00127 #define BOUND_NM 3
00128 #define DIM_SZ BOUND_NM*DOPE_bound_sz
00129 #define ADDR_OFFSET 0
00130 #define ADDR_TYPEID Pointer_Mtype
00131 
00132 #define IS_TYLIST
00133 
00134 extern TY_IDX DOPE_bound_ty ;
00135 
00136   /* decl_distribute_pragmas - set to a list of distribute pragmas generated */
00137 extern WN   *decl_distribute_pragmas;
00138 
00139 /* Type for LOGICAL(4), (predefined) */
00140 extern TY_IDX logical4_ty;
00141 
00142 #ifdef __cplusplus
00143 extern "C" {
00144 #endif
00145 
00146 typedef struct dope_header1 {
00147     unsigned int        assoc     :1;   /* associated flag */
00148     unsigned int        ptr_alloc :1;   /* set if allocated by pointer */
00149     unsigned int        p_or_a    :2;   /* pointer or allocatable array. Use */
00150                                         /* enum ptrarray values.  */
00151     unsigned int        a_contig  :1;   /* array storage contiguous flag */
00152     unsigned int        unused    :27;  /* pad for first 32 bits        */
00153 } dope_header1_type;
00154 
00155 typedef struct dope_header2 {
00156     unsigned int        unused    :29;  /* pad for second 32-bits       */
00157     unsigned int        n_dim     :3;   /* number of dimensions */
00158 } dope_header2_type;
00159 
00160 typedef struct f90_type {
00161 
00162     unsigned int                :32;     /* used for future development */
00163     unsigned int        type    :8;     /* type code */
00164     unsigned int        dpflag  :1;     /* set if declared double precision
00165                                          * or double complex */
00166     unsigned int kind_or_star   :3;     /* Set if KIND= or *n appears in the
00167                                          * variable declaration.  Values
00168                                          * are from enum dec_codes */
00169     unsigned int        int_len :12;    /* internal length in bits of iolist
00170                                          * entity. 8 for character data to
00171                                          * indicate size of each character */
00172     unsigned int        dec_len :8;     /* declared length in bytes for *n
00173                                          * or KIND value. Ignored if
00174                                          * kind_or_star==DVD_DEFAULT */
00175 } f90_type_t;
00176 
00177 #ifdef __cplusplus
00178 }
00179 #endif
00180 
00181 #endif /* CWH_TYPES_INCLUDED */
00182 
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines