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