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 #ifndef config_targ_INCLUDED 00037 #define config_targ_INCLUDED 00038 #ifdef __cplusplus 00039 extern "C" { 00040 #endif 00041 00042 /* ==================================================================== 00043 * ==================================================================== 00044 * 00045 * Module: config_targ.h 00046 * $Revision: 1.1.1.1 $ 00047 * $Date: 2005/10/21 19:00:00 $ 00048 * $Author: marcel $ 00049 * $Source: /proj/osprey/CVS/open64/osprey1.0/common/com/ia64/config_targ.h,v $ 00050 * 00051 * Revision history: 00052 * 15-Jun-91 - Original Version 00053 * 25-Sep-91 - Added subprogram interface pointers. 00054 * 27-Nov-91 - Reconfiguration of target representation for TP. 00055 * 21-Apr-93 - Set TARG_NEEDS_QUAD_OP to 1 00056 * 14-Mar-97 - Removed most -TARG group flags to config_targ_opt.h. 00057 * 00058 * Description: 00059 * 00060 * This file defines general configuration parameters which are 00061 * specific to the compiler's target machine and system. 00062 * There is an approximate distinction between -TARG option group 00063 * flags and their configuration (in config_targ_opt.[hc]), and more 00064 * generic target configuration (in this file). Note that this file 00065 * is included in config.h, and hence indirectly in most source files, 00066 * whereas config_targ_opt.h is only included directly, so putting new 00067 * -TARG option-related variables in config_targ_opt.[hc] is to be 00068 * preferred to putting them here. 00069 * 00070 * See com/config.h for a detailed description of configuration 00071 * parameters, where they are declared, and how they are processed. 00072 * 00073 * See also: 00074 * TARGET/com/targ_const.h -- Manipulation of target constants, as 00075 * appropriate on the host system. 00076 * 00077 * ==================================================================== 00078 * ==================================================================== 00079 */ 00080 00081 00082 #ifdef _KEEP_RCS_ID 00083 static char *config_targ_rcs_id = "$Source: /proj/osprey/CVS/open64/osprey1.0/common/com/ia64/config_targ.h,v $ $Revision: 1.1.1.1 $"; 00084 #endif /* _KEEP_RCS_ID */ 00085 00086 #include "mtypes.h" 00087 00088 00089 /* ==================================================================== 00090 * 00091 * Target selection 00092 * 00093 * Note that the current target is also given by a #define name of the 00094 * form TARG_xxx. However, since a single compiler may support several 00095 * target variants, this symbol (defined in the TDT) will generally be 00096 * less specific than the variable Target below. 00097 * 00098 * ==================================================================== 00099 */ 00100 00101 /* ========== */ 00102 /* Target ABI */ 00103 /* ========== */ 00104 00105 typedef enum { 00106 ABI_UNDEF, /* Undefined */ 00107 ABI_I32, /* 32-bit */ 00108 ABI_I64 /* 64-bit */ 00109 } TARGET_ABI; 00110 00111 extern TARGET_ABI Target_ABI; 00112 00113 /* ================ */ 00114 /* Target processor */ 00115 /* ================ */ 00116 00117 /* Define an enum representing all current target processors. 00118 * For variants and modifiers of these, see tp/com/config_targ.h. 00119 */ 00120 typedef enum { 00121 TARGET_UNDEF, /* Undefined */ 00122 TARGET_ITANIUM, /* Intel Itanium */ 00123 TARGET_ITANIUM2 /* Intel Itanium */ 00124 } TARGET_PROCESSOR; 00125 00126 extern TARGET_PROCESSOR Target; /* -Tc */ 00127 00128 /* return the target name for <target> */ 00129 extern char *Targ_Name (TARGET_PROCESSOR target); 00130 00131 #define Is_Target_Itanium() (Target==TARGET_ITANIUM || Target == TARGET_ITANIUM2) 00132 #define Is_Target_32bit() (FALSE) 00133 #define Is_Target_64bit() (TRUE) 00134 00135 00136 /* ========== */ 00137 /* Target ISA */ 00138 /* ========== */ 00139 00140 typedef enum { 00141 TARGET_ISA_UNDEF, /* Undefined */ 00142 TARGET_ISA_I1 00143 } TARGET_ISA; 00144 00145 extern TARGET_ISA Target_ISA; /* -Tc.Rc */ 00146 00147 /* return the ISA name corresponding to <target_isa> */ 00148 extern char *Isa_Name (TARGET_ISA target_isa); 00149 00150 #define Is_Target_ISA_I1() (Target_ISA==TARGET_ISA_I1) 00151 00152 #define Is_Target_ISA_I1Plus() (Target_ISA >= TARGET_ISA_I1) 00153 00154 /* What is the floating point format? */ 00155 #define IEEE_FP_FORMAT TRUE 00156 #define IBM_FP_FORMAT FALSE 00157 00158 /* Do we need to implement quad float? */ 00159 /* #define TARG_NEEDS_QUAD_OPS */ 00160 00161 /* Target-specific controls: */ 00162 00163 /* We need to know the machine type of the integer and floating point 00164 * registers for purposes of subprogram save/restore: 00165 */ 00166 extern CLASS_INDEX Spill_Int_Mtype; 00167 extern CLASS_INDEX Spill_Float_Mtype; 00168 00169 /* We need to know the maximum machine type corresponding directly to 00170 * the machine registers: 00171 */ 00172 extern CLASS_INDEX Max_Int_Mtype, Max_Uint_Mtype; 00173 00174 /* We need to know the default machine type to be used for internally 00175 * generated integers, e.g. DO loop indices. These will default to the 00176 * max int types above, but the FEs may override the defaults: 00177 */ 00178 extern CLASS_INDEX Def_Int_Mtype, Def_Uint_Mtype; 00179 00180 /* =================== */ 00181 /* Target Pointer Size */ 00182 /* =================== */ 00183 00184 /* On MIPS III targets, should we use 32-bit pointers? */ 00185 extern BOOL Use_32_Bit_Pointers; /* -Tc.P32 */ 00186 00187 /* For various targets, what are the characteristics of pointers */ 00188 extern INT Pointer_Size; /* in bytes */ 00189 extern CLASS_INDEX Pointer_Mtype; 00190 extern CLASS_INDEX Pointer_Mtype2; 00191 00192 /* What are pointers and booleans aliased to in WHIRL */ 00193 extern TYPE_ID Pointer_type; 00194 extern TYPE_ID Pointer_type2; 00195 extern TYPE_ID Boolean_type; 00196 extern TYPE_ID Boolean_type2; 00197 extern TYPE_ID Integer_type; 00198 00199 /* On every target, there is an upper bound on the size pf data object 00200 * that can be defined. The following two definitions define this 00201 * upper bound for 32 and 64 bits mode compilations respectively. 00202 */ 00203 #define MAX_64BITS_OBJECT_SIZE 0x000000ffffffffffULL /* 40 bits */ 00204 #define MAX_32BITS_OBJECT_SIZE 0x000000007fffffffULL /* 31 bits */ 00205 00206 /* On most targets, it will be necessary to decide whether a text 00207 * address is usable in an instruction literal field. The following 00208 * specifies the maximum value which we may assume a function or label 00209 * address will take on. 00210 * 00211 * NOTE: On the MIPS, jumps are relative to the current 256MB segment, 00212 * and we always assume that we can reach anything we want to jump/call 00213 * to, since the linker will insert stubs if necessary. So we treat 00214 * the limit as 256MB here. We make it smaller than necessary to allow 00215 * for some arithmetic without overflowing the limits. 00216 */ 00217 #define MAX_LABEL_SYMVAL 0x03fffff0 00218 #define MAX_FUNC_SYMVAL 0x03fffff0 00219 00220 /* maximum gspace (gp-relative) size */ 00221 #define DEFAULT_GSPACE 0x3fffff 00222 00223 /* ================== */ 00224 /* Comparison Results */ 00225 /* ================== */ 00226 00227 /* For various targets, what is the comparison result type? */ 00228 extern INT Comparison_Result_Size; /* in bytes */ 00229 extern CLASS_INDEX Comparison_Result_Mtype; 00230 00231 /* ============= */ 00232 /* Miscellaneous */ 00233 /* ============= */ 00234 00235 /* Miscellaneous exception control */ 00236 #define FPX_I 0x01 /* IEEE-754 inexact exception */ 00237 #define FPX_U 0x02 /* IEEE-754 underflow exception */ 00238 #define FPX_O 0x04 /* IEEE-754 overflow exception */ 00239 #define FPX_Z 0x08 /* IEEE-754 zero divide exception */ 00240 #define FPX_V 0x10 /* IEEE-754 invalid operation exception */ 00241 #define FPX_ALL 0x1f /* All the IEEE-754 exceptions */ 00242 #define EXC_ALL 0x1f /* All the exceptions */ 00243 extern INT16 FP_Exception_Enable_Max; /* Max FP trap enables */ 00244 extern INT16 FP_Exception_Enable_Min; /* Min FP trap enables */ 00245 00246 /* Is the "char" type signed? */ 00247 extern BOOL Char_Type_Is_Signed; 00248 00249 00250 /* ==================================================================== 00251 * 00252 * Target debugging options 00253 * 00254 * ==================================================================== 00255 */ 00256 00257 /* Symbolic Debug mode as specified on command line. (The mode can 00258 * change from PU to PU because, for example, we encounter a call to 00259 * the routine 'alloca()' -- we must restore the mode to the value as it 00260 * was specified on the command line, so we remember it.) 00261 */ 00262 #define SDM_NONE 0x00 /* No information */ 00263 #define SDM_LINE 0x01 /* Line numbers */ 00264 #define SDM_SYMBOL 0x02 /* Symbol table information */ 00265 #define SDM_SEQLINE 0x04 /* Force sequentail line numbers */ 00266 #define SDM_GEN_FP 0x08 /* Save/restore of fp for sdb */ 00267 #define SDM_USE_FP 0x10 /* Use fp for sdb definitions */ 00268 00269 extern INT16 Symbolic_Debug_Mode; /* Current */ 00270 extern INT16 Max_Symbolic_Debug_Mode; /* Maximum for any PU */ 00271 00272 #define Want_Line_Debugging (Symbolic_Debug_Mode & SDM_LINE) 00273 #define Want_Sequential_Line_Debugging (Symbolic_Debug_Mode & SDM_SEQLINE) 00274 #define Want_Symbol_Debugging (Symbolic_Debug_Mode & SDM_SYMBOL) 00275 #define Want_Any_Debugging (Symbolic_Debug_Mode &(SDM_LINE|SDM_SEQLINE|SDM_SYMBOL)) 00276 #define Gen_Frame_Ptr (Symbolic_Debug_Mode & SDM_GEN_FP) 00277 #define Set_Gen_Frame_Ptr (Max_Symbolic_Debug_Mode |= SDM_GEN_FP, \ 00278 Symbolic_Debug_Mode |= SDM_GEN_FP) 00279 #define Use_Frame_Ptr_For_Sdb (Symbolic_Debug_Mode & SDM_USE_FP) 00280 #define Set_Use_Frame_Ptr_For_Sdb (Max_Symbolic_Debug_Mode |= SDM_USE_FP, \ 00281 Symbolic_Debug_Mode |= SDM_USE_FP) 00282 00283 /* I believe the frame pointer flags function as follows: 00284 * 00285 * The debugger may require that a frame pointer be generated and 00286 * available (Gen_Frame_Ptr), and/or that it be used in the external 00287 * symbol table definitions of variables' addressing emitted in 00288 * coffsdb.c (Use_Frame_Ptr_For_Sdb). We currently treat these 00289 * independently, though perhaps Use_Frame_Ptr_For_Sdb should imply 00290 * Gen_Frame_Ptr. 00291 * 00292 * In addition, memmodel.[hc] contains variables Gen_Frame_Pointer 00293 * and Use_Frame_Pointer which actually control whether code is 00294 * generated to produce the FP on PU entry and use it for referencing 00295 * part of the stack frame, respectively. Gen_Frame_Pointer is 00296 * initialized to Gen_Frame_Ptr, but may also be turned on by the 00297 * Use_Frame_Pointer requirement. Use_Frame_Pointer is currently 00298 * set only if the stack frame is large enough that we want both 00299 * pointers to improve addressibility; it will also probably be set 00300 * if we need to deal with dynamic local data allocation. It is 00301 * therefore completely independent of Use_Frame_Ptr_For_Sdb. 00302 */ 00303 00304 /* ==================================================================== 00305 * 00306 * Miscellaneous options 00307 * 00308 * ==================================================================== 00309 */ 00310 00311 /* Do we need to force NOOPs in empty cycles? */ 00312 #define FORCE_NOOPS FALSE 00313 00314 /* Can 64-bit values be 4-byte aligned in memory? */ 00315 extern BOOL Allow_Word_Aligned_Doubles; 00316 00317 /* Should we generate position-independent code by default? */ 00318 extern BOOL Generate_Position_Independent_Code; 00319 00320 /* Split 64-bit integer ops into 32-bit ops, and simulate them? */ 00321 extern BOOL Split_64_Bit_Int_Ops; 00322 00323 /* Split quad-precision ops into double-precision, and simulate them? */ 00324 extern BOOL Split_Quad_Ops; 00325 00326 /* Should we simulate 32-bit subprogram interface by default? */ 00327 extern BOOL Simulate_32_Bit_Interface; 00328 00329 /* Workaround for TFP branch cache problem. */ 00330 extern BOOL No_Quad_Aligned_Branch; 00331 extern BOOL No_Quad_Aligned_Branch; 00332 00333 /* Does target provides only unsigned 64-bit instructions? */ 00334 extern BOOL Only_Unsigned_64_Bit_Ops; 00335 00336 extern INT32 Align_Instructions; /* Align frequent blocks and funcs */ 00337 00338 extern BOOL Eager_Bottom_Load; 00339 extern BOOL Eager_Ptr_Deref; 00340 extern BOOL Eager_Null_Ptr_Deref; 00341 00342 /* file has non-standard gp groups, i.e. SYMTAB_gp_group(Global_Symtab) */ 00343 extern BOOL Has_GP_Groups; 00344 00345 /* Does target have offsets in load and store instructions? 00346 * Note: CG should instead test: 00347 * ( TOP_Find_Operand_Use( OP_code(op), OU_offset ) >= 0 ) */ 00348 extern BOOL Use_Load_Store_Offset; 00349 00350 00351 /* ==================================================================== 00352 * 00353 * Initialization interface 00354 * 00355 * ==================================================================== 00356 */ 00357 00358 /* Configuration prior to flag processing: */ 00359 extern void Preconfigure_Target (void); 00360 00361 /* Configuration after flag processing: */ 00362 extern void Configure_Target (void); 00363 extern void IPA_Configure_Target (void); 00364 00365 /* Reconfiguration for each source file: */ 00366 extern void Configure_Source_Target ( char *filename ); 00367 00368 /* return FALSE if abi mismatch */ 00369 extern BOOL Set_Target_ABI (BOOL is_64bit, INT isa); 00370 00371 00372 /*================================================================*/ 00373 /* Architecture specific options. Variables are set in config_targ.cxx, 00374 #defines are set in config_targ.h 00375 */ 00376 00377 extern BOOL ARCH_mask_shift_counts; 00378 extern BOOL ARCH_generate_nor; 00379 #define ARCH_recip_is_exact TRUE 00380 #define ARCH_has_bit_tests TRUE 00381 00382 /* default value for WHIRL_Keep_Cvt */ 00383 #define DEFAULT_KEEP_CVT TRUE 00384 00385 #ifdef __cplusplus 00386 } 00387 #endif 00388 #endif /* config_targ_INCLUDED */
1.5.6