Add AMD SSE5 support; Add iterator over function arguments; Add stdarg_p, prototype_p...
[official-gcc.git] / gcc / config / frv / frv-abi.h
blobae8488713c70b599ec49926d8818fcb08b808bca
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)
10 any later version.
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. */
25 #ifdef __GNUC__
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");
32 #else
33 #define RENAME_LIBRARY(OLD,NEW) \
34 __asm__ (".globl\t" #NEW "\n" \
35 #NEW "=" #OLD "\n" \
36 "\t.type\t" #NEW ",@function\n");
37 #endif
39 #define CREATE_DOUBLE_SHIFT(OLD,NEW) \
40 __asm__ (".text\n" \
41 "\t.globl\t" #NEW "\n" \
42 "\t.type\t" #NEW ",@function\n" \
43 #NEW ":\n" \
44 "\tor\tgr11, gr0, gr10\n" \
45 ".L" #OLD " = " #OLD "\n" \
46 "\tbra\t.L" #OLD "\n");
48 #ifdef L_sf_to_df
49 #define DECLARE_LIBRARY_RENAMES RENAME_LIBRARY(__extendsfdf2,__ftod)
50 #endif
52 #ifdef L_sf_to_si
53 #define DECLARE_LIBRARY_RENAMES RENAME_LIBRARY(__fixsfsi,__ftoi)
54 #endif
56 #ifdef L_sf_to_usi
57 #define DECLARE_LIBRARY_RENAMES RENAME_LIBRARY(__fixunssfsi,__ftoui)
58 #endif
60 #ifdef L_df_to_si
61 #define DECLARE_LIBRARY_RENAMES RENAME_LIBRARY(__fixdfsi,__dtoi)
62 #endif
64 #ifdef L_fixunssfsi
65 #define DECLARE_LIBRARY_RENAMES RENAME_LIBRARY(__fixunssfsi,__ftoui)
66 #endif
68 #ifdef L_fixunsdfsi
69 #define DECLARE_LIBRARY_RENAMES RENAME_LIBRARY(__fixunsdfsi,__dtoui)
70 #endif
72 #ifdef L_fixsfdi
73 #define DECLARE_LIBRARY_RENAMES RENAME_LIBRARY(__fixsfdi,__ftoll)
74 #endif
76 #ifdef L_fixdfdi
77 #define DECLARE_LIBRARY_RENAMES RENAME_LIBRARY(__fixdfdi,__dtoll)
78 #endif
80 #ifdef L_fixunssfdi
81 #define DECLARE_LIBRARY_RENAMES RENAME_LIBRARY(__fixunssfdi,__ftoull)
82 #endif
84 #ifdef L_fixunsdfdi
85 #define DECLARE_LIBRARY_RENAMES RENAME_LIBRARY(__fixunsdfdi,__dtoull)
86 #endif
88 #ifdef L_si_to_sf
89 #define DECLARE_LIBRARY_RENAMES RENAME_LIBRARY(__floatsisf,__itof)
90 #endif
92 #ifdef L_di_to_sf
93 #define DECLARE_LIBRARY_RENAMES RENAME_LIBRARY(__floatdisf,__lltof)
94 #endif
96 #ifdef L_df_to_sf
97 #define DECLARE_LIBRARY_RENAMES RENAME_LIBRARY(__truncdfsf2,__dtof)
98 #endif
100 #ifdef L_si_to_df
101 #define DECLARE_LIBRARY_RENAMES RENAME_LIBRARY(__floatsidf,__itod)
102 #endif
104 #ifdef L_floatdisf
105 #define DECLARE_LIBRARY_RENAMES RENAME_LIBRARY(__floatdisf,__lltof)
106 #endif
108 #ifdef L_floatdidf
109 #define DECLARE_LIBRARY_RENAMES RENAME_LIBRARY(__floatdidf,__lltod)
110 #endif
112 #ifdef L_addsub_df
113 #define DECLARE_LIBRARY_RENAMES \
114 RENAME_LIBRARY(__adddf3,__addd)
115 RENAME_LIBRARY(__subdf3,__subd)
116 #endif
118 #ifdef L_mul_df
119 #define DECLARE_LIBRARY_RENAMES RENAME_LIBRARY(__muldf3,__muld)
120 #endif
122 #ifdef L_div_df
123 #define DECLARE_LIBRARY_RENAMES RENAME_LIBRARY(__divdf3,__divd)
124 #endif
126 #ifdef L_addsub_sf
127 #define DECLARE_LIBRARY_RENAMES \
128 RENAME_LIBRARY(__addsf3,__addf) \
129 RENAME_LIBRARY(__subsf3,__subf)
130 #endif
132 #ifdef L_mul_sf
133 #define DECLARE_LIBRARY_RENAMES RENAME_LIBRARY(__mulsf3,__mulf)
134 #endif
136 #ifdef L_div_sf
137 #define DECLARE_LIBRARY_RENAMES RENAME_LIBRARY(__divsf3,__divf)
138 #endif
140 #ifdef L_ashldi3
141 #define DECLARE_LIBRARY_RENAMES CREATE_DOUBLE_SHIFT (__ashldi3,__sllll)
142 #endif
144 #ifdef L_lshrdi3
145 #define DECLARE_LIBRARY_RENAMES CREATE_DOUBLE_SHIFT (__lshrdi3,__srlll)
146 #endif
148 #ifdef L_ashrdi3
149 #define DECLARE_LIBRARY_RENAMES CREATE_DOUBLE_SHIFT (__ashrdi3,__srall)
150 #endif
152 #ifdef L_adddi3
153 #define DECLARE_LIBRARY_RENAMES RENAME_LIBRARY(__adddi3,__addll)
154 #endif
156 #ifdef L_subdi3
157 #define DECLARE_LIBRARY_RENAMES RENAME_LIBRARY(__subdi3,__subll)
158 #endif
160 #ifdef L_muldi3
161 #define DECLARE_LIBRARY_RENAMES \
162 RENAME_LIBRARY(__muldi3,__mulll)
163 RENAME_LIBRARY(__muldi3,__umulll)
164 #endif
166 #ifdef L_divdi3
167 #define DECLARE_LIBRARY_RENAMES RENAME_LIBRARY(__divdi3,__divll)
168 #endif
170 #ifdef L_udivdi3
171 #define DECLARE_LIBRARY_RENAMES RENAME_LIBRARY(__udivdi3,__udivll)
172 #endif
174 #ifdef L_moddi3
175 #define DECLARE_LIBRARY_RENAMES RENAME_LIBRARY(__moddi3,__modll)
176 #endif
178 #ifdef L_umoddi3
179 #define DECLARE_LIBRARY_RENAMES RENAME_LIBRARY(__umoddi3,__umodll)
180 #endif
181 #endif /* __GNUC__ */