1 /******************************************************************************
2   Copyright (c) 2011, Intel Corp.
3   All rights reserved.
4 
5   Redistribution and use in source and binary forms, with or without
6   modification, are permitted provided that the following conditions are met:
7 
8     * Redistributions of source code must retain the above copyright notice,
9       this list of conditions and the following disclaimer.
10     * Redistributions in binary form must reproduce the above copyright
11       notice, this list of conditions and the following disclaimer in the
12       documentation and/or other materials provided with the distribution.
13     * Neither the name of Intel Corporation nor the names of its contributors
14       may be used to endorse or promote products derived from this software
15       without specific prior written permission.
16 
17   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
18   AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
19   IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
20   ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
21   LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
22   CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
23   SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
24   INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
25   CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
26   ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
27   THE POSSIBILITY OF SUCH DAMAGE.
28 ******************************************************************************/
29 
30 #if defined(__cplusplus)
31 #define BID_EXTERN_C extern "C"
32 #else
33 #define BID_EXTERN_C extern
34 #endif
35 
36 #ifndef _BID_CONF_H
37 #define _BID_CONF_H
38 
39 // Name Changes
40 
41 #define _IDEC_glbflags __bid_IDEC_glbflags
42 #define _IDEC_glbround __bid_IDEC_glbround
43 #define _IDEC_glbexcepthandling __bid_IDEC_glbexcepthandling
44 #define _IDEC_glbexceptionmasks __bid_IDEC_glbexceptionmasks
45 
46 #define bid32_inf         __bid32_inf
47 #define bid64_inf         __bid64_inf
48 #define bid128_inf        __bid128_inf
49 #define bid32_exp         __bid32_exp
50 #define bid32_log         __bid32_log
51 #define bid32_pow         __bid32_pow
52 #define bid64_exp         __bid64_exp
53 #define bid64_log         __bid64_log
54 #define bid64_pow         __bid64_pow
55 #define bid128_exp        __bid128_exp
56 #define bid128_log        __bid128_log
57 #define bid128_pow        __bid128_pow
58 #define bid32_cbrt        __bid32_cbrt
59 #define bid64_cbrt        __bid64_cbrt
60 #define bid128_cbrt       __bid128_cbrt
61 #define bid32_atan2       __bid32_atan2
62 #define bid64_atan2       __bid64_atan2
63 #define bid128_atan2      __bid128_atan2
64 #define bid32_fmod        __bid32_fmod
65 #define bid64_fmod        __bid64_fmod
66 #define bid128_fmod       __bid128_fmod
67 #define bid32_modf        __bid32_modf
68 #define bid64_modf        __bid64_modf
69 #define bid128_modf       __bid128_modf
70 #define bid32_hypot       __bid32_hypot
71 #define bid64_hypot       __bid64_hypot
72 #define bid128_hypot      __bid128_hypot
73 #define bid32_sin         __bid32_sin
74 #define bid64_sin         __bid64_sin
75 #define bid128_sin        __bid128_sin
76 #define bid32_cos         __bid32_cos
77 #define bid64_cos         __bid64_cos
78 #define bid128_cos        __bid128_cos
79 #define bid32_tan         __bid32_tan
80 #define bid64_tan         __bid64_tan
81 #define bid128_tan        __bid128_tan
82 #define bid32_asin         __bid32_asin
83 #define bid64_asin         __bid64_asin
84 #define bid128_asin        __bid128_asin
85 #define bid32_acos         __bid32_acos
86 #define bid64_acos         __bid64_acos
87 #define bid128_acos        __bid128_acos
88 #define bid32_atan         __bid32_atan
89 #define bid64_atan         __bid64_atan
90 #define bid128_atan        __bid128_atan
91 #define bid32_sinh         __bid32_sinh
92 #define bid64_sinh         __bid64_sinh
93 #define bid128_sinh        __bid128_sinh
94 #define bid32_cosh         __bid32_cosh
95 #define bid64_cosh         __bid64_cosh
96 #define bid128_cosh        __bid128_cosh
97 #define bid32_tanh         __bid32_tanh
98 #define bid64_tanh         __bid64_tanh
99 #define bid128_tanh        __bid128_tanh
100 #define bid32_asinh        __bid32_asinh
101 #define bid64_asinh        __bid64_asinh
102 #define bid128_asinh       __bid128_asinh
103 #define bid32_acosh        __bid32_acosh
104 #define bid64_acosh        __bid64_acosh
105 #define bid128_acosh       __bid128_acosh
106 #define bid32_atanh        __bid32_atanh
107 #define bid64_atanh        __bid64_atanh
108 #define bid128_atanh       __bid128_atanh
109 #define bid32_log1p        __bid32_log1p
110 #define bid64_log1p        __bid64_log1p
111 #define bid128_log1p       __bid128_log1p
112 #define bid32_exp2          __bid32_exp2
113 #define bid64_exp2         __bid64_exp2
114 #define bid128_exp2        __bid128_exp2
115 #define bid32_exp10          __bid32_exp10
116 #define bid64_exp10         __bid64_exp10
117 #define bid128_exp10        __bid128_exp10
118 #define bid32_expm1        __bid32_expm1
119 #define bid64_expm1        __bid64_expm1
120 #define bid128_expm1       __bid128_expm1
121 #define bid32_log10        __bid32_log10
122 #define bid64_log10        __bid64_log10
123 #define bid128_log10       __bid128_log10
124 #define bid32_log2         __bid32_log2
125 #define bid64_log2         __bid64_log2
126 #define bid128_log2        __bid128_log2
127 #define bid32_erf          __bid32_erf
128 #define bid64_erf          __bid64_erf
129 #define bid128_erf         __bid128_erf
130 #define bid32_erfc         __bid32_erfc
131 #define bid64_erfc         __bid64_erfc
132 #define bid128_erfc        __bid128_erfc
133 #define bid32_tgamma       __bid32_tgamma
134 #define bid64_tgamma       __bid64_tgamma
135 #define bid128_tgamma      __bid128_tgamma
136 #define bid32_lgamma       __bid32_lgamma
137 #define bid64_lgamma       __bid64_lgamma
138 #define bid128_lgamma      __bid128_lgamma
139 
140 #define bid32_frexp        __bid32_frexp
141 #define bid64_frexp        __bid64_frexp
142 #define bid128_frexp       __bid128_frexp
143 #define bid32_logb         __bid32_logb
144 #define bid64_logb         __bid64_logb
145 #define bid128_logb        __bid128_logb
146 #define bid32_scalbln      __bid32_scalbln
147 #define bid64_scalbln      __bid64_scalbln
148 #define bid128_scalbln     __bid128_scalbln
149 #define bid32_nearbyint    __bid32_nearbyint
150 #define bid64_nearbyint    __bid64_nearbyint
151 #define bid128_nearbyint   __bid128_nearbyint
152 #define bid32_lrint        __bid32_lrint
153 #define bid64_lrint        __bid64_lrint
154 #define bid128_lrint       __bid128_lrint
155 #define bid32_llrint       __bid32_llrint
156 #define bid64_llrint       __bid64_llrint
157 #define bid128_llrint      __bid128_llrint
158 #define bid32_lround       __bid32_lround
159 #define bid64_lround       __bid64_lround
160 #define bid128_lround      __bid128_lround
161 #define bid32_llround      __bid32_llround
162 #define bid64_llround      __bid64_llround
163 #define bid128_llround     __bid128_llround
164 #define bid32_nan          __bid32_nan
165 #define bid64_nan          __bid64_nan
166 #define bid128_nan         __bid128_nan
167 #define bid32_nexttoward   __bid32_nexttoward
168 #define bid64_nexttoward   __bid64_nexttoward
169 #define bid128_nexttoward  __bid128_nexttoward
170 #define bid32_fdim          __bid32_fdim
171 #define bid64_fdim          __bid64_fdim
172 #define bid128_fdim         __bid128_fdim
173 #define bid32_quantexp     __bid32_quantexp
174 #define bid64_quantexp     __bid64_quantexp
175 #define bid128_quantexp    __bid128_quantexp
176 
177 #define bid32_add         __bid32_add
178 #define bid32_sub         __bid32_sub
179 #define bid32_mul         __bid32_mul
180 #define bid32_div         __bid32_div
181 #define bid32_fma         __bid32_fma
182 #define bid32_sqrt        __bid32_sqrt
183 #define bid32_rem         __bid32_rem
184 #define bid32_ilogb       __bid32_ilogb
185 #define bid32_scalbn      __bid32_scalbn
186 #define bid32_ldexp       __bid32_ldexp
187 #define bid32_to_string   __bid32_to_string
188 #define bid32_from_string __bid32_from_string
189 #define bid32_quantize    __bid32_quantize
190 #define bid32_nextup      __bid32_nextup
191 #define bid32_nextdown    __bid32_nextdown
192 #define bid32_minnum      __bid32_minnum
193 #define bid32_minnum_mag  __bid32_minnum_mag
194 #define bid32_maxnum      __bid32_maxnum
195 #define bid32_maxnum_mag  __bid32_maxnum_mag
196 #define bid32_from_int32  __bid32_from_int32
197 #define bid32_from_uint32 __bid32_from_uint32
198 #define bid32_from_int64  __bid32_from_int64
199 #define bid32_from_uint64 __bid32_from_uint64
200 #define bid32_isSigned    __bid32_isSigned
201 #define bid32_isNormal    __bid32_isNormal
202 #define bid32_isSubnormal __bid32_isSubnormal
203 #define bid32_isFinite    __bid32_isFinite
204 #define bid32_isZero      __bid32_isZero
205 #define bid32_isInf       __bid32_isInf
206 #define bid32_isSignaling __bid32_isSignaling
207 #define bid32_isNaN       __bid32_isNaN
208 #define bid32_copy        __bid32_copy
209 #define bid32_negate      __bid32_negate
210 #define bid32_abs         __bid32_abs
211 #define bid32_copySign    __bid32_copySign
212 #define bid32_class       __bid32_class
213 #define bid32_sameQuantum __bid32_sameQuantum
214 #define bid32_totalOrder  __bid32_totalOrder
215 #define bid32_totalOrderMag __bid32_totalOrderMag
216 #define bid32_radix       __bid32_radix
217 #define bid32_quiet_equal __bid32_quiet_equal
218 #define bid32_quiet_greater __bid32_quiet_greater
219 #define bid32_quiet_greater_equal __bid32_quiet_greater_equal
220 #define bid32_quiet_greater_unordered __bid32_quiet_greater_unordered
221 #define bid32_quiet_less __bid32_quiet_less
222 #define bid32_quiet_less_equal __bid32_quiet_less_equal
223 #define bid32_quiet_less_unordered __bid32_quiet_less_unordered
224 #define bid32_quiet_not_equal __bid32_quiet_not_equal
225 #define bid32_quiet_not_greater __bid32_quiet_not_greater
226 #define bid32_quiet_not_less __bid32_quiet_not_less
227 #define bid32_quiet_ordered __bid32_quiet_ordered
228 #define bid32_quiet_unordered __bid32_quiet_unordered
229 #define bid32_signaling_greater __bid32_signaling_greater
230 #define bid32_signaling_greater_equal __bid32_signaling_greater_equal
231 #define bid32_signaling_greater_unordered __bid32_signaling_greater_unordered
232 #define bid32_signaling_less __bid32_signaling_less
233 #define bid32_signaling_less_equal __bid32_signaling_less_equal
234 #define bid32_signaling_less_unordered __bid32_signaling_less_unordered
235 #define bid32_signaling_not_greater __bid32_signaling_not_greater
236 #define bid32_signaling_not_less __bid32_signaling_not_less
237 #define bid32_isCanonical __bid32_isCanonical
238 #define bid32_nextafter __bid32_nextafter
239 #define bid32_round_integral_exact __bid32_round_integral_exact
240 #define bid32_round_integral_nearest_away __bid32_round_integral_nearest_away
241 #define bid32_round_integral_nearest_even __bid32_round_integral_nearest_even
242 #define bid32_round_integral_negative __bid32_round_integral_negative
243 #define bid32_round_integral_positive __bid32_round_integral_positive
244 #define bid32_round_integral_zero __bid32_round_integral_zero
245 #define bid32_to_int16_ceil __bid32_to_int16_ceil
246 #define bid32_to_int16_floor __bid32_to_int16_floor
247 #define bid32_to_int16_int __bid32_to_int16_int
248 #define bid32_to_int16_rnint __bid32_to_int16_rnint
249 #define bid32_to_int16_rninta __bid32_to_int16_rninta
250 #define bid32_to_int16_xceil __bid32_to_int16_xceil
251 #define bid32_to_int16_xfloor __bid32_to_int16_xfloor
252 #define bid32_to_int16_xint __bid32_to_int16_xint
253 #define bid32_to_int16_xrnint __bid32_to_int16_xrnint
254 #define bid32_to_int16_xrninta __bid32_to_int16_xrninta
255 #define bid32_to_int32_ceil __bid32_to_int32_ceil
256 #define bid32_to_int32_floor __bid32_to_int32_floor
257 #define bid32_to_int32_int __bid32_to_int32_int
258 #define bid32_to_int32_rnint __bid32_to_int32_rnint
259 #define bid32_to_int32_rninta __bid32_to_int32_rninta
260 #define bid32_to_int32_xceil __bid32_to_int32_xceil
261 #define bid32_to_int32_xfloor __bid32_to_int32_xfloor
262 #define bid32_to_int32_xint __bid32_to_int32_xint
263 #define bid32_to_int32_xrnint __bid32_to_int32_xrnint
264 #define bid32_to_int32_xrninta __bid32_to_int32_xrninta
265 #define bid32_to_int64_ceil __bid32_to_int64_ceil
266 #define bid32_to_int64_floor __bid32_to_int64_floor
267 #define bid32_to_int64_int __bid32_to_int64_int
268 #define bid32_to_int64_rnint __bid32_to_int64_rnint
269 #define bid32_to_int64_rninta __bid32_to_int64_rninta
270 #define bid32_to_int64_xceil __bid32_to_int64_xceil
271 #define bid32_to_int64_xfloor __bid32_to_int64_xfloor
272 #define bid32_to_int64_xint __bid32_to_int64_xint
273 #define bid32_to_int64_xrnint __bid32_to_int64_xrnint
274 #define bid32_to_int64_xrninta __bid32_to_int64_xrninta
275 #define bid32_to_int8_ceil __bid32_to_int8_ceil
276 #define bid32_to_int8_floor __bid32_to_int8_floor
277 #define bid32_to_int8_int __bid32_to_int8_int
278 #define bid32_to_int8_rnint __bid32_to_int8_rnint
279 #define bid32_to_int8_rninta __bid32_to_int8_rninta
280 #define bid32_to_int8_xceil __bid32_to_int8_xceil
281 #define bid32_to_int8_xfloor __bid32_to_int8_xfloor
282 #define bid32_to_int8_xint __bid32_to_int8_xint
283 #define bid32_to_int8_xrnint __bid32_to_int8_xrnint
284 #define bid32_to_int8_xrninta __bid32_to_int8_xrninta
285 #define bid32_to_uint16_ceil __bid32_to_uint16_ceil
286 #define bid32_to_uint16_floor __bid32_to_uint16_floor
287 #define bid32_to_uint16_int __bid32_to_uint16_int
288 #define bid32_to_uint16_rnint __bid32_to_uint16_rnint
289 #define bid32_to_uint16_rninta __bid32_to_uint16_rninta
290 #define bid32_to_uint16_xceil __bid32_to_uint16_xceil
291 #define bid32_to_uint16_xfloor __bid32_to_uint16_xfloor
292 #define bid32_to_uint16_xint __bid32_to_uint16_xint
293 #define bid32_to_uint16_xrnint __bid32_to_uint16_xrnint
294 #define bid32_to_uint16_xrninta __bid32_to_uint16_xrninta
295 #define bid32_to_uint32_ceil __bid32_to_uint32_ceil
296 #define bid32_to_uint32_floor __bid32_to_uint32_floor
297 #define bid32_to_uint32_int __bid32_to_uint32_int
298 #define bid32_to_uint32_rnint __bid32_to_uint32_rnint
299 #define bid32_to_uint32_rninta __bid32_to_uint32_rninta
300 #define bid32_to_uint32_xceil __bid32_to_uint32_xceil
301 #define bid32_to_uint32_xfloor __bid32_to_uint32_xfloor
302 #define bid32_to_uint32_xint __bid32_to_uint32_xint
303 #define bid32_to_uint32_xrnint __bid32_to_uint32_xrnint
304 #define bid32_to_uint32_xrninta __bid32_to_uint32_xrninta
305 #define bid32_to_uint64_ceil __bid32_to_uint64_ceil
306 #define bid32_to_uint64_floor __bid32_to_uint64_floor
307 #define bid32_to_uint64_int __bid32_to_uint64_int
308 #define bid32_to_uint64_rnint __bid32_to_uint64_rnint
309 #define bid32_to_uint64_rninta __bid32_to_uint64_rninta
310 #define bid32_to_uint64_xceil __bid32_to_uint64_xceil
311 #define bid32_to_uint64_xfloor __bid32_to_uint64_xfloor
312 #define bid32_to_uint64_xint __bid32_to_uint64_xint
313 #define bid32_to_uint64_xrnint __bid32_to_uint64_xrnint
314 #define bid32_to_uint64_xrninta __bid32_to_uint64_xrninta
315 #define bid32_to_uint8_ceil __bid32_to_uint8_ceil
316 #define bid32_to_uint8_floor __bid32_to_uint8_floor
317 #define bid32_to_uint8_int __bid32_to_uint8_int
318 #define bid32_to_uint8_rnint __bid32_to_uint8_rnint
319 #define bid32_to_uint8_rninta __bid32_to_uint8_rninta
320 #define bid32_to_uint8_xceil __bid32_to_uint8_xceil
321 #define bid32_to_uint8_xfloor __bid32_to_uint8_xfloor
322 #define bid32_to_uint8_xint __bid32_to_uint8_xint
323 #define bid32_to_uint8_xrnint __bid32_to_uint8_xrnint
324 #define bid32_to_uint8_xrninta __bid32_to_uint8_xrninta
325 
326 #define bid64_add __bid64_add
327 #define bid64_sub __bid64_sub
328 #define bid64_mul __bid64_mul
329 #define bid64_div __bid64_div
330 #define bid64dq_div __bid64dq_div
331 #define bid64qd_div __bid64qd_div
332 #define bid64qq_div __bid64qq_div
333 #define bid64q_sqrt __bid64q_sqrt
334 #define bid64_sqrt __bid64_sqrt
335 #define bid64_rem __bid64_rem
336 #define bid64_fma __bid64_fma
337 #define bid64_scalbn __bid64_scalbn
338 #define bid64_ldexp  __bid64_ldexp
339 #define bid_round128_19_38 __bid_round128_19_38
340 #define bid_round192_39_57 __bid_round192_39_57
341 #define bid_round256_58_76 __bid_round256_58_76
342 #define bid_round64_2_18 __bid_round64_2_18
343 #define bid64_nextafter __bid64_nextafter
344 #define bid64_nextdown __bid64_nextdown
345 #define bid64_nextup __bid64_nextup
346 #define bid_b2d __bid_b2d
347 #define bid_b2d2 __bid_b2d2
348 #define bid_b2d3 __bid_b2d3
349 #define bid_b2d4 __bid_b2d4
350 #define bid_b2d5 __bid_b2d5
351 #define bid_to_dpd128 __bid_to_dpd128
352 #define bid_to_dpd32 __bid_to_dpd32
353 #define bid_to_dpd64 __bid_to_dpd64
354 #define bid_d2b __bid_d2b
355 #define bid_d2b2 __bid_d2b2
356 #define bid_d2b3 __bid_d2b3
357 #define bid_d2b4 __bid_d2b4
358 #define bid_d2b5 __bid_d2b5
359 #define bid_d2b6 __bid_d2b6
360 #define bid_dpd_to_bid128 __bid_dpd_to_bid128
361 #define bid_dpd_to_bid32 __bid_dpd_to_bid32
362 #define bid_dpd_to_bid64 __bid_dpd_to_bid64
363 #define bid128_nextafter __bid128_nextafter
364 #define bid128_nextdown __bid128_nextdown
365 #define bid128_nextup __bid128_nextup
366 #define bid64_ilogb __bid64_ilogb
367 #define bid64_quantize __bid64_quantize
368 #define bid_estimate_bin_expon __bid_estimate_bin_expon
369 #define bid_estimate_decimal_digits __bid_estimate_decimal_digits
370 #define bid_power10_index_binexp __bid_power10_index_binexp
371 #define bid_power10_index_binexp_128 __bid_power10_index_binexp_128
372 #define bid_power10_table_128 __bid_power10_table_128
373 #define bid_reciprocals10_128 __bid_reciprocals10_128
374 #define bid_reciprocals10_64 __bid_reciprocals10_64
375 #define bid_recip_scale __bid_recip_scale
376 #define bid_round_const_table __bid_round_const_table
377 #define bid_round_const_table_128 __bid_round_const_table_128
378 #define bid_short_recip_scale __bid_short_recip_scale
379 #define bid64_from_string __bid64_from_string
380 #define bid64_to_string __bid64_to_string
381 #define bid_Inv_Tento9 __bid_Inv_Tento9
382 #define bid_midi_tbl __bid_midi_tbl
383 #define bid_Tento3 __bid_Tento3
384 #define bid_Tento6 __bid_Tento6
385 #define bid_Tento9 __bid_Tento9
386 #define bid_Twoto30_m_10to9 __bid_Twoto30_m_10to9
387 #define bid_Twoto60 __bid_Twoto60
388 #define bid_Twoto60_m_10to18 __bid_Twoto60_m_10to18
389 #define bid_convert_table __bid_convert_table
390 #define bid_factors __bid_factors
391 #define bid_packed_10000_zeros __bid_packed_10000_zeros
392 #define bid_char_table2 __bid_char_table2
393 #define bid_char_table3 __bid_char_table3
394 #define bid_Ex128m128 __bid_Ex128m128
395 #define bid_Ex192m192 __bid_Ex192m192
396 #define bid_Ex256m256 __bid_Ex256m256
397 #define bid_Ex64m64 __bid_Ex64m64
398 #define bid_half128 __bid_half128
399 #define bid_half192 __bid_half192
400 #define bid_half256 __bid_half256
401 #define bid_half64 __bid_half64
402 #define bid_Kx128 __bid_Kx128
403 #define bid_Kx192 __bid_Kx192
404 #define bid_Kx256 __bid_Kx256
405 #define bid_Kx64 __bid_Kx64
406 #define bid_mask128 __bid_mask128
407 #define bid_mask192 __bid_mask192
408 #define bid_mask256 __bid_mask256
409 #define bid_mask64 __bid_mask64
410 #define bid_maskhigh128 __bid_maskhigh128
411 #define bid_maskhigh128M __bid_maskhigh128M
412 #define bid_maskhigh192M __bid_maskhigh192M
413 #define bid_maskhigh256M __bid_maskhigh256M
414 #define bid_midpoint128 __bid_midpoint128
415 #define bid_midpoint192 __bid_midpoint192
416 #define bid_midpoint256 __bid_midpoint256
417 #define bid_midpoint64 __bid_midpoint64
418 #define bid_nr_digits __bid_nr_digits
419 #define bid_onehalf128 __bid_onehalf128
420 #define bid_onehalf128M __bid_onehalf128M
421 #define bid_onehalf192M __bid_onehalf192M
422 #define bid_onehalf256M __bid_onehalf256M
423 #define bid_shiftright128 __bid_shiftright128
424 #define bid_shiftright128M __bid_shiftright128M
425 #define bid_shiftright192M __bid_shiftright192M
426 #define bid_shiftright256M __bid_shiftright256M
427 #define bid_shift_ten2m3k128 __bid_shift_ten2m3k128
428 #define bid_shift_ten2m3k64 __bid_shift_ten2m3k64
429 #define bid_ten2k128 __bid_ten2k128
430 #define bid_ten2k256 __bid_ten2k256
431 #define bid_ten2k64 __bid_ten2k64
432 #define bid_ten2m3k128 __bid_ten2m3k128
433 #define bid_ten2m3k64 __bid_ten2m3k64
434 #define bid_ten2mk128 __bid_ten2mk128
435 #define bid_ten2mk128M __bid_ten2mk128M
436 #define bid_ten2mk128trunc __bid_ten2mk128trunc
437 #define bid_ten2mk128truncM __bid_ten2mk128truncM
438 #define bid_ten2mk192M __bid_ten2mk192M
439 #define bid_ten2mk192truncM __bid_ten2mk192truncM
440 #define bid_ten2mk256M __bid_ten2mk256M
441 #define bid_ten2mk256truncM __bid_ten2mk256truncM
442 #define bid_ten2mk64 __bid_ten2mk64
443 #define bid_ten2mxtrunc128 __bid_ten2mxtrunc128
444 #define bid_ten2mxtrunc192 __bid_ten2mxtrunc192
445 #define bid_ten2mxtrunc256 __bid_ten2mxtrunc256
446 #define bid_ten2mxtrunc64 __bid_ten2mxtrunc64
447 #define bid128_add __bid128_add
448 #define bid128dd_add __bid128dd_add
449 #define bid128dd_sub __bid128dd_sub
450 #define bid128dq_add __bid128dq_add
451 #define bid128dq_sub __bid128dq_sub
452 #define bid128qd_add __bid128qd_add
453 #define bid128qd_sub __bid128qd_sub
454 #define bid128_sub __bid128_sub
455 #define bid64dq_add __bid64dq_add
456 #define bid64dq_sub __bid64dq_sub
457 #define bid64qd_add __bid64qd_add
458 #define bid64qd_sub __bid64qd_sub
459 #define bid64qq_add __bid64qq_add
460 #define bid64qq_sub __bid64qq_sub
461 #define bid128dd_mul __bid128dd_mul
462 #define bid128dq_mul __bid128dq_mul
463 #define bid128_mul __bid128_mul
464 #define bid128qd_mul __bid128qd_mul
465 #define bid64dq_mul __bid64dq_mul
466 #define bid64qd_mul __bid64qd_mul
467 #define bid64qq_mul __bid64qq_mul
468 #define bid128dd_div __bid128dd_div
469 #define bid128_div __bid128_div
470 #define bid128dq_div __bid128dq_div
471 #define bid128qd_div __bid128qd_div
472 #define bid128d_sqrt __bid128d_sqrt
473 #define bid128_sqrt __bid128_sqrt
474 #define bid128ddd_fma __bid128ddd_fma
475 #define bid128ddq_fma __bid128ddq_fma
476 #define bid128dqd_fma __bid128dqd_fma
477 #define bid128dqq_fma __bid128dqq_fma
478 #define bid128_fma __bid128_fma
479 #define bid128qdd_fma __bid128qdd_fma
480 #define bid128qdq_fma __bid128qdq_fma
481 #define bid128qqd_fma __bid128qqd_fma
482 #define bid64ddq_fma __bid64ddq_fma
483 #define bid64dqd_fma __bid64dqd_fma
484 #define bid64dqq_fma __bid64dqq_fma
485 #define bid64qdd_fma __bid64qdd_fma
486 #define bid64qdq_fma __bid64qdq_fma
487 #define bid64qqd_fma __bid64qqd_fma
488 #define bid64qqq_fma __bid64qqq_fma
489 #define bid128_round_integral_exact __bid128_round_integral_exact
490 #define bid128_round_integral_nearest_away __bid128_round_integral_nearest_away
491 #define bid128_round_integral_nearest_even __bid128_round_integral_nearest_even
492 #define bid128_round_integral_negative __bid128_round_integral_negative
493 #define bid128_round_integral_positive __bid128_round_integral_positive
494 #define bid128_round_integral_zero __bid128_round_integral_zero
495 #define bid64_round_integral_exact __bid64_round_integral_exact
496 #define bid64_round_integral_nearest_away __bid64_round_integral_nearest_away
497 #define bid64_round_integral_nearest_even __bid64_round_integral_nearest_even
498 #define bid64_round_integral_negative __bid64_round_integral_negative
499 #define bid64_round_integral_positive __bid64_round_integral_positive
500 #define bid64_round_integral_zero __bid64_round_integral_zero
501 #define bid128_quantize __bid128_quantize
502 #define bid128_scalbn __bid128_scalbn
503 #define bid128_ldexp  __bid128_ldexp
504 #define bid64_maxnum __bid64_maxnum
505 #define bid64_maxnum_mag __bid64_maxnum_mag
506 #define bid64_minnum __bid64_minnum
507 #define bid64_minnum_mag __bid64_minnum_mag
508 #define bid128_maxnum __bid128_maxnum
509 #define bid128_maxnum_mag __bid128_maxnum_mag
510 #define bid128_minnum __bid128_minnum
511 #define bid128_minnum_mag __bid128_minnum_mag
512 #define bid128_rem __bid128_rem
513 #define bid128_ilogb __bid128_ilogb
514 #define bid_getDecimalRoundingDirection __bid_getDecimalRoundingDirection
515 #define bid_is754 __bid_is754
516 #define bid_is754R __bid_is754R
517 #define bid_signalException __bid_signalException
518 #define bid_lowerFlags __bid_lowerFlags
519 #define bid_restoreFlags __bid_restoreFlags
520 #define bid_saveFlags __bid_saveFlags
521 #define bid_setDecimalRoundingDirection __bid_setDecimalRoundingDirection
522 #define bid_testFlags __bid_testFlags
523 #define bid_testSavedFlags __bid_testSavedFlags
524 #define bid32_to_bid64 __bid32_to_bid64
525 #define bid64_to_bid32 __bid64_to_bid32
526 #define bid128_to_string __bid128_to_string
527 #define mod10_18_tbl __bid_mod10_18_tbl
528 #define bid128_to_bid32 __bid128_to_bid32
529 #define bid32_to_bid128 __bid32_to_bid128
530 #define bid128_to_bid64 __bid128_to_bid64
531 #define bid64_to_bid128 __bid64_to_bid128
532 #define bid128_from_string __bid128_from_string
533 #define bid128_from_int32 __bid128_from_int32
534 #define bid128_from_int64 __bid128_from_int64
535 #define bid128_from_uint32 __bid128_from_uint32
536 #define bid128_from_uint64 __bid128_from_uint64
537 #define bid64_from_int32 __bid64_from_int32
538 #define bid64_from_int64 __bid64_from_int64
539 #define bid64_from_uint32 __bid64_from_uint32
540 #define bid64_from_uint64 __bid64_from_uint64
541 #define bid64_abs __bid64_abs
542 #define bid64_class __bid64_class
543 #define bid64_copy __bid64_copy
544 #define bid64_copySign __bid64_copySign
545 #define bid64_isCanonical __bid64_isCanonical
546 #define bid64_isFinite __bid64_isFinite
547 #define bid64_isInf __bid64_isInf
548 #define bid64_isNaN __bid64_isNaN
549 #define bid64_isNormal __bid64_isNormal
550 #define bid64_isSignaling __bid64_isSignaling
551 #define bid64_isSigned __bid64_isSigned
552 #define bid64_isSubnormal __bid64_isSubnormal
553 #define bid64_isZero __bid64_isZero
554 #define bid64_negate __bid64_negate
555 #define bid64_radix __bid64_radix
556 #define bid64_sameQuantum __bid64_sameQuantum
557 #define bid64_totalOrder __bid64_totalOrder
558 #define bid64_totalOrderMag __bid64_totalOrderMag
559 #define bid128_abs __bid128_abs
560 #define bid128_class __bid128_class
561 #define bid128_copy __bid128_copy
562 #define bid128_copySign __bid128_copySign
563 #define bid128_isCanonical __bid128_isCanonical
564 #define bid128_isFinite __bid128_isFinite
565 #define bid128_isInf __bid128_isInf
566 #define bid128_isNaN __bid128_isNaN
567 #define bid128_isNormal __bid128_isNormal
568 #define bid128_isSignaling __bid128_isSignaling
569 #define bid128_isSigned __bid128_isSigned
570 #define bid128_isSubnormal __bid128_isSubnormal
571 #define bid128_isZero __bid128_isZero
572 #define bid128_negate __bid128_negate
573 #define bid128_radix __bid128_radix
574 #define bid128_sameQuantum __bid128_sameQuantum
575 #define bid128_totalOrder __bid128_totalOrder
576 #define bid128_totalOrderMag __bid128_totalOrderMag
577 #define bid64_quiet_equal __bid64_quiet_equal
578 #define bid64_quiet_greater __bid64_quiet_greater
579 #define bid64_quiet_greater_equal __bid64_quiet_greater_equal
580 #define bid64_quiet_greater_unordered __bid64_quiet_greater_unordered
581 #define bid64_quiet_less __bid64_quiet_less
582 #define bid64_quiet_less_equal __bid64_quiet_less_equal
583 #define bid64_quiet_less_unordered __bid64_quiet_less_unordered
584 #define bid64_quiet_not_equal __bid64_quiet_not_equal
585 #define bid64_quiet_not_greater __bid64_quiet_not_greater
586 #define bid64_quiet_not_less __bid64_quiet_not_less
587 #define bid64_quiet_ordered __bid64_quiet_ordered
588 #define bid64_quiet_unordered __bid64_quiet_unordered
589 #define bid64_signaling_greater __bid64_signaling_greater
590 #define bid64_signaling_greater_equal __bid64_signaling_greater_equal
591 #define bid64_signaling_greater_unordered __bid64_signaling_greater_unordered
592 #define bid64_signaling_less __bid64_signaling_less
593 #define bid64_signaling_less_equal __bid64_signaling_less_equal
594 #define bid64_signaling_less_unordered __bid64_signaling_less_unordered
595 #define bid64_signaling_not_greater __bid64_signaling_not_greater
596 #define bid64_signaling_not_less __bid64_signaling_not_less
597 #define bid128_quiet_equal __bid128_quiet_equal
598 #define bid128_quiet_greater __bid128_quiet_greater
599 #define bid128_quiet_greater_equal __bid128_quiet_greater_equal
600 #define bid128_quiet_greater_unordered __bid128_quiet_greater_unordered
601 #define bid128_quiet_less __bid128_quiet_less
602 #define bid128_quiet_less_equal __bid128_quiet_less_equal
603 #define bid128_quiet_less_unordered __bid128_quiet_less_unordered
604 #define bid128_quiet_not_equal __bid128_quiet_not_equal
605 #define bid128_quiet_not_greater __bid128_quiet_not_greater
606 #define bid128_quiet_not_less __bid128_quiet_not_less
607 #define bid128_quiet_ordered __bid128_quiet_ordered
608 #define bid128_quiet_unordered __bid128_quiet_unordered
609 #define bid128_signaling_greater __bid128_signaling_greater
610 #define bid128_signaling_greater_equal __bid128_signaling_greater_equal
611 #define bid128_signaling_greater_unordered __bid128_signaling_greater_unordered
612 #define bid128_signaling_less __bid128_signaling_less
613 #define bid128_signaling_less_equal __bid128_signaling_less_equal
614 #define bid128_signaling_less_unordered __bid128_signaling_less_unordered
615 #define bid128_signaling_not_greater __bid128_signaling_not_greater
616 #define bid128_signaling_not_less __bid128_signaling_not_less
617 #define bid64_to_int32_ceil __bid64_to_int32_ceil
618 #define bid64_to_int32_floor __bid64_to_int32_floor
619 #define bid64_to_int32_int __bid64_to_int32_int
620 #define bid64_to_int32_rnint __bid64_to_int32_rnint
621 #define bid64_to_int32_rninta __bid64_to_int32_rninta
622 #define bid64_to_int32_xceil __bid64_to_int32_xceil
623 #define bid64_to_int32_xfloor __bid64_to_int32_xfloor
624 #define bid64_to_int32_xint __bid64_to_int32_xint
625 #define bid64_to_int32_xrnint __bid64_to_int32_xrnint
626 #define bid64_to_int32_xrninta __bid64_to_int32_xrninta
627 #define bid64_to_uint32_ceil __bid64_to_uint32_ceil
628 #define bid64_to_uint32_floor __bid64_to_uint32_floor
629 #define bid64_to_uint32_int __bid64_to_uint32_int
630 #define bid64_to_uint32_rnint __bid64_to_uint32_rnint
631 #define bid64_to_uint32_rninta __bid64_to_uint32_rninta
632 #define bid64_to_uint32_xceil __bid64_to_uint32_xceil
633 #define bid64_to_uint32_xfloor __bid64_to_uint32_xfloor
634 #define bid64_to_uint32_xint __bid64_to_uint32_xint
635 #define bid64_to_uint32_xrnint __bid64_to_uint32_xrnint
636 #define bid64_to_uint32_xrninta __bid64_to_uint32_xrninta
637 #define bid64_to_int64_ceil __bid64_to_int64_ceil
638 #define bid64_to_int64_floor __bid64_to_int64_floor
639 #define bid64_to_int64_int __bid64_to_int64_int
640 #define bid64_to_int64_rnint __bid64_to_int64_rnint
641 #define bid64_to_int64_rninta __bid64_to_int64_rninta
642 #define bid64_to_int64_xceil __bid64_to_int64_xceil
643 #define bid64_to_int64_xfloor __bid64_to_int64_xfloor
644 #define bid64_to_int64_xint __bid64_to_int64_xint
645 #define bid64_to_int64_xrnint __bid64_to_int64_xrnint
646 #define bid64_to_int64_xrninta __bid64_to_int64_xrninta
647 #define bid64_to_uint64_ceil __bid64_to_uint64_ceil
648 #define bid64_to_uint64_floor __bid64_to_uint64_floor
649 #define bid64_to_uint64_int __bid64_to_uint64_int
650 #define bid64_to_uint64_rnint __bid64_to_uint64_rnint
651 #define bid64_to_uint64_rninta __bid64_to_uint64_rninta
652 #define bid64_to_uint64_xceil __bid64_to_uint64_xceil
653 #define bid64_to_uint64_xfloor __bid64_to_uint64_xfloor
654 #define bid64_to_uint64_xint __bid64_to_uint64_xint
655 #define bid64_to_uint64_xrnint __bid64_to_uint64_xrnint
656 #define bid64_to_uint64_xrninta __bid64_to_uint64_xrninta
657 #define bid128_to_int32_ceil __bid128_to_int32_ceil
658 #define bid128_to_int32_floor __bid128_to_int32_floor
659 #define bid128_to_int32_int __bid128_to_int32_int
660 #define bid128_to_int32_rnint __bid128_to_int32_rnint
661 #define bid128_to_int32_rninta __bid128_to_int32_rninta
662 #define bid128_to_int32_xceil __bid128_to_int32_xceil
663 #define bid128_to_int32_xfloor __bid128_to_int32_xfloor
664 #define bid128_to_int32_xint __bid128_to_int32_xint
665 #define bid128_to_int32_xrnint __bid128_to_int32_xrnint
666 #define bid128_to_int32_xrninta __bid128_to_int32_xrninta
667 #define bid128_to_uint32_ceil __bid128_to_uint32_ceil
668 #define bid128_to_uint32_floor __bid128_to_uint32_floor
669 #define bid128_to_uint32_int __bid128_to_uint32_int
670 #define bid128_to_uint32_rnint __bid128_to_uint32_rnint
671 #define bid128_to_uint32_rninta __bid128_to_uint32_rninta
672 #define bid128_to_uint32_xceil __bid128_to_uint32_xceil
673 #define bid128_to_uint32_xfloor __bid128_to_uint32_xfloor
674 #define bid128_to_uint32_xint __bid128_to_uint32_xint
675 #define bid128_to_uint32_xrnint __bid128_to_uint32_xrnint
676 #define bid128_to_uint32_xrninta __bid128_to_uint32_xrninta
677 #define bid128_to_int64_ceil __bid128_to_int64_ceil
678 #define bid128_to_int64_floor __bid128_to_int64_floor
679 #define bid128_to_int64_int __bid128_to_int64_int
680 #define bid128_to_int64_rnint __bid128_to_int64_rnint
681 #define bid128_to_int64_rninta __bid128_to_int64_rninta
682 #define bid128_to_int64_xceil __bid128_to_int64_xceil
683 #define bid128_to_int64_xfloor __bid128_to_int64_xfloor
684 #define bid128_to_int64_xint __bid128_to_int64_xint
685 #define bid128_to_int64_xrnint __bid128_to_int64_xrnint
686 #define bid128_to_int64_xrninta __bid128_to_int64_xrninta
687 #define bid128_to_uint64_ceil __bid128_to_uint64_ceil
688 #define bid128_to_uint64_floor __bid128_to_uint64_floor
689 #define bid128_to_uint64_int __bid128_to_uint64_int
690 #define bid128_to_uint64_rnint __bid128_to_uint64_rnint
691 #define bid128_to_uint64_rninta __bid128_to_uint64_rninta
692 #define bid128_to_uint64_xceil __bid128_to_uint64_xceil
693 #define bid128_to_uint64_xfloor __bid128_to_uint64_xfloor
694 #define bid128_to_uint64_xint __bid128_to_uint64_xint
695 #define bid128_to_uint64_xrnint __bid128_to_uint64_xrnint
696 #define bid128_to_uint64_xrninta __bid128_to_uint64_xrninta
697 #define bid128_to_binary128 __bid128_to_binary128
698 #define bid128_to_binary32 __bid128_to_binary32
699 #define bid128_to_binary64 __bid128_to_binary64
700 #define bid128_to_binary80 __bid128_to_binary80
701 #define bid32_to_binary128 __bid32_to_binary128
702 #define bid32_to_binary32 __bid32_to_binary32
703 #define bid32_to_binary64 __bid32_to_binary64
704 #define bid32_to_binary80 __bid32_to_binary80
705 #define bid64_to_binary128 __bid64_to_binary128
706 #define bid64_to_binary32 __bid64_to_binary32
707 #define bid64_to_binary64 __bid64_to_binary64
708 #define bid64_to_binary80 __bid64_to_binary80
709 #define binary128_to_bid128 __binary128_to_bid128
710 #define binary128_to_bid32 __binary128_to_bid32
711 #define binary128_to_bid64 __binary128_to_bid64
712 #define binary32_to_bid128 __binary32_to_bid128
713 #define binary32_to_bid32 __binary32_to_bid32
714 #define binary32_to_bid64 __binary32_to_bid64
715 #define binary64_to_bid128 __binary64_to_bid128
716 #define binary64_to_bid32 __binary64_to_bid32
717 #define binary64_to_bid64 __binary64_to_bid64
718 #define binary80_to_bid128 __binary80_to_bid128
719 #define binary80_to_bid32 __binary80_to_bid32
720 #define binary80_to_bid64 __binary80_to_bid64
721 #define bid64_to_uint16_ceil __bid64_to_uint16_ceil
722 #define bid64_to_uint16_floor __bid64_to_uint16_floor
723 #define bid64_to_uint16_int __bid64_to_uint16_int
724 #define bid64_to_uint16_rnint __bid64_to_uint16_rnint
725 #define bid64_to_uint16_rninta __bid64_to_uint16_rninta
726 #define bid64_to_uint16_xceil __bid64_to_uint16_xceil
727 #define bid64_to_uint16_xfloor __bid64_to_uint16_xfloor
728 #define bid64_to_uint16_xint __bid64_to_uint16_xint
729 #define bid64_to_uint16_xrnint __bid64_to_uint16_xrnint
730 #define bid64_to_uint16_xrninta __bid64_to_uint16_xrninta
731 #define bid64_to_int16_ceil __bid64_to_int16_ceil
732 #define bid64_to_int16_floor __bid64_to_int16_floor
733 #define bid64_to_int16_int __bid64_to_int16_int
734 #define bid64_to_int16_rnint __bid64_to_int16_rnint
735 #define bid64_to_int16_rninta __bid64_to_int16_rninta
736 #define bid64_to_int16_xceil __bid64_to_int16_xceil
737 #define bid64_to_int16_xfloor __bid64_to_int16_xfloor
738 #define bid64_to_int16_xint __bid64_to_int16_xint
739 #define bid64_to_int16_xrnint __bid64_to_int16_xrnint
740 #define bid64_to_int16_xrninta __bid64_to_int16_xrninta
741 #define bid128_to_uint16_ceil __bid128_to_uint16_ceil
742 #define bid128_to_uint16_floor __bid128_to_uint16_floor
743 #define bid128_to_uint16_int __bid128_to_uint16_int
744 #define bid128_to_uint16_rnint __bid128_to_uint16_rnint
745 #define bid128_to_uint16_rninta __bid128_to_uint16_rninta
746 #define bid128_to_uint16_xceil __bid128_to_uint16_xceil
747 #define bid128_to_uint16_xfloor __bid128_to_uint16_xfloor
748 #define bid128_to_uint16_xint __bid128_to_uint16_xint
749 #define bid128_to_uint16_xrnint __bid128_to_uint16_xrnint
750 #define bid128_to_uint16_xrninta __bid128_to_uint16_xrninta
751 #define bid128_to_int16_ceil __bid128_to_int16_ceil
752 #define bid128_to_int16_floor __bid128_to_int16_floor
753 #define bid128_to_int16_int __bid128_to_int16_int
754 #define bid128_to_int16_rnint __bid128_to_int16_rnint
755 #define bid128_to_int16_rninta __bid128_to_int16_rninta
756 #define bid128_to_int16_xceil __bid128_to_int16_xceil
757 #define bid128_to_int16_xfloor __bid128_to_int16_xfloor
758 #define bid128_to_int16_xint __bid128_to_int16_xint
759 #define bid128_to_int16_xrnint __bid128_to_int16_xrnint
760 #define bid128_to_int16_xrninta __bid128_to_int16_xrninta
761 #define bid64_to_uint8_ceil __bid64_to_uint8_ceil
762 #define bid64_to_uint8_floor __bid64_to_uint8_floor
763 #define bid64_to_uint8_int __bid64_to_uint8_int
764 #define bid64_to_uint8_rnint __bid64_to_uint8_rnint
765 #define bid64_to_uint8_rninta __bid64_to_uint8_rninta
766 #define bid64_to_uint8_xceil __bid64_to_uint8_xceil
767 #define bid64_to_uint8_xfloor __bid64_to_uint8_xfloor
768 #define bid64_to_uint8_xint __bid64_to_uint8_xint
769 #define bid64_to_uint8_xrnint __bid64_to_uint8_xrnint
770 #define bid64_to_uint8_xrninta __bid64_to_uint8_xrninta
771 #define bid64_to_int8_ceil __bid64_to_int8_ceil
772 #define bid64_to_int8_floor __bid64_to_int8_floor
773 #define bid64_to_int8_int __bid64_to_int8_int
774 #define bid64_to_int8_rnint __bid64_to_int8_rnint
775 #define bid64_to_int8_rninta __bid64_to_int8_rninta
776 #define bid64_to_int8_xceil __bid64_to_int8_xceil
777 #define bid64_to_int8_xfloor __bid64_to_int8_xfloor
778 #define bid64_to_int8_xint __bid64_to_int8_xint
779 #define bid64_to_int8_xrnint __bid64_to_int8_xrnint
780 #define bid64_to_int8_xrninta __bid64_to_int8_xrninta
781 #define bid128_to_uint8_ceil __bid128_to_uint8_ceil
782 #define bid128_to_uint8_floor __bid128_to_uint8_floor
783 #define bid128_to_uint8_int __bid128_to_uint8_int
784 #define bid128_to_uint8_rnint __bid128_to_uint8_rnint
785 #define bid128_to_uint8_rninta __bid128_to_uint8_rninta
786 #define bid128_to_uint8_xceil __bid128_to_uint8_xceil
787 #define bid128_to_uint8_xfloor __bid128_to_uint8_xfloor
788 #define bid128_to_uint8_xint __bid128_to_uint8_xint
789 #define bid128_to_uint8_xrnint __bid128_to_uint8_xrnint
790 #define bid128_to_uint8_xrninta __bid128_to_uint8_xrninta
791 #define bid128_to_int8_ceil __bid128_to_int8_ceil
792 #define bid128_to_int8_floor __bid128_to_int8_floor
793 #define bid128_to_int8_int __bid128_to_int8_int
794 #define bid128_to_int8_rnint __bid128_to_int8_rnint
795 #define bid128_to_int8_rninta __bid128_to_int8_rninta
796 #define bid128_to_int8_xceil __bid128_to_int8_xceil
797 #define bid128_to_int8_xfloor __bid128_to_int8_xfloor
798 #define bid128_to_int8_xint __bid128_to_int8_xint
799 #define bid128_to_int8_xrnint __bid128_to_int8_xrnint
800 #define bid128_to_int8_xrninta __bid128_to_int8_xrninta
801 
802 #define bid32_inf __bid32_inf
803 #define bid64_inf __bid64_inf
804 #define bid128_inf __bid128_inf
805 
806 #define bid_feclearexcept __bid_feclearexcept
807 #define bid_fegetexceptflag __bid_fegetexceptflag
808 #define bid_feraiseexcept __bid_feraiseexcept
809 #define bid_fesetexceptflag __bid_fesetexceptflag
810 #define bid_fetestexcept __bid_fetestexcept
811 
812 #define bid_strtod128 __bid_strtod128
813 #define bid_strtod64  __bid_strtod64
814 #define bid_strtod32  __bid_strtod32
815 #define bid_wcstod128 __bid_wcstod128
816 #define bid_wcstod64  __bid_wcstod64
817 #define bid_wcstod32  __bid_wcstod32
818 
819 #ifdef IN_LIBGCC2
820 #if !defined ENABLE_DECIMAL_BID_FORMAT || !ENABLE_DECIMAL_BID_FORMAT
821 #error BID not enabled in libbid
822 #endif
823 
824 #ifndef BID_BIG_ENDIAN
825 #define BID_BIG_ENDIAN LIBGCC2_FLOAT_WORDS_BIG_ENDIAN
826 #endif
827 
828 #ifndef BID_THREAD
829 #if defined (HAVE_CC_TLS) && defined (USE_TLS)
830 #define BID_THREAD __thread
831 #endif
832 #endif
833 
834 #define BID__intptr_t_defined
835 #define DECIMAL_CALL_BY_REFERENCE 0
836 #define DECIMAL_GLOBAL_ROUNDING 1
837 #define DECIMAL_GLOBAL_ROUNDING_ACCESS_FUNCTIONS 1
838 #define DECIMAL_GLOBAL_EXCEPTION_FLAGS 1
839 #define DECIMAL_GLOBAL_EXCEPTION_FLAGS_ACCESS_FUNCTIONS 1
840 #define BID_HAS_GCC_DECIMAL_INTRINSICS 1
841 #endif /* IN_LIBGCC2 */
842 
843 // Configuration Options
844 
845 #define DECIMAL_TINY_DETECTION_AFTER_ROUNDING 0
846 #define BINARY_TINY_DETECTION_AFTER_ROUNDING 1
847 
848 #define BID_SET_STATUS_FLAGS
849 
850 #ifndef BID_THREAD
851 #if defined (_MSC_VER) //Windows
852 #define BID_THREAD __declspec(thread)
853 #else
854 #if !defined(__APPLE__) //Linux, FreeBSD
855 #define BID_THREAD __thread
856 #else //Mac OSX, TBD
857 #define BID_THREAD
858 #endif //Linux or Mac
859 #endif //Windows
860 #endif //BID_THREAD
861 
862 
863 #ifndef BID_HAS_GCC_DECIMAL_INTRINSICS
864 #define BID_HAS_GCC_DECIMAL_INTRINSICS 0
865 #endif
866 
867 // set sizeof (long) here, for bid32_lrint(), bid64_lrint(), bid128_lrint(),
868 // and for bid32_lround(), bid64_lround(), bid128_lround()
869 #ifndef BID_SIZE_LONG
870 #if defined(WINDOWS)
871 #define BID_SIZE_LONG 4
872 #else
873 #if defined(__x86_64__) || defined (__ia64__) || defined(__powerpc64__)
874 #define BID_SIZE_LONG 8
875 #else
876 #define BID_SIZE_LONG 4
877 #endif
878 #endif
879 #endif
880 
881 #if !defined(WINDOWS) || defined(__INTEL_COMPILER)
882 // #define UNCHANGED_BINARY_STATUS_FLAGS
883 #endif
884 // #define HPUX_OS
885 
886 // If DECIMAL_CALL_BY_REFERENCE is defined then numerical arguments and results
887 // are passed by reference otherwise they are passed by value (except that
888 // a pointer is always passed to the status flags)
889 
890 #ifndef DECIMAL_CALL_BY_REFERENCE
891 #define DECIMAL_CALL_BY_REFERENCE 0
892 #endif
893 
894 // If DECIMAL_GLOBAL_ROUNDING is defined then the rounding mode is a global
895 // variable _IDEC_glbround, otherwise it is passed as a parameter when needed
896 
897 #ifndef DECIMAL_GLOBAL_ROUNDING
898 #define DECIMAL_GLOBAL_ROUNDING 0
899 #endif
900 
901 #ifndef DECIMAL_GLOBAL_ROUNDING_ACCESS_FUNCTIONS
902 #define DECIMAL_GLOBAL_ROUNDING_ACCESS_FUNCTIONS 0
903 #endif
904 
905 // If DECIMAL_GLOBAL_EXCEPTION_FLAGS is defined then the exception status flags
906 // are represented by a global variable _IDEC_glbflags, otherwise they are
907 // passed as a parameter when needed
908 
909 #ifndef DECIMAL_GLOBAL_EXCEPTION_FLAGS
910 #define DECIMAL_GLOBAL_EXCEPTION_FLAGS 0
911 #endif
912 
913 #ifndef DECIMAL_GLOBAL_EXCEPTION_FLAGS_ACCESS_FUNCTIONS
914 #define DECIMAL_GLOBAL_EXCEPTION_FLAGS_ACCESS_FUNCTIONS 0
915 #endif
916 
917 // If DECIMAL_ALTERNATE_EXCEPTION_HANDLING is defined then the exception masks
918 // are examined and exception handling information is provided to the caller
919 // if alternate exception handling is necessary
920 
921 #ifndef DECIMAL_ALTERNATE_EXCEPTION_HANDLING
922 #define DECIMAL_ALTERNATE_EXCEPTION_HANDLING 0
923 #endif
924 
925 typedef unsigned int _IDEC_round;
926 typedef unsigned int _IDEC_flags;       // could be a struct with diagnostic info
927 
928 #if DECIMAL_ALTERNATE_EXCEPTION_HANDLING
929   // If DECIMAL_GLOBAL_EXCEPTION_MASKS is defined then the exception mask bits
930   // are represented by a global variable _IDEC_exceptionmasks, otherwise they
931   // are passed as a parameter when needed; DECIMAL_GLOBAL_EXCEPTION_MASKS is
932   // ignored
933   // if DECIMAL_ALTERNATE_EXCEPTION_HANDLING is not defined
934   // **************************************************************************
935 #define DECIMAL_GLOBAL_EXCEPTION_MASKS 0
936   // **************************************************************************
937 
938   // If DECIMAL_GLOBAL_EXCEPTION_INFO is defined then the alternate exception
939   // handling information is represented by a global data structure
940   // _IDEC_glbexcepthandling, otherwise it is passed by reference as a
941   // parameter when needed; DECIMAL_GLOBAL_EXCEPTION_INFO is ignored
942   // if DECIMAL_ALTERNATE_EXCEPTION_HANDLING is not defined
943   // **************************************************************************
944 #define DECIMAL_GLOBAL_EXCEPTION_INFO 0
945   // **************************************************************************
946 #endif
947 
948 // Notes: 1) rnd_mode from _RND_MODE_ARG is used by the caller of a function
949 //           from this library, and can be any name
950 //        2) rnd_mode and prnd_mode from _RND_MODE_PARAM are fixed names
951 //           and *must* be used in the library functions
952 //        3) _IDEC_glbround is the fixed name for the global variable holding
953 //           the rounding mode
954 
955 #if !DECIMAL_GLOBAL_ROUNDING
956 #if DECIMAL_CALL_BY_REFERENCE
957 #define _RND_MODE_ARG , &rnd_mode
958 #define _RND_MODE_PARAM , _IDEC_round *prnd_mode
959 #define _RND_MODE_PARAM_0 _IDEC_round *prnd_mode
960 #define _RND_MODE_ARG_ALONE &rnd_mode
961 #define _RND_MODE_PARAM_ALONE _IDEC_round *prnd_mode
962 #else
963 #define _RND_MODE_ARG , rnd_mode
964 #define _RND_MODE_PARAM , _IDEC_round rnd_mode
965 #define _RND_MODE_PARAM_0 _IDEC_round rnd_mode
966 #define _RND_MODE_ARG_ALONE rnd_mode
967 #define _RND_MODE_PARAM_ALONE _IDEC_round rnd_mode
968 #endif
969 #else
970 #define _RND_MODE_ARG
971 #define _RND_MODE_PARAM
972 #define _RND_MODE_ARG_ALONE
973 #define _RND_MODE_PARAM_ALONE
974 #define rnd_mode _IDEC_glbround
975 #endif
976 
977 // Notes: 1) pfpsf from _EXC_FLAGS_ARG is used by the caller of a function
978 //           from this library, and can be any name
979 //        2) pfpsf from _EXC_FLAGS_PARAM is a fixed name and *must* be used
980 //           in the library functions
981 //        3) _IDEC_glbflags is the fixed name for the global variable holding
982 //           the floating-point status flags
983 #if !DECIMAL_GLOBAL_EXCEPTION_FLAGS
984 #define _EXC_FLAGS_ARG , pfpsf
985 #define _EXC_FLAGS_PARAM , _IDEC_flags *pfpsf
986 #else
987 #define _EXC_FLAGS_ARG
988 #define _EXC_FLAGS_PARAM
989 #define pfpsf &_IDEC_glbflags
990 #endif
991 
992 #if DECIMAL_GLOBAL_ROUNDING
993 BID_EXTERN_C BID_THREAD _IDEC_round _IDEC_glbround;
994 #endif
995 
996 #if DECIMAL_GLOBAL_EXCEPTION_FLAGS
997 BID_EXTERN_C BID_THREAD _IDEC_flags _IDEC_glbflags;
998 #endif
999 
1000 #if DECIMAL_ALTERNATE_EXCEPTION_HANDLING
1001 #if DECIMAL_GLOBAL_EXCEPTION_MASKS
1002 BID_EXTERN_C BID_THREAD _IDEC_exceptionmasks _IDEC_glbexceptionmasks;
1003 #endif
1004 #if DECIMAL_GLOBAL_EXCEPTION_INFO
1005 BID_EXTERN_C BID_THREAD _IDEC_excepthandling _IDEC_glbexcepthandling;
1006 #endif
1007 #endif
1008 
1009 #if DECIMAL_ALTERNATE_EXCEPTION_HANDLING
1010 
1011   // Notes: 1) exc_mask from _EXC_MASKS_ARG is used by the caller of a function
1012   //           from this library, and can be any name
1013   //        2) exc_mask and pexc_mask from _EXC_MASKS_PARAM are fixed names
1014   //           and *must* be used in the library functions
1015   //        3) _IDEC_glbexceptionmasks is the fixed name for the global
1016   //           variable holding the floating-point exception masks
1017 #if !DECIMAL_GLOBAL_EXCEPTION_MASKS
1018 #if DECIMAL_CALL_BY_REFERENCE
1019 #define _EXC_MASKS_ARG , &exc_mask
1020 #define _EXC_MASKS_PARAM , _IDEC_exceptionmasks *pexc_mask
1021 #else
1022 #define _EXC_MASKS_ARG , exc_mask
1023 #define _EXC_MASKS_PARAM , _IDEC_exceptionmasks exc_mask
1024 #endif
1025 #else
1026 #define _EXC_MASKS_ARG
1027 #define _EXC_MASKS_PARAM
1028 #define exc_mask _IDEC_glbexceptionmasks
1029 #endif
1030 
1031   // Notes: 1) BID_pexc_info from _EXC_INFO_ARG is used by the caller of a function
1032   //           from this library, and can be any name
1033   //        2) BID_pexc_info from _EXC_INFO_PARAM is a fixed name and *must* be
1034   //           used in the library functions
1035   //        3) _IDEC_glbexcepthandling is the fixed name for the global
1036   //           variable holding the floating-point exception information
1037 #if !DECIMAL_GLOBAL_EXCEPTION_INFO
1038 #define _EXC_INFO_ARG , BID_pexc_info
1039 #define _EXC_INFO_PARAM , _IDEC_excepthandling *BID_pexc_info
1040 #else
1041 #define _EXC_INFO_ARG
1042 #define _EXC_INFO_PARAM
1043 #define BID_pexc_info &_IDEC_glbexcepthandling
1044 #endif
1045 #else
1046 #define _EXC_MASKS_ARG
1047 #define _EXC_MASKS_PARAM
1048 #define _EXC_INFO_ARG
1049 #define _EXC_INFO_PARAM
1050 #endif
1051 
1052 #ifndef BID_BIG_ENDIAN
1053 #define BID_BIG_ENDIAN 0
1054 #endif
1055 
1056 #if BID_BIG_ENDIAN
1057 #define BID_SWAP128(x) {  \
1058   BID_UINT64 sw;              \
1059   sw = (x).w[1];          \
1060   (x).w[1] = (x).w[0];    \
1061   (x).w[0] = sw;          \
1062   }
1063 #else
1064 #define BID_SWAP128(x)
1065 #endif
1066 
1067 #if DECIMAL_CALL_BY_REFERENCE
1068 #define BID_RETURN_VAL(x) { BID_OPT_RESTORE_BINARY_FLAGS()  *pres = (x); return; }
1069 #if BID_BIG_ENDIAN && defined BID_128RES
1070 #define BID_RETURN(x) { BID_OPT_RESTORE_BINARY_FLAGS()  BID_SWAP128(x); *pres = (x); return; }
1071 #define BID_RETURN_NOFLAGS(x) { BID_SWAP128(x); *pres = (x); return; }
1072 #else
1073 #define BID_RETURN(x) { BID_OPT_RESTORE_BINARY_FLAGS()  *pres = (x); return; }
1074 #define BID_RETURN_NOFLAGS(x) { *pres = (x); return; }
1075 #endif
1076 #else
1077 #define BID_RETURN_VAL(x) { BID_OPT_RESTORE_BINARY_FLAGS()  return(x); }
1078 #if BID_BIG_ENDIAN && defined BID_128RES
1079 #define BID_RETURN(x) { BID_OPT_RESTORE_BINARY_FLAGS()  BID_SWAP128(x); return(x); }
1080 #define BID_RETURN_NOFLAGS(x) { BID_SWAP128(x); return(x); }
1081 #else
1082 #define BID_RETURN(x) { BID_OPT_RESTORE_BINARY_FLAGS()  return(x); }
1083 #define BID_RETURN_NOFLAGS(x) { return(x); }
1084 #endif
1085 #endif
1086 
1087 #if DECIMAL_CALL_BY_REFERENCE
1088 #define BIDECIMAL_CALL1(_FUNC, _RES, _OP1) \
1089     _FUNC(&(_RES), &(_OP1) _RND_MODE_ARG _EXC_FLAGS_ARG _EXC_MASKS_ARG _EXC_INFO_ARG)
1090 #define BIDECIMAL_CALL1_NORND(_FUNC, _RES, _OP1) \
1091     _FUNC(&(_RES), &(_OP1) _EXC_FLAGS_ARG _EXC_MASKS_ARG _EXC_INFO_ARG)
1092 #define BIDECIMAL_CALL2(_FUNC, _RES, _OP1, _OP2) \
1093     _FUNC(&(_RES), &(_OP1), &(_OP2) _RND_MODE_ARG _EXC_FLAGS_ARG _EXC_MASKS_ARG _EXC_INFO_ARG)
1094 #define BIDECIMAL_CALL2_YPTR_NORND(_FUNC, _RES, _OP1, _OP2) \
1095     _FUNC(&(_RES), &(_OP1), &(_OP2) _EXC_FLAGS_ARG _EXC_MASKS_ARG _EXC_INFO_ARG)
1096 #define BIDECIMAL_CALL2_NORND(_FUNC, _RES, _OP1, _OP2) \
1097     _FUNC(&(_RES), &(_OP1), &(_OP2) _EXC_FLAGS_ARG _EXC_MASKS_ARG _EXC_INFO_ARG)
1098 #define BIDECIMAL_CALL1_NORND_RESREF(_FUNC, _RES, _OP1) \
1099     _FUNC((_RES), &(_OP1) _EXC_FLAGS_ARG _EXC_MASKS_ARG _EXC_INFO_ARG)
1100 #define BIDECIMAL_CALL1_RESARG(_FUNC, _RES, _OP1) \
1101     _FUNC(&(_RES), (_OP1) _RND_MODE_ARG _EXC_FLAGS_ARG _EXC_MASKS_ARG _EXC_INFO_ARG)
1102 #define BIDECIMAL_CALL1_RESREF(_FUNC, _RES, _OP1) \
1103     _FUNC((_RES), &(_OP1) _RND_MODE_ARG _EXC_FLAGS_ARG _EXC_MASKS_ARG _EXC_INFO_ARG)
1104 #define BIDECIMAL_CALL1_NORND_NOSTAT(_FUNC, _RES, _OP1) \
1105     _FUNC(&(_RES), &(_OP1) _EXC_MASKS_ARG _EXC_INFO_ARG)
1106 #define BIDECIMAL_CALL2_NORND_NOSTAT(_FUNC, _RES, _OP1, _OP2) \
1107     _FUNC(&(_RES), &(_OP1), &(_OP2) _EXC_MASKS_ARG _EXC_INFO_ARG)
1108 #define BIDECIMAL_CALL3(_FUNC, _RES, _OP1, _OP2, _OP3) \
1109     _FUNC(&(_RES), &(_OP1), &(_OP2), &(_OP3) _RND_MODE_ARG _EXC_FLAGS_ARG _EXC_MASKS_ARG _EXC_INFO_ARG)
1110 #define BIDECIMAL_CALL1_NORND_NOMASK_NOINFO(_FUNC, _RES, _OP1) \
1111     _FUNC(&(_RES), &(_OP1) _EXC_FLAGS_ARG )
1112 #define BIDECIMAL_CALL1_NORND_NOFLAGS_NOMASK_NOINFO(_FUNC, _RES, _OP1) \
1113     _FUNC(&(_RES), &(_OP1) )
1114 #define BIDECIMAL_CALL1_NORND_NOFLAGS_NOMASK_NOINFO_ARGREF(_FUNC, _RES, _OP1) \
1115     _FUNC(&(_RES), (_OP1) )
1116 #define BIDECIMAL_CALL2_NORND_NOFLAGS_NOMASK_NOINFO(_FUNC, _RES, _OP1, _OP2) \
1117     _FUNC(&(_RES), &(_OP1), &(_OP2) )
1118 #define BIDECIMAL_CALL2_NORND_NOFLAGS_NOMASK_NOINFO_ARG2REF(_FUNC, _RES, _OP1, _OP2) \
1119     _FUNC(&(_RES), &(_OP1), (_OP2) )
1120 #define BIDECIMAL_CALL1_NORND_NOMASK_NOINFO_RESVOID(_FUNC, _OP1) \
1121     _FUNC(&(_OP1) _EXC_FLAGS_ARG )
1122 #define BIDECIMAL_CALL2_NORND_NOMASK_NOINFO_RESVOID(_FUNC, _OP1, _OP2) \
1123     _FUNC(&(_OP1), &(_OP2) _EXC_FLAGS_ARG )
1124 #define BIDECIMAL_CALLV_NOFLAGS_NOMASK_NOINFO(_FUNC, _RES) \
1125     _FUNC(&(_RES) _RND_MODE_ARG)
1126 #define BIDECIMAL_CALL1_NOFLAGS_NOMASK_NOINFO(_FUNC, _RES, _OP1) \
1127     _FUNC(&(_OP1) _RND_MODE_ARG)
1128 #define BIDECIMAL_CALLV_EMPTY(_FUNC, _RES) \
1129     _FUNC(&(_RES))
1130 #else
1131 #define BIDECIMAL_CALL1(_FUNC, _RES, _OP1) \
1132     _RES = _FUNC((_OP1) _RND_MODE_ARG _EXC_FLAGS_ARG _EXC_MASKS_ARG _EXC_INFO_ARG)
1133 #define BIDECIMAL_CALL1_NORND(_FUNC, _RES, _OP1) \
1134     _RES = _FUNC((_OP1) _EXC_FLAGS_ARG _EXC_MASKS_ARG _EXC_INFO_ARG)
1135 #define BIDECIMAL_CALL2(_FUNC, _RES, _OP1, _OP2) \
1136     _RES = _FUNC((_OP1), (_OP2) _RND_MODE_ARG _EXC_FLAGS_ARG _EXC_MASKS_ARG _EXC_INFO_ARG)
1137 #define BIDECIMAL_CALL2_YPTR_NORND(_FUNC, _RES, _OP1, _OP2) \
1138     _RES = _FUNC((_OP1), &(_OP2) _EXC_FLAGS_ARG _EXC_MASKS_ARG _EXC_INFO_ARG)
1139 #define BIDECIMAL_CALL2_NORND(_FUNC, _RES, _OP1, _OP2) \
1140     _RES = _FUNC((_OP1), (_OP2) _EXC_FLAGS_ARG _EXC_MASKS_ARG _EXC_INFO_ARG)
1141 #define BIDECIMAL_CALL1_NORND_RESREF(_FUNC, _RES, _OP1) \
1142     _FUNC((_RES), _OP1 _EXC_FLAGS_ARG _EXC_MASKS_ARG _EXC_INFO_ARG)
1143 #define BIDECIMAL_CALL1_RESARG(_FUNC, _RES, _OP1) \
1144     _RES = _FUNC((_OP1) _RND_MODE_ARG _EXC_FLAGS_ARG _EXC_MASKS_ARG _EXC_INFO_ARG)
1145 #define BIDECIMAL_CALL1_RESREF(_FUNC, _RES, _OP1) \
1146     _FUNC((_RES), _OP1 _RND_MODE_ARG _EXC_FLAGS_ARG _EXC_MASKS_ARG _EXC_INFO_ARG)
1147 #define BIDECIMAL_CALL1_NORND_NOSTAT(_FUNC, _RES, _OP1) \
1148     _RES = _FUNC((_OP1) _EXC_MASKS_ARG _EXC_INFO_ARG)
1149 #define BIDECIMAL_CALL2_NORND_NOSTAT(_FUNC, _RES, _OP1, _OP2) \
1150     _RES = _FUNC((_OP1), (_OP2) _EXC_MASKS_ARG _EXC_INFO_ARG)
1151 #define BIDECIMAL_CALL3(_FUNC, _RES, _OP1, _OP2, _OP3) \
1152     _RES = _FUNC((_OP1), (_OP2), (_OP3) _RND_MODE_ARG _EXC_FLAGS_ARG _EXC_MASKS_ARG _EXC_INFO_ARG)
1153 #define BIDECIMAL_CALL1_NORND_NOMASK_NOINFO(_FUNC, _RES, _OP1) \
1154     _RES = _FUNC((_OP1) _EXC_FLAGS_ARG)
1155 #define BIDECIMAL_CALL1_NORND_NOFLAGS_NOMASK_NOINFO(_FUNC, _RES, _OP1) \
1156     _RES = _FUNC((_OP1) )
1157 #define BIDECIMAL_CALL1_NORND_NOFLAGS_NOMASK_NOINFO_ARGREF(_FUNC, _RES, _OP1) \
1158     _RES = _FUNC((_OP1) )
1159 #define BIDECIMAL_CALL2_NORND_NOFLAGS_NOMASK_NOINFO(_FUNC, _RES, _OP1, _OP2) \
1160     _RES = _FUNC((_OP1), (_OP2) )
1161 #define BIDECIMAL_CALL2_NORND_NOFLAGS_NOMASK_NOINFO_ARG2REF(_FUNC, _RES, _OP1, _OP2) \
1162     _RES = _FUNC((_OP1), (_OP2) )
1163 #define BIDECIMAL_CALL1_NORND_NOMASK_NOINFO_RESVOID(_FUNC, _OP1) \
1164     _FUNC((_OP1) _EXC_FLAGS_ARG)
1165 #define BIDECIMAL_CALL2_NORND_NOMASK_NOINFO_RESVOID(_FUNC, _OP1, _OP2) \
1166     _FUNC((_OP1), (_OP2) _EXC_FLAGS_ARG)
1167 #define BIDECIMAL_CALLV_NOFLAGS_NOMASK_NOINFO(_FUNC, _RES) \
1168     _RES = _FUNC(_RND_MODE_ARG_ALONE)
1169 #if !DECIMAL_GLOBAL_ROUNDING
1170 #define BIDECIMAL_CALL1_NOFLAGS_NOMASK_NOINFO(_FUNC, _RES, _OP1) \
1171     _RES = _FUNC((_OP1) _RND_MODE_ARG)
1172 #else
1173 #define BIDECIMAL_CALL1_NOFLAGS_NOMASK_NOINFO(_FUNC, _RES, _OP1) \
1174     _FUNC((_OP1) _RND_MODE_ARG)
1175 #endif
1176 #define BIDECIMAL_CALLV_EMPTY(_FUNC, _RES) \
1177     _RES=_FUNC()
1178 #endif
1179 
1180 #if BID_BIG_ENDIAN
1181 #define BID_HIGH_128W 0
1182 #define BID_LOW_128W  1
1183 #else
1184 #define BID_HIGH_128W 1
1185 #define BID_LOW_128W  0
1186 #endif
1187 
1188 #if BID_BIG_ENDIAN
1189 #define BID_COPY_ARG_REF(arg_name) \
1190        BID_UINT128 arg_name={{ pbid_##arg_name->w[1], pbid_##arg_name->w[0]}};
1191 #define BID_COPY_ARG_VAL(arg_name) \
1192        BID_UINT128 arg_name={{ bid_##arg_name.w[1], bid_##arg_name.w[0]}};
1193 #else
1194 #define BID_COPY_ARG_REF(arg_name) \
1195        BID_UINT128 arg_name=*pbid_##arg_name;
1196 #define BID_COPY_ARG_VAL(arg_name) \
1197        BID_UINT128 arg_name= bid_##arg_name;
1198 #endif
1199 
1200 #define BID_COPY_ARG_TYPE_REF(type, arg_name) \
1201        type arg_name=*pbid_##arg_name;
1202 #define BID_COPY_ARG_TYPE_VAL(type, arg_name) \
1203        type arg_name= bid_##arg_name;
1204 
1205 #if !DECIMAL_GLOBAL_ROUNDING
1206 #define BID_SET_RND_MODE() \
1207   _IDEC_round rnd_mode = *prnd_mode;
1208 #else
1209 #define BID_SET_RND_MODE()
1210 #endif
1211 
1212 #if !defined(BID_MS_FLAGS) && (defined(_MSC_VER) && !defined(__INTEL_COMPILER))
1213 #   define BID_MS_FLAGS
1214 #endif
1215 
1216 #if defined (UNCHANGED_BINARY_STATUS_FLAGS) && defined (BID_FUNCTION_SETS_BINARY_FLAGS)
1217 #   if defined( BID_MS_FLAGS )
1218 
1219 #       include <float.h>
1220 
1221         extern unsigned int __bid_ms_restore_flags(unsigned int*);
1222 
1223 #       define BID_OPT_FLAG_DECLARE() \
1224             unsigned int binaryflags = 0;
1225 #       define BID_OPT_SAVE_BINARY_FLAGS() \
1226              binaryflags = _statusfp();
1227 #        define BID_OPT_RESTORE_BINARY_FLAGS() \
1228               __bid_ms_restore_flags(&binaryflags);
1229 
1230 #   else
1231 #       include <fenv.h>
1232 #       define BID_FE_ALL_FLAGS FE_INVALID|FE_DIVBYZERO|FE_OVERFLOW|FE_UNDERFLOW|FE_INEXACT
1233 #       define BID_OPT_FLAG_DECLARE() \
1234             fexcept_t binaryflags = 0;
1235 #       define BID_OPT_SAVE_BINARY_FLAGS() \
1236             (void) fegetexceptflag (&binaryflags, BID_FE_ALL_FLAGS);
1237 #       define BID_OPT_RESTORE_BINARY_FLAGS() \
1238             (void) fesetexceptflag (&binaryflags, BID_FE_ALL_FLAGS);
1239 #   endif
1240 #else
1241 #   define BID_OPT_FLAG_DECLARE()
1242 #   define BID_OPT_SAVE_BINARY_FLAGS()
1243 #   define BID_OPT_RESTORE_BINARY_FLAGS()
1244 #endif
1245 
1246 #define BID_PROLOG_REF(arg_name) \
1247        BID_COPY_ARG_REF(arg_name)
1248 
1249 #define BID_PROLOG_VAL(arg_name) \
1250        BID_COPY_ARG_VAL(arg_name)
1251 
1252 #define BID_PROLOG_TYPE_REF(type, arg_name) \
1253        BID_COPY_ARG_TYPE_REF(type, arg_name)
1254 
1255 #define BID_PROLOG_TYPE_VAL(type, arg_name) \
1256       BID_COPY_ARG_TYPE_VAL(type, arg_name)
1257 
1258 #define OTHER_BID_PROLOG_REF()    BID_OPT_FLAG_DECLARE()
1259 #define OTHER_BID_PROLOG_VAL()    BID_OPT_FLAG_DECLARE()
1260 
1261 #if DECIMAL_CALL_BY_REFERENCE
1262 #define       BID128_FUNCTION_ARG1(fn_name, arg_name)\
1263       void fn_name (BID_UINT128 * pres, \
1264            BID_UINT128 *  \
1265            pbid_##arg_name _RND_MODE_PARAM _EXC_FLAGS_PARAM _EXC_MASKS_PARAM \
1266            _EXC_INFO_PARAM) {\
1267      BID_PROLOG_REF(arg_name)   \
1268      BID_SET_RND_MODE()         \
1269      OTHER_BID_PROLOG_REF()
1270 
1271 #define       BID128_FUNCTION_ARG1_NORND(fn_name, arg_name)\
1272       void fn_name (BID_UINT128 * pres, \
1273            BID_UINT128 *  \
1274            pbid_##arg_name _EXC_FLAGS_PARAM _EXC_MASKS_PARAM \
1275            _EXC_INFO_PARAM) {\
1276      BID_PROLOG_REF(arg_name)   \
1277      OTHER_BID_PROLOG_REF()
1278 
1279 #define       BID128_FUNCTION_ARG1_NORND_CUSTOMRESTYPE(restype, fn_name, arg_name)\
1280       void fn_name (restype * pres, \
1281            BID_UINT128 *  \
1282            pbid_##arg_name _EXC_FLAGS_PARAM _EXC_MASKS_PARAM \
1283            _EXC_INFO_PARAM) {\
1284      BID_PROLOG_REF(arg_name)   \
1285      OTHER_BID_PROLOG_REF()
1286 
1287 #define       BID128_FUNCTION_ARG2(fn_name, arg_name1, arg_name2)\
1288       void fn_name (BID_UINT128 * pres, \
1289            BID_UINT128 *pbid_##arg_name1,  BID_UINT128 *pbid_##arg_name2  \
1290            _RND_MODE_PARAM _EXC_FLAGS_PARAM _EXC_MASKS_PARAM \
1291            _EXC_INFO_PARAM) {\
1292      BID_PROLOG_REF(arg_name1)   \
1293      BID_PROLOG_REF(arg_name2)   \
1294      BID_SET_RND_MODE()         \
1295      OTHER_BID_PROLOG_REF()
1296 
1297 #define       BID128_FUNCTION_ARG2_NORND_CUSTOMRESTYPE(restype, fn_name, arg_name1, arg_name2)\
1298       void fn_name (restype * pres, \
1299            BID_UINT128 *pbid_##arg_name1,  BID_UINT128 *pbid_##arg_name2  \
1300            _EXC_FLAGS_PARAM _EXC_MASKS_PARAM \
1301            _EXC_INFO_PARAM) {\
1302      BID_PROLOG_REF(arg_name1)   \
1303      BID_PROLOG_REF(arg_name2)   \
1304      OTHER_BID_PROLOG_REF()
1305 
1306 #define       BID128_FUNCTION_ARG2P_NORND_CUSTOMRESTYPE(restype, fn_name, arg_name1, arg_name2)\
1307       void fn_name (restype * pres, \
1308            BID_UINT128 *pbid_##arg_name1,  BID_UINT128 *arg_name2  \
1309            _EXC_FLAGS_PARAM _EXC_MASKS_PARAM \
1310            _EXC_INFO_PARAM) {\
1311      BID_PROLOG_REF(arg_name1)   \
1312      OTHER_BID_PROLOG_REF()
1313 
1314 #define       BID128_FUNCTION_ARG3P_NORND_CUSTOMRESTYPE(restype, fn_name, arg_name1, arg_name2, res_name3)\
1315       void fn_name (restype * pres, \
1316            BID_UINT128 *pbid_##arg_name1,  BID_UINT128 *pbid_##arg_name2, BID_UINT128 *res_name3  \
1317            _EXC_FLAGS_PARAM _EXC_MASKS_PARAM \
1318            _EXC_INFO_PARAM) {\
1319      BID_PROLOG_REF(arg_name1)   \
1320      BID_PROLOG_REF(arg_name2)   \
1321      OTHER_BID_PROLOG_REF()
1322 
1323 #define       BID128_FUNCTION_ARG128_ARGTYPE2(fn_name, arg_name1, type2, arg_name2)\
1324       void fn_name (BID_UINT128 * pres, \
1325            BID_UINT128 *pbid_##arg_name1,  type2 *pbid_##arg_name2  \
1326            _RND_MODE_PARAM _EXC_FLAGS_PARAM _EXC_MASKS_PARAM \
1327            _EXC_INFO_PARAM) {\
1328      BID_PROLOG_REF(arg_name1)   \
1329      BID_PROLOG_TYPE_REF(type2, arg_name2)   \
1330      BID_SET_RND_MODE()         \
1331      OTHER_BID_PROLOG_REF()
1332 
1333 #define       BID_TYPE0_FUNCTION_ARGTYPE1_ARGTYPE2(type0, fn_name, type1, arg_name1, type2, arg_name2)\
1334       void fn_name (type0 *pres, \
1335            type1 *pbid_##arg_name1,  type2 *pbid_##arg_name2  \
1336            _RND_MODE_PARAM _EXC_FLAGS_PARAM _EXC_MASKS_PARAM \
1337            _EXC_INFO_PARAM) {\
1338      BID_PROLOG_TYPE_REF(type1, arg_name1)   \
1339      BID_PROLOG_TYPE_REF(type2, arg_name2)   \
1340      BID_SET_RND_MODE()         \
1341      OTHER_BID_PROLOG_REF()
1342 
1343 #define       BID_TYPE0_FUNCTION_ARGTYPE1_ARGTYPE2_ARGTYPE3(type0, fn_name, type1, arg_name1, type2, arg_name2, type3, arg_name3)\
1344       void fn_name (type0 *pres, \
1345            type1 *pbid_##arg_name1,  type2 *pbid_##arg_name2,  type3 *pbid_##arg_name3  \
1346            _RND_MODE_PARAM _EXC_FLAGS_PARAM _EXC_MASKS_PARAM \
1347            _EXC_INFO_PARAM) {\
1348      BID_PROLOG_TYPE_REF(type1, arg_name1)   \
1349      BID_PROLOG_TYPE_REF(type2, arg_name2)   \
1350      BID_PROLOG_TYPE_REF(type3, arg_name3)   \
1351      BID_SET_RND_MODE()         \
1352      OTHER_BID_PROLOG_REF()
1353 
1354 #define       BID_TYPE_FUNCTION_ARG2(type0, fn_name, arg_name1, arg_name2)\
1355       void fn_name (type0 *pres, \
1356            type0 *pbid_##arg_name1,  type0 *pbid_##arg_name2  \
1357            _RND_MODE_PARAM _EXC_FLAGS_PARAM _EXC_MASKS_PARAM \
1358            _EXC_INFO_PARAM) {\
1359      BID_PROLOG_TYPE_REF(type0, arg_name1)   \
1360      BID_PROLOG_TYPE_REF(type0, arg_name2)   \
1361      BID_SET_RND_MODE()         \
1362      OTHER_BID_PROLOG_REF()
1363 
1364 #define       BID_TYPE_FUNCTION_ARG1(type0, fn_name, arg_name1)\
1365       void fn_name (type0 *pres, \
1366            type0 *pbid_##arg_name1  \
1367            _RND_MODE_PARAM _EXC_FLAGS_PARAM _EXC_MASKS_PARAM \
1368            _EXC_INFO_PARAM) {\
1369      BID_PROLOG_TYPE_REF(type0, arg_name1)   \
1370      BID_SET_RND_MODE()         \
1371      OTHER_BID_PROLOG_REF()
1372 
1373 #define       BID128_FUNCTION_ARGTYPE1_ARG128(fn_name, type1, arg_name1, arg_name2)\
1374       void fn_name (BID_UINT128 * pres, \
1375            type1 *pbid_##arg_name1,  BID_UINT128 *pbid_##arg_name2  \
1376            _RND_MODE_PARAM _EXC_FLAGS_PARAM _EXC_MASKS_PARAM \
1377            _EXC_INFO_PARAM) {\
1378      BID_PROLOG_TYPE_REF(type1, arg_name1)   \
1379      BID_PROLOG_REF(arg_name2)   \
1380      BID_SET_RND_MODE()         \
1381      OTHER_BID_PROLOG_REF()
1382 
1383 #define       BID_TYPE0_FUNCTION_ARG128_ARGTYPE2(type0, fn_name, arg_name1, type2, arg_name2)\
1384       void fn_name (type0 *pres, \
1385            BID_UINT128 *pbid_##arg_name1,  type2 *pbid_##arg_name2  \
1386            _RND_MODE_PARAM _EXC_FLAGS_PARAM _EXC_MASKS_PARAM \
1387            _EXC_INFO_PARAM) {\
1388      BID_PROLOG_REF(arg_name1)   \
1389      BID_PROLOG_TYPE_REF(type2, arg_name2)   \
1390      BID_SET_RND_MODE()         \
1391      OTHER_BID_PROLOG_REF()
1392 
1393 #define       BID_TYPE0_FUNCTION_ARGTYPE1_ARG128(type0, fn_name, type1, arg_name1, arg_name2)\
1394       void fn_name (type0 *pres, \
1395            type1 *pbid_##arg_name1,  BID_UINT128 *pbid_##arg_name2  \
1396            _RND_MODE_PARAM _EXC_FLAGS_PARAM _EXC_MASKS_PARAM \
1397            _EXC_INFO_PARAM) {\
1398      BID_PROLOG_TYPE_REF(type1, arg_name1)   \
1399      BID_PROLOG_REF(arg_name2)   \
1400      BID_SET_RND_MODE()         \
1401      OTHER_BID_PROLOG_REF()
1402 
1403 #define       BID_TYPE0_FUNCTION_ARG128_ARG128(type0, fn_name, arg_name1, arg_name2)\
1404       void fn_name (type0 * pres, \
1405            BID_UINT128 *pbid_##arg_name1,  BID_UINT128 *pbid_##arg_name2  \
1406            _RND_MODE_PARAM _EXC_FLAGS_PARAM _EXC_MASKS_PARAM \
1407            _EXC_INFO_PARAM) {\
1408      BID_PROLOG_REF(arg_name1)   \
1409      BID_PROLOG_REF(arg_name2)   \
1410      BID_SET_RND_MODE()         \
1411      OTHER_BID_PROLOG_REF()
1412 
1413 #define       BID_TYPE0_FUNCTION_ARG1(type0, fn_name, arg_name)\
1414       void fn_name (type0 * pres, \
1415            BID_UINT128 *  \
1416            pbid_##arg_name _RND_MODE_PARAM _EXC_FLAGS_PARAM _EXC_MASKS_PARAM \
1417            _EXC_INFO_PARAM) {\
1418      BID_PROLOG_REF(arg_name)   \
1419      BID_SET_RND_MODE()         \
1420      OTHER_BID_PROLOG_REF()
1421 
1422 #define       BID128_FUNCTION_ARGTYPE1(fn_name, type1, arg_name)\
1423       void fn_name (BID_UINT128 * pres, \
1424            type1 *  \
1425            pbid_##arg_name _RND_MODE_PARAM _EXC_FLAGS_PARAM _EXC_MASKS_PARAM \
1426            _EXC_INFO_PARAM) {\
1427      BID_PROLOG_TYPE_REF(type1, arg_name)   \
1428      BID_SET_RND_MODE()         \
1429      OTHER_BID_PROLOG_REF()
1430 
1431 #define       BID_TYPE0_FUNCTION_ARGTYPE1(type0, fn_name, type1, arg_name)\
1432       void fn_name (type0 * pres, \
1433            type1 *  \
1434            pbid_##arg_name _RND_MODE_PARAM _EXC_FLAGS_PARAM _EXC_MASKS_PARAM \
1435            _EXC_INFO_PARAM) {\
1436      BID_PROLOG_TYPE_REF(type1, arg_name)   \
1437      BID_SET_RND_MODE()         \
1438      OTHER_BID_PROLOG_REF()
1439 
1440 #define       BID_TYPE0_FUNCTION_ARGTYPE1_NORND(type0, fn_name, type1, arg_name)\
1441       void fn_name (type0 * pres, \
1442            type1 *  \
1443            pbid_##arg_name _EXC_FLAGS_PARAM _EXC_MASKS_PARAM \
1444            _EXC_INFO_PARAM) {\
1445      BID_PROLOG_TYPE_REF(type1, arg_name)   \
1446      OTHER_BID_PROLOG_REF()
1447 
1448 #define       BID_TYPE0_FUNCTION_ARGTYPE1_NORND_NOFLAGS(type0, fn_name, type1, arg_name)\
1449       void fn_name (type0 * pres, \
1450            type1 *  \
1451            pbid_##arg_name _EXC_FLAGS_PARAM _EXC_MASKS_PARAM \
1452            _EXC_INFO_PARAM) {\
1453      BID_PROLOG_TYPE_REF(type1, arg_name)
1454 
1455 #define       BID_TYPE0_FUNCTION_ARGTYPE1_ARGTYPE2_NORND(type0, fn_name, type1, arg_name1, type2, arg_name2)\
1456       void fn_name (type0 * pres, \
1457            type1 *  \
1458            pbid_##arg_name1, type2 * pbid_##arg_name2 _EXC_FLAGS_PARAM _EXC_MASKS_PARAM \
1459            _EXC_INFO_PARAM) {\
1460      BID_PROLOG_TYPE_REF(type1, arg_name1)   \
1461      BID_PROLOG_TYPE_REF(type2, arg_name2)   \
1462      OTHER_BID_PROLOG_REF()
1463 //////////////////////////////////////////
1464 /////////////////////////////////////////
1465 ////////////////////////////////////////
1466 
1467 #else
1468 
1469 //////////////////////////////////////////
1470 /////////////////////////////////////////
1471 ////////////////////////////////////////
1472 
1473 #define       BID128_FUNCTION_ARG1(fn_name, arg_name)\
1474      BID_UINT128                                     \
1475      fn_name (BID_UINT128 bid_##arg_name _RND_MODE_PARAM _EXC_FLAGS_PARAM  \
1476            _EXC_MASKS_PARAM _EXC_INFO_PARAM) { \
1477      BID_PROLOG_VAL(arg_name)                      \
1478      OTHER_BID_PROLOG_VAL()
1479 
1480 #define       BID128_FUNCTION_ARG1_NORND(fn_name, arg_name)\
1481      BID_UINT128                                     \
1482      fn_name (BID_UINT128 bid_##arg_name _EXC_FLAGS_PARAM  \
1483            _EXC_MASKS_PARAM _EXC_INFO_PARAM) { \
1484      BID_PROLOG_VAL(arg_name)                      \
1485      OTHER_BID_PROLOG_VAL()
1486 
1487 #define       BID128_FUNCTION_ARG1_NORND_CUSTOMRESTYPE(restype, fn_name, arg_name)\
1488      restype                                     \
1489      fn_name (BID_UINT128 bid_##arg_name _EXC_FLAGS_PARAM  \
1490            _EXC_MASKS_PARAM _EXC_INFO_PARAM) { \
1491      BID_PROLOG_VAL(arg_name)                      \
1492      OTHER_BID_PROLOG_VAL()
1493 
1494 #define       BID128_FUNCTION_ARG2(fn_name, arg_name1, arg_name2)\
1495      BID_UINT128                                     \
1496      fn_name (BID_UINT128 bid_##arg_name1,      \
1497             BID_UINT128 bid_##arg_name2 _RND_MODE_PARAM _EXC_FLAGS_PARAM  \
1498            _EXC_MASKS_PARAM _EXC_INFO_PARAM) {  \
1499      BID_PROLOG_VAL(arg_name1)                      \
1500      BID_PROLOG_VAL(arg_name2)                      \
1501      OTHER_BID_PROLOG_VAL()
1502 
1503 #define       BID128_FUNCTION_ARG2_NORND_CUSTOMRESTYPE(restype, fn_name, arg_name1, arg_name2)\
1504      restype                                    \
1505      fn_name (BID_UINT128 bid_##arg_name1,      \
1506             BID_UINT128 bid_##arg_name2 _EXC_FLAGS_PARAM  \
1507            _EXC_MASKS_PARAM _EXC_INFO_PARAM) {  \
1508      BID_PROLOG_VAL(arg_name1)                      \
1509      BID_PROLOG_VAL(arg_name2)                      \
1510      OTHER_BID_PROLOG_VAL()
1511 
1512 #define       BID128_FUNCTION_ARG2P_NORND_CUSTOMRESTYPE(restype, fn_name, arg_name1, res_name2)\
1513      restype                                    \
1514      fn_name (BID_UINT128 bid_##arg_name1,      \
1515             BID_UINT128* res_name2 _EXC_FLAGS_PARAM  \
1516            _EXC_MASKS_PARAM _EXC_INFO_PARAM) {  \
1517      BID_PROLOG_VAL(arg_name1)                      \
1518      OTHER_BID_PROLOG_VAL()
1519 
1520 #define       BID128_FUNCTION_ARG3P_NORND_CUSTOMRESTYPE(restype, fn_name, arg_name1, arg_name2, res_name3)\
1521      restype                                    \
1522      fn_name (BID_UINT128 bid_##arg_name1,      \
1523             BID_UINT128 bid_##arg_name2, BID_UINT128* res_name3 _EXC_FLAGS_PARAM  \
1524            _EXC_MASKS_PARAM _EXC_INFO_PARAM) {  \
1525      BID_PROLOG_VAL(arg_name1)                      \
1526      BID_PROLOG_VAL(arg_name2)                      \
1527      OTHER_BID_PROLOG_VAL()
1528 
1529 #define       BID128_FUNCTION_ARG128_ARGTYPE2(fn_name, arg_name1, type2, arg_name2)\
1530      BID_UINT128                                     \
1531      fn_name (BID_UINT128 bid_##arg_name1,      \
1532             type2 bid_##arg_name2 _RND_MODE_PARAM _EXC_FLAGS_PARAM  \
1533            _EXC_MASKS_PARAM _EXC_INFO_PARAM) {  \
1534      BID_PROLOG_VAL(arg_name1)                      \
1535      BID_PROLOG_TYPE_VAL(type2, arg_name2)          \
1536      OTHER_BID_PROLOG_VAL()
1537 
1538 #define       BID_TYPE0_FUNCTION_ARGTYPE1_ARGTYPE2(type0, fn_name, type1, arg_name1, type2, arg_name2)\
1539      type0                                     \
1540      fn_name (type1 bid_##arg_name1,      \
1541             type2 bid_##arg_name2 _RND_MODE_PARAM _EXC_FLAGS_PARAM  \
1542            _EXC_MASKS_PARAM _EXC_INFO_PARAM) {  \
1543      BID_PROLOG_TYPE_VAL(type1, arg_name1)                      \
1544      BID_PROLOG_TYPE_VAL(type2, arg_name2)          \
1545      OTHER_BID_PROLOG_VAL()
1546 
1547 #define       BID_TYPE0_FUNCTION_ARGTYPE1_ARGTYPE2_ARGTYPE3(type0, fn_name, type1, arg_name1, type2, arg_name2, type3, arg_name3)\
1548      type0                                     \
1549      fn_name (type1 bid_##arg_name1,      \
1550             type2 bid_##arg_name2, type3 bid_##arg_name3 _RND_MODE_PARAM _EXC_FLAGS_PARAM  \
1551            _EXC_MASKS_PARAM _EXC_INFO_PARAM) {  \
1552      BID_PROLOG_TYPE_VAL(type1, arg_name1)                      \
1553      BID_PROLOG_TYPE_VAL(type2, arg_name2)          \
1554      BID_PROLOG_TYPE_VAL(type3, arg_name3)          \
1555      OTHER_BID_PROLOG_VAL()
1556 
1557 #define       BID_TYPE_FUNCTION_ARG2(type0, fn_name, arg_name1, arg_name2)\
1558      type0                                     \
1559      fn_name (type0 bid_##arg_name1,      \
1560             type0 bid_##arg_name2 _RND_MODE_PARAM _EXC_FLAGS_PARAM  \
1561            _EXC_MASKS_PARAM _EXC_INFO_PARAM) {  \
1562      BID_PROLOG_TYPE_VAL(type0, arg_name1)                      \
1563      BID_PROLOG_TYPE_VAL(type0, arg_name2)          \
1564      OTHER_BID_PROLOG_VAL()
1565 
1566 #define       BID_TYPE_FUNCTION_ARG1(type0, fn_name, arg_name1)\
1567      type0                                     \
1568      fn_name (type0 bid_##arg_name1      \
1569              _RND_MODE_PARAM _EXC_FLAGS_PARAM  \
1570            _EXC_MASKS_PARAM _EXC_INFO_PARAM) {  \
1571      BID_PROLOG_TYPE_VAL(type0, arg_name1)                      \
1572      OTHER_BID_PROLOG_VAL()
1573 
1574 #define       BID128_FUNCTION_ARGTYPE1_ARG128(fn_name, type1, arg_name1, arg_name2)\
1575      BID_UINT128                                     \
1576      fn_name (type1 bid_##arg_name1,      \
1577             BID_UINT128 bid_##arg_name2 _RND_MODE_PARAM _EXC_FLAGS_PARAM  \
1578            _EXC_MASKS_PARAM _EXC_INFO_PARAM) {  \
1579      BID_PROLOG_TYPE_VAL(type1, arg_name1)          \
1580      BID_PROLOG_VAL(arg_name2)                      \
1581      OTHER_BID_PROLOG_VAL()
1582 
1583 #define       BID_TYPE0_FUNCTION_ARG128_ARGTYPE2(type0, fn_name, arg_name1, type2, arg_name2)\
1584      type0                                     \
1585      fn_name (BID_UINT128 bid_##arg_name1,      \
1586             type2 bid_##arg_name2 _RND_MODE_PARAM _EXC_FLAGS_PARAM  \
1587            _EXC_MASKS_PARAM _EXC_INFO_PARAM) {  \
1588      BID_PROLOG_VAL(arg_name1)                      \
1589      BID_PROLOG_TYPE_VAL(type2, arg_name2)          \
1590      OTHER_BID_PROLOG_VAL()
1591 
1592 #define       BID_TYPE0_FUNCTION_ARGTYPE1_ARG128(type0, fn_name, type1, arg_name1, arg_name2)\
1593      type0                                     \
1594      fn_name (type1 bid_##arg_name1,      \
1595             BID_UINT128 bid_##arg_name2 _RND_MODE_PARAM _EXC_FLAGS_PARAM  \
1596            _EXC_MASKS_PARAM _EXC_INFO_PARAM) {  \
1597      BID_PROLOG_TYPE_VAL(type1, arg_name1)                      \
1598      BID_PROLOG_VAL(arg_name2)          \
1599      OTHER_BID_PROLOG_VAL()
1600 
1601 #define       BID_TYPE0_FUNCTION_ARG128_ARG128(type0, fn_name, arg_name1, arg_name2)\
1602      type0                                     \
1603      fn_name (BID_UINT128 bid_##arg_name1,      \
1604             BID_UINT128 bid_##arg_name2 _RND_MODE_PARAM _EXC_FLAGS_PARAM  \
1605            _EXC_MASKS_PARAM _EXC_INFO_PARAM) {  \
1606      BID_PROLOG_VAL(arg_name1)                      \
1607      BID_PROLOG_VAL(arg_name2)                      \
1608      OTHER_BID_PROLOG_VAL()
1609 
1610 #define       BID_TYPE0_FUNCTION_ARG1(type0, fn_name, arg_name)\
1611      type0                                     \
1612      fn_name (BID_UINT128 bid_##arg_name _RND_MODE_PARAM _EXC_FLAGS_PARAM  \
1613            _EXC_MASKS_PARAM _EXC_INFO_PARAM) { \
1614      BID_PROLOG_VAL(arg_name)                      \
1615      OTHER_BID_PROLOG_VAL()
1616 
1617 #define       BID128_FUNCTION_ARGTYPE1(fn_name, type1, arg_name)\
1618      BID_UINT128                                     \
1619      fn_name (type1 bid_##arg_name _RND_MODE_PARAM _EXC_FLAGS_PARAM  \
1620            _EXC_MASKS_PARAM _EXC_INFO_PARAM) { \
1621      BID_PROLOG_TYPE_VAL(type1, arg_name)                      \
1622      OTHER_BID_PROLOG_VAL()
1623 
1624 #define       BID_TYPE0_FUNCTION_ARGTYPE1(type0, fn_name, type1, arg_name)\
1625      type0                                     \
1626      fn_name (type1 bid_##arg_name _RND_MODE_PARAM _EXC_FLAGS_PARAM  \
1627            _EXC_MASKS_PARAM _EXC_INFO_PARAM) { \
1628      BID_PROLOG_TYPE_VAL(type1, arg_name)                      \
1629      OTHER_BID_PROLOG_VAL()
1630 
1631 #define       BID_TYPE0_FUNCTION_ARGTYPE1_NORND(type0, fn_name, type1, arg_name)\
1632      type0                                     \
1633      fn_name (type1 bid_##arg_name _EXC_FLAGS_PARAM  \
1634            _EXC_MASKS_PARAM _EXC_INFO_PARAM) { \
1635      BID_PROLOG_TYPE_VAL(type1, arg_name)                      \
1636      OTHER_BID_PROLOG_VAL()
1637 
1638 #define       BID_TYPE0_FUNCTION_ARGTYPE1_NORND_NOFLAGS(type0, fn_name, type1, arg_name)\
1639      type0                                     \
1640      fn_name (type1 bid_##arg_name _EXC_FLAGS_PARAM  \
1641            _EXC_MASKS_PARAM _EXC_INFO_PARAM) { \
1642      BID_PROLOG_TYPE_VAL(type1, arg_name)
1643 
1644 #define       BID_TYPE0_FUNCTION_ARGTYPE1_ARGTYPE2_NORND(type0, fn_name, type1, arg_name1, type2, arg_name2)\
1645      type0                                     \
1646      fn_name (type1 bid_##arg_name1, type2 bid_##arg_name2 _EXC_FLAGS_PARAM  \
1647            _EXC_MASKS_PARAM _EXC_INFO_PARAM) { \
1648      BID_PROLOG_TYPE_VAL(type1, arg_name1)                      \
1649      BID_PROLOG_TYPE_VAL(type2, arg_name2)                      \
1650      OTHER_BID_PROLOG_VAL()
1651 #endif
1652 
1653 
1654 
1655 #define   BID_TO_SMALL_BID_UINT_CVT_FUNCTION(type0, fn_name, type1, arg_name, cvt_fn_name, type2, size_mask, invalid_res)\
1656     BID_TYPE0_FUNCTION_ARGTYPE1_NORND(type0, fn_name, type1, arg_name)\
1657         type2 res;                                                    \
1658         _IDEC_flags saved_fpsc=*pfpsf;                                \
1659     BIDECIMAL_CALL1_NORND(cvt_fn_name, res, arg_name);            \
1660         if(res & size_mask) {                                         \
1661       *pfpsf = saved_fpsc | BID_INVALID_EXCEPTION;                    \
1662           res = invalid_res; }                                        \
1663     BID_RETURN_VAL((type0)res);                                   \
1664                    }
1665 
1666 #define   BID_TO_SMALL_INT_CVT_FUNCTION(type0, fn_name, type1, arg_name, cvt_fn_name, type2, size_mask, invalid_res)\
1667     BID_TYPE0_FUNCTION_ARGTYPE1_NORND(type0, fn_name, type1, arg_name)\
1668         type2 res, sgn_mask;                                          \
1669         _IDEC_flags saved_fpsc=*pfpsf;                                \
1670     BIDECIMAL_CALL1_NORND(cvt_fn_name, res, arg_name);            \
1671         sgn_mask = res & size_mask;                                   \
1672         if(sgn_mask && (sgn_mask != (type2)size_mask)) {                     \
1673       *pfpsf = saved_fpsc | BID_INVALID_EXCEPTION;                    \
1674           res = invalid_res; }                                        \
1675     BID_RETURN_VAL((type0)res);                                   \
1676                    }
1677 #endif
1678 
1679