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
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
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. */
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");
38 #define RENAME_LIBRARY(OLD,NEW) \
39 __asm__ (".globl\t" #NEW "\n" \
41 "\t.type\t" #NEW ",@function\n");
44 #define CREATE_DOUBLE_SHIFT(OLD,NEW) \
46 "\t.globl\t" #NEW "\n" \
47 "\t.type\t" #NEW ",@function\n" \
49 "\tor\tgr11, gr0, gr10\n" \
50 ".L" #OLD " = " #OLD "\n" \
51 "\tbra\t.L" #OLD "\n");
54 #define DECLARE_LIBRARY_RENAMES RENAME_LIBRARY(__extendsfdf2,__ftod)
58 #define DECLARE_LIBRARY_RENAMES RENAME_LIBRARY(__fixsfsi,__ftoi)
62 #define DECLARE_LIBRARY_RENAMES RENAME_LIBRARY(__fixunssfsi,__ftoui)
66 #define DECLARE_LIBRARY_RENAMES RENAME_LIBRARY(__fixdfsi,__dtoi)
70 #define DECLARE_LIBRARY_RENAMES RENAME_LIBRARY(__fixunssfsi,__ftoui)
74 #define DECLARE_LIBRARY_RENAMES RENAME_LIBRARY(__fixunsdfsi,__dtoui)
78 #define DECLARE_LIBRARY_RENAMES RENAME_LIBRARY(__fixsfdi,__ftoll)
82 #define DECLARE_LIBRARY_RENAMES RENAME_LIBRARY(__fixdfdi,__dtoll)
86 #define DECLARE_LIBRARY_RENAMES RENAME_LIBRARY(__fixunssfdi,__ftoull)
90 #define DECLARE_LIBRARY_RENAMES RENAME_LIBRARY(__fixunsdfdi,__dtoull)
94 #define DECLARE_LIBRARY_RENAMES RENAME_LIBRARY(__floatsisf,__itof)
98 #define DECLARE_LIBRARY_RENAMES RENAME_LIBRARY(__floatdisf,__lltof)
102 #define DECLARE_LIBRARY_RENAMES RENAME_LIBRARY(__truncdfsf2,__dtof)
106 #define DECLARE_LIBRARY_RENAMES RENAME_LIBRARY(__floatsidf,__itod)
110 #define DECLARE_LIBRARY_RENAMES RENAME_LIBRARY(__floatdisf,__lltof)
114 #define DECLARE_LIBRARY_RENAMES RENAME_LIBRARY(__floatdidf,__lltod)
118 #define DECLARE_LIBRARY_RENAMES \
119 RENAME_LIBRARY(__adddf3,__addd)
120 RENAME_LIBRARY(__subdf3
,__subd
)
124 #define DECLARE_LIBRARY_RENAMES RENAME_LIBRARY(__muldf3,__muld)
128 #define DECLARE_LIBRARY_RENAMES RENAME_LIBRARY(__divdf3,__divd)
132 #define DECLARE_LIBRARY_RENAMES \
133 RENAME_LIBRARY(__addsf3,__addf) \
134 RENAME_LIBRARY(__subsf3,__subf)
138 #define DECLARE_LIBRARY_RENAMES RENAME_LIBRARY(__mulsf3,__mulf)
142 #define DECLARE_LIBRARY_RENAMES RENAME_LIBRARY(__divsf3,__divf)
146 #define DECLARE_LIBRARY_RENAMES CREATE_DOUBLE_SHIFT (__ashldi3,__sllll)
150 #define DECLARE_LIBRARY_RENAMES CREATE_DOUBLE_SHIFT (__lshrdi3,__srlll)
154 #define DECLARE_LIBRARY_RENAMES CREATE_DOUBLE_SHIFT (__ashrdi3,__srall)
158 #define DECLARE_LIBRARY_RENAMES RENAME_LIBRARY(__adddi3,__addll)
162 #define DECLARE_LIBRARY_RENAMES RENAME_LIBRARY(__subdi3,__subll)
166 #define DECLARE_LIBRARY_RENAMES \
167 RENAME_LIBRARY(__muldi3,__mulll)
168 RENAME_LIBRARY(__muldi3
,__umulll
)
172 #define DECLARE_LIBRARY_RENAMES RENAME_LIBRARY(__divdi3,__divll)
176 #define DECLARE_LIBRARY_RENAMES RENAME_LIBRARY(__udivdi3,__udivll)
180 #define DECLARE_LIBRARY_RENAMES RENAME_LIBRARY(__moddi3,__modll)
184 #define DECLARE_LIBRARY_RENAMES RENAME_LIBRARY(__umoddi3,__umodll)
186 #endif /* __GNUC__ */