Next: Addressing Modes, Previous: Trampolines, Up: Target Macros
Here is an explanation of implicit calls to library routines.
This macro, if defined, should expand to a piece of C code that will get expanded when compiling functions for libgcc.a. It can be used to provide alternate names for GCC's internal library functions if there are ABI-mandated names that the compiler should provide.
This hook should declare additional library routines or rename existing ones, using the functions
set_optab_libfunc
andinit_one_libfunc
defined in optabs.c.init_optabs
calls this macro after initializing all the normal library routines.The default is to do nothing. Most ports don't need to define this hook.
This macro should return
true
if the library routine that implements the floating point comparison operator comparison in mode mode will return a boolean, and false if it will return a tristate.GCC's own floating point libraries return tristates from the comparison operators, so the default returns false always. Most ports don't need to define this macro.
This macro should evaluate to
true
if the integer comparison functions (like__cmpdi2
) return 0 to indicate that the first operand is smaller than the second, 1 to indicate that they are equal, and 2 to indicate that the first operand is greater than the second. If this macro evaluates tofalse
the comparison functions return −1, 0, and 1 instead of 0, 1, and 2. If the target uses the routines in libgcc.a, you do not need to define this macro.
Define this macro if your system C library uses the US Software GOFAST library to provide floating point emulation.
In addition to defining this macro, your architecture must set
TARGET_INIT_LIBFUNCS
togofast_maybe_init_libfuncs
, or else call that function from its version of that hook. It is defined in config/gofast.h, which must be included by your architecture's cpu.c file. See sparc/sparc.c for an example.If this macro is defined, the
TARGET_FLOAT_LIB_COMPARE_RETURNS_BOOL
target hook must return false forSFmode
andDFmode
comparisons.
The value of
EDOM
on the target machine, as a C integer constant expression. If you don't define this macro, GCC does not attempt to deposit the value ofEDOM
intoerrno
directly. Look in /usr/include/errno.h to find the value ofEDOM
on your system.If you do not define
TARGET_EDOM
, then compiled code reports domain errors by calling the library function and letting it report the error. If mathematical functions on your system usematherr
when there is an error, then you should leaveTARGET_EDOM
undefined so thatmatherr
is used normally.
Define this macro as a C expression to create an rtl expression that refers to the global “variable”
errno
. (On certain systems,errno
may not actually be a variable.) If you don't define this macro, a reasonable default is used.
When this macro is nonzero, GCC will implicitly optimize
sin
calls intosinf
and similarly for other functions defined by C99 standard. The default is zero because a number of existing systems lack support for these functions in their runtime so this macro needs to be redefined to one on systems that do support the C99 runtime.
When this macro is nonzero, GCC will implicitly optimize calls to
sin
andcos
with the same argument to a call tosincos
. The default is zero. The target has to provide the following functions: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);
Define this macro to generate code for Objective-C message sending using the calling convention of the NeXT system. This calling convention involves passing the object, the selector and the method arguments all at once to the method-lookup library function.
The default calling convention passes just the object and the selector to the lookup function, which returns a pointer to the method.