Daily bump.
[gcc.git] / libgcc / config / frv / frv-abi.h
blob02f3179f107cafd05e4377c2436bd96a8314b72d
1 /* Frv map GCC names to FR-V ABI.
2 Copyright (C) 2000-2024 Free Software Foundation, Inc.
3 Contributed by Red Hat, Inc.
5 This file is part of GCC.
7 GCC is free software; you can redistribute it and/or modify it under
8 the terms of the GNU General Public License as published by the Free
9 Software Foundation; either version 3, or (at your option) any later
10 version.
12 GCC is distributed in the hope that it will be useful, but WITHOUT
13 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
14 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
15 for more details.
17 Under Section 7 of GPL version 3, you are granted additional
18 permissions described in the GCC Runtime Library Exception, version
19 3.1, as published by the Free Software Foundation.
21 You should have received a copy of the GNU General Public License and
22 a copy of the GCC Runtime Library Exception along with this program;
23 see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
24 <http://www.gnu.org/licenses/>. */
26 /* For each of the functions in the library that has a corresponding name in
27 the ABI, add an equivalence between the GCC name and the ABI name. This is
28 in a separate file from frv.h so that fp-bit.c can be made to include it. */
30 #ifdef __GNUC__
31 #ifdef __FRV_UNDERSCORE__
32 #define RENAME_LIBRARY(OLD,NEW) \
33 __asm__ (".globl\t_" #NEW "\n" \
34 "_" #NEW "=_" #OLD "\n" \
35 "\t.type\t_" #NEW ",@function\n");
37 #else
38 #define RENAME_LIBRARY(OLD,NEW) \
39 __asm__ (".globl\t" #NEW "\n" \
40 #NEW "=" #OLD "\n" \
41 "\t.type\t" #NEW ",@function\n");
42 #endif
44 #define CREATE_DOUBLE_SHIFT(OLD,NEW) \
45 __asm__ (".text\n" \
46 "\t.globl\t" #NEW "\n" \
47 "\t.type\t" #NEW ",@function\n" \
48 #NEW ":\n" \
49 "\tor\tgr11, gr0, gr10\n" \
50 ".L" #OLD " = " #OLD "\n" \
51 "\tbra\t.L" #OLD "\n");
53 #ifdef L_sf_to_df
54 #define DECLARE_LIBRARY_RENAMES RENAME_LIBRARY(__extendsfdf2,__ftod)
55 #endif
57 #ifdef L_sf_to_si
58 #define DECLARE_LIBRARY_RENAMES RENAME_LIBRARY(__fixsfsi,__ftoi)
59 #endif
61 #ifdef L_sf_to_usi
62 #define DECLARE_LIBRARY_RENAMES RENAME_LIBRARY(__fixunssfsi,__ftoui)
63 #endif
65 #ifdef L_df_to_si
66 #define DECLARE_LIBRARY_RENAMES RENAME_LIBRARY(__fixdfsi,__dtoi)
67 #endif
69 #ifdef L_fixunssfsi
70 #define DECLARE_LIBRARY_RENAMES RENAME_LIBRARY(__fixunssfsi,__ftoui)
71 #endif
73 #ifdef L_fixunsdfsi
74 #define DECLARE_LIBRARY_RENAMES RENAME_LIBRARY(__fixunsdfsi,__dtoui)
75 #endif
77 #ifdef L_fixsfdi
78 #define DECLARE_LIBRARY_RENAMES RENAME_LIBRARY(__fixsfdi,__ftoll)
79 #endif
81 #ifdef L_fixdfdi
82 #define DECLARE_LIBRARY_RENAMES RENAME_LIBRARY(__fixdfdi,__dtoll)
83 #endif
85 #ifdef L_fixunssfdi
86 #define DECLARE_LIBRARY_RENAMES RENAME_LIBRARY(__fixunssfdi,__ftoull)
87 #endif
89 #ifdef L_fixunsdfdi
90 #define DECLARE_LIBRARY_RENAMES RENAME_LIBRARY(__fixunsdfdi,__dtoull)
91 #endif
93 #ifdef L_si_to_sf
94 #define DECLARE_LIBRARY_RENAMES RENAME_LIBRARY(__floatsisf,__itof)
95 #endif
97 #ifdef L_di_to_sf
98 #define DECLARE_LIBRARY_RENAMES RENAME_LIBRARY(__floatdisf,__lltof)
99 #endif
101 #ifdef L_df_to_sf
102 #define DECLARE_LIBRARY_RENAMES RENAME_LIBRARY(__truncdfsf2,__dtof)
103 #endif
105 #ifdef L_si_to_df
106 #define DECLARE_LIBRARY_RENAMES RENAME_LIBRARY(__floatsidf,__itod)
107 #endif
109 #ifdef L_floatdisf
110 #define DECLARE_LIBRARY_RENAMES RENAME_LIBRARY(__floatdisf,__lltof)
111 #endif
113 #ifdef L_floatdidf
114 #define DECLARE_LIBRARY_RENAMES RENAME_LIBRARY(__floatdidf,__lltod)
115 #endif
117 #ifdef L_addsub_df
118 #define DECLARE_LIBRARY_RENAMES \
119 RENAME_LIBRARY(__adddf3,__addd)
120 RENAME_LIBRARY(__subdf3,__subd)
121 #endif
123 #ifdef L_mul_df
124 #define DECLARE_LIBRARY_RENAMES RENAME_LIBRARY(__muldf3,__muld)
125 #endif
127 #ifdef L_div_df
128 #define DECLARE_LIBRARY_RENAMES RENAME_LIBRARY(__divdf3,__divd)
129 #endif
131 #ifdef L_addsub_sf
132 #define DECLARE_LIBRARY_RENAMES \
133 RENAME_LIBRARY(__addsf3,__addf) \
134 RENAME_LIBRARY(__subsf3,__subf)
135 #endif
137 #ifdef L_mul_sf
138 #define DECLARE_LIBRARY_RENAMES RENAME_LIBRARY(__mulsf3,__mulf)
139 #endif
141 #ifdef L_div_sf
142 #define DECLARE_LIBRARY_RENAMES RENAME_LIBRARY(__divsf3,__divf)
143 #endif
145 #ifdef L_ashldi3
146 #define DECLARE_LIBRARY_RENAMES CREATE_DOUBLE_SHIFT (__ashldi3,__sllll)
147 #endif
149 #ifdef L_lshrdi3
150 #define DECLARE_LIBRARY_RENAMES CREATE_DOUBLE_SHIFT (__lshrdi3,__srlll)
151 #endif
153 #ifdef L_ashrdi3
154 #define DECLARE_LIBRARY_RENAMES CREATE_DOUBLE_SHIFT (__ashrdi3,__srall)
155 #endif
157 #ifdef L_adddi3
158 #define DECLARE_LIBRARY_RENAMES RENAME_LIBRARY(__adddi3,__addll)
159 #endif
161 #ifdef L_subdi3
162 #define DECLARE_LIBRARY_RENAMES RENAME_LIBRARY(__subdi3,__subll)
163 #endif
165 #ifdef L_muldi3
166 #define DECLARE_LIBRARY_RENAMES \
167 RENAME_LIBRARY(__muldi3,__mulll)
168 RENAME_LIBRARY(__muldi3,__umulll)
169 #endif
171 #ifdef L_divdi3
172 #define DECLARE_LIBRARY_RENAMES RENAME_LIBRARY(__divdi3,__divll)
173 #endif
175 #ifdef L_udivdi3
176 #define DECLARE_LIBRARY_RENAMES RENAME_LIBRARY(__udivdi3,__udivll)
177 #endif
179 #ifdef L_moddi3
180 #define DECLARE_LIBRARY_RENAMES RENAME_LIBRARY(__moddi3,__modll)
181 #endif
183 #ifdef L_umoddi3
184 #define DECLARE_LIBRARY_RENAMES RENAME_LIBRARY(__umoddi3,__umodll)
185 #endif
186 #endif /* __GNUC__ */