00001 /* 00002 * Copyright 2002, 2003, 2004, 2005, 2006 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_INCLUDED 00041 #define config_INCLUDED 00042 00043 /* ==================================================================== 00044 * ==================================================================== 00045 * 00046 * Module: config.h 00047 * $Revision: 1.1.1.1 $ 00048 * $Date: 2005/10/21 19:00:00 $ 00049 * $Author: marcel $ 00050 * $Source: /proj/osprey/CVS/open64/osprey1.0/common/com/config.h,v $ 00051 * 00052 * Revision history: 00053 * 09-Apr-90 - Original Version 00054 * 01-Feb-91 - Copied for TP/Muse 00055 * 15-Jun-91 - Restructuring, Josie integration 00056 * 00057 * Description: 00058 * 00059 * Declare parameters describing the current host/target configuration, 00060 * and configuration options selected by the user in the command line. 00061 * 00062 * ==================================================================== 00063 * NOTE: We want to split out the declarations for various option 00064 * groups, so that adding to them doesn't cause virtually everything 00065 * to compile. These are declared in files named 00066 * common/com/config_groupname.h, and should be used instead of adding 00067 * to this file, although many of the -OPT group options are still 00068 * here (feel free to move them). 00069 * ==================================================================== 00070 * 00071 * Most of the compiler is designed to be independent of the host 00072 * (the machine and system where the compiler runs) and of the target 00073 * (the machine and system where the compiled code will run). This 00074 * file (with those it includes) is the central repository for 00075 * parameters and data which help isolate those parts of the compiler 00076 * which are not host- and/or target-independent. Note that we assume 00077 * in general that the "host" for building the compiler and the "host" 00078 * for running the compiler are the same. Although this need not be 00079 * true, it generally will be except for bootstrap phases. Given a 00080 * cross-compiler on the build host which is reasonably compatible with 00081 * the eventual native compiler on the compilation host, the 00082 * differences in the compiler code should be limited to type 00083 * definitions in defs.h and conceivably to the tdgen programs, which 00084 * will be built and run on the build host. 00085 * 00086 * CONFIGURATION PARAMETER CLASSES 00087 * 00088 * We recognize several classes of such parameters -- the following 00089 * attempts to provide guidelines on where to declare them and where 00090 * to process them. 00091 * 00092 * In the following description, "TARGET" refers to the directory 00093 * containing the host- and target-specific sources and build 00094 * directories; in the Twin Peaks case, it is "tp". 00095 * 00096 * Ubiquitous: Some configuration parameters are used essentially 00097 * everywhere in the compiler, such as the basic data 00098 * type declarations INT32, TN_NUM, and the like. 00099 * Notwithstanding the following classifications, these 00100 * are declared in TARGET/com/defs.h, which is included 00101 * in (virtually) all source files. 00102 * 00103 * Host Machine: Some parameters reflect the capabilities of the host 00104 * hardware. The most important other than the basic 00105 * types defined in defs.h involves the representation 00106 * and manipulation of target constants on the host 00107 * machine, declared in file TARGET/com/targ_const.h. 00108 * The remainder will be defined in the file 00109 * TARGET/com/config_host.h, which is included in this 00110 * file. 00111 * 00112 * Host System: Some parameters reflect the configuration of the host 00113 * software, e.g. the pathnames of library files, the 00114 * syntax of the assembler, etc. Those required broadly 00115 * will be declared in TARGET/com/config_host.h; those 00116 * with a more restricted clientele (e.g. the assembler 00117 * interface) will be maintained in more specific files. 00118 * 00119 * Note that we include in this class parameters which 00120 * depend on which compiler process is being built, i.e. 00121 * driver, front end, or back end. Definitions specific 00122 * to a single process should be #ifdef'ed based on 00123 * DRIVER, FRONT_END, or BACK_END. 00124 * 00125 * Target Machine: Most parameters dependent on the target machine 00126 * are defined by the Target Information facility, and 00127 * are used in general for driving the code generation process 00128 * throughout the compiler. The interface to the target 00129 * information is in the form of generated header files 00130 * in TARGET/targ_info. The generator programs and their 00131 * input are all under common/targ_info. 00132 * 00133 * The second significant component of this class is the 00134 * handling of target constants; as described above, the 00135 * interface to this functionality is in the file 00136 * TARGET/com/targ_const.h. 00137 * 00138 * Other parameters in this class should be declared in 00139 * TARGET/com/config_targ.h. 00140 * 00141 * Target System: Parameters in this class, e.g. runtime library 00142 * interface information, will generally have a limited 00143 * clientele, and will be in files reflecting this usage. 00144 * Some such information is in the TDT, either due to its 00145 * effect on code generation or due to the need to 00146 * preprocess it in tdgen. Anything else should be in 00147 * TARGET/com/config_targ.h. 00148 * 00149 * Compiler: Parameters in this class control processing choices 00150 * made by the compiler, independent of host or target, 00151 * e.g. which optimizations to perform, how to schedule, 00152 * and the like. They will generally be declared in the 00153 * driver modules for the relevant phases (e.g. 00154 * be/cg/cg.h, be/gopt/opt.h), and initialized by the 00155 * configuration routines (see below). 00156 * 00157 * Options: Many configuration parameters are set or affected by 00158 * options specified by the command line or environment. 00159 * Such parameters which need to be widely available will 00160 * be in this file; those required only by command line 00161 * processing will be in flags.h. NOTE: choices made 00162 * based on user interface flags like optimization level 00163 * should be implemented by declaring a control variable 00164 * and setting it in the configuration routines. We want 00165 * to be able to modify the effect of specific flag 00166 * settings in a central place where the interactions are 00167 * clear, rather than by searching the compiler for who 00168 * depends on something like optimization level. 00169 * 00170 * NOTE ALSO: There is a general interface to compiler 00171 * controls, settable via either the command line or 00172 * pragmas, in controls.h. It will still be preferable 00173 * to interface to a control variable declared here, but 00174 * the general, direct interface is available there. 00175 * 00176 * Global Data: Such data, of a non-configuration nature (e.g. the 00177 * current file names), used to be declared in flags.h. 00178 * It is now declared in the process' miscellaneous 00179 * globals header (i.e. glob.h) and defined in the 00180 * process driver (e.g. bedriver.c for the back end). 00181 * 00182 * CONFIGURATION PROCESSING 00183 * 00184 * Each of the configuration files described above has an associated 00185 * source file with three external routines (at least): 00186 * 00187 * Preconfigure_Xxx: Does configuration required before flag 00188 * processing (Xxx = Host, Target, etc.). 00189 * 00190 * Configure_Xxx: Does configuration required after flag processing. 00191 * 00192 * Configure_Source_Xxx: Does configuration required for each source 00193 * file compiled. 00194 * 00195 * Processing will involve calling, at compiler initialization time, 00196 * the Preconfigure routines, flag processing, and the Configure 00197 * routines. Then, as each source file is processed, the driver will 00198 * call the Configure_Source routine. 00199 * 00200 * CONTENTS 00201 * 00202 * - Memory allocation configuration. 00203 * 00204 * 00205 * Exported variables: 00206 * 00207 * TODO: Cleanup organization of the *_Level and Max_Sdata_Elt_Size 00208 * controls. For example, the Debug and Profile maximums and defaults 00209 * are determined by identical code in fedriver.c and bedriver.c. 00210 * Eagerness levels need their own enumerated type. 00211 * 00212 * INT8 Opt_Level 00213 * Optimization level, as set by -0 switch. Bounded by 00214 * MAX_OPT_LEVEL. Default is DEF_OPT_LEVEL if -O not given, 00215 * or DEF_O_LEVEL if -O given with no argument. 00216 * 00217 * INT8 Debug_Level 00218 * Debug level, as set by -g switch. Bounded by MAX_DEBUG_LEVEL. 00219 * Defaults to DEF_DEBUG_LEVEL if -g not given or 2 if -g given 00220 * with no argument (see fedriver.c, bedriver.c). 00221 * 00222 * INT32 Max_Sdata_Elt_Size 00223 * Maximum size of data elements allowed in .sdata/.sbss 00224 * (short data/bss) sections. Bounded by MAX_SDATA_ELT_SIZE. 00225 * Defaults to DEF_SDATA_ELT_SIZE. 00226 * 00227 * INT16 Eager_Level 00228 * Eagerness level for speculative operations, as set by -X 00229 * switch. Valid levels are: 00230 * EAGER_NONE No speculative operations 00231 * EAGER_SAFE Only exception-safe speculative ops 00232 * EAGER_ARITH Arithmetic exceptions off 00233 * EAGER_DIVIDE Divide by zero exceptions off 00234 * EAGER_MEMORY Memory exceptions off 00235 * EAGER_OTHER All speculative ops allowed 00236 * Each level includes the levels above (in this text) it. 00237 * Default is EAGER_SAFE. 00238 * 00239 * 00240 * SEE ALSO 00241 * 00242 * common/com/MIPS/config_platform.h -- target platform configuration 00243 * common/com/MIPS/config_targ.h -- target processor configuration 00244 * common/com/MIPS/config_host.h -- compiler host configuration 00245 * common/com/defs.h -- ubiquitous host types and configuration 00246 * options. 00247 * common/util/flags.h -- command-line processing utilities. 00248 * 00249 * common/com/config_ipa.h -- -IPA/-INLINE group options. 00250 * common/com/config_opt.h -- -OPT group options. 00251 * common/com/config_wopt.h -- -WOPT group options. 00252 * 00253 * ==================================================================== 00254 * ==================================================================== 00255 */ 00256 00257 00258 #ifdef _KEEP_RCS_ID 00259 static char *config_rcs_id = "$Source: common/com/SCCS/s.config.h $ $Revision: 1.24 $"; 00260 #endif /* _KEEP_RCS_ID */ 00261 00262 #include "config_host.h" /* in TARGET/com */ 00263 #include "config_targ.h" /* in TARGET/com */ 00264 00265 #if defined(__MINGW32__) 00266 /* some systems define these, some don't */ 00267 #ifndef BIG_ENDIAN 00268 #define BIG_ENDIAN 4321 00269 #endif 00270 #ifndef LITTLE_ENDIAN 00271 #define LITTLE_ENDIAN 1234 00272 #endif 00273 #elif defined(BUILD_OS_DARWIN) || defined(__CYGWIN__) || defined(__APPLE__) 00274 #include <machine/endian.h> /* for BIG_ENDIAN, LITTLE_ENDIAN */ 00275 #elif !(defined(linux)) 00276 #include <sys/endian.h> /* for BIG_ENDIAN, LITTLE_ENDIAN */ 00277 #else 00278 #include <endian.h> /* for BIG_ENDIAN, LITTLE_ENDIAN */ 00279 #endif 00280 00281 #include "mempool.h" /* Include the "fundamental" routines */ 00282 #include "flags.h" 00283 00284 /* IR builder sometimes needs to know whether we're in front end, 00285 * either to do something differently, or to complain about attempts 00286 * to handle something that shouldn't be present. Note that the 00287 * arguments to the *Assert_Front_End macros are parenthesized 00288 * parameter lists to ErrMsg or printf. 00289 */ 00290 #ifdef SINGLE_PROCESS 00291 extern INT16 In_Front_End; 00292 # ifdef Is_True_On 00293 # define Assert_Front_End(x) Assert ( In_Front_End, x ) 00294 # define FmtAssert_Front_End(x) FmtAssert ( In_Front_End, x ) 00295 # endif 00296 #else 00297 # ifdef FRONT_END 00298 # define In_Front_End TRUE 00299 # else 00300 # define In_Front_End FALSE 00301 # ifdef Is_True_On 00302 # define Assert_Front_End(x) ErrMsg x 00303 # define FmtAssert_Front_End(x) FmtAssert ( FALSE, x ) 00304 # endif 00305 # endif 00306 #endif 00307 00308 #ifndef Assert_Front_End 00309 # define Assert_Front_End(x) (void)0 00310 # define FmtAssert_Front_End(x) (void)0 00311 #endif 00312 00313 00314 00315 /* ==================================================================== 00316 * 00317 * Miscellaneous configuration options 00318 * 00319 * ==================================================================== 00320 */ 00321 00322 /***** Language being compiled -- initialized in flags.c *****/ 00323 #include "language.h" 00324 00325 #ifdef __cplusplus 00326 extern "C" { 00327 #endif 00328 00329 extern LANGUAGE Language; 00330 00331 /* What is the model to be used for logical values in Fortran? 00332 * TRUE: .TRUE. is 1 (i.e. standard C/Unix model). 00333 * truth test is zero/non-zero. 00334 * FALSE: .TRUE. is -1 (i.e. VMS Fortran model). 00335 * truth test is LSB test. 00336 * This variable is defaulted to TRUE; the Fortran FE must set it to 00337 * FALSE prior to any IRB conversions if the VMS model is desired. 00338 */ 00339 extern BOOL Use_C_Like_Logicals; 00340 00341 /***** LANGuage group options *****/ 00342 extern BOOL CXX_Bool_On; 00343 extern BOOL CXX_Bool_Set; 00344 extern BOOL CXX_Exceptions_On; 00345 extern BOOL CXX_Exceptions_Set; 00346 extern BOOL CXX_Alias_Const; 00347 extern BOOL CXX_Alias_Const_Set; 00348 extern BOOL LANG_Recursive; /* Fortran program contains recursion */ 00349 extern BOOL LANG_Recursive_Set; 00350 extern BOOL CXX_Wchar_On; 00351 extern BOOL CXX_Wchar_Set; 00352 00353 extern BOOL CXX_Namespaces_On; 00354 extern BOOL CXX_Namespaces_Set; 00355 extern BOOL CXX_Ansi_For_Init_Scope_On; 00356 extern BOOL CXX_Ansi_For_Init_Scope_Set; 00357 extern BOOL CXX_Explicit_On; 00358 extern BOOL CXX_Explicit_Set; 00359 extern BOOL CXX_Typename_On; 00360 extern BOOL CXX_Typename_Set; 00361 extern BOOL CXX_Mutable_On; 00362 extern BOOL CXX_Mutable_Set; 00363 extern BOOL CXX_Packed_On; 00364 extern BOOL CXX_Packed_Set; 00365 00366 extern BOOL CXX_Standard_C_Plus_Plus_On; 00367 extern BOOL CXX_Standard_C_Plus_Plus_Set; 00368 00369 extern BOOL LANG_Pch; 00370 extern BOOL LANG_Pch_Set; 00371 extern char *LANG_Create_Pch; 00372 extern BOOL LANG_Create_Pch_Set; 00373 extern char *LANG_Use_Pch; 00374 extern BOOL LANG_Use_Pch_Set; 00375 extern char *LANG_Pchdir; 00376 extern BOOL LANG_Pchdir_Set; 00377 00378 extern char *LANG_cxx_dialect; 00379 extern BOOL LANG_cxx_dialect_Set; 00380 00381 extern BOOL LANG_Microsoft_Mode; 00382 extern BOOL LANG_Microsoft_Mode_Set; 00383 00384 extern BOOL LANG_Ansi_Setjmp_On; 00385 extern BOOL LANG_Ansi_Setjmp_Set; 00386 00387 extern BOOL LANG_Ignore_Carriage_Return_On; 00388 extern BOOL LANG_Ignore_Carriage_Return_Set; 00389 00390 #ifdef KEY /* Bug 3405 */ 00391 extern BOOL LANG_IEEE_Minus_Zero_On; 00392 extern BOOL LANG_IEEE_Minus_Zero_Set; 00393 #endif /* KEY Bug 3405 */ 00394 00395 extern BOOL C_Restrict_On; 00396 extern BOOL C_Restrict_Set; 00397 00398 extern char *C_Auto_Restrict; 00399 extern BOOL C_Auto_Restrict_Set; 00400 00401 extern BOOL FTN_Short_Circuit_On; 00402 extern BOOL FTN_Short_Circuit_Set; 00403 00404 extern BOOL WHIRL_Comma_Rcomma_On; 00405 extern BOOL WHIRL_Comma_Rcomma_Set; 00406 00407 extern BOOL Macro_Expand_Pragmas_On; 00408 extern BOOL Macro_Expand_Pragmas_Set; 00409 00410 extern BOOL C_VLA_On; 00411 extern BOOL C_VLA_Set; 00412 00413 extern BOOL WHIRL_Merge_Types_On; 00414 extern BOOL WHIRL_Merge_Types_Set; 00415 00416 extern BOOL LANG_Symtab_Verify_On; 00417 extern BOOL LANG_Symtab_Verify_Set; 00418 #ifdef KEY 00419 extern BOOL LANG_Formal_Deref_Unsafe; 00420 extern BOOL LANG_Math_Errno; 00421 extern BOOL LANG_Enable_CXX_Openmp; 00422 extern BOOL LANG_Enable_Global_Asm; 00423 #endif 00424 00425 extern BOOL WHIRL_Mtype_A_On; 00426 extern BOOL WHIRL_Mtype_B_On; 00427 extern BOOL WHIRL_Mtype_BS_On; 00428 extern BOOL WHIRL_Return_Val_On; 00429 extern BOOL WHIRL_Flatten_Field_On; 00430 extern BOOL WHIRL_Mldid_Mstid_On; 00431 extern BOOL WHIRL_Vfcall_On; 00432 extern BOOL WHIRL_Addr_Passed_On; 00433 extern BOOL WHIRL_Addr_Saved_For_Passed_On; 00434 extern BOOL WHIRL_Addr_Saved_On; 00435 extern BOOL WHIRL_Keep_Cvt_On; 00436 extern BOOL WHIRL_Return_Info_On; 00437 00438 extern BOOL Global_Pragmas_In_Dummy_PU_On; 00439 extern BOOL Malloc_Free_On; 00440 extern BOOL Alloca_Dealloca_On; 00441 extern BOOL Barrier_Lvalues_On; 00442 00443 #ifdef TARG_IA64 00444 extern BOOL Use_Call_Shared_Link; /*For redundant save/restore gp opt */ 00445 extern BOOL Gp_Save_Restore_Opt; 00446 extern BOOL Gp_Rel_Aggresive_Opt; 00447 #endif 00448 00449 /***** The following is TRUE for C++ unless -no_exceptions is specified *****/ 00450 extern BOOL Allow_Exceptions; 00451 00452 /***** Compiler debug/trace options *****/ 00453 extern BOOL Tracing_Enabled; /* Any trace options set? */ 00454 00455 /* Control usage of the .I and .J files: */ 00456 extern BOOL Open_IJ_Files; 00457 00458 /* For communication between driver and config routines ONLY: */ 00459 extern INT8 Debug_Level; 00460 # define MAX_DEBUG_LEVEL 3 00461 00462 typedef enum { 00463 EAGER_NONE, 00464 EAGER_SAFE, 00465 EAGER_ARITH, 00466 EAGER_DIVIDE, 00467 EAGER_MEMORY, 00468 EAGER_OTHER, 00469 EAGER_EXCESS 00470 } EAGER_LEVEL; 00471 extern EAGER_LEVEL Eager_Level; 00472 00473 /***** Miscellaneous optimization options *****/ 00474 /* Should idict commute operands in seeking match? */ 00475 extern BOOL Idict_Commutable_Match; 00476 extern BOOL Enable_FE_Optimization; /* Enable FE (KAP) scalar opt? */ 00477 extern BOOL Alias_Pointer_Parms; /* Reference parms indep? */ 00478 extern BOOL Alias_Pointer_Types; /* Ptrs to distinct basic types indep? */ 00479 extern BOOL Alias_Not_In_Union; /* C++ ONLY rule: assume ptrs to objects with user-constructors are NOT in unions */ 00480 extern BOOL Alias_Pointer_Strongly_Typed; /* Ptrs to distinct types indep? */ 00481 extern BOOL Alias_Pointer_Named_Data; /* No pointers to named data? */ 00482 extern BOOL Alias_Pointer_Restricted; /* *p and *q not aliased */ 00483 extern BOOL Alias_Pointer_Disjoint; /* **p and **q not aliased */ 00484 extern BOOL Alias_Pointer_Cray; /* Cray pointer semantics? */ 00485 extern BOOL Alias_Common_Scalar; /* Distinguish scalar from other array 00486 in a common block */ 00487 00488 extern BOOL CSE_Elim_Enabled; /* Is CSE-elim on? -- this does 00489 * not control it, it just 00490 * shadows the opt. level 00491 */ 00492 extern BOOL Enable_GOT_Call_Conversion; /* %call16 -> %got_disp? */ 00493 extern BOOL OPT_Unroll_Analysis; /* Enable unroll limitations? */ 00494 extern BOOL OPT_Unroll_Analysis_Set; /* ... option seen? */ 00495 00496 extern BOOL Disable_Simplification_For_FE; /* Disable Simplification for Front End*/ 00497 00498 /***** Various Scalar Optimizer options *****/ 00499 extern BOOL Enable_Copy_Propagate; 00500 00501 /***** Put all-zero initialized file-level data in the BSS section? *****/ 00502 extern BOOL Zeroinit_in_bss; 00503 00504 00505 /***** Thread-Local_Storage options *****/ 00506 extern char* TLS_Model_Name; 00507 00508 /***** IEEE 754 options *****/ 00509 typedef enum { 00510 IEEE_STRICT = 0, /* Conform strictly */ 00511 /* IEEE_STRICT is not supported. It might be useful to 00512 * avoid madds, do gradual underflow, etc... 00513 */ 00514 IEEE_ACCURATE = 1, /* Do not degrade IEEE accuracy */ 00515 IEEE_INEXACT = 2, /* Inexact results may not be IEEE */ 00516 IEEE_ANY = 3 /* Anything goes */ 00517 } IEEE_LEVEL; 00518 extern IEEE_LEVEL IEEE_Arithmetic; /* IEEE arithmetic? */ 00519 extern BOOL IEEE_Arith_Set; /* ... option seen? */ 00520 00521 /***** Constant folding options *****/ 00522 typedef enum { 00523 ROUNDOFF_NONE, /* No roundoff-inducing transformations */ 00524 ROUNDOFF_SIMPLE, /* Simple roundoff transformations */ 00525 ROUNDOFF_ASSOC, /* Reassociation transformations */ 00526 ROUNDOFF_ANY /* Anything goes */ 00527 } ROUNDOFF; 00528 extern ROUNDOFF Roundoff_Level; /* -OPT_roundoff=n value */ 00529 extern BOOL Roundoff_Set; /* ... option seen? */ 00530 extern BOOL Enable_WN_Simp; /* Use the WHIRL simplifier? */ 00531 extern BOOL Regions_Around_Inner_Loops; /* Put REGIONs around inner loops */ 00532 extern BOOL Region_Boundary_Info; /* calc boundary info for regions */ 00533 extern BOOL Cray_Ivdep; /* Use Cray meaning for ivdep */ 00534 extern BOOL Liberal_Ivdep; /* Use liberal meaning for ivdep */ 00535 #ifdef TARG_X8664 00536 extern UINT32 Rsqrt_Allowed; /* Generate RSQRT instruction? */ 00537 #else 00538 extern BOOL Rsqrt_Allowed; /* Generate RSQRT instruction? */ 00539 #endif 00540 extern BOOL Recip_Allowed; /* Generate RECIP instruction? */ 00541 extern BOOL Enable_Cfold_Aggressive; /* Complex constant folding? */ 00542 extern BOOL Ptr_Opt_Allowed; /* Treat pointers as arrays */ 00543 extern BOOL Fast_Complex_Allowed; /* Enable fast c_div and c_abs? */ 00544 extern BOOL Fast_Complex_Set; /* ... option seen? */ 00545 extern BOOL Fast_Bit_Allowed; /* Fast inlined bit intrinsics? */ 00546 extern BOOL Fast_Bit_Set; /* ... option seen? */ 00547 extern BOOL Fast_NINT_Allowed; /* Fast NINT and ANINT? */ 00548 extern BOOL Fast_NINT_Set; /* ... option seen? */ 00549 #ifdef TARG_X8664 00550 extern BOOL Fast_ANINT_Allowed; /* Fast ANINT? */ 00551 extern BOOL Fast_ANINT_Set; /* ... option seen? */ 00552 #endif 00553 extern BOOL Fast_trunc_Allowed; /* Fast trunc of NINT/ANINT/AINT/AMOD */ 00554 extern BOOL Fast_trunc_Set; /* ... option seen? */ 00555 extern BOOL Fast_IO_Allowed; /* Fast printf/scanf/printw */ 00556 extern BOOL Inline_Intrinsics_Allowed; /* Inline intrinsics? Or lib calls? */ 00557 extern BOOL Inline_Intrinsics_Set; /* ... option seen? */ 00558 extern BOOL Simp_Multiply_To_Shift; /* Change multiplies to shifts? */ 00559 extern BOOL Simp_Canonicalize; /* Simple canon/reassoc */ 00560 extern BOOL Simp_Fold_Unsigned_Relops; /* Simplify unsigned relops */ 00561 extern BOOL Simp_Unsafe_Relops; /* Allow foldings which might cause error if overflow occurs */ 00562 extern BOOL Enable_NaryExpr; /* Allow nary expr in the lowerer */ 00563 extern BOOL Enable_NaryExpr_Set; /* ... option seen? */ 00564 00565 #if defined(__linux__) || defined(BUILD_OS_DARWIN) 00566 extern BOOL Enable_WFE_DFE; /* frontend dead function elimination? */ 00567 #endif /* __linux __ */ 00568 00569 /***** Global Code Motion (GCM) options *****/ 00570 extern BOOL GCM_Eager_Null_Ptr_Deref; /* allow speculation past the NULL 00571 ptr test. assumes page zero as 00572 readable */ 00573 extern BOOL GCM_Eager_Null_Ptr_Deref_Set; /* ... option seen? */ 00574 00575 /***** Miscellaneous GOPT options *****/ 00576 #define MAX_OPT_LEVEL 3 00577 #define DEF_O_LEVEL 2 /* Level implied by -O */ 00578 #define DEF_OPT_LEVEL 1 00579 extern INT32 Opt_Level; /* -On level */ 00580 extern INT32 OPT_unroll_times; 00581 extern BOOL OPT_unroll_times_overridden; 00582 extern INT32 OPT_unroll_size; 00583 extern BOOL OPT_unroll_size_overridden; 00584 extern BOOL OPT_Lower_Speculate; 00585 extern BOOL OPT_Lower_Treeheight; 00586 extern BOOL OPT_Inline_Divide; 00587 extern BOOL OPT_Space; 00588 extern INT32 Olimit; /* stop optimization or use regions at this limit */ 00589 extern BOOL Olimit_opt; /* FALSE => stop optimization if Olimit reached; 00590 * TRUE => use regions to optimize if Olimit reached */ 00591 extern BOOL CG_mem_intrinsics; 00592 extern INT32 CG_memmove_inst_count; 00593 extern BOOL CG_memmove_inst_count_overridden; 00594 extern BOOL CG_bcopy_cannot_overlap; 00595 extern BOOL CG_memcpy_cannot_overlap; 00596 extern BOOL CG_memmove_cannot_overlap; 00597 extern BOOL CG_memmove_nonconst; 00598 extern BOOL Allow_wrap_around_opt; 00599 #define DEF_FOLD_ARITH_MAX_INS_CNT 1000 00600 extern INT32 Fold_Arith_Max_INS_CNT; 00601 #define DEF_CONST_COPY_TN_CNT 10000 00602 extern INT32 Const_Copy_TN_CNT; 00603 #define DEF_GOPT_TN_CNT 15000 00604 extern INT32 Gopt_TN_CNT; 00605 extern BOOL Enable_BB_Splitting; /* Split long basic blocks? */ 00606 extern INT32 Split_BB_Length; /* split BBs that are > than this */ 00607 #if defined(TARG_IA32) || defined(TARG_X8664) 00608 #define DEF_BBLENGTH 1300 /* default value for Split_BB_Length */ 00609 #define MIN_BBLENGTH 5 /* allow smaller due to fewer regs and CISC */ 00610 #else 00611 #define DEF_BBLENGTH 300 /* default value for Split_BB_Length */ 00612 #define MIN_BBLENGTH 100 /* don't let the value get too small */ 00613 #endif 00614 #define MAX_BBLENGTH 5000 /* don't let the value get too big */ 00615 00616 /***** What is the byte sex of the host and target? *****/ 00617 extern UINT8 Host_Byte_Sex; /* Set in config_host.c */ 00618 extern UINT8 Target_Byte_Sex; /* Set in config_targ.c */ 00619 extern BOOL Same_Byte_Sex; /* Set in config_targ.c */ 00620 00621 extern INT32 iolist_reuse_limit; 00622 00623 /***** Misaligned memory reference control *****/ 00624 extern INT32 Aggregate_Alignment; /* This alignment for aggregate layout */ 00625 extern BOOL Aggregate_Alignment_Set; 00626 extern INT32 Aggregate_UnrollFactor; /* When lowering aggregate copy into */ 00627 00628 extern BOOL Align_Object; /* Try to improve the alignment of objects */ 00629 extern BOOL Align_Padding; /* Pad objects to their natural alignment */ 00630 extern BOOL UseAlignedCopyForStructs; /* always use aligned copy */ 00631 extern BOOL UnweaveCopyForStructs; /* clump loads before stores */ 00632 00633 /***** Miscellaneous code generation options *****/ 00634 extern BOOL Gen_PIC_Call_Shared; /* CPIC */ 00635 extern BOOL Gen_PIC_Shared; /* PIC */ 00636 extern BOOL Gen_PIC_Calls; /* do calls as PIC code */ 00637 extern BOOL Guaranteed_Small_GOT; /* GOT < 64kB? */ 00638 extern BOOL Non_Volatile_GOT; /* GOT entries volatile? */ 00639 extern BOOL PIC_Local_Names; /* Names local by default? */ 00640 extern BOOL PIC_Protected_Names; /* Names protected by default? */ 00641 extern BOOL PIC_Fixed_Addresses; /* Names fixed by default? */ 00642 extern BOOL PIC_No_Page_Offset; /* Don't use page/offset addressing? */ 00643 extern BOOL Force_Mem_Formals; /* Always force formals to memory? */ 00644 extern BOOL Kernel_Code; /* Compiling OS kernel? */ 00645 extern INT32 Short_Data; /* Objects of this size in .sdata */ 00646 extern INT32 Short_Lits; /* Literals of this size in .litX */ 00647 extern INT32 Max_Sdata_Elt_Size;/* -Gn: sdata size */ 00648 extern INT32 Gspace_Available; /* -Gspace: available space for gprel objects */ 00649 extern BOOL Force_GP_Prolog; /* force usage of gp prolog */ 00650 extern INT32 Heap_Allocation_Threshold; /* Allocate objects > this on the heap 00651 * (-1 means always use stack), 00652 * 0 always use heap 00653 * default is 0 00654 */ 00655 extern BOOL Strings_Not_Gprelative; /* don't make strings gp-relative */ 00656 #define MAX_SDATA_ELT_SIZE 32760 00657 #define DEF_SDATA_ELT_SIZE 8 00658 extern BOOL Varargs_Prototypes; /* Varargs have prototypes for FP? */ 00659 extern BOOL Gen_Profile; 00660 extern const char *Gen_Profile_Name; 00661 extern BOOL Call_Mcount; /* generate a call to mcount in pu entry */ 00662 extern BOOL GP_Is_Preserved; /* GP is neither caller or callee-save */ 00663 extern BOOL Constant_GP; /* GP never changes */ 00664 00665 extern char *Emit_Global_Data; /* only emit global data */ 00666 extern char *Read_Global_Data; /* only read global data */ 00667 00668 extern char *Library_Name; /* -TENV:io_library=xxx */ 00669 00670 /* -foptimize-regions implies this internal variable, 00671 * which is used in cgdwarf_targ.cxx to close emit .restore directive 00672 */ 00673 extern BOOL Omit_UE_DESTROY_FRAME; /* tmp close Epilogue overflow error */ 00674 00675 extern INT target_io_library; 00676 00677 #if defined (TARG_SL) 00678 extern BOOL Sl2_Inibuf; 00679 extern char* Sl2_Ibuf_Name; 00680 #endif 00681 00682 #ifdef TARG_X8664 00683 extern char* Mcmodel_Name; /* -TENV:mcmodel=xxx */ 00684 typedef enum { 00685 SMALL = 0, /* The program and its symbols must be linked in the lower 00686 2 GB of the address space. This is the default code model. 00687 */ 00688 KERNEL, /* The kernel runs in the negative 2 GB of the address space. 00689 This model has to be used for Linux kernel code. 00690 */ 00691 MEDIUM, /* The program is linked in the lower 2 GB of the address space but 00692 symbols can be located anywhere in the address space. 00693 Programs can be statically or dynamically linked, but building of 00694 shared libraries are not supported with the medium model. 00695 */ 00696 LARGE /* This model makes no assumptions about addresses and sizes of sections. 00697 */ 00698 } MCMODEL; 00699 extern MCMODEL mcmodel; 00700 #endif // TARG_X8664 00701 00702 extern BOOL Meld_Schedule; /* Attempt to meld basic blocks */ 00703 extern BOOL Gap_Schedule; /* Attempt to perform gap scheduling */ 00704 extern BOOL Attempt_Bypass; /* Attempt to use bypass registers */ 00705 extern BOOL Enable_SWP; /* Do software pipelining */ 00706 extern BOOL Enable_SWP_overridden; /* override on command line */ 00707 extern BOOL Enable_LOH; /* Do loop overhead */ 00708 extern BOOL Enable_LOH_overridden; /* Enable_LOH overridden on cmd line */ 00709 extern BOOL Enable_Spec_Loads; /* Allow speculation of loads */ 00710 extern BOOL Isolate_Lines; /* Don't overlap source lines */ 00711 extern BOOL Fill_Delay_Slots; /* Attempt to fill branch delay slots */ 00712 extern BOOL Enable_GDSE; /* Do global dead store elimination */ 00713 extern BOOL Enable_CG_Peephole; /* Enable peephole optimization in cgprep */ 00714 extern BOOL Optimize_CVTL_Exp; /* Optimize expansion of CVTL operators */ 00715 extern BOOL Enable_EBO_Post_Proc_Rgn; /* Enable ebo after global scheduling */ 00716 extern BOOL Optimine_CVTL_Exp; /* Optimize expansion of CVTL operators */ 00717 extern BOOL Enable_CVT_Opt; /* Optimize expansion of CVT operators */ 00718 extern BOOL Indexed_Loads_Allowed; /* enable generation of indexed loads/stores */ 00719 extern BOOL Early_MP_Processing; /* Do MP lowering before LNO/PREOPT */ 00720 extern BOOL Implied_Do_Io_Opt; /* Do implied-do loop optimization for I/O */ 00721 00722 /* back end phases options */ 00723 #ifdef BACK_END 00724 extern BOOL Run_lno; /* run loop-nest optimizer */ 00725 extern BOOL Run_lego; /* run lego-lowering */ 00726 extern BOOL Run_lego_given; /* was run lego-lowering given/not */ 00727 extern BOOL Run_wopt; /* run WHIRL global optimizer */ 00728 extern BOOL Run_preopt; /* run WHIRL preopt optimizer */ 00729 extern BOOL Run_cg; /* run code generator */ 00730 extern BOOL Run_w2c; /* run whirl2c */ 00731 extern BOOL Run_w2f; /* run whirl2f */ 00732 extern BOOL Run_w2fc_early; /* run whirl2f after LNO parallelization */ 00733 extern BOOL Run_prompf; /* create prompf analysis file */ 00734 extern BOOL Run_purple; /* run purple instrumenter */ 00735 extern BOOL Run_ipl; /* run summary phase of IPA */ 00736 extern char *LNO_Path; /* path to lno.so */ 00737 extern char *WOPT_Path; /* path to wopt.so */ 00738 extern char *CG_Path; /* path to cg.so */ 00739 extern char *W2C_Path; /* path to whirl2c.so */ 00740 extern char *W2F_Path; /* path to whirl2f.so */ 00741 extern char *Prompf_Anl_Path; /* path to prompf_anl.so */ 00742 extern char *Purple_Path; /* path to purple.so */ 00743 extern char *Ipl_Path; /* path to ipl.so */ 00744 #if defined(TARG_SL) 00745 extern BOOL Run_ipisr; /* run ipisr register allocation */ 00746 #endif 00747 #endif /* BACK_END */ 00748 extern char *Inline_Path; /* path to inline.so */ 00749 #if defined(BACK_END) || defined(QIKKI_BE) 00750 extern char *Targ_Path; /* path to targinfo .so */ 00751 #endif /* defined(BACK_END) || defined(QIKKI_BE) */ 00752 00753 extern char *Schedlist_Option; 00754 00755 /* Force EH Region offsets to be long */ 00756 extern BOOL Force_Long_EH_Range_Offsets; 00757 /* Force stack frame to use large model */ 00758 extern BOOL Force_Large_Stack_Model; 00759 #ifdef TARG_X8664 00760 /* Force stack frame to use frame pointer */ 00761 extern BOOL Force_Frame_Pointer; 00762 extern BOOL Force_Frame_Pointer_Set; 00763 00764 /* Cause lowerer to change MTYPE_C8 datatype to MTYPE_V16C8 for SSE3. */ 00765 extern BOOL Vcast_Complex; 00766 extern BOOL Vcast_Complex_Set; 00767 00768 /* Use g77 ABI (affects complex and real function return values) */ 00769 extern BOOL F2c_Abi; 00770 extern BOOL F2c_Abi_Set; 00771 /* Align double and long double stack variables on a double word boundary. */ 00772 extern BOOL Align_Double; 00773 extern BOOL Align_Double_Set; 00774 00775 extern BOOL SIMD_IMask; 00776 extern BOOL SIMD_DMask; 00777 extern BOOL SIMD_ZMask; 00778 extern BOOL SIMD_OMask; 00779 extern BOOL SIMD_UMask; 00780 extern BOOL SIMD_PMask; 00781 00782 extern BOOL Use_Sse_Reg_Parm; 00783 extern INT32 Use_Reg_Parm; 00784 #endif 00785 /* put each function in its own text section */ 00786 extern BOOL Section_For_Each_Function; 00787 00788 /* list of registers that are not allocatable */ 00789 extern OPTION_LIST *Registers_Not_Allocatable; 00790 00791 /* Unique ident from IPA */ 00792 extern INT32 Ipa_Ident_Number; 00793 00794 #ifdef KEY 00795 /* Tell ipa_link about the LD_LIBRARY_PATH that was in effect before the 00796 compiler was run. */ 00797 extern char *IPA_old_ld_library_path; 00798 00799 /* Tell ipa_link which compiler to invoke. */ 00800 extern char *IPA_cc_name; 00801 00802 /* Tell ipa_link about the source language. */ 00803 extern char *IPA_lang; 00804 #endif 00805 00806 extern char *IPA_Object_Name; /* for -shared -ipa compile */ 00807 extern BOOL Scalar_Formal_Ref; /* for fortran formal scalar refs */ 00808 extern BOOL Non_Scalar_Formal_Ref; /* for fortran formal non_scalar refs */ 00809 00810 /***** Maximum sizes of recursive structures we will handle *****/ 00811 #define MAXDONEST 300 00812 #define MAXIFNEST 300 00813 00814 /* The following define specifies the maximum evaluation depth from 00815 * leaf to root in an expression containing boolean operators (AND, 00816 * OR, NOT). The amount of space specified will be allocated to hold 00817 * the inherited attributes of boolean expressions and flow of control 00818 * statements. 00819 */ 00820 #define MAXBOOLDEPTH (100 + MAXIFNEST) 00821 00822 /* ==================================================================== 00823 * 00824 * Skip option interface 00825 * 00826 * For debugging purposes, we support the suppression (skipping) of 00827 * optimization for specific PUs in a compilation (e.g. in WOPT and in 00828 * IPA). This is controlled by specifying a range (before/after) or 00829 * item (ident) of numbers to skip, which produces a group option list 00830 * from the group processing in flags.c. The support here provides for 00831 * (1) converting the group option list to a form easier to query, and 00832 * (2) querying the resulting skip list. 00833 * 00834 * ==================================================================== 00835 */ 00836 00837 typedef struct skiplist SKIPLIST; 00838 struct option_list; 00839 00840 /* Convert an option list to a SKIPLIST: */ 00841 SKIPLIST *Build_Skiplist ( struct option_list *olist ); 00842 00843 /* Query a SKIPLIST -- result TRUE means element is in list: */ 00844 BOOL Query_Skiplist ( SKIPLIST *slist, INT32 elmt ); 00845 00846 /* SKIPLIST for All Optimizations */ 00847 extern SKIPLIST *Optimization_Skip_List; /* Processed list */ 00848 extern SKIPLIST *Region_Skip_List; /* regions to skip, processed */ 00849 #ifdef KEY 00850 extern SKIPLIST *Goto_Skip_List; /* Processed list */ 00851 extern SKIPLIST *DDB_Skip_List; /* Processed list */ 00852 #endif 00853 00854 /* ==================================================================== 00855 * 00856 * Initialization interface 00857 * 00858 * ==================================================================== 00859 */ 00860 00861 /***** Perform configuration functions prior to flag processing *****/ 00862 extern void Preconfigure (void); 00863 00864 /***** Perform configuration specifically in FE if Olegacy is set *****/ 00865 extern void Configure_Olegacy (BOOL in_FE); 00866 00867 /***** Perform configuration functions after flag processing *****/ 00868 extern void Configure (void); 00869 00870 /***** Perform configuration functions for each source file *****/ 00871 extern void Configure_Source ( char *filename ); 00872 00873 /***** Perform configuration functions for the alias analysis options *****/ 00874 extern void Configure_Alias_Options (struct option_list *); 00875 00876 extern void Configure_Feedback_Options (struct option_list *); 00877 00878 00879 /***** Process a trace option string *****/ 00880 extern BOOL Process_Trace_Option ( char *option ); 00881 00882 /***** List options to the given file *****/ 00883 extern void List_Compile_Options ( 00884 FILE *file, /* File to which to write */ 00885 const char *pfx, /* Prefix output with this string */ 00886 BOOL internal, /* Internal or user listing? */ 00887 BOOL full_list, /* Groups (user)? All options (internal)? */ 00888 BOOL update ); /* Reset option changed/modified flags? */ 00889 00890 00891 #ifndef Is_Target_R4K 00892 #define Is_Target_R4K() (0) 00893 #endif 00894 #ifndef Is_Target_R5K 00895 #define Is_Target_R5K() (0) 00896 #endif 00897 #ifndef Is_Target_R8K 00898 #define Is_Target_R8K() (0) 00899 #endif 00900 #ifndef Is_Target_R10K 00901 #define Is_Target_R10K() (0) 00902 #endif 00903 #ifndef Is_Target_TP 00904 #define Is_Target_TP() Is_Target_R8K() 00905 #endif 00906 #ifndef Is_Target_T5 00907 #define Is_Target_T5() Is_Target_R10K() 00908 #endif 00909 #ifndef Is_Target_Pentium 00910 #define Is_Target_Pentium() (0) 00911 #endif 00912 #ifndef Is_Target_Itanium 00913 #define Is_Target_Itanium() (0) 00914 #endif 00915 00916 #ifndef Is_Target_ISA_M1 00917 #define Is_Target_ISA_M1() (0) 00918 #endif 00919 #ifndef Is_Target_ISA_M2 00920 #define Is_Target_ISA_M2() (0) 00921 #endif 00922 #ifndef Is_Target_ISA_M3 00923 #define Is_Target_ISA_M3() (0) 00924 #endif 00925 #ifndef Is_Target_ISA_M4 00926 #define Is_Target_ISA_M4() (0) 00927 #endif 00928 #ifndef Is_Target_ISA_M2Plus 00929 #define Is_Target_ISA_M2Plus() (0) 00930 #endif 00931 #ifndef Is_Target_ISA_M3Plus 00932 #define Is_Target_ISA_M3Plus() (0) 00933 #endif 00934 #ifndef Is_Target_ISA_M4Plus 00935 #define Is_Target_ISA_M4Plus() (0) 00936 #endif 00937 #ifndef Is_Target_ISA_I1 00938 #define Is_Target_ISA_I1() (0) 00939 #endif 00940 #ifndef Is_Target_ISA_I1Plus 00941 #define Is_Target_ISA_I1Plus() (0) 00942 #endif 00943 00944 #ifdef __cplusplus 00945 } 00946 #endif 00947 #endif /* config_INCLUDED */
1.5.6