1 /* Frv map GCC names to FR-V ABI.
2 Copyright (C) 2000, 2003, 2004, 2007 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
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 3, or (at your option)
12 GCC is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
17 You should have received a copy of the GNU General Public License
18 along with GCC; see the file COPYING3. If not see
19 <http://www.gnu.org/licenses/>. */
21 /* For each of the functions in the library that has a corresponding name in
22 the ABI, add an equivalence between the GCC name and the ABI name. This is
23 in a separate file from frv.h so that fp-bit.c can be made to include it. */
26 #ifdef __FRV_UNDERSCORE__
27 #define RENAME_LIBRARY(OLD,NEW) \
28 __asm__ (".globl\t_" #NEW "\n" \
29 "_" #NEW "=_" #OLD "\n" \
30 "\t.type\t_" #NEW ",@function\n");
33 #define RENAME_LIBRARY(OLD,NEW) \
34 __asm__ (".globl\t" #NEW "\n" \
36 "\t.type\t" #NEW ",@function\n");
39 #define CREATE_DOUBLE_SHIFT(OLD,NEW) \
41 "\t.globl\t" #NEW "\n" \
42 "\t.type\t" #NEW ",@function\n" \
44 "\tor\tgr11, gr0, gr10\n" \
45 ".L" #OLD " = " #OLD "\n" \
46 "\tbra\t.L" #OLD "\n");
49 #define DECLARE_LIBRARY_RENAMES RENAME_LIBRARY(__extendsfdf2,__ftod)
53 #define DECLARE_LIBRARY_RENAMES RENAME_LIBRARY(__fixsfsi,__ftoi)
57 #define DECLARE_LIBRARY_RENAMES RENAME_LIBRARY(__fixunssfsi,__ftoui)
61 #define DECLARE_LIBRARY_RENAMES RENAME_LIBRARY(__fixdfsi,__dtoi)
65 #define DECLARE_LIBRARY_RENAMES RENAME_LIBRARY(__fixunssfsi,__ftoui)
69 #define DECLARE_LIBRARY_RENAMES RENAME_LIBRARY(__fixunsdfsi,__dtoui)
73 #define DECLARE_LIBRARY_RENAMES RENAME_LIBRARY(__fixsfdi,__ftoll)
77 #define DECLARE_LIBRARY_RENAMES RENAME_LIBRARY(__fixdfdi,__dtoll)
81 #define DECLARE_LIBRARY_RENAMES RENAME_LIBRARY(__fixunssfdi,__ftoull)
85 #define DECLARE_LIBRARY_RENAMES RENAME_LIBRARY(__fixunsdfdi,__dtoull)
89 #define DECLARE_LIBRARY_RENAMES RENAME_LIBRARY(__floatsisf,__itof)
93 #define DECLARE_LIBRARY_RENAMES RENAME_LIBRARY(__floatdisf,__lltof)
97 #define DECLARE_LIBRARY_RENAMES RENAME_LIBRARY(__truncdfsf2,__dtof)
101 #define DECLARE_LIBRARY_RENAMES RENAME_LIBRARY(__floatsidf,__itod)
105 #define DECLARE_LIBRARY_RENAMES RENAME_LIBRARY(__floatdisf,__lltof)
109 #define DECLARE_LIBRARY_RENAMES RENAME_LIBRARY(__floatdidf,__lltod)
113 #define DECLARE_LIBRARY_RENAMES \
114 RENAME_LIBRARY(__adddf3,__addd)
115 RENAME_LIBRARY(__subdf3
,__subd
)
119 #define DECLARE_LIBRARY_RENAMES RENAME_LIBRARY(__muldf3,__muld)
123 #define DECLARE_LIBRARY_RENAMES RENAME_LIBRARY(__divdf3,__divd)
127 #define DECLARE_LIBRARY_RENAMES \
128 RENAME_LIBRARY(__addsf3,__addf) \
129 RENAME_LIBRARY(__subsf3,__subf)
133 #define DECLARE_LIBRARY_RENAMES RENAME_LIBRARY(__mulsf3,__mulf)
137 #define DECLARE_LIBRARY_RENAMES RENAME_LIBRARY(__divsf3,__divf)
141 #define DECLARE_LIBRARY_RENAMES CREATE_DOUBLE_SHIFT (__ashldi3,__sllll)
145 #define DECLARE_LIBRARY_RENAMES CREATE_DOUBLE_SHIFT (__lshrdi3,__srlll)
149 #define DECLARE_LIBRARY_RENAMES CREATE_DOUBLE_SHIFT (__ashrdi3,__srall)
153 #define DECLARE_LIBRARY_RENAMES RENAME_LIBRARY(__adddi3,__addll)
157 #define DECLARE_LIBRARY_RENAMES RENAME_LIBRARY(__subdi3,__subll)
161 #define DECLARE_LIBRARY_RENAMES \
162 RENAME_LIBRARY(__muldi3,__mulll)
163 RENAME_LIBRARY(__muldi3
,__umulll
)
167 #define DECLARE_LIBRARY_RENAMES RENAME_LIBRARY(__divdi3,__divll)
171 #define DECLARE_LIBRARY_RENAMES RENAME_LIBRARY(__udivdi3,__udivll)
175 #define DECLARE_LIBRARY_RENAMES RENAME_LIBRARY(__moddi3,__modll)
179 #define DECLARE_LIBRARY_RENAMES RENAME_LIBRARY(__umoddi3,__umodll)
181 #endif /* __GNUC__ */