xref: /netbsd-src/external/gpl3/gcc/dist/libgcc/config/arm/bpabi-lib.h (revision b7b7574d3bf8eeb51a1fa3977b59142ec6434a55)
1 /* Configuration file for ARM BPABI targets, library renames.
2    Copyright (C) 2010-2013 Free Software Foundation, Inc.
3    Contributed by CodeSourcery, LLC
4 
5    This file is part of GCC.
6 
7    GCC is free software; you can redistribute it and/or modify it
8    under the terms of the GNU General Public License as published
9    by the Free Software Foundation; either version 3, or (at your
10    option) any later version.
11 
12    GCC is distributed in the hope that it will be useful, but WITHOUT
13    ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
14    or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public
15    License for more details.
16 
17    You should have received a copy of the GNU General Public License and
18    a copy of the GCC Runtime Library Exception along with this program;
19    see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
20    <http://www.gnu.org/licenses/>.  */
21 
22 /* Make __aeabi_AEABI_NAME an alias for __GCC_NAME.  */
23 #define RENAME_LIBRARY(GCC_NAME, AEABI_NAME)		\
24   typeof (__##GCC_NAME) __aeabi_##AEABI_NAME \
25     __attribute__((alias ("__" #GCC_NAME)));
26 
27 /* Give some libgcc functions an additional __aeabi name.  */
28 #ifdef L_muldi3
29 #define DECLARE_LIBRARY_RENAMES RENAME_LIBRARY (muldi3, lmul)
30 #endif
31 #ifdef L_muldi3
32 #define DECLARE_LIBRARY_RENAMES RENAME_LIBRARY (muldi3, lmul)
33 #endif
34 #ifdef L_fixdfdi
35 #define DECLARE_LIBRARY_RENAMES RENAME_LIBRARY (fixdfdi, d2lz) \
36   extern DWtype __fixdfdi (DFtype) __attribute__((pcs("aapcs"))); \
37   extern UDWtype __fixunsdfdi (DFtype) __asm__("__aeabi_d2ulz") __attribute__((pcs("aapcs")));
38 #endif
39 #ifdef L_fixunsdfdi
40 #define DECLARE_LIBRARY_RENAMES RENAME_LIBRARY (fixunsdfdi, d2ulz) \
41   extern UDWtype __fixunsdfdi (DFtype) __attribute__((pcs("aapcs")));
42 #endif
43 #ifdef L_fixsfdi
44 #define DECLARE_LIBRARY_RENAMES RENAME_LIBRARY (fixsfdi, f2lz) \
45   extern DWtype __fixsfdi (SFtype) __attribute__((pcs("aapcs"))); \
46   extern UDWtype __fixunssfdi (SFtype) __asm__("__aeabi_f2ulz") __attribute__((pcs("aapcs")));
47 #endif
48 #ifdef L_fixunssfdi
49 #define DECLARE_LIBRARY_RENAMES RENAME_LIBRARY (fixunssfdi, f2ulz) \
50   extern UDWtype __fixunssfdi (SFtype) __attribute__((pcs("aapcs")));
51 #endif
52 #ifdef L_floatdidf
53 #define DECLARE_LIBRARY_RENAMES RENAME_LIBRARY (floatdidf, l2d)
54 #endif
55 #ifdef L_floatdisf
56 #define DECLARE_LIBRARY_RENAMES RENAME_LIBRARY (floatdisf, l2f)
57 #endif
58 
59 /* These renames are needed on ARMv6M.  Other targets get them from
60    assembly routines.  */
61 #ifdef L_fixunsdfsi
62 #define DECLARE_LIBRARY_RENAMES RENAME_LIBRARY (fixunsdfsi, d2uiz)
63 #endif
64 #ifdef L_fixunssfsi
65 #define DECLARE_LIBRARY_RENAMES RENAME_LIBRARY (fixunssfsi, f2uiz)
66 #endif
67 #ifdef L_floatundidf
68 #define DECLARE_LIBRARY_RENAMES RENAME_LIBRARY (floatundidf, ul2d)
69 #endif
70 #ifdef L_floatundisf
71 #define DECLARE_LIBRARY_RENAMES RENAME_LIBRARY (floatundisf, ul2f)
72 #endif
73 
74 /* For ARM bpabi, we only want to use a "__gnu_" prefix for the fixed-point
75    helper functions - not everything in libgcc - in the interests of
76    maintaining backward compatibility.  */
77 #define LIBGCC2_FIXEDBIT_GNU_PREFIX
78