OSDN Git Service

2007-01-31 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
[pf3gnuchains/gcc-fork.git] / gcc / doc / tm.texi
index c4dc052..77c83f4 100644 (file)
@@ -1,5 +1,5 @@
 @c Copyright (C) 1988,1989,1992,1993,1994,1995,1996,1997,1998,1999,2000,2001,
-@c 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
+@c 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc.
 @c This is part of the GCC manual.
 @c For copying conditions, see the file gcc.texi.
 
@@ -615,19 +615,26 @@ Here is the order of prefixes tried for exec files:
 Any prefixes specified by the user with @option{-B}.
 
 @item
-The environment variable @code{GCC_EXEC_PREFIX}, if any.
+The environment variable @code{GCC_EXEC_PREFIX} or, if @code{GCC_EXEC_PREFIX}
+is not set and the compiler has not been installed in the configure-time 
+@var{prefix}, the location in which the compiler has actually been installed.
 
 @item
 The directories specified by the environment variable @code{COMPILER_PATH}.
 
 @item
-The macro @code{STANDARD_EXEC_PREFIX}.
+The macro @code{STANDARD_EXEC_PREFIX}, if the compiler has been installed
+in the configured-time @var{prefix}. 
 
 @item
-@file{/usr/lib/gcc/}.
+The location @file{/usr/libexec/gcc/}, but only if this is a native compiler. 
 
 @item
-The macro @code{MD_EXEC_PREFIX}, if any.
+The location @file{/usr/lib/gcc/}, but only if this is a native compiler. 
+
+@item
+The macro @code{MD_EXEC_PREFIX}, if defined, but only if this is a native 
+compiler.
 @end enumerate
 
 Here is the order of prefixes tried for startfiles:
@@ -637,31 +644,45 @@ Here is the order of prefixes tried for startfiles:
 Any prefixes specified by the user with @option{-B}.
 
 @item
-The environment variable @code{GCC_EXEC_PREFIX}, if any.
+The environment variable @code{GCC_EXEC_PREFIX} or its automatically determined
+value based on the installed toolchain location.
 
 @item
 The directories specified by the environment variable @code{LIBRARY_PATH}
 (or port-specific name; native only, cross compilers do not use this).
 
 @item
-The macro @code{STANDARD_EXEC_PREFIX}.
+The macro @code{STANDARD_EXEC_PREFIX}, but only if the toolchain is installed
+in the configured @var{prefix} or this is a native compiler. 
 
 @item
-@file{/usr/lib/gcc/}.
+The location @file{/usr/lib/gcc/}, but only if this is a native compiler.
+
+@item
+The macro @code{MD_EXEC_PREFIX}, if defined, but only if this is a native 
+compiler.
 
 @item
-The macro @code{MD_EXEC_PREFIX}, if any.
+The macro @code{MD_STARTFILE_PREFIX}, if defined, but only if this is a 
+native compiler, or we have a target system root.
 
 @item
-The macro @code{MD_STARTFILE_PREFIX}, if any.
+The macro @code{MD_STARTFILE_PREFIX_1}, if defined, but only if this is a 
+native compiler, or we have a target system root.
 
 @item
-The macro @code{STANDARD_STARTFILE_PREFIX}.
+The macro @code{STANDARD_STARTFILE_PREFIX}, with any sysroot modifications.
+If this path is relative it will be prefixed by @code{GCC_EXEC_PREFIX} and
+the machine suffix or @code{STANDARD_EXEC_PREFIX} and the machine suffix.
 
 @item
+The macro @code{STANDARD_STARTFILE_PREFIX_1}, but only if this is a native
+compiler, or we have a target system root. The default for this macro is
 @file{/lib/}.
 
 @item
+The macro @code{STANDARD_STARTFILE_PREFIX_2}, but only if this is a native
+compiler, or we have a target system root. The default for this macro is
 @file{/usr/lib/}.
 @end enumerate
 
@@ -1078,6 +1099,12 @@ Biggest alignment supported by the object file format of this machine.
 Use this macro to limit the alignment which can be specified using the
 @code{__attribute__ ((aligned (@var{n})))} construct.  If not defined,
 the default value is @code{BIGGEST_ALIGNMENT}.
+
+On systems that use ELF, the default (in @file{config/elfos.h}) is
+the largest supported 32-bit ELF section alignment representable on
+a 32-bit host e.g. @samp{(((unsigned HOST_WIDEST_INT) 1 << 28) * 8)}.
+On 32-bit ELF the largest supported section alignment in bits is
+@samp{(0x80000000 * 8)}, but this is not representable on 32-bit hosts.
 @end defmac
 
 @defmac DATA_ALIGNMENT (@var{type}, @var{basic-align})
