00001 /* 00002 * Copyright 2003, 2004 PathScale, Inc. All Rights Reserved. 00003 */ 00004 00005 /* 00006 00007 Copyright (C) 2000, 2001 Silicon Graphics, Inc. All Rights Reserved. 00008 00009 This program is free software; you can redistribute it and/or modify it 00010 under the terms of version 2 of the GNU General Public License as 00011 published by the Free Software Foundation. 00012 00013 This program is distributed in the hope that it would be useful, but 00014 WITHOUT ANY WARRANTY; without even the implied warranty of 00015 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 00016 00017 Further, this software is distributed without any warranty that it is 00018 free of the rightful claim of any third person regarding infringement 00019 or the like. Any license provided herein, whether implied or 00020 otherwise, applies only to this software file. Patent licenses, if 00021 any, provided herein do not apply to combinations of this program with 00022 other software, or any other product whatsoever. 00023 00024 You should have received a copy of the GNU General Public License along 00025 with this program; if not, write the Free Software Foundation, Inc., 59 00026 Temple Place - Suite 330, Boston MA 02111-1307, USA. 00027 00028 Contact information: Silicon Graphics, Inc., 1600 Amphitheatre Pky, 00029 Mountain View, CA 94043, or: 00030 00031 http://www.sgi.com 00032 00033 For further information regarding this notice, see: 00034 00035 http://oss.sgi.com/projects/GenInfo/NoticeExplan 00036 00037 */ 00038 00039 00040 #ifndef config_targ_INCLUDED 00041 #define config_targ_INCLUDED 00042 #ifdef __cplusplus 00043 extern "C" { 00044 #endif 00045 00046 /* ==================================================================== 00047 * ==================================================================== 00048 * 00049 * Module: config_targ.h 00050 * $Revision: 1.1 $ 00051 * $Date: 2005/07/27 02:18:02 $ 00052 * $Author: kevinlo $ 00053 * $Source: /depot/CVSROOT/javi/src/sw/cmplr/common/com/MIPS/config_targ.h,v $ 00054 * 00055 * Revision history: 00056 * 15-Jun-91 - Original Version 00057 * 25-Sep-91 - Added subprogram interface pointers. 00058 * 27-Nov-91 - Reconfiguration of target representation for TP. 00059 * 21-Apr-93 - Set TARG_NEEDS_QUAD_OP to 1 00060 * 14-Mar-97 - Removed most -TARG group flags to config_targ_opt.h. 00061 * 00062 * Description: 00063 * 00064 * This file defines general configuration parameters which are 00065 * specific to the compiler's target machine and system. 00066 * There is an approximate distinction between -TARG option group 00067 * flags and their configuration (in config_TARG.[hc]), and more 00068 * generic target configuration (in this file). Note that this file 00069 * is included in config.h, and hence indirectly in most source files, 00070 * whereas config_targ_opt.h is only included directly, so putting new 00071 * -TARG option-related variables in config_TARG.[hc] is to be 00072 * preferred to putting them here. 00073 * 00074 * See com/config.h for a detailed description of configuration 00075 * parameters, where they are declared, and how they are processed. 00076 * 00077 * See also: 00078 * TARGET/com/targ_const.h -- Manipulation of target constants, as 00079 * appropriate on the host system. 00080 * 00081 * ==================================================================== 00082 * ==================================================================== 00083 */ 00084 00085 00086 #ifdef _KEEP_RCS_ID 00087 static char *config_targ_rcs_id = "$Source: /depot/CVSROOT/javi/src/sw/cmplr/common/com/MIPS/config_targ.h,v $ $Revision: 1.1 $"; 00088 #endif /* _KEEP_RCS_ID */ 00089 00090 #include "mtypes.h" 00091 00092 00093 /* ==================================================================== 00094 * 00095 * Target selection 00096 * 00097 * Note that the current target is also given by a #define name of the 00098 * form TARG_xxx. However, since a single compiler may support several 00099 * target variants, this symbol (defined in the TDT) will generally be 00100 * less specific than the variable Target below. 00101 * 00102 * ==================================================================== 00103 */ 00104 00105 /* ========== */ 00106 /* Target ABI */ 00107 /* ========== */ 00108 00109 /* ABI_N32 collides with the ABI_N32 macro defined in */ 00110 /* kg++fe/gnu/config/MIPS/mips.h. */ 00111 #undef ABI_N32 00112 typedef enum { 00113 ABI_UNDEF, /* Undefined */ 00114 ABI_N32, /* 32-bit */ 00115 ABI_N64 /* 64-bit */ 00116 } TARGET_ABI; 00117 00118 extern TARGET_ABI Target_ABI; 00119 00120 /* ================ */ 00121 /* Target processor */ 00122 /* ================ */ 00123 00124 /* Define an enum representing all current target processors. 00125 * For variants and modifiers of these, see tp/com/config_targ.h. 00126 */ 00127 typedef enum { 00128 TARGET_UNDEF, /* Undefined */ 00129 TARGET_sb1, 00130 TARGET_R10K, 00131 TARGET_sl1_pcore, 00132 TARGET_sl1_dsp, 00133 TARGET_sl2_pcore, 00134 TARGET_sl2_mcore, 00135 } TARGET_PROCESSOR; 00136 #define Is_Target_Sb1() (Target == TARGET_sb1) 00137 #define Is_Target_R10K() (Target == TARGET_R10K) 00138 #ifdef TARG_SL 00139 #define Is_Target_Sl1_pcore() (Target == TARGET_sl1_pcore) 00140 #define Is_Target_Sl1_dsp() (Target == TARGET_sl1_dsp) 00141 #define Is_Target_Sl2_pcore() (Target == TARGET_sl2_pcore) 00142 #define Is_Target_Sl2_mcore() (Target == TARGET_sl2_mcore) 00143 #endif 00144 #define Is_Target_64bit() (Target_ABI == ABI_N64) 00145 #define Is_Target_Opteron() (0) 00146 00147 extern TARGET_PROCESSOR Target; /* -Tc */ 00148 00149 /* return the target name for <target> */ 00150 extern char *Targ_Name (TARGET_PROCESSOR target); 00151 00152 #define Is_Target_Itanium() (Target==TARGET_ITANIUM) 00153 00154 00155 /* ========== */ 00156 /* Target ISA */ 00157 /* ========== */ 00158 00159 typedef enum { 00160 TARGET_ISA_UNDEF, /* Undefined */ 00161 TARGET_ISA_M1, 00162 TARGET_ISA_M2, 00163 TARGET_ISA_M3, 00164 TARGET_ISA_M4, 00165 TARGET_ISA_Mips64 00166 } TARGET_ISA; 00167 00168 extern TARGET_ISA Target_ISA; /* -Tc.Rc */ 00169 00170 /* return the ISA name corresponding to <target_isa> */ 00171 extern char *Isa_Name (TARGET_ISA target_isa); 00172 00173 #define Is_Target_ISA_M1() (Target_ISA==TARGET_ISA_M1) 00174 #define Is_Target_ISA_M2() (Target_ISA==TARGET_ISA_M2) 00175 #define Is_Target_ISA_M3() (Target_ISA==TARGET_ISA_M3) 00176 #define Is_Target_ISA_M4() (Target_ISA==TARGET_ISA_M4) 00177 #define Is_Target_ISA_Mips64() (Target_ISA==TARGET_ISA_Mips64) 00178 #define Is_Target_ISA_M1Plus() (Target_ISA >= TARGET_ISA_M1) 00179 #define Is_Target_ISA_M2Plus() (Target_ISA >= TARGET_ISA_M2) 00180 #define Is_Target_ISA_M3Plus() (Target_ISA >= TARGET_ISA_M3) 00181 #define Is_Target_ISA_M4Plus() (Target_ISA >= TARGET_ISA_M4) 00182 00183 /* What is the floating point format? */ 00184 #define IEEE_FP_FORMAT TRUE 00185 #define IBM_FP_FORMAT FALSE 00186 00187 /* Do we need to implement quad float? */ 00188 /* #define TARG_NEEDS_QUAD_OPS */ 00189 00190 /* Target-specific controls: */ 00191 00192 /* We need to know the machine type of the integer and floating point 00193 * registers for purposes of subprogram save/restore: 00194 */ 00195 extern CLASS_INDEX Spill_Int_Mtype; 00196 extern CLASS_INDEX Spill_Float_Mtype; 00197 extern CLASS_INDEX Spill_Int32_Mtype; 00198 extern CLASS_INDEX Spill_Float32_Mtype; 00199 00200 /* We need to know the maximum machine type corresponding directly to 00201 * the machine registers: 00202 */ 00203 extern CLASS_INDEX Max_Int_Mtype, Max_Uint_Mtype; 00204 00205 /* We need to know the default machine type to be used for internally 00206 * generated integers, e.g. DO loop indices. These will default to the 00207 * max int types above, but the FEs may override the defaults: 00208 */ 00209 extern CLASS_INDEX Def_Int_Mtype, Def_Uint_Mtype; 00210 00211 #if defined(INT32_MAX) 00212 #undef INT32_MAX 00213 #undef INT32_MIN 00214 #endif 00215 #define INT32_MAX INT_MAX 00216 #define INT32_MIN INT_MIN 00217 00218 /* =================== */ 00219 /* Target Pointer Size */ 00220 /* =================== */ 00221 00222 /* On MIPS III targets, should we use 32-bit pointers? */ 00223 extern BOOL Use_32_Bit_Pointers; /* -Tc.P32 */ 00224 00225 /* For various targets, what are the characteristics of pointers */ 00226 extern INT Pointer_Size; /* in bytes */ 00227 extern CLASS_INDEX Pointer_Mtype; 00228 extern CLASS_INDEX Pointer_Mtype2; 00229 00230 /* What are pointers and booleans aliased to in WHIRL */ 00231 extern TYPE_ID Pointer_type; 00232 extern TYPE_ID Pointer_type2; 00233 extern TYPE_ID Boolean_type; 00234 extern TYPE_ID Boolean_type2; 00235 extern TYPE_ID Integer_type; 00236 00237 /* On every target, there is an upper bound on the size pf data object 00238 * that can be defined. The following two definitions define this 00239 * upper bound for 32 and 64 bits mode compilations respectively. 00240 */ 00241 #define MAX_64BITS_OBJECT_SIZE 0x000000ffffffffffULL /* 40 bits */ 00242 #define MAX_32BITS_OBJECT_SIZE 0x000000007fffffffULL /* 31 bits */ 00243 00244 /* On most targets, it will be necessary to decide whether a text 00245 * address is usable in an instruction literal field. The following 00246 * specifies the maximum value which we may assume a function or label 00247 * address will take on. 00248 * 00249 * NOTE: On the MIPS, jumps are relative to the current 256MB segment, 00250 * and we always assume that we can reach anything we want to jump/call 00251 * to, since the linker will insert stubs if necessary. So we treat 00252 * the limit as 256MB here. We make it smaller than necessary to allow 00253 * for some arithmetic without overflowing the limits. 00254 */ 00255 #define MAX_LABEL_SYMVAL 0x03fffff0 00256 #define MAX_FUNC_SYMVAL 0x03fffff0 00257 00258 /* maximum gspace (gp-relative) size */ 00259 //#define DEFAULT_GSPACE 0x3fffff 00260 #define DEFAULT_GSPACE 0x7fff 00261 00262 /* ================== */ 00263 /* Comparison Results */ 00264 /* ================== */ 00265 00266 /* For various targets, what is the comparison result type? */ 00267 extern INT Comparison_Result_Size; /* in bytes */ 00268 extern CLASS_INDEX Comparison_Result_Mtype; 00269 00270 /* ============= */ 00271 /* Miscellaneous */ 00272 /* ============= */ 00273 00274 /* Miscellaneous exception control */ 00275 #define FPX_I 0x01 /* IEEE-754 inexact exception */ 00276 #define FPX_U 0x02 /* IEEE-754 underflow exception */ 00277 #define FPX_O 0x04 /* IEEE-754 overflow exception */ 00278 #define FPX_Z 0x08 /* IEEE-754 zero divide exception */ 00279 #define FPX_V 0x10 /* IEEE-754 invalid operation exception */ 00280 #define FPX_ALL 0x1f /* All the IEEE-754 exceptions */ 00281 #define EXC_ALL 0x1f /* All the exceptions */ 00282 extern INT16 FP_Exception_Enable_Max; /* Max FP trap enables */ 00283 extern INT16 FP_Exception_Enable_Min; /* Min FP trap enables */ 00284 00285 /* Is the "char" type signed? */ 00286 extern BOOL Char_Type_Is_Signed; 00287 00288 00289 /* ==================================================================== 00290 * 00291 * Target debugging options 00292 * 00293 * ==================================================================== 00294 */ 00295 00296 /* Symbolic Debug mode as specified on command line. (The mode can 00297 * change from PU to PU because, for example, we encounter a call to 00298 * the routine 'alloca()' -- we must restore the mode to the value as it 00299 * was specified on the command line, so we remember it.) 00300 */ 00301 #define SDM_NONE 0x00 /* No information */ 00302 #define SDM_LINE 0x01 /* Line numbers */ 00303 #define SDM_SYMBOL 0x02 /* Symbol table information */ 00304 #define SDM_SEQLINE 0x04 /* Force sequentail line numbers */ 00305 #define SDM_GEN_FP 0x08 /* Save/restore of fp for sdb */ 00306 #define SDM_USE_FP 0x10 /* Use fp for sdb definitions */ 00307 00308 extern INT16 Symbolic_Debug_Mode; /* Current */ 00309 extern INT16 Max_Symbolic_Debug_Mode; /* Maximum for any PU */ 00310 00311 #define Want_Line_Debugging (Symbolic_Debug_Mode & SDM_LINE) 00312 #define Want_Sequential_Line_Debugging (Symbolic_Debug_Mode & SDM_SEQLINE) 00313 #define Want_Symbol_Debugging (Symbolic_Debug_Mode & SDM_SYMBOL) 00314 #define Want_Any_Debugging (Symbolic_Debug_Mode &(SDM_LINE|SDM_SEQLINE|SDM_SYMBOL)) 00315 #define Gen_Frame_Ptr (Symbolic_Debug_Mode & SDM_GEN_FP) 00316 #define Set_Gen_Frame_Ptr (Max_Symbolic_Debug_Mode |= SDM_GEN_FP, \ 00317 Symbolic_Debug_Mode |= SDM_GEN_FP) 00318 #define Use_Frame_Ptr_For_Sdb (Symbolic_Debug_Mode & SDM_USE_FP) 00319 #define Set_Use_Frame_Ptr_For_Sdb (Max_Symbolic_Debug_Mode |= SDM_USE_FP, \ 00320 Symbolic_Debug_Mode |= SDM_USE_FP) 00321 00322 /* I believe the frame pointer flags function as follows: 00323 * 00324 * The debugger may require that a frame pointer be generated and 00325 * available (Gen_Frame_Ptr), and/or that it be used in the external 00326 * symbol table definitions of variables' addressing emitted in 00327 * coffsdb.c (Use_Frame_Ptr_For_Sdb). We currently treat these 00328 * independently, though perhaps Use_Frame_Ptr_For_Sdb should imply 00329 * Gen_Frame_Ptr. 00330 * 00331 * In addition, memmodel.[hc] contains variables Gen_Frame_Pointer 00332 * and Use_Frame_Pointer which actually control whether code is 00333 * generated to produce the FP on PU entry and use it for referencing 00334 * part of the stack frame, respectively. Gen_Frame_Pointer is 00335 * initialized to Gen_Frame_Ptr, but may also be turned on by the 00336 * Use_Frame_Pointer requirement. Use_Frame_Pointer is currently 00337 * set only if the stack frame is large enough that we want both 00338 * pointers to improve addressibility; it will also probably be set 00339 * if we need to deal with dynamic local data allocation. It is 00340 * therefore completely independent of Use_Frame_Ptr_For_Sdb. 00341 */ 00342 00343 /* ==================================================================== 00344 * 00345 * Miscellaneous options 00346 * 00347 * ==================================================================== 00348 */ 00349 00350 /* Do we need to force NOOPs in empty cycles? */ 00351 #define FORCE_NOOPS FALSE 00352 00353 /* Can 64-bit values be 4-byte aligned in memory? */ 00354 extern BOOL Allow_Word_Aligned_Doubles; 00355 00356 /* Should we generate position-independent code by default? */ 00357 extern BOOL Generate_Position_Independent_Code; 00358 00359 /* Split 64-bit integer ops into 32-bit ops, and simulate them? */ 00360 extern BOOL Split_64_Bit_Int_Ops; 00361 00362 /* Split quad-precision ops into double-precision, and simulate them? */ 00363 extern BOOL Split_Quad_Ops; 00364 00365 /* Should we simulate 32-bit subprogram interface by default? */ 00366 extern BOOL Simulate_32_Bit_Interface; 00367 00368 /* Workaround for TFP branch cache problem. */ 00369 extern BOOL No_Quad_Aligned_Branch; 00370 extern BOOL No_Quad_Aligned_Branch; 00371 00372 /* Does target provides only unsigned 64-bit instructions? */ 00373 extern BOOL Only_Unsigned_64_Bit_Ops; 00374 00375 extern INT32 Align_Instructions; /* Align frequent blocks and funcs */ 00376 00377 extern BOOL Eager_Bottom_Load; 00378 extern BOOL Eager_Ptr_Deref; 00379 extern BOOL Eager_Null_Ptr_Deref; 00380 00381 /* file has non-standard gp groups, i.e. SYMTAB_gp_group(Global_Symtab) */ 00382 extern BOOL Has_GP_Groups; 00383 00384 /* Does target have offsets in load and store instructions? 00385 * Note: CG should instead test: 00386 * ( TOP_Find_Operand_Use( OP_code(op), OU_offset ) >= 0 ) */ 00387 extern BOOL Use_Load_Store_Offset; 00388 00389 00390 /* ==================================================================== 00391 * 00392 * Initialization interface 00393 * 00394 * ==================================================================== 00395 */ 00396 00397 /* Configuration prior to flag processing: */ 00398 extern void Preconfigure_Target (void); 00399 00400 /* Configuration after flag processing: */ 00401 extern void Configure_Target (void); 00402 extern void IPA_Configure_Target (void); 00403 00404 /* Reconfiguration for each source file: */ 00405 extern void Configure_Source_Target ( char *filename ); 00406 00407 /* return FALSE if abi mismatch */ 00408 extern BOOL Set_Target_ABI (BOOL is_64bit, INT isa); 00409 00410 00411 /*================================================================*/ 00412 /* Architecture specific options. Variables are set in config_targ.cxx, 00413 #defines are set in config_targ.h 00414 */ 00415 00416 extern BOOL ARCH_mask_shift_counts; 00417 extern BOOL ARCH_generate_nor; 00418 #define ARCH_recip_is_exact TRUE 00419 #define ARCH_has_bit_tests TRUE 00420 00421 /* default value for WHIRL_Keep_Cvt */ 00422 #define DEFAULT_KEEP_CVT TRUE 00423 00424 #ifdef __cplusplus 00425 } 00426 #endif 00427 #endif /* config_targ_INCLUDED */
1.5.6