]>
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 | Contributed by Aldy Hernandez <aldy@quesejoda.com> | |
7 | ||
8 | .. _libgcc: | |
9 | ||
10 | The GCC low-level runtime library | |
11 | --------------------------------- | |
12 | ||
13 | GCC provides a low-level runtime library, :samp:`libgcc.a` or | |
14 | :samp:`libgcc_s.so.1` on some platforms. GCC generates calls to | |
15 | routines in this library automatically, whenever it needs to perform | |
16 | some operation that is too complicated to emit inline code for. | |
17 | ||
18 | Most of the routines in ``libgcc`` handle arithmetic operations | |
19 | that the target processor cannot perform directly. This includes | |
20 | integer multiply and divide on some machines, and all floating-point | |
21 | and fixed-point operations on other machines. ``libgcc`` also includes | |
22 | routines for exception handling, and a handful of miscellaneous operations. | |
23 | ||
24 | Some of these routines can be defined in mostly machine-independent C. | |
25 | Others must be hand-written in assembly language for each processor | |
26 | that needs them. | |
27 | ||
28 | GCC will also generate calls to C library routines, such as | |
29 | ``memcpy`` and ``memset``, in some cases. The set of routines | |
30 | that GCC may possibly use is documented in :ref:`gcc:other-builtins`. | |
31 | ||
32 | These routines take arguments and return values of a specific machine | |
33 | mode, not a specific C type. See :ref:`machine-modes`, for an explanation | |
34 | of this concept. For illustrative purposes, in this chapter the | |
35 | floating point type ``float`` is assumed to correspond to ``SFmode`` ; | |
36 | ``double`` to ``DFmode`` ; and ``long double`` to both | |
37 | ``TFmode`` and ``XFmode``. Similarly, the integer types ``int`` | |
38 | and ``unsigned int`` correspond to ``SImode`` ; ``long`` and | |
39 | ``unsigned long`` to ``DImode`` ; and ``long long`` and | |
40 | ``unsigned long long`` to ``TImode``. | |
41 | ||
42 | .. toctree:: | |
43 | :maxdepth: 2 | |
44 | ||
45 | the-gcc-low-level-runtime-library/routines-for-integer-arithmetic | |
46 | the-gcc-low-level-runtime-library/routines-for-floating-point-emulation | |
47 | the-gcc-low-level-runtime-library/routines-for-decimal-floating-point-emulation | |
48 | the-gcc-low-level-runtime-library/routines-for-fixed-point-fractional-emulation | |
49 | the-gcc-low-level-runtime-library/language-independent-routines-for-exception-handling | |
3ed1b4ce | 50 | the-gcc-low-level-runtime-library/miscellaneous-runtime-library-routines |