@@ -1972,6 +1999,33 @@ definition of this macro is
 @end smallexample
 @end defmac
 
+@defmac HARD_REGNO_NREGS_HAS_PADDING (@var{regno}, @var{mode})
+A C expression that is nonzero if a value of mode @var{mode}, stored
+in memory, ends with padding that causes it to take up more space than
+in registers starting at register number @var{regno} (as determined by
+multiplying GCC's notion of the size of the register when containing
+this mode by the number of registers returned by
+@code{HARD_REGNO_NREGS}).  By default this is zero.
+
+For example, if a floating-point value is stored in three 32-bit
+registers but takes up 128 bits in memory, then this would be
+nonzero.
+
+This macros only needs to be defined if there are cases where
+@code{subreg_get_info}
+would otherwise wrongly determine that a @code{subreg} can be
+represented by an offset to the register number, when in fact such a
+@code{subreg} would contain some of the padding not stored in
+registers and so not be representable.
+@end defmac
+
+@defmac HARD_REGNO_NREGS_WITH_PADDING (@var{regno}, @var{mode})
+For values of @var{regno} and @var{mode} for which
+@code{HARD_REGNO_NREGS_HAS_PADDING} returns nonzero, a C expression
+returning the greater number of registers required to hold the value
+including any padding.  In the example above, the value would be four.
+@end defmac
+
 @defmac REGMODE_NATURAL_SIZE (@var{mode})
 Define this macro if the natural size of registers that hold values
 of mode @var{mode} is not the word size.  It is a C expression that
@@ -2332,8 +2386,9 @@ that expression may examine the mode of the memory reference in
 @var{mode}.  You should define this macro if the mode of the memory
 reference affects whether a register may be used as a base register.  If
 you define this macro, the compiler will use it instead of
-@code{REGNO_OK_FOR_BASE_P}.  The mode may be @code{VOIDmode} for addresses
-that appear outside a @code{MEM}, i.e. as an @code{address_operand}.
+@code{REGNO_OK_FOR_BASE_P}.  The mode may be @code{VOIDmode} for
+addresses that appear outside a @code{MEM}, i.e., as an
+@code{address_operand}.
 
 @end defmac
 
@@ -2350,14 +2405,15 @@ Use of this macro is deprecated; please use the more general
 @end defmac
 
 @defmac REGNO_MODE_CODE_OK_FOR_BASE_P (@var{num}, @var{mode}, @var{outer_code}, @var{index_code})
-A C expression that is just like @code{REGNO_MODE_OK_FOR_BASE_P}, except that
-that expression may examine the context in which the register appears in the
-memory reference.  @var{outer_code} is the code of the immediately enclosing
-expression (@code{MEM} if at the top level of the address, @code{ADDRESS} for
-something that occurs in an @code{address_operand}).  @var{index_code} is the
-code of the corresponding index expression if @var{outer_code} is @code{PLUS};
+A C expression that is just like @code{REGNO_MODE_OK_FOR_BASE_P}, except
+that that expression may examine the context in which the register
+appears in the memory reference.  @var{outer_code} is the code of the
+immediately enclosing expression (@code{MEM} if at the top level of the
+address, @code{ADDRESS} for something that occurs in an
+@code{address_operand}).  @var{index_code} is the code of the
+corresponding index expression if @var{outer_code} is @code{PLUS};
 @code{SCRATCH} otherwise.  The mode may be @code{VOIDmode} for addresses
-that appear outside a @code{MEM}, i.e. as an @code{address_operand}.
+that appear outside a @code{MEM}, i.e., as an @code{address_operand}.
 @end defmac
 
 @defmac REGNO_OK_FOR_INDEX_P (@var{num})
@@ -4053,7 +4109,12 @@ place regardless of mode.)  The value of the expression is usually a
 @code{reg} RTX for the hard register where the return value is stored.
 The value can also be a @code{parallel} RTX, if the return value is in
 multiple places.  See @code{FUNCTION_ARG} for an explanation of the
-@code{parallel} form.
+@code{parallel} form.   Note that the callee will populate every
+location specified in the @code{parallel}, but if the first element of
+the @code{parallel} contains the whole return value, callers will use
+that element as the canonical location and ignore the others.  The m68k
+port uses this type of @code{parallel} to return pointers in both
+@samp{%a0} (the canonical location) and @samp{%d0}.
 
 If @code{TARGET_PROMOTE_FUNCTION_RETURN} returns true, you must apply
 the same promotion rules specified in @code{PROMOTE_MODE} if
@@ -4535,10 +4596,11 @@ not support profiling.
 @end defmac
 
 @defmac NO_PROFILE_COUNTERS
