00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055
00056
00057
00058 #ifndef CWH_DEFINES_INCLUDED
00059 #define CWH_DEFINES_INCLUDED
00060
00061 #ifdef _KEEP_RCS_ID
00062 static char *rcs_id = "$Source: /home/bos/bk/kpro64-pending/crayf90/sgi/SCCS/s.cwh_defines.h $ $Revision: 1.5 $";
00063 #endif
00064
00065
00066
00067
00068 typedef INT64 OFFSET_64 ;
00069 typedef unsigned long ULONG ;
00070 typedef long SLONG ;
00071 #if ((defined(TARG_IA64) || defined(TARG_X8664)) && defined(_LP64))
00072 #define cast_to_TY(x) ((TY_IDX)x)
00073 #define cast_to_WN(x) ((WN *) (void *)x)
00074 #define cast_to_ST(x) ((ST *) (void *)x)
00075 #define cast_to_LB(x) ((LABEL_IDX)x)
00076 #define cast_to_uint(x) ((unsigned int) x)
00077 #define cast_to_int(x) ((int)x)
00078 #define cast_to_long(x) ((long)(void*)x)
00079 #define cast_to_void(x) ((void *)x)
00080 #define cast_to_STB(x) ((STB_pkt *) (void *)x)
00081 #else
00082 #define cast_to_TY(x) ((TY_IDX) (INTPTR)(void *)x)
00083 #define cast_to_WN(x) ((WN *) (void *)x)
00084 #define cast_to_ST(x) ((ST *) (void *)x)
00085 #define cast_to_LB(x) ((LABEL_IDX) (INTPTR) (void *)x)
00086 #define cast_to_uint(x) ((unsigned long) (INTPTR) (void *)x)
00087 #define cast_to_int(x) ((long ) (void *)x)
00088 #define cast_to_long(x) ((long)(void*)x)
00089 #define cast_to_void(x) ((void *)x)
00090 #define cast_to_STB(x) ((STB_pkt *) (void *)x)
00091 #endif
00092
00093
00094
00095
00096 #define DUMP_TY(ty) dump_ty(ty)
00097 #define DUMP_ST(st) dump_st(st)
00098 #define DUMP_LB(lb) dump_label(lb)
00099 #define DUMP_WN(wn) fdump_tree(stdout,wn);
00100 #define DUMP_STK cwh_stk_dump()
00101
00102
00103 extern void dump_ty (TY_IDX ty);
00104 extern void dump_st (ST * st);
00105 extern void dump_label(LABEL_IDX lb);
00106
00107
00108
00109 #define bit_to_byte(a) (a >> 3)
00110 #define bit_to_byte_WN(a) (cwh_expr_bincalc(OPR_DIV,WN_COPY_Tree(a),WN_CreateIntconst (OPC_U4INTCONST,8)))
00111 #define byte_to_bit(a) (a << 3)
00112 #define test_flag(f,sh) ((INT32)((f >> sh) & 1))
00113
00114
00115
00116 #define GLOBAL_LEVEL 1
00117 #define HOST_LEVEL GLOBAL_LEVEL + 1
00118 #define INTERNAL_LEVEL HOST_LEVEL + 1
00119
00120
00121
00122 #define WNOPR(w) (WN_operator(w))
00123 #define WNRTY(w) (WN_rtype(w))
00124 #define IS_GLOBAL_SYMTAB(s) (SYMTAB_level(s) == GLOBAL_LEVEL)
00125 #define IN_HOST_PU (CURRENT_SYMTAB == HOST_LEVEL)
00126 #define IN_NESTED_PU (CURRENT_SYMTAB >= INTERNAL_LEVEL)
00127
00128 #define RESULT_SIZE 16
00129 #define RESULT_ALIGN 8
00130
00131
00132
00133
00134
00135
00136
00137
00138 typedef struct {
00139 WN * wn ;
00140 TY_IDX ty ;
00141 } W_node ;
00142
00143 #define W_wn(a) (a.wn)
00144 #define W_ty(a) (a.ty)
00145 #define iW_wn(a) (a->wn)
00146 #define iW_ty(a) (a->ty)
00147
00148
00149
00150
00151
00152
00153
00154
00155
00156 typedef struct blist {
00157 ST * element ;
00158 struct blist * nxt ;
00159 } ITEM ;
00160
00161 #define I_element(i) ((i)->element)
00162 #define I_next(i) ((i)->nxt)
00163
00164 typedef struct clist {
00165 ITEM * first ;
00166 ITEM * last ;
00167 INT32 nitems ;
00168 } LIST ;
00169
00170 #define L_first(l) ((l)->first)
00171 #define L_last(l) ((l)->last)
00172 #define L_num(l) ((l)->nitems)
00173
00174
00175
00176
00177 #define OPC_UNKNOWN 0
00178 #define MAX_ARY_DIMS 7
00179 #define NUM_LOG_KINDS 4
00180
00181 #define ANULL -1
00182
00183
00184 extern MEM_POOL *FE_Mempool;
00185
00186
00187
00188
00189
00190
00191
00192
00193
00194
00195
00196
00197
00198
00199
00200
00201
00202
00203
00204
00205
00206
00207
00208
00209
00210
00211
00212 #undef RESULT_SIZE
00213
00214 #ifdef TARG_MIPS
00215 #define RESULT_SIZE 16
00216 #endif
00217 #ifdef TARG_IA32
00218 #if defined(BUILD_OS_DARWIN)
00219
00220 #define RESULT_SIZE 8
00221 #else
00222 #define RESULT_SIZE 0
00223 #endif
00224 #endif
00225 #ifdef TARG_IA64
00226 #define RESULT_SIZE 64
00227 #endif
00228 #ifdef TARG_X8664
00229 #define RESULT_SIZE 16
00230 #endif
00231
00232 #define STRUCT_BY_VALUE(ty) ((TY_kind(ty) == KIND_STRUCT) \
00233 && (TY_size(ty) <= RESULT_SIZE) \
00234 && !cwh_types_contains_dope(ty))
00235
00236
00237 #endif
00238