OSDN Git Service

PR target/34210 PR target/35508 * config.host (avr-*-*): Add avr cpu_type and avr...
[pf3gnuchains/gcc-fork.git] / libgcc / config / libbid / bid_conf.h
1 /* Copyright (C) 2007  Free Software Foundation, Inc.
2
3 This file is part of GCC.
4
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 2, or (at your option) any later
8 version.
9
10 In addition to the permissions in the GNU General Public License, the
11 Free Software Foundation gives you unlimited permission to link the
12 compiled version of this file into combinations with other programs,
13 and to distribute those combinations without any restriction coming
14 from the use of this file.  (The General Public License restrictions
15 do apply in other respects; for example, they cover modification of
16 the file, and distribution when not linked into a combine
17 executable.)
18
19 GCC is distributed in the hope that it will be useful, but WITHOUT ANY
20 WARRANTY; without even the implied warranty of MERCHANTABILITY or
21 FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
22 for more details.
23
24 You should have received a copy of the GNU General Public License
25 along with GCC; see the file COPYING.  If not, write to the Free
26 Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA
27 02110-1301, USA.  */
28
29 #ifndef _BID_CONF_H
30 #define _BID_CONF_H
31
32 // Name Changes
33
34 #define _IDEC_glbflags __bid_IDEC_glbflags
35 #define _IDEC_glbround __bid_IDEC_glbround
36 #define _IDEC_glbexcepthandling __bid_IDEC_glbexcepthandling
37 #define _IDEC_glbexceptionmasks __bid_IDEC_glbexceptionmasks
38 #define bid64_add __bid64_add
39 #define bid64_sub __bid64_sub
40 #define bid64_mul __bid64_mul
41 #define bid64_div __bid64_div
42 #define bid64dq_div __bid64dq_div
43 #define bid64qd_div __bid64qd_div
44 #define bid64qq_div __bid64qq_div
45 #define bid64q_sqrt __bid64q_sqrt
46 #define bid64_sqrt __bid64_sqrt
47 #define bid64_rem __bid64_rem
48 #define bid64_fma __bid64_fma
49 #define bid64_scalb __bid64_scalb
50 #define round128_19_38 __bid_round128_19_38
51 #define round192_39_57 __bid_round192_39_57
52 #define round256_58_76 __bid_round256_58_76
53 #define round64_2_18 __bid_round64_2_18
54 #define bid64_nextafter __bid64_nextafter
55 #define bid64_nextdown __bid64_nextdown
56 #define bid64_nextup __bid64_nextup
57 #define b2d __bid_b2d
58 #define b2d2 __bid_b2d2
59 #define b2d3 __bid_b2d3
60 #define b2d4 __bid_b2d4
61 #define b2d5 __bid_b2d5
62 #define bid128_canonize __bid128_canonize
63 #define bid32_canonize __bid32_canonize
64 #define bid64_canonize __bid64_canonize
65 #define bid_to_bid128 __bid_to_bid128
66 #define bid_to_bid32 __bid_to_bid32
67 #define bid_to_bid64 __bid_to_bid64
68 #define bid_to_dpd128 __bid_to_dpd128
69 #define bid_to_dpd32 __bid_to_dpd32
70 #define bid_to_dpd64 __bid_to_dpd64
71 #define d2b __bid_d2b
72 #define d2b2 __bid_d2b2
73 #define d2b3 __bid_d2b3
74 #define d2b4 __bid_d2b4
75 #define d2b5 __bid_d2b5
76 #define d2b6 __bid_d2b6
77 #define dpd_to_bid128 __bid_dpd_to_bid128
78 #define dpd_to_bid32 __bid_dpd_to_bid32
79 #define dpd_to_bid64 __bid_dpd_to_bid64
80 #define bid128_nextafter __bid128_nextafter
81 #define bid128_nextdown __bid128_nextdown
82 #define bid128_nextup __bid128_nextup
83 #define bid64_logb __bid64_logb
84 #define bid64_quantize __bid64_quantize
85 #define estimate_bin_expon __bid_estimate_bin_expon
86 #define estimate_decimal_digits __bid_estimate_decimal_digits
87 #define power10_index_binexp __bid_power10_index_binexp
88 #define power10_index_binexp_128 __bid_power10_index_binexp_128
89 #define power10_table_128 __bid_power10_table_128
90 #define reciprocals10_128 __bid_reciprocals10_128
91 #define reciprocals10_64 __bid_reciprocals10_64
92 #define recip_scale __bid_recip_scale
93 #define round_const_table __bid_round_const_table
94 #define round_const_table_128 __bid_round_const_table_128
95 #define short_recip_scale __bid_short_recip_scale
96 #define bid64_from_string __bid64_from_string
97 #define bid64_to_string __bid64_to_string
98 #define Inv_Tento9 __bid_Inv_Tento9
99 #define midi_tbl __bid_midi_tbl
100 #define Tento3 __bid_Tento3
101 #define Tento6 __bid_Tento6
102 #define Tento9 __bid_Tento9
103 #define Twoto30_m_10to9 __bid_Twoto30_m_10to9
104 #define Twoto60 __bid_Twoto60
105 #define Twoto60_m_10to18 __bid_Twoto60_m_10to18
106 #define convert_table __bid_convert_table
107 #define factors __bid_factors
108 #define packed_10000_zeros __bid_packed_10000_zeros
109 #define char_table2 __bid_char_table2
110 #define char_table3 __bid_char_table3
111 #define Ex128m128 __bid_Ex128m128
112 #define Ex192m192 __bid_Ex192m192
113 #define Ex256m256 __bid_Ex256m256
114 #define Ex64m64 __bid_Ex64m64
115 #define half128 __bid_half128
116 #define half192 __bid_half192
117 #define half256 __bid_half256
118 #define half64 __bid_half64
119 #define Kx128 __bid_Kx128
120 #define Kx192 __bid_Kx192
121 #define Kx256 __bid_Kx256
122 #define Kx64 __bid_Kx64
123 #define mask128 __bid_mask128
124 #define mask192 __bid_mask192
125 #define mask256 __bid_mask256
126 #define mask64 __bid_mask64
127 #define maskhigh128 __bid_maskhigh128
128 #define maskhigh128M __bid_maskhigh128M
129 #define maskhigh192M __bid_maskhigh192M
130 #define maskhigh256M __bid_maskhigh256M
131 #define midpoint128 __bid_midpoint128
132 #define midpoint192 __bid_midpoint192
133 #define midpoint256 __bid_midpoint256
134 #define midpoint64 __bid_midpoint64
135 #define nr_digits __bid_nr_digits
136 #define onehalf128 __bid_onehalf128
137 #define onehalf128M __bid_onehalf128M
138 #define onehalf192M __bid_onehalf192M
139 #define onehalf256M __bid_onehalf256M
140 #define shiftright128 __bid_shiftright128
141 #define shiftright128M __bid_shiftright128M
142 #define shiftright192M __bid_shiftright192M
143 #define shiftright256M __bid_shiftright256M
144 #define shift_ten2m3k128 __bid_shift_ten2m3k128
145 #define shift_ten2m3k64 __bid_shift_ten2m3k64
146 #define ten2k128 __bid_ten2k128
147 #define ten2k256 __bid_ten2k256
148 #define ten2k64 __bid_ten2k64
149 #define ten2m3k128 __bid_ten2m3k128
150 #define ten2m3k64 __bid_ten2m3k64
151 #define ten2mk128 __bid_ten2mk128
152 #define ten2mk128M __bid_ten2mk128M
153 #define ten2mk128trunc __bid_ten2mk128trunc
154 #define ten2mk128truncM __bid_ten2mk128truncM
155 #define ten2mk192M __bid_ten2mk192M
156 #define ten2mk192truncM __bid_ten2mk192truncM
157 #define ten2mk256M __bid_ten2mk256M
158 #define ten2mk256truncM __bid_ten2mk256truncM
159 #define ten2mk64 __bid_ten2mk64
160 #define ten2mxtrunc128 __bid_ten2mxtrunc128
161 #define ten2mxtrunc192 __bid_ten2mxtrunc192
162 #define ten2mxtrunc256 __bid_ten2mxtrunc256
163 #define ten2mxtrunc64 __bid_ten2mxtrunc64
164 #define bid128_add __bid128_add
165 #define bid128dd_add __bid128dd_add
166 #define bid128dd_sub __bid128dd_sub
167 #define bid128dq_add __bid128dq_add
168 #define bid128dq_sub __bid128dq_sub
169 #define bid128qd_add __bid128qd_add
170 #define bid128qd_sub __bid128qd_sub
171 #define bid128_sub __bid128_sub
172 #define bid64dq_add __bid64dq_add
173 #define bid64dq_sub __bid64dq_sub
174 #define bid64qd_add __bid64qd_add
175 #define bid64qd_sub __bid64qd_sub
176 #define bid64qq_add __bid64qq_add
177 #define bid64qq_sub __bid64qq_sub
178 #define bid128dd_mul __bid128dd_mul
179 #define bid128dq_mul __bid128dq_mul
180 #define bid128_mul __bid128_mul
181 #define bid128qd_mul __bid128qd_mul
182 #define bid64dq_mul __bid64dq_mul
183 #define bid64qd_mul __bid64qd_mul
184 #define bid64qq_mul __bid64qq_mul
185 #define bid128dd_div __bid128dd_div
186 #define bid128_div __bid128_div
187 #define bid128dq_div __bid128dq_div
188 #define bid128qd_div __bid128qd_div
189 #define bid128d_sqrt __bid128d_sqrt
190 #define bid128_sqrt __bid128_sqrt
191 #define bid128ddd_fma __bid128ddd_fma
192 #define bid128ddq_fma __bid128ddq_fma
193 #define bid128dqd_fma __bid128dqd_fma
194 #define bid128dqq_fma __bid128dqq_fma
195 #define bid128_fma __bid128_fma
196 #define bid128qdd_fma __bid128qdd_fma
197 #define bid128qdq_fma __bid128qdq_fma
198 #define bid128qqd_fma __bid128qqd_fma
199 #define bid64ddq_fma __bid64ddq_fma
200 #define bid64dqd_fma __bid64dqd_fma
201 #define bid64dqq_fma __bid64dqq_fma
202 #define bid64qdd_fma __bid64qdd_fma
203 #define bid64qdq_fma __bid64qdq_fma
204 #define bid64qqd_fma __bid64qqd_fma
205 #define bid64qqq_fma __bid64qqq_fma
206 #define bid128_round_integral_exact __bid128_round_integral_exact
207 #define bid128_round_integral_nearest_away __bid128_round_integral_nearest_away
208 #define bid128_round_integral_nearest_even __bid128_round_integral_nearest_even
209 #define bid128_round_integral_negative __bid128_round_integral_negative
210 #define bid128_round_integral_positive __bid128_round_integral_positive
211 #define bid128_round_integral_zero __bid128_round_integral_zero
212 #define bid64_round_integral_exact __bid64_round_integral_exact
213 #define bid64_round_integral_nearest_away __bid64_round_integral_nearest_away
214 #define bid64_round_integral_nearest_even __bid64_round_integral_nearest_even
215 #define bid64_round_integral_negative __bid64_round_integral_negative
216 #define bid64_round_integral_positive __bid64_round_integral_positive
217 #define bid64_round_integral_zero __bid64_round_integral_zero
218 #define bid128_quantize __bid128_quantize
219 #define bid128_scalb __bid128_scalb
220 #define bid64_maxnum __bid64_maxnum
221 #define bid64_maxnum_mag __bid64_maxnum_mag
222 #define bid64_minnum __bid64_minnum
223 #define bid64_minnum_mag __bid64_minnum_mag
224 #define bid128_maxnum __bid128_maxnum
225 #define bid128_maxnum_mag __bid128_maxnum_mag
226 #define bid128_minnum __bid128_minnum
227 #define bid128_minnum_mag __bid128_minnum_mag
228 #define bid128_rem __bid128_rem
229 #define bid128_logb __bid128_logb
230 #define getDecimalRoundingDirection __bid_getDecimalRoundingDirection
231 #define is754 __bid_is754
232 #define is754R __bid_is754R
233 #define signalException __bid_signalException
234 #define lowerFlags __bid_lowerFlags
235 #define restoreFlags __bid_restoreFlags
236 #define saveFlags __bid_saveFlags
237 #define setDecimalRoundingDirection __bid_setDecimalRoundingDirection
238 #define testFlags __bid_testFlags
239 #define testSavedFlags __bid_testSavedFlags
240 #define bid32_to_bid64 __bid32_to_bid64
241 #define bid64_to_bid32 __bid64_to_bid32
242 #define bid128_to_string __bid128_to_string
243 #define mod10_18_tbl __bid_mod10_18_tbl
244 #define bid128_to_bid32 __bid128_to_bid32
245 #define bid32_to_bid128 __bid32_to_bid128
246 #define bid128_to_bid64 __bid128_to_bid64
247 #define bid64_to_bid128 __bid64_to_bid128
248 #define bid128_from_string __bid128_from_string
249 #define bid128_from_int32 __bid128_from_int32
250 #define bid128_from_int64 __bid128_from_int64
251 #define bid128_from_uint32 __bid128_from_uint32
252 #define bid128_from_uint64 __bid128_from_uint64
253 #define bid64_from_int32 __bid64_from_int32
254 #define bid64_from_int64 __bid64_from_int64
255 #define bid64_from_uint32 __bid64_from_uint32
256 #define bid64_from_uint64 __bid64_from_uint64
257 #define bid64_abs __bid64_abs
258 #define bid64_class __bid64_class
259 #define bid64_copy __bid64_copy
260 #define bid64_copySign __bid64_copySign
261 #define bid64_isCanonical __bid64_isCanonical
262 #define bid64_isFinite __bid64_isFinite
263 #define bid64_isInf __bid64_isInf
264 #define bid64_isNaN __bid64_isNaN
265 #define bid64_isNormal __bid64_isNormal
266 #define bid64_isSignaling __bid64_isSignaling
267 #define bid64_isSigned __bid64_isSigned
268 #define bid64_isSubnormal __bid64_isSubnormal
269 #define bid64_isZero __bid64_isZero
270 #define bid64_negate __bid64_negate
271 #define bid64_radix __bid64_radix
272 #define bid64_sameQuantum __bid64_sameQuantum
273 #define bid64_totalOrder __bid64_totalOrder
274 #define bid64_totalOrderMag __bid64_totalOrderMag
275 #define bid128_abs __bid128_abs
276 #define bid128_class __bid128_class
277 #define bid128_copy __bid128_copy
278 #define bid128_copySign __bid128_copySign
279 #define bid128_isCanonical __bid128_isCanonical
280 #define bid128_isFinite __bid128_isFinite
281 #define bid128_isInf __bid128_isInf
282 #define bid128_isNaN __bid128_isNaN
283 #define bid128_isNormal __bid128_isNormal
284 #define bid128_isSignaling __bid128_isSignaling
285 #define bid128_isSigned __bid128_isSigned
286 #define bid128_isSubnormal __bid128_isSubnormal
287 #define bid128_isZero __bid128_isZero
288 #define bid128_negate __bid128_negate
289 #define bid128_radix __bid128_radix
290 #define bid128_sameQuantum __bid128_sameQuantum
291 #define bid128_totalOrder __bid128_totalOrder
292 #define bid128_totalOrderMag __bid128_totalOrderMag
293 #define bid64_quiet_equal __bid64_quiet_equal
294 #define bid64_quiet_greater __bid64_quiet_greater
295 #define bid64_quiet_greater_equal __bid64_quiet_greater_equal
296 #define bid64_quiet_greater_unordered __bid64_quiet_greater_unordered
297 #define bid64_quiet_less __bid64_quiet_less
298 #define bid64_quiet_less_equal __bid64_quiet_less_equal
299 #define bid64_quiet_less_unordered __bid64_quiet_less_unordered
300 #define bid64_quiet_not_equal __bid64_quiet_not_equal
301 #define bid64_quiet_not_greater __bid64_quiet_not_greater
302 #define bid64_quiet_not_less __bid64_quiet_not_less
303 #define bid64_quiet_ordered __bid64_quiet_ordered
304 #define bid64_quiet_unordered __bid64_quiet_unordered
305 #define bid64_signaling_greater __bid64_signaling_greater
306 #define bid64_signaling_greater_equal __bid64_signaling_greater_equal
307 #define bid64_signaling_greater_unordered __bid64_signaling_greater_unordered
308 #define bid64_signaling_less __bid64_signaling_less
309 #define bid64_signaling_less_equal __bid64_signaling_less_equal
310 #define bid64_signaling_less_unordered __bid64_signaling_less_unordered
311 #define bid64_signaling_not_greater __bid64_signaling_not_greater
312 #define bid64_signaling_not_less __bid64_signaling_not_less
313 #define bid128_quiet_equal __bid128_quiet_equal
314 #define bid128_quiet_greater __bid128_quiet_greater
315 #define bid128_quiet_greater_equal __bid128_quiet_greater_equal
316 #define bid128_quiet_greater_unordered __bid128_quiet_greater_unordered
317 #define bid128_quiet_less __bid128_quiet_less
318 #define bid128_quiet_less_equal __bid128_quiet_less_equal
319 #define bid128_quiet_less_unordered __bid128_quiet_less_unordered
320 #define bid128_quiet_not_equal __bid128_quiet_not_equal
321 #define bid128_quiet_not_greater __bid128_quiet_not_greater
322 #define bid128_quiet_not_less __bid128_quiet_not_less
323 #define bid128_quiet_ordered __bid128_quiet_ordered
324 #define bid128_quiet_unordered __bid128_quiet_unordered
325 #define bid128_signaling_greater __bid128_signaling_greater
326 #define bid128_signaling_greater_equal __bid128_signaling_greater_equal
327 #define bid128_signaling_greater_unordered __bid128_signaling_greater_unordered
328 #define bid128_signaling_less __bid128_signaling_less
329 #define bid128_signaling_less_equal __bid128_signaling_less_equal
330 #define bid128_signaling_less_unordered __bid128_signaling_less_unordered
331 #define bid128_signaling_not_greater __bid128_signaling_not_greater
332 #define bid128_signaling_not_less __bid128_signaling_not_less
333 #define bid64_to_int32_ceil __bid64_to_int32_ceil
334 #define bid64_to_int32_floor __bid64_to_int32_floor
335 #define bid64_to_int32_int __bid64_to_int32_int
336 #define bid64_to_int32_rnint __bid64_to_int32_rnint
337 #define bid64_to_int32_rninta __bid64_to_int32_rninta
338 #define bid64_to_int32_xceil __bid64_to_int32_xceil
339 #define bid64_to_int32_xfloor __bid64_to_int32_xfloor
340 #define bid64_to_int32_xint __bid64_to_int32_xint
341 #define bid64_to_int32_xrnint __bid64_to_int32_xrnint
342 #define bid64_to_int32_xrninta __bid64_to_int32_xrninta
343 #define bid64_to_uint32_ceil __bid64_to_uint32_ceil
344 #define bid64_to_uint32_floor __bid64_to_uint32_floor
345 #define bid64_to_uint32_int __bid64_to_uint32_int
346 #define bid64_to_uint32_rnint __bid64_to_uint32_rnint
347 #define bid64_to_uint32_rninta __bid64_to_uint32_rninta
348 #define bid64_to_uint32_xceil __bid64_to_uint32_xceil
349 #define bid64_to_uint32_xfloor __bid64_to_uint32_xfloor
350 #define bid64_to_uint32_xint __bid64_to_uint32_xint
351 #define bid64_to_uint32_xrnint __bid64_to_uint32_xrnint
352 #define bid64_to_uint32_xrninta __bid64_to_uint32_xrninta
353 #define bid64_to_int64_ceil __bid64_to_int64_ceil
354 #define bid64_to_int64_floor __bid64_to_int64_floor
355 #define bid64_to_int64_int __bid64_to_int64_int
356 #define bid64_to_int64_rnint __bid64_to_int64_rnint
357 #define bid64_to_int64_rninta __bid64_to_int64_rninta
358 #define bid64_to_int64_xceil __bid64_to_int64_xceil
359 #define bid64_to_int64_xfloor __bid64_to_int64_xfloor
360 #define bid64_to_int64_xint __bid64_to_int64_xint
361 #define bid64_to_int64_xrnint __bid64_to_int64_xrnint
362 #define bid64_to_int64_xrninta __bid64_to_int64_xrninta
363 #define bid64_to_uint64_ceil __bid64_to_uint64_ceil
364 #define bid64_to_uint64_floor __bid64_to_uint64_floor
365 #define bid64_to_uint64_int __bid64_to_uint64_int
366 #define bid64_to_uint64_rnint __bid64_to_uint64_rnint
367 #define bid64_to_uint64_rninta __bid64_to_uint64_rninta
368 #define bid64_to_uint64_xceil __bid64_to_uint64_xceil
369 #define bid64_to_uint64_xfloor __bid64_to_uint64_xfloor
370 #define bid64_to_uint64_xint __bid64_to_uint64_xint
371 #define bid64_to_uint64_xrnint __bid64_to_uint64_xrnint
372 #define bid64_to_uint64_xrninta __bid64_to_uint64_xrninta
373 #define bid128_to_int32_ceil __bid128_to_int32_ceil
374 #define bid128_to_int32_floor __bid128_to_int32_floor
375 #define bid128_to_int32_int __bid128_to_int32_int
376 #define bid128_to_int32_rnint __bid128_to_int32_rnint
377 #define bid128_to_int32_rninta __bid128_to_int32_rninta
378 #define bid128_to_int32_xceil __bid128_to_int32_xceil
379 #define bid128_to_int32_xfloor __bid128_to_int32_xfloor
380 #define bid128_to_int32_xint __bid128_to_int32_xint
381 #define bid128_to_int32_xrnint __bid128_to_int32_xrnint
382 #define bid128_to_int32_xrninta __bid128_to_int32_xrninta
383 #define bid128_to_uint32_ceil __bid128_to_uint32_ceil
384 #define bid128_to_uint32_floor __bid128_to_uint32_floor
385 #define bid128_to_uint32_int __bid128_to_uint32_int
386 #define bid128_to_uint32_rnint __bid128_to_uint32_rnint
387 #define bid128_to_uint32_rninta __bid128_to_uint32_rninta
388 #define bid128_to_uint32_xceil __bid128_to_uint32_xceil
389 #define bid128_to_uint32_xfloor __bid128_to_uint32_xfloor
390 #define bid128_to_uint32_xint __bid128_to_uint32_xint
391 #define bid128_to_uint32_xrnint __bid128_to_uint32_xrnint
392 #define bid128_to_uint32_xrninta __bid128_to_uint32_xrninta
393 #define bid128_to_int64_ceil __bid128_to_int64_ceil
394 #define bid128_to_int64_floor __bid128_to_int64_floor
395 #define bid128_to_int64_int __bid128_to_int64_int
396 #define bid128_to_int64_rnint __bid128_to_int64_rnint
397 #define bid128_to_int64_rninta __bid128_to_int64_rninta
398 #define bid128_to_int64_xceil __bid128_to_int64_xceil
399 #define bid128_to_int64_xfloor __bid128_to_int64_xfloor
400 #define bid128_to_int64_xint __bid128_to_int64_xint
401 #define bid128_to_int64_xrnint __bid128_to_int64_xrnint
402 #define bid128_to_int64_xrninta __bid128_to_int64_xrninta
403 #define bid128_to_uint64_ceil __bid128_to_uint64_ceil
404 #define bid128_to_uint64_floor __bid128_to_uint64_floor
405 #define bid128_to_uint64_int __bid128_to_uint64_int
406 #define bid128_to_uint64_rnint __bid128_to_uint64_rnint
407 #define bid128_to_uint64_rninta __bid128_to_uint64_rninta
408 #define bid128_to_uint64_xceil __bid128_to_uint64_xceil
409 #define bid128_to_uint64_xfloor __bid128_to_uint64_xfloor
410 #define bid128_to_uint64_xint __bid128_to_uint64_xint
411 #define bid128_to_uint64_xrnint __bid128_to_uint64_xrnint
412 #define bid128_to_uint64_xrninta __bid128_to_uint64_xrninta
413 #define bid128_to_binary128 __bid128_to_binary128
414 #define bid128_to_binary32 __bid128_to_binary32
415 #define bid128_to_binary64 __bid128_to_binary64
416 #define bid128_to_binary80 __bid128_to_binary80
417 #define bid32_to_binary128 __bid32_to_binary128
418 #define bid32_to_binary32 __bid32_to_binary32
419 #define bid32_to_binary64 __bid32_to_binary64
420 #define bid32_to_binary80 __bid32_to_binary80
421 #define bid64_to_binary128 __bid64_to_binary128
422 #define bid64_to_binary32 __bid64_to_binary32
423 #define bid64_to_binary64 __bid64_to_binary64
424 #define bid64_to_binary80 __bid64_to_binary80
425 #define binary128_to_bid128 __binary128_to_bid128
426 #define binary128_to_bid32 __binary128_to_bid32
427 #define binary128_to_bid64 __binary128_to_bid64
428 #define binary32_to_bid128 __binary32_to_bid128
429 #define binary32_to_bid32 __binary32_to_bid32
430 #define binary32_to_bid64 __binary32_to_bid64
431 #define binary64_to_bid128 __binary64_to_bid128
432 #define binary64_to_bid32 __binary64_to_bid32
433 #define binary64_to_bid64 __binary64_to_bid64
434 #define binary80_to_bid128 __binary80_to_bid128
435 #define binary80_to_bid32 __binary80_to_bid32
436 #define binary80_to_bid64 __binary80_to_bid64
437 #define bid64_to_uint16_ceil __bid64_to_uint16_ceil
438 #define bid64_to_uint16_floor __bid64_to_uint16_floor
439 #define bid64_to_uint16_int __bid64_to_uint16_int
440 #define bid64_to_uint16_rnint __bid64_to_uint16_rnint
441 #define bid64_to_uint16_rninta __bid64_to_uint16_rninta
442 #define bid64_to_uint16_xceil __bid64_to_uint16_xceil
443 #define bid64_to_uint16_xfloor __bid64_to_uint16_xfloor
444 #define bid64_to_uint16_xint __bid64_to_uint16_xint
445 #define bid64_to_uint16_xrnint __bid64_to_uint16_xrnint
446 #define bid64_to_uint16_xrninta __bid64_to_uint16_xrninta
447 #define bid64_to_int16_ceil __bid64_to_int16_ceil
448 #define bid64_to_int16_floor __bid64_to_int16_floor
449 #define bid64_to_int16_int __bid64_to_int16_int
450 #define bid64_to_int16_rnint __bid64_to_int16_rnint
451 #define bid64_to_int16_rninta __bid64_to_int16_rninta
452 #define bid64_to_int16_xceil __bid64_to_int16_xceil
453 #define bid64_to_int16_xfloor __bid64_to_int16_xfloor
454 #define bid64_to_int16_xint __bid64_to_int16_xint
455 #define bid64_to_int16_xrnint __bid64_to_int16_xrnint
456 #define bid64_to_int16_xrninta __bid64_to_int16_xrninta
457 #define bid128_to_uint16_ceil __bid128_to_uint16_ceil
458 #define bid128_to_uint16_floor __bid128_to_uint16_floor
459 #define bid128_to_uint16_int __bid128_to_uint16_int
460 #define bid128_to_uint16_rnint __bid128_to_uint16_rnint
461 #define bid128_to_uint16_rninta __bid128_to_uint16_rninta
462 #define bid128_to_uint16_xceil __bid128_to_uint16_xceil
463 #define bid128_to_uint16_xfloor __bid128_to_uint16_xfloor
464 #define bid128_to_uint16_xint __bid128_to_uint16_xint
465 #define bid128_to_uint16_xrnint __bid128_to_uint16_xrnint
466 #define bid128_to_uint16_xrninta __bid128_to_uint16_xrninta
467 #define bid128_to_int16_ceil __bid128_to_int16_ceil
468 #define bid128_to_int16_floor __bid128_to_int16_floor
469 #define bid128_to_int16_int __bid128_to_int16_int
470 #define bid128_to_int16_rnint __bid128_to_int16_rnint
471 #define bid128_to_int16_rninta __bid128_to_int16_rninta
472 #define bid128_to_int16_xceil __bid128_to_int16_xceil
473 #define bid128_to_int16_xfloor __bid128_to_int16_xfloor
474 #define bid128_to_int16_xint __bid128_to_int16_xint
475 #define bid128_to_int16_xrnint __bid128_to_int16_xrnint
476 #define bid128_to_int16_xrninta __bid128_to_int16_xrninta
477 #define bid64_to_uint8_ceil __bid64_to_uint8_ceil
478 #define bid64_to_uint8_floor __bid64_to_uint8_floor
479 #define bid64_to_uint8_int __bid64_to_uint8_int
480 #define bid64_to_uint8_rnint __bid64_to_uint8_rnint
481 #define bid64_to_uint8_rninta __bid64_to_uint8_rninta
482 #define bid64_to_uint8_xceil __bid64_to_uint8_xceil
483 #define bid64_to_uint8_xfloor __bid64_to_uint8_xfloor
484 #define bid64_to_uint8_xint __bid64_to_uint8_xint
485 #define bid64_to_uint8_xrnint __bid64_to_uint8_xrnint
486 #define bid64_to_uint8_xrninta __bid64_to_uint8_xrninta
487 #define bid64_to_int8_ceil __bid64_to_int8_ceil
488 #define bid64_to_int8_floor __bid64_to_int8_floor
489 #define bid64_to_int8_int __bid64_to_int8_int
490 #define bid64_to_int8_rnint __bid64_to_int8_rnint
491 #define bid64_to_int8_rninta __bid64_to_int8_rninta
492 #define bid64_to_int8_xceil __bid64_to_int8_xceil
493 #define bid64_to_int8_xfloor __bid64_to_int8_xfloor
494 #define bid64_to_int8_xint __bid64_to_int8_xint
495 #define bid64_to_int8_xrnint __bid64_to_int8_xrnint
496 #define bid64_to_int8_xrninta __bid64_to_int8_xrninta
497 #define bid128_to_uint8_ceil __bid128_to_uint8_ceil
498 #define bid128_to_uint8_floor __bid128_to_uint8_floor
499 #define bid128_to_uint8_int __bid128_to_uint8_int
500 #define bid128_to_uint8_rnint __bid128_to_uint8_rnint
501 #define bid128_to_uint8_rninta __bid128_to_uint8_rninta
502 #define bid128_to_uint8_xceil __bid128_to_uint8_xceil
503 #define bid128_to_uint8_xfloor __bid128_to_uint8_xfloor
504 #define bid128_to_uint8_xint __bid128_to_uint8_xint
505 #define bid128_to_uint8_xrnint __bid128_to_uint8_xrnint
506 #define bid128_to_uint8_xrninta __bid128_to_uint8_xrninta
507 #define bid128_to_int8_ceil __bid128_to_int8_ceil
508 #define bid128_to_int8_floor __bid128_to_int8_floor
509 #define bid128_to_int8_int __bid128_to_int8_int
510 #define bid128_to_int8_rnint __bid128_to_int8_rnint
511 #define bid128_to_int8_rninta __bid128_to_int8_rninta
512 #define bid128_to_int8_xceil __bid128_to_int8_xceil
513 #define bid128_to_int8_xfloor __bid128_to_int8_xfloor
514 #define bid128_to_int8_xint __bid128_to_int8_xint
515 #define bid128_to_int8_xrnint __bid128_to_int8_xrnint
516 #define bid128_to_int8_xrninta __bid128_to_int8_xrninta
517
518 #ifdef IN_LIBGCC2
519 #if !defined ENABLE_DECIMAL_BID_FORMAT || !ENABLE_DECIMAL_BID_FORMAT
520 #error BID not enabled in libbid
521 #endif
522
523 #ifndef BID_BIG_ENDIAN
524 #define BID_BIG_ENDIAN LIBGCC2_FLOAT_WORDS_BIG_ENDIAN
525 #endif
526
527 #ifndef BID_THREAD
528 #if defined (HAVE_CC_TLS) && defined (USE_TLS)
529 #define BID_THREAD __thread
530 #endif
531 #endif
532
533 #define _intptr_t_defined
534 #define DECIMAL_CALL_BY_REFERENCE 0
535 #define DECIMAL_GLOBAL_ROUNDING 1
536 #define DECIMAL_GLOBAL_ROUNDING_ACCESS_FUNCTIONS 1
537 #define DECIMAL_GLOBAL_EXCEPTION_FLAGS 1
538 #define DECIMAL_GLOBAL_EXCEPTION_FLAGS_ACCESS_FUNCTIONS 1
539 #define BID_HAS_GCC_DECIMAL_INTRINSICS 1
540 #endif /* IN_LIBGCC2 */
541
542 // Configuration Options
543
544 #define SET_STATUS_FLAGS
545
546 #ifndef BID_THREAD
547 #define BID_THREAD
548 #endif
549
550 #ifndef BID_HAS_GCC_DECIMAL_INTRINSICS
551 #define BID_HAS_GCC_DECIMAL_INTRINSICS 0
552 #endif
553
554 #if !defined(WINDOWS) || defined(__INTEL_COMPILER)
555 // #define UNCHANGED_BINARY_STATUS_FLAGS
556 #endif
557 // #define HPUX_OS
558
559 // If DECIMAL_CALL_BY_REFERENCE is defined then numerical arguments and results
560 // are passed by reference otherwise they are passed by value (except that
561 // a pointer is always passed to the status flags)
562
563 #ifndef DECIMAL_CALL_BY_REFERENCE
564 #define DECIMAL_CALL_BY_REFERENCE 0
565 #endif
566
567 // If DECIMAL_GLOBAL_ROUNDING is defined then the rounding mode is a global 
568 // variable _IDEC_glbround, otherwise it is passed as a parameter when needed
569
570 #ifndef DECIMAL_GLOBAL_ROUNDING
571 #define DECIMAL_GLOBAL_ROUNDING 0
572 #endif
573
574 #ifndef DECIMAL_GLOBAL_ROUNDING_ACCESS_FUNCTIONS
575 #define DECIMAL_GLOBAL_ROUNDING_ACCESS_FUNCTIONS 0
576 #endif
577
578 // If DECIMAL_GLOBAL_EXCEPTION_FLAGS is defined then the exception status flags
579 // are represented by a global variable _IDEC_glbflags, otherwise they are 
580 // passed as a parameter when needed
581
582 #ifndef DECIMAL_GLOBAL_EXCEPTION_FLAGS
583 #define DECIMAL_GLOBAL_EXCEPTION_FLAGS 0
584 #endif
585
586 #ifndef DECIMAL_GLOBAL_EXCEPTION_FLAGS_ACCESS_FUNCTIONS
587 #define DECIMAL_GLOBAL_EXCEPTION_FLAGS_ACCESS_FUNCTIONS 0
588 #endif
589
590 // If DECIMAL_ALTERNATE_EXCEPTION_HANDLING is defined then the exception masks
591 // are examined and exception handling information is provided to the caller 
592 // if alternate exception handling is necessary
593
594 #ifndef DECIMAL_ALTERNATE_EXCEPTION_HANDLING
595 #define DECIMAL_ALTERNATE_EXCEPTION_HANDLING 0
596 #endif
597
598 typedef unsigned int _IDEC_round;
599 typedef unsigned int _IDEC_flags;       // could be a struct with diagnostic info
600
601 #if DECIMAL_ALTERNATE_EXCEPTION_HANDLING
602   // If DECIMAL_GLOBAL_EXCEPTION_MASKS is defined then the exception mask bits
603   // are represented by a global variable _IDEC_exceptionmasks, otherwise they
604   // are passed as a parameter when needed; DECIMAL_GLOBAL_EXCEPTION_MASKS is 
605   // ignored
606   // if DECIMAL_ALTERNATE_EXCEPTION_HANDLING is not defined
607   // **************************************************************************
608 #define DECIMAL_GLOBAL_EXCEPTION_MASKS 0
609   // **************************************************************************
610
611   // If DECIMAL_GLOBAL_EXCEPTION_INFO is defined then the alternate exception  
612   // handling information is represented by a global data structure 
613   // _IDEC_glbexcepthandling, otherwise it is passed by reference as a
614   // parameter when needed; DECIMAL_GLOBAL_EXCEPTION_INFO is ignored
615   // if DECIMAL_ALTERNATE_EXCEPTION_HANDLING is not defined
616   // **************************************************************************
617 #define DECIMAL_GLOBAL_EXCEPTION_INFO 0
618   // **************************************************************************
619 #endif
620
621 // Notes: 1) rnd_mode from _RND_MODE_ARG is used by the caller of a function
622 //           from this library, and can be any name
623 //        2) rnd_mode and prnd_mode from _RND_MODE_PARAM are fixed names 
624 //           and *must* be used in the library functions
625 //        3) _IDEC_glbround is the fixed name for the global variable holding 
626 //           the rounding mode
627
628 #if !DECIMAL_GLOBAL_ROUNDING
629 #if DECIMAL_CALL_BY_REFERENCE
630 #define _RND_MODE_ARG , &rnd_mode
631 #define _RND_MODE_PARAM , _IDEC_round *prnd_mode
632 #define _RND_MODE_ARG_ALONE &rnd_mode
633 #define _RND_MODE_PARAM_ALONE _IDEC_round *prnd_mode
634 #else
635 #define _RND_MODE_ARG , rnd_mode
636 #define _RND_MODE_PARAM , _IDEC_round rnd_mode
637 #define _RND_MODE_ARG_ALONE rnd_mode
638 #define _RND_MODE_PARAM_ALONE _IDEC_round rnd_mode
639 #endif
640 #else
641 #define _RND_MODE_ARG
642 #define _RND_MODE_PARAM
643 #define _RND_MODE_ARG_ALONE
644 #define _RND_MODE_PARAM_ALONE
645 #define rnd_mode _IDEC_glbround
646 #endif
647
648 // Notes: 1) pfpsf from _EXC_FLAGS_ARG is used by the caller of a function
649 //           from this library, and can be any name 
650 //        2) pfpsf from _EXC_FLAGS_PARAM is a fixed name and *must* be used  
651 //           in the library functions
652 //        3) _IDEC_glbflags is the fixed name for the global variable holding 
653 //           the floating-point status flags
654 #if !DECIMAL_GLOBAL_EXCEPTION_FLAGS
655 #define _EXC_FLAGS_ARG , pfpsf
656 #define _EXC_FLAGS_PARAM , _IDEC_flags *pfpsf
657 #else
658 #define _EXC_FLAGS_ARG
659 #define _EXC_FLAGS_PARAM
660 #define pfpsf &_IDEC_glbflags
661 #endif
662
663 #if DECIMAL_GLOBAL_ROUNDING
664 extern BID_THREAD _IDEC_round _IDEC_glbround;
665 #endif
666
667 #if DECIMAL_GLOBAL_EXCEPTION_FLAGS
668 extern BID_THREAD _IDEC_flags _IDEC_glbflags;
669 #endif
670
671 #if DECIMAL_ALTERNATE_EXCEPTION_HANDLING
672 #if DECIMAL_GLOBAL_EXCEPTION_MASKS
673 extern BID_THREAD _IDEC_exceptionmasks _IDEC_glbexceptionmasks;
674 #endif
675 #if DECIMAL_GLOBAL_EXCEPTION_INFO
676 extern BID_THREAD _IDEC_excepthandling _IDEC_glbexcepthandling;
677 #endif
678 #endif
679
680 #if DECIMAL_ALTERNATE_EXCEPTION_HANDLING
681
682   // Notes: 1) exc_mask from _EXC_MASKS_ARG is used by the caller of a function
683   //           from this library, and can be any name
684   //        2) exc_mask and pexc_mask from _EXC_MASKS_PARAM are fixed names
685   //           and *must* be used in the library functions
686   //        3) _IDEC_glbexceptionmasks is the fixed name for the global 
687   //           variable holding the floating-point exception masks
688 #if !DECIMAL_GLOBAL_EXCEPTION_MASKS
689 #if DECIMAL_CALL_BY_REFERENCE
690 #define _EXC_MASKS_ARG , &exc_mask
691 #define _EXC_MASKS_PARAM , _IDEC_exceptionmasks *pexc_mask
692 #else
693 #define _EXC_MASKS_ARG , exc_mask
694 #define _EXC_MASKS_PARAM , _IDEC_exceptionmasks exc_mask
695 #endif
696 #else
697 #define _EXC_MASKS_ARG
698 #define _EXC_MASKS_PARAM
699 #define exc_mask _IDEC_glbexceptionmasks
700 #endif
701
702   // Notes: 1) pexc_info from _EXC_INFO_ARG is used by the caller of a function
703   //           from this library, and can be any name
704   //        2) pexc_info from _EXC_INFO_PARAM is a fixed name and *must* be  
705   //           used in the library functions
706   //        3) _IDEC_glbexcepthandling is the fixed name for the global  
707   //           variable holding the floating-point exception information
708 #if !DECIMAL_GLOBAL_EXCEPTION_INFO
709 #define _EXC_INFO_ARG , pexc_info
710 #define _EXC_INFO_PARAM , _IDEC_excepthandling *pexc_info
711 #else
712 #define _EXC_INFO_ARG
713 #define _EXC_INFO_PARAM
714 #define pexc_info &_IDEC_glbexcepthandling
715 #endif
716 #else
717 #define _EXC_MASKS_ARG
718 #define _EXC_MASKS_PARAM
719 #define _EXC_INFO_ARG
720 #define _EXC_INFO_PARAM
721 #endif
722
723
724 #ifndef BID_BIG_ENDIAN
725 #define BID_BIG_ENDIAN 0
726 #endif
727
728 #if BID_BIG_ENDIAN
729 #define BID_SWAP128(x) {  \
730   UINT64 sw;              \
731   sw = (x).w[1];          \
732   (x).w[1] = (x).w[0];    \
733   (x).w[0] = sw;          \
734   }
735 #else
736 #define BID_SWAP128(x)
737 #endif
738
739 #if DECIMAL_CALL_BY_REFERENCE
740 #define BID_RETURN_VAL(x) { *pres = (x); return; }
741 #if BID_BIG_ENDIAN && defined BID_128RES
742 #define BID_RETURN(x) { BID_SWAP128(x); *pres = (x); return; }
743 #else
744 #define BID_RETURN(x) { *pres = (x); return; }
745 #endif
746 #else
747 #define BID_RETURN_VAL(x) return(x);
748 #if BID_BIG_ENDIAN && defined BID_128RES
749 #define BID_RETURN(x) { BID_SWAP128(x); return(x); }
750 #else
751 #define BID_RETURN(x) return(x);
752 #endif
753 #endif
754
755 #if DECIMAL_CALL_BY_REFERENCE
756 #define BIDECIMAL_CALL1(_FUNC, _RES, _OP1) \
757     _FUNC(&(_RES), &(_OP1) _RND_MODE_ARG _EXC_FLAGS_ARG _EXC_MASKS_ARG _EXC_INFO_ARG)
758 #define BIDECIMAL_CALL1_NORND(_FUNC, _RES, _OP1) \
759     _FUNC(&(_RES), &(_OP1) _EXC_FLAGS_ARG _EXC_MASKS_ARG _EXC_INFO_ARG)
760 #define BIDECIMAL_CALL2(_FUNC, _RES, _OP1, _OP2) \
761     _FUNC(&(_RES), &(_OP1), &(_OP2) _RND_MODE_ARG _EXC_FLAGS_ARG _EXC_MASKS_ARG _EXC_INFO_ARG)
762 #define BIDECIMAL_CALL2_NORND(_FUNC, _RES, _OP1, _OP2) \
763     _FUNC(&(_RES), &(_OP1), &(_OP2) _EXC_FLAGS_ARG _EXC_MASKS_ARG _EXC_INFO_ARG)
764 #define BIDECIMAL_CALL1_NORND_RESREF(_FUNC, _RES, _OP1) \
765     _FUNC((_RES), &(_OP1) _EXC_FLAGS_ARG _EXC_MASKS_ARG _EXC_INFO_ARG)
766 #define BIDECIMAL_CALL1_RESARG(_FUNC, _RES, _OP1) \
767     _FUNC(&(_RES), (_OP1) _RND_MODE_ARG _EXC_FLAGS_ARG _EXC_MASKS_ARG _EXC_INFO_ARG)
768 #define BIDECIMAL_CALL1_RESREF(_FUNC, _RES, _OP1) \
769     _FUNC((_RES), &(_OP1) _RND_MODE_ARG _EXC_FLAGS_ARG _EXC_MASKS_ARG _EXC_INFO_ARG)
770 #define BIDECIMAL_CALL1_NORND_NOSTAT(_FUNC, _RES, _OP1) \
771     _FUNC(&(_RES), &(_OP1) _EXC_MASKS_ARG _EXC_INFO_ARG)
772 #define BIDECIMAL_CALL2_NORND_NOSTAT(_FUNC, _RES, _OP1, _OP2) \
773     _FUNC(&(_RES), &(_OP1), &(_OP2) _EXC_MASKS_ARG _EXC_INFO_ARG)
774 #define BIDECIMAL_CALL3(_FUNC, _RES, _OP1, _OP2, _OP3) \
775     _FUNC(&(_RES), &(_OP1), &(_OP2), &(_OP3) _RND_MODE_ARG _EXC_FLAGS_ARG _EXC_MASKS_ARG _EXC_INFO_ARG)
776 #define BIDECIMAL_CALL1_NORND_NOMASK_NOINFO(_FUNC, _RES, _OP1) \
777     _FUNC(&(_RES), &(_OP1) _EXC_FLAGS_ARG )
778 #define BIDECIMAL_CALL1_NORND_NOFLAGS_NOMASK_NOINFO(_FUNC, _RES, _OP1) \
779     _FUNC(&(_RES), &(_OP1) )
780 #define BIDECIMAL_CALL2_NORND_NOFLAGS_NOMASK_NOINFO(_FUNC, _RES, _OP1, _OP2) \
781     _FUNC(&(_RES), &(_OP1), &(_OP2) )
782 #define BIDECIMAL_CALL1_NORND_NOMASK_NOINFO_RESVOID(_FUNC, _OP1) \
783     _FUNC(&(_OP1) _EXC_FLAGS_ARG )
784 #define BIDECIMAL_CALL2_NORND_NOMASK_NOINFO_RESVOID(_FUNC, _OP1, _OP2) \
785     _FUNC(&(_OP1), &(_OP2) _EXC_FLAGS_ARG )
786 #define BIDECIMAL_CALLV_NOFLAGS_NOMASK_NOINFO(_FUNC, _RES) \
787     _FUNC(&(_RES) _RND_MODE_ARG)
788 #define BIDECIMAL_CALL1_NOFLAGS_NOMASK_NOINFO(_FUNC, _RES, _OP1) \
789     _FUNC(&(_OP1) _RND_MODE_ARG)
790 #else
791 #define BIDECIMAL_CALL1(_FUNC, _RES, _OP1) \
792     _RES = _FUNC((_OP1) _RND_MODE_ARG _EXC_FLAGS_ARG _EXC_MASKS_ARG _EXC_INFO_ARG)
793 #define BIDECIMAL_CALL1_NORND(_FUNC, _RES, _OP1) \
794     _RES = _FUNC((_OP1) _EXC_FLAGS_ARG _EXC_MASKS_ARG _EXC_INFO_ARG)
795 #define BIDECIMAL_CALL2(_FUNC, _RES, _OP1, _OP2) \
796     _RES = _FUNC((_OP1), (_OP2) _RND_MODE_ARG _EXC_FLAGS_ARG _EXC_MASKS_ARG _EXC_INFO_ARG)
797 #define BIDECIMAL_CALL2_NORND(_FUNC, _RES, _OP1, _OP2) \
798     _RES = _FUNC((_OP1), (_OP2) _EXC_FLAGS_ARG _EXC_MASKS_ARG _EXC_INFO_ARG)
799 #define BIDECIMAL_CALL1_NORND_RESREF(_FUNC, _RES, _OP1) \
800     _FUNC((_RES), _OP1 _EXC_FLAGS_ARG _EXC_MASKS_ARG _EXC_INFO_ARG)
801 #define BIDECIMAL_CALL1_RESARG(_FUNC, _RES, _OP1) \
802     _RES = _FUNC((_OP1) _RND_MODE_ARG _EXC_FLAGS_ARG _EXC_MASKS_ARG _EXC_INFO_ARG)
803 #define BIDECIMAL_CALL1_RESREF(_FUNC, _RES, _OP1) \
804     _FUNC((_RES), _OP1 _RND_MODE_ARG _EXC_FLAGS_ARG _EXC_MASKS_ARG _EXC_INFO_ARG)
805 #define BIDECIMAL_CALL1_NORND_NOSTAT(_FUNC, _RES, _OP1) \
806     _RES = _FUNC((_OP1) _EXC_MASKS_ARG _EXC_INFO_ARG)
807 #define BIDECIMAL_CALL2_NORND_NOSTAT(_FUNC, _RES, _OP1, _OP2) \
808     _RES = _FUNC((_OP1), (_OP2) _EXC_MASKS_ARG _EXC_INFO_ARG)
809 #define BIDECIMAL_CALL3(_FUNC, _RES, _OP1, _OP2, _OP3) \
810     _RES = _FUNC((_OP1), (_OP2), (_OP3) _RND_MODE_ARG _EXC_FLAGS_ARG _EXC_MASKS_ARG _EXC_INFO_ARG)
811 #define BIDECIMAL_CALL1_NORND_NOMASK_NOINFO(_FUNC, _RES, _OP1) \
812     _RES = _FUNC((_OP1) _EXC_FLAGS_ARG)
813 #define BIDECIMAL_CALL1_NORND_NOFLAGS_NOMASK_NOINFO(_FUNC, _RES, _OP1) \
814     _RES = _FUNC((_OP1) )
815 #define BIDECIMAL_CALL2_NORND_NOFLAGS_NOMASK_NOINFO(_FUNC, _RES, _OP1, _OP2) \
816     _RES = _FUNC((_OP1), (_OP2) )
817 #define BIDECIMAL_CALL1_NORND_NOMASK_NOINFO_RESVOID(_FUNC, _OP1) \
818     _FUNC((_OP1) _EXC_FLAGS_ARG)
819 #define BIDECIMAL_CALL2_NORND_NOMASK_NOINFO_RESVOID(_FUNC, _OP1, _OP2) \
820     _FUNC((_OP1), (_OP2) _EXC_FLAGS_ARG)
821 #define BIDECIMAL_CALLV_NOFLAGS_NOMASK_NOINFO(_FUNC, _RES) \
822     _RES = _FUNC(_RND_MODE_ARG_ALONE)
823 #if !DECIMAL_GLOBAL_ROUNDING
824 #define BIDECIMAL_CALL1_NOFLAGS_NOMASK_NOINFO(_FUNC, _RES, _OP1) \
825     _RES = _FUNC((_OP1) _RND_MODE_ARG)
826 #else
827 #define BIDECIMAL_CALL1_NOFLAGS_NOMASK_NOINFO(_FUNC, _RES, _OP1) \
828     _FUNC((_OP1) _RND_MODE_ARG)
829 #endif
830 #endif
831
832 #if BID_BIG_ENDIAN
833 #define HIGH_128W 0
834 #define LOW_128W  1
835 #else
836 #define HIGH_128W 1
837 #define LOW_128W  0
838 #endif
839
840 #if BID_BIG_ENDIAN
841 #define COPY_ARG_REF(arg_name) \
842        UINT128 arg_name={ pbid_##arg_name->w[1], pbid_##arg_name->w[0]};
843 #define COPY_ARG_VAL(arg_name) \
844        UINT128 arg_name={ bid_##arg_name.w[1], bid_##arg_name.w[0]};
845 #else
846 #define COPY_ARG_REF(arg_name) \
847        UINT128 arg_name=*pbid_##arg_name;
848 #define COPY_ARG_VAL(arg_name) \
849        UINT128 arg_name= bid_##arg_name;
850 #endif
851
852 #define COPY_ARG_TYPE_REF(type, arg_name) \
853        type arg_name=*pbid_##arg_name;
854 #define COPY_ARG_TYPE_VAL(type, arg_name) \
855        type arg_name= bid_##arg_name;
856
857 #if !DECIMAL_GLOBAL_ROUNDING
858 #define SET_RND_MODE() \
859   _IDEC_round rnd_mode = *prnd_mode;
860 #else
861 #define SET_RND_MODE()
862 #endif
863
864 #define PROLOG_REF(arg_name) \
865        COPY_ARG_REF(arg_name)
866
867 #define PROLOG_VAL(arg_name) \
868        COPY_ARG_VAL(arg_name)
869
870 #define PROLOG_TYPE_REF(type, arg_name) \
871        COPY_ARG_TYPE_REF(type, arg_name)
872
873 #define PROLOG_TYPE_VAL(type, arg_name) \
874       COPY_ARG_TYPE_VAL(type, arg_name)
875
876 #define OTHER_PROLOG_REF()
877 #define OTHER_PROLOG_VAL()
878
879 #if DECIMAL_CALL_BY_REFERENCE
880 #define       BID128_FUNCTION_ARG1(fn_name, arg_name)\
881       void fn_name (UINT128 * pres, \
882            UINT128 *  \
883            pbid_##arg_name _RND_MODE_PARAM _EXC_FLAGS_PARAM _EXC_MASKS_PARAM \
884            _EXC_INFO_PARAM) {\
885      PROLOG_REF(arg_name)   \
886      SET_RND_MODE()         \
887      OTHER_PROLOG_REF()
888
889 #define       BID128_FUNCTION_ARG1_NORND(fn_name, arg_name)\
890       void fn_name (UINT128 * pres, \
891            UINT128 *  \
892            pbid_##arg_name _EXC_FLAGS_PARAM _EXC_MASKS_PARAM \
893            _EXC_INFO_PARAM) {\
894      PROLOG_REF(arg_name)   \
895      OTHER_PROLOG_REF()
896
897 #define       BID128_FUNCTION_ARG1_NORND_CUSTOMRESTYPE(restype, fn_name, arg_name)\
898       void fn_name (restype * pres, \
899            UINT128 *  \
900            pbid_##arg_name _EXC_FLAGS_PARAM _EXC_MASKS_PARAM \
901            _EXC_INFO_PARAM) {\
902      PROLOG_REF(arg_name)   \
903      OTHER_PROLOG_REF()
904
905 #define       BID128_FUNCTION_ARG2(fn_name, arg_name1, arg_name2)\
906       void fn_name (UINT128 * pres, \
907            UINT128 *pbid_##arg_name1,  UINT128 *pbid_##arg_name2  \
908            _RND_MODE_PARAM _EXC_FLAGS_PARAM _EXC_MASKS_PARAM \
909            _EXC_INFO_PARAM) {\
910      PROLOG_REF(arg_name1)   \
911      PROLOG_REF(arg_name2)   \
912      SET_RND_MODE()         \
913      OTHER_PROLOG_REF()
914
915 #define       BID128_FUNCTION_ARG2_NORND_CUSTOMRESTYPE(restype, fn_name, arg_name1, arg_name2)\
916       void fn_name (restype * pres, \
917            UINT128 *pbid_##arg_name1,  UINT128 *pbid_##arg_name2  \
918            _EXC_FLAGS_PARAM _EXC_MASKS_PARAM \
919            _EXC_INFO_PARAM) {\
920      PROLOG_REF(arg_name1)   \
921      PROLOG_REF(arg_name2)   \
922      OTHER_PROLOG_REF()
923
924 #define       BID128_FUNCTION_ARG128_ARGTYPE2(fn_name, arg_name1, type2, arg_name2)\
925       void fn_name (UINT128 * pres, \
926            UINT128 *pbid_##arg_name1,  type2 *pbid_##arg_name2  \
927            _RND_MODE_PARAM _EXC_FLAGS_PARAM _EXC_MASKS_PARAM \
928            _EXC_INFO_PARAM) {\
929      PROLOG_REF(arg_name1)   \
930      PROLOG_TYPE_REF(type2, arg_name2)   \
931      SET_RND_MODE()         \
932      OTHER_PROLOG_REF()
933
934 #define       TYPE0_FUNCTION_ARGTYPE1_ARGTYPE2(type0, fn_name, type1, arg_name1, type2, arg_name2)\
935       void fn_name (type0 *pres, \
936            type1 *pbid_##arg_name1,  type2 *pbid_##arg_name2  \
937            _RND_MODE_PARAM _EXC_FLAGS_PARAM _EXC_MASKS_PARAM \
938            _EXC_INFO_PARAM) {\
939      PROLOG_TYPE_REF(type1, arg_name1)   \
940      PROLOG_TYPE_REF(type2, arg_name2)   \
941      SET_RND_MODE()         \
942      OTHER_PROLOG_REF()
943
944 #define       BID128_FUNCTION_ARGTYPE1_ARG128(fn_name, type1, arg_name1, arg_name2)\
945       void fn_name (UINT128 * pres, \
946            type1 *pbid_##arg_name1,  UINT128 *pbid_##arg_name2  \
947            _RND_MODE_PARAM _EXC_FLAGS_PARAM _EXC_MASKS_PARAM \
948            _EXC_INFO_PARAM) {\
949      PROLOG_TYPE_REF(type1, arg_name1)   \
950      PROLOG_REF(arg_name2)   \
951      SET_RND_MODE()         \
952      OTHER_PROLOG_REF()
953
954 #define       TYPE0_FUNCTION_ARG128_ARGTYPE2(type0, fn_name, arg_name1, type2, arg_name2)\
955       void fn_name (type0 *pres, \
956            UINT128 *pbid_##arg_name1,  type2 *pbid_##arg_name2  \
957            _RND_MODE_PARAM _EXC_FLAGS_PARAM _EXC_MASKS_PARAM \
958            _EXC_INFO_PARAM) {\
959      PROLOG_REF(arg_name1)   \
960      PROLOG_TYPE_REF(type2, arg_name2)   \
961      SET_RND_MODE()         \
962      OTHER_PROLOG_REF()
963
964 #define       TYPE0_FUNCTION_ARGTYPE1_ARG128(type0, fn_name, type1, arg_name1, arg_name2)\
965       void fn_name (type0 *pres, \
966            type1 *pbid_##arg_name1,  UINT128 *pbid_##arg_name2  \
967            _RND_MODE_PARAM _EXC_FLAGS_PARAM _EXC_MASKS_PARAM \
968            _EXC_INFO_PARAM) {\
969      PROLOG_TYPE_REF(type1, arg_name1)   \
970      PROLOG_REF(arg_name2)   \
971      SET_RND_MODE()         \
972      OTHER_PROLOG_REF()
973
974 #define       TYPE0_FUNCTION_ARG128_ARG128(type0, fn_name, arg_name1, arg_name2)\
975       void fn_name (type0 * pres, \
976            UINT128 *pbid_##arg_name1,  UINT128 *pbid_##arg_name2  \
977            _RND_MODE_PARAM _EXC_FLAGS_PARAM _EXC_MASKS_PARAM \
978            _EXC_INFO_PARAM) {\
979      PROLOG_REF(arg_name1)   \
980      PROLOG_REF(arg_name2)   \
981      SET_RND_MODE()         \
982      OTHER_PROLOG_REF()
983
984 #define       TYPE0_FUNCTION_ARG1(type0, fn_name, arg_name)\
985       void fn_name (type0 * pres, \
986            UINT128 *  \
987            pbid_##arg_name _RND_MODE_PARAM _EXC_FLAGS_PARAM _EXC_MASKS_PARAM \
988            _EXC_INFO_PARAM) {\
989      PROLOG_REF(arg_name)   \
990      SET_RND_MODE()         \
991      OTHER_PROLOG_REF()
992
993 #define       BID128_FUNCTION_ARGTYPE1(fn_name, type1, arg_name)\
994       void fn_name (UINT128 * pres, \
995            type1 *  \
996            pbid_##arg_name _RND_MODE_PARAM _EXC_FLAGS_PARAM _EXC_MASKS_PARAM \
997            _EXC_INFO_PARAM) {\
998      PROLOG_TYPE_REF(type1, arg_name)   \
999      SET_RND_MODE()         \
1000      OTHER_PROLOG_REF()
1001
1002 #define       TYPE0_FUNCTION_ARGTYPE1(type0, fn_name, type1, arg_name)\
1003       void fn_name (type0 * pres, \
1004            type1 *  \
1005            pbid_##arg_name _RND_MODE_PARAM _EXC_FLAGS_PARAM _EXC_MASKS_PARAM \
1006            _EXC_INFO_PARAM) {\
1007      PROLOG_TYPE_REF(type1, arg_name)   \
1008      SET_RND_MODE()         \
1009      OTHER_PROLOG_REF()
1010
1011 #define       TYPE0_FUNCTION_ARGTYPE1_NORND(type0, fn_name, type1, arg_name)\
1012       void fn_name (type0 * pres, \
1013            type1 *  \
1014            pbid_##arg_name _EXC_FLAGS_PARAM _EXC_MASKS_PARAM \
1015            _EXC_INFO_PARAM) {\
1016      PROLOG_TYPE_REF(type1, arg_name)   \
1017      OTHER_PROLOG_REF()
1018
1019 //////////////////////////////////////////
1020 /////////////////////////////////////////
1021 ////////////////////////////////////////
1022
1023 #else
1024
1025 //////////////////////////////////////////
1026 /////////////////////////////////////////
1027 ////////////////////////////////////////
1028
1029 #define       BID128_FUNCTION_ARG1(fn_name, arg_name)\
1030      UINT128                                     \
1031      fn_name (UINT128 bid_##arg_name _RND_MODE_PARAM _EXC_FLAGS_PARAM  \
1032            _EXC_MASKS_PARAM _EXC_INFO_PARAM) { \
1033      PROLOG_VAL(arg_name)                      \
1034      OTHER_PROLOG_VAL()
1035
1036 #define       BID128_FUNCTION_ARG1_NORND(fn_name, arg_name)\
1037      UINT128                                     \
1038      fn_name (UINT128 bid_##arg_name _EXC_FLAGS_PARAM  \
1039            _EXC_MASKS_PARAM _EXC_INFO_PARAM) { \
1040      PROLOG_VAL(arg_name)                      \
1041      OTHER_PROLOG_VAL()
1042
1043 #define       BID128_FUNCTION_ARG1_NORND_CUSTOMRESTYPE(restype, fn_name, arg_name)\
1044      restype                                     \
1045      fn_name (UINT128 bid_##arg_name _EXC_FLAGS_PARAM  \
1046            _EXC_MASKS_PARAM _EXC_INFO_PARAM) { \
1047      PROLOG_VAL(arg_name)                      \
1048      OTHER_PROLOG_VAL()
1049
1050 #define       BID128_FUNCTION_ARG2(fn_name, arg_name1, arg_name2)\
1051      UINT128                                     \
1052      fn_name (UINT128 bid_##arg_name1,      \
1053             UINT128 bid_##arg_name2 _RND_MODE_PARAM _EXC_FLAGS_PARAM  \
1054            _EXC_MASKS_PARAM _EXC_INFO_PARAM) {  \
1055      PROLOG_VAL(arg_name1)                      \
1056      PROLOG_VAL(arg_name2)                      \
1057      OTHER_PROLOG_VAL()
1058
1059 #define       BID128_FUNCTION_ARG2_NORND_CUSTOMRESTYPE(restype, fn_name, arg_name1, arg_name2)\
1060      restype                                    \
1061      fn_name (UINT128 bid_##arg_name1,      \
1062             UINT128 bid_##arg_name2 _EXC_FLAGS_PARAM  \
1063            _EXC_MASKS_PARAM _EXC_INFO_PARAM) {  \
1064      PROLOG_VAL(arg_name1)                      \
1065      PROLOG_VAL(arg_name2)                      \
1066      OTHER_PROLOG_VAL()
1067
1068 #define       BID128_FUNCTION_ARG128_ARGTYPE2(fn_name, arg_name1, type2, arg_name2)\
1069      UINT128                                     \
1070      fn_name (UINT128 bid_##arg_name1,      \
1071             type2 bid_##arg_name2 _RND_MODE_PARAM _EXC_FLAGS_PARAM  \
1072            _EXC_MASKS_PARAM _EXC_INFO_PARAM) {  \
1073      PROLOG_VAL(arg_name1)                      \
1074      PROLOG_TYPE_VAL(type2, arg_name2)          \
1075      OTHER_PROLOG_VAL()
1076
1077 #define       TYPE0_FUNCTION_ARGTYPE1_ARGTYPE2(type0, fn_name, type1, arg_name1, type2, arg_name2)\
1078      type0                                     \
1079      fn_name (type1 bid_##arg_name1,      \
1080             type2 bid_##arg_name2 _RND_MODE_PARAM _EXC_FLAGS_PARAM  \
1081            _EXC_MASKS_PARAM _EXC_INFO_PARAM) {  \
1082      PROLOG_TYPE_VAL(type1, arg_name1)                      \
1083      PROLOG_TYPE_VAL(type2, arg_name2)          \
1084      OTHER_PROLOG_VAL()
1085
1086 #define       BID128_FUNCTION_ARGTYPE1_ARG128(fn_name, type1, arg_name1, arg_name2)\
1087      UINT128                                     \
1088      fn_name (type1 bid_##arg_name1,      \
1089             UINT128 bid_##arg_name2 _RND_MODE_PARAM _EXC_FLAGS_PARAM  \
1090            _EXC_MASKS_PARAM _EXC_INFO_PARAM) {  \
1091      PROLOG_TYPE_VAL(type1, arg_name1)          \
1092      PROLOG_VAL(arg_name2)                      \
1093      OTHER_PROLOG_VAL()
1094
1095 #define       TYPE0_FUNCTION_ARG128_ARGTYPE2(type0, fn_name, arg_name1, type2, arg_name2)\
1096      type0                                     \
1097      fn_name (UINT128 bid_##arg_name1,      \
1098             type2 bid_##arg_name2 _RND_MODE_PARAM _EXC_FLAGS_PARAM  \
1099            _EXC_MASKS_PARAM _EXC_INFO_PARAM) {  \
1100      PROLOG_VAL(arg_name1)                      \
1101      PROLOG_TYPE_VAL(type2, arg_name2)          \
1102      OTHER_PROLOG_VAL()
1103
1104 #define       TYPE0_FUNCTION_ARGTYPE1_ARG128(type0, fn_name, type1, arg_name1, arg_name2)\
1105      type0                                     \
1106      fn_name (type1 bid_##arg_name1,      \
1107             UINT128 bid_##arg_name2 _RND_MODE_PARAM _EXC_FLAGS_PARAM  \
1108            _EXC_MASKS_PARAM _EXC_INFO_PARAM) {  \
1109      PROLOG_TYPE_VAL(type1, arg_name1)                      \
1110      PROLOG_VAL(arg_name2)          \
1111      OTHER_PROLOG_VAL()
1112
1113 #define       TYPE0_FUNCTION_ARG128_ARG128(type0, fn_name, arg_name1, arg_name2)\
1114      type0                                     \
1115      fn_name (UINT128 bid_##arg_name1,      \
1116             UINT128 bid_##arg_name2 _RND_MODE_PARAM _EXC_FLAGS_PARAM  \
1117            _EXC_MASKS_PARAM _EXC_INFO_PARAM) {  \
1118      PROLOG_VAL(arg_name1)                      \
1119      PROLOG_VAL(arg_name2)                      \
1120      OTHER_PROLOG_VAL()
1121
1122 #define       TYPE0_FUNCTION_ARG1(type0, fn_name, arg_name)\
1123      type0                                     \
1124      fn_name (UINT128 bid_##arg_name _RND_MODE_PARAM _EXC_FLAGS_PARAM  \
1125            _EXC_MASKS_PARAM _EXC_INFO_PARAM) { \
1126      PROLOG_VAL(arg_name)                      \
1127      OTHER_PROLOG_VAL()
1128
1129 #define       BID128_FUNCTION_ARGTYPE1(fn_name, type1, arg_name)\
1130      UINT128                                     \
1131      fn_name (type1 bid_##arg_name _RND_MODE_PARAM _EXC_FLAGS_PARAM  \
1132            _EXC_MASKS_PARAM _EXC_INFO_PARAM) { \
1133      PROLOG_TYPE_VAL(type1, arg_name)                      \
1134      OTHER_PROLOG_VAL()
1135
1136 #define       TYPE0_FUNCTION_ARGTYPE1(type0, fn_name, type1, arg_name)\
1137      type0                                     \
1138      fn_name (type1 bid_##arg_name _RND_MODE_PARAM _EXC_FLAGS_PARAM  \
1139            _EXC_MASKS_PARAM _EXC_INFO_PARAM) { \
1140      PROLOG_TYPE_VAL(type1, arg_name)                      \
1141      OTHER_PROLOG_VAL()
1142
1143 #define       TYPE0_FUNCTION_ARGTYPE1_NORND(type0, fn_name, type1, arg_name)\
1144      type0                                     \
1145      fn_name (type1 bid_##arg_name _EXC_FLAGS_PARAM  \
1146            _EXC_MASKS_PARAM _EXC_INFO_PARAM) { \
1147      PROLOG_TYPE_VAL(type1, arg_name)                      \
1148      OTHER_PROLOG_VAL()
1149
1150 #endif
1151
1152
1153
1154 #define   BID_TO_SMALL_UINT_CVT_FUNCTION(type0, fn_name, type1, arg_name, cvt_fn_name, type2, size_mask, invalid_res)\
1155     TYPE0_FUNCTION_ARGTYPE1_NORND(type0, fn_name, type1, arg_name)\
1156         type2 res;                                                    \
1157         _IDEC_flags saved_fpsc=*pfpsf;                                \
1158     BIDECIMAL_CALL1_NORND(cvt_fn_name, res, arg_name);            \
1159         if(res & size_mask) {                                         \
1160       *pfpsf = saved_fpsc | INVALID_EXCEPTION;                    \
1161           res = invalid_res; }                                        \
1162     BID_RETURN_VAL((type0)res);                                   \
1163                    }
1164
1165 #define   BID_TO_SMALL_INT_CVT_FUNCTION(type0, fn_name, type1, arg_name, cvt_fn_name, type2, size_mask, invalid_res)\
1166     TYPE0_FUNCTION_ARGTYPE1_NORND(type0, fn_name, type1, arg_name)\
1167         type2 res, sgn_mask;                                          \
1168         _IDEC_flags saved_fpsc=*pfpsf;                                \
1169     BIDECIMAL_CALL1_NORND(cvt_fn_name, res, arg_name);            \
1170         sgn_mask = res & size_mask;                                   \
1171         if(sgn_mask && (sgn_mask != (type2)size_mask)) {                     \
1172       *pfpsf = saved_fpsc | INVALID_EXCEPTION;                    \
1173           res = invalid_res; }                                        \
1174     BID_RETURN_VAL((type0)res);                                   \
1175                    }
1176 #endif