recog.c (split_all_insns): Remove dead code.
[official-gcc.git] / libgcc / config / libbid / bid_gcc_intrinsics.h
blobf536e3b1bd4c2556f84a37912ad89d9d885685c1
1 /* Copyright (C) 2007, 2009 Free Software Foundation, Inc.
3 This file is part of GCC.
5 GCC is free software; you can redistribute it and/or modify it under
6 the terms of the GNU General Public License as published by the Free
7 Software Foundation; either version 3, or (at your option) any later
8 version.
10 GCC is distributed in the hope that it will be useful, but WITHOUT ANY
11 WARRANTY; without even the implied warranty of MERCHANTABILITY or
12 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
13 for more details.
15 Under Section 7 of GPL version 3, you are granted additional
16 permissions described in the GCC Runtime Library Exception, version
17 3.1, as published by the Free Software Foundation.
19 You should have received a copy of the GNU General Public License and
20 a copy of the GCC Runtime Library Exception along with this program;
21 see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
22 <http://www.gnu.org/licenses/>. */
24 #ifndef _BID_GCC_INTRINSICS_H
25 #define _BID_GCC_INTRINSICS_H
27 #ifdef IN_LIBGCC2
29 #include "tconfig.h"
30 #include "coretypes.h"
31 #include "tm.h"
33 #ifndef LIBGCC2_FLOAT_WORDS_BIG_ENDIAN
34 #define LIBGCC2_FLOAT_WORDS_BIG_ENDIAN \
35 (__BYTE_ORDER__ != __ORDER_LITTLE_ENDIAN__)
36 #endif
38 #ifndef LIBGCC2_LONG_DOUBLE_TYPE_SIZE
39 #define LIBGCC2_LONG_DOUBLE_TYPE_SIZE LONG_DOUBLE_TYPE_SIZE
40 #endif
42 #ifndef LIBGCC2_HAS_XF_MODE
43 #define LIBGCC2_HAS_XF_MODE \
44 (BITS_PER_UNIT == 8 && LIBGCC2_LONG_DOUBLE_TYPE_SIZE == 80)
45 #endif
47 #ifndef LIBGCC2_HAS_TF_MODE
48 #define LIBGCC2_HAS_TF_MODE \
49 (BITS_PER_UNIT == 8 && LIBGCC2_LONG_DOUBLE_TYPE_SIZE == 128)
50 #endif
52 #ifndef BID_HAS_XF_MODE
53 #define BID_HAS_XF_MODE LIBGCC2_HAS_XF_MODE
54 #endif
56 #ifndef BID_HAS_TF_MODE
57 #define BID_HAS_TF_MODE LIBGCC2_HAS_TF_MODE
58 #endif
60 /* Some handy typedefs. */
62 typedef float SFtype __attribute__ ((mode (SF)));
63 typedef float DFtype __attribute__ ((mode (DF)));
64 #if LIBGCC2_HAS_XF_MODE
65 typedef float XFtype __attribute__ ((mode (XF)));
66 #endif /* LIBGCC2_HAS_XF_MODE */
67 #if LIBGCC2_HAS_TF_MODE
68 typedef float TFtype __attribute__ ((mode (TF)));
69 #endif /* LIBGCC2_HAS_XF_MODE */
71 typedef int SItype __attribute__ ((mode (SI)));
72 typedef int DItype __attribute__ ((mode (DI)));
73 typedef unsigned int USItype __attribute__ ((mode (SI)));
74 typedef unsigned int UDItype __attribute__ ((mode (DI)));
76 /* The type of the result of a decimal float comparison. This must
77 match `word_mode' in GCC for the target. */
79 typedef int CMPtype __attribute__ ((mode (word)));
81 typedef int SINT8 __attribute__ ((mode (QI)));
82 typedef unsigned int UINT8 __attribute__ ((mode (QI)));
83 typedef USItype UINT32;
84 typedef SItype SINT32;
85 typedef UDItype UINT64;
86 typedef DItype SINT64;
88 /* It has to be identical to the one defined in bid_functions.h. */
89 typedef __attribute__ ((aligned(16))) struct
91 UINT64 w[2];
92 } UINT128;
93 #else /* if not IN_LIBGCC2 */
95 #ifndef BID_HAS_XF_MODE
96 #define BID_HAS_XF_MODE 1
97 #endif
99 #ifndef BID_HAS_TF_MODE
100 #if defined __i386__
101 #define BID_HAS_TF_MODE 0
102 #else
103 #define BID_HAS_TF_MODE 1
104 #endif
105 #endif
107 #ifndef SFtype
108 #define SFtype float
109 #endif
111 #ifndef DFtype
112 #define DFtype double
113 #endif
115 #if BID_HAS_XF_MODE
116 #ifndef XFtype
117 #define XFtype long double
118 #endif
120 #endif /* IN_LIBGCC2 */
122 #if BID_HAS_TF_MODE
123 #ifndef TFtype
124 #define TFtype __float128
125 #endif
126 #endif
128 #ifndef SItype
129 #define SItype SINT32
130 #endif
132 #ifndef DItype
133 #define DItype SINT64
134 #endif
136 #ifndef USItype
137 #define USItype UINT32
138 #endif
140 #ifndef UDItype
141 #define UDItype UINT64
142 #endif
144 #ifndef CMPtype
145 #define CMPtype long
146 #endif
147 #endif /* IN_LIBGCC2 */
149 #if BID_HAS_GCC_DECIMAL_INTRINSICS
150 /* Prototypes for gcc instrinsics */
152 extern _Decimal64 __bid_adddd3 (_Decimal64, _Decimal64);
153 extern _Decimal64 __bid_subdd3 (_Decimal64, _Decimal64);
154 extern _Decimal32 __bid_addsd3 (_Decimal32, _Decimal32);
155 extern _Decimal32 __bid_subsd3 (_Decimal32, _Decimal32);
156 extern _Decimal128 __bid_addtd3 (_Decimal128, _Decimal128);
157 extern _Decimal128 __bid_subtd3 (_Decimal128, _Decimal128);
158 extern DFtype __bid_truncdddf (_Decimal64);
159 extern DItype __bid_fixdddi (_Decimal64);
160 extern _Decimal32 __bid_truncddsd2 (_Decimal64);
161 extern SFtype __bid_truncddsf (_Decimal64);
162 extern SItype __bid_fixddsi (_Decimal64);
163 extern _Decimal128 __bid_extendddtd2 (_Decimal64);
164 #if BID_HAS_TF_MODE
165 extern TFtype __bid_extendddtf (_Decimal64);
166 #endif
167 extern UDItype __bid_fixunsdddi (_Decimal64);
168 extern USItype __bid_fixunsddsi (_Decimal64);
169 #if BID_HAS_XF_MODE
170 extern XFtype __bid_extendddxf (_Decimal64);
171 #endif
172 extern _Decimal64 __bid_extenddfdd (DFtype);
173 extern _Decimal32 __bid_truncdfsd (DFtype);
174 extern _Decimal128 __bid_extenddftd (DFtype);
175 extern _Decimal64 __bid_floatdidd (DItype);
176 extern _Decimal32 __bid_floatdisd (DItype);
177 extern _Decimal128 __bid_floatditd (DItype);
178 extern _Decimal64 __bid_divdd3 (_Decimal64, _Decimal64);
179 extern _Decimal32 __bid_divsd3 (_Decimal32, _Decimal32);
180 extern _Decimal128 __bid_divtd3 (_Decimal128, _Decimal128);
181 extern CMPtype __bid_eqdd2 (_Decimal64, _Decimal64);
182 extern CMPtype __bid_eqsd2 (_Decimal32, _Decimal32);
183 extern CMPtype __bid_eqtd2 (_Decimal128, _Decimal128);
184 extern CMPtype __bid_gedd2 (_Decimal64, _Decimal64);
185 extern CMPtype __bid_gesd2 (_Decimal32, _Decimal32);
186 extern CMPtype __bid_getd2 (_Decimal128, _Decimal128);
187 extern CMPtype __bid_gtdd2 (_Decimal64, _Decimal64);
188 extern CMPtype __bid_gtsd2 (_Decimal32, _Decimal32);
189 extern CMPtype __bid_gttd2 (_Decimal128, _Decimal128);
190 extern CMPtype __bid_ledd2 (_Decimal64, _Decimal64);
191 extern CMPtype __bid_lesd2 (_Decimal32, _Decimal32);
192 extern CMPtype __bid_letd2 (_Decimal128, _Decimal128);
193 extern CMPtype __bid_ltdd2 (_Decimal64, _Decimal64);
194 extern CMPtype __bid_ltsd2 (_Decimal32, _Decimal32);
195 extern CMPtype __bid_lttd2 (_Decimal128, _Decimal128);
196 extern CMPtype __bid_nedd2 (_Decimal64, _Decimal64);
197 extern CMPtype __bid_nesd2 (_Decimal32, _Decimal32);
198 extern CMPtype __bid_netd2 (_Decimal128, _Decimal128);
199 extern CMPtype __bid_unorddd2 (_Decimal64, _Decimal64);
200 extern CMPtype __bid_unordsd2 (_Decimal32, _Decimal32);
201 extern CMPtype __bid_unordtd2 (_Decimal128, _Decimal128);
202 extern _Decimal64 __bid_muldd3 (_Decimal64, _Decimal64);
203 extern _Decimal32 __bid_mulsd3 (_Decimal32, _Decimal32);
204 extern _Decimal128 __bid_multd3 (_Decimal128, _Decimal128);
205 extern _Decimal64 __bid_extendsddd2 (_Decimal32);
206 extern DFtype __bid_extendsddf (_Decimal32);
207 extern DItype __bid_fixsddi (_Decimal32);
208 extern SFtype __bid_truncsdsf (_Decimal32);
209 extern SItype __bid_fixsdsi (_Decimal32);
210 extern _Decimal128 __bid_extendsdtd2 (_Decimal32);
211 #if BID_HAS_TF_MODE
212 extern TFtype __bid_extendsdtf (_Decimal32);
213 #endif
214 extern UDItype __bid_fixunssddi (_Decimal32);
215 extern USItype __bid_fixunssdsi (_Decimal32);
216 #if BID_HAS_XF_MODE
217 extern XFtype __bid_extendsdxf (_Decimal32);
218 #endif
219 extern _Decimal64 __bid_extendsfdd (SFtype);
220 extern _Decimal32 __bid_extendsfsd (SFtype);
221 extern _Decimal128 __bid_extendsftd (SFtype);
222 extern _Decimal64 __bid_floatsidd (SItype);
223 extern _Decimal32 __bid_floatsisd (SItype);
224 extern _Decimal128 __bid_floatsitd (SItype);
225 extern _Decimal64 __bid_trunctddd2 (_Decimal128);
226 extern DFtype __bid_trunctddf (_Decimal128);
227 extern DItype __bid_fixtddi (_Decimal128);
228 extern _Decimal32 __bid_trunctdsd2 (_Decimal128);
229 extern SFtype __bid_trunctdsf (_Decimal128);
230 extern SItype __bid_fixtdsi (_Decimal128);
231 #if BID_HAS_TF_MODE
232 extern TFtype __bid_trunctdtf (_Decimal128);
233 #endif
234 extern UDItype __bid_fixunstddi (_Decimal128);
235 extern USItype __bid_fixunstdsi (_Decimal128);
236 #if BID_HAS_XF_MODE
237 extern XFtype __bid_trunctdxf (_Decimal128);
238 #endif
239 #if BID_HAS_TF_MODE
240 extern _Decimal64 __bid_trunctfdd (TFtype);
241 extern _Decimal32 __bid_trunctfsd (TFtype);
242 extern _Decimal128 __bid_extendtftd (TFtype);
243 #endif
244 extern _Decimal64 __bid_floatunsdidd (UDItype);
245 extern _Decimal32 __bid_floatunsdisd (UDItype);
246 extern _Decimal128 __bid_floatunsditd (UDItype);
247 extern _Decimal64 __bid_floatunssidd (USItype);
248 extern _Decimal32 __bid_floatunssisd (USItype);
249 extern _Decimal128 __bid_floatunssitd (USItype);
250 #if BID_HAS_XF_MODE
251 extern _Decimal64 __bid_truncxfdd (XFtype);
252 extern _Decimal32 __bid_truncxfsd (XFtype);
253 extern _Decimal128 __bid_extendxftd (XFtype);
254 #endif
255 extern int isinfd32 (_Decimal32);
256 extern int isinfd64 (_Decimal64);
257 extern int isinfd128 (_Decimal128);
258 #endif /* BID_HAS_GCC_DECIMAL_INTRINSICS */
260 extern void __dfp_set_round (int);
261 extern int __dfp_get_round (void);
262 extern void __dfp_clear_except (void);
263 extern int __dfp_test_except (int);
264 extern void __dfp_raise_except (int);
266 #if BID_HAS_GCC_DECIMAL_INTRINSICS
267 /* Used by gcc intrinsics. We have to define them after UINT128
268 is defined. */
269 union decimal32 {
270 _Decimal32 d;
271 UINT32 i;
274 union decimal64 {
275 _Decimal64 d;
276 UINT64 i;
279 union decimal128 {
280 _Decimal128 d;
281 UINT128 i;
284 #if BID_HAS_TF_MODE
285 union float128 {
286 TFtype f;
287 UINT128 i;
289 #endif
290 #endif /* BID_HAS_GCC_DECIMAL_INTRINSICS */
292 #endif /* _BID_GCC_INTRINSICS_H */