]>
Commit | Line | Data |
---|---|---|
c63539ff ML |
1 | .. |
2 | Copyright 1988-2022 Free Software Foundation, Inc. | |
3 | This is part of the GCC manual. | |
4 | For copying conditions, see the copyright.rst file. | |
5 | ||
6 | .. index:: library subroutine names, libgcc.a | |
7 | ||
8 | .. _library-calls: | |
9 | ||
10 | Implicit Calls to Library Routines | |
11 | ********************************** | |
12 | ||
13 | .. prevent bad page break with this line | |
14 | ||
15 | Here is an explanation of implicit calls to library routines. | |
16 | ||
17 | .. c:macro:: DECLARE_LIBRARY_RENAMES | |
18 | ||
19 | This macro, if defined, should expand to a piece of C code that will get | |
20 | expanded when compiling functions for libgcc.a. It can be used to | |
21 | provide alternate names for GCC's internal library functions if there | |
22 | are ABI-mandated names that the compiler should provide. | |
23 | ||
24 | .. index:: set_optab_libfunc, init_one_libfunc | |
25 | ||
8f2b513c ML |
26 | .. include:: tm.rst.in |
27 | :start-after: [TARGET_INIT_LIBFUNCS] | |
28 | :end-before: [TARGET_INIT_LIBFUNCS] | |
c63539ff | 29 | |
c63539ff | 30 | |
8f2b513c ML |
31 | .. include:: tm.rst.in |
32 | :start-after: [TARGET_LIBFUNC_GNU_PREFIX] | |
33 | :end-before: [TARGET_LIBFUNC_GNU_PREFIX] | |
c63539ff | 34 | |
c63539ff ML |
35 | |
36 | .. c:macro:: FLOAT_LIB_COMPARE_RETURNS_BOOL (mode, comparison) | |
37 | ||
38 | This macro should return ``true`` if the library routine that | |
39 | implements the floating point comparison operator :samp:`{comparison}` in | |
40 | mode :samp:`{mode}` will return a boolean, and :samp:`{false}` if it will | |
41 | return a tristate. | |
42 | ||
43 | GCC's own floating point libraries return tristates from the | |
44 | comparison operators, so the default returns false always. Most ports | |
45 | don't need to define this macro. | |
46 | ||
47 | .. c:macro:: TARGET_LIB_INT_CMP_BIASED | |
48 | ||
49 | This macro should evaluate to ``true`` if the integer comparison | |
50 | functions (like ``__cmpdi2``) return 0 to indicate that the first | |
51 | operand is smaller than the second, 1 to indicate that they are equal, | |
52 | and 2 to indicate that the first operand is greater than the second. | |
53 | If this macro evaluates to ``false`` the comparison functions return | |
54 | -1, 0, and 1 instead of 0, 1, and 2. If the target uses the routines | |
55 | in :samp:`libgcc.a`, you do not need to define this macro. | |
56 | ||
57 | .. c:macro:: TARGET_HAS_NO_HW_DIVIDE | |
58 | ||
59 | This macro should be defined if the target has no hardware divide | |
60 | instructions. If this macro is defined, GCC will use an algorithm which | |
61 | make use of simple logical and arithmetic operations for 64-bit | |
62 | division. If the macro is not defined, GCC will use an algorithm which | |
63 | make use of a 64-bit by 32-bit divide primitive. | |
64 | ||
65 | .. index:: EDOM, implicit usage, matherr | |
66 | ||
67 | .. c:macro:: TARGET_EDOM | |
68 | ||
69 | The value of ``EDOM`` on the target machine, as a C integer constant | |
70 | expression. If you don't define this macro, GCC does not attempt to | |
71 | deposit the value of ``EDOM`` into ``errno`` directly. Look in | |
72 | :samp:`/usr/include/errno.h` to find the value of ``EDOM`` on your | |
73 | system. | |
74 | ||
75 | If you do not define ``TARGET_EDOM``, then compiled code reports | |
76 | domain errors by calling the library function and letting it report the | |
77 | error. If mathematical functions on your system use ``matherr`` when | |
78 | there is an error, then you should leave ``TARGET_EDOM`` undefined so | |
79 | that ``matherr`` is used normally. | |
80 | ||
81 | .. index:: errno, implicit usage | |
82 | ||
83 | .. c:macro:: GEN_ERRNO_RTX | |
84 | ||
85 | Define this macro as a C expression to create an rtl expression that | |
86 | refers to the global 'variable' ``errno``. (On certain systems, | |
87 | ``errno`` may not actually be a variable.) If you don't define this | |
88 | macro, a reasonable default is used. | |
89 | ||
8f2b513c ML |
90 | .. include:: tm.rst.in |
91 | :start-after: [TARGET_LIBC_HAS_FUNCTION] | |
92 | :end-before: [TARGET_LIBC_HAS_FUNCTION] | |
c63539ff | 93 | |
c63539ff | 94 | |
8f2b513c ML |
95 | .. include:: tm.rst.in |
96 | :start-after: [TARGET_LIBC_HAS_FAST_FUNCTION] | |
97 | :end-before: [TARGET_LIBC_HAS_FAST_FUNCTION] | |
c63539ff | 98 | |
c63539ff ML |
99 | |
100 | .. c:macro:: NEXT_OBJC_RUNTIME | |
101 | ||
102 | Set this macro to 1 to use the "NeXT" Objective-C message sending conventions | |
103 | by default. This calling convention involves passing the object, the selector | |
104 | and the method arguments all at once to the method-lookup library function. | |
105 | This is the usual setting when targeting Darwin/Mac OS X systems, which have | |
106 | the NeXT runtime installed. | |
107 | ||
108 | If the macro is set to 0, the "GNU" Objective-C message sending convention | |
109 | will be used by default. This convention passes just the object and the | |
110 | selector to the method-lookup function, which returns a pointer to the method. | |
111 | ||
112 | In either case, it remains possible to select code-generation for the alternate | |
3ed1b4ce | 113 | scheme, by means of compiler command line switches. |