-Define this macro if the @code{mcount} subroutine on your system does
-not need a counter variable allocated for each function.  This is true
-for almost all modern implementations.  If you define this macro, you
-must not use the @var{labelno} argument to @code{FUNCTION_PROFILER}.
+Define this macro to be an expression with a nonzero value if the
+@code{mcount} subroutine on your system does not need a counter variable
+allocated for each function.  This is true for almost all modern
+implementations.  If you define this macro, you must not use the
+@var{labelno} argument to @code{FUNCTION_PROFILER}.
 @end defmac
 
 @defmac PROFILE_BEFORE_PROLOGUE
@@ -5001,6 +5063,18 @@ number of existing systems lacks support for these functions in the runtime so
 they needs this macro to be redefined to 0.
 @end defmac
 
+@cindex sincos math function, implicit usage
+@defmac TARGET_HAS_SINCOS
+When this macro is nonzero, GCC will implicitly optimize calls to @code{sin}
+and @code{cos} with the same argument to a call to @code{sincos}.  The
+default is zero.  The target has to provide the following functions:
+@smallexample
+void sincos(double x, double *sin, double *cos);
+void sincosf(float x, float *sin, float *cos);
+void sincosl(long double x, long double *sin, long double *cos);
+@end smallexample
+@end defmac
+
 @defmac NEXT_OBJC_RUNTIME
 Define this macro to generate code for Objective-C message sending using
 the calling convention of the NeXT system.  This calling convention
@@ -5195,7 +5269,7 @@ the address has become legitimate.
 
 @findex copy_rtx
 If you want to change only a part of @var{x}, one standard way of doing
-this is to use @code{copy_rtx}.  Note, however, that is unshares only a
+this is to use @code{copy_rtx}.  Note, however, that it unshares only a
 single level of rtl.  Thus, if the part to be changed is not at the
 top level, you'll need to replace first the top level.
 It is not necessary for this macro to come up with a legitimate
@@ -5261,7 +5335,7 @@ address @var{addr} as an argument returns a mask @var{m} that can be
 used to extract from two vectors the relevant data that resides in
 @var{addr} in case @var{addr} is not properly aligned.
 
-The autovectrizer, when vectorizing a load operation from an address
+The autovectorizer, when vectorizing a load operation from an address
 @var{addr} that may be unaligned, will generate two vector loads from
 the two aligned addresses around @var{addr}. It then generates a
 @code{REALIGN_LOAD} operation to extract the relevant data from the
@@ -5284,6 +5358,35 @@ the argument @var{OFF} to @code{REALIGN_LOAD}, in which case the low
 log2(@var{VS})-1 bits of @var{addr} will be considered.
 @end deftypefn
 
+@deftypefn {Target Hook} tree TARGET_VECTORIZE_BUILTIN_MUL_WIDEN_EVEN (tree @var{x})
+This hook should return the DECL of a function @var{f} that implements
+widening multiplication of the even elements of two input vectors of type @var{x}.
+
+If this hook is defined, the autovectorizer will use it along with the
+@code{TARGET_VECTORIZE_BUILTIN_MUL_WIDEN_ODD} target hook when vectorizing
+widening multiplication in cases that the order of the results does not have to be
+preserved (e.g. used only by a reduction computation). Otherwise, the
+@code{widen_mult_hi/lo} idioms will be used.
+@end deftypefn
+
+@deftypefn {Target Hook} tree TARGET_VECTORIZE_BUILTIN_MUL_WIDEN_ODD (tree @var{x})
+This hook should return the DECL of a function @var{f} that implements
+widening multiplication of the odd elements of two input vectors of type @var{x}.
+
+If this hook is defined, the autovectorizer will use it along with the
+@code{TARGET_VECTORIZE_BUILTIN_MUL_WIDEN_EVEN} target hook when vectorizing
+widening multiplication in cases that the order of the results does not have to be
+preserved (e.g. used only by a reduction computation). Otherwise, the
+@code{widen_mult_hi/lo} idioms will be used.
+@end deftypefn
+
+@deftypefn {Target Hook} tree TARGET_VECTORIZE_BUILTIN_VECTORIZED_FUNCTION (enum built_in_function @var{code}, tree @var{vec_type})
+This hook should return the decl of a function that implements the vectorized
+variant of the builtin function with builtin function code @var{code} or
+@code{NULL_TREE} if such a function is not available.  The return type of
+the vectorized function shall be of vector type @var{vec_type}.
+@end deftypefn
+
 @node Anchored Addresses
 @section Anchored Addresses
 @cindex anchored addresses
@@ -6590,6 +6693,58 @@ need to override this if your target has special flags that might be
 set via @code{__attribute__}.
 @end deftypefn
 
