Debian Codegraph @

libgcc/config/libbid/bid_conf.h

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