+@deftypefn {Target Hook} {int} TARGET_ASM_RECORD_GCC_SWITCHES (print_switch_type @var{type}, const char * @var{text})
+Provides the target with the ability to record the gcc command line
+switches that have been passed to the compiler, and options that are
+enabled.  The @var{type} argument specifies what is being recorded.
+It can take the following values:
+
+@table @gcctabopt
+@item SWITCH_TYPE_PASSED
+@var{text} is a command line switch that has been set by the user.
+
+@item SWITCH_TYPE_ENABLED
+@var{text} is an option which has been enabled.  This might be as a
+direct result of a command line switch, or because it is enabled by
+default or because it has been enabled as a side effect of a different
+command line switch.  For example, the @option{-O2} switch enables
+various different individual optimization passes.
+
+@item SWITCH_TYPE_DESCRIPTIVE
+@var{text} is either NULL or some descriptive text which should be
+ignored.  If @var{text} is NULL then it is being used to warn the
+target hook that either recording is starting or ending.  The first
+time @var{type} is SWITCH_TYPE_DESCRIPTIVE and @var{text} is NULL, the
+warning is for start up and the second time the warning is for
+wind down.  This feature is to allow the target hook to make any
+necessary preparations before it starts to record switches and to
+perform any necessary tidying up after it has finished recording
+switches.
+
+@item SWITCH_TYPE_LINE_START
+This option can be ignored by this target hook.
+
+@item  SWITCH_TYPE_LINE_END
+This option can be ignored by this target hook.
+@end table
+
+The hook's return value must be zero.  Other return values may be
+supported in the future.
+
+By default this hook is set to NULL, but an example implementation is
+provided for ELF based targets.  Called @var{elf_record_gcc_switches},
+it records the switches as ASCII text inside a new, string mergeable
+section in the assembler output file.  The name of the new section is
+provided by the @code{TARGET_ASM_RECORD_GCC_SWITCHES_SECTION} target
+hook.
+@end deftypefn
+
+@deftypefn {Target Hook} {const char *} TARGET_ASM_RECORD_GCC_SWITCHES_SECTION
+This is the name of the section that will be created by the example
+ELF implementation of the @code{TARGET_ASM_RECORD_GCC_SWITCHES} target
+hook.
+@end deftypefn
+
 @need 2000
 @node Data Output
 @subsection Output of Data
@@ -7045,6 +7200,14 @@ The default implementation relies on a proper definition of
 @code{GLOBAL_ASM_OP}.
 @end deftypefn
 
+@deftypefn {Target Hook} void TARGET_ASM_GLOBALIZE_DECL_NAME (FILE *@var{stream}, tree @var{decl})
+This target hook is a function to output to the stdio stream
+@var{stream} some commands that will make the name associated with @var{decl}
+global; that is, available for reference from other files.
+
+The default implementation uses the TARGET_ASM_GLOBALIZE_LABEL target hook.
+@end deftypefn
+
 @defmac ASM_WEAKEN_LABEL (@var{stream}, @var{name})
 A C statement (sans semicolon) to output to the stdio stream
 @var{stream} some commands that will make the label @var{name} weak;
@@ -8080,7 +8243,7 @@ This works only if @code{ASM_OUTPUT_MAX_SKIP_ALIGN} is defined.
 A C statement to output to the stdio stream @var{stream} an assembler
 instruction to advance the location counter by @var{nbytes} bytes.
 Those bytes should be zero when loaded.  @var{nbytes} will be a C
-expression of type @code{int}.
+expression of type @code{unsigned HOST_WIDE_INT}.
 @end defmac
 
 @defmac ASM_NO_SKIP_IN_TEXT
@@ -8625,7 +8788,7 @@ Returns the absolute value of @var{x}.
 @deftypefn Macro REAL_VALUE_TYPE REAL_VALUE_TRUNCATE (REAL_VALUE_TYPE @var{mode}, enum machine_mode @var{x})
 Truncates the floating point value @var{x} to fit in @var{mode}.  The
 return value is still a full-size @code{REAL_VALUE_TYPE}, but it has an
-appropriate bit pattern to be output asa floating constant whose
+appropriate bit pattern to be output as a floating constant whose
 precision accords with mode @var{mode}.
 @end deftypefn
 
@@ -8965,6 +9128,12 @@ classes whose virtual table will be emitted in only one translation
 unit will not be COMDAT.
 @end deftypefn
 
+@deftypefn {Target Hook} bool TARGET_CXX_LIBRARY_RTTI_COMDAT (void)
+This hook returns true (the default) if the RTTI information for
+the basic types which is defined in the C++ runtime should always
+be COMDAT, false if it should not be COMDAT.
+@end deftypefn
+
 @deftypefn {Target Hook} bool TARGET_CXX_USE_AEABI_ATEXIT (void)
 This hook returns true if @code{__aeabi_atexit} (as defined by the ARM EABI)
 should be used to register static destructors when @option{-fuse-cxa-atexit}