1 /* automatically generated by ieee754-ops-auto.sh, do not edit! */
2 #include <tme/common.h>
3 _TME_RCSID("$Id: ieee754-ops-auto.sh,v 1.5 2009/08/28 01:34:01 fredette Exp $");
4 
5 #include "softfloat-tme.h"
6 #include <math.h>
7 
8 /* this does a strict compliance single-precision add: */
9 static void
_tme_ieee754_strict_single_add(struct tme_ieee754_ctl * ieee754_ctl,const struct tme_float * src0,const struct tme_float * src1,struct tme_float * dst)10 _tme_ieee754_strict_single_add(struct tme_ieee754_ctl *ieee754_ctl, const struct tme_float *src0, const struct tme_float *src1, struct tme_float *dst)
11 {
12   tme_uint32_t src0_buffer;
13   tme_uint32_t src1_buffer;
14   int exceptions;
15 
16   /* enter softfloat operation: */
17   tme_mutex_lock(&tme_ieee754_global_mutex);
18   tme_ieee754_global_ctl = ieee754_ctl;
19   tme_ieee754_global_exceptions = 0;
20   ieee754_ctl->tme_ieee754_ctl_lock_unlock = tme_ieee754_unlock_softfloat;
21 
22   /* assume that this operation raises no exceptions: */
23   exceptions = 0;
24 
25   /* the operation: */
26   _tme_ieee754_single_value_set(dst, float32,
27     float32_add((*((const float32 *) tme_ieee754_single_value_get(src0, &src0_buffer))),
28                 (*((const float32 *) tme_ieee754_single_value_get(src1, &src1_buffer)))));
29 
30   /* leave softfloat operation: */
31   tme_ieee754_global_ctl = NULL;
32   exceptions |= tme_ieee754_global_exceptions;
33   tme_mutex_unlock(&tme_ieee754_global_mutex);
34   ieee754_ctl->tme_ieee754_ctl_lock_unlock = NULL;
35 
36   /* signal any exceptions: */
37   if (exceptions != 0) {
38     (*ieee754_ctl->tme_ieee754_ctl_exception)(ieee754_ctl, exceptions);
39   }
40 }
41 
42 /* this does a strict compliance single-precision sub: */
43 static void
_tme_ieee754_strict_single_sub(struct tme_ieee754_ctl * ieee754_ctl,const struct tme_float * src0,const struct tme_float * src1,struct tme_float * dst)44 _tme_ieee754_strict_single_sub(struct tme_ieee754_ctl *ieee754_ctl, const struct tme_float *src0, const struct tme_float *src1, struct tme_float *dst)
45 {
46   tme_uint32_t src0_buffer;
47   tme_uint32_t src1_buffer;
48   int exceptions;
49 
50   /* enter softfloat operation: */
51   tme_mutex_lock(&tme_ieee754_global_mutex);
52   tme_ieee754_global_ctl = ieee754_ctl;
53   tme_ieee754_global_exceptions = 0;
54   ieee754_ctl->tme_ieee754_ctl_lock_unlock = tme_ieee754_unlock_softfloat;
55 
56   /* assume that this operation raises no exceptions: */
57   exceptions = 0;
58 
59   /* the operation: */
60   _tme_ieee754_single_value_set(dst, float32,
61     float32_sub((*((const float32 *) tme_ieee754_single_value_get(src0, &src0_buffer))),
62                 (*((const float32 *) tme_ieee754_single_value_get(src1, &src1_buffer)))));
63 
64   /* leave softfloat operation: */
65   tme_ieee754_global_ctl = NULL;
66   exceptions |= tme_ieee754_global_exceptions;
67   tme_mutex_unlock(&tme_ieee754_global_mutex);
68   ieee754_ctl->tme_ieee754_ctl_lock_unlock = NULL;
69 
70   /* signal any exceptions: */
71   if (exceptions != 0) {
72     (*ieee754_ctl->tme_ieee754_ctl_exception)(ieee754_ctl, exceptions);
73   }
74 }
75 
76 /* this does a strict compliance single-precision mul: */
77 static void
_tme_ieee754_strict_single_mul(struct tme_ieee754_ctl * ieee754_ctl,const struct tme_float * src0,const struct tme_float * src1,struct tme_float * dst)78 _tme_ieee754_strict_single_mul(struct tme_ieee754_ctl *ieee754_ctl, const struct tme_float *src0, const struct tme_float *src1, struct tme_float *dst)
79 {
80   tme_uint32_t src0_buffer;
81   tme_uint32_t src1_buffer;
82   int exceptions;
83 
84   /* enter softfloat operation: */
85   tme_mutex_lock(&tme_ieee754_global_mutex);
86   tme_ieee754_global_ctl = ieee754_ctl;
87   tme_ieee754_global_exceptions = 0;
88   ieee754_ctl->tme_ieee754_ctl_lock_unlock = tme_ieee754_unlock_softfloat;
89 
90   /* assume that this operation raises no exceptions: */
91   exceptions = 0;
92 
93   /* the operation: */
94   _tme_ieee754_single_value_set(dst, float32,
95     float32_mul((*((const float32 *) tme_ieee754_single_value_get(src0, &src0_buffer))),
96                 (*((const float32 *) tme_ieee754_single_value_get(src1, &src1_buffer)))));
97 
98   /* leave softfloat operation: */
99   tme_ieee754_global_ctl = NULL;
100   exceptions |= tme_ieee754_global_exceptions;
101   tme_mutex_unlock(&tme_ieee754_global_mutex);
102   ieee754_ctl->tme_ieee754_ctl_lock_unlock = NULL;
103 
104   /* signal any exceptions: */
105   if (exceptions != 0) {
106     (*ieee754_ctl->tme_ieee754_ctl_exception)(ieee754_ctl, exceptions);
107   }
108 }
109 
110 /* this does a strict compliance single-precision div: */
111 static void
_tme_ieee754_strict_single_div(struct tme_ieee754_ctl * ieee754_ctl,const struct tme_float * src0,const struct tme_float * src1,struct tme_float * dst)112 _tme_ieee754_strict_single_div(struct tme_ieee754_ctl *ieee754_ctl, const struct tme_float *src0, const struct tme_float *src1, struct tme_float *dst)
113 {
114   tme_uint32_t src0_buffer;
115   tme_uint32_t src1_buffer;
116   int exceptions;
117 
118   /* enter softfloat operation: */
119   tme_mutex_lock(&tme_ieee754_global_mutex);
120   tme_ieee754_global_ctl = ieee754_ctl;
121   tme_ieee754_global_exceptions = 0;
122   ieee754_ctl->tme_ieee754_ctl_lock_unlock = tme_ieee754_unlock_softfloat;
123 
124   /* assume that this operation raises no exceptions: */
125   exceptions = 0;
126 
127   /* the operation: */
128   _tme_ieee754_single_value_set(dst, float32,
129     float32_div((*((const float32 *) tme_ieee754_single_value_get(src0, &src0_buffer))),
130                 (*((const float32 *) tme_ieee754_single_value_get(src1, &src1_buffer)))));
131 
132   /* leave softfloat operation: */
133   tme_ieee754_global_ctl = NULL;
134   exceptions |= tme_ieee754_global_exceptions;
135   tme_mutex_unlock(&tme_ieee754_global_mutex);
136   ieee754_ctl->tme_ieee754_ctl_lock_unlock = NULL;
137 
138   /* signal any exceptions: */
139   if (exceptions != 0) {
140     (*ieee754_ctl->tme_ieee754_ctl_exception)(ieee754_ctl, exceptions);
141   }
142 }
143 
144 /* this does a strict compliance single-precision rem: */
145 static void
_tme_ieee754_strict_single_rem(struct tme_ieee754_ctl * ieee754_ctl,const struct tme_float * src0,const struct tme_float * src1,struct tme_float * dst)146 _tme_ieee754_strict_single_rem(struct tme_ieee754_ctl *ieee754_ctl, const struct tme_float *src0, const struct tme_float *src1, struct tme_float *dst)
147 {
148   tme_uint32_t src0_buffer;
149   tme_uint32_t src1_buffer;
150   int exceptions;
151 
152   /* enter softfloat operation: */
153   tme_mutex_lock(&tme_ieee754_global_mutex);
154   tme_ieee754_global_ctl = ieee754_ctl;
155   tme_ieee754_global_exceptions = 0;
156   ieee754_ctl->tme_ieee754_ctl_lock_unlock = tme_ieee754_unlock_softfloat;
157 
158   /* assume that this operation raises no exceptions: */
159   exceptions = 0;
160 
161   /* the operation: */
162   _tme_ieee754_single_value_set(dst, float32,
163     float32_rem((*((const float32 *) tme_ieee754_single_value_get(src0, &src0_buffer))),
164                 (*((const float32 *) tme_ieee754_single_value_get(src1, &src1_buffer)))));
165 
166   /* leave softfloat operation: */
167   tme_ieee754_global_ctl = NULL;
168   exceptions |= tme_ieee754_global_exceptions;
169   tme_mutex_unlock(&tme_ieee754_global_mutex);
170   ieee754_ctl->tme_ieee754_ctl_lock_unlock = NULL;
171 
172   /* signal any exceptions: */
173   if (exceptions != 0) {
174     (*ieee754_ctl->tme_ieee754_ctl_exception)(ieee754_ctl, exceptions);
175   }
176 }
177 
178 /* this does a strict compliance single-precision sqrt: */
179 static void
_tme_ieee754_strict_single_sqrt(struct tme_ieee754_ctl * ieee754_ctl,const struct tme_float * src0,struct tme_float * dst)180 _tme_ieee754_strict_single_sqrt(struct tme_ieee754_ctl *ieee754_ctl, const struct tme_float *src0, struct tme_float *dst)
181 {
182   tme_uint32_t src0_buffer;
183   int exceptions;
184 
185   /* enter softfloat operation: */
186   tme_mutex_lock(&tme_ieee754_global_mutex);
187   tme_ieee754_global_ctl = ieee754_ctl;
188   tme_ieee754_global_exceptions = 0;
189   ieee754_ctl->tme_ieee754_ctl_lock_unlock = tme_ieee754_unlock_softfloat;
190 
191   /* assume that this operation raises no exceptions: */
192   exceptions = 0;
193 
194   /* the operation: */
195   _tme_ieee754_single_value_set(dst, float32,
196     float32_sqrt((*((const float32 *) tme_ieee754_single_value_get(src0, &src0_buffer)))));
197 
198   /* leave softfloat operation: */
199   tme_ieee754_global_ctl = NULL;
200   exceptions |= tme_ieee754_global_exceptions;
201   tme_mutex_unlock(&tme_ieee754_global_mutex);
202   ieee754_ctl->tme_ieee754_ctl_lock_unlock = NULL;
203 
204   /* signal any exceptions: */
205   if (exceptions != 0) {
206     (*ieee754_ctl->tme_ieee754_ctl_exception)(ieee754_ctl, exceptions);
207   }
208 }
209 
210 /* this does a strict compliance single-precision neg: */
211 static void
_tme_ieee754_strict_single_neg(struct tme_ieee754_ctl * ieee754_ctl,const struct tme_float * src0,struct tme_float * dst)212 _tme_ieee754_strict_single_neg(struct tme_ieee754_ctl *ieee754_ctl, const struct tme_float *src0, struct tme_float *dst)
213 {
214   tme_uint32_t src0_buffer;
215   int exceptions;
216 
217   /* enter softfloat operation: */
218   tme_mutex_lock(&tme_ieee754_global_mutex);
219   tme_ieee754_global_ctl = ieee754_ctl;
220   tme_ieee754_global_exceptions = 0;
221   ieee754_ctl->tme_ieee754_ctl_lock_unlock = tme_ieee754_unlock_softfloat;
222 
223   /* assume that this operation raises no exceptions: */
224   exceptions = 0;
225 
226   /* the operation: */
227   _tme_ieee754_single_value_set(dst, float32,
228     float32_mul(int32_to_float32(-1),
229                 (*((const float32 *) tme_ieee754_single_value_get(src0, &src0_buffer)))));
230 
231   /* leave softfloat operation: */
232   tme_ieee754_global_ctl = NULL;
233   exceptions |= tme_ieee754_global_exceptions;
234   tme_mutex_unlock(&tme_ieee754_global_mutex);
235   ieee754_ctl->tme_ieee754_ctl_lock_unlock = NULL;
236 
237   /* signal any exceptions: */
238   if (exceptions != 0) {
239     (*ieee754_ctl->tme_ieee754_ctl_exception)(ieee754_ctl, exceptions);
240   }
241 }
242 
243 /* this does a strict compliance single-precision move: */
244 static void
_tme_ieee754_strict_single_move(struct tme_ieee754_ctl * ieee754_ctl,const struct tme_float * src0,struct tme_float * dst)245 _tme_ieee754_strict_single_move(struct tme_ieee754_ctl *ieee754_ctl, const struct tme_float *src0, struct tme_float *dst)
246 {
247   tme_uint32_t src0_buffer;
248   int exceptions;
249 
250   /* enter softfloat operation: */
251   tme_mutex_lock(&tme_ieee754_global_mutex);
252   tme_ieee754_global_ctl = ieee754_ctl;
253   tme_ieee754_global_exceptions = 0;
254   ieee754_ctl->tme_ieee754_ctl_lock_unlock = tme_ieee754_unlock_softfloat;
255 
256   /* assume that this operation raises no exceptions: */
257   exceptions = 0;
258 
259   /* the operation: */
260   _tme_ieee754_single_value_set(dst, float32,
261     float32_add((*((const float32 *) tme_ieee754_single_value_get(src0, &src0_buffer))),
262                 int32_to_float32(0)));
263 
264   /* leave softfloat operation: */
265   tme_ieee754_global_ctl = NULL;
266   exceptions |= tme_ieee754_global_exceptions;
267   tme_mutex_unlock(&tme_ieee754_global_mutex);
268   ieee754_ctl->tme_ieee754_ctl_lock_unlock = NULL;
269 
270   /* signal any exceptions: */
271   if (exceptions != 0) {
272     (*ieee754_ctl->tme_ieee754_ctl_exception)(ieee754_ctl, exceptions);
273   }
274 }
275 
276 /* this does a strict compliance single-precision rint: */
277 static void
_tme_ieee754_strict_single_rint(struct tme_ieee754_ctl * ieee754_ctl,const struct tme_float * src0,struct tme_float * dst)278 _tme_ieee754_strict_single_rint(struct tme_ieee754_ctl *ieee754_ctl, const struct tme_float *src0, struct tme_float *dst)
279 {
280   tme_uint32_t src0_buffer;
281   int exceptions;
282 
283   /* enter softfloat operation: */
284   tme_mutex_lock(&tme_ieee754_global_mutex);
285   tme_ieee754_global_ctl = ieee754_ctl;
286   tme_ieee754_global_exceptions = 0;
287   ieee754_ctl->tme_ieee754_ctl_lock_unlock = tme_ieee754_unlock_softfloat;
288 
289   /* assume that this operation raises no exceptions: */
290   exceptions = 0;
291 
292   /* the operation: */
293   _tme_ieee754_single_value_set(dst, float32,
294     float32_round_to_int((*((const float32 *) tme_ieee754_single_value_get(src0, &src0_buffer)))));
295 
296   /* leave softfloat operation: */
297   tme_ieee754_global_ctl = NULL;
298   exceptions |= tme_ieee754_global_exceptions;
299   tme_mutex_unlock(&tme_ieee754_global_mutex);
300   ieee754_ctl->tme_ieee754_ctl_lock_unlock = NULL;
301 
302   /* signal any exceptions: */
303   if (exceptions != 0) {
304     (*ieee754_ctl->tme_ieee754_ctl_exception)(ieee754_ctl, exceptions);
305   }
306 }
307 
308 /* this does a strict compliance single-precision getexp: */
309 static void
_tme_ieee754_strict_single_getexp(struct tme_ieee754_ctl * ieee754_ctl,const struct tme_float * src0,struct tme_float * dst)310 _tme_ieee754_strict_single_getexp(struct tme_ieee754_ctl *ieee754_ctl, const struct tme_float *src0, struct tme_float *dst)
311 {
312   tme_uint32_t src0_buffer;
313   int exceptions;
314 
315   /* check for a NaN operand: */
316   if (__tme_predict_false(tme_ieee754_single_check_nan_monadic(ieee754_ctl, src0, dst))) {
317     return;
318   }
319 
320   /* if the operand is an infinity: */
321   if (tme_ieee754_single_is_inf(src0)) {
322 
323     /* return a NaN: */
324     dst->tme_float_format = TME_FLOAT_FORMAT_IEEE754_SINGLE;
325     dst->tme_float_value_ieee754_single = ieee754_ctl->tme_ieee754_ctl_default_nan_single;
326     return;
327   }
328 
329   /* assume that this operation raises no exceptions: */
330   exceptions = 0;
331 
332   /* the operation: */
333 
334   /* if the operand is a zero, return a zero: */
335   if (tme_ieee754_single_is_zero(src0)) {
336     tme_ieee754_single_value_builtin_set(dst, TME_FLOAT_FORMAT_IEEE754_SINGLE_BUILTIN, 0);
337   }
338 
339   /* otherwise, return the unbiased exponent: */
340   else {
341     tme_ieee754_single_value_builtin_set(dst, TME_FLOAT_FORMAT_IEEE754_SINGLE_BUILTIN, TME_FIELD_MASK_EXTRACTU((*tme_ieee754_single_value_get(src0, &src0_buffer)), ((tme_uint32_t) 0x7f800000)) - ((((tme_uint32_t) 0x7f800000) / _TME_FIELD_MASK_FACTOR(((tme_uint32_t) 0x7f800000))) >> 1));
342   }
343   ieee754_ctl->tme_ieee754_ctl_lock_unlock = NULL;
344 
345   /* signal any exceptions: */
346   if (exceptions != 0) {
347     (*ieee754_ctl->tme_ieee754_ctl_exception)(ieee754_ctl, exceptions);
348   }
349 }
350 
351 /* this does a strict compliance single-precision getman: */
352 static void
_tme_ieee754_strict_single_getman(struct tme_ieee754_ctl * ieee754_ctl,const struct tme_float * src0,struct tme_float * dst)353 _tme_ieee754_strict_single_getman(struct tme_ieee754_ctl *ieee754_ctl, const struct tme_float *src0, struct tme_float *dst)
354 {
355   tme_uint32_t src0_buffer;
356   int exceptions;
357 
358   /* check for a NaN operand: */
359   if (__tme_predict_false(tme_ieee754_single_check_nan_monadic(ieee754_ctl, src0, dst))) {
360     return;
361   }
362 
363   /* if the operand is an infinity: */
364   if (tme_ieee754_single_is_inf(src0)) {
365 
366     /* return a NaN: */
367     dst->tme_float_format = TME_FLOAT_FORMAT_IEEE754_SINGLE;
368     dst->tme_float_value_ieee754_single = ieee754_ctl->tme_ieee754_ctl_default_nan_single;
369     return;
370   }
371 
372   /* assume that this operation raises no exceptions: */
373   exceptions = 0;
374 
375   /* the operation: */
376 
377   /* if the operand is a zero, return it: */
378   if (tme_ieee754_single_is_zero(src0)) {
379     *dst = *src0;
380   }
381 
382   /* otherwise, return the operand, with its exponent set to biased zero: */
383   else {
384     tme_ieee754_single_value_set(dst, (*tme_ieee754_single_value_get(src0, &src0_buffer)));
385     TME_FIELD_MASK_DEPOSITU(dst->tme_float_value_ieee754_single, ((tme_uint32_t) 0x7f800000), ((((tme_uint32_t) 0x7f800000) / _TME_FIELD_MASK_FACTOR(((tme_uint32_t) 0x7f800000))) >> 1));
386   }
387   ieee754_ctl->tme_ieee754_ctl_lock_unlock = NULL;
388 
389   /* signal any exceptions: */
390   if (exceptions != 0) {
391     (*ieee754_ctl->tme_ieee754_ctl_exception)(ieee754_ctl, exceptions);
392   }
393 }
394 
395 /* this does a strict compliance single-precision from-double: */
396 static void
_tme_ieee754_strict_single_from_double(struct tme_ieee754_ctl * ieee754_ctl,const struct tme_float * src0,struct tme_float * dst)397 _tme_ieee754_strict_single_from_double(struct tme_ieee754_ctl *ieee754_ctl, const struct tme_float *src0, struct tme_float *dst)
398 {
399   union tme_value64 src0_buffer;
400   int exceptions;
401 
402   /* enter softfloat operation: */
403   tme_mutex_lock(&tme_ieee754_global_mutex);
404   tme_ieee754_global_ctl = ieee754_ctl;
405   tme_ieee754_global_exceptions = 0;
406   ieee754_ctl->tme_ieee754_ctl_lock_unlock = tme_ieee754_unlock_softfloat;
407 
408   /* assume that this operation raises no exceptions: */
409   exceptions = 0;
410 
411   /* the operation: */
412   _tme_ieee754_single_value_set(dst, float32,
413     float64_to_float32((*((const float64 *) tme_ieee754_double_value_get(src0, &src0_buffer)))));
414 
415   /* leave softfloat operation: */
416   tme_ieee754_global_ctl = NULL;
417   exceptions |= tme_ieee754_global_exceptions;
418   tme_mutex_unlock(&tme_ieee754_global_mutex);
419   ieee754_ctl->tme_ieee754_ctl_lock_unlock = NULL;
420 
421   /* signal any exceptions: */
422   if (exceptions != 0) {
423     (*ieee754_ctl->tme_ieee754_ctl_exception)(ieee754_ctl, exceptions);
424   }
425 }
426 
427 /* this does a strict compliance single-precision from-extended80: */
428 static void
_tme_ieee754_strict_single_from_extended80(struct tme_ieee754_ctl * ieee754_ctl,const struct tme_float * src0,struct tme_float * dst)429 _tme_ieee754_strict_single_from_extended80(struct tme_ieee754_ctl *ieee754_ctl, const struct tme_float *src0, struct tme_float *dst)
430 {
431   struct tme_float_ieee754_extended80 src0_buffer;
432   int exceptions;
433 
434   /* enter softfloat operation: */
435   tme_mutex_lock(&tme_ieee754_global_mutex);
436   tme_ieee754_global_ctl = ieee754_ctl;
437   tme_ieee754_global_exceptions = 0;
438   ieee754_ctl->tme_ieee754_ctl_lock_unlock = tme_ieee754_unlock_softfloat;
439 
440   /* assume that this operation raises no exceptions: */
441   exceptions = 0;
442 
443   /* the operation: */
444   _tme_ieee754_single_value_set(dst, float32,
445     floatx80_to_float32((*((const floatx80 *) tme_ieee754_extended80_value_get(src0, &src0_buffer)))));
446 
447   /* leave softfloat operation: */
448   tme_ieee754_global_ctl = NULL;
449   exceptions |= tme_ieee754_global_exceptions;
450   tme_mutex_unlock(&tme_ieee754_global_mutex);
451   ieee754_ctl->tme_ieee754_ctl_lock_unlock = NULL;
452 
453   /* signal any exceptions: */
454   if (exceptions != 0) {
455     (*ieee754_ctl->tme_ieee754_ctl_exception)(ieee754_ctl, exceptions);
456   }
457 }
458 
459 /* this does a strict compliance single-precision from-quad: */
460 static void
_tme_ieee754_strict_single_from_quad(struct tme_ieee754_ctl * ieee754_ctl,const struct tme_float * src0,struct tme_float * dst)461 _tme_ieee754_strict_single_from_quad(struct tme_ieee754_ctl *ieee754_ctl, const struct tme_float *src0, struct tme_float *dst)
462 {
463   struct tme_float_ieee754_quad src0_buffer;
464   int exceptions;
465 
466   /* enter softfloat operation: */
467   tme_mutex_lock(&tme_ieee754_global_mutex);
468   tme_ieee754_global_ctl = ieee754_ctl;
469   tme_ieee754_global_exceptions = 0;
470   ieee754_ctl->tme_ieee754_ctl_lock_unlock = tme_ieee754_unlock_softfloat;
471 
472   /* assume that this operation raises no exceptions: */
473   exceptions = 0;
474 
475   /* the operation: */
476   _tme_ieee754_single_value_set(dst, float32,
477     float128_to_float32((*((const float128 *) tme_ieee754_quad_value_get(src0, &src0_buffer)))));
478 
479   /* leave softfloat operation: */
480   tme_ieee754_global_ctl = NULL;
481   exceptions |= tme_ieee754_global_exceptions;
482   tme_mutex_unlock(&tme_ieee754_global_mutex);
483   ieee754_ctl->tme_ieee754_ctl_lock_unlock = NULL;
484 
485   /* signal any exceptions: */
486   if (exceptions != 0) {
487     (*ieee754_ctl->tme_ieee754_ctl_exception)(ieee754_ctl, exceptions);
488   }
489 }
490 
491 /* this does a strict compliance single-precision from-int32: */
492 static void
_tme_ieee754_strict_single_from_int32(struct tme_ieee754_ctl * ieee754_ctl,const tme_int32_t src0,struct tme_float * dst)493 _tme_ieee754_strict_single_from_int32(struct tme_ieee754_ctl *ieee754_ctl, const tme_int32_t src0, struct tme_float *dst)
494 {
495   int exceptions;
496 
497   /* enter softfloat operation: */
498   tme_mutex_lock(&tme_ieee754_global_mutex);
499   tme_ieee754_global_ctl = ieee754_ctl;
500   tme_ieee754_global_exceptions = 0;
501   ieee754_ctl->tme_ieee754_ctl_lock_unlock = tme_ieee754_unlock_softfloat;
502 
503   /* assume that this operation raises no exceptions: */
504   exceptions = 0;
505 
506   /* the operation: */
507   _tme_ieee754_single_value_set(dst, float32,
508     int32_to_float32(src0));
509 
510   /* leave softfloat operation: */
511   tme_ieee754_global_ctl = NULL;
512   exceptions |= tme_ieee754_global_exceptions;
513   tme_mutex_unlock(&tme_ieee754_global_mutex);
514   ieee754_ctl->tme_ieee754_ctl_lock_unlock = NULL;
515 
516   /* signal any exceptions: */
517   if (exceptions != 0) {
518     (*ieee754_ctl->tme_ieee754_ctl_exception)(ieee754_ctl, exceptions);
519   }
520 }
521 
522 #if defined(TME_HAVE_INT64_T)
523 
524 /* this does a strict compliance single-precision from-int64: */
525 static void
_tme_ieee754_strict_single_from_int64(struct tme_ieee754_ctl * ieee754_ctl,const tme_int64_t src0,struct tme_float * dst)526 _tme_ieee754_strict_single_from_int64(struct tme_ieee754_ctl *ieee754_ctl, const tme_int64_t src0, struct tme_float *dst)
527 {
528   int exceptions;
529 
530   /* enter softfloat operation: */
531   tme_mutex_lock(&tme_ieee754_global_mutex);
532   tme_ieee754_global_ctl = ieee754_ctl;
533   tme_ieee754_global_exceptions = 0;
534   ieee754_ctl->tme_ieee754_ctl_lock_unlock = tme_ieee754_unlock_softfloat;
535 
536   /* assume that this operation raises no exceptions: */
537   exceptions = 0;
538 
539   /* the operation: */
540   _tme_ieee754_single_value_set(dst, float32,
541     int64_to_float32(src0));
542 
543   /* leave softfloat operation: */
544   tme_ieee754_global_ctl = NULL;
545   exceptions |= tme_ieee754_global_exceptions;
546   tme_mutex_unlock(&tme_ieee754_global_mutex);
547   ieee754_ctl->tme_ieee754_ctl_lock_unlock = NULL;
548 
549   /* signal any exceptions: */
550   if (exceptions != 0) {
551     (*ieee754_ctl->tme_ieee754_ctl_exception)(ieee754_ctl, exceptions);
552   }
553 }
554 
555 #endif /* defined(TME_HAVE_INT64_T) */
556 
557 /* this does a strict compliance single-precision to-int32: */
558 static void
_tme_ieee754_strict_single_to_int32(struct tme_ieee754_ctl * ieee754_ctl,const struct tme_float * src0,tme_int32_t * dst)559 _tme_ieee754_strict_single_to_int32(struct tme_ieee754_ctl *ieee754_ctl, const struct tme_float *src0, tme_int32_t *dst)
560 {
561   tme_uint32_t src0_buffer;
562   int exceptions;
563 
564   /* enter softfloat operation: */
565   tme_mutex_lock(&tme_ieee754_global_mutex);
566   tme_ieee754_global_ctl = ieee754_ctl;
567   tme_ieee754_global_exceptions = 0;
568   ieee754_ctl->tme_ieee754_ctl_lock_unlock = tme_ieee754_unlock_softfloat;
569 
570   /* assume that this operation raises no exceptions: */
571   exceptions = 0;
572 
573   /* the operation: */
574   *dst = float32_to_int32((*((const float32 *) tme_ieee754_single_value_get(src0, &src0_buffer))));
575 
576   /* leave softfloat operation: */
577   tme_ieee754_global_ctl = NULL;
578   exceptions |= tme_ieee754_global_exceptions;
579   tme_mutex_unlock(&tme_ieee754_global_mutex);
580   ieee754_ctl->tme_ieee754_ctl_lock_unlock = NULL;
581 
582   /* signal any exceptions: */
583   if (exceptions != 0) {
584     (*ieee754_ctl->tme_ieee754_ctl_exception)(ieee754_ctl, exceptions);
585   }
586 }
587 
588 #if defined(TME_HAVE_INT64_T)
589 
590 /* this does a strict compliance single-precision to-int64: */
591 static void
_tme_ieee754_strict_single_to_int64(struct tme_ieee754_ctl * ieee754_ctl,const struct tme_float * src0,tme_int64_t * dst)592 _tme_ieee754_strict_single_to_int64(struct tme_ieee754_ctl *ieee754_ctl, const struct tme_float *src0, tme_int64_t *dst)
593 {
594   tme_uint32_t src0_buffer;
595   int exceptions;
596 
597   /* enter softfloat operation: */
598   tme_mutex_lock(&tme_ieee754_global_mutex);
599   tme_ieee754_global_ctl = ieee754_ctl;
600   tme_ieee754_global_exceptions = 0;
601   ieee754_ctl->tme_ieee754_ctl_lock_unlock = tme_ieee754_unlock_softfloat;
602 
603   /* assume that this operation raises no exceptions: */
604   exceptions = 0;
605 
606   /* the operation: */
607   *dst = float32_to_int64((*((const float32 *) tme_ieee754_single_value_get(src0, &src0_buffer))));
608 
609   /* leave softfloat operation: */
610   tme_ieee754_global_ctl = NULL;
611   exceptions |= tme_ieee754_global_exceptions;
612   tme_mutex_unlock(&tme_ieee754_global_mutex);
613   ieee754_ctl->tme_ieee754_ctl_lock_unlock = NULL;
614 
615   /* signal any exceptions: */
616   if (exceptions != 0) {
617     (*ieee754_ctl->tme_ieee754_ctl_exception)(ieee754_ctl, exceptions);
618   }
619 }
620 
621 #endif /* defined(TME_HAVE_INT64_T) */
622 
623 /* this does a strict compliance double-precision add: */
624 static void
_tme_ieee754_strict_double_add(struct tme_ieee754_ctl * ieee754_ctl,const struct tme_float * src0,const struct tme_float * src1,struct tme_float * dst)625 _tme_ieee754_strict_double_add(struct tme_ieee754_ctl *ieee754_ctl, const struct tme_float *src0, const struct tme_float *src1, struct tme_float *dst)
626 {
627   union tme_value64 src0_buffer;
628   union tme_value64 src1_buffer;
629   int exceptions;
630 
631   /* enter softfloat operation: */
632   tme_mutex_lock(&tme_ieee754_global_mutex);
633   tme_ieee754_global_ctl = ieee754_ctl;
634   tme_ieee754_global_exceptions = 0;
635   ieee754_ctl->tme_ieee754_ctl_lock_unlock = tme_ieee754_unlock_softfloat;
636 
637   /* assume that this operation raises no exceptions: */
638   exceptions = 0;
639 
640   /* the operation: */
641   _tme_ieee754_double_value_set(dst, float64,
642     float64_add((*((const float64 *) tme_ieee754_double_value_get(src0, &src0_buffer))),
643                 (*((const float64 *) tme_ieee754_double_value_get(src1, &src1_buffer)))));
644 
645   /* leave softfloat operation: */
646   tme_ieee754_global_ctl = NULL;
647   exceptions |= tme_ieee754_global_exceptions;
648   tme_mutex_unlock(&tme_ieee754_global_mutex);
649   ieee754_ctl->tme_ieee754_ctl_lock_unlock = NULL;
650 
651   /* signal any exceptions: */
652   if (exceptions != 0) {
653     (*ieee754_ctl->tme_ieee754_ctl_exception)(ieee754_ctl, exceptions);
654   }
655 }
656 
657 /* this does a strict compliance double-precision sub: */
658 static void
_tme_ieee754_strict_double_sub(struct tme_ieee754_ctl * ieee754_ctl,const struct tme_float * src0,const struct tme_float * src1,struct tme_float * dst)659 _tme_ieee754_strict_double_sub(struct tme_ieee754_ctl *ieee754_ctl, const struct tme_float *src0, const struct tme_float *src1, struct tme_float *dst)
660 {
661   union tme_value64 src0_buffer;
662   union tme_value64 src1_buffer;
663   int exceptions;
664 
665   /* enter softfloat operation: */
666   tme_mutex_lock(&tme_ieee754_global_mutex);
667   tme_ieee754_global_ctl = ieee754_ctl;
668   tme_ieee754_global_exceptions = 0;
669   ieee754_ctl->tme_ieee754_ctl_lock_unlock = tme_ieee754_unlock_softfloat;
670 
671   /* assume that this operation raises no exceptions: */
672   exceptions = 0;
673 
674   /* the operation: */
675   _tme_ieee754_double_value_set(dst, float64,
676     float64_sub((*((const float64 *) tme_ieee754_double_value_get(src0, &src0_buffer))),
677                 (*((const float64 *) tme_ieee754_double_value_get(src1, &src1_buffer)))));
678 
679   /* leave softfloat operation: */
680   tme_ieee754_global_ctl = NULL;
681   exceptions |= tme_ieee754_global_exceptions;
682   tme_mutex_unlock(&tme_ieee754_global_mutex);
683   ieee754_ctl->tme_ieee754_ctl_lock_unlock = NULL;
684 
685   /* signal any exceptions: */
686   if (exceptions != 0) {
687     (*ieee754_ctl->tme_ieee754_ctl_exception)(ieee754_ctl, exceptions);
688   }
689 }
690 
691 /* this does a strict compliance double-precision mul: */
692 static void
_tme_ieee754_strict_double_mul(struct tme_ieee754_ctl * ieee754_ctl,const struct tme_float * src0,const struct tme_float * src1,struct tme_float * dst)693 _tme_ieee754_strict_double_mul(struct tme_ieee754_ctl *ieee754_ctl, const struct tme_float *src0, const struct tme_float *src1, struct tme_float *dst)
694 {
695   union tme_value64 src0_buffer;
696   union tme_value64 src1_buffer;
697   int exceptions;
698 
699   /* enter softfloat operation: */
700   tme_mutex_lock(&tme_ieee754_global_mutex);
701   tme_ieee754_global_ctl = ieee754_ctl;
702   tme_ieee754_global_exceptions = 0;
703   ieee754_ctl->tme_ieee754_ctl_lock_unlock = tme_ieee754_unlock_softfloat;
704 
705   /* assume that this operation raises no exceptions: */
706   exceptions = 0;
707 
708   /* the operation: */
709   _tme_ieee754_double_value_set(dst, float64,
710     float64_mul((*((const float64 *) tme_ieee754_double_value_get(src0, &src0_buffer))),
711                 (*((const float64 *) tme_ieee754_double_value_get(src1, &src1_buffer)))));
712 
713   /* leave softfloat operation: */
714   tme_ieee754_global_ctl = NULL;
715   exceptions |= tme_ieee754_global_exceptions;
716   tme_mutex_unlock(&tme_ieee754_global_mutex);
717   ieee754_ctl->tme_ieee754_ctl_lock_unlock = NULL;
718 
719   /* signal any exceptions: */
720   if (exceptions != 0) {
721     (*ieee754_ctl->tme_ieee754_ctl_exception)(ieee754_ctl, exceptions);
722   }
723 }
724 
725 /* this does a strict compliance double-precision div: */
726 static void
_tme_ieee754_strict_double_div(struct tme_ieee754_ctl * ieee754_ctl,const struct tme_float * src0,const struct tme_float * src1,struct tme_float * dst)727 _tme_ieee754_strict_double_div(struct tme_ieee754_ctl *ieee754_ctl, const struct tme_float *src0, const struct tme_float *src1, struct tme_float *dst)
728 {
729   union tme_value64 src0_buffer;
730   union tme_value64 src1_buffer;
731   int exceptions;
732 
733   /* enter softfloat operation: */
734   tme_mutex_lock(&tme_ieee754_global_mutex);
735   tme_ieee754_global_ctl = ieee754_ctl;
736   tme_ieee754_global_exceptions = 0;
737   ieee754_ctl->tme_ieee754_ctl_lock_unlock = tme_ieee754_unlock_softfloat;
738 
739   /* assume that this operation raises no exceptions: */
740   exceptions = 0;
741 
742   /* the operation: */
743   _tme_ieee754_double_value_set(dst, float64,
744     float64_div((*((const float64 *) tme_ieee754_double_value_get(src0, &src0_buffer))),
745                 (*((const float64 *) tme_ieee754_double_value_get(src1, &src1_buffer)))));
746 
747   /* leave softfloat operation: */
748   tme_ieee754_global_ctl = NULL;
749   exceptions |= tme_ieee754_global_exceptions;
750   tme_mutex_unlock(&tme_ieee754_global_mutex);
751   ieee754_ctl->tme_ieee754_ctl_lock_unlock = NULL;
752 
753   /* signal any exceptions: */
754   if (exceptions != 0) {
755     (*ieee754_ctl->tme_ieee754_ctl_exception)(ieee754_ctl, exceptions);
756   }
757 }
758 
759 /* this does a strict compliance double-precision rem: */
760 static void
_tme_ieee754_strict_double_rem(struct tme_ieee754_ctl * ieee754_ctl,const struct tme_float * src0,const struct tme_float * src1,struct tme_float * dst)761 _tme_ieee754_strict_double_rem(struct tme_ieee754_ctl *ieee754_ctl, const struct tme_float *src0, const struct tme_float *src1, struct tme_float *dst)
762 {
763   union tme_value64 src0_buffer;
764   union tme_value64 src1_buffer;
765   int exceptions;
766 
767   /* enter softfloat operation: */
768   tme_mutex_lock(&tme_ieee754_global_mutex);
769   tme_ieee754_global_ctl = ieee754_ctl;
770   tme_ieee754_global_exceptions = 0;
771   ieee754_ctl->tme_ieee754_ctl_lock_unlock = tme_ieee754_unlock_softfloat;
772 
773   /* assume that this operation raises no exceptions: */
774   exceptions = 0;
775 
776   /* the operation: */
777   _tme_ieee754_double_value_set(dst, float64,
778     float64_rem((*((const float64 *) tme_ieee754_double_value_get(src0, &src0_buffer))),
779                 (*((const float64 *) tme_ieee754_double_value_get(src1, &src1_buffer)))));
780 
781   /* leave softfloat operation: */
782   tme_ieee754_global_ctl = NULL;
783   exceptions |= tme_ieee754_global_exceptions;
784   tme_mutex_unlock(&tme_ieee754_global_mutex);
785   ieee754_ctl->tme_ieee754_ctl_lock_unlock = NULL;
786 
787   /* signal any exceptions: */
788   if (exceptions != 0) {
789     (*ieee754_ctl->tme_ieee754_ctl_exception)(ieee754_ctl, exceptions);
790   }
791 }
792 
793 /* this does a strict compliance double-precision sqrt: */
794 static void
_tme_ieee754_strict_double_sqrt(struct tme_ieee754_ctl * ieee754_ctl,const struct tme_float * src0,struct tme_float * dst)795 _tme_ieee754_strict_double_sqrt(struct tme_ieee754_ctl *ieee754_ctl, const struct tme_float *src0, struct tme_float *dst)
796 {
797   union tme_value64 src0_buffer;
798   int exceptions;
799 
800   /* enter softfloat operation: */
801   tme_mutex_lock(&tme_ieee754_global_mutex);
802   tme_ieee754_global_ctl = ieee754_ctl;
803   tme_ieee754_global_exceptions = 0;
804   ieee754_ctl->tme_ieee754_ctl_lock_unlock = tme_ieee754_unlock_softfloat;
805 
806   /* assume that this operation raises no exceptions: */
807   exceptions = 0;
808 
809   /* the operation: */
810   _tme_ieee754_double_value_set(dst, float64,
811     float64_sqrt((*((const float64 *) tme_ieee754_double_value_get(src0, &src0_buffer)))));
812 
813   /* leave softfloat operation: */
814   tme_ieee754_global_ctl = NULL;
815   exceptions |= tme_ieee754_global_exceptions;
816   tme_mutex_unlock(&tme_ieee754_global_mutex);
817   ieee754_ctl->tme_ieee754_ctl_lock_unlock = NULL;
818 
819   /* signal any exceptions: */
820   if (exceptions != 0) {
821     (*ieee754_ctl->tme_ieee754_ctl_exception)(ieee754_ctl, exceptions);
822   }
823 }
824 
825 /* this does a strict compliance double-precision neg: */
826 static void
_tme_ieee754_strict_double_neg(struct tme_ieee754_ctl * ieee754_ctl,const struct tme_float * src0,struct tme_float * dst)827 _tme_ieee754_strict_double_neg(struct tme_ieee754_ctl *ieee754_ctl, const struct tme_float *src0, struct tme_float *dst)
828 {
829   union tme_value64 src0_buffer;
830   int exceptions;
831 
832   /* enter softfloat operation: */
833   tme_mutex_lock(&tme_ieee754_global_mutex);
834   tme_ieee754_global_ctl = ieee754_ctl;
835   tme_ieee754_global_exceptions = 0;
836   ieee754_ctl->tme_ieee754_ctl_lock_unlock = tme_ieee754_unlock_softfloat;
837 
838   /* assume that this operation raises no exceptions: */
839   exceptions = 0;
840 
841   /* the operation: */
842   _tme_ieee754_double_value_set(dst, float64,
843     float64_mul(int32_to_float64(-1),
844                 (*((const float64 *) tme_ieee754_double_value_get(src0, &src0_buffer)))));
845 
846   /* leave softfloat operation: */
847   tme_ieee754_global_ctl = NULL;
848   exceptions |= tme_ieee754_global_exceptions;
849   tme_mutex_unlock(&tme_ieee754_global_mutex);
850   ieee754_ctl->tme_ieee754_ctl_lock_unlock = NULL;
851 
852   /* signal any exceptions: */
853   if (exceptions != 0) {
854     (*ieee754_ctl->tme_ieee754_ctl_exception)(ieee754_ctl, exceptions);
855   }
856 }
857 
858 /* this does a strict compliance double-precision move: */
859 static void
_tme_ieee754_strict_double_move(struct tme_ieee754_ctl * ieee754_ctl,const struct tme_float * src0,struct tme_float * dst)860 _tme_ieee754_strict_double_move(struct tme_ieee754_ctl *ieee754_ctl, const struct tme_float *src0, struct tme_float *dst)
861 {
862   union tme_value64 src0_buffer;
863   int exceptions;
864 
865   /* enter softfloat operation: */
866   tme_mutex_lock(&tme_ieee754_global_mutex);
867   tme_ieee754_global_ctl = ieee754_ctl;
868   tme_ieee754_global_exceptions = 0;
869   ieee754_ctl->tme_ieee754_ctl_lock_unlock = tme_ieee754_unlock_softfloat;
870 
871   /* assume that this operation raises no exceptions: */
872   exceptions = 0;
873 
874   /* the operation: */
875   _tme_ieee754_double_value_set(dst, float64,
876     float64_add((*((const float64 *) tme_ieee754_double_value_get(src0, &src0_buffer))),
877                 int32_to_float64(0)));
878 
879   /* leave softfloat operation: */
880   tme_ieee754_global_ctl = NULL;
881   exceptions |= tme_ieee754_global_exceptions;
882   tme_mutex_unlock(&tme_ieee754_global_mutex);
883   ieee754_ctl->tme_ieee754_ctl_lock_unlock = NULL;
884 
885   /* signal any exceptions: */
886   if (exceptions != 0) {
887     (*ieee754_ctl->tme_ieee754_ctl_exception)(ieee754_ctl, exceptions);
888   }
889 }
890 
891 /* this does a strict compliance double-precision rint: */
892 static void
_tme_ieee754_strict_double_rint(struct tme_ieee754_ctl * ieee754_ctl,const struct tme_float * src0,struct tme_float * dst)893 _tme_ieee754_strict_double_rint(struct tme_ieee754_ctl *ieee754_ctl, const struct tme_float *src0, struct tme_float *dst)
894 {
895   union tme_value64 src0_buffer;
896   int exceptions;
897 
898   /* enter softfloat operation: */
899   tme_mutex_lock(&tme_ieee754_global_mutex);
900   tme_ieee754_global_ctl = ieee754_ctl;
901   tme_ieee754_global_exceptions = 0;
902   ieee754_ctl->tme_ieee754_ctl_lock_unlock = tme_ieee754_unlock_softfloat;
903 
904   /* assume that this operation raises no exceptions: */
905   exceptions = 0;
906 
907   /* the operation: */
908   _tme_ieee754_double_value_set(dst, float64,
909     float64_round_to_int((*((const float64 *) tme_ieee754_double_value_get(src0, &src0_buffer)))));
910 
911   /* leave softfloat operation: */
912   tme_ieee754_global_ctl = NULL;
913   exceptions |= tme_ieee754_global_exceptions;
914   tme_mutex_unlock(&tme_ieee754_global_mutex);
915   ieee754_ctl->tme_ieee754_ctl_lock_unlock = NULL;
916 
917   /* signal any exceptions: */
918   if (exceptions != 0) {
919     (*ieee754_ctl->tme_ieee754_ctl_exception)(ieee754_ctl, exceptions);
920   }
921 }
922 
923 /* this does a strict compliance double-precision getexp: */
924 static void
_tme_ieee754_strict_double_getexp(struct tme_ieee754_ctl * ieee754_ctl,const struct tme_float * src0,struct tme_float * dst)925 _tme_ieee754_strict_double_getexp(struct tme_ieee754_ctl *ieee754_ctl, const struct tme_float *src0, struct tme_float *dst)
926 {
927   union tme_value64 src0_buffer;
928   int exceptions;
929 
930   /* check for a NaN operand: */
931   if (__tme_predict_false(tme_ieee754_double_check_nan_monadic(ieee754_ctl, src0, dst))) {
932     return;
933   }
934 
935   /* if the operand is an infinity: */
936   if (tme_ieee754_double_is_inf(src0)) {
937 
938     /* return a NaN: */
939     dst->tme_float_format = TME_FLOAT_FORMAT_IEEE754_DOUBLE;
940     dst->tme_float_value_ieee754_double = ieee754_ctl->tme_ieee754_ctl_default_nan_double;
941     return;
942   }
943 
944   /* assume that this operation raises no exceptions: */
945   exceptions = 0;
946 
947   /* the operation: */
948 
949   /* if the operand is a zero, return a zero: */
950   if (tme_ieee754_double_is_zero(src0)) {
951     tme_ieee754_double_value_builtin_set(dst, TME_FLOAT_FORMAT_IEEE754_DOUBLE_BUILTIN, 0);
952   }
953 
954   /* otherwise, return the unbiased exponent: */
955   else {
956     tme_ieee754_double_value_builtin_set(dst, TME_FLOAT_FORMAT_IEEE754_DOUBLE_BUILTIN, TME_FIELD_MASK_EXTRACTU((*tme_ieee754_double_value_get(src0, &src0_buffer)).tme_value64_uint32_hi, ((tme_uint32_t) 0x7ff00000)) - ((((tme_uint32_t) 0x7ff00000) / _TME_FIELD_MASK_FACTOR(((tme_uint32_t) 0x7ff00000))) >> 1));
957   }
958   ieee754_ctl->tme_ieee754_ctl_lock_unlock = NULL;
959 
960   /* signal any exceptions: */
961   if (exceptions != 0) {
962     (*ieee754_ctl->tme_ieee754_ctl_exception)(ieee754_ctl, exceptions);
963   }
964 }
965 
966 /* this does a strict compliance double-precision getman: */
967 static void
_tme_ieee754_strict_double_getman(struct tme_ieee754_ctl * ieee754_ctl,const struct tme_float * src0,struct tme_float * dst)968 _tme_ieee754_strict_double_getman(struct tme_ieee754_ctl *ieee754_ctl, const struct tme_float *src0, struct tme_float *dst)
969 {
970   union tme_value64 src0_buffer;
971   int exceptions;
972 
973   /* check for a NaN operand: */
974   if (__tme_predict_false(tme_ieee754_double_check_nan_monadic(ieee754_ctl, src0, dst))) {
975     return;
976   }
977 
978   /* if the operand is an infinity: */
979   if (tme_ieee754_double_is_inf(src0)) {
980 
981     /* return a NaN: */
982     dst->tme_float_format = TME_FLOAT_FORMAT_IEEE754_DOUBLE;
983     dst->tme_float_value_ieee754_double = ieee754_ctl->tme_ieee754_ctl_default_nan_double;
984     return;
985   }
986 
987   /* assume that this operation raises no exceptions: */
988   exceptions = 0;
989 
990   /* the operation: */
991 
992   /* if the operand is a zero, return it: */
993   if (tme_ieee754_double_is_zero(src0)) {
994     *dst = *src0;
995   }
996 
997   /* otherwise, return the operand, with its exponent set to biased zero: */
998   else {
999     tme_ieee754_double_value_set(dst, (*tme_ieee754_double_value_get(src0, &src0_buffer)));
1000     TME_FIELD_MASK_DEPOSITU(dst->tme_float_value_ieee754_double.tme_value64_uint32_hi, ((tme_uint32_t) 0x7ff00000), ((((tme_uint32_t) 0x7ff00000) / _TME_FIELD_MASK_FACTOR(((tme_uint32_t) 0x7ff00000))) >> 1));
1001   }
1002   ieee754_ctl->tme_ieee754_ctl_lock_unlock = NULL;
1003 
1004   /* signal any exceptions: */
1005   if (exceptions != 0) {
1006     (*ieee754_ctl->tme_ieee754_ctl_exception)(ieee754_ctl, exceptions);
1007   }
1008 }
1009 
1010 /* this does a strict compliance double-precision from-single: */
1011 static void
_tme_ieee754_strict_double_from_single(struct tme_ieee754_ctl * ieee754_ctl,const struct tme_float * src0,struct tme_float * dst)1012 _tme_ieee754_strict_double_from_single(struct tme_ieee754_ctl *ieee754_ctl, const struct tme_float *src0, struct tme_float *dst)
1013 {
1014   tme_uint32_t src0_buffer;
1015   int exceptions;
1016 
1017   /* enter softfloat operation: */
1018   tme_mutex_lock(&tme_ieee754_global_mutex);
1019   tme_ieee754_global_ctl = ieee754_ctl;
1020   tme_ieee754_global_exceptions = 0;
1021   ieee754_ctl->tme_ieee754_ctl_lock_unlock = tme_ieee754_unlock_softfloat;
1022 
1023   /* assume that this operation raises no exceptions: */
1024   exceptions = 0;
1025 
1026   /* the operation: */
1027   _tme_ieee754_double_value_set(dst, float64,
1028     float32_to_float64((*((const float32 *) tme_ieee754_single_value_get(src0, &src0_buffer)))));
1029 
1030   /* leave softfloat operation: */
1031   tme_ieee754_global_ctl = NULL;
1032   exceptions |= tme_ieee754_global_exceptions;
1033   tme_mutex_unlock(&tme_ieee754_global_mutex);
1034   ieee754_ctl->tme_ieee754_ctl_lock_unlock = NULL;
1035 
1036   /* signal any exceptions: */
1037   if (exceptions != 0) {
1038     (*ieee754_ctl->tme_ieee754_ctl_exception)(ieee754_ctl, exceptions);
1039   }
1040 }
1041 
1042 /* this does a strict compliance double-precision from-extended80: */
1043 static void
_tme_ieee754_strict_double_from_extended80(struct tme_ieee754_ctl * ieee754_ctl,const struct tme_float * src0,struct tme_float * dst)1044 _tme_ieee754_strict_double_from_extended80(struct tme_ieee754_ctl *ieee754_ctl, const struct tme_float *src0, struct tme_float *dst)
1045 {
1046   struct tme_float_ieee754_extended80 src0_buffer;
1047   int exceptions;
1048 
1049   /* enter softfloat operation: */
1050   tme_mutex_lock(&tme_ieee754_global_mutex);
1051   tme_ieee754_global_ctl = ieee754_ctl;
1052   tme_ieee754_global_exceptions = 0;
1053   ieee754_ctl->tme_ieee754_ctl_lock_unlock = tme_ieee754_unlock_softfloat;
1054 
1055   /* assume that this operation raises no exceptions: */
1056   exceptions = 0;
1057 
1058   /* the operation: */
1059   _tme_ieee754_double_value_set(dst, float64,
1060     floatx80_to_float64((*((const floatx80 *) tme_ieee754_extended80_value_get(src0, &src0_buffer)))));
1061 
1062   /* leave softfloat operation: */
1063   tme_ieee754_global_ctl = NULL;
1064   exceptions |= tme_ieee754_global_exceptions;
1065   tme_mutex_unlock(&tme_ieee754_global_mutex);
1066   ieee754_ctl->tme_ieee754_ctl_lock_unlock = NULL;
1067 
1068   /* signal any exceptions: */
1069   if (exceptions != 0) {
1070     (*ieee754_ctl->tme_ieee754_ctl_exception)(ieee754_ctl, exceptions);
1071   }
1072 }
1073 
1074 /* this does a strict compliance double-precision from-quad: */
1075 static void
_tme_ieee754_strict_double_from_quad(struct tme_ieee754_ctl * ieee754_ctl,const struct tme_float * src0,struct tme_float * dst)1076 _tme_ieee754_strict_double_from_quad(struct tme_ieee754_ctl *ieee754_ctl, const struct tme_float *src0, struct tme_float *dst)
1077 {
1078   struct tme_float_ieee754_quad src0_buffer;
1079   int exceptions;
1080 
1081   /* enter softfloat operation: */
1082   tme_mutex_lock(&tme_ieee754_global_mutex);
1083   tme_ieee754_global_ctl = ieee754_ctl;
1084   tme_ieee754_global_exceptions = 0;
1085   ieee754_ctl->tme_ieee754_ctl_lock_unlock = tme_ieee754_unlock_softfloat;
1086 
1087   /* assume that this operation raises no exceptions: */
1088   exceptions = 0;
1089 
1090   /* the operation: */
1091   _tme_ieee754_double_value_set(dst, float64,
1092     float128_to_float64((*((const float128 *) tme_ieee754_quad_value_get(src0, &src0_buffer)))));
1093 
1094   /* leave softfloat operation: */
1095   tme_ieee754_global_ctl = NULL;
1096   exceptions |= tme_ieee754_global_exceptions;
1097   tme_mutex_unlock(&tme_ieee754_global_mutex);
1098   ieee754_ctl->tme_ieee754_ctl_lock_unlock = NULL;
1099 
1100   /* signal any exceptions: */
1101   if (exceptions != 0) {
1102     (*ieee754_ctl->tme_ieee754_ctl_exception)(ieee754_ctl, exceptions);
1103   }
1104 }
1105 
1106 /* this does a strict compliance double-precision from-int32: */
1107 static void
_tme_ieee754_strict_double_from_int32(struct tme_ieee754_ctl * ieee754_ctl,const tme_int32_t src0,struct tme_float * dst)1108 _tme_ieee754_strict_double_from_int32(struct tme_ieee754_ctl *ieee754_ctl, const tme_int32_t src0, struct tme_float *dst)
1109 {
1110   int exceptions;
1111 
1112   /* enter softfloat operation: */
1113   tme_mutex_lock(&tme_ieee754_global_mutex);
1114   tme_ieee754_global_ctl = ieee754_ctl;
1115   tme_ieee754_global_exceptions = 0;
1116   ieee754_ctl->tme_ieee754_ctl_lock_unlock = tme_ieee754_unlock_softfloat;
1117 
1118   /* assume that this operation raises no exceptions: */
1119   exceptions = 0;
1120 
1121   /* the operation: */
1122   _tme_ieee754_double_value_set(dst, float64,
1123     int32_to_float64(src0));
1124 
1125   /* leave softfloat operation: */
1126   tme_ieee754_global_ctl = NULL;
1127   exceptions |= tme_ieee754_global_exceptions;
1128   tme_mutex_unlock(&tme_ieee754_global_mutex);
1129   ieee754_ctl->tme_ieee754_ctl_lock_unlock = NULL;
1130 
1131   /* signal any exceptions: */
1132   if (exceptions != 0) {
1133     (*ieee754_ctl->tme_ieee754_ctl_exception)(ieee754_ctl, exceptions);
1134   }
1135 }
1136 
1137 #if defined(TME_HAVE_INT64_T)
1138 
1139 /* this does a strict compliance double-precision from-int64: */
1140 static void
_tme_ieee754_strict_double_from_int64(struct tme_ieee754_ctl * ieee754_ctl,const tme_int64_t src0,struct tme_float * dst)1141 _tme_ieee754_strict_double_from_int64(struct tme_ieee754_ctl *ieee754_ctl, const tme_int64_t src0, struct tme_float *dst)
1142 {
1143   int exceptions;
1144 
1145   /* enter softfloat operation: */
1146   tme_mutex_lock(&tme_ieee754_global_mutex);
1147   tme_ieee754_global_ctl = ieee754_ctl;
1148   tme_ieee754_global_exceptions = 0;
1149   ieee754_ctl->tme_ieee754_ctl_lock_unlock = tme_ieee754_unlock_softfloat;
1150 
1151   /* assume that this operation raises no exceptions: */
1152   exceptions = 0;
1153 
1154   /* the operation: */
1155   _tme_ieee754_double_value_set(dst, float64,
1156     int64_to_float64(src0));
1157 
1158   /* leave softfloat operation: */
1159   tme_ieee754_global_ctl = NULL;
1160   exceptions |= tme_ieee754_global_exceptions;
1161   tme_mutex_unlock(&tme_ieee754_global_mutex);
1162   ieee754_ctl->tme_ieee754_ctl_lock_unlock = NULL;
1163 
1164   /* signal any exceptions: */
1165   if (exceptions != 0) {
1166     (*ieee754_ctl->tme_ieee754_ctl_exception)(ieee754_ctl, exceptions);
1167   }
1168 }
1169 
1170 #endif /* defined(TME_HAVE_INT64_T) */
1171 
1172 /* this does a strict compliance double-precision to-int32: */
1173 static void
_tme_ieee754_strict_double_to_int32(struct tme_ieee754_ctl * ieee754_ctl,const struct tme_float * src0,tme_int32_t * dst)1174 _tme_ieee754_strict_double_to_int32(struct tme_ieee754_ctl *ieee754_ctl, const struct tme_float *src0, tme_int32_t *dst)
1175 {
1176   union tme_value64 src0_buffer;
1177   int exceptions;
1178 
1179   /* enter softfloat operation: */
1180   tme_mutex_lock(&tme_ieee754_global_mutex);
1181   tme_ieee754_global_ctl = ieee754_ctl;
1182   tme_ieee754_global_exceptions = 0;
1183   ieee754_ctl->tme_ieee754_ctl_lock_unlock = tme_ieee754_unlock_softfloat;
1184 
1185   /* assume that this operation raises no exceptions: */
1186   exceptions = 0;
1187 
1188   /* the operation: */
1189   *dst = float64_to_int32((*((const float64 *) tme_ieee754_double_value_get(src0, &src0_buffer))));
1190 
1191   /* leave softfloat operation: */
1192   tme_ieee754_global_ctl = NULL;
1193   exceptions |= tme_ieee754_global_exceptions;
1194   tme_mutex_unlock(&tme_ieee754_global_mutex);
1195   ieee754_ctl->tme_ieee754_ctl_lock_unlock = NULL;
1196 
1197   /* signal any exceptions: */
1198   if (exceptions != 0) {
1199     (*ieee754_ctl->tme_ieee754_ctl_exception)(ieee754_ctl, exceptions);
1200   }
1201 }
1202 
1203 #if defined(TME_HAVE_INT64_T)
1204 
1205 /* this does a strict compliance double-precision to-int64: */
1206 static void
_tme_ieee754_strict_double_to_int64(struct tme_ieee754_ctl * ieee754_ctl,const struct tme_float * src0,tme_int64_t * dst)1207 _tme_ieee754_strict_double_to_int64(struct tme_ieee754_ctl *ieee754_ctl, const struct tme_float *src0, tme_int64_t *dst)
1208 {
1209   union tme_value64 src0_buffer;
1210   int exceptions;
1211 
1212   /* enter softfloat operation: */
1213   tme_mutex_lock(&tme_ieee754_global_mutex);
1214   tme_ieee754_global_ctl = ieee754_ctl;
1215   tme_ieee754_global_exceptions = 0;
1216   ieee754_ctl->tme_ieee754_ctl_lock_unlock = tme_ieee754_unlock_softfloat;
1217 
1218   /* assume that this operation raises no exceptions: */
1219   exceptions = 0;
1220 
1221   /* the operation: */
1222   *dst = float64_to_int64((*((const float64 *) tme_ieee754_double_value_get(src0, &src0_buffer))));
1223 
1224   /* leave softfloat operation: */
1225   tme_ieee754_global_ctl = NULL;
1226   exceptions |= tme_ieee754_global_exceptions;
1227   tme_mutex_unlock(&tme_ieee754_global_mutex);
1228   ieee754_ctl->tme_ieee754_ctl_lock_unlock = NULL;
1229 
1230   /* signal any exceptions: */
1231   if (exceptions != 0) {
1232     (*ieee754_ctl->tme_ieee754_ctl_exception)(ieee754_ctl, exceptions);
1233   }
1234 }
1235 
1236 #endif /* defined(TME_HAVE_INT64_T) */
1237 
1238 #if defined(TME_HAVE_INT64_T)
1239 
1240 /* this does a strict compliance extended80-precision add: */
1241 static void
_tme_ieee754_strict_extended80_add(struct tme_ieee754_ctl * ieee754_ctl,const struct tme_float * src0,const struct tme_float * src1,struct tme_float * dst)1242 _tme_ieee754_strict_extended80_add(struct tme_ieee754_ctl *ieee754_ctl, const struct tme_float *src0, const struct tme_float *src1, struct tme_float *dst)
1243 {
1244   struct tme_float_ieee754_extended80 src0_buffer;
1245   struct tme_float_ieee754_extended80 src1_buffer;
1246   int exceptions;
1247 
1248   /* enter softfloat operation: */
1249   tme_mutex_lock(&tme_ieee754_global_mutex);
1250   tme_ieee754_global_ctl = ieee754_ctl;
1251   tme_ieee754_global_exceptions = 0;
1252   ieee754_ctl->tme_ieee754_ctl_lock_unlock = tme_ieee754_unlock_softfloat;
1253 
1254   /* assume that this operation raises no exceptions: */
1255   exceptions = 0;
1256 
1257   /* the operation: */
1258   _tme_ieee754_extended80_value_set(dst, floatx80,
1259     floatx80_add((*((const floatx80 *) tme_ieee754_extended80_value_get(src0, &src0_buffer))),
1260                 (*((const floatx80 *) tme_ieee754_extended80_value_get(src1, &src1_buffer)))));
1261 
1262   /* leave softfloat operation: */
1263   tme_ieee754_global_ctl = NULL;
1264   exceptions |= tme_ieee754_global_exceptions;
1265   tme_mutex_unlock(&tme_ieee754_global_mutex);
1266   ieee754_ctl->tme_ieee754_ctl_lock_unlock = NULL;
1267 
1268   /* signal any exceptions: */
1269   if (exceptions != 0) {
1270     (*ieee754_ctl->tme_ieee754_ctl_exception)(ieee754_ctl, exceptions);
1271   }
1272 }
1273 
1274 #endif /* defined(TME_HAVE_INT64_T) */
1275 
1276 #if defined(TME_HAVE_INT64_T)
1277 
1278 /* this does a strict compliance extended80-precision sub: */
1279 static void
_tme_ieee754_strict_extended80_sub(struct tme_ieee754_ctl * ieee754_ctl,const struct tme_float * src0,const struct tme_float * src1,struct tme_float * dst)1280 _tme_ieee754_strict_extended80_sub(struct tme_ieee754_ctl *ieee754_ctl, const struct tme_float *src0, const struct tme_float *src1, struct tme_float *dst)
1281 {
1282   struct tme_float_ieee754_extended80 src0_buffer;
1283   struct tme_float_ieee754_extended80 src1_buffer;
1284   int exceptions;
1285 
1286   /* enter softfloat operation: */
1287   tme_mutex_lock(&tme_ieee754_global_mutex);
1288   tme_ieee754_global_ctl = ieee754_ctl;
1289   tme_ieee754_global_exceptions = 0;
1290   ieee754_ctl->tme_ieee754_ctl_lock_unlock = tme_ieee754_unlock_softfloat;
1291 
1292   /* assume that this operation raises no exceptions: */
1293   exceptions = 0;
1294 
1295   /* the operation: */
1296   _tme_ieee754_extended80_value_set(dst, floatx80,
1297     floatx80_sub((*((const floatx80 *) tme_ieee754_extended80_value_get(src0, &src0_buffer))),
1298                 (*((const floatx80 *) tme_ieee754_extended80_value_get(src1, &src1_buffer)))));
1299 
1300   /* leave softfloat operation: */
1301   tme_ieee754_global_ctl = NULL;
1302   exceptions |= tme_ieee754_global_exceptions;
1303   tme_mutex_unlock(&tme_ieee754_global_mutex);
1304   ieee754_ctl->tme_ieee754_ctl_lock_unlock = NULL;
1305 
1306   /* signal any exceptions: */
1307   if (exceptions != 0) {
1308     (*ieee754_ctl->tme_ieee754_ctl_exception)(ieee754_ctl, exceptions);
1309   }
1310 }
1311 
1312 #endif /* defined(TME_HAVE_INT64_T) */
1313 
1314 #if defined(TME_HAVE_INT64_T)
1315 
1316 /* this does a strict compliance extended80-precision mul: */
1317 static void
_tme_ieee754_strict_extended80_mul(struct tme_ieee754_ctl * ieee754_ctl,const struct tme_float * src0,const struct tme_float * src1,struct tme_float * dst)1318 _tme_ieee754_strict_extended80_mul(struct tme_ieee754_ctl *ieee754_ctl, const struct tme_float *src0, const struct tme_float *src1, struct tme_float *dst)
1319 {
1320   struct tme_float_ieee754_extended80 src0_buffer;
1321   struct tme_float_ieee754_extended80 src1_buffer;
1322   int exceptions;
1323 
1324   /* enter softfloat operation: */
1325   tme_mutex_lock(&tme_ieee754_global_mutex);
1326   tme_ieee754_global_ctl = ieee754_ctl;
1327   tme_ieee754_global_exceptions = 0;
1328   ieee754_ctl->tme_ieee754_ctl_lock_unlock = tme_ieee754_unlock_softfloat;
1329 
1330   /* assume that this operation raises no exceptions: */
1331   exceptions = 0;
1332 
1333   /* the operation: */
1334   _tme_ieee754_extended80_value_set(dst, floatx80,
1335     floatx80_mul((*((const floatx80 *) tme_ieee754_extended80_value_get(src0, &src0_buffer))),
1336                 (*((const floatx80 *) tme_ieee754_extended80_value_get(src1, &src1_buffer)))));
1337 
1338   /* leave softfloat operation: */
1339   tme_ieee754_global_ctl = NULL;
1340   exceptions |= tme_ieee754_global_exceptions;
1341   tme_mutex_unlock(&tme_ieee754_global_mutex);
1342   ieee754_ctl->tme_ieee754_ctl_lock_unlock = NULL;
1343 
1344   /* signal any exceptions: */
1345   if (exceptions != 0) {
1346     (*ieee754_ctl->tme_ieee754_ctl_exception)(ieee754_ctl, exceptions);
1347   }
1348 }
1349 
1350 #endif /* defined(TME_HAVE_INT64_T) */
1351 
1352 #if defined(TME_HAVE_INT64_T)
1353 
1354 /* this does a strict compliance extended80-precision div: */
1355 static void
_tme_ieee754_strict_extended80_div(struct tme_ieee754_ctl * ieee754_ctl,const struct tme_float * src0,const struct tme_float * src1,struct tme_float * dst)1356 _tme_ieee754_strict_extended80_div(struct tme_ieee754_ctl *ieee754_ctl, const struct tme_float *src0, const struct tme_float *src1, struct tme_float *dst)
1357 {
1358   struct tme_float_ieee754_extended80 src0_buffer;
1359   struct tme_float_ieee754_extended80 src1_buffer;
1360   int exceptions;
1361 
1362   /* enter softfloat operation: */
1363   tme_mutex_lock(&tme_ieee754_global_mutex);
1364   tme_ieee754_global_ctl = ieee754_ctl;
1365   tme_ieee754_global_exceptions = 0;
1366   ieee754_ctl->tme_ieee754_ctl_lock_unlock = tme_ieee754_unlock_softfloat;
1367 
1368   /* assume that this operation raises no exceptions: */
1369   exceptions = 0;
1370 
1371   /* the operation: */
1372   _tme_ieee754_extended80_value_set(dst, floatx80,
1373     floatx80_div((*((const floatx80 *) tme_ieee754_extended80_value_get(src0, &src0_buffer))),
1374                 (*((const floatx80 *) tme_ieee754_extended80_value_get(src1, &src1_buffer)))));
1375 
1376   /* leave softfloat operation: */
1377   tme_ieee754_global_ctl = NULL;
1378   exceptions |= tme_ieee754_global_exceptions;
1379   tme_mutex_unlock(&tme_ieee754_global_mutex);
1380   ieee754_ctl->tme_ieee754_ctl_lock_unlock = NULL;
1381 
1382   /* signal any exceptions: */
1383   if (exceptions != 0) {
1384     (*ieee754_ctl->tme_ieee754_ctl_exception)(ieee754_ctl, exceptions);
1385   }
1386 }
1387 
1388 #endif /* defined(TME_HAVE_INT64_T) */
1389 
1390 #if defined(TME_HAVE_INT64_T)
1391 
1392 /* this does a strict compliance extended80-precision rem: */
1393 static void
_tme_ieee754_strict_extended80_rem(struct tme_ieee754_ctl * ieee754_ctl,const struct tme_float * src0,const struct tme_float * src1,struct tme_float * dst)1394 _tme_ieee754_strict_extended80_rem(struct tme_ieee754_ctl *ieee754_ctl, const struct tme_float *src0, const struct tme_float *src1, struct tme_float *dst)
1395 {
1396   struct tme_float_ieee754_extended80 src0_buffer;
1397   struct tme_float_ieee754_extended80 src1_buffer;
1398   int exceptions;
1399 
1400   /* enter softfloat operation: */
1401   tme_mutex_lock(&tme_ieee754_global_mutex);
1402   tme_ieee754_global_ctl = ieee754_ctl;
1403   tme_ieee754_global_exceptions = 0;
1404   ieee754_ctl->tme_ieee754_ctl_lock_unlock = tme_ieee754_unlock_softfloat;
1405 
1406   /* assume that this operation raises no exceptions: */
1407   exceptions = 0;
1408 
1409   /* the operation: */
1410   _tme_ieee754_extended80_value_set(dst, floatx80,
1411     floatx80_rem((*((const floatx80 *) tme_ieee754_extended80_value_get(src0, &src0_buffer))),
1412                 (*((const floatx80 *) tme_ieee754_extended80_value_get(src1, &src1_buffer)))));
1413 
1414   /* leave softfloat operation: */
1415   tme_ieee754_global_ctl = NULL;
1416   exceptions |= tme_ieee754_global_exceptions;
1417   tme_mutex_unlock(&tme_ieee754_global_mutex);
1418   ieee754_ctl->tme_ieee754_ctl_lock_unlock = NULL;
1419 
1420   /* signal any exceptions: */
1421   if (exceptions != 0) {
1422     (*ieee754_ctl->tme_ieee754_ctl_exception)(ieee754_ctl, exceptions);
1423   }
1424 }
1425 
1426 #endif /* defined(TME_HAVE_INT64_T) */
1427 
1428 #if defined(TME_HAVE_INT64_T)
1429 
1430 /* this does a strict compliance extended80-precision sqrt: */
1431 static void
_tme_ieee754_strict_extended80_sqrt(struct tme_ieee754_ctl * ieee754_ctl,const struct tme_float * src0,struct tme_float * dst)1432 _tme_ieee754_strict_extended80_sqrt(struct tme_ieee754_ctl *ieee754_ctl, const struct tme_float *src0, struct tme_float *dst)
1433 {
1434   struct tme_float_ieee754_extended80 src0_buffer;
1435   int exceptions;
1436 
1437   /* enter softfloat operation: */
1438   tme_mutex_lock(&tme_ieee754_global_mutex);
1439   tme_ieee754_global_ctl = ieee754_ctl;
1440   tme_ieee754_global_exceptions = 0;
1441   ieee754_ctl->tme_ieee754_ctl_lock_unlock = tme_ieee754_unlock_softfloat;
1442 
1443   /* assume that this operation raises no exceptions: */
1444   exceptions = 0;
1445 
1446   /* the operation: */
1447   _tme_ieee754_extended80_value_set(dst, floatx80,
1448     floatx80_sqrt((*((const floatx80 *) tme_ieee754_extended80_value_get(src0, &src0_buffer)))));
1449 
1450   /* leave softfloat operation: */
1451   tme_ieee754_global_ctl = NULL;
1452   exceptions |= tme_ieee754_global_exceptions;
1453   tme_mutex_unlock(&tme_ieee754_global_mutex);
1454   ieee754_ctl->tme_ieee754_ctl_lock_unlock = NULL;
1455 
1456   /* signal any exceptions: */
1457   if (exceptions != 0) {
1458     (*ieee754_ctl->tme_ieee754_ctl_exception)(ieee754_ctl, exceptions);
1459   }
1460 }
1461 
1462 #endif /* defined(TME_HAVE_INT64_T) */
1463 
1464 #if defined(TME_HAVE_INT64_T)
1465 
1466 /* this does a strict compliance extended80-precision neg: */
1467 static void
_tme_ieee754_strict_extended80_neg(struct tme_ieee754_ctl * ieee754_ctl,const struct tme_float * src0,struct tme_float * dst)1468 _tme_ieee754_strict_extended80_neg(struct tme_ieee754_ctl *ieee754_ctl, const struct tme_float *src0, struct tme_float *dst)
1469 {
1470   struct tme_float_ieee754_extended80 src0_buffer;
1471   int exceptions;
1472 
1473   /* enter softfloat operation: */
1474   tme_mutex_lock(&tme_ieee754_global_mutex);
1475   tme_ieee754_global_ctl = ieee754_ctl;
1476   tme_ieee754_global_exceptions = 0;
1477   ieee754_ctl->tme_ieee754_ctl_lock_unlock = tme_ieee754_unlock_softfloat;
1478 
1479   /* assume that this operation raises no exceptions: */
1480   exceptions = 0;
1481 
1482   /* the operation: */
1483   _tme_ieee754_extended80_value_set(dst, floatx80,
1484     floatx80_mul(int32_to_floatx80(-1),
1485                 (*((const floatx80 *) tme_ieee754_extended80_value_get(src0, &src0_buffer)))));
1486 
1487   /* leave softfloat operation: */
1488   tme_ieee754_global_ctl = NULL;
1489   exceptions |= tme_ieee754_global_exceptions;
1490   tme_mutex_unlock(&tme_ieee754_global_mutex);
1491   ieee754_ctl->tme_ieee754_ctl_lock_unlock = NULL;
1492 
1493   /* signal any exceptions: */
1494   if (exceptions != 0) {
1495     (*ieee754_ctl->tme_ieee754_ctl_exception)(ieee754_ctl, exceptions);
1496   }
1497 }
1498 
1499 #endif /* defined(TME_HAVE_INT64_T) */
1500 
1501 #if defined(TME_HAVE_INT64_T)
1502 
1503 /* this does a strict compliance extended80-precision move: */
1504 static void
_tme_ieee754_strict_extended80_move(struct tme_ieee754_ctl * ieee754_ctl,const struct tme_float * src0,struct tme_float * dst)1505 _tme_ieee754_strict_extended80_move(struct tme_ieee754_ctl *ieee754_ctl, const struct tme_float *src0, struct tme_float *dst)
1506 {
1507   struct tme_float_ieee754_extended80 src0_buffer;
1508   int exceptions;
1509 
1510   /* enter softfloat operation: */
1511   tme_mutex_lock(&tme_ieee754_global_mutex);
1512   tme_ieee754_global_ctl = ieee754_ctl;
1513   tme_ieee754_global_exceptions = 0;
1514   ieee754_ctl->tme_ieee754_ctl_lock_unlock = tme_ieee754_unlock_softfloat;
1515 
1516   /* assume that this operation raises no exceptions: */
1517   exceptions = 0;
1518 
1519   /* the operation: */
1520   _tme_ieee754_extended80_value_set(dst, floatx80,
1521     floatx80_add((*((const floatx80 *) tme_ieee754_extended80_value_get(src0, &src0_buffer))),
1522                 int32_to_floatx80(0)));
1523 
1524   /* leave softfloat operation: */
1525   tme_ieee754_global_ctl = NULL;
1526   exceptions |= tme_ieee754_global_exceptions;
1527   tme_mutex_unlock(&tme_ieee754_global_mutex);
1528   ieee754_ctl->tme_ieee754_ctl_lock_unlock = NULL;
1529 
1530   /* signal any exceptions: */
1531   if (exceptions != 0) {
1532     (*ieee754_ctl->tme_ieee754_ctl_exception)(ieee754_ctl, exceptions);
1533   }
1534 }
1535 
1536 #endif /* defined(TME_HAVE_INT64_T) */
1537 
1538 #if defined(TME_HAVE_INT64_T)
1539 
1540 /* this does a strict compliance extended80-precision rint: */
1541 static void
_tme_ieee754_strict_extended80_rint(struct tme_ieee754_ctl * ieee754_ctl,const struct tme_float * src0,struct tme_float * dst)1542 _tme_ieee754_strict_extended80_rint(struct tme_ieee754_ctl *ieee754_ctl, const struct tme_float *src0, struct tme_float *dst)
1543 {
1544   struct tme_float_ieee754_extended80 src0_buffer;
1545   int exceptions;
1546 
1547   /* enter softfloat operation: */
1548   tme_mutex_lock(&tme_ieee754_global_mutex);
1549   tme_ieee754_global_ctl = ieee754_ctl;
1550   tme_ieee754_global_exceptions = 0;
1551   ieee754_ctl->tme_ieee754_ctl_lock_unlock = tme_ieee754_unlock_softfloat;
1552 
1553   /* assume that this operation raises no exceptions: */
1554   exceptions = 0;
1555 
1556   /* the operation: */
1557   _tme_ieee754_extended80_value_set(dst, floatx80,
1558     floatx80_round_to_int((*((const floatx80 *) tme_ieee754_extended80_value_get(src0, &src0_buffer)))));
1559 
1560   /* leave softfloat operation: */
1561   tme_ieee754_global_ctl = NULL;
1562   exceptions |= tme_ieee754_global_exceptions;
1563   tme_mutex_unlock(&tme_ieee754_global_mutex);
1564   ieee754_ctl->tme_ieee754_ctl_lock_unlock = NULL;
1565 
1566   /* signal any exceptions: */
1567   if (exceptions != 0) {
1568     (*ieee754_ctl->tme_ieee754_ctl_exception)(ieee754_ctl, exceptions);
1569   }
1570 }
1571 
1572 #endif /* defined(TME_HAVE_INT64_T) */
1573 
1574 /* this does a strict compliance extended80-precision getexp: */
1575 static void
_tme_ieee754_strict_extended80_getexp(struct tme_ieee754_ctl * ieee754_ctl,const struct tme_float * src0,struct tme_float * dst)1576 _tme_ieee754_strict_extended80_getexp(struct tme_ieee754_ctl *ieee754_ctl, const struct tme_float *src0, struct tme_float *dst)
1577 {
1578   struct tme_float_ieee754_extended80 src0_buffer;
1579   int exceptions;
1580 
1581   /* check for a NaN operand: */
1582   if (__tme_predict_false(tme_ieee754_extended80_check_nan_monadic(ieee754_ctl, src0, dst))) {
1583     return;
1584   }
1585 
1586   /* if the operand is an infinity: */
1587   if (tme_ieee754_extended80_is_inf(src0)) {
1588 
1589     /* return a NaN: */
1590     dst->tme_float_format = TME_FLOAT_FORMAT_IEEE754_EXTENDED80;
1591     dst->tme_float_value_ieee754_extended80 = ieee754_ctl->tme_ieee754_ctl_default_nan_extended80;
1592     return;
1593   }
1594 
1595   /* assume that this operation raises no exceptions: */
1596   exceptions = 0;
1597 
1598   /* the operation: */
1599 
1600   /* if the operand is a zero, return a zero: */
1601   if (tme_ieee754_extended80_is_zero(src0)) {
1602     tme_ieee754_extended80_value_builtin_set(dst, TME_FLOAT_FORMAT_IEEE754_EXTENDED80_BUILTIN, 0);
1603   }
1604 
1605   /* otherwise, return the unbiased exponent: */
1606   else {
1607     tme_ieee754_extended80_value_builtin_set(dst, TME_FLOAT_FORMAT_IEEE754_EXTENDED80_BUILTIN, TME_FIELD_MASK_EXTRACTU((*tme_ieee754_extended80_value_get(src0, &src0_buffer)).tme_float_ieee754_extended80_sexp, ((tme_uint32_t) 0x7fff)) - ((((tme_uint32_t) 0x7fff) / _TME_FIELD_MASK_FACTOR(((tme_uint32_t) 0x7fff))) >> 1));
1608   }
1609   ieee754_ctl->tme_ieee754_ctl_lock_unlock = NULL;
1610 
1611   /* signal any exceptions: */
1612   if (exceptions != 0) {
1613     (*ieee754_ctl->tme_ieee754_ctl_exception)(ieee754_ctl, exceptions);
1614   }
1615 }
1616 
1617 /* this does a strict compliance extended80-precision getman: */
1618 static void
_tme_ieee754_strict_extended80_getman(struct tme_ieee754_ctl * ieee754_ctl,const struct tme_float * src0,struct tme_float * dst)1619 _tme_ieee754_strict_extended80_getman(struct tme_ieee754_ctl *ieee754_ctl, const struct tme_float *src0, struct tme_float *dst)
1620 {
1621   struct tme_float_ieee754_extended80 src0_buffer;
1622   int exceptions;
1623 
1624   /* check for a NaN operand: */
1625   if (__tme_predict_false(tme_ieee754_extended80_check_nan_monadic(ieee754_ctl, src0, dst))) {
1626     return;
1627   }
1628 
1629   /* if the operand is an infinity: */
1630   if (tme_ieee754_extended80_is_inf(src0)) {
1631 
1632     /* return a NaN: */
1633     dst->tme_float_format = TME_FLOAT_FORMAT_IEEE754_EXTENDED80;
1634     dst->tme_float_value_ieee754_extended80 = ieee754_ctl->tme_ieee754_ctl_default_nan_extended80;
1635     return;
1636   }
1637 
1638   /* assume that this operation raises no exceptions: */
1639   exceptions = 0;
1640 
1641   /* the operation: */
1642 
1643   /* if the operand is a zero, return it: */
1644   if (tme_ieee754_extended80_is_zero(src0)) {
1645     *dst = *src0;
1646   }
1647 
1648   /* otherwise, return the operand, with its exponent set to biased zero: */
1649   else {
1650     tme_ieee754_extended80_value_set(dst, (*tme_ieee754_extended80_value_get(src0, &src0_buffer)));
1651     TME_FIELD_MASK_DEPOSITU(dst->tme_float_value_ieee754_extended80.tme_float_ieee754_extended80_sexp, ((tme_uint32_t) 0x7fff), ((((tme_uint32_t) 0x7fff) / _TME_FIELD_MASK_FACTOR(((tme_uint32_t) 0x7fff))) >> 1));
1652   }
1653   ieee754_ctl->tme_ieee754_ctl_lock_unlock = NULL;
1654 
1655   /* signal any exceptions: */
1656   if (exceptions != 0) {
1657     (*ieee754_ctl->tme_ieee754_ctl_exception)(ieee754_ctl, exceptions);
1658   }
1659 }
1660 
1661 #if defined(TME_HAVE_INT64_T)
1662 
1663 /* this does a strict compliance extended80-precision from-single: */
1664 static void
_tme_ieee754_strict_extended80_from_single(struct tme_ieee754_ctl * ieee754_ctl,const struct tme_float * src0,struct tme_float * dst)1665 _tme_ieee754_strict_extended80_from_single(struct tme_ieee754_ctl *ieee754_ctl, const struct tme_float *src0, struct tme_float *dst)
1666 {
1667   tme_uint32_t src0_buffer;
1668   int exceptions;
1669 
1670   /* enter softfloat operation: */
1671   tme_mutex_lock(&tme_ieee754_global_mutex);
1672   tme_ieee754_global_ctl = ieee754_ctl;
1673   tme_ieee754_global_exceptions = 0;
1674   ieee754_ctl->tme_ieee754_ctl_lock_unlock = tme_ieee754_unlock_softfloat;
1675 
1676   /* assume that this operation raises no exceptions: */
1677   exceptions = 0;
1678 
1679   /* the operation: */
1680   _tme_ieee754_extended80_value_set(dst, floatx80,
1681     float32_to_floatx80((*((const float32 *) tme_ieee754_single_value_get(src0, &src0_buffer)))));
1682 
1683   /* leave softfloat operation: */
1684   tme_ieee754_global_ctl = NULL;
1685   exceptions |= tme_ieee754_global_exceptions;
1686   tme_mutex_unlock(&tme_ieee754_global_mutex);
1687   ieee754_ctl->tme_ieee754_ctl_lock_unlock = NULL;
1688 
1689   /* signal any exceptions: */
1690   if (exceptions != 0) {
1691     (*ieee754_ctl->tme_ieee754_ctl_exception)(ieee754_ctl, exceptions);
1692   }
1693 }
1694 
1695 #endif /* defined(TME_HAVE_INT64_T) */
1696 
1697 #if defined(TME_HAVE_INT64_T)
1698 
1699 /* this does a strict compliance extended80-precision from-double: */
1700 static void
_tme_ieee754_strict_extended80_from_double(struct tme_ieee754_ctl * ieee754_ctl,const struct tme_float * src0,struct tme_float * dst)1701 _tme_ieee754_strict_extended80_from_double(struct tme_ieee754_ctl *ieee754_ctl, const struct tme_float *src0, struct tme_float *dst)
1702 {
1703   union tme_value64 src0_buffer;
1704   int exceptions;
1705 
1706   /* enter softfloat operation: */
1707   tme_mutex_lock(&tme_ieee754_global_mutex);
1708   tme_ieee754_global_ctl = ieee754_ctl;
1709   tme_ieee754_global_exceptions = 0;
1710   ieee754_ctl->tme_ieee754_ctl_lock_unlock = tme_ieee754_unlock_softfloat;
1711 
1712   /* assume that this operation raises no exceptions: */
1713   exceptions = 0;
1714 
1715   /* the operation: */
1716   _tme_ieee754_extended80_value_set(dst, floatx80,
1717     float64_to_floatx80((*((const float64 *) tme_ieee754_double_value_get(src0, &src0_buffer)))));
1718 
1719   /* leave softfloat operation: */
1720   tme_ieee754_global_ctl = NULL;
1721   exceptions |= tme_ieee754_global_exceptions;
1722   tme_mutex_unlock(&tme_ieee754_global_mutex);
1723   ieee754_ctl->tme_ieee754_ctl_lock_unlock = NULL;
1724 
1725   /* signal any exceptions: */
1726   if (exceptions != 0) {
1727     (*ieee754_ctl->tme_ieee754_ctl_exception)(ieee754_ctl, exceptions);
1728   }
1729 }
1730 
1731 #endif /* defined(TME_HAVE_INT64_T) */
1732 
1733 #if defined(TME_HAVE_INT64_T)
1734 
1735 /* this does a strict compliance extended80-precision from-quad: */
1736 static void
_tme_ieee754_strict_extended80_from_quad(struct tme_ieee754_ctl * ieee754_ctl,const struct tme_float * src0,struct tme_float * dst)1737 _tme_ieee754_strict_extended80_from_quad(struct tme_ieee754_ctl *ieee754_ctl, const struct tme_float *src0, struct tme_float *dst)
1738 {
1739   struct tme_float_ieee754_quad src0_buffer;
1740   int exceptions;
1741 
1742   /* enter softfloat operation: */
1743   tme_mutex_lock(&tme_ieee754_global_mutex);
1744   tme_ieee754_global_ctl = ieee754_ctl;
1745   tme_ieee754_global_exceptions = 0;
1746   ieee754_ctl->tme_ieee754_ctl_lock_unlock = tme_ieee754_unlock_softfloat;
1747 
1748   /* assume that this operation raises no exceptions: */
1749   exceptions = 0;
1750 
1751   /* the operation: */
1752   _tme_ieee754_extended80_value_set(dst, floatx80,
1753     float128_to_floatx80((*((const float128 *) tme_ieee754_quad_value_get(src0, &src0_buffer)))));
1754 
1755   /* leave softfloat operation: */
1756   tme_ieee754_global_ctl = NULL;
1757   exceptions |= tme_ieee754_global_exceptions;
1758   tme_mutex_unlock(&tme_ieee754_global_mutex);
1759   ieee754_ctl->tme_ieee754_ctl_lock_unlock = NULL;
1760 
1761   /* signal any exceptions: */
1762   if (exceptions != 0) {
1763     (*ieee754_ctl->tme_ieee754_ctl_exception)(ieee754_ctl, exceptions);
1764   }
1765 }
1766 
1767 #endif /* defined(TME_HAVE_INT64_T) */
1768 
1769 #if defined(TME_HAVE_INT64_T)
1770 
1771 /* this does a strict compliance extended80-precision from-int32: */
1772 static void
_tme_ieee754_strict_extended80_from_int32(struct tme_ieee754_ctl * ieee754_ctl,const tme_int32_t src0,struct tme_float * dst)1773 _tme_ieee754_strict_extended80_from_int32(struct tme_ieee754_ctl *ieee754_ctl, const tme_int32_t src0, struct tme_float *dst)
1774 {
1775   int exceptions;
1776 
1777   /* enter softfloat operation: */
1778   tme_mutex_lock(&tme_ieee754_global_mutex);
1779   tme_ieee754_global_ctl = ieee754_ctl;
1780   tme_ieee754_global_exceptions = 0;
1781   ieee754_ctl->tme_ieee754_ctl_lock_unlock = tme_ieee754_unlock_softfloat;
1782 
1783   /* assume that this operation raises no exceptions: */
1784   exceptions = 0;
1785 
1786   /* the operation: */
1787   _tme_ieee754_extended80_value_set(dst, floatx80,
1788     int32_to_floatx80(src0));
1789 
1790   /* leave softfloat operation: */
1791   tme_ieee754_global_ctl = NULL;
1792   exceptions |= tme_ieee754_global_exceptions;
1793   tme_mutex_unlock(&tme_ieee754_global_mutex);
1794   ieee754_ctl->tme_ieee754_ctl_lock_unlock = NULL;
1795 
1796   /* signal any exceptions: */
1797   if (exceptions != 0) {
1798     (*ieee754_ctl->tme_ieee754_ctl_exception)(ieee754_ctl, exceptions);
1799   }
1800 }
1801 
1802 #endif /* defined(TME_HAVE_INT64_T) */
1803 
1804 #if defined(TME_HAVE_INT64_T)
1805 
1806 /* this does a strict compliance extended80-precision from-int64: */
1807 static void
_tme_ieee754_strict_extended80_from_int64(struct tme_ieee754_ctl * ieee754_ctl,const tme_int64_t src0,struct tme_float * dst)1808 _tme_ieee754_strict_extended80_from_int64(struct tme_ieee754_ctl *ieee754_ctl, const tme_int64_t src0, struct tme_float *dst)
1809 {
1810   int exceptions;
1811 
1812   /* enter softfloat operation: */
1813   tme_mutex_lock(&tme_ieee754_global_mutex);
1814   tme_ieee754_global_ctl = ieee754_ctl;
1815   tme_ieee754_global_exceptions = 0;
1816   ieee754_ctl->tme_ieee754_ctl_lock_unlock = tme_ieee754_unlock_softfloat;
1817 
1818   /* assume that this operation raises no exceptions: */
1819   exceptions = 0;
1820 
1821   /* the operation: */
1822   _tme_ieee754_extended80_value_set(dst, floatx80,
1823     int64_to_floatx80(src0));
1824 
1825   /* leave softfloat operation: */
1826   tme_ieee754_global_ctl = NULL;
1827   exceptions |= tme_ieee754_global_exceptions;
1828   tme_mutex_unlock(&tme_ieee754_global_mutex);
1829   ieee754_ctl->tme_ieee754_ctl_lock_unlock = NULL;
1830 
1831   /* signal any exceptions: */
1832   if (exceptions != 0) {
1833     (*ieee754_ctl->tme_ieee754_ctl_exception)(ieee754_ctl, exceptions);
1834   }
1835 }
1836 
1837 #endif /* defined(TME_HAVE_INT64_T) */
1838 
1839 /* this does a strict compliance extended80-precision to-int32: */
1840 static void
_tme_ieee754_strict_extended80_to_int32(struct tme_ieee754_ctl * ieee754_ctl,const struct tme_float * src0,tme_int32_t * dst)1841 _tme_ieee754_strict_extended80_to_int32(struct tme_ieee754_ctl *ieee754_ctl, const struct tme_float *src0, tme_int32_t *dst)
1842 {
1843   struct tme_float_ieee754_extended80 src0_buffer;
1844   int exceptions;
1845 
1846   /* enter softfloat operation: */
1847   tme_mutex_lock(&tme_ieee754_global_mutex);
1848   tme_ieee754_global_ctl = ieee754_ctl;
1849   tme_ieee754_global_exceptions = 0;
1850   ieee754_ctl->tme_ieee754_ctl_lock_unlock = tme_ieee754_unlock_softfloat;
1851 
1852   /* assume that this operation raises no exceptions: */
1853   exceptions = 0;
1854 
1855   /* the operation: */
1856   *dst = floatx80_to_int32((*((const floatx80 *) tme_ieee754_extended80_value_get(src0, &src0_buffer))));
1857 
1858   /* leave softfloat operation: */
1859   tme_ieee754_global_ctl = NULL;
1860   exceptions |= tme_ieee754_global_exceptions;
1861   tme_mutex_unlock(&tme_ieee754_global_mutex);
1862   ieee754_ctl->tme_ieee754_ctl_lock_unlock = NULL;
1863 
1864   /* signal any exceptions: */
1865   if (exceptions != 0) {
1866     (*ieee754_ctl->tme_ieee754_ctl_exception)(ieee754_ctl, exceptions);
1867   }
1868 }
1869 
1870 #if defined(TME_HAVE_INT64_T)
1871 
1872 /* this does a strict compliance extended80-precision to-int64: */
1873 static void
_tme_ieee754_strict_extended80_to_int64(struct tme_ieee754_ctl * ieee754_ctl,const struct tme_float * src0,tme_int64_t * dst)1874 _tme_ieee754_strict_extended80_to_int64(struct tme_ieee754_ctl *ieee754_ctl, const struct tme_float *src0, tme_int64_t *dst)
1875 {
1876   struct tme_float_ieee754_extended80 src0_buffer;
1877   int exceptions;
1878 
1879   /* enter softfloat operation: */
1880   tme_mutex_lock(&tme_ieee754_global_mutex);
1881   tme_ieee754_global_ctl = ieee754_ctl;
1882   tme_ieee754_global_exceptions = 0;
1883   ieee754_ctl->tme_ieee754_ctl_lock_unlock = tme_ieee754_unlock_softfloat;
1884 
1885   /* assume that this operation raises no exceptions: */
1886   exceptions = 0;
1887 
1888   /* the operation: */
1889   *dst = floatx80_to_int64((*((const floatx80 *) tme_ieee754_extended80_value_get(src0, &src0_buffer))));
1890 
1891   /* leave softfloat operation: */
1892   tme_ieee754_global_ctl = NULL;
1893   exceptions |= tme_ieee754_global_exceptions;
1894   tme_mutex_unlock(&tme_ieee754_global_mutex);
1895   ieee754_ctl->tme_ieee754_ctl_lock_unlock = NULL;
1896 
1897   /* signal any exceptions: */
1898   if (exceptions != 0) {
1899     (*ieee754_ctl->tme_ieee754_ctl_exception)(ieee754_ctl, exceptions);
1900   }
1901 }
1902 
1903 #endif /* defined(TME_HAVE_INT64_T) */
1904 
1905 #if defined(TME_HAVE_INT64_T)
1906 
1907 /* this does a strict compliance quad-precision add: */
1908 static void
_tme_ieee754_strict_quad_add(struct tme_ieee754_ctl * ieee754_ctl,const struct tme_float * src0,const struct tme_float * src1,struct tme_float * dst)1909 _tme_ieee754_strict_quad_add(struct tme_ieee754_ctl *ieee754_ctl, const struct tme_float *src0, const struct tme_float *src1, struct tme_float *dst)
1910 {
1911   struct tme_float_ieee754_quad src0_buffer;
1912   struct tme_float_ieee754_quad src1_buffer;
1913   int exceptions;
1914 
1915   /* enter softfloat operation: */
1916   tme_mutex_lock(&tme_ieee754_global_mutex);
1917   tme_ieee754_global_ctl = ieee754_ctl;
1918   tme_ieee754_global_exceptions = 0;
1919   ieee754_ctl->tme_ieee754_ctl_lock_unlock = tme_ieee754_unlock_softfloat;
1920 
1921   /* assume that this operation raises no exceptions: */
1922   exceptions = 0;
1923 
1924   /* the operation: */
1925   _tme_ieee754_quad_value_set(dst, float128,
1926     float128_add((*((const float128 *) tme_ieee754_quad_value_get(src0, &src0_buffer))),
1927                 (*((const float128 *) tme_ieee754_quad_value_get(src1, &src1_buffer)))));
1928 
1929   /* leave softfloat operation: */
1930   tme_ieee754_global_ctl = NULL;
1931   exceptions |= tme_ieee754_global_exceptions;
1932   tme_mutex_unlock(&tme_ieee754_global_mutex);
1933   ieee754_ctl->tme_ieee754_ctl_lock_unlock = NULL;
1934 
1935   /* signal any exceptions: */
1936   if (exceptions != 0) {
1937     (*ieee754_ctl->tme_ieee754_ctl_exception)(ieee754_ctl, exceptions);
1938   }
1939 }
1940 
1941 #endif /* defined(TME_HAVE_INT64_T) */
1942 
1943 #if defined(TME_HAVE_INT64_T)
1944 
1945 /* this does a strict compliance quad-precision sub: */
1946 static void
_tme_ieee754_strict_quad_sub(struct tme_ieee754_ctl * ieee754_ctl,const struct tme_float * src0,const struct tme_float * src1,struct tme_float * dst)1947 _tme_ieee754_strict_quad_sub(struct tme_ieee754_ctl *ieee754_ctl, const struct tme_float *src0, const struct tme_float *src1, struct tme_float *dst)
1948 {
1949   struct tme_float_ieee754_quad src0_buffer;
1950   struct tme_float_ieee754_quad src1_buffer;
1951   int exceptions;
1952 
1953   /* enter softfloat operation: */
1954   tme_mutex_lock(&tme_ieee754_global_mutex);
1955   tme_ieee754_global_ctl = ieee754_ctl;
1956   tme_ieee754_global_exceptions = 0;
1957   ieee754_ctl->tme_ieee754_ctl_lock_unlock = tme_ieee754_unlock_softfloat;
1958 
1959   /* assume that this operation raises no exceptions: */
1960   exceptions = 0;
1961 
1962   /* the operation: */
1963   _tme_ieee754_quad_value_set(dst, float128,
1964     float128_sub((*((const float128 *) tme_ieee754_quad_value_get(src0, &src0_buffer))),
1965                 (*((const float128 *) tme_ieee754_quad_value_get(src1, &src1_buffer)))));
1966 
1967   /* leave softfloat operation: */
1968   tme_ieee754_global_ctl = NULL;
1969   exceptions |= tme_ieee754_global_exceptions;
1970   tme_mutex_unlock(&tme_ieee754_global_mutex);
1971   ieee754_ctl->tme_ieee754_ctl_lock_unlock = NULL;
1972 
1973   /* signal any exceptions: */
1974   if (exceptions != 0) {
1975     (*ieee754_ctl->tme_ieee754_ctl_exception)(ieee754_ctl, exceptions);
1976   }
1977 }
1978 
1979 #endif /* defined(TME_HAVE_INT64_T) */
1980 
1981 #if defined(TME_HAVE_INT64_T)
1982 
1983 /* this does a strict compliance quad-precision mul: */
1984 static void
_tme_ieee754_strict_quad_mul(struct tme_ieee754_ctl * ieee754_ctl,const struct tme_float * src0,const struct tme_float * src1,struct tme_float * dst)1985 _tme_ieee754_strict_quad_mul(struct tme_ieee754_ctl *ieee754_ctl, const struct tme_float *src0, const struct tme_float *src1, struct tme_float *dst)
1986 {
1987   struct tme_float_ieee754_quad src0_buffer;
1988   struct tme_float_ieee754_quad src1_buffer;
1989   int exceptions;
1990 
1991   /* enter softfloat operation: */
1992   tme_mutex_lock(&tme_ieee754_global_mutex);
1993   tme_ieee754_global_ctl = ieee754_ctl;
1994   tme_ieee754_global_exceptions = 0;
1995   ieee754_ctl->tme_ieee754_ctl_lock_unlock = tme_ieee754_unlock_softfloat;
1996 
1997   /* assume that this operation raises no exceptions: */
1998   exceptions = 0;
1999 
2000   /* the operation: */
2001   _tme_ieee754_quad_value_set(dst, float128,
2002     float128_mul((*((const float128 *) tme_ieee754_quad_value_get(src0, &src0_buffer))),
2003                 (*((const float128 *) tme_ieee754_quad_value_get(src1, &src1_buffer)))));
2004 
2005   /* leave softfloat operation: */
2006   tme_ieee754_global_ctl = NULL;
2007   exceptions |= tme_ieee754_global_exceptions;
2008   tme_mutex_unlock(&tme_ieee754_global_mutex);
2009   ieee754_ctl->tme_ieee754_ctl_lock_unlock = NULL;
2010 
2011   /* signal any exceptions: */
2012   if (exceptions != 0) {
2013     (*ieee754_ctl->tme_ieee754_ctl_exception)(ieee754_ctl, exceptions);
2014   }
2015 }
2016 
2017 #endif /* defined(TME_HAVE_INT64_T) */
2018 
2019 #if defined(TME_HAVE_INT64_T)
2020 
2021 /* this does a strict compliance quad-precision div: */
2022 static void
_tme_ieee754_strict_quad_div(struct tme_ieee754_ctl * ieee754_ctl,const struct tme_float * src0,const struct tme_float * src1,struct tme_float * dst)2023 _tme_ieee754_strict_quad_div(struct tme_ieee754_ctl *ieee754_ctl, const struct tme_float *src0, const struct tme_float *src1, struct tme_float *dst)
2024 {
2025   struct tme_float_ieee754_quad src0_buffer;
2026   struct tme_float_ieee754_quad src1_buffer;
2027   int exceptions;
2028 
2029   /* enter softfloat operation: */
2030   tme_mutex_lock(&tme_ieee754_global_mutex);
2031   tme_ieee754_global_ctl = ieee754_ctl;
2032   tme_ieee754_global_exceptions = 0;
2033   ieee754_ctl->tme_ieee754_ctl_lock_unlock = tme_ieee754_unlock_softfloat;
2034 
2035   /* assume that this operation raises no exceptions: */
2036   exceptions = 0;
2037 
2038   /* the operation: */
2039   _tme_ieee754_quad_value_set(dst, float128,
2040     float128_div((*((const float128 *) tme_ieee754_quad_value_get(src0, &src0_buffer))),
2041                 (*((const float128 *) tme_ieee754_quad_value_get(src1, &src1_buffer)))));
2042 
2043   /* leave softfloat operation: */
2044   tme_ieee754_global_ctl = NULL;
2045   exceptions |= tme_ieee754_global_exceptions;
2046   tme_mutex_unlock(&tme_ieee754_global_mutex);
2047   ieee754_ctl->tme_ieee754_ctl_lock_unlock = NULL;
2048 
2049   /* signal any exceptions: */
2050   if (exceptions != 0) {
2051     (*ieee754_ctl->tme_ieee754_ctl_exception)(ieee754_ctl, exceptions);
2052   }
2053 }
2054 
2055 #endif /* defined(TME_HAVE_INT64_T) */
2056 
2057 #if defined(TME_HAVE_INT64_T)
2058 
2059 /* this does a strict compliance quad-precision rem: */
2060 static void
_tme_ieee754_strict_quad_rem(struct tme_ieee754_ctl * ieee754_ctl,const struct tme_float * src0,const struct tme_float * src1,struct tme_float * dst)2061 _tme_ieee754_strict_quad_rem(struct tme_ieee754_ctl *ieee754_ctl, const struct tme_float *src0, const struct tme_float *src1, struct tme_float *dst)
2062 {
2063   struct tme_float_ieee754_quad src0_buffer;
2064   struct tme_float_ieee754_quad src1_buffer;
2065   int exceptions;
2066 
2067   /* enter softfloat operation: */
2068   tme_mutex_lock(&tme_ieee754_global_mutex);
2069   tme_ieee754_global_ctl = ieee754_ctl;
2070   tme_ieee754_global_exceptions = 0;
2071   ieee754_ctl->tme_ieee754_ctl_lock_unlock = tme_ieee754_unlock_softfloat;
2072 
2073   /* assume that this operation raises no exceptions: */
2074   exceptions = 0;
2075 
2076   /* the operation: */
2077   _tme_ieee754_quad_value_set(dst, float128,
2078     float128_rem((*((const float128 *) tme_ieee754_quad_value_get(src0, &src0_buffer))),
2079                 (*((const float128 *) tme_ieee754_quad_value_get(src1, &src1_buffer)))));
2080 
2081   /* leave softfloat operation: */
2082   tme_ieee754_global_ctl = NULL;
2083   exceptions |= tme_ieee754_global_exceptions;
2084   tme_mutex_unlock(&tme_ieee754_global_mutex);
2085   ieee754_ctl->tme_ieee754_ctl_lock_unlock = NULL;
2086 
2087   /* signal any exceptions: */
2088   if (exceptions != 0) {
2089     (*ieee754_ctl->tme_ieee754_ctl_exception)(ieee754_ctl, exceptions);
2090   }
2091 }
2092 
2093 #endif /* defined(TME_HAVE_INT64_T) */
2094 
2095 #if defined(TME_HAVE_INT64_T)
2096 
2097 /* this does a strict compliance quad-precision sqrt: */
2098 static void
_tme_ieee754_strict_quad_sqrt(struct tme_ieee754_ctl * ieee754_ctl,const struct tme_float * src0,struct tme_float * dst)2099 _tme_ieee754_strict_quad_sqrt(struct tme_ieee754_ctl *ieee754_ctl, const struct tme_float *src0, struct tme_float *dst)
2100 {
2101   struct tme_float_ieee754_quad src0_buffer;
2102   int exceptions;
2103 
2104   /* enter softfloat operation: */
2105   tme_mutex_lock(&tme_ieee754_global_mutex);
2106   tme_ieee754_global_ctl = ieee754_ctl;
2107   tme_ieee754_global_exceptions = 0;
2108   ieee754_ctl->tme_ieee754_ctl_lock_unlock = tme_ieee754_unlock_softfloat;
2109 
2110   /* assume that this operation raises no exceptions: */
2111   exceptions = 0;
2112 
2113   /* the operation: */
2114   _tme_ieee754_quad_value_set(dst, float128,
2115     float128_sqrt((*((const float128 *) tme_ieee754_quad_value_get(src0, &src0_buffer)))));
2116 
2117   /* leave softfloat operation: */
2118   tme_ieee754_global_ctl = NULL;
2119   exceptions |= tme_ieee754_global_exceptions;
2120   tme_mutex_unlock(&tme_ieee754_global_mutex);
2121   ieee754_ctl->tme_ieee754_ctl_lock_unlock = NULL;
2122 
2123   /* signal any exceptions: */
2124   if (exceptions != 0) {
2125     (*ieee754_ctl->tme_ieee754_ctl_exception)(ieee754_ctl, exceptions);
2126   }
2127 }
2128 
2129 #endif /* defined(TME_HAVE_INT64_T) */
2130 
2131 #if defined(TME_HAVE_INT64_T)
2132 
2133 /* this does a strict compliance quad-precision neg: */
2134 static void
_tme_ieee754_strict_quad_neg(struct tme_ieee754_ctl * ieee754_ctl,const struct tme_float * src0,struct tme_float * dst)2135 _tme_ieee754_strict_quad_neg(struct tme_ieee754_ctl *ieee754_ctl, const struct tme_float *src0, struct tme_float *dst)
2136 {
2137   struct tme_float_ieee754_quad src0_buffer;
2138   int exceptions;
2139 
2140   /* enter softfloat operation: */
2141   tme_mutex_lock(&tme_ieee754_global_mutex);
2142   tme_ieee754_global_ctl = ieee754_ctl;
2143   tme_ieee754_global_exceptions = 0;
2144   ieee754_ctl->tme_ieee754_ctl_lock_unlock = tme_ieee754_unlock_softfloat;
2145 
2146   /* assume that this operation raises no exceptions: */
2147   exceptions = 0;
2148 
2149   /* the operation: */
2150   _tme_ieee754_quad_value_set(dst, float128,
2151     float128_mul(int32_to_float128(-1),
2152                 (*((const float128 *) tme_ieee754_quad_value_get(src0, &src0_buffer)))));
2153 
2154   /* leave softfloat operation: */
2155   tme_ieee754_global_ctl = NULL;
2156   exceptions |= tme_ieee754_global_exceptions;
2157   tme_mutex_unlock(&tme_ieee754_global_mutex);
2158   ieee754_ctl->tme_ieee754_ctl_lock_unlock = NULL;
2159 
2160   /* signal any exceptions: */
2161   if (exceptions != 0) {
2162     (*ieee754_ctl->tme_ieee754_ctl_exception)(ieee754_ctl, exceptions);
2163   }
2164 }
2165 
2166 #endif /* defined(TME_HAVE_INT64_T) */
2167 
2168 #if defined(TME_HAVE_INT64_T)
2169 
2170 /* this does a strict compliance quad-precision move: */
2171 static void
_tme_ieee754_strict_quad_move(struct tme_ieee754_ctl * ieee754_ctl,const struct tme_float * src0,struct tme_float * dst)2172 _tme_ieee754_strict_quad_move(struct tme_ieee754_ctl *ieee754_ctl, const struct tme_float *src0, struct tme_float *dst)
2173 {
2174   struct tme_float_ieee754_quad src0_buffer;
2175   int exceptions;
2176 
2177   /* enter softfloat operation: */
2178   tme_mutex_lock(&tme_ieee754_global_mutex);
2179   tme_ieee754_global_ctl = ieee754_ctl;
2180   tme_ieee754_global_exceptions = 0;
2181   ieee754_ctl->tme_ieee754_ctl_lock_unlock = tme_ieee754_unlock_softfloat;
2182 
2183   /* assume that this operation raises no exceptions: */
2184   exceptions = 0;
2185 
2186   /* the operation: */
2187   _tme_ieee754_quad_value_set(dst, float128,
2188     float128_add((*((const float128 *) tme_ieee754_quad_value_get(src0, &src0_buffer))),
2189                 int32_to_float128(0)));
2190 
2191   /* leave softfloat operation: */
2192   tme_ieee754_global_ctl = NULL;
2193   exceptions |= tme_ieee754_global_exceptions;
2194   tme_mutex_unlock(&tme_ieee754_global_mutex);
2195   ieee754_ctl->tme_ieee754_ctl_lock_unlock = NULL;
2196 
2197   /* signal any exceptions: */
2198   if (exceptions != 0) {
2199     (*ieee754_ctl->tme_ieee754_ctl_exception)(ieee754_ctl, exceptions);
2200   }
2201 }
2202 
2203 #endif /* defined(TME_HAVE_INT64_T) */
2204 
2205 #if defined(TME_HAVE_INT64_T)
2206 
2207 /* this does a strict compliance quad-precision rint: */
2208 static void
_tme_ieee754_strict_quad_rint(struct tme_ieee754_ctl * ieee754_ctl,const struct tme_float * src0,struct tme_float * dst)2209 _tme_ieee754_strict_quad_rint(struct tme_ieee754_ctl *ieee754_ctl, const struct tme_float *src0, struct tme_float *dst)
2210 {
2211   struct tme_float_ieee754_quad src0_buffer;
2212   int exceptions;
2213 
2214   /* enter softfloat operation: */
2215   tme_mutex_lock(&tme_ieee754_global_mutex);
2216   tme_ieee754_global_ctl = ieee754_ctl;
2217   tme_ieee754_global_exceptions = 0;
2218   ieee754_ctl->tme_ieee754_ctl_lock_unlock = tme_ieee754_unlock_softfloat;
2219 
2220   /* assume that this operation raises no exceptions: */
2221   exceptions = 0;
2222 
2223   /* the operation: */
2224   _tme_ieee754_quad_value_set(dst, float128,
2225     float128_round_to_int((*((const float128 *) tme_ieee754_quad_value_get(src0, &src0_buffer)))));
2226 
2227   /* leave softfloat operation: */
2228   tme_ieee754_global_ctl = NULL;
2229   exceptions |= tme_ieee754_global_exceptions;
2230   tme_mutex_unlock(&tme_ieee754_global_mutex);
2231   ieee754_ctl->tme_ieee754_ctl_lock_unlock = NULL;
2232 
2233   /* signal any exceptions: */
2234   if (exceptions != 0) {
2235     (*ieee754_ctl->tme_ieee754_ctl_exception)(ieee754_ctl, exceptions);
2236   }
2237 }
2238 
2239 #endif /* defined(TME_HAVE_INT64_T) */
2240 
2241 /* this does a strict compliance quad-precision getexp: */
2242 static void
_tme_ieee754_strict_quad_getexp(struct tme_ieee754_ctl * ieee754_ctl,const struct tme_float * src0,struct tme_float * dst)2243 _tme_ieee754_strict_quad_getexp(struct tme_ieee754_ctl *ieee754_ctl, const struct tme_float *src0, struct tme_float *dst)
2244 {
2245   struct tme_float_ieee754_quad src0_buffer;
2246   int exceptions;
2247 
2248   /* check for a NaN operand: */
2249   if (__tme_predict_false(tme_ieee754_quad_check_nan_monadic(ieee754_ctl, src0, dst))) {
2250     return;
2251   }
2252 
2253   /* if the operand is an infinity: */
2254   if (tme_ieee754_quad_is_inf(src0)) {
2255 
2256     /* return a NaN: */
2257     dst->tme_float_format = TME_FLOAT_FORMAT_IEEE754_QUAD;
2258     dst->tme_float_value_ieee754_quad = ieee754_ctl->tme_ieee754_ctl_default_nan_quad;
2259     return;
2260   }
2261 
2262   /* assume that this operation raises no exceptions: */
2263   exceptions = 0;
2264 
2265   /* the operation: */
2266 
2267   /* if the operand is a zero, return a zero: */
2268   if (tme_ieee754_quad_is_zero(src0)) {
2269     tme_ieee754_quad_value_builtin_set(dst, TME_FLOAT_FORMAT_IEEE754_QUAD_BUILTIN, 0);
2270   }
2271 
2272   /* otherwise, return the unbiased exponent: */
2273   else {
2274     tme_ieee754_quad_value_builtin_set(dst, TME_FLOAT_FORMAT_IEEE754_QUAD_BUILTIN, TME_FIELD_MASK_EXTRACTU((*tme_ieee754_quad_value_get(src0, &src0_buffer)).tme_float_ieee754_quad_hi.tme_value64_uint32_hi, ((tme_uint32_t) 0x7fff0000)) - ((((tme_uint32_t) 0x7fff0000) / _TME_FIELD_MASK_FACTOR(((tme_uint32_t) 0x7fff0000))) >> 1));
2275   }
2276   ieee754_ctl->tme_ieee754_ctl_lock_unlock = NULL;
2277 
2278   /* signal any exceptions: */
2279   if (exceptions != 0) {
2280     (*ieee754_ctl->tme_ieee754_ctl_exception)(ieee754_ctl, exceptions);
2281   }
2282 }
2283 
2284 /* this does a strict compliance quad-precision getman: */
2285 static void
_tme_ieee754_strict_quad_getman(struct tme_ieee754_ctl * ieee754_ctl,const struct tme_float * src0,struct tme_float * dst)2286 _tme_ieee754_strict_quad_getman(struct tme_ieee754_ctl *ieee754_ctl, const struct tme_float *src0, struct tme_float *dst)
2287 {
2288   struct tme_float_ieee754_quad src0_buffer;
2289   int exceptions;
2290 
2291   /* check for a NaN operand: */
2292   if (__tme_predict_false(tme_ieee754_quad_check_nan_monadic(ieee754_ctl, src0, dst))) {
2293     return;
2294   }
2295 
2296   /* if the operand is an infinity: */
2297   if (tme_ieee754_quad_is_inf(src0)) {
2298 
2299     /* return a NaN: */
2300     dst->tme_float_format = TME_FLOAT_FORMAT_IEEE754_QUAD;
2301     dst->tme_float_value_ieee754_quad = ieee754_ctl->tme_ieee754_ctl_default_nan_quad;
2302     return;
2303   }
2304 
2305   /* assume that this operation raises no exceptions: */
2306   exceptions = 0;
2307 
2308   /* the operation: */
2309 
2310   /* if the operand is a zero, return it: */
2311   if (tme_ieee754_quad_is_zero(src0)) {
2312     *dst = *src0;
2313   }
2314 
2315   /* otherwise, return the operand, with its exponent set to biased zero: */
2316   else {
2317     tme_ieee754_quad_value_set(dst, (*tme_ieee754_quad_value_get(src0, &src0_buffer)));
2318     TME_FIELD_MASK_DEPOSITU(dst->tme_float_value_ieee754_quad.tme_float_ieee754_quad_hi.tme_value64_uint32_hi, ((tme_uint32_t) 0x7fff0000), ((((tme_uint32_t) 0x7fff0000) / _TME_FIELD_MASK_FACTOR(((tme_uint32_t) 0x7fff0000))) >> 1));
2319   }
2320   ieee754_ctl->tme_ieee754_ctl_lock_unlock = NULL;
2321 
2322   /* signal any exceptions: */
2323   if (exceptions != 0) {
2324     (*ieee754_ctl->tme_ieee754_ctl_exception)(ieee754_ctl, exceptions);
2325   }
2326 }
2327 
2328 #if defined(TME_HAVE_INT64_T)
2329 
2330 /* this does a strict compliance quad-precision from-single: */
2331 static void
_tme_ieee754_strict_quad_from_single(struct tme_ieee754_ctl * ieee754_ctl,const struct tme_float * src0,struct tme_float * dst)2332 _tme_ieee754_strict_quad_from_single(struct tme_ieee754_ctl *ieee754_ctl, const struct tme_float *src0, struct tme_float *dst)
2333 {
2334   tme_uint32_t src0_buffer;
2335   int exceptions;
2336 
2337   /* enter softfloat operation: */
2338   tme_mutex_lock(&tme_ieee754_global_mutex);
2339   tme_ieee754_global_ctl = ieee754_ctl;
2340   tme_ieee754_global_exceptions = 0;
2341   ieee754_ctl->tme_ieee754_ctl_lock_unlock = tme_ieee754_unlock_softfloat;
2342 
2343   /* assume that this operation raises no exceptions: */
2344   exceptions = 0;
2345 
2346   /* the operation: */
2347   _tme_ieee754_quad_value_set(dst, float128,
2348     float32_to_float128((*((const float32 *) tme_ieee754_single_value_get(src0, &src0_buffer)))));
2349 
2350   /* leave softfloat operation: */
2351   tme_ieee754_global_ctl = NULL;
2352   exceptions |= tme_ieee754_global_exceptions;
2353   tme_mutex_unlock(&tme_ieee754_global_mutex);
2354   ieee754_ctl->tme_ieee754_ctl_lock_unlock = NULL;
2355 
2356   /* signal any exceptions: */
2357   if (exceptions != 0) {
2358     (*ieee754_ctl->tme_ieee754_ctl_exception)(ieee754_ctl, exceptions);
2359   }
2360 }
2361 
2362 #endif /* defined(TME_HAVE_INT64_T) */
2363 
2364 #if defined(TME_HAVE_INT64_T)
2365 
2366 /* this does a strict compliance quad-precision from-double: */
2367 static void
_tme_ieee754_strict_quad_from_double(struct tme_ieee754_ctl * ieee754_ctl,const struct tme_float * src0,struct tme_float * dst)2368 _tme_ieee754_strict_quad_from_double(struct tme_ieee754_ctl *ieee754_ctl, const struct tme_float *src0, struct tme_float *dst)
2369 {
2370   union tme_value64 src0_buffer;
2371   int exceptions;
2372 
2373   /* enter softfloat operation: */
2374   tme_mutex_lock(&tme_ieee754_global_mutex);
2375   tme_ieee754_global_ctl = ieee754_ctl;
2376   tme_ieee754_global_exceptions = 0;
2377   ieee754_ctl->tme_ieee754_ctl_lock_unlock = tme_ieee754_unlock_softfloat;
2378 
2379   /* assume that this operation raises no exceptions: */
2380   exceptions = 0;
2381 
2382   /* the operation: */
2383   _tme_ieee754_quad_value_set(dst, float128,
2384     float64_to_float128((*((const float64 *) tme_ieee754_double_value_get(src0, &src0_buffer)))));
2385 
2386   /* leave softfloat operation: */
2387   tme_ieee754_global_ctl = NULL;
2388   exceptions |= tme_ieee754_global_exceptions;
2389   tme_mutex_unlock(&tme_ieee754_global_mutex);
2390   ieee754_ctl->tme_ieee754_ctl_lock_unlock = NULL;
2391 
2392   /* signal any exceptions: */
2393   if (exceptions != 0) {
2394     (*ieee754_ctl->tme_ieee754_ctl_exception)(ieee754_ctl, exceptions);
2395   }
2396 }
2397 
2398 #endif /* defined(TME_HAVE_INT64_T) */
2399 
2400 #if defined(TME_HAVE_INT64_T)
2401 
2402 /* this does a strict compliance quad-precision from-extended80: */
2403 static void
_tme_ieee754_strict_quad_from_extended80(struct tme_ieee754_ctl * ieee754_ctl,const struct tme_float * src0,struct tme_float * dst)2404 _tme_ieee754_strict_quad_from_extended80(struct tme_ieee754_ctl *ieee754_ctl, const struct tme_float *src0, struct tme_float *dst)
2405 {
2406   struct tme_float_ieee754_extended80 src0_buffer;
2407   int exceptions;
2408 
2409   /* enter softfloat operation: */
2410   tme_mutex_lock(&tme_ieee754_global_mutex);
2411   tme_ieee754_global_ctl = ieee754_ctl;
2412   tme_ieee754_global_exceptions = 0;
2413   ieee754_ctl->tme_ieee754_ctl_lock_unlock = tme_ieee754_unlock_softfloat;
2414 
2415   /* assume that this operation raises no exceptions: */
2416   exceptions = 0;
2417 
2418   /* the operation: */
2419   _tme_ieee754_quad_value_set(dst, float128,
2420     floatx80_to_float128((*((const floatx80 *) tme_ieee754_extended80_value_get(src0, &src0_buffer)))));
2421 
2422   /* leave softfloat operation: */
2423   tme_ieee754_global_ctl = NULL;
2424   exceptions |= tme_ieee754_global_exceptions;
2425   tme_mutex_unlock(&tme_ieee754_global_mutex);
2426   ieee754_ctl->tme_ieee754_ctl_lock_unlock = NULL;
2427 
2428   /* signal any exceptions: */
2429   if (exceptions != 0) {
2430     (*ieee754_ctl->tme_ieee754_ctl_exception)(ieee754_ctl, exceptions);
2431   }
2432 }
2433 
2434 #endif /* defined(TME_HAVE_INT64_T) */
2435 
2436 #if defined(TME_HAVE_INT64_T)
2437 
2438 /* this does a strict compliance quad-precision from-int32: */
2439 static void
_tme_ieee754_strict_quad_from_int32(struct tme_ieee754_ctl * ieee754_ctl,const tme_int32_t src0,struct tme_float * dst)2440 _tme_ieee754_strict_quad_from_int32(struct tme_ieee754_ctl *ieee754_ctl, const tme_int32_t src0, struct tme_float *dst)
2441 {
2442   int exceptions;
2443 
2444   /* enter softfloat operation: */
2445   tme_mutex_lock(&tme_ieee754_global_mutex);
2446   tme_ieee754_global_ctl = ieee754_ctl;
2447   tme_ieee754_global_exceptions = 0;
2448   ieee754_ctl->tme_ieee754_ctl_lock_unlock = tme_ieee754_unlock_softfloat;
2449 
2450   /* assume that this operation raises no exceptions: */
2451   exceptions = 0;
2452 
2453   /* the operation: */
2454   _tme_ieee754_quad_value_set(dst, float128,
2455     int32_to_float128(src0));
2456 
2457   /* leave softfloat operation: */
2458   tme_ieee754_global_ctl = NULL;
2459   exceptions |= tme_ieee754_global_exceptions;
2460   tme_mutex_unlock(&tme_ieee754_global_mutex);
2461   ieee754_ctl->tme_ieee754_ctl_lock_unlock = NULL;
2462 
2463   /* signal any exceptions: */
2464   if (exceptions != 0) {
2465     (*ieee754_ctl->tme_ieee754_ctl_exception)(ieee754_ctl, exceptions);
2466   }
2467 }
2468 
2469 #endif /* defined(TME_HAVE_INT64_T) */
2470 
2471 #if defined(TME_HAVE_INT64_T)
2472 
2473 /* this does a strict compliance quad-precision from-int64: */
2474 static void
_tme_ieee754_strict_quad_from_int64(struct tme_ieee754_ctl * ieee754_ctl,const tme_int64_t src0,struct tme_float * dst)2475 _tme_ieee754_strict_quad_from_int64(struct tme_ieee754_ctl *ieee754_ctl, const tme_int64_t src0, struct tme_float *dst)
2476 {
2477   int exceptions;
2478 
2479   /* enter softfloat operation: */
2480   tme_mutex_lock(&tme_ieee754_global_mutex);
2481   tme_ieee754_global_ctl = ieee754_ctl;
2482   tme_ieee754_global_exceptions = 0;
2483   ieee754_ctl->tme_ieee754_ctl_lock_unlock = tme_ieee754_unlock_softfloat;
2484 
2485   /* assume that this operation raises no exceptions: */
2486   exceptions = 0;
2487 
2488   /* the operation: */
2489   _tme_ieee754_quad_value_set(dst, float128,
2490     int64_to_float128(src0));
2491 
2492   /* leave softfloat operation: */
2493   tme_ieee754_global_ctl = NULL;
2494   exceptions |= tme_ieee754_global_exceptions;
2495   tme_mutex_unlock(&tme_ieee754_global_mutex);
2496   ieee754_ctl->tme_ieee754_ctl_lock_unlock = NULL;
2497 
2498   /* signal any exceptions: */
2499   if (exceptions != 0) {
2500     (*ieee754_ctl->tme_ieee754_ctl_exception)(ieee754_ctl, exceptions);
2501   }
2502 }
2503 
2504 #endif /* defined(TME_HAVE_INT64_T) */
2505 
2506 /* this does a strict compliance quad-precision to-int32: */
2507 static void
_tme_ieee754_strict_quad_to_int32(struct tme_ieee754_ctl * ieee754_ctl,const struct tme_float * src0,tme_int32_t * dst)2508 _tme_ieee754_strict_quad_to_int32(struct tme_ieee754_ctl *ieee754_ctl, const struct tme_float *src0, tme_int32_t *dst)
2509 {
2510   struct tme_float_ieee754_quad src0_buffer;
2511   int exceptions;
2512 
2513   /* enter softfloat operation: */
2514   tme_mutex_lock(&tme_ieee754_global_mutex);
2515   tme_ieee754_global_ctl = ieee754_ctl;
2516   tme_ieee754_global_exceptions = 0;
2517   ieee754_ctl->tme_ieee754_ctl_lock_unlock = tme_ieee754_unlock_softfloat;
2518 
2519   /* assume that this operation raises no exceptions: */
2520   exceptions = 0;
2521 
2522   /* the operation: */
2523   *dst = float128_to_int32((*((const float128 *) tme_ieee754_quad_value_get(src0, &src0_buffer))));
2524 
2525   /* leave softfloat operation: */
2526   tme_ieee754_global_ctl = NULL;
2527   exceptions |= tme_ieee754_global_exceptions;
2528   tme_mutex_unlock(&tme_ieee754_global_mutex);
2529   ieee754_ctl->tme_ieee754_ctl_lock_unlock = NULL;
2530 
2531   /* signal any exceptions: */
2532   if (exceptions != 0) {
2533     (*ieee754_ctl->tme_ieee754_ctl_exception)(ieee754_ctl, exceptions);
2534   }
2535 }
2536 
2537 #if defined(TME_HAVE_INT64_T)
2538 
2539 /* this does a strict compliance quad-precision to-int64: */
2540 static void
_tme_ieee754_strict_quad_to_int64(struct tme_ieee754_ctl * ieee754_ctl,const struct tme_float * src0,tme_int64_t * dst)2541 _tme_ieee754_strict_quad_to_int64(struct tme_ieee754_ctl *ieee754_ctl, const struct tme_float *src0, tme_int64_t *dst)
2542 {
2543   struct tme_float_ieee754_quad src0_buffer;
2544   int exceptions;
2545 
2546   /* enter softfloat operation: */
2547   tme_mutex_lock(&tme_ieee754_global_mutex);
2548   tme_ieee754_global_ctl = ieee754_ctl;
2549   tme_ieee754_global_exceptions = 0;
2550   ieee754_ctl->tme_ieee754_ctl_lock_unlock = tme_ieee754_unlock_softfloat;
2551 
2552   /* assume that this operation raises no exceptions: */
2553   exceptions = 0;
2554 
2555   /* the operation: */
2556   *dst = float128_to_int64((*((const float128 *) tme_ieee754_quad_value_get(src0, &src0_buffer))));
2557 
2558   /* leave softfloat operation: */
2559   tme_ieee754_global_ctl = NULL;
2560   exceptions |= tme_ieee754_global_exceptions;
2561   tme_mutex_unlock(&tme_ieee754_global_mutex);
2562   ieee754_ctl->tme_ieee754_ctl_lock_unlock = NULL;
2563 
2564   /* signal any exceptions: */
2565   if (exceptions != 0) {
2566     (*ieee754_ctl->tme_ieee754_ctl_exception)(ieee754_ctl, exceptions);
2567   }
2568 }
2569 
2570 #endif /* defined(TME_HAVE_INT64_T) */
2571 
2572 /* the strict compliance operations: */
2573 _tme_const struct tme_ieee754_ops tme_ieee754_ops_strict = {
2574 
2575   /* the version of this structure: */
2576   TME_X_VERSION(0, 0),
2577 
2578   /* this does a strict compliance single-precision add: */
2579   _tme_ieee754_strict_single_add,
2580 
2581   /* this does a strict compliance single-precision sub: */
2582   _tme_ieee754_strict_single_sub,
2583 
2584   /* this does a strict compliance single-precision mul: */
2585   _tme_ieee754_strict_single_mul,
2586 
2587   /* this does a strict compliance single-precision div: */
2588   _tme_ieee754_strict_single_div,
2589 
2590   /* this does a strict compliance single-precision rem: */
2591   _tme_ieee754_strict_single_rem,
2592 
2593   /* this does a strict compliance single-precision sqrt: */
2594   _tme_ieee754_strict_single_sqrt,
2595 
2596   /* this does a strict compliance single-precision abs: */
2597   NULL,
2598 
2599   /* this does a strict compliance single-precision neg: */
2600   _tme_ieee754_strict_single_neg,
2601 
2602   /* this does a strict compliance single-precision move: */
2603   _tme_ieee754_strict_single_move,
2604 
2605   /* this does a strict compliance single-precision rint: */
2606   _tme_ieee754_strict_single_rint,
2607 
2608   /* this does a strict compliance single-precision cos: */
2609   NULL,
2610 
2611   /* this does a strict compliance single-precision acos: */
2612   NULL,
2613 
2614   /* this does a strict compliance single-precision cosh: */
2615   NULL,
2616 
2617   /* this does a strict compliance single-precision sin: */
2618   NULL,
2619 
2620   /* this does a strict compliance single-precision asin: */
2621   NULL,
2622 
2623   /* this does a strict compliance single-precision sinh: */
2624   NULL,
2625 
2626   /* this does a strict compliance single-precision tan: */
2627   NULL,
2628 
2629   /* this does a strict compliance single-precision atan: */
2630   NULL,
2631 
2632   /* this does a strict compliance single-precision tanh: */
2633   NULL,
2634 
2635   /* this does a strict compliance single-precision atanh: */
2636   NULL,
2637 
2638   /* this does a strict compliance single-precision exp: */
2639   NULL,
2640 
2641   /* this does a strict compliance single-precision expm1: */
2642   NULL,
2643 
2644   /* this does a strict compliance single-precision log10: */
2645   NULL,
2646 
2647   /* this does a strict compliance single-precision log: */
2648   NULL,
2649 
2650   /* this does a strict compliance single-precision log1p: */
2651   NULL,
2652 
2653   /* this does a strict compliance single-precision getexp: */
2654   _tme_ieee754_strict_single_getexp,
2655 
2656   /* this does a strict compliance single-precision getman: */
2657   _tme_ieee754_strict_single_getman,
2658 
2659   /* this does a strict compliance single-precision scale: */
2660   NULL,
2661 
2662   /* this does a strict compliance single-precision pow: */
2663   NULL,
2664 
2665   /* this does a strict compliance single-precision from_double: */
2666   _tme_ieee754_strict_single_from_double,
2667 
2668   /* this does a strict compliance single-precision from_extended80: */
2669   _tme_ieee754_strict_single_from_extended80,
2670 
2671   /* this does a strict compliance single-precision from_quad: */
2672   _tme_ieee754_strict_single_from_quad,
2673 
2674   /* this does a strict compliance single-precision from_int32: */
2675   _tme_ieee754_strict_single_from_int32,
2676 
2677   /* this does a strict compliance single-precision from_int64: */
2678 #if (defined(TME_HAVE_INT64_T))
2679   _tme_ieee754_strict_single_from_int64,
2680 #else  /* !(defined(TME_HAVE_INT64_T)) */
2681   NULL,
2682 #endif /* !(defined(TME_HAVE_INT64_T)) */
2683 
2684   /* this does a strict compliance single-precision to_int32: */
2685   _tme_ieee754_strict_single_to_int32,
2686 
2687   /* this does a strict compliance single-precision to_int64: */
2688 #if (defined(TME_HAVE_INT64_T))
2689   _tme_ieee754_strict_single_to_int64,
2690 #else  /* !(defined(TME_HAVE_INT64_T)) */
2691   NULL,
2692 #endif /* !(defined(TME_HAVE_INT64_T)) */
2693 
2694   /* this does a strict compliance double-precision add: */
2695   _tme_ieee754_strict_double_add,
2696 
2697   /* this does a strict compliance double-precision sub: */
2698   _tme_ieee754_strict_double_sub,
2699 
2700   /* this does a strict compliance double-precision mul: */
2701   _tme_ieee754_strict_double_mul,
2702 
2703   /* this does a strict compliance double-precision div: */
2704   _tme_ieee754_strict_double_div,
2705 
2706   /* this does a strict compliance double-precision rem: */
2707   _tme_ieee754_strict_double_rem,
2708 
2709   /* this does a strict compliance double-precision sqrt: */
2710   _tme_ieee754_strict_double_sqrt,
2711 
2712   /* this does a strict compliance double-precision abs: */
2713   NULL,
2714 
2715   /* this does a strict compliance double-precision neg: */
2716   _tme_ieee754_strict_double_neg,
2717 
2718   /* this does a strict compliance double-precision move: */
2719   _tme_ieee754_strict_double_move,
2720 
2721   /* this does a strict compliance double-precision rint: */
2722   _tme_ieee754_strict_double_rint,
2723 
2724   /* this does a strict compliance double-precision cos: */
2725   NULL,
2726 
2727   /* this does a strict compliance double-precision acos: */
2728   NULL,
2729 
2730   /* this does a strict compliance double-precision cosh: */
2731   NULL,
2732 
2733   /* this does a strict compliance double-precision sin: */
2734   NULL,
2735 
2736   /* this does a strict compliance double-precision asin: */
2737   NULL,
2738 
2739   /* this does a strict compliance double-precision sinh: */
2740   NULL,
2741 
2742   /* this does a strict compliance double-precision tan: */
2743   NULL,
2744 
2745   /* this does a strict compliance double-precision atan: */
2746   NULL,
2747 
2748   /* this does a strict compliance double-precision tanh: */
2749   NULL,
2750 
2751   /* this does a strict compliance double-precision atanh: */
2752   NULL,
2753 
2754   /* this does a strict compliance double-precision exp: */
2755   NULL,
2756 
2757   /* this does a strict compliance double-precision expm1: */
2758   NULL,
2759 
2760   /* this does a strict compliance double-precision log10: */
2761   NULL,
2762 
2763   /* this does a strict compliance double-precision log: */
2764   NULL,
2765 
2766   /* this does a strict compliance double-precision log1p: */
2767   NULL,
2768 
2769   /* this does a strict compliance double-precision getexp: */
2770   _tme_ieee754_strict_double_getexp,
2771 
2772   /* this does a strict compliance double-precision getman: */
2773   _tme_ieee754_strict_double_getman,
2774 
2775   /* this does a strict compliance double-precision scale: */
2776   NULL,
2777 
2778   /* this does a strict compliance double-precision pow: */
2779   NULL,
2780 
2781   /* this does a strict compliance double-precision from_single: */
2782   _tme_ieee754_strict_double_from_single,
2783 
2784   /* this does a strict compliance double-precision from_extended80: */
2785   _tme_ieee754_strict_double_from_extended80,
2786 
2787   /* this does a strict compliance double-precision from_quad: */
2788   _tme_ieee754_strict_double_from_quad,
2789 
2790   /* this does a strict compliance double-precision from_int32: */
2791   _tme_ieee754_strict_double_from_int32,
2792 
2793   /* this does a strict compliance double-precision from_int64: */
2794 #if (defined(TME_HAVE_INT64_T))
2795   _tme_ieee754_strict_double_from_int64,
2796 #else  /* !(defined(TME_HAVE_INT64_T)) */
2797   NULL,
2798 #endif /* !(defined(TME_HAVE_INT64_T)) */
2799 
2800   /* this does a strict compliance double-precision to_int32: */
2801   _tme_ieee754_strict_double_to_int32,
2802 
2803   /* this does a strict compliance double-precision to_int64: */
2804 #if (defined(TME_HAVE_INT64_T))
2805   _tme_ieee754_strict_double_to_int64,
2806 #else  /* !(defined(TME_HAVE_INT64_T)) */
2807   NULL,
2808 #endif /* !(defined(TME_HAVE_INT64_T)) */
2809 
2810   /* this does a strict compliance extended80-precision add: */
2811 #if (defined(TME_HAVE_INT64_T))
2812   _tme_ieee754_strict_extended80_add,
2813 #else  /* !(defined(TME_HAVE_INT64_T)) */
2814   NULL,
2815 #endif /* !(defined(TME_HAVE_INT64_T)) */
2816 
2817   /* this does a strict compliance extended80-precision sub: */
2818 #if (defined(TME_HAVE_INT64_T))
2819   _tme_ieee754_strict_extended80_sub,
2820 #else  /* !(defined(TME_HAVE_INT64_T)) */
2821   NULL,
2822 #endif /* !(defined(TME_HAVE_INT64_T)) */
2823 
2824   /* this does a strict compliance extended80-precision mul: */
2825 #if (defined(TME_HAVE_INT64_T))
2826   _tme_ieee754_strict_extended80_mul,
2827 #else  /* !(defined(TME_HAVE_INT64_T)) */
2828   NULL,
2829 #endif /* !(defined(TME_HAVE_INT64_T)) */
2830 
2831   /* this does a strict compliance extended80-precision div: */
2832 #if (defined(TME_HAVE_INT64_T))
2833   _tme_ieee754_strict_extended80_div,
2834 #else  /* !(defined(TME_HAVE_INT64_T)) */
2835   NULL,
2836 #endif /* !(defined(TME_HAVE_INT64_T)) */
2837 
2838   /* this does a strict compliance extended80-precision rem: */
2839 #if (defined(TME_HAVE_INT64_T))
2840   _tme_ieee754_strict_extended80_rem,
2841 #else  /* !(defined(TME_HAVE_INT64_T)) */
2842   NULL,
2843 #endif /* !(defined(TME_HAVE_INT64_T)) */
2844 
2845   /* this does a strict compliance extended80-precision sqrt: */
2846 #if (defined(TME_HAVE_INT64_T))
2847   _tme_ieee754_strict_extended80_sqrt,
2848 #else  /* !(defined(TME_HAVE_INT64_T)) */
2849   NULL,
2850 #endif /* !(defined(TME_HAVE_INT64_T)) */
2851 
2852   /* this does a strict compliance extended80-precision abs: */
2853   NULL,
2854 
2855   /* this does a strict compliance extended80-precision neg: */
2856 #if (defined(TME_HAVE_INT64_T))
2857   _tme_ieee754_strict_extended80_neg,
2858 #else  /* !(defined(TME_HAVE_INT64_T)) */
2859   NULL,
2860 #endif /* !(defined(TME_HAVE_INT64_T)) */
2861 
2862   /* this does a strict compliance extended80-precision move: */
2863 #if (defined(TME_HAVE_INT64_T))
2864   _tme_ieee754_strict_extended80_move,
2865 #else  /* !(defined(TME_HAVE_INT64_T)) */
2866   NULL,
2867 #endif /* !(defined(TME_HAVE_INT64_T)) */
2868 
2869   /* this does a strict compliance extended80-precision rint: */
2870 #if (defined(TME_HAVE_INT64_T))
2871   _tme_ieee754_strict_extended80_rint,
2872 #else  /* !(defined(TME_HAVE_INT64_T)) */
2873   NULL,
2874 #endif /* !(defined(TME_HAVE_INT64_T)) */
2875 
2876   /* this does a strict compliance extended80-precision cos: */
2877   NULL,
2878 
2879   /* this does a strict compliance extended80-precision acos: */
2880   NULL,
2881 
2882   /* this does a strict compliance extended80-precision cosh: */
2883   NULL,
2884 
2885   /* this does a strict compliance extended80-precision sin: */
2886   NULL,
2887 
2888   /* this does a strict compliance extended80-precision asin: */
2889   NULL,
2890 
2891   /* this does a strict compliance extended80-precision sinh: */
2892   NULL,
2893 
2894   /* this does a strict compliance extended80-precision tan: */
2895   NULL,
2896 
2897   /* this does a strict compliance extended80-precision atan: */
2898   NULL,
2899 
2900   /* this does a strict compliance extended80-precision tanh: */
2901   NULL,
2902 
2903   /* this does a strict compliance extended80-precision atanh: */
2904   NULL,
2905 
2906   /* this does a strict compliance extended80-precision exp: */
2907   NULL,
2908 
2909   /* this does a strict compliance extended80-precision expm1: */
2910   NULL,
2911 
2912   /* this does a strict compliance extended80-precision log10: */
2913   NULL,
2914 
2915   /* this does a strict compliance extended80-precision log: */
2916   NULL,
2917 
2918   /* this does a strict compliance extended80-precision log1p: */
2919   NULL,
2920 
2921   /* this does a strict compliance extended80-precision getexp: */
2922   _tme_ieee754_strict_extended80_getexp,
2923 
2924   /* this does a strict compliance extended80-precision getman: */
2925   _tme_ieee754_strict_extended80_getman,
2926 
2927   /* this does a strict compliance extended80-precision scale: */
2928   NULL,
2929 
2930   /* this does a strict compliance extended80-precision pow: */
2931   NULL,
2932 
2933   /* this does a strict compliance extended80-precision from_single: */
2934 #if (defined(TME_HAVE_INT64_T))
2935   _tme_ieee754_strict_extended80_from_single,
2936 #else  /* !(defined(TME_HAVE_INT64_T)) */
2937   NULL,
2938 #endif /* !(defined(TME_HAVE_INT64_T)) */
2939 
2940   /* this does a strict compliance extended80-precision from_double: */
2941 #if (defined(TME_HAVE_INT64_T))
2942   _tme_ieee754_strict_extended80_from_double,
2943 #else  /* !(defined(TME_HAVE_INT64_T)) */
2944   NULL,
2945 #endif /* !(defined(TME_HAVE_INT64_T)) */
2946 
2947   /* this does a strict compliance extended80-precision from_quad: */
2948 #if (defined(TME_HAVE_INT64_T))
2949   _tme_ieee754_strict_extended80_from_quad,
2950 #else  /* !(defined(TME_HAVE_INT64_T)) */
2951   NULL,
2952 #endif /* !(defined(TME_HAVE_INT64_T)) */
2953 
2954   /* this does a strict compliance extended80-precision from_int32: */
2955 #if (defined(TME_HAVE_INT64_T))
2956   _tme_ieee754_strict_extended80_from_int32,
2957 #else  /* !(defined(TME_HAVE_INT64_T)) */
2958   NULL,
2959 #endif /* !(defined(TME_HAVE_INT64_T)) */
2960 
2961   /* this does a strict compliance extended80-precision from_int64: */
2962 #if (defined(TME_HAVE_INT64_T))
2963   _tme_ieee754_strict_extended80_from_int64,
2964 #else  /* !(defined(TME_HAVE_INT64_T)) */
2965   NULL,
2966 #endif /* !(defined(TME_HAVE_INT64_T)) */
2967 
2968   /* this does a strict compliance extended80-precision to_int32: */
2969   _tme_ieee754_strict_extended80_to_int32,
2970 
2971   /* this does a strict compliance extended80-precision to_int64: */
2972 #if (defined(TME_HAVE_INT64_T))
2973   _tme_ieee754_strict_extended80_to_int64,
2974 #else  /* !(defined(TME_HAVE_INT64_T)) */
2975   NULL,
2976 #endif /* !(defined(TME_HAVE_INT64_T)) */
2977 
2978   /* this does a strict compliance quad-precision add: */
2979 #if (defined(TME_HAVE_INT64_T))
2980   _tme_ieee754_strict_quad_add,
2981 #else  /* !(defined(TME_HAVE_INT64_T)) */
2982   NULL,
2983 #endif /* !(defined(TME_HAVE_INT64_T)) */
2984 
2985   /* this does a strict compliance quad-precision sub: */
2986 #if (defined(TME_HAVE_INT64_T))
2987   _tme_ieee754_strict_quad_sub,
2988 #else  /* !(defined(TME_HAVE_INT64_T)) */
2989   NULL,
2990 #endif /* !(defined(TME_HAVE_INT64_T)) */
2991 
2992   /* this does a strict compliance quad-precision mul: */
2993 #if (defined(TME_HAVE_INT64_T))
2994   _tme_ieee754_strict_quad_mul,
2995 #else  /* !(defined(TME_HAVE_INT64_T)) */
2996   NULL,
2997 #endif /* !(defined(TME_HAVE_INT64_T)) */
2998 
2999   /* this does a strict compliance quad-precision div: */
3000 #if (defined(TME_HAVE_INT64_T))
3001   _tme_ieee754_strict_quad_div,
3002 #else  /* !(defined(TME_HAVE_INT64_T)) */
3003   NULL,
3004 #endif /* !(defined(TME_HAVE_INT64_T)) */
3005 
3006   /* this does a strict compliance quad-precision rem: */
3007 #if (defined(TME_HAVE_INT64_T))
3008   _tme_ieee754_strict_quad_rem,
3009 #else  /* !(defined(TME_HAVE_INT64_T)) */
3010   NULL,
3011 #endif /* !(defined(TME_HAVE_INT64_T)) */
3012 
3013   /* this does a strict compliance quad-precision sqrt: */
3014 #if (defined(TME_HAVE_INT64_T))
3015   _tme_ieee754_strict_quad_sqrt,
3016 #else  /* !(defined(TME_HAVE_INT64_T)) */
3017   NULL,
3018 #endif /* !(defined(TME_HAVE_INT64_T)) */
3019 
3020   /* this does a strict compliance quad-precision abs: */
3021   NULL,
3022 
3023   /* this does a strict compliance quad-precision neg: */
3024 #if (defined(TME_HAVE_INT64_T))
3025   _tme_ieee754_strict_quad_neg,
3026 #else  /* !(defined(TME_HAVE_INT64_T)) */
3027   NULL,
3028 #endif /* !(defined(TME_HAVE_INT64_T)) */
3029 
3030   /* this does a strict compliance quad-precision move: */
3031 #if (defined(TME_HAVE_INT64_T))
3032   _tme_ieee754_strict_quad_move,
3033 #else  /* !(defined(TME_HAVE_INT64_T)) */
3034   NULL,
3035 #endif /* !(defined(TME_HAVE_INT64_T)) */
3036 
3037   /* this does a strict compliance quad-precision rint: */
3038 #if (defined(TME_HAVE_INT64_T))
3039   _tme_ieee754_strict_quad_rint,
3040 #else  /* !(defined(TME_HAVE_INT64_T)) */
3041   NULL,
3042 #endif /* !(defined(TME_HAVE_INT64_T)) */
3043 
3044   /* this does a strict compliance quad-precision cos: */
3045   NULL,
3046 
3047   /* this does a strict compliance quad-precision acos: */
3048   NULL,
3049 
3050   /* this does a strict compliance quad-precision cosh: */
3051   NULL,
3052 
3053   /* this does a strict compliance quad-precision sin: */
3054   NULL,
3055 
3056   /* this does a strict compliance quad-precision asin: */
3057   NULL,
3058 
3059   /* this does a strict compliance quad-precision sinh: */
3060   NULL,
3061 
3062   /* this does a strict compliance quad-precision tan: */
3063   NULL,
3064 
3065   /* this does a strict compliance quad-precision atan: */
3066   NULL,
3067 
3068   /* this does a strict compliance quad-precision tanh: */
3069   NULL,
3070 
3071   /* this does a strict compliance quad-precision atanh: */
3072   NULL,
3073 
3074   /* this does a strict compliance quad-precision exp: */
3075   NULL,
3076 
3077   /* this does a strict compliance quad-precision expm1: */
3078   NULL,
3079 
3080   /* this does a strict compliance quad-precision log10: */
3081   NULL,
3082 
3083   /* this does a strict compliance quad-precision log: */
3084   NULL,
3085 
3086   /* this does a strict compliance quad-precision log1p: */
3087   NULL,
3088 
3089   /* this does a strict compliance quad-precision getexp: */
3090   _tme_ieee754_strict_quad_getexp,
3091 
3092   /* this does a strict compliance quad-precision getman: */
3093   _tme_ieee754_strict_quad_getman,
3094 
3095   /* this does a strict compliance quad-precision scale: */
3096   NULL,
3097 
3098   /* this does a strict compliance quad-precision pow: */
3099   NULL,
3100 
3101   /* this does a strict compliance quad-precision from_single: */
3102 #if (defined(TME_HAVE_INT64_T))
3103   _tme_ieee754_strict_quad_from_single,
3104 #else  /* !(defined(TME_HAVE_INT64_T)) */
3105   NULL,
3106 #endif /* !(defined(TME_HAVE_INT64_T)) */
3107 
3108   /* this does a strict compliance quad-precision from_double: */
3109 #if (defined(TME_HAVE_INT64_T))
3110   _tme_ieee754_strict_quad_from_double,
3111 #else  /* !(defined(TME_HAVE_INT64_T)) */
3112   NULL,
3113 #endif /* !(defined(TME_HAVE_INT64_T)) */
3114 
3115   /* this does a strict compliance quad-precision from_extended80: */
3116 #if (defined(TME_HAVE_INT64_T))
3117   _tme_ieee754_strict_quad_from_extended80,
3118 #else  /* !(defined(TME_HAVE_INT64_T)) */
3119   NULL,
3120 #endif /* !(defined(TME_HAVE_INT64_T)) */
3121 
3122   /* this does a strict compliance quad-precision from_int32: */
3123 #if (defined(TME_HAVE_INT64_T))
3124   _tme_ieee754_strict_quad_from_int32,
3125 #else  /* !(defined(TME_HAVE_INT64_T)) */
3126   NULL,
3127 #endif /* !(defined(TME_HAVE_INT64_T)) */
3128 
3129   /* this does a strict compliance quad-precision from_int64: */
3130 #if (defined(TME_HAVE_INT64_T))
3131   _tme_ieee754_strict_quad_from_int64,
3132 #else  /* !(defined(TME_HAVE_INT64_T)) */
3133   NULL,
3134 #endif /* !(defined(TME_HAVE_INT64_T)) */
3135 
3136   /* this does a strict compliance quad-precision to_int32: */
3137   _tme_ieee754_strict_quad_to_int32,
3138 
3139   /* this does a strict compliance quad-precision to_int64: */
3140 #if (defined(TME_HAVE_INT64_T))
3141   _tme_ieee754_strict_quad_to_int64,
3142 #else  /* !(defined(TME_HAVE_INT64_T)) */
3143   NULL,
3144 #endif /* !(defined(TME_HAVE_INT64_T)) */
3145 };
3146 
3147 #if (TME_FLOAT_FORMAT_IEEE754_SINGLE_BUILTIN == TME_FLOAT_FORMAT_IEEE754_SINGLE)
3148 
3149 /* this does a partial compliance single-precision add: */
3150 static void
_tme_ieee754_partial_single_add(struct tme_ieee754_ctl * ieee754_ctl,const struct tme_float * src0,const struct tme_float * src1,struct tme_float * dst)3151 _tme_ieee754_partial_single_add(struct tme_ieee754_ctl *ieee754_ctl, const struct tme_float *src0, const struct tme_float *src1, struct tme_float *dst)
3152 {
3153   int exceptions;
3154 
3155   /* check for a NaN operand: */
3156   if (__tme_predict_false(tme_ieee754_single_check_nan_dyadic(ieee754_ctl, src0, src1, dst))) {
3157     return;
3158   }
3159 
3160   /* enter native floating-point operation: */
3161   tme_float_enter(ieee754_ctl->tme_ieee754_ctl_rounding_mode, tme_ieee754_exception_float, ieee754_ctl);
3162   ieee754_ctl->tme_ieee754_ctl_lock_unlock = tme_float_leave;
3163 
3164   /* assume that this operation raises no exceptions: */
3165   exceptions = 0;
3166 
3167   /* the operation: */
3168   tme_ieee754_single_value_builtin_set(dst, TME_FLOAT_FORMAT_IEEE754_SINGLE_BUILTIN, tme_ieee754_single_value_builtin_get(src0) + tme_ieee754_single_value_builtin_get(src1));
3169 
3170   /* leave native floating-point operation: */
3171   exceptions |= tme_float_leave();
3172   ieee754_ctl->tme_ieee754_ctl_lock_unlock = NULL;
3173 
3174   /* signal any exceptions: */
3175   if (exceptions != 0) {
3176     (*ieee754_ctl->tme_ieee754_ctl_exception)(ieee754_ctl, exceptions);
3177   }
3178 }
3179 
3180 #endif /* (TME_FLOAT_FORMAT_IEEE754_SINGLE_BUILTIN == TME_FLOAT_FORMAT_IEEE754_SINGLE) */
3181 
3182 #if (TME_FLOAT_FORMAT_IEEE754_SINGLE_BUILTIN == TME_FLOAT_FORMAT_IEEE754_SINGLE)
3183 
3184 /* this does a partial compliance single-precision sub: */
3185 static void
_tme_ieee754_partial_single_sub(struct tme_ieee754_ctl * ieee754_ctl,const struct tme_float * src0,const struct tme_float * src1,struct tme_float * dst)3186 _tme_ieee754_partial_single_sub(struct tme_ieee754_ctl *ieee754_ctl, const struct tme_float *src0, const struct tme_float *src1, struct tme_float *dst)
3187 {
3188   int exceptions;
3189 
3190   /* check for a NaN operand: */
3191   if (__tme_predict_false(tme_ieee754_single_check_nan_dyadic(ieee754_ctl, src0, src1, dst))) {
3192     return;
3193   }
3194 
3195   /* enter native floating-point operation: */
3196   tme_float_enter(ieee754_ctl->tme_ieee754_ctl_rounding_mode, tme_ieee754_exception_float, ieee754_ctl);
3197   ieee754_ctl->tme_ieee754_ctl_lock_unlock = tme_float_leave;
3198 
3199   /* assume that this operation raises no exceptions: */
3200   exceptions = 0;
3201 
3202   /* the operation: */
3203   tme_ieee754_single_value_builtin_set(dst, TME_FLOAT_FORMAT_IEEE754_SINGLE_BUILTIN, tme_ieee754_single_value_builtin_get(src0) - tme_ieee754_single_value_builtin_get(src1));
3204 
3205   /* leave native floating-point operation: */
3206   exceptions |= tme_float_leave();
3207   ieee754_ctl->tme_ieee754_ctl_lock_unlock = NULL;
3208 
3209   /* signal any exceptions: */
3210   if (exceptions != 0) {
3211     (*ieee754_ctl->tme_ieee754_ctl_exception)(ieee754_ctl, exceptions);
3212   }
3213 }
3214 
3215 #endif /* (TME_FLOAT_FORMAT_IEEE754_SINGLE_BUILTIN == TME_FLOAT_FORMAT_IEEE754_SINGLE) */
3216 
3217 #if (TME_FLOAT_FORMAT_IEEE754_SINGLE_BUILTIN == TME_FLOAT_FORMAT_IEEE754_SINGLE)
3218 
3219 /* this does a partial compliance single-precision mul: */
3220 static void
_tme_ieee754_partial_single_mul(struct tme_ieee754_ctl * ieee754_ctl,const struct tme_float * src0,const struct tme_float * src1,struct tme_float * dst)3221 _tme_ieee754_partial_single_mul(struct tme_ieee754_ctl *ieee754_ctl, const struct tme_float *src0, const struct tme_float *src1, struct tme_float *dst)
3222 {
3223   int exceptions;
3224 
3225   /* check for a NaN operand: */
3226   if (__tme_predict_false(tme_ieee754_single_check_nan_dyadic(ieee754_ctl, src0, src1, dst))) {
3227     return;
3228   }
3229 
3230   /* enter native floating-point operation: */
3231   tme_float_enter(ieee754_ctl->tme_ieee754_ctl_rounding_mode, tme_ieee754_exception_float, ieee754_ctl);
3232   ieee754_ctl->tme_ieee754_ctl_lock_unlock = tme_float_leave;
3233 
3234   /* assume that this operation raises no exceptions: */
3235   exceptions = 0;
3236 
3237   /* the operation: */
3238   tme_ieee754_single_value_builtin_set(dst, TME_FLOAT_FORMAT_IEEE754_SINGLE_BUILTIN, tme_ieee754_single_value_builtin_get(src0) * tme_ieee754_single_value_builtin_get(src1));
3239 
3240   /* leave native floating-point operation: */
3241   exceptions |= tme_float_leave();
3242   ieee754_ctl->tme_ieee754_ctl_lock_unlock = NULL;
3243 
3244   /* signal any exceptions: */
3245   if (exceptions != 0) {
3246     (*ieee754_ctl->tme_ieee754_ctl_exception)(ieee754_ctl, exceptions);
3247   }
3248 }
3249 
3250 #endif /* (TME_FLOAT_FORMAT_IEEE754_SINGLE_BUILTIN == TME_FLOAT_FORMAT_IEEE754_SINGLE) */
3251 
3252 #if (TME_FLOAT_FORMAT_IEEE754_SINGLE_BUILTIN == TME_FLOAT_FORMAT_IEEE754_SINGLE)
3253 
3254 /* this does a partial compliance single-precision div: */
3255 static void
_tme_ieee754_partial_single_div(struct tme_ieee754_ctl * ieee754_ctl,const struct tme_float * src0,const struct tme_float * src1,struct tme_float * dst)3256 _tme_ieee754_partial_single_div(struct tme_ieee754_ctl *ieee754_ctl, const struct tme_float *src0, const struct tme_float *src1, struct tme_float *dst)
3257 {
3258   int exceptions;
3259 
3260   /* check for a NaN operand: */
3261   if (__tme_predict_false(tme_ieee754_single_check_nan_dyadic(ieee754_ctl, src0, src1, dst))) {
3262     return;
3263   }
3264 
3265   /* enter native floating-point operation: */
3266   tme_float_enter(ieee754_ctl->tme_ieee754_ctl_rounding_mode, tme_ieee754_exception_float, ieee754_ctl);
3267   ieee754_ctl->tme_ieee754_ctl_lock_unlock = tme_float_leave;
3268 
3269   /* assume that this operation raises no exceptions: */
3270   exceptions = 0;
3271 
3272   /* the operation: */
3273   tme_ieee754_single_value_builtin_set(dst, TME_FLOAT_FORMAT_IEEE754_SINGLE_BUILTIN, tme_ieee754_single_value_builtin_get(src0) / tme_ieee754_single_value_builtin_get(src1));
3274 
3275   /* leave native floating-point operation: */
3276   exceptions |= tme_float_leave();
3277   ieee754_ctl->tme_ieee754_ctl_lock_unlock = NULL;
3278 
3279   /* signal any exceptions: */
3280   if (exceptions != 0) {
3281     (*ieee754_ctl->tme_ieee754_ctl_exception)(ieee754_ctl, exceptions);
3282   }
3283 }
3284 
3285 #endif /* (TME_FLOAT_FORMAT_IEEE754_SINGLE_BUILTIN == TME_FLOAT_FORMAT_IEEE754_SINGLE) */
3286 
3287 #if (TME_FLOAT_FORMAT_IEEE754_SINGLE_BUILTIN == TME_FLOAT_FORMAT_IEEE754_SINGLE)
3288 
3289 /* this does a partial compliance single-precision sqrt: */
3290 static void
_tme_ieee754_partial_single_sqrt(struct tme_ieee754_ctl * ieee754_ctl,const struct tme_float * src0,struct tme_float * dst)3291 _tme_ieee754_partial_single_sqrt(struct tme_ieee754_ctl *ieee754_ctl, const struct tme_float *src0, struct tme_float *dst)
3292 {
3293   int exceptions;
3294 
3295   /* check for a NaN operand: */
3296   if (__tme_predict_false(tme_ieee754_single_check_nan_monadic(ieee754_ctl, src0, dst))) {
3297     return;
3298   }
3299 
3300   /* enter native floating-point operation: */
3301   tme_float_enter(ieee754_ctl->tme_ieee754_ctl_rounding_mode, tme_ieee754_exception_float, ieee754_ctl);
3302   ieee754_ctl->tme_ieee754_ctl_lock_unlock = tme_float_leave;
3303 
3304   /* assume that this operation raises no exceptions: */
3305   exceptions = 0;
3306 
3307   /* the operation: */
3308 #if (TME_FLOAT_FORMAT_IEEE754_SINGLE_BUILTIN == TME_FLOAT_FORMAT_FLOAT)
3309   tme_ieee754_single_value_builtin_set(dst, TME_FLOAT_FORMAT_FLOAT, sqrtf(tme_ieee754_single_value_builtin_get(src0)));
3310 #else  /* (TME_FLOAT_FORMAT_IEEE754_SINGLE_BUILTIN != TME_FLOAT_FORMAT_FLOAT) */
3311   tme_ieee754_single_value_builtin_set(dst, TME_FLOAT_FORMAT_DOUBLE, sqrt(tme_ieee754_single_value_builtin_get(src0)));
3312 #endif /* (TME_FLOAT_FORMAT_IEEE754_SINGLE_BUILTIN != TME_FLOAT_FORMAT_FLOAT) */
3313 
3314   /* leave native floating-point operation: */
3315   exceptions |= tme_float_leave();
3316   ieee754_ctl->tme_ieee754_ctl_lock_unlock = NULL;
3317 
3318   /* signal any exceptions: */
3319   if (exceptions != 0) {
3320     (*ieee754_ctl->tme_ieee754_ctl_exception)(ieee754_ctl, exceptions);
3321   }
3322 }
3323 
3324 #endif /* (TME_FLOAT_FORMAT_IEEE754_SINGLE_BUILTIN == TME_FLOAT_FORMAT_IEEE754_SINGLE) */
3325 
3326 #if (TME_FLOAT_FORMAT_IEEE754_SINGLE_BUILTIN == TME_FLOAT_FORMAT_IEEE754_SINGLE)
3327 
3328 /* this does a partial compliance single-precision abs: */
3329 static void
_tme_ieee754_partial_single_abs(struct tme_ieee754_ctl * ieee754_ctl,const struct tme_float * src0,struct tme_float * dst)3330 _tme_ieee754_partial_single_abs(struct tme_ieee754_ctl *ieee754_ctl, const struct tme_float *src0, struct tme_float *dst)
3331 {
3332   int exceptions;
3333 
3334   /* check for a NaN operand: */
3335   if (__tme_predict_false(tme_ieee754_single_check_nan_monadic(ieee754_ctl, src0, dst))) {
3336     return;
3337   }
3338 
3339   /* enter native floating-point operation: */
3340   tme_float_enter(ieee754_ctl->tme_ieee754_ctl_rounding_mode, tme_ieee754_exception_float, ieee754_ctl);
3341   ieee754_ctl->tme_ieee754_ctl_lock_unlock = tme_float_leave;
3342 
3343   /* assume that this operation raises no exceptions: */
3344   exceptions = 0;
3345 
3346   /* the operation: */
3347 #if (TME_FLOAT_FORMAT_IEEE754_SINGLE_BUILTIN == TME_FLOAT_FORMAT_FLOAT)
3348   tme_ieee754_single_value_builtin_set(dst, TME_FLOAT_FORMAT_FLOAT, fabsf(tme_ieee754_single_value_builtin_get(src0)));
3349 #else  /* (TME_FLOAT_FORMAT_IEEE754_SINGLE_BUILTIN != TME_FLOAT_FORMAT_FLOAT) */
3350   tme_ieee754_single_value_builtin_set(dst, TME_FLOAT_FORMAT_DOUBLE, fabs(tme_ieee754_single_value_builtin_get(src0)));
3351 #endif /* (TME_FLOAT_FORMAT_IEEE754_SINGLE_BUILTIN != TME_FLOAT_FORMAT_FLOAT) */
3352 
3353   /* leave native floating-point operation: */
3354   exceptions |= tme_float_leave();
3355   ieee754_ctl->tme_ieee754_ctl_lock_unlock = NULL;
3356 
3357   /* signal any exceptions: */
3358   if (exceptions != 0) {
3359     (*ieee754_ctl->tme_ieee754_ctl_exception)(ieee754_ctl, exceptions);
3360   }
3361 }
3362 
3363 #endif /* (TME_FLOAT_FORMAT_IEEE754_SINGLE_BUILTIN == TME_FLOAT_FORMAT_IEEE754_SINGLE) */
3364 
3365 #if (TME_FLOAT_FORMAT_IEEE754_SINGLE_BUILTIN == TME_FLOAT_FORMAT_IEEE754_SINGLE)
3366 
3367 /* this does a partial compliance single-precision neg: */
3368 static void
_tme_ieee754_partial_single_neg(struct tme_ieee754_ctl * ieee754_ctl,const struct tme_float * src0,struct tme_float * dst)3369 _tme_ieee754_partial_single_neg(struct tme_ieee754_ctl *ieee754_ctl, const struct tme_float *src0, struct tme_float *dst)
3370 {
3371   int exceptions;
3372 
3373   /* check for a NaN operand: */
3374   if (__tme_predict_false(tme_ieee754_single_check_nan_monadic(ieee754_ctl, src0, dst))) {
3375     return;
3376   }
3377 
3378   /* enter native floating-point operation: */
3379   tme_float_enter(ieee754_ctl->tme_ieee754_ctl_rounding_mode, tme_ieee754_exception_float, ieee754_ctl);
3380   ieee754_ctl->tme_ieee754_ctl_lock_unlock = tme_float_leave;
3381 
3382   /* assume that this operation raises no exceptions: */
3383   exceptions = 0;
3384 
3385   /* the operation: */
3386   tme_ieee754_single_value_builtin_set(dst, TME_FLOAT_FORMAT_IEEE754_SINGLE_BUILTIN, -1 * tme_ieee754_single_value_builtin_get(src0));
3387 
3388   /* leave native floating-point operation: */
3389   exceptions |= tme_float_leave();
3390   ieee754_ctl->tme_ieee754_ctl_lock_unlock = NULL;
3391 
3392   /* signal any exceptions: */
3393   if (exceptions != 0) {
3394     (*ieee754_ctl->tme_ieee754_ctl_exception)(ieee754_ctl, exceptions);
3395   }
3396 }
3397 
3398 #endif /* (TME_FLOAT_FORMAT_IEEE754_SINGLE_BUILTIN == TME_FLOAT_FORMAT_IEEE754_SINGLE) */
3399 
3400 #if (TME_FLOAT_FORMAT_IEEE754_SINGLE_BUILTIN == TME_FLOAT_FORMAT_IEEE754_SINGLE)
3401 
3402 /* this does a partial compliance single-precision move: */
3403 static void
_tme_ieee754_partial_single_move(struct tme_ieee754_ctl * ieee754_ctl,const struct tme_float * src0,struct tme_float * dst)3404 _tme_ieee754_partial_single_move(struct tme_ieee754_ctl *ieee754_ctl, const struct tme_float *src0, struct tme_float *dst)
3405 {
3406   int exceptions;
3407 
3408   /* check for a NaN operand: */
3409   if (__tme_predict_false(tme_ieee754_single_check_nan_monadic(ieee754_ctl, src0, dst))) {
3410     return;
3411   }
3412 
3413   /* enter native floating-point operation: */
3414   tme_float_enter(ieee754_ctl->tme_ieee754_ctl_rounding_mode, tme_ieee754_exception_float, ieee754_ctl);
3415   ieee754_ctl->tme_ieee754_ctl_lock_unlock = tme_float_leave;
3416 
3417   /* assume that this operation raises no exceptions: */
3418   exceptions = 0;
3419 
3420   /* the operation: */
3421   *dst = *src0;
3422 
3423   /* leave native floating-point operation: */
3424   exceptions |= tme_float_leave();
3425   ieee754_ctl->tme_ieee754_ctl_lock_unlock = NULL;
3426 
3427   /* signal any exceptions: */
3428   if (exceptions != 0) {
3429     (*ieee754_ctl->tme_ieee754_ctl_exception)(ieee754_ctl, exceptions);
3430   }
3431 }
3432 
3433 #endif /* (TME_FLOAT_FORMAT_IEEE754_SINGLE_BUILTIN == TME_FLOAT_FORMAT_IEEE754_SINGLE) */
3434 
3435 #if (TME_FLOAT_FORMAT_IEEE754_SINGLE_BUILTIN == TME_FLOAT_FORMAT_IEEE754_SINGLE)
3436 
3437 /* this does a partial compliance single-precision exp: */
3438 static void
_tme_ieee754_partial_single_exp(struct tme_ieee754_ctl * ieee754_ctl,const struct tme_float * src0,struct tme_float * dst)3439 _tme_ieee754_partial_single_exp(struct tme_ieee754_ctl *ieee754_ctl, const struct tme_float *src0, struct tme_float *dst)
3440 {
3441   int exceptions;
3442 
3443   /* check for a NaN operand: */
3444   if (__tme_predict_false(tme_ieee754_single_check_nan_monadic(ieee754_ctl, src0, dst))) {
3445     return;
3446   }
3447 
3448   /* enter native floating-point operation: */
3449   tme_float_enter(ieee754_ctl->tme_ieee754_ctl_rounding_mode, tme_ieee754_exception_float, ieee754_ctl);
3450   ieee754_ctl->tme_ieee754_ctl_lock_unlock = tme_float_leave;
3451 
3452   /* assume that this operation raises no exceptions: */
3453   exceptions = 0;
3454 
3455   /* the operation: */
3456 #if (TME_FLOAT_FORMAT_IEEE754_SINGLE_BUILTIN == TME_FLOAT_FORMAT_FLOAT)
3457   tme_ieee754_single_value_builtin_set(dst, TME_FLOAT_FORMAT_FLOAT, expf(tme_ieee754_single_value_builtin_get(src0)));
3458 #else  /* (TME_FLOAT_FORMAT_IEEE754_SINGLE_BUILTIN != TME_FLOAT_FORMAT_FLOAT) */
3459   tme_ieee754_single_value_builtin_set(dst, TME_FLOAT_FORMAT_DOUBLE, exp(tme_ieee754_single_value_builtin_get(src0)));
3460 #endif /* (TME_FLOAT_FORMAT_IEEE754_SINGLE_BUILTIN != TME_FLOAT_FORMAT_FLOAT) */
3461 
3462   /* leave native floating-point operation: */
3463   exceptions |= tme_float_leave();
3464   ieee754_ctl->tme_ieee754_ctl_lock_unlock = NULL;
3465 
3466   /* signal any exceptions: */
3467   if (exceptions != 0) {
3468     (*ieee754_ctl->tme_ieee754_ctl_exception)(ieee754_ctl, exceptions);
3469   }
3470 }
3471 
3472 #endif /* (TME_FLOAT_FORMAT_IEEE754_SINGLE_BUILTIN == TME_FLOAT_FORMAT_IEEE754_SINGLE) */
3473 
3474 #if (TME_FLOAT_FORMAT_IEEE754_SINGLE_BUILTIN == TME_FLOAT_FORMAT_IEEE754_SINGLE)
3475 
3476 /* this does a partial compliance single-precision log10: */
3477 static void
_tme_ieee754_partial_single_log10(struct tme_ieee754_ctl * ieee754_ctl,const struct tme_float * src0,struct tme_float * dst)3478 _tme_ieee754_partial_single_log10(struct tme_ieee754_ctl *ieee754_ctl, const struct tme_float *src0, struct tme_float *dst)
3479 {
3480   int exceptions;
3481 
3482   /* check for a NaN operand: */
3483   if (__tme_predict_false(tme_ieee754_single_check_nan_monadic(ieee754_ctl, src0, dst))) {
3484     return;
3485   }
3486 
3487   /* enter native floating-point operation: */
3488   tme_float_enter(ieee754_ctl->tme_ieee754_ctl_rounding_mode, tme_ieee754_exception_float, ieee754_ctl);
3489   ieee754_ctl->tme_ieee754_ctl_lock_unlock = tme_float_leave;
3490 
3491   /* assume that this operation raises no exceptions: */
3492   exceptions = 0;
3493 
3494   /* the operation: */
3495 #if (TME_FLOAT_FORMAT_IEEE754_SINGLE_BUILTIN == TME_FLOAT_FORMAT_FLOAT)
3496   tme_ieee754_single_value_builtin_set(dst, TME_FLOAT_FORMAT_FLOAT, log10f(tme_ieee754_single_value_builtin_get(src0)));
3497 #else  /* (TME_FLOAT_FORMAT_IEEE754_SINGLE_BUILTIN != TME_FLOAT_FORMAT_FLOAT) */
3498   tme_ieee754_single_value_builtin_set(dst, TME_FLOAT_FORMAT_DOUBLE, log10(tme_ieee754_single_value_builtin_get(src0)));
3499 #endif /* (TME_FLOAT_FORMAT_IEEE754_SINGLE_BUILTIN != TME_FLOAT_FORMAT_FLOAT) */
3500 
3501   /* leave native floating-point operation: */
3502   exceptions |= tme_float_leave();
3503   ieee754_ctl->tme_ieee754_ctl_lock_unlock = NULL;
3504 
3505   /* signal any exceptions: */
3506   if (exceptions != 0) {
3507     (*ieee754_ctl->tme_ieee754_ctl_exception)(ieee754_ctl, exceptions);
3508   }
3509 }
3510 
3511 #endif /* (TME_FLOAT_FORMAT_IEEE754_SINGLE_BUILTIN == TME_FLOAT_FORMAT_IEEE754_SINGLE) */
3512 
3513 #if (TME_FLOAT_FORMAT_IEEE754_SINGLE_BUILTIN == TME_FLOAT_FORMAT_IEEE754_SINGLE)
3514 
3515 /* this does a partial compliance single-precision log: */
3516 static void
_tme_ieee754_partial_single_log(struct tme_ieee754_ctl * ieee754_ctl,const struct tme_float * src0,struct tme_float * dst)3517 _tme_ieee754_partial_single_log(struct tme_ieee754_ctl *ieee754_ctl, const struct tme_float *src0, struct tme_float *dst)
3518 {
3519   int exceptions;
3520 
3521   /* check for a NaN operand: */
3522   if (__tme_predict_false(tme_ieee754_single_check_nan_monadic(ieee754_ctl, src0, dst))) {
3523     return;
3524   }
3525 
3526   /* enter native floating-point operation: */
3527   tme_float_enter(ieee754_ctl->tme_ieee754_ctl_rounding_mode, tme_ieee754_exception_float, ieee754_ctl);
3528   ieee754_ctl->tme_ieee754_ctl_lock_unlock = tme_float_leave;
3529 
3530   /* assume that this operation raises no exceptions: */
3531   exceptions = 0;
3532 
3533   /* the operation: */
3534 #if (TME_FLOAT_FORMAT_IEEE754_SINGLE_BUILTIN == TME_FLOAT_FORMAT_FLOAT)
3535   tme_ieee754_single_value_builtin_set(dst, TME_FLOAT_FORMAT_FLOAT, logf(tme_ieee754_single_value_builtin_get(src0)));
3536 #else  /* (TME_FLOAT_FORMAT_IEEE754_SINGLE_BUILTIN != TME_FLOAT_FORMAT_FLOAT) */
3537   tme_ieee754_single_value_builtin_set(dst, TME_FLOAT_FORMAT_DOUBLE, log(tme_ieee754_single_value_builtin_get(src0)));
3538 #endif /* (TME_FLOAT_FORMAT_IEEE754_SINGLE_BUILTIN != TME_FLOAT_FORMAT_FLOAT) */
3539 
3540   /* leave native floating-point operation: */
3541   exceptions |= tme_float_leave();
3542   ieee754_ctl->tme_ieee754_ctl_lock_unlock = NULL;
3543 
3544   /* signal any exceptions: */
3545   if (exceptions != 0) {
3546     (*ieee754_ctl->tme_ieee754_ctl_exception)(ieee754_ctl, exceptions);
3547   }
3548 }
3549 
3550 #endif /* (TME_FLOAT_FORMAT_IEEE754_SINGLE_BUILTIN == TME_FLOAT_FORMAT_IEEE754_SINGLE) */
3551 
3552 #if (TME_FLOAT_FORMAT_IEEE754_SINGLE_BUILTIN == TME_FLOAT_FORMAT_IEEE754_SINGLE)
3553 
3554 /* this does a partial compliance single-precision scale: */
3555 static void
_tme_ieee754_partial_single_scale(struct tme_ieee754_ctl * ieee754_ctl,const struct tme_float * src0,const struct tme_float * src1,struct tme_float * dst)3556 _tme_ieee754_partial_single_scale(struct tme_ieee754_ctl *ieee754_ctl, const struct tme_float *src0, const struct tme_float *src1, struct tme_float *dst)
3557 {
3558   int exceptions;
3559 
3560   /* check for a NaN operand: */
3561   if (__tme_predict_false(tme_ieee754_single_check_nan_dyadic(ieee754_ctl, src0, src1, dst))) {
3562     return;
3563   }
3564 
3565   /* enter native floating-point operation: */
3566   tme_float_enter(ieee754_ctl->tme_ieee754_ctl_rounding_mode, tme_ieee754_exception_float, ieee754_ctl);
3567   ieee754_ctl->tme_ieee754_ctl_lock_unlock = tme_float_leave;
3568 
3569   /* assume that this operation raises no exceptions: */
3570   exceptions = 0;
3571 
3572   /* the operation: */
3573 #if (TME_FLOAT_FORMAT_IEEE754_SINGLE_BUILTIN == TME_FLOAT_FORMAT_FLOAT)
3574   tme_ieee754_single_value_builtin_set(dst, TME_FLOAT_FORMAT_FLOAT, scalbnf(tme_ieee754_single_value_builtin_get(src0), tme_ieee754_single_value_builtin_get(src1)));
3575 #else  /* (TME_FLOAT_FORMAT_IEEE754_SINGLE_BUILTIN != TME_FLOAT_FORMAT_FLOAT) */
3576   tme_ieee754_single_value_builtin_set(dst, TME_FLOAT_FORMAT_DOUBLE, scalbn(tme_ieee754_single_value_builtin_get(src0), tme_ieee754_single_value_builtin_get(src1)));
3577 #endif /* (TME_FLOAT_FORMAT_IEEE754_SINGLE_BUILTIN != TME_FLOAT_FORMAT_FLOAT) */
3578 
3579   /* leave native floating-point operation: */
3580   exceptions |= tme_float_leave();
3581   ieee754_ctl->tme_ieee754_ctl_lock_unlock = NULL;
3582 
3583   /* signal any exceptions: */
3584   if (exceptions != 0) {
3585     (*ieee754_ctl->tme_ieee754_ctl_exception)(ieee754_ctl, exceptions);
3586   }
3587 }
3588 
3589 #endif /* (TME_FLOAT_FORMAT_IEEE754_SINGLE_BUILTIN == TME_FLOAT_FORMAT_IEEE754_SINGLE) */
3590 
3591 #if (TME_FLOAT_FORMAT_IEEE754_SINGLE_BUILTIN == TME_FLOAT_FORMAT_IEEE754_SINGLE)
3592 
3593 /* this does a partial compliance single-precision pow: */
3594 static void
_tme_ieee754_partial_single_pow(struct tme_ieee754_ctl * ieee754_ctl,const struct tme_float * src0,const struct tme_float * src1,struct tme_float * dst)3595 _tme_ieee754_partial_single_pow(struct tme_ieee754_ctl *ieee754_ctl, const struct tme_float *src0, const struct tme_float *src1, struct tme_float *dst)
3596 {
3597   int exceptions;
3598 
3599   /* check for a NaN operand: */
3600   if (__tme_predict_false(tme_ieee754_single_check_nan_dyadic(ieee754_ctl, src0, src1, dst))) {
3601     return;
3602   }
3603 
3604   /* enter native floating-point operation: */
3605   tme_float_enter(ieee754_ctl->tme_ieee754_ctl_rounding_mode, tme_ieee754_exception_float, ieee754_ctl);
3606   ieee754_ctl->tme_ieee754_ctl_lock_unlock = tme_float_leave;
3607 
3608   /* assume that this operation raises no exceptions: */
3609   exceptions = 0;
3610 
3611   /* the operation: */
3612 #if (TME_FLOAT_FORMAT_IEEE754_SINGLE_BUILTIN == TME_FLOAT_FORMAT_FLOAT)
3613   tme_ieee754_single_value_builtin_set(dst, TME_FLOAT_FORMAT_FLOAT, powf(tme_ieee754_single_value_builtin_get(src0), tme_ieee754_single_value_builtin_get(src1)));
3614 #else  /* (TME_FLOAT_FORMAT_IEEE754_SINGLE_BUILTIN != TME_FLOAT_FORMAT_FLOAT) */
3615   tme_ieee754_single_value_builtin_set(dst, TME_FLOAT_FORMAT_DOUBLE, pow(tme_ieee754_single_value_builtin_get(src0), tme_ieee754_single_value_builtin_get(src1)));
3616 #endif /* (TME_FLOAT_FORMAT_IEEE754_SINGLE_BUILTIN != TME_FLOAT_FORMAT_FLOAT) */
3617 
3618   /* leave native floating-point operation: */
3619   exceptions |= tme_float_leave();
3620   ieee754_ctl->tme_ieee754_ctl_lock_unlock = NULL;
3621 
3622   /* signal any exceptions: */
3623   if (exceptions != 0) {
3624     (*ieee754_ctl->tme_ieee754_ctl_exception)(ieee754_ctl, exceptions);
3625   }
3626 }
3627 
3628 #endif /* (TME_FLOAT_FORMAT_IEEE754_SINGLE_BUILTIN == TME_FLOAT_FORMAT_IEEE754_SINGLE) */
3629 
3630 #if (TME_FLOAT_FORMAT_IEEE754_DOUBLE_BUILTIN == TME_FLOAT_FORMAT_IEEE754_DOUBLE)
3631 
3632 /* this does a partial compliance double-precision add: */
3633 static void
_tme_ieee754_partial_double_add(struct tme_ieee754_ctl * ieee754_ctl,const struct tme_float * src0,const struct tme_float * src1,struct tme_float * dst)3634 _tme_ieee754_partial_double_add(struct tme_ieee754_ctl *ieee754_ctl, const struct tme_float *src0, const struct tme_float *src1, struct tme_float *dst)
3635 {
3636   int exceptions;
3637 
3638   /* check for a NaN operand: */
3639   if (__tme_predict_false(tme_ieee754_double_check_nan_dyadic(ieee754_ctl, src0, src1, dst))) {
3640     return;
3641   }
3642 
3643   /* enter native floating-point operation: */
3644   tme_float_enter(ieee754_ctl->tme_ieee754_ctl_rounding_mode, tme_ieee754_exception_float, ieee754_ctl);
3645   ieee754_ctl->tme_ieee754_ctl_lock_unlock = tme_float_leave;
3646 
3647   /* assume that this operation raises no exceptions: */
3648   exceptions = 0;
3649 
3650   /* the operation: */
3651   tme_ieee754_double_value_builtin_set(dst, TME_FLOAT_FORMAT_IEEE754_DOUBLE_BUILTIN, tme_ieee754_double_value_builtin_get(src0) + tme_ieee754_double_value_builtin_get(src1));
3652 
3653   /* leave native floating-point operation: */
3654   exceptions |= tme_float_leave();
3655   ieee754_ctl->tme_ieee754_ctl_lock_unlock = NULL;
3656 
3657   /* signal any exceptions: */
3658   if (exceptions != 0) {
3659     (*ieee754_ctl->tme_ieee754_ctl_exception)(ieee754_ctl, exceptions);
3660   }
3661 }
3662 
3663 #endif /* (TME_FLOAT_FORMAT_IEEE754_DOUBLE_BUILTIN == TME_FLOAT_FORMAT_IEEE754_DOUBLE) */
3664 
3665 #if (TME_FLOAT_FORMAT_IEEE754_DOUBLE_BUILTIN == TME_FLOAT_FORMAT_IEEE754_DOUBLE)
3666 
3667 /* this does a partial compliance double-precision sub: */
3668 static void
_tme_ieee754_partial_double_sub(struct tme_ieee754_ctl * ieee754_ctl,const struct tme_float * src0,const struct tme_float * src1,struct tme_float * dst)3669 _tme_ieee754_partial_double_sub(struct tme_ieee754_ctl *ieee754_ctl, const struct tme_float *src0, const struct tme_float *src1, struct tme_float *dst)
3670 {
3671   int exceptions;
3672 
3673   /* check for a NaN operand: */
3674   if (__tme_predict_false(tme_ieee754_double_check_nan_dyadic(ieee754_ctl, src0, src1, dst))) {
3675     return;
3676   }
3677 
3678   /* enter native floating-point operation: */
3679   tme_float_enter(ieee754_ctl->tme_ieee754_ctl_rounding_mode, tme_ieee754_exception_float, ieee754_ctl);
3680   ieee754_ctl->tme_ieee754_ctl_lock_unlock = tme_float_leave;
3681 
3682   /* assume that this operation raises no exceptions: */
3683   exceptions = 0;
3684 
3685   /* the operation: */
3686   tme_ieee754_double_value_builtin_set(dst, TME_FLOAT_FORMAT_IEEE754_DOUBLE_BUILTIN, tme_ieee754_double_value_builtin_get(src0) - tme_ieee754_double_value_builtin_get(src1));
3687 
3688   /* leave native floating-point operation: */
3689   exceptions |= tme_float_leave();
3690   ieee754_ctl->tme_ieee754_ctl_lock_unlock = NULL;
3691 
3692   /* signal any exceptions: */
3693   if (exceptions != 0) {
3694     (*ieee754_ctl->tme_ieee754_ctl_exception)(ieee754_ctl, exceptions);
3695   }
3696 }
3697 
3698 #endif /* (TME_FLOAT_FORMAT_IEEE754_DOUBLE_BUILTIN == TME_FLOAT_FORMAT_IEEE754_DOUBLE) */
3699 
3700 #if (TME_FLOAT_FORMAT_IEEE754_DOUBLE_BUILTIN == TME_FLOAT_FORMAT_IEEE754_DOUBLE)
3701 
3702 /* this does a partial compliance double-precision mul: */
3703 static void
_tme_ieee754_partial_double_mul(struct tme_ieee754_ctl * ieee754_ctl,const struct tme_float * src0,const struct tme_float * src1,struct tme_float * dst)3704 _tme_ieee754_partial_double_mul(struct tme_ieee754_ctl *ieee754_ctl, const struct tme_float *src0, const struct tme_float *src1, struct tme_float *dst)
3705 {
3706   int exceptions;
3707 
3708   /* check for a NaN operand: */
3709   if (__tme_predict_false(tme_ieee754_double_check_nan_dyadic(ieee754_ctl, src0, src1, dst))) {
3710     return;
3711   }
3712 
3713   /* enter native floating-point operation: */
3714   tme_float_enter(ieee754_ctl->tme_ieee754_ctl_rounding_mode, tme_ieee754_exception_float, ieee754_ctl);
3715   ieee754_ctl->tme_ieee754_ctl_lock_unlock = tme_float_leave;
3716 
3717   /* assume that this operation raises no exceptions: */
3718   exceptions = 0;
3719 
3720   /* the operation: */
3721   tme_ieee754_double_value_builtin_set(dst, TME_FLOAT_FORMAT_IEEE754_DOUBLE_BUILTIN, tme_ieee754_double_value_builtin_get(src0) * tme_ieee754_double_value_builtin_get(src1));
3722 
3723   /* leave native floating-point operation: */
3724   exceptions |= tme_float_leave();
3725   ieee754_ctl->tme_ieee754_ctl_lock_unlock = NULL;
3726 
3727   /* signal any exceptions: */
3728   if (exceptions != 0) {
3729     (*ieee754_ctl->tme_ieee754_ctl_exception)(ieee754_ctl, exceptions);
3730   }
3731 }
3732 
3733 #endif /* (TME_FLOAT_FORMAT_IEEE754_DOUBLE_BUILTIN == TME_FLOAT_FORMAT_IEEE754_DOUBLE) */
3734 
3735 #if (TME_FLOAT_FORMAT_IEEE754_DOUBLE_BUILTIN == TME_FLOAT_FORMAT_IEEE754_DOUBLE)
3736 
3737 /* this does a partial compliance double-precision div: */
3738 static void
_tme_ieee754_partial_double_div(struct tme_ieee754_ctl * ieee754_ctl,const struct tme_float * src0,const struct tme_float * src1,struct tme_float * dst)3739 _tme_ieee754_partial_double_div(struct tme_ieee754_ctl *ieee754_ctl, const struct tme_float *src0, const struct tme_float *src1, struct tme_float *dst)
3740 {
3741   int exceptions;
3742 
3743   /* check for a NaN operand: */
3744   if (__tme_predict_false(tme_ieee754_double_check_nan_dyadic(ieee754_ctl, src0, src1, dst))) {
3745     return;
3746   }
3747 
3748   /* enter native floating-point operation: */
3749   tme_float_enter(ieee754_ctl->tme_ieee754_ctl_rounding_mode, tme_ieee754_exception_float, ieee754_ctl);
3750   ieee754_ctl->tme_ieee754_ctl_lock_unlock = tme_float_leave;
3751 
3752   /* assume that this operation raises no exceptions: */
3753   exceptions = 0;
3754 
3755   /* the operation: */
3756   tme_ieee754_double_value_builtin_set(dst, TME_FLOAT_FORMAT_IEEE754_DOUBLE_BUILTIN, tme_ieee754_double_value_builtin_get(src0) / tme_ieee754_double_value_builtin_get(src1));
3757 
3758   /* leave native floating-point operation: */
3759   exceptions |= tme_float_leave();
3760   ieee754_ctl->tme_ieee754_ctl_lock_unlock = NULL;
3761 
3762   /* signal any exceptions: */
3763   if (exceptions != 0) {
3764     (*ieee754_ctl->tme_ieee754_ctl_exception)(ieee754_ctl, exceptions);
3765   }
3766 }
3767 
3768 #endif /* (TME_FLOAT_FORMAT_IEEE754_DOUBLE_BUILTIN == TME_FLOAT_FORMAT_IEEE754_DOUBLE) */
3769 
3770 #if (TME_FLOAT_FORMAT_IEEE754_DOUBLE_BUILTIN == TME_FLOAT_FORMAT_IEEE754_DOUBLE)
3771 
3772 /* this does a partial compliance double-precision sqrt: */
3773 static void
_tme_ieee754_partial_double_sqrt(struct tme_ieee754_ctl * ieee754_ctl,const struct tme_float * src0,struct tme_float * dst)3774 _tme_ieee754_partial_double_sqrt(struct tme_ieee754_ctl *ieee754_ctl, const struct tme_float *src0, struct tme_float *dst)
3775 {
3776   int exceptions;
3777 
3778   /* check for a NaN operand: */
3779   if (__tme_predict_false(tme_ieee754_double_check_nan_monadic(ieee754_ctl, src0, dst))) {
3780     return;
3781   }
3782 
3783   /* enter native floating-point operation: */
3784   tme_float_enter(ieee754_ctl->tme_ieee754_ctl_rounding_mode, tme_ieee754_exception_float, ieee754_ctl);
3785   ieee754_ctl->tme_ieee754_ctl_lock_unlock = tme_float_leave;
3786 
3787   /* assume that this operation raises no exceptions: */
3788   exceptions = 0;
3789 
3790   /* the operation: */
3791 #if (TME_FLOAT_FORMAT_IEEE754_DOUBLE_BUILTIN == TME_FLOAT_FORMAT_FLOAT)
3792   tme_ieee754_double_value_builtin_set(dst, TME_FLOAT_FORMAT_FLOAT, sqrtf(tme_ieee754_double_value_builtin_get(src0)));
3793 #else  /* (TME_FLOAT_FORMAT_IEEE754_DOUBLE_BUILTIN != TME_FLOAT_FORMAT_FLOAT) */
3794   tme_ieee754_double_value_builtin_set(dst, TME_FLOAT_FORMAT_DOUBLE, sqrt(tme_ieee754_double_value_builtin_get(src0)));
3795 #endif /* (TME_FLOAT_FORMAT_IEEE754_DOUBLE_BUILTIN != TME_FLOAT_FORMAT_FLOAT) */
3796 
3797   /* leave native floating-point operation: */
3798   exceptions |= tme_float_leave();
3799   ieee754_ctl->tme_ieee754_ctl_lock_unlock = NULL;
3800 
3801   /* signal any exceptions: */
3802   if (exceptions != 0) {
3803     (*ieee754_ctl->tme_ieee754_ctl_exception)(ieee754_ctl, exceptions);
3804   }
3805 }
3806 
3807 #endif /* (TME_FLOAT_FORMAT_IEEE754_DOUBLE_BUILTIN == TME_FLOAT_FORMAT_IEEE754_DOUBLE) */
3808 
3809 #if (TME_FLOAT_FORMAT_IEEE754_DOUBLE_BUILTIN == TME_FLOAT_FORMAT_IEEE754_DOUBLE)
3810 
3811 /* this does a partial compliance double-precision abs: */
3812 static void
_tme_ieee754_partial_double_abs(struct tme_ieee754_ctl * ieee754_ctl,const struct tme_float * src0,struct tme_float * dst)3813 _tme_ieee754_partial_double_abs(struct tme_ieee754_ctl *ieee754_ctl, const struct tme_float *src0, struct tme_float *dst)
3814 {
3815   int exceptions;
3816 
3817   /* check for a NaN operand: */
3818   if (__tme_predict_false(tme_ieee754_double_check_nan_monadic(ieee754_ctl, src0, dst))) {
3819     return;
3820   }
3821 
3822   /* enter native floating-point operation: */
3823   tme_float_enter(ieee754_ctl->tme_ieee754_ctl_rounding_mode, tme_ieee754_exception_float, ieee754_ctl);
3824   ieee754_ctl->tme_ieee754_ctl_lock_unlock = tme_float_leave;
3825 
3826   /* assume that this operation raises no exceptions: */
3827   exceptions = 0;
3828 
3829   /* the operation: */
3830 #if (TME_FLOAT_FORMAT_IEEE754_DOUBLE_BUILTIN == TME_FLOAT_FORMAT_FLOAT)
3831   tme_ieee754_double_value_builtin_set(dst, TME_FLOAT_FORMAT_FLOAT, fabsf(tme_ieee754_double_value_builtin_get(src0)));
3832 #else  /* (TME_FLOAT_FORMAT_IEEE754_DOUBLE_BUILTIN != TME_FLOAT_FORMAT_FLOAT) */
3833   tme_ieee754_double_value_builtin_set(dst, TME_FLOAT_FORMAT_DOUBLE, fabs(tme_ieee754_double_value_builtin_get(src0)));
3834 #endif /* (TME_FLOAT_FORMAT_IEEE754_DOUBLE_BUILTIN != TME_FLOAT_FORMAT_FLOAT) */
3835 
3836   /* leave native floating-point operation: */
3837   exceptions |= tme_float_leave();
3838   ieee754_ctl->tme_ieee754_ctl_lock_unlock = NULL;
3839 
3840   /* signal any exceptions: */
3841   if (exceptions != 0) {
3842     (*ieee754_ctl->tme_ieee754_ctl_exception)(ieee754_ctl, exceptions);
3843   }
3844 }
3845 
3846 #endif /* (TME_FLOAT_FORMAT_IEEE754_DOUBLE_BUILTIN == TME_FLOAT_FORMAT_IEEE754_DOUBLE) */
3847 
3848 #if (TME_FLOAT_FORMAT_IEEE754_DOUBLE_BUILTIN == TME_FLOAT_FORMAT_IEEE754_DOUBLE)
3849 
3850 /* this does a partial compliance double-precision neg: */
3851 static void
_tme_ieee754_partial_double_neg(struct tme_ieee754_ctl * ieee754_ctl,const struct tme_float * src0,struct tme_float * dst)3852 _tme_ieee754_partial_double_neg(struct tme_ieee754_ctl *ieee754_ctl, const struct tme_float *src0, struct tme_float *dst)
3853 {
3854   int exceptions;
3855 
3856   /* check for a NaN operand: */
3857   if (__tme_predict_false(tme_ieee754_double_check_nan_monadic(ieee754_ctl, src0, dst))) {
3858     return;
3859   }
3860 
3861   /* enter native floating-point operation: */
3862   tme_float_enter(ieee754_ctl->tme_ieee754_ctl_rounding_mode, tme_ieee754_exception_float, ieee754_ctl);
3863   ieee754_ctl->tme_ieee754_ctl_lock_unlock = tme_float_leave;
3864 
3865   /* assume that this operation raises no exceptions: */
3866   exceptions = 0;
3867 
3868   /* the operation: */
3869   tme_ieee754_double_value_builtin_set(dst, TME_FLOAT_FORMAT_IEEE754_DOUBLE_BUILTIN, -1 * tme_ieee754_double_value_builtin_get(src0));
3870 
3871   /* leave native floating-point operation: */
3872   exceptions |= tme_float_leave();
3873   ieee754_ctl->tme_ieee754_ctl_lock_unlock = NULL;
3874 
3875   /* signal any exceptions: */
3876   if (exceptions != 0) {
3877     (*ieee754_ctl->tme_ieee754_ctl_exception)(ieee754_ctl, exceptions);
3878   }
3879 }
3880 
3881 #endif /* (TME_FLOAT_FORMAT_IEEE754_DOUBLE_BUILTIN == TME_FLOAT_FORMAT_IEEE754_DOUBLE) */
3882 
3883 #if (TME_FLOAT_FORMAT_IEEE754_DOUBLE_BUILTIN == TME_FLOAT_FORMAT_IEEE754_DOUBLE)
3884 
3885 /* this does a partial compliance double-precision move: */
3886 static void
_tme_ieee754_partial_double_move(struct tme_ieee754_ctl * ieee754_ctl,const struct tme_float * src0,struct tme_float * dst)3887 _tme_ieee754_partial_double_move(struct tme_ieee754_ctl *ieee754_ctl, const struct tme_float *src0, struct tme_float *dst)
3888 {
3889   int exceptions;
3890 
3891   /* check for a NaN operand: */
3892   if (__tme_predict_false(tme_ieee754_double_check_nan_monadic(ieee754_ctl, src0, dst))) {
3893     return;
3894   }
3895 
3896   /* enter native floating-point operation: */
3897   tme_float_enter(ieee754_ctl->tme_ieee754_ctl_rounding_mode, tme_ieee754_exception_float, ieee754_ctl);
3898   ieee754_ctl->tme_ieee754_ctl_lock_unlock = tme_float_leave;
3899 
3900   /* assume that this operation raises no exceptions: */
3901   exceptions = 0;
3902 
3903   /* the operation: */
3904   *dst = *src0;
3905 
3906   /* leave native floating-point operation: */
3907   exceptions |= tme_float_leave();
3908   ieee754_ctl->tme_ieee754_ctl_lock_unlock = NULL;
3909 
3910   /* signal any exceptions: */
3911   if (exceptions != 0) {
3912     (*ieee754_ctl->tme_ieee754_ctl_exception)(ieee754_ctl, exceptions);
3913   }
3914 }
3915 
3916 #endif /* (TME_FLOAT_FORMAT_IEEE754_DOUBLE_BUILTIN == TME_FLOAT_FORMAT_IEEE754_DOUBLE) */
3917 
3918 #if (TME_FLOAT_FORMAT_IEEE754_DOUBLE_BUILTIN == TME_FLOAT_FORMAT_IEEE754_DOUBLE)
3919 
3920 /* this does a partial compliance double-precision exp: */
3921 static void
_tme_ieee754_partial_double_exp(struct tme_ieee754_ctl * ieee754_ctl,const struct tme_float * src0,struct tme_float * dst)3922 _tme_ieee754_partial_double_exp(struct tme_ieee754_ctl *ieee754_ctl, const struct tme_float *src0, struct tme_float *dst)
3923 {
3924   int exceptions;
3925 
3926   /* check for a NaN operand: */
3927   if (__tme_predict_false(tme_ieee754_double_check_nan_monadic(ieee754_ctl, src0, dst))) {
3928     return;
3929   }
3930 
3931   /* enter native floating-point operation: */
3932   tme_float_enter(ieee754_ctl->tme_ieee754_ctl_rounding_mode, tme_ieee754_exception_float, ieee754_ctl);
3933   ieee754_ctl->tme_ieee754_ctl_lock_unlock = tme_float_leave;
3934 
3935   /* assume that this operation raises no exceptions: */
3936   exceptions = 0;
3937 
3938   /* the operation: */
3939 #if (TME_FLOAT_FORMAT_IEEE754_DOUBLE_BUILTIN == TME_FLOAT_FORMAT_FLOAT)
3940   tme_ieee754_double_value_builtin_set(dst, TME_FLOAT_FORMAT_FLOAT, expf(tme_ieee754_double_value_builtin_get(src0)));
3941 #else  /* (TME_FLOAT_FORMAT_IEEE754_DOUBLE_BUILTIN != TME_FLOAT_FORMAT_FLOAT) */
3942   tme_ieee754_double_value_builtin_set(dst, TME_FLOAT_FORMAT_DOUBLE, exp(tme_ieee754_double_value_builtin_get(src0)));
3943 #endif /* (TME_FLOAT_FORMAT_IEEE754_DOUBLE_BUILTIN != TME_FLOAT_FORMAT_FLOAT) */
3944 
3945   /* leave native floating-point operation: */
3946   exceptions |= tme_float_leave();
3947   ieee754_ctl->tme_ieee754_ctl_lock_unlock = NULL;
3948 
3949   /* signal any exceptions: */
3950   if (exceptions != 0) {
3951     (*ieee754_ctl->tme_ieee754_ctl_exception)(ieee754_ctl, exceptions);
3952   }
3953 }
3954 
3955 #endif /* (TME_FLOAT_FORMAT_IEEE754_DOUBLE_BUILTIN == TME_FLOAT_FORMAT_IEEE754_DOUBLE) */
3956 
3957 #if (TME_FLOAT_FORMAT_IEEE754_DOUBLE_BUILTIN == TME_FLOAT_FORMAT_IEEE754_DOUBLE)
3958 
3959 /* this does a partial compliance double-precision log10: */
3960 static void
_tme_ieee754_partial_double_log10(struct tme_ieee754_ctl * ieee754_ctl,const struct tme_float * src0,struct tme_float * dst)3961 _tme_ieee754_partial_double_log10(struct tme_ieee754_ctl *ieee754_ctl, const struct tme_float *src0, struct tme_float *dst)
3962 {
3963   int exceptions;
3964 
3965   /* check for a NaN operand: */
3966   if (__tme_predict_false(tme_ieee754_double_check_nan_monadic(ieee754_ctl, src0, dst))) {
3967     return;
3968   }
3969 
3970   /* enter native floating-point operation: */
3971   tme_float_enter(ieee754_ctl->tme_ieee754_ctl_rounding_mode, tme_ieee754_exception_float, ieee754_ctl);
3972   ieee754_ctl->tme_ieee754_ctl_lock_unlock = tme_float_leave;
3973 
3974   /* assume that this operation raises no exceptions: */
3975   exceptions = 0;
3976 
3977   /* the operation: */
3978 #if (TME_FLOAT_FORMAT_IEEE754_DOUBLE_BUILTIN == TME_FLOAT_FORMAT_FLOAT)
3979   tme_ieee754_double_value_builtin_set(dst, TME_FLOAT_FORMAT_FLOAT, log10f(tme_ieee754_double_value_builtin_get(src0)));
3980 #else  /* (TME_FLOAT_FORMAT_IEEE754_DOUBLE_BUILTIN != TME_FLOAT_FORMAT_FLOAT) */
3981   tme_ieee754_double_value_builtin_set(dst, TME_FLOAT_FORMAT_DOUBLE, log10(tme_ieee754_double_value_builtin_get(src0)));
3982 #endif /* (TME_FLOAT_FORMAT_IEEE754_DOUBLE_BUILTIN != TME_FLOAT_FORMAT_FLOAT) */
3983 
3984   /* leave native floating-point operation: */
3985   exceptions |= tme_float_leave();
3986   ieee754_ctl->tme_ieee754_ctl_lock_unlock = NULL;
3987 
3988   /* signal any exceptions: */
3989   if (exceptions != 0) {
3990     (*ieee754_ctl->tme_ieee754_ctl_exception)(ieee754_ctl, exceptions);
3991   }
3992 }
3993 
3994 #endif /* (TME_FLOAT_FORMAT_IEEE754_DOUBLE_BUILTIN == TME_FLOAT_FORMAT_IEEE754_DOUBLE) */
3995 
3996 #if (TME_FLOAT_FORMAT_IEEE754_DOUBLE_BUILTIN == TME_FLOAT_FORMAT_IEEE754_DOUBLE)
3997 
3998 /* this does a partial compliance double-precision log: */
3999 static void
_tme_ieee754_partial_double_log(struct tme_ieee754_ctl * ieee754_ctl,const struct tme_float * src0,struct tme_float * dst)4000 _tme_ieee754_partial_double_log(struct tme_ieee754_ctl *ieee754_ctl, const struct tme_float *src0, struct tme_float *dst)
4001 {
4002   int exceptions;
4003 
4004   /* check for a NaN operand: */
4005   if (__tme_predict_false(tme_ieee754_double_check_nan_monadic(ieee754_ctl, src0, dst))) {
4006     return;
4007   }
4008 
4009   /* enter native floating-point operation: */
4010   tme_float_enter(ieee754_ctl->tme_ieee754_ctl_rounding_mode, tme_ieee754_exception_float, ieee754_ctl);
4011   ieee754_ctl->tme_ieee754_ctl_lock_unlock = tme_float_leave;
4012 
4013   /* assume that this operation raises no exceptions: */
4014   exceptions = 0;
4015 
4016   /* the operation: */
4017 #if (TME_FLOAT_FORMAT_IEEE754_DOUBLE_BUILTIN == TME_FLOAT_FORMAT_FLOAT)
4018   tme_ieee754_double_value_builtin_set(dst, TME_FLOAT_FORMAT_FLOAT, logf(tme_ieee754_double_value_builtin_get(src0)));
4019 #else  /* (TME_FLOAT_FORMAT_IEEE754_DOUBLE_BUILTIN != TME_FLOAT_FORMAT_FLOAT) */
4020   tme_ieee754_double_value_builtin_set(dst, TME_FLOAT_FORMAT_DOUBLE, log(tme_ieee754_double_value_builtin_get(src0)));
4021 #endif /* (TME_FLOAT_FORMAT_IEEE754_DOUBLE_BUILTIN != TME_FLOAT_FORMAT_FLOAT) */
4022 
4023   /* leave native floating-point operation: */
4024   exceptions |= tme_float_leave();
4025   ieee754_ctl->tme_ieee754_ctl_lock_unlock = NULL;
4026 
4027   /* signal any exceptions: */
4028   if (exceptions != 0) {
4029     (*ieee754_ctl->tme_ieee754_ctl_exception)(ieee754_ctl, exceptions);
4030   }
4031 }
4032 
4033 #endif /* (TME_FLOAT_FORMAT_IEEE754_DOUBLE_BUILTIN == TME_FLOAT_FORMAT_IEEE754_DOUBLE) */
4034 
4035 #if (TME_FLOAT_FORMAT_IEEE754_DOUBLE_BUILTIN == TME_FLOAT_FORMAT_IEEE754_DOUBLE)
4036 
4037 /* this does a partial compliance double-precision scale: */
4038 static void
_tme_ieee754_partial_double_scale(struct tme_ieee754_ctl * ieee754_ctl,const struct tme_float * src0,const struct tme_float * src1,struct tme_float * dst)4039 _tme_ieee754_partial_double_scale(struct tme_ieee754_ctl *ieee754_ctl, const struct tme_float *src0, const struct tme_float *src1, struct tme_float *dst)
4040 {
4041   int exceptions;
4042 
4043   /* check for a NaN operand: */
4044   if (__tme_predict_false(tme_ieee754_double_check_nan_dyadic(ieee754_ctl, src0, src1, dst))) {
4045     return;
4046   }
4047 
4048   /* enter native floating-point operation: */
4049   tme_float_enter(ieee754_ctl->tme_ieee754_ctl_rounding_mode, tme_ieee754_exception_float, ieee754_ctl);
4050   ieee754_ctl->tme_ieee754_ctl_lock_unlock = tme_float_leave;
4051 
4052   /* assume that this operation raises no exceptions: */
4053   exceptions = 0;
4054 
4055   /* the operation: */
4056 #if (TME_FLOAT_FORMAT_IEEE754_DOUBLE_BUILTIN == TME_FLOAT_FORMAT_FLOAT)
4057   tme_ieee754_double_value_builtin_set(dst, TME_FLOAT_FORMAT_FLOAT, scalbnf(tme_ieee754_double_value_builtin_get(src0), tme_ieee754_double_value_builtin_get(src1)));
4058 #else  /* (TME_FLOAT_FORMAT_IEEE754_DOUBLE_BUILTIN != TME_FLOAT_FORMAT_FLOAT) */
4059   tme_ieee754_double_value_builtin_set(dst, TME_FLOAT_FORMAT_DOUBLE, scalbn(tme_ieee754_double_value_builtin_get(src0), tme_ieee754_double_value_builtin_get(src1)));
4060 #endif /* (TME_FLOAT_FORMAT_IEEE754_DOUBLE_BUILTIN != TME_FLOAT_FORMAT_FLOAT) */
4061 
4062   /* leave native floating-point operation: */
4063   exceptions |= tme_float_leave();
4064   ieee754_ctl->tme_ieee754_ctl_lock_unlock = NULL;
4065 
4066   /* signal any exceptions: */
4067   if (exceptions != 0) {
4068     (*ieee754_ctl->tme_ieee754_ctl_exception)(ieee754_ctl, exceptions);
4069   }
4070 }
4071 
4072 #endif /* (TME_FLOAT_FORMAT_IEEE754_DOUBLE_BUILTIN == TME_FLOAT_FORMAT_IEEE754_DOUBLE) */
4073 
4074 #if (TME_FLOAT_FORMAT_IEEE754_DOUBLE_BUILTIN == TME_FLOAT_FORMAT_IEEE754_DOUBLE)
4075 
4076 /* this does a partial compliance double-precision pow: */
4077 static void
_tme_ieee754_partial_double_pow(struct tme_ieee754_ctl * ieee754_ctl,const struct tme_float * src0,const struct tme_float * src1,struct tme_float * dst)4078 _tme_ieee754_partial_double_pow(struct tme_ieee754_ctl *ieee754_ctl, const struct tme_float *src0, const struct tme_float *src1, struct tme_float *dst)
4079 {
4080   int exceptions;
4081 
4082   /* check for a NaN operand: */
4083   if (__tme_predict_false(tme_ieee754_double_check_nan_dyadic(ieee754_ctl, src0, src1, dst))) {
4084     return;
4085   }
4086 
4087   /* enter native floating-point operation: */
4088   tme_float_enter(ieee754_ctl->tme_ieee754_ctl_rounding_mode, tme_ieee754_exception_float, ieee754_ctl);
4089   ieee754_ctl->tme_ieee754_ctl_lock_unlock = tme_float_leave;
4090 
4091   /* assume that this operation raises no exceptions: */
4092   exceptions = 0;
4093 
4094   /* the operation: */
4095 #if (TME_FLOAT_FORMAT_IEEE754_DOUBLE_BUILTIN == TME_FLOAT_FORMAT_FLOAT)
4096   tme_ieee754_double_value_builtin_set(dst, TME_FLOAT_FORMAT_FLOAT, powf(tme_ieee754_double_value_builtin_get(src0), tme_ieee754_double_value_builtin_get(src1)));
4097 #else  /* (TME_FLOAT_FORMAT_IEEE754_DOUBLE_BUILTIN != TME_FLOAT_FORMAT_FLOAT) */
4098   tme_ieee754_double_value_builtin_set(dst, TME_FLOAT_FORMAT_DOUBLE, pow(tme_ieee754_double_value_builtin_get(src0), tme_ieee754_double_value_builtin_get(src1)));
4099 #endif /* (TME_FLOAT_FORMAT_IEEE754_DOUBLE_BUILTIN != TME_FLOAT_FORMAT_FLOAT) */
4100 
4101   /* leave native floating-point operation: */
4102   exceptions |= tme_float_leave();
4103   ieee754_ctl->tme_ieee754_ctl_lock_unlock = NULL;
4104 
4105   /* signal any exceptions: */
4106   if (exceptions != 0) {
4107     (*ieee754_ctl->tme_ieee754_ctl_exception)(ieee754_ctl, exceptions);
4108   }
4109 }
4110 
4111 #endif /* (TME_FLOAT_FORMAT_IEEE754_DOUBLE_BUILTIN == TME_FLOAT_FORMAT_IEEE754_DOUBLE) */
4112 
4113 #if (TME_FLOAT_FORMAT_IEEE754_EXTENDED80_BUILTIN == TME_FLOAT_FORMAT_IEEE754_EXTENDED80)
4114 
4115 /* this does a partial compliance extended80-precision add: */
4116 static void
_tme_ieee754_partial_extended80_add(struct tme_ieee754_ctl * ieee754_ctl,const struct tme_float * src0,const struct tme_float * src1,struct tme_float * dst)4117 _tme_ieee754_partial_extended80_add(struct tme_ieee754_ctl *ieee754_ctl, const struct tme_float *src0, const struct tme_float *src1, struct tme_float *dst)
4118 {
4119   int exceptions;
4120 
4121   /* check for a NaN operand: */
4122   if (__tme_predict_false(tme_ieee754_extended80_check_nan_dyadic(ieee754_ctl, src0, src1, dst))) {
4123     return;
4124   }
4125 
4126   /* enter native floating-point operation: */
4127   tme_float_enter(ieee754_ctl->tme_ieee754_ctl_rounding_mode, tme_ieee754_exception_float, ieee754_ctl);
4128   ieee754_ctl->tme_ieee754_ctl_lock_unlock = tme_float_leave;
4129 
4130   /* assume that this operation raises no exceptions: */
4131   exceptions = 0;
4132 
4133   /* the operation: */
4134   tme_ieee754_extended80_value_builtin_set(dst, TME_FLOAT_FORMAT_IEEE754_EXTENDED80_BUILTIN, tme_ieee754_extended80_value_builtin_get(src0) + tme_ieee754_extended80_value_builtin_get(src1));
4135 
4136   /* leave native floating-point operation: */
4137   exceptions |= tme_float_leave();
4138   ieee754_ctl->tme_ieee754_ctl_lock_unlock = NULL;
4139 
4140   /* signal any exceptions: */
4141   if (exceptions != 0) {
4142     (*ieee754_ctl->tme_ieee754_ctl_exception)(ieee754_ctl, exceptions);
4143   }
4144 }
4145 
4146 #endif /* (TME_FLOAT_FORMAT_IEEE754_EXTENDED80_BUILTIN == TME_FLOAT_FORMAT_IEEE754_EXTENDED80) */
4147 
4148 #if (TME_FLOAT_FORMAT_IEEE754_EXTENDED80_BUILTIN == TME_FLOAT_FORMAT_IEEE754_EXTENDED80)
4149 
4150 /* this does a partial compliance extended80-precision sub: */
4151 static void
_tme_ieee754_partial_extended80_sub(struct tme_ieee754_ctl * ieee754_ctl,const struct tme_float * src0,const struct tme_float * src1,struct tme_float * dst)4152 _tme_ieee754_partial_extended80_sub(struct tme_ieee754_ctl *ieee754_ctl, const struct tme_float *src0, const struct tme_float *src1, struct tme_float *dst)
4153 {
4154   int exceptions;
4155 
4156   /* check for a NaN operand: */
4157   if (__tme_predict_false(tme_ieee754_extended80_check_nan_dyadic(ieee754_ctl, src0, src1, dst))) {
4158     return;
4159   }
4160 
4161   /* enter native floating-point operation: */
4162   tme_float_enter(ieee754_ctl->tme_ieee754_ctl_rounding_mode, tme_ieee754_exception_float, ieee754_ctl);
4163   ieee754_ctl->tme_ieee754_ctl_lock_unlock = tme_float_leave;
4164 
4165   /* assume that this operation raises no exceptions: */
4166   exceptions = 0;
4167 
4168   /* the operation: */
4169   tme_ieee754_extended80_value_builtin_set(dst, TME_FLOAT_FORMAT_IEEE754_EXTENDED80_BUILTIN, tme_ieee754_extended80_value_builtin_get(src0) - tme_ieee754_extended80_value_builtin_get(src1));
4170 
4171   /* leave native floating-point operation: */
4172   exceptions |= tme_float_leave();
4173   ieee754_ctl->tme_ieee754_ctl_lock_unlock = NULL;
4174 
4175   /* signal any exceptions: */
4176   if (exceptions != 0) {
4177     (*ieee754_ctl->tme_ieee754_ctl_exception)(ieee754_ctl, exceptions);
4178   }
4179 }
4180 
4181 #endif /* (TME_FLOAT_FORMAT_IEEE754_EXTENDED80_BUILTIN == TME_FLOAT_FORMAT_IEEE754_EXTENDED80) */
4182 
4183 #if (TME_FLOAT_FORMAT_IEEE754_EXTENDED80_BUILTIN == TME_FLOAT_FORMAT_IEEE754_EXTENDED80)
4184 
4185 /* this does a partial compliance extended80-precision mul: */
4186 static void
_tme_ieee754_partial_extended80_mul(struct tme_ieee754_ctl * ieee754_ctl,const struct tme_float * src0,const struct tme_float * src1,struct tme_float * dst)4187 _tme_ieee754_partial_extended80_mul(struct tme_ieee754_ctl *ieee754_ctl, const struct tme_float *src0, const struct tme_float *src1, struct tme_float *dst)
4188 {
4189   int exceptions;
4190 
4191   /* check for a NaN operand: */
4192   if (__tme_predict_false(tme_ieee754_extended80_check_nan_dyadic(ieee754_ctl, src0, src1, dst))) {
4193     return;
4194   }
4195 
4196   /* enter native floating-point operation: */
4197   tme_float_enter(ieee754_ctl->tme_ieee754_ctl_rounding_mode, tme_ieee754_exception_float, ieee754_ctl);
4198   ieee754_ctl->tme_ieee754_ctl_lock_unlock = tme_float_leave;
4199 
4200   /* assume that this operation raises no exceptions: */
4201   exceptions = 0;
4202 
4203   /* the operation: */
4204   tme_ieee754_extended80_value_builtin_set(dst, TME_FLOAT_FORMAT_IEEE754_EXTENDED80_BUILTIN, tme_ieee754_extended80_value_builtin_get(src0) * tme_ieee754_extended80_value_builtin_get(src1));
4205 
4206   /* leave native floating-point operation: */
4207   exceptions |= tme_float_leave();
4208   ieee754_ctl->tme_ieee754_ctl_lock_unlock = NULL;
4209 
4210   /* signal any exceptions: */
4211   if (exceptions != 0) {
4212     (*ieee754_ctl->tme_ieee754_ctl_exception)(ieee754_ctl, exceptions);
4213   }
4214 }
4215 
4216 #endif /* (TME_FLOAT_FORMAT_IEEE754_EXTENDED80_BUILTIN == TME_FLOAT_FORMAT_IEEE754_EXTENDED80) */
4217 
4218 #if (TME_FLOAT_FORMAT_IEEE754_EXTENDED80_BUILTIN == TME_FLOAT_FORMAT_IEEE754_EXTENDED80)
4219 
4220 /* this does a partial compliance extended80-precision div: */
4221 static void
_tme_ieee754_partial_extended80_div(struct tme_ieee754_ctl * ieee754_ctl,const struct tme_float * src0,const struct tme_float * src1,struct tme_float * dst)4222 _tme_ieee754_partial_extended80_div(struct tme_ieee754_ctl *ieee754_ctl, const struct tme_float *src0, const struct tme_float *src1, struct tme_float *dst)
4223 {
4224   int exceptions;
4225 
4226   /* check for a NaN operand: */
4227   if (__tme_predict_false(tme_ieee754_extended80_check_nan_dyadic(ieee754_ctl, src0, src1, dst))) {
4228     return;
4229   }
4230 
4231   /* enter native floating-point operation: */
4232   tme_float_enter(ieee754_ctl->tme_ieee754_ctl_rounding_mode, tme_ieee754_exception_float, ieee754_ctl);
4233   ieee754_ctl->tme_ieee754_ctl_lock_unlock = tme_float_leave;
4234 
4235   /* assume that this operation raises no exceptions: */
4236   exceptions = 0;
4237 
4238   /* the operation: */
4239   tme_ieee754_extended80_value_builtin_set(dst, TME_FLOAT_FORMAT_IEEE754_EXTENDED80_BUILTIN, tme_ieee754_extended80_value_builtin_get(src0) / tme_ieee754_extended80_value_builtin_get(src1));
4240 
4241   /* leave native floating-point operation: */
4242   exceptions |= tme_float_leave();
4243   ieee754_ctl->tme_ieee754_ctl_lock_unlock = NULL;
4244 
4245   /* signal any exceptions: */
4246   if (exceptions != 0) {
4247     (*ieee754_ctl->tme_ieee754_ctl_exception)(ieee754_ctl, exceptions);
4248   }
4249 }
4250 
4251 #endif /* (TME_FLOAT_FORMAT_IEEE754_EXTENDED80_BUILTIN == TME_FLOAT_FORMAT_IEEE754_EXTENDED80) */
4252 
4253 #if (TME_FLOAT_FORMAT_IEEE754_EXTENDED80_BUILTIN == TME_FLOAT_FORMAT_IEEE754_EXTENDED80)
4254 
4255 /* this does a partial compliance extended80-precision sqrt: */
4256 static void
_tme_ieee754_partial_extended80_sqrt(struct tme_ieee754_ctl * ieee754_ctl,const struct tme_float * src0,struct tme_float * dst)4257 _tme_ieee754_partial_extended80_sqrt(struct tme_ieee754_ctl *ieee754_ctl, const struct tme_float *src0, struct tme_float *dst)
4258 {
4259   int exceptions;
4260 
4261   /* check for a NaN operand: */
4262   if (__tme_predict_false(tme_ieee754_extended80_check_nan_monadic(ieee754_ctl, src0, dst))) {
4263     return;
4264   }
4265 
4266   /* enter native floating-point operation: */
4267   tme_float_enter(ieee754_ctl->tme_ieee754_ctl_rounding_mode, tme_ieee754_exception_float, ieee754_ctl);
4268   ieee754_ctl->tme_ieee754_ctl_lock_unlock = tme_float_leave;
4269 
4270   /* assume that this operation raises no exceptions: */
4271   exceptions = 0;
4272 
4273   /* the operation: */
4274 #if (TME_FLOAT_FORMAT_IEEE754_EXTENDED80_BUILTIN == TME_FLOAT_FORMAT_FLOAT)
4275   tme_ieee754_extended80_value_builtin_set(dst, TME_FLOAT_FORMAT_FLOAT, sqrtf(tme_ieee754_extended80_value_builtin_get(src0)));
4276 #else  /* (TME_FLOAT_FORMAT_IEEE754_EXTENDED80_BUILTIN != TME_FLOAT_FORMAT_FLOAT) */
4277   tme_ieee754_extended80_value_builtin_set(dst, TME_FLOAT_FORMAT_DOUBLE, sqrt(tme_ieee754_extended80_value_builtin_get(src0)));
4278 #endif /* (TME_FLOAT_FORMAT_IEEE754_EXTENDED80_BUILTIN != TME_FLOAT_FORMAT_FLOAT) */
4279 
4280   /* leave native floating-point operation: */
4281   exceptions |= tme_float_leave();
4282   ieee754_ctl->tme_ieee754_ctl_lock_unlock = NULL;
4283 
4284   /* signal any exceptions: */
4285   if (exceptions != 0) {
4286     (*ieee754_ctl->tme_ieee754_ctl_exception)(ieee754_ctl, exceptions);
4287   }
4288 }
4289 
4290 #endif /* (TME_FLOAT_FORMAT_IEEE754_EXTENDED80_BUILTIN == TME_FLOAT_FORMAT_IEEE754_EXTENDED80) */
4291 
4292 #if (TME_FLOAT_FORMAT_IEEE754_EXTENDED80_BUILTIN == TME_FLOAT_FORMAT_IEEE754_EXTENDED80)
4293 
4294 /* this does a partial compliance extended80-precision abs: */
4295 static void
_tme_ieee754_partial_extended80_abs(struct tme_ieee754_ctl * ieee754_ctl,const struct tme_float * src0,struct tme_float * dst)4296 _tme_ieee754_partial_extended80_abs(struct tme_ieee754_ctl *ieee754_ctl, const struct tme_float *src0, struct tme_float *dst)
4297 {
4298   int exceptions;
4299 
4300   /* check for a NaN operand: */
4301   if (__tme_predict_false(tme_ieee754_extended80_check_nan_monadic(ieee754_ctl, src0, dst))) {
4302     return;
4303   }
4304 
4305   /* enter native floating-point operation: */
4306   tme_float_enter(ieee754_ctl->tme_ieee754_ctl_rounding_mode, tme_ieee754_exception_float, ieee754_ctl);
4307   ieee754_ctl->tme_ieee754_ctl_lock_unlock = tme_float_leave;
4308 
4309   /* assume that this operation raises no exceptions: */
4310   exceptions = 0;
4311 
4312   /* the operation: */
4313 #if (TME_FLOAT_FORMAT_IEEE754_EXTENDED80_BUILTIN == TME_FLOAT_FORMAT_FLOAT)
4314   tme_ieee754_extended80_value_builtin_set(dst, TME_FLOAT_FORMAT_FLOAT, fabsf(tme_ieee754_extended80_value_builtin_get(src0)));
4315 #else  /* (TME_FLOAT_FORMAT_IEEE754_EXTENDED80_BUILTIN != TME_FLOAT_FORMAT_FLOAT) */
4316   tme_ieee754_extended80_value_builtin_set(dst, TME_FLOAT_FORMAT_DOUBLE, fabs(tme_ieee754_extended80_value_builtin_get(src0)));
4317 #endif /* (TME_FLOAT_FORMAT_IEEE754_EXTENDED80_BUILTIN != TME_FLOAT_FORMAT_FLOAT) */
4318 
4319   /* leave native floating-point operation: */
4320   exceptions |= tme_float_leave();
4321   ieee754_ctl->tme_ieee754_ctl_lock_unlock = NULL;
4322 
4323   /* signal any exceptions: */
4324   if (exceptions != 0) {
4325     (*ieee754_ctl->tme_ieee754_ctl_exception)(ieee754_ctl, exceptions);
4326   }
4327 }
4328 
4329 #endif /* (TME_FLOAT_FORMAT_IEEE754_EXTENDED80_BUILTIN == TME_FLOAT_FORMAT_IEEE754_EXTENDED80) */
4330 
4331 #if (TME_FLOAT_FORMAT_IEEE754_EXTENDED80_BUILTIN == TME_FLOAT_FORMAT_IEEE754_EXTENDED80)
4332 
4333 /* this does a partial compliance extended80-precision neg: */
4334 static void
_tme_ieee754_partial_extended80_neg(struct tme_ieee754_ctl * ieee754_ctl,const struct tme_float * src0,struct tme_float * dst)4335 _tme_ieee754_partial_extended80_neg(struct tme_ieee754_ctl *ieee754_ctl, const struct tme_float *src0, struct tme_float *dst)
4336 {
4337   int exceptions;
4338 
4339   /* check for a NaN operand: */
4340   if (__tme_predict_false(tme_ieee754_extended80_check_nan_monadic(ieee754_ctl, src0, dst))) {
4341     return;
4342   }
4343 
4344   /* enter native floating-point operation: */
4345   tme_float_enter(ieee754_ctl->tme_ieee754_ctl_rounding_mode, tme_ieee754_exception_float, ieee754_ctl);
4346   ieee754_ctl->tme_ieee754_ctl_lock_unlock = tme_float_leave;
4347 
4348   /* assume that this operation raises no exceptions: */
4349   exceptions = 0;
4350 
4351   /* the operation: */
4352   tme_ieee754_extended80_value_builtin_set(dst, TME_FLOAT_FORMAT_IEEE754_EXTENDED80_BUILTIN, -1 * tme_ieee754_extended80_value_builtin_get(src0));
4353 
4354   /* leave native floating-point operation: */
4355   exceptions |= tme_float_leave();
4356   ieee754_ctl->tme_ieee754_ctl_lock_unlock = NULL;
4357 
4358   /* signal any exceptions: */
4359   if (exceptions != 0) {
4360     (*ieee754_ctl->tme_ieee754_ctl_exception)(ieee754_ctl, exceptions);
4361   }
4362 }
4363 
4364 #endif /* (TME_FLOAT_FORMAT_IEEE754_EXTENDED80_BUILTIN == TME_FLOAT_FORMAT_IEEE754_EXTENDED80) */
4365 
4366 #if (TME_FLOAT_FORMAT_IEEE754_EXTENDED80_BUILTIN == TME_FLOAT_FORMAT_IEEE754_EXTENDED80)
4367 
4368 /* this does a partial compliance extended80-precision move: */
4369 static void
_tme_ieee754_partial_extended80_move(struct tme_ieee754_ctl * ieee754_ctl,const struct tme_float * src0,struct tme_float * dst)4370 _tme_ieee754_partial_extended80_move(struct tme_ieee754_ctl *ieee754_ctl, const struct tme_float *src0, struct tme_float *dst)
4371 {
4372   int exceptions;
4373 
4374   /* check for a NaN operand: */
4375   if (__tme_predict_false(tme_ieee754_extended80_check_nan_monadic(ieee754_ctl, src0, dst))) {
4376     return;
4377   }
4378 
4379   /* enter native floating-point operation: */
4380   tme_float_enter(ieee754_ctl->tme_ieee754_ctl_rounding_mode, tme_ieee754_exception_float, ieee754_ctl);
4381   ieee754_ctl->tme_ieee754_ctl_lock_unlock = tme_float_leave;
4382 
4383   /* assume that this operation raises no exceptions: */
4384   exceptions = 0;
4385 
4386   /* the operation: */
4387   *dst = *src0;
4388 
4389   /* leave native floating-point operation: */
4390   exceptions |= tme_float_leave();
4391   ieee754_ctl->tme_ieee754_ctl_lock_unlock = NULL;
4392 
4393   /* signal any exceptions: */
4394   if (exceptions != 0) {
4395     (*ieee754_ctl->tme_ieee754_ctl_exception)(ieee754_ctl, exceptions);
4396   }
4397 }
4398 
4399 #endif /* (TME_FLOAT_FORMAT_IEEE754_EXTENDED80_BUILTIN == TME_FLOAT_FORMAT_IEEE754_EXTENDED80) */
4400 
4401 #if (TME_FLOAT_FORMAT_IEEE754_EXTENDED80_BUILTIN == TME_FLOAT_FORMAT_IEEE754_EXTENDED80)
4402 
4403 /* this does a partial compliance extended80-precision exp: */
4404 static void
_tme_ieee754_partial_extended80_exp(struct tme_ieee754_ctl * ieee754_ctl,const struct tme_float * src0,struct tme_float * dst)4405 _tme_ieee754_partial_extended80_exp(struct tme_ieee754_ctl *ieee754_ctl, const struct tme_float *src0, struct tme_float *dst)
4406 {
4407   int exceptions;
4408 
4409   /* check for a NaN operand: */
4410   if (__tme_predict_false(tme_ieee754_extended80_check_nan_monadic(ieee754_ctl, src0, dst))) {
4411     return;
4412   }
4413 
4414   /* enter native floating-point operation: */
4415   tme_float_enter(ieee754_ctl->tme_ieee754_ctl_rounding_mode, tme_ieee754_exception_float, ieee754_ctl);
4416   ieee754_ctl->tme_ieee754_ctl_lock_unlock = tme_float_leave;
4417 
4418   /* assume that this operation raises no exceptions: */
4419   exceptions = 0;
4420 
4421   /* the operation: */
4422 #if (TME_FLOAT_FORMAT_IEEE754_EXTENDED80_BUILTIN == TME_FLOAT_FORMAT_FLOAT)
4423   tme_ieee754_extended80_value_builtin_set(dst, TME_FLOAT_FORMAT_FLOAT, expf(tme_ieee754_extended80_value_builtin_get(src0)));
4424 #else  /* (TME_FLOAT_FORMAT_IEEE754_EXTENDED80_BUILTIN != TME_FLOAT_FORMAT_FLOAT) */
4425   tme_ieee754_extended80_value_builtin_set(dst, TME_FLOAT_FORMAT_DOUBLE, exp(tme_ieee754_extended80_value_builtin_get(src0)));
4426 #endif /* (TME_FLOAT_FORMAT_IEEE754_EXTENDED80_BUILTIN != TME_FLOAT_FORMAT_FLOAT) */
4427 
4428   /* leave native floating-point operation: */
4429   exceptions |= tme_float_leave();
4430   ieee754_ctl->tme_ieee754_ctl_lock_unlock = NULL;
4431 
4432   /* signal any exceptions: */
4433   if (exceptions != 0) {
4434     (*ieee754_ctl->tme_ieee754_ctl_exception)(ieee754_ctl, exceptions);
4435   }
4436 }
4437 
4438 #endif /* (TME_FLOAT_FORMAT_IEEE754_EXTENDED80_BUILTIN == TME_FLOAT_FORMAT_IEEE754_EXTENDED80) */
4439 
4440 #if (TME_FLOAT_FORMAT_IEEE754_EXTENDED80_BUILTIN == TME_FLOAT_FORMAT_IEEE754_EXTENDED80)
4441 
4442 /* this does a partial compliance extended80-precision log10: */
4443 static void
_tme_ieee754_partial_extended80_log10(struct tme_ieee754_ctl * ieee754_ctl,const struct tme_float * src0,struct tme_float * dst)4444 _tme_ieee754_partial_extended80_log10(struct tme_ieee754_ctl *ieee754_ctl, const struct tme_float *src0, struct tme_float *dst)
4445 {
4446   int exceptions;
4447 
4448   /* check for a NaN operand: */
4449   if (__tme_predict_false(tme_ieee754_extended80_check_nan_monadic(ieee754_ctl, src0, dst))) {
4450     return;
4451   }
4452 
4453   /* enter native floating-point operation: */
4454   tme_float_enter(ieee754_ctl->tme_ieee754_ctl_rounding_mode, tme_ieee754_exception_float, ieee754_ctl);
4455   ieee754_ctl->tme_ieee754_ctl_lock_unlock = tme_float_leave;
4456 
4457   /* assume that this operation raises no exceptions: */
4458   exceptions = 0;
4459 
4460   /* the operation: */
4461 #if (TME_FLOAT_FORMAT_IEEE754_EXTENDED80_BUILTIN == TME_FLOAT_FORMAT_FLOAT)
4462   tme_ieee754_extended80_value_builtin_set(dst, TME_FLOAT_FORMAT_FLOAT, log10f(tme_ieee754_extended80_value_builtin_get(src0)));
4463 #else  /* (TME_FLOAT_FORMAT_IEEE754_EXTENDED80_BUILTIN != TME_FLOAT_FORMAT_FLOAT) */
4464   tme_ieee754_extended80_value_builtin_set(dst, TME_FLOAT_FORMAT_DOUBLE, log10(tme_ieee754_extended80_value_builtin_get(src0)));
4465 #endif /* (TME_FLOAT_FORMAT_IEEE754_EXTENDED80_BUILTIN != TME_FLOAT_FORMAT_FLOAT) */
4466 
4467   /* leave native floating-point operation: */
4468   exceptions |= tme_float_leave();
4469   ieee754_ctl->tme_ieee754_ctl_lock_unlock = NULL;
4470 
4471   /* signal any exceptions: */
4472   if (exceptions != 0) {
4473     (*ieee754_ctl->tme_ieee754_ctl_exception)(ieee754_ctl, exceptions);
4474   }
4475 }
4476 
4477 #endif /* (TME_FLOAT_FORMAT_IEEE754_EXTENDED80_BUILTIN == TME_FLOAT_FORMAT_IEEE754_EXTENDED80) */
4478 
4479 #if (TME_FLOAT_FORMAT_IEEE754_EXTENDED80_BUILTIN == TME_FLOAT_FORMAT_IEEE754_EXTENDED80)
4480 
4481 /* this does a partial compliance extended80-precision log: */
4482 static void
_tme_ieee754_partial_extended80_log(struct tme_ieee754_ctl * ieee754_ctl,const struct tme_float * src0,struct tme_float * dst)4483 _tme_ieee754_partial_extended80_log(struct tme_ieee754_ctl *ieee754_ctl, const struct tme_float *src0, struct tme_float *dst)
4484 {
4485   int exceptions;
4486 
4487   /* check for a NaN operand: */
4488   if (__tme_predict_false(tme_ieee754_extended80_check_nan_monadic(ieee754_ctl, src0, dst))) {
4489     return;
4490   }
4491 
4492   /* enter native floating-point operation: */
4493   tme_float_enter(ieee754_ctl->tme_ieee754_ctl_rounding_mode, tme_ieee754_exception_float, ieee754_ctl);
4494   ieee754_ctl->tme_ieee754_ctl_lock_unlock = tme_float_leave;
4495 
4496   /* assume that this operation raises no exceptions: */
4497   exceptions = 0;
4498 
4499   /* the operation: */
4500 #if (TME_FLOAT_FORMAT_IEEE754_EXTENDED80_BUILTIN == TME_FLOAT_FORMAT_FLOAT)
4501   tme_ieee754_extended80_value_builtin_set(dst, TME_FLOAT_FORMAT_FLOAT, logf(tme_ieee754_extended80_value_builtin_get(src0)));
4502 #else  /* (TME_FLOAT_FORMAT_IEEE754_EXTENDED80_BUILTIN != TME_FLOAT_FORMAT_FLOAT) */
4503   tme_ieee754_extended80_value_builtin_set(dst, TME_FLOAT_FORMAT_DOUBLE, log(tme_ieee754_extended80_value_builtin_get(src0)));
4504 #endif /* (TME_FLOAT_FORMAT_IEEE754_EXTENDED80_BUILTIN != TME_FLOAT_FORMAT_FLOAT) */
4505 
4506   /* leave native floating-point operation: */
4507   exceptions |= tme_float_leave();
4508   ieee754_ctl->tme_ieee754_ctl_lock_unlock = NULL;
4509 
4510   /* signal any exceptions: */
4511   if (exceptions != 0) {
4512     (*ieee754_ctl->tme_ieee754_ctl_exception)(ieee754_ctl, exceptions);
4513   }
4514 }
4515 
4516 #endif /* (TME_FLOAT_FORMAT_IEEE754_EXTENDED80_BUILTIN == TME_FLOAT_FORMAT_IEEE754_EXTENDED80) */
4517 
4518 #if (TME_FLOAT_FORMAT_IEEE754_EXTENDED80_BUILTIN == TME_FLOAT_FORMAT_IEEE754_EXTENDED80)
4519 
4520 /* this does a partial compliance extended80-precision scale: */
4521 static void
_tme_ieee754_partial_extended80_scale(struct tme_ieee754_ctl * ieee754_ctl,const struct tme_float * src0,const struct tme_float * src1,struct tme_float * dst)4522 _tme_ieee754_partial_extended80_scale(struct tme_ieee754_ctl *ieee754_ctl, const struct tme_float *src0, const struct tme_float *src1, struct tme_float *dst)
4523 {
4524   int exceptions;
4525 
4526   /* check for a NaN operand: */
4527   if (__tme_predict_false(tme_ieee754_extended80_check_nan_dyadic(ieee754_ctl, src0, src1, dst))) {
4528     return;
4529   }
4530 
4531   /* enter native floating-point operation: */
4532   tme_float_enter(ieee754_ctl->tme_ieee754_ctl_rounding_mode, tme_ieee754_exception_float, ieee754_ctl);
4533   ieee754_ctl->tme_ieee754_ctl_lock_unlock = tme_float_leave;
4534 
4535   /* assume that this operation raises no exceptions: */
4536   exceptions = 0;
4537 
4538   /* the operation: */
4539 #if (TME_FLOAT_FORMAT_IEEE754_EXTENDED80_BUILTIN == TME_FLOAT_FORMAT_FLOAT)
4540   tme_ieee754_extended80_value_builtin_set(dst, TME_FLOAT_FORMAT_FLOAT, scalbnf(tme_ieee754_extended80_value_builtin_get(src0), tme_ieee754_extended80_value_builtin_get(src1)));
4541 #else  /* (TME_FLOAT_FORMAT_IEEE754_EXTENDED80_BUILTIN != TME_FLOAT_FORMAT_FLOAT) */
4542   tme_ieee754_extended80_value_builtin_set(dst, TME_FLOAT_FORMAT_DOUBLE, scalbn(tme_ieee754_extended80_value_builtin_get(src0), tme_ieee754_extended80_value_builtin_get(src1)));
4543 #endif /* (TME_FLOAT_FORMAT_IEEE754_EXTENDED80_BUILTIN != TME_FLOAT_FORMAT_FLOAT) */
4544 
4545   /* leave native floating-point operation: */
4546   exceptions |= tme_float_leave();
4547   ieee754_ctl->tme_ieee754_ctl_lock_unlock = NULL;
4548 
4549   /* signal any exceptions: */
4550   if (exceptions != 0) {
4551     (*ieee754_ctl->tme_ieee754_ctl_exception)(ieee754_ctl, exceptions);
4552   }
4553 }
4554 
4555 #endif /* (TME_FLOAT_FORMAT_IEEE754_EXTENDED80_BUILTIN == TME_FLOAT_FORMAT_IEEE754_EXTENDED80) */
4556 
4557 #if (TME_FLOAT_FORMAT_IEEE754_EXTENDED80_BUILTIN == TME_FLOAT_FORMAT_IEEE754_EXTENDED80)
4558 
4559 /* this does a partial compliance extended80-precision pow: */
4560 static void
_tme_ieee754_partial_extended80_pow(struct tme_ieee754_ctl * ieee754_ctl,const struct tme_float * src0,const struct tme_float * src1,struct tme_float * dst)4561 _tme_ieee754_partial_extended80_pow(struct tme_ieee754_ctl *ieee754_ctl, const struct tme_float *src0, const struct tme_float *src1, struct tme_float *dst)
4562 {
4563   int exceptions;
4564 
4565   /* check for a NaN operand: */
4566   if (__tme_predict_false(tme_ieee754_extended80_check_nan_dyadic(ieee754_ctl, src0, src1, dst))) {
4567     return;
4568   }
4569 
4570   /* enter native floating-point operation: */
4571   tme_float_enter(ieee754_ctl->tme_ieee754_ctl_rounding_mode, tme_ieee754_exception_float, ieee754_ctl);
4572   ieee754_ctl->tme_ieee754_ctl_lock_unlock = tme_float_leave;
4573 
4574   /* assume that this operation raises no exceptions: */
4575   exceptions = 0;
4576 
4577   /* the operation: */
4578 #if (TME_FLOAT_FORMAT_IEEE754_EXTENDED80_BUILTIN == TME_FLOAT_FORMAT_FLOAT)
4579   tme_ieee754_extended80_value_builtin_set(dst, TME_FLOAT_FORMAT_FLOAT, powf(tme_ieee754_extended80_value_builtin_get(src0), tme_ieee754_extended80_value_builtin_get(src1)));
4580 #else  /* (TME_FLOAT_FORMAT_IEEE754_EXTENDED80_BUILTIN != TME_FLOAT_FORMAT_FLOAT) */
4581   tme_ieee754_extended80_value_builtin_set(dst, TME_FLOAT_FORMAT_DOUBLE, pow(tme_ieee754_extended80_value_builtin_get(src0), tme_ieee754_extended80_value_builtin_get(src1)));
4582 #endif /* (TME_FLOAT_FORMAT_IEEE754_EXTENDED80_BUILTIN != TME_FLOAT_FORMAT_FLOAT) */
4583 
4584   /* leave native floating-point operation: */
4585   exceptions |= tme_float_leave();
4586   ieee754_ctl->tme_ieee754_ctl_lock_unlock = NULL;
4587 
4588   /* signal any exceptions: */
4589   if (exceptions != 0) {
4590     (*ieee754_ctl->tme_ieee754_ctl_exception)(ieee754_ctl, exceptions);
4591   }
4592 }
4593 
4594 #endif /* (TME_FLOAT_FORMAT_IEEE754_EXTENDED80_BUILTIN == TME_FLOAT_FORMAT_IEEE754_EXTENDED80) */
4595 
4596 #if (TME_FLOAT_FORMAT_IEEE754_QUAD_BUILTIN == TME_FLOAT_FORMAT_IEEE754_QUAD)
4597 
4598 /* this does a partial compliance quad-precision add: */
4599 static void
_tme_ieee754_partial_quad_add(struct tme_ieee754_ctl * ieee754_ctl,const struct tme_float * src0,const struct tme_float * src1,struct tme_float * dst)4600 _tme_ieee754_partial_quad_add(struct tme_ieee754_ctl *ieee754_ctl, const struct tme_float *src0, const struct tme_float *src1, struct tme_float *dst)
4601 {
4602   int exceptions;
4603 
4604   /* check for a NaN operand: */
4605   if (__tme_predict_false(tme_ieee754_quad_check_nan_dyadic(ieee754_ctl, src0, src1, dst))) {
4606     return;
4607   }
4608 
4609   /* enter native floating-point operation: */
4610   tme_float_enter(ieee754_ctl->tme_ieee754_ctl_rounding_mode, tme_ieee754_exception_float, ieee754_ctl);
4611   ieee754_ctl->tme_ieee754_ctl_lock_unlock = tme_float_leave;
4612 
4613   /* assume that this operation raises no exceptions: */
4614   exceptions = 0;
4615 
4616   /* the operation: */
4617   tme_ieee754_quad_value_builtin_set(dst, TME_FLOAT_FORMAT_IEEE754_QUAD_BUILTIN, tme_ieee754_quad_value_builtin_get(src0) + tme_ieee754_quad_value_builtin_get(src1));
4618 
4619   /* leave native floating-point operation: */
4620   exceptions |= tme_float_leave();
4621   ieee754_ctl->tme_ieee754_ctl_lock_unlock = NULL;
4622 
4623   /* signal any exceptions: */
4624   if (exceptions != 0) {
4625     (*ieee754_ctl->tme_ieee754_ctl_exception)(ieee754_ctl, exceptions);
4626   }
4627 }
4628 
4629 #endif /* (TME_FLOAT_FORMAT_IEEE754_QUAD_BUILTIN == TME_FLOAT_FORMAT_IEEE754_QUAD) */
4630 
4631 #if (TME_FLOAT_FORMAT_IEEE754_QUAD_BUILTIN == TME_FLOAT_FORMAT_IEEE754_QUAD)
4632 
4633 /* this does a partial compliance quad-precision sub: */
4634 static void
_tme_ieee754_partial_quad_sub(struct tme_ieee754_ctl * ieee754_ctl,const struct tme_float * src0,const struct tme_float * src1,struct tme_float * dst)4635 _tme_ieee754_partial_quad_sub(struct tme_ieee754_ctl *ieee754_ctl, const struct tme_float *src0, const struct tme_float *src1, struct tme_float *dst)
4636 {
4637   int exceptions;
4638 
4639   /* check for a NaN operand: */
4640   if (__tme_predict_false(tme_ieee754_quad_check_nan_dyadic(ieee754_ctl, src0, src1, dst))) {
4641     return;
4642   }
4643 
4644   /* enter native floating-point operation: */
4645   tme_float_enter(ieee754_ctl->tme_ieee754_ctl_rounding_mode, tme_ieee754_exception_float, ieee754_ctl);
4646   ieee754_ctl->tme_ieee754_ctl_lock_unlock = tme_float_leave;
4647 
4648   /* assume that this operation raises no exceptions: */
4649   exceptions = 0;
4650 
4651   /* the operation: */
4652   tme_ieee754_quad_value_builtin_set(dst, TME_FLOAT_FORMAT_IEEE754_QUAD_BUILTIN, tme_ieee754_quad_value_builtin_get(src0) - tme_ieee754_quad_value_builtin_get(src1));
4653 
4654   /* leave native floating-point operation: */
4655   exceptions |= tme_float_leave();
4656   ieee754_ctl->tme_ieee754_ctl_lock_unlock = NULL;
4657 
4658   /* signal any exceptions: */
4659   if (exceptions != 0) {
4660     (*ieee754_ctl->tme_ieee754_ctl_exception)(ieee754_ctl, exceptions);
4661   }
4662 }
4663 
4664 #endif /* (TME_FLOAT_FORMAT_IEEE754_QUAD_BUILTIN == TME_FLOAT_FORMAT_IEEE754_QUAD) */
4665 
4666 #if (TME_FLOAT_FORMAT_IEEE754_QUAD_BUILTIN == TME_FLOAT_FORMAT_IEEE754_QUAD)
4667 
4668 /* this does a partial compliance quad-precision mul: */
4669 static void
_tme_ieee754_partial_quad_mul(struct tme_ieee754_ctl * ieee754_ctl,const struct tme_float * src0,const struct tme_float * src1,struct tme_float * dst)4670 _tme_ieee754_partial_quad_mul(struct tme_ieee754_ctl *ieee754_ctl, const struct tme_float *src0, const struct tme_float *src1, struct tme_float *dst)
4671 {
4672   int exceptions;
4673 
4674   /* check for a NaN operand: */
4675   if (__tme_predict_false(tme_ieee754_quad_check_nan_dyadic(ieee754_ctl, src0, src1, dst))) {
4676     return;
4677   }
4678 
4679   /* enter native floating-point operation: */
4680   tme_float_enter(ieee754_ctl->tme_ieee754_ctl_rounding_mode, tme_ieee754_exception_float, ieee754_ctl);
4681   ieee754_ctl->tme_ieee754_ctl_lock_unlock = tme_float_leave;
4682 
4683   /* assume that this operation raises no exceptions: */
4684   exceptions = 0;
4685 
4686   /* the operation: */
4687   tme_ieee754_quad_value_builtin_set(dst, TME_FLOAT_FORMAT_IEEE754_QUAD_BUILTIN, tme_ieee754_quad_value_builtin_get(src0) * tme_ieee754_quad_value_builtin_get(src1));
4688 
4689   /* leave native floating-point operation: */
4690   exceptions |= tme_float_leave();
4691   ieee754_ctl->tme_ieee754_ctl_lock_unlock = NULL;
4692 
4693   /* signal any exceptions: */
4694   if (exceptions != 0) {
4695     (*ieee754_ctl->tme_ieee754_ctl_exception)(ieee754_ctl, exceptions);
4696   }
4697 }
4698 
4699 #endif /* (TME_FLOAT_FORMAT_IEEE754_QUAD_BUILTIN == TME_FLOAT_FORMAT_IEEE754_QUAD) */
4700 
4701 #if (TME_FLOAT_FORMAT_IEEE754_QUAD_BUILTIN == TME_FLOAT_FORMAT_IEEE754_QUAD)
4702 
4703 /* this does a partial compliance quad-precision div: */
4704 static void
_tme_ieee754_partial_quad_div(struct tme_ieee754_ctl * ieee754_ctl,const struct tme_float * src0,const struct tme_float * src1,struct tme_float * dst)4705 _tme_ieee754_partial_quad_div(struct tme_ieee754_ctl *ieee754_ctl, const struct tme_float *src0, const struct tme_float *src1, struct tme_float *dst)
4706 {
4707   int exceptions;
4708 
4709   /* check for a NaN operand: */
4710   if (__tme_predict_false(tme_ieee754_quad_check_nan_dyadic(ieee754_ctl, src0, src1, dst))) {
4711     return;
4712   }
4713 
4714   /* enter native floating-point operation: */
4715   tme_float_enter(ieee754_ctl->tme_ieee754_ctl_rounding_mode, tme_ieee754_exception_float, ieee754_ctl);
4716   ieee754_ctl->tme_ieee754_ctl_lock_unlock = tme_float_leave;
4717 
4718   /* assume that this operation raises no exceptions: */
4719   exceptions = 0;
4720 
4721   /* the operation: */
4722   tme_ieee754_quad_value_builtin_set(dst, TME_FLOAT_FORMAT_IEEE754_QUAD_BUILTIN, tme_ieee754_quad_value_builtin_get(src0) / tme_ieee754_quad_value_builtin_get(src1));
4723 
4724   /* leave native floating-point operation: */
4725   exceptions |= tme_float_leave();
4726   ieee754_ctl->tme_ieee754_ctl_lock_unlock = NULL;
4727 
4728   /* signal any exceptions: */
4729   if (exceptions != 0) {
4730     (*ieee754_ctl->tme_ieee754_ctl_exception)(ieee754_ctl, exceptions);
4731   }
4732 }
4733 
4734 #endif /* (TME_FLOAT_FORMAT_IEEE754_QUAD_BUILTIN == TME_FLOAT_FORMAT_IEEE754_QUAD) */
4735 
4736 #if (TME_FLOAT_FORMAT_IEEE754_QUAD_BUILTIN == TME_FLOAT_FORMAT_IEEE754_QUAD)
4737 
4738 /* this does a partial compliance quad-precision sqrt: */
4739 static void
_tme_ieee754_partial_quad_sqrt(struct tme_ieee754_ctl * ieee754_ctl,const struct tme_float * src0,struct tme_float * dst)4740 _tme_ieee754_partial_quad_sqrt(struct tme_ieee754_ctl *ieee754_ctl, const struct tme_float *src0, struct tme_float *dst)
4741 {
4742   int exceptions;
4743 
4744   /* check for a NaN operand: */
4745   if (__tme_predict_false(tme_ieee754_quad_check_nan_monadic(ieee754_ctl, src0, dst))) {
4746     return;
4747   }
4748 
4749   /* enter native floating-point operation: */
4750   tme_float_enter(ieee754_ctl->tme_ieee754_ctl_rounding_mode, tme_ieee754_exception_float, ieee754_ctl);
4751   ieee754_ctl->tme_ieee754_ctl_lock_unlock = tme_float_leave;
4752 
4753   /* assume that this operation raises no exceptions: */
4754   exceptions = 0;
4755 
4756   /* the operation: */
4757 #if (TME_FLOAT_FORMAT_IEEE754_QUAD_BUILTIN == TME_FLOAT_FORMAT_FLOAT)
4758   tme_ieee754_quad_value_builtin_set(dst, TME_FLOAT_FORMAT_FLOAT, sqrtf(tme_ieee754_quad_value_builtin_get(src0)));
4759 #else  /* (TME_FLOAT_FORMAT_IEEE754_QUAD_BUILTIN != TME_FLOAT_FORMAT_FLOAT) */
4760   tme_ieee754_quad_value_builtin_set(dst, TME_FLOAT_FORMAT_DOUBLE, sqrt(tme_ieee754_quad_value_builtin_get(src0)));
4761 #endif /* (TME_FLOAT_FORMAT_IEEE754_QUAD_BUILTIN != TME_FLOAT_FORMAT_FLOAT) */
4762 
4763   /* leave native floating-point operation: */
4764   exceptions |= tme_float_leave();
4765   ieee754_ctl->tme_ieee754_ctl_lock_unlock = NULL;
4766 
4767   /* signal any exceptions: */
4768   if (exceptions != 0) {
4769     (*ieee754_ctl->tme_ieee754_ctl_exception)(ieee754_ctl, exceptions);
4770   }
4771 }
4772 
4773 #endif /* (TME_FLOAT_FORMAT_IEEE754_QUAD_BUILTIN == TME_FLOAT_FORMAT_IEEE754_QUAD) */
4774 
4775 #if (TME_FLOAT_FORMAT_IEEE754_QUAD_BUILTIN == TME_FLOAT_FORMAT_IEEE754_QUAD)
4776 
4777 /* this does a partial compliance quad-precision abs: */
4778 static void
_tme_ieee754_partial_quad_abs(struct tme_ieee754_ctl * ieee754_ctl,const struct tme_float * src0,struct tme_float * dst)4779 _tme_ieee754_partial_quad_abs(struct tme_ieee754_ctl *ieee754_ctl, const struct tme_float *src0, struct tme_float *dst)
4780 {
4781   int exceptions;
4782 
4783   /* check for a NaN operand: */
4784   if (__tme_predict_false(tme_ieee754_quad_check_nan_monadic(ieee754_ctl, src0, dst))) {
4785     return;
4786   }
4787 
4788   /* enter native floating-point operation: */
4789   tme_float_enter(ieee754_ctl->tme_ieee754_ctl_rounding_mode, tme_ieee754_exception_float, ieee754_ctl);
4790   ieee754_ctl->tme_ieee754_ctl_lock_unlock = tme_float_leave;
4791 
4792   /* assume that this operation raises no exceptions: */
4793   exceptions = 0;
4794 
4795   /* the operation: */
4796 #if (TME_FLOAT_FORMAT_IEEE754_QUAD_BUILTIN == TME_FLOAT_FORMAT_FLOAT)
4797   tme_ieee754_quad_value_builtin_set(dst, TME_FLOAT_FORMAT_FLOAT, fabsf(tme_ieee754_quad_value_builtin_get(src0)));
4798 #else  /* (TME_FLOAT_FORMAT_IEEE754_QUAD_BUILTIN != TME_FLOAT_FORMAT_FLOAT) */
4799   tme_ieee754_quad_value_builtin_set(dst, TME_FLOAT_FORMAT_DOUBLE, fabs(tme_ieee754_quad_value_builtin_get(src0)));
4800 #endif /* (TME_FLOAT_FORMAT_IEEE754_QUAD_BUILTIN != TME_FLOAT_FORMAT_FLOAT) */
4801 
4802   /* leave native floating-point operation: */
4803   exceptions |= tme_float_leave();
4804   ieee754_ctl->tme_ieee754_ctl_lock_unlock = NULL;
4805 
4806   /* signal any exceptions: */
4807   if (exceptions != 0) {
4808     (*ieee754_ctl->tme_ieee754_ctl_exception)(ieee754_ctl, exceptions);
4809   }
4810 }
4811 
4812 #endif /* (TME_FLOAT_FORMAT_IEEE754_QUAD_BUILTIN == TME_FLOAT_FORMAT_IEEE754_QUAD) */
4813 
4814 #if (TME_FLOAT_FORMAT_IEEE754_QUAD_BUILTIN == TME_FLOAT_FORMAT_IEEE754_QUAD)
4815 
4816 /* this does a partial compliance quad-precision neg: */
4817 static void
_tme_ieee754_partial_quad_neg(struct tme_ieee754_ctl * ieee754_ctl,const struct tme_float * src0,struct tme_float * dst)4818 _tme_ieee754_partial_quad_neg(struct tme_ieee754_ctl *ieee754_ctl, const struct tme_float *src0, struct tme_float *dst)
4819 {
4820   int exceptions;
4821 
4822   /* check for a NaN operand: */
4823   if (__tme_predict_false(tme_ieee754_quad_check_nan_monadic(ieee754_ctl, src0, dst))) {
4824     return;
4825   }
4826 
4827   /* enter native floating-point operation: */
4828   tme_float_enter(ieee754_ctl->tme_ieee754_ctl_rounding_mode, tme_ieee754_exception_float, ieee754_ctl);
4829   ieee754_ctl->tme_ieee754_ctl_lock_unlock = tme_float_leave;
4830 
4831   /* assume that this operation raises no exceptions: */
4832   exceptions = 0;
4833 
4834   /* the operation: */
4835   tme_ieee754_quad_value_builtin_set(dst, TME_FLOAT_FORMAT_IEEE754_QUAD_BUILTIN, -1 * tme_ieee754_quad_value_builtin_get(src0));
4836 
4837   /* leave native floating-point operation: */
4838   exceptions |= tme_float_leave();
4839   ieee754_ctl->tme_ieee754_ctl_lock_unlock = NULL;
4840 
4841   /* signal any exceptions: */
4842   if (exceptions != 0) {
4843     (*ieee754_ctl->tme_ieee754_ctl_exception)(ieee754_ctl, exceptions);
4844   }
4845 }
4846 
4847 #endif /* (TME_FLOAT_FORMAT_IEEE754_QUAD_BUILTIN == TME_FLOAT_FORMAT_IEEE754_QUAD) */
4848 
4849 #if (TME_FLOAT_FORMAT_IEEE754_QUAD_BUILTIN == TME_FLOAT_FORMAT_IEEE754_QUAD)
4850 
4851 /* this does a partial compliance quad-precision move: */
4852 static void
_tme_ieee754_partial_quad_move(struct tme_ieee754_ctl * ieee754_ctl,const struct tme_float * src0,struct tme_float * dst)4853 _tme_ieee754_partial_quad_move(struct tme_ieee754_ctl *ieee754_ctl, const struct tme_float *src0, struct tme_float *dst)
4854 {
4855   int exceptions;
4856 
4857   /* check for a NaN operand: */
4858   if (__tme_predict_false(tme_ieee754_quad_check_nan_monadic(ieee754_ctl, src0, dst))) {
4859     return;
4860   }
4861 
4862   /* enter native floating-point operation: */
4863   tme_float_enter(ieee754_ctl->tme_ieee754_ctl_rounding_mode, tme_ieee754_exception_float, ieee754_ctl);
4864   ieee754_ctl->tme_ieee754_ctl_lock_unlock = tme_float_leave;
4865 
4866   /* assume that this operation raises no exceptions: */
4867   exceptions = 0;
4868 
4869   /* the operation: */
4870   *dst = *src0;
4871 
4872   /* leave native floating-point operation: */
4873   exceptions |= tme_float_leave();
4874   ieee754_ctl->tme_ieee754_ctl_lock_unlock = NULL;
4875 
4876   /* signal any exceptions: */
4877   if (exceptions != 0) {
4878     (*ieee754_ctl->tme_ieee754_ctl_exception)(ieee754_ctl, exceptions);
4879   }
4880 }
4881 
4882 #endif /* (TME_FLOAT_FORMAT_IEEE754_QUAD_BUILTIN == TME_FLOAT_FORMAT_IEEE754_QUAD) */
4883 
4884 #if (TME_FLOAT_FORMAT_IEEE754_QUAD_BUILTIN == TME_FLOAT_FORMAT_IEEE754_QUAD)
4885 
4886 /* this does a partial compliance quad-precision exp: */
4887 static void
_tme_ieee754_partial_quad_exp(struct tme_ieee754_ctl * ieee754_ctl,const struct tme_float * src0,struct tme_float * dst)4888 _tme_ieee754_partial_quad_exp(struct tme_ieee754_ctl *ieee754_ctl, const struct tme_float *src0, struct tme_float *dst)
4889 {
4890   int exceptions;
4891 
4892   /* check for a NaN operand: */
4893   if (__tme_predict_false(tme_ieee754_quad_check_nan_monadic(ieee754_ctl, src0, dst))) {
4894     return;
4895   }
4896 
4897   /* enter native floating-point operation: */
4898   tme_float_enter(ieee754_ctl->tme_ieee754_ctl_rounding_mode, tme_ieee754_exception_float, ieee754_ctl);
4899   ieee754_ctl->tme_ieee754_ctl_lock_unlock = tme_float_leave;
4900 
4901   /* assume that this operation raises no exceptions: */
4902   exceptions = 0;
4903 
4904   /* the operation: */
4905 #if (TME_FLOAT_FORMAT_IEEE754_QUAD_BUILTIN == TME_FLOAT_FORMAT_FLOAT)
4906   tme_ieee754_quad_value_builtin_set(dst, TME_FLOAT_FORMAT_FLOAT, expf(tme_ieee754_quad_value_builtin_get(src0)));
4907 #else  /* (TME_FLOAT_FORMAT_IEEE754_QUAD_BUILTIN != TME_FLOAT_FORMAT_FLOAT) */
4908   tme_ieee754_quad_value_builtin_set(dst, TME_FLOAT_FORMAT_DOUBLE, exp(tme_ieee754_quad_value_builtin_get(src0)));
4909 #endif /* (TME_FLOAT_FORMAT_IEEE754_QUAD_BUILTIN != TME_FLOAT_FORMAT_FLOAT) */
4910 
4911   /* leave native floating-point operation: */
4912   exceptions |= tme_float_leave();
4913   ieee754_ctl->tme_ieee754_ctl_lock_unlock = NULL;
4914 
4915   /* signal any exceptions: */
4916   if (exceptions != 0) {
4917     (*ieee754_ctl->tme_ieee754_ctl_exception)(ieee754_ctl, exceptions);
4918   }
4919 }
4920 
4921 #endif /* (TME_FLOAT_FORMAT_IEEE754_QUAD_BUILTIN == TME_FLOAT_FORMAT_IEEE754_QUAD) */
4922 
4923 #if (TME_FLOAT_FORMAT_IEEE754_QUAD_BUILTIN == TME_FLOAT_FORMAT_IEEE754_QUAD)
4924 
4925 /* this does a partial compliance quad-precision log10: */
4926 static void
_tme_ieee754_partial_quad_log10(struct tme_ieee754_ctl * ieee754_ctl,const struct tme_float * src0,struct tme_float * dst)4927 _tme_ieee754_partial_quad_log10(struct tme_ieee754_ctl *ieee754_ctl, const struct tme_float *src0, struct tme_float *dst)
4928 {
4929   int exceptions;
4930 
4931   /* check for a NaN operand: */
4932   if (__tme_predict_false(tme_ieee754_quad_check_nan_monadic(ieee754_ctl, src0, dst))) {
4933     return;
4934   }
4935 
4936   /* enter native floating-point operation: */
4937   tme_float_enter(ieee754_ctl->tme_ieee754_ctl_rounding_mode, tme_ieee754_exception_float, ieee754_ctl);
4938   ieee754_ctl->tme_ieee754_ctl_lock_unlock = tme_float_leave;
4939 
4940   /* assume that this operation raises no exceptions: */
4941   exceptions = 0;
4942 
4943   /* the operation: */
4944 #if (TME_FLOAT_FORMAT_IEEE754_QUAD_BUILTIN == TME_FLOAT_FORMAT_FLOAT)
4945   tme_ieee754_quad_value_builtin_set(dst, TME_FLOAT_FORMAT_FLOAT, log10f(tme_ieee754_quad_value_builtin_get(src0)));
4946 #else  /* (TME_FLOAT_FORMAT_IEEE754_QUAD_BUILTIN != TME_FLOAT_FORMAT_FLOAT) */
4947   tme_ieee754_quad_value_builtin_set(dst, TME_FLOAT_FORMAT_DOUBLE, log10(tme_ieee754_quad_value_builtin_get(src0)));
4948 #endif /* (TME_FLOAT_FORMAT_IEEE754_QUAD_BUILTIN != TME_FLOAT_FORMAT_FLOAT) */
4949 
4950   /* leave native floating-point operation: */
4951   exceptions |= tme_float_leave();
4952   ieee754_ctl->tme_ieee754_ctl_lock_unlock = NULL;
4953 
4954   /* signal any exceptions: */
4955   if (exceptions != 0) {
4956     (*ieee754_ctl->tme_ieee754_ctl_exception)(ieee754_ctl, exceptions);
4957   }
4958 }
4959 
4960 #endif /* (TME_FLOAT_FORMAT_IEEE754_QUAD_BUILTIN == TME_FLOAT_FORMAT_IEEE754_QUAD) */
4961 
4962 #if (TME_FLOAT_FORMAT_IEEE754_QUAD_BUILTIN == TME_FLOAT_FORMAT_IEEE754_QUAD)
4963 
4964 /* this does a partial compliance quad-precision log: */
4965 static void
_tme_ieee754_partial_quad_log(struct tme_ieee754_ctl * ieee754_ctl,const struct tme_float * src0,struct tme_float * dst)4966 _tme_ieee754_partial_quad_log(struct tme_ieee754_ctl *ieee754_ctl, const struct tme_float *src0, struct tme_float *dst)
4967 {
4968   int exceptions;
4969 
4970   /* check for a NaN operand: */
4971   if (__tme_predict_false(tme_ieee754_quad_check_nan_monadic(ieee754_ctl, src0, dst))) {
4972     return;
4973   }
4974 
4975   /* enter native floating-point operation: */
4976   tme_float_enter(ieee754_ctl->tme_ieee754_ctl_rounding_mode, tme_ieee754_exception_float, ieee754_ctl);
4977   ieee754_ctl->tme_ieee754_ctl_lock_unlock = tme_float_leave;
4978 
4979   /* assume that this operation raises no exceptions: */
4980   exceptions = 0;
4981 
4982   /* the operation: */
4983 #if (TME_FLOAT_FORMAT_IEEE754_QUAD_BUILTIN == TME_FLOAT_FORMAT_FLOAT)
4984   tme_ieee754_quad_value_builtin_set(dst, TME_FLOAT_FORMAT_FLOAT, logf(tme_ieee754_quad_value_builtin_get(src0)));
4985 #else  /* (TME_FLOAT_FORMAT_IEEE754_QUAD_BUILTIN != TME_FLOAT_FORMAT_FLOAT) */
4986   tme_ieee754_quad_value_builtin_set(dst, TME_FLOAT_FORMAT_DOUBLE, log(tme_ieee754_quad_value_builtin_get(src0)));
4987 #endif /* (TME_FLOAT_FORMAT_IEEE754_QUAD_BUILTIN != TME_FLOAT_FORMAT_FLOAT) */
4988 
4989   /* leave native floating-point operation: */
4990   exceptions |= tme_float_leave();
4991   ieee754_ctl->tme_ieee754_ctl_lock_unlock = NULL;
4992 
4993   /* signal any exceptions: */
4994   if (exceptions != 0) {
4995     (*ieee754_ctl->tme_ieee754_ctl_exception)(ieee754_ctl, exceptions);
4996   }
4997 }
4998 
4999 #endif /* (TME_FLOAT_FORMAT_IEEE754_QUAD_BUILTIN == TME_FLOAT_FORMAT_IEEE754_QUAD) */
5000 
5001 #if (TME_FLOAT_FORMAT_IEEE754_QUAD_BUILTIN == TME_FLOAT_FORMAT_IEEE754_QUAD)
5002 
5003 /* this does a partial compliance quad-precision scale: */
5004 static void
_tme_ieee754_partial_quad_scale(struct tme_ieee754_ctl * ieee754_ctl,const struct tme_float * src0,const struct tme_float * src1,struct tme_float * dst)5005 _tme_ieee754_partial_quad_scale(struct tme_ieee754_ctl *ieee754_ctl, const struct tme_float *src0, const struct tme_float *src1, struct tme_float *dst)
5006 {
5007   int exceptions;
5008 
5009   /* check for a NaN operand: */
5010   if (__tme_predict_false(tme_ieee754_quad_check_nan_dyadic(ieee754_ctl, src0, src1, dst))) {
5011     return;
5012   }
5013 
5014   /* enter native floating-point operation: */
5015   tme_float_enter(ieee754_ctl->tme_ieee754_ctl_rounding_mode, tme_ieee754_exception_float, ieee754_ctl);
5016   ieee754_ctl->tme_ieee754_ctl_lock_unlock = tme_float_leave;
5017 
5018   /* assume that this operation raises no exceptions: */
5019   exceptions = 0;
5020 
5021   /* the operation: */
5022 #if (TME_FLOAT_FORMAT_IEEE754_QUAD_BUILTIN == TME_FLOAT_FORMAT_FLOAT)
5023   tme_ieee754_quad_value_builtin_set(dst, TME_FLOAT_FORMAT_FLOAT, scalbnf(tme_ieee754_quad_value_builtin_get(src0), tme_ieee754_quad_value_builtin_get(src1)));
5024 #else  /* (TME_FLOAT_FORMAT_IEEE754_QUAD_BUILTIN != TME_FLOAT_FORMAT_FLOAT) */
5025   tme_ieee754_quad_value_builtin_set(dst, TME_FLOAT_FORMAT_DOUBLE, scalbn(tme_ieee754_quad_value_builtin_get(src0), tme_ieee754_quad_value_builtin_get(src1)));
5026 #endif /* (TME_FLOAT_FORMAT_IEEE754_QUAD_BUILTIN != TME_FLOAT_FORMAT_FLOAT) */
5027 
5028   /* leave native floating-point operation: */
5029   exceptions |= tme_float_leave();
5030   ieee754_ctl->tme_ieee754_ctl_lock_unlock = NULL;
5031 
5032   /* signal any exceptions: */
5033   if (exceptions != 0) {
5034     (*ieee754_ctl->tme_ieee754_ctl_exception)(ieee754_ctl, exceptions);
5035   }
5036 }
5037 
5038 #endif /* (TME_FLOAT_FORMAT_IEEE754_QUAD_BUILTIN == TME_FLOAT_FORMAT_IEEE754_QUAD) */
5039 
5040 #if (TME_FLOAT_FORMAT_IEEE754_QUAD_BUILTIN == TME_FLOAT_FORMAT_IEEE754_QUAD)
5041 
5042 /* this does a partial compliance quad-precision pow: */
5043 static void
_tme_ieee754_partial_quad_pow(struct tme_ieee754_ctl * ieee754_ctl,const struct tme_float * src0,const struct tme_float * src1,struct tme_float * dst)5044 _tme_ieee754_partial_quad_pow(struct tme_ieee754_ctl *ieee754_ctl, const struct tme_float *src0, const struct tme_float *src1, struct tme_float *dst)
5045 {
5046   int exceptions;
5047 
5048   /* check for a NaN operand: */
5049   if (__tme_predict_false(tme_ieee754_quad_check_nan_dyadic(ieee754_ctl, src0, src1, dst))) {
5050     return;
5051   }
5052 
5053   /* enter native floating-point operation: */
5054   tme_float_enter(ieee754_ctl->tme_ieee754_ctl_rounding_mode, tme_ieee754_exception_float, ieee754_ctl);
5055   ieee754_ctl->tme_ieee754_ctl_lock_unlock = tme_float_leave;
5056 
5057   /* assume that this operation raises no exceptions: */
5058   exceptions = 0;
5059 
5060   /* the operation: */
5061 #if (TME_FLOAT_FORMAT_IEEE754_QUAD_BUILTIN == TME_FLOAT_FORMAT_FLOAT)
5062   tme_ieee754_quad_value_builtin_set(dst, TME_FLOAT_FORMAT_FLOAT, powf(tme_ieee754_quad_value_builtin_get(src0), tme_ieee754_quad_value_builtin_get(src1)));
5063 #else  /* (TME_FLOAT_FORMAT_IEEE754_QUAD_BUILTIN != TME_FLOAT_FORMAT_FLOAT) */
5064   tme_ieee754_quad_value_builtin_set(dst, TME_FLOAT_FORMAT_DOUBLE, pow(tme_ieee754_quad_value_builtin_get(src0), tme_ieee754_quad_value_builtin_get(src1)));
5065 #endif /* (TME_FLOAT_FORMAT_IEEE754_QUAD_BUILTIN != TME_FLOAT_FORMAT_FLOAT) */
5066 
5067   /* leave native floating-point operation: */
5068   exceptions |= tme_float_leave();
5069   ieee754_ctl->tme_ieee754_ctl_lock_unlock = NULL;
5070 
5071   /* signal any exceptions: */
5072   if (exceptions != 0) {
5073     (*ieee754_ctl->tme_ieee754_ctl_exception)(ieee754_ctl, exceptions);
5074   }
5075 }
5076 
5077 #endif /* (TME_FLOAT_FORMAT_IEEE754_QUAD_BUILTIN == TME_FLOAT_FORMAT_IEEE754_QUAD) */
5078 
5079 /* the partial compliance operations: */
5080 _tme_const struct tme_ieee754_ops tme_ieee754_ops_partial = {
5081 
5082   /* the version of this structure: */
5083   TME_X_VERSION(0, 0),
5084 
5085   /* this does a partial compliance single-precision add: */
5086 #if ((TME_FLOAT_FORMAT_IEEE754_SINGLE_BUILTIN == TME_FLOAT_FORMAT_IEEE754_SINGLE))
5087   _tme_ieee754_partial_single_add,
5088 #else  /* !((TME_FLOAT_FORMAT_IEEE754_SINGLE_BUILTIN == TME_FLOAT_FORMAT_IEEE754_SINGLE)) */
5089   _tme_ieee754_strict_single_add,
5090 #endif /* !((TME_FLOAT_FORMAT_IEEE754_SINGLE_BUILTIN == TME_FLOAT_FORMAT_IEEE754_SINGLE)) */
5091 
5092   /* this does a partial compliance single-precision sub: */
5093 #if ((TME_FLOAT_FORMAT_IEEE754_SINGLE_BUILTIN == TME_FLOAT_FORMAT_IEEE754_SINGLE))
5094   _tme_ieee754_partial_single_sub,
5095 #else  /* !((TME_FLOAT_FORMAT_IEEE754_SINGLE_BUILTIN == TME_FLOAT_FORMAT_IEEE754_SINGLE)) */
5096   _tme_ieee754_strict_single_sub,
5097 #endif /* !((TME_FLOAT_FORMAT_IEEE754_SINGLE_BUILTIN == TME_FLOAT_FORMAT_IEEE754_SINGLE)) */
5098 
5099   /* this does a partial compliance single-precision mul: */
5100 #if ((TME_FLOAT_FORMAT_IEEE754_SINGLE_BUILTIN == TME_FLOAT_FORMAT_IEEE754_SINGLE))
5101   _tme_ieee754_partial_single_mul,
5102 #else  /* !((TME_FLOAT_FORMAT_IEEE754_SINGLE_BUILTIN == TME_FLOAT_FORMAT_IEEE754_SINGLE)) */
5103   _tme_ieee754_strict_single_mul,
5104 #endif /* !((TME_FLOAT_FORMAT_IEEE754_SINGLE_BUILTIN == TME_FLOAT_FORMAT_IEEE754_SINGLE)) */
5105 
5106   /* this does a partial compliance single-precision div: */
5107 #if ((TME_FLOAT_FORMAT_IEEE754_SINGLE_BUILTIN == TME_FLOAT_FORMAT_IEEE754_SINGLE))
5108   _tme_ieee754_partial_single_div,
5109 #else  /* !((TME_FLOAT_FORMAT_IEEE754_SINGLE_BUILTIN == TME_FLOAT_FORMAT_IEEE754_SINGLE)) */
5110   _tme_ieee754_strict_single_div,
5111 #endif /* !((TME_FLOAT_FORMAT_IEEE754_SINGLE_BUILTIN == TME_FLOAT_FORMAT_IEEE754_SINGLE)) */
5112 
5113   /* this does a partial compliance single-precision rem: */
5114   _tme_ieee754_strict_single_rem,
5115 
5116   /* this does a partial compliance single-precision sqrt: */
5117 #if ((TME_FLOAT_FORMAT_IEEE754_SINGLE_BUILTIN == TME_FLOAT_FORMAT_IEEE754_SINGLE))
5118   _tme_ieee754_partial_single_sqrt,
5119 #else  /* !((TME_FLOAT_FORMAT_IEEE754_SINGLE_BUILTIN == TME_FLOAT_FORMAT_IEEE754_SINGLE)) */
5120   _tme_ieee754_strict_single_sqrt,
5121 #endif /* !((TME_FLOAT_FORMAT_IEEE754_SINGLE_BUILTIN == TME_FLOAT_FORMAT_IEEE754_SINGLE)) */
5122 
5123   /* this does a partial compliance single-precision abs: */
5124 #if ((TME_FLOAT_FORMAT_IEEE754_SINGLE_BUILTIN == TME_FLOAT_FORMAT_IEEE754_SINGLE))
5125   _tme_ieee754_partial_single_abs,
5126 #else  /* !((TME_FLOAT_FORMAT_IEEE754_SINGLE_BUILTIN == TME_FLOAT_FORMAT_IEEE754_SINGLE)) */
5127   NULL,
5128 #endif /* !((TME_FLOAT_FORMAT_IEEE754_SINGLE_BUILTIN == TME_FLOAT_FORMAT_IEEE754_SINGLE)) */
5129 
5130   /* this does a partial compliance single-precision neg: */
5131 #if ((TME_FLOAT_FORMAT_IEEE754_SINGLE_BUILTIN == TME_FLOAT_FORMAT_IEEE754_SINGLE))
5132   _tme_ieee754_partial_single_neg,
5133 #else  /* !((TME_FLOAT_FORMAT_IEEE754_SINGLE_BUILTIN == TME_FLOAT_FORMAT_IEEE754_SINGLE)) */
5134   _tme_ieee754_strict_single_neg,
5135 #endif /* !((TME_FLOAT_FORMAT_IEEE754_SINGLE_BUILTIN == TME_FLOAT_FORMAT_IEEE754_SINGLE)) */
5136 
5137   /* this does a partial compliance single-precision move: */
5138 #if ((TME_FLOAT_FORMAT_IEEE754_SINGLE_BUILTIN == TME_FLOAT_FORMAT_IEEE754_SINGLE))
5139   _tme_ieee754_partial_single_move,
5140 #else  /* !((TME_FLOAT_FORMAT_IEEE754_SINGLE_BUILTIN == TME_FLOAT_FORMAT_IEEE754_SINGLE)) */
5141   _tme_ieee754_strict_single_move,
5142 #endif /* !((TME_FLOAT_FORMAT_IEEE754_SINGLE_BUILTIN == TME_FLOAT_FORMAT_IEEE754_SINGLE)) */
5143 
5144   /* this does a partial compliance single-precision rint: */
5145   _tme_ieee754_strict_single_rint,
5146 
5147   /* this does a partial compliance single-precision cos: */
5148   NULL,
5149 
5150   /* this does a partial compliance single-precision acos: */
5151   NULL,
5152 
5153   /* this does a partial compliance single-precision cosh: */
5154   NULL,
5155 
5156   /* this does a partial compliance single-precision sin: */
5157   NULL,
5158 
5159   /* this does a partial compliance single-precision asin: */
5160   NULL,
5161 
5162   /* this does a partial compliance single-precision sinh: */
5163   NULL,
5164 
5165   /* this does a partial compliance single-precision tan: */
5166   NULL,
5167 
5168   /* this does a partial compliance single-precision atan: */
5169   NULL,
5170 
5171   /* this does a partial compliance single-precision tanh: */
5172   NULL,
5173 
5174   /* this does a partial compliance single-precision atanh: */
5175   NULL,
5176 
5177   /* this does a partial compliance single-precision exp: */
5178 #if ((TME_FLOAT_FORMAT_IEEE754_SINGLE_BUILTIN == TME_FLOAT_FORMAT_IEEE754_SINGLE))
5179   _tme_ieee754_partial_single_exp,
5180 #else  /* !((TME_FLOAT_FORMAT_IEEE754_SINGLE_BUILTIN == TME_FLOAT_FORMAT_IEEE754_SINGLE)) */
5181   NULL,
5182 #endif /* !((TME_FLOAT_FORMAT_IEEE754_SINGLE_BUILTIN == TME_FLOAT_FORMAT_IEEE754_SINGLE)) */
5183 
5184   /* this does a partial compliance single-precision expm1: */
5185   NULL,
5186 
5187   /* this does a partial compliance single-precision log10: */
5188 #if ((TME_FLOAT_FORMAT_IEEE754_SINGLE_BUILTIN == TME_FLOAT_FORMAT_IEEE754_SINGLE))
5189   _tme_ieee754_partial_single_log10,
5190 #else  /* !((TME_FLOAT_FORMAT_IEEE754_SINGLE_BUILTIN == TME_FLOAT_FORMAT_IEEE754_SINGLE)) */
5191   NULL,
5192 #endif /* !((TME_FLOAT_FORMAT_IEEE754_SINGLE_BUILTIN == TME_FLOAT_FORMAT_IEEE754_SINGLE)) */
5193 
5194   /* this does a partial compliance single-precision log: */
5195 #if ((TME_FLOAT_FORMAT_IEEE754_SINGLE_BUILTIN == TME_FLOAT_FORMAT_IEEE754_SINGLE))
5196   _tme_ieee754_partial_single_log,
5197 #else  /* !((TME_FLOAT_FORMAT_IEEE754_SINGLE_BUILTIN == TME_FLOAT_FORMAT_IEEE754_SINGLE)) */
5198   NULL,
5199 #endif /* !((TME_FLOAT_FORMAT_IEEE754_SINGLE_BUILTIN == TME_FLOAT_FORMAT_IEEE754_SINGLE)) */
5200 
5201   /* this does a partial compliance single-precision log1p: */
5202   NULL,
5203 
5204   /* this does a partial compliance single-precision getexp: */
5205   _tme_ieee754_strict_single_getexp,
5206 
5207   /* this does a partial compliance single-precision getman: */
5208   _tme_ieee754_strict_single_getman,
5209 
5210   /* this does a partial compliance single-precision scale: */
5211 #if ((TME_FLOAT_FORMAT_IEEE754_SINGLE_BUILTIN == TME_FLOAT_FORMAT_IEEE754_SINGLE))
5212   _tme_ieee754_partial_single_scale,
5213 #else  /* !((TME_FLOAT_FORMAT_IEEE754_SINGLE_BUILTIN == TME_FLOAT_FORMAT_IEEE754_SINGLE)) */
5214   NULL,
5215 #endif /* !((TME_FLOAT_FORMAT_IEEE754_SINGLE_BUILTIN == TME_FLOAT_FORMAT_IEEE754_SINGLE)) */
5216 
5217   /* this does a partial compliance single-precision pow: */
5218 #if ((TME_FLOAT_FORMAT_IEEE754_SINGLE_BUILTIN == TME_FLOAT_FORMAT_IEEE754_SINGLE))
5219   _tme_ieee754_partial_single_pow,
5220 #else  /* !((TME_FLOAT_FORMAT_IEEE754_SINGLE_BUILTIN == TME_FLOAT_FORMAT_IEEE754_SINGLE)) */
5221   NULL,
5222 #endif /* !((TME_FLOAT_FORMAT_IEEE754_SINGLE_BUILTIN == TME_FLOAT_FORMAT_IEEE754_SINGLE)) */
5223 
5224   /* this does a partial compliance single-precision from_double: */
5225   _tme_ieee754_strict_single_from_double,
5226 
5227   /* this does a partial compliance single-precision from_extended80: */
5228   _tme_ieee754_strict_single_from_extended80,
5229 
5230   /* this does a partial compliance single-precision from_quad: */
5231   _tme_ieee754_strict_single_from_quad,
5232 
5233   /* this does a partial compliance single-precision from_int32: */
5234   _tme_ieee754_strict_single_from_int32,
5235 
5236   /* this does a partial compliance single-precision from_int64: */
5237 #if (defined(TME_HAVE_INT64_T))
5238   _tme_ieee754_strict_single_from_int64,
5239 #else  /* !(defined(TME_HAVE_INT64_T)) */
5240   NULL,
5241 #endif /* !(defined(TME_HAVE_INT64_T)) */
5242 
5243   /* this does a partial compliance single-precision to_int32: */
5244   _tme_ieee754_strict_single_to_int32,
5245 
5246   /* this does a partial compliance single-precision to_int64: */
5247 #if (defined(TME_HAVE_INT64_T))
5248   _tme_ieee754_strict_single_to_int64,
5249 #else  /* !(defined(TME_HAVE_INT64_T)) */
5250   NULL,
5251 #endif /* !(defined(TME_HAVE_INT64_T)) */
5252 
5253   /* this does a partial compliance double-precision add: */
5254 #if ((TME_FLOAT_FORMAT_IEEE754_DOUBLE_BUILTIN == TME_FLOAT_FORMAT_IEEE754_DOUBLE))
5255   _tme_ieee754_partial_double_add,
5256 #else  /* !((TME_FLOAT_FORMAT_IEEE754_DOUBLE_BUILTIN == TME_FLOAT_FORMAT_IEEE754_DOUBLE)) */
5257   _tme_ieee754_strict_double_add,
5258 #endif /* !((TME_FLOAT_FORMAT_IEEE754_DOUBLE_BUILTIN == TME_FLOAT_FORMAT_IEEE754_DOUBLE)) */
5259 
5260   /* this does a partial compliance double-precision sub: */
5261 #if ((TME_FLOAT_FORMAT_IEEE754_DOUBLE_BUILTIN == TME_FLOAT_FORMAT_IEEE754_DOUBLE))
5262   _tme_ieee754_partial_double_sub,
5263 #else  /* !((TME_FLOAT_FORMAT_IEEE754_DOUBLE_BUILTIN == TME_FLOAT_FORMAT_IEEE754_DOUBLE)) */
5264   _tme_ieee754_strict_double_sub,
5265 #endif /* !((TME_FLOAT_FORMAT_IEEE754_DOUBLE_BUILTIN == TME_FLOAT_FORMAT_IEEE754_DOUBLE)) */
5266 
5267   /* this does a partial compliance double-precision mul: */
5268 #if ((TME_FLOAT_FORMAT_IEEE754_DOUBLE_BUILTIN == TME_FLOAT_FORMAT_IEEE754_DOUBLE))
5269   _tme_ieee754_partial_double_mul,
5270 #else  /* !((TME_FLOAT_FORMAT_IEEE754_DOUBLE_BUILTIN == TME_FLOAT_FORMAT_IEEE754_DOUBLE)) */
5271   _tme_ieee754_strict_double_mul,
5272 #endif /* !((TME_FLOAT_FORMAT_IEEE754_DOUBLE_BUILTIN == TME_FLOAT_FORMAT_IEEE754_DOUBLE)) */
5273 
5274   /* this does a partial compliance double-precision div: */
5275 #if ((TME_FLOAT_FORMAT_IEEE754_DOUBLE_BUILTIN == TME_FLOAT_FORMAT_IEEE754_DOUBLE))
5276   _tme_ieee754_partial_double_div,
5277 #else  /* !((TME_FLOAT_FORMAT_IEEE754_DOUBLE_BUILTIN == TME_FLOAT_FORMAT_IEEE754_DOUBLE)) */
5278   _tme_ieee754_strict_double_div,
5279 #endif /* !((TME_FLOAT_FORMAT_IEEE754_DOUBLE_BUILTIN == TME_FLOAT_FORMAT_IEEE754_DOUBLE)) */
5280 
5281   /* this does a partial compliance double-precision rem: */
5282   _tme_ieee754_strict_double_rem,
5283 
5284   /* this does a partial compliance double-precision sqrt: */
5285 #if ((TME_FLOAT_FORMAT_IEEE754_DOUBLE_BUILTIN == TME_FLOAT_FORMAT_IEEE754_DOUBLE))
5286   _tme_ieee754_partial_double_sqrt,
5287 #else  /* !((TME_FLOAT_FORMAT_IEEE754_DOUBLE_BUILTIN == TME_FLOAT_FORMAT_IEEE754_DOUBLE)) */
5288   _tme_ieee754_strict_double_sqrt,
5289 #endif /* !((TME_FLOAT_FORMAT_IEEE754_DOUBLE_BUILTIN == TME_FLOAT_FORMAT_IEEE754_DOUBLE)) */
5290 
5291   /* this does a partial compliance double-precision abs: */
5292 #if ((TME_FLOAT_FORMAT_IEEE754_DOUBLE_BUILTIN == TME_FLOAT_FORMAT_IEEE754_DOUBLE))
5293   _tme_ieee754_partial_double_abs,
5294 #else  /* !((TME_FLOAT_FORMAT_IEEE754_DOUBLE_BUILTIN == TME_FLOAT_FORMAT_IEEE754_DOUBLE)) */
5295   NULL,
5296 #endif /* !((TME_FLOAT_FORMAT_IEEE754_DOUBLE_BUILTIN == TME_FLOAT_FORMAT_IEEE754_DOUBLE)) */
5297 
5298   /* this does a partial compliance double-precision neg: */
5299 #if ((TME_FLOAT_FORMAT_IEEE754_DOUBLE_BUILTIN == TME_FLOAT_FORMAT_IEEE754_DOUBLE))
5300   _tme_ieee754_partial_double_neg,
5301 #else  /* !((TME_FLOAT_FORMAT_IEEE754_DOUBLE_BUILTIN == TME_FLOAT_FORMAT_IEEE754_DOUBLE)) */
5302   _tme_ieee754_strict_double_neg,
5303 #endif /* !((TME_FLOAT_FORMAT_IEEE754_DOUBLE_BUILTIN == TME_FLOAT_FORMAT_IEEE754_DOUBLE)) */
5304 
5305   /* this does a partial compliance double-precision move: */
5306 #if ((TME_FLOAT_FORMAT_IEEE754_DOUBLE_BUILTIN == TME_FLOAT_FORMAT_IEEE754_DOUBLE))
5307   _tme_ieee754_partial_double_move,
5308 #else  /* !((TME_FLOAT_FORMAT_IEEE754_DOUBLE_BUILTIN == TME_FLOAT_FORMAT_IEEE754_DOUBLE)) */
5309   _tme_ieee754_strict_double_move,
5310 #endif /* !((TME_FLOAT_FORMAT_IEEE754_DOUBLE_BUILTIN == TME_FLOAT_FORMAT_IEEE754_DOUBLE)) */
5311 
5312   /* this does a partial compliance double-precision rint: */
5313   _tme_ieee754_strict_double_rint,
5314 
5315   /* this does a partial compliance double-precision cos: */
5316   NULL,
5317 
5318   /* this does a partial compliance double-precision acos: */
5319   NULL,
5320 
5321   /* this does a partial compliance double-precision cosh: */
5322   NULL,
5323 
5324   /* this does a partial compliance double-precision sin: */
5325   NULL,
5326 
5327   /* this does a partial compliance double-precision asin: */
5328   NULL,
5329 
5330   /* this does a partial compliance double-precision sinh: */
5331   NULL,
5332 
5333   /* this does a partial compliance double-precision tan: */
5334   NULL,
5335 
5336   /* this does a partial compliance double-precision atan: */
5337   NULL,
5338 
5339   /* this does a partial compliance double-precision tanh: */
5340   NULL,
5341 
5342   /* this does a partial compliance double-precision atanh: */
5343   NULL,
5344 
5345   /* this does a partial compliance double-precision exp: */
5346 #if ((TME_FLOAT_FORMAT_IEEE754_DOUBLE_BUILTIN == TME_FLOAT_FORMAT_IEEE754_DOUBLE))
5347   _tme_ieee754_partial_double_exp,
5348 #else  /* !((TME_FLOAT_FORMAT_IEEE754_DOUBLE_BUILTIN == TME_FLOAT_FORMAT_IEEE754_DOUBLE)) */
5349   NULL,
5350 #endif /* !((TME_FLOAT_FORMAT_IEEE754_DOUBLE_BUILTIN == TME_FLOAT_FORMAT_IEEE754_DOUBLE)) */
5351 
5352   /* this does a partial compliance double-precision expm1: */
5353   NULL,
5354 
5355   /* this does a partial compliance double-precision log10: */
5356 #if ((TME_FLOAT_FORMAT_IEEE754_DOUBLE_BUILTIN == TME_FLOAT_FORMAT_IEEE754_DOUBLE))
5357   _tme_ieee754_partial_double_log10,
5358 #else  /* !((TME_FLOAT_FORMAT_IEEE754_DOUBLE_BUILTIN == TME_FLOAT_FORMAT_IEEE754_DOUBLE)) */
5359   NULL,
5360 #endif /* !((TME_FLOAT_FORMAT_IEEE754_DOUBLE_BUILTIN == TME_FLOAT_FORMAT_IEEE754_DOUBLE)) */
5361 
5362   /* this does a partial compliance double-precision log: */
5363 #if ((TME_FLOAT_FORMAT_IEEE754_DOUBLE_BUILTIN == TME_FLOAT_FORMAT_IEEE754_DOUBLE))
5364   _tme_ieee754_partial_double_log,
5365 #else  /* !((TME_FLOAT_FORMAT_IEEE754_DOUBLE_BUILTIN == TME_FLOAT_FORMAT_IEEE754_DOUBLE)) */
5366   NULL,
5367 #endif /* !((TME_FLOAT_FORMAT_IEEE754_DOUBLE_BUILTIN == TME_FLOAT_FORMAT_IEEE754_DOUBLE)) */
5368 
5369   /* this does a partial compliance double-precision log1p: */
5370   NULL,
5371 
5372   /* this does a partial compliance double-precision getexp: */
5373   _tme_ieee754_strict_double_getexp,
5374 
5375   /* this does a partial compliance double-precision getman: */
5376   _tme_ieee754_strict_double_getman,
5377 
5378   /* this does a partial compliance double-precision scale: */
5379 #if ((TME_FLOAT_FORMAT_IEEE754_DOUBLE_BUILTIN == TME_FLOAT_FORMAT_IEEE754_DOUBLE))
5380   _tme_ieee754_partial_double_scale,
5381 #else  /* !((TME_FLOAT_FORMAT_IEEE754_DOUBLE_BUILTIN == TME_FLOAT_FORMAT_IEEE754_DOUBLE)) */
5382   NULL,
5383 #endif /* !((TME_FLOAT_FORMAT_IEEE754_DOUBLE_BUILTIN == TME_FLOAT_FORMAT_IEEE754_DOUBLE)) */
5384 
5385   /* this does a partial compliance double-precision pow: */
5386 #if ((TME_FLOAT_FORMAT_IEEE754_DOUBLE_BUILTIN == TME_FLOAT_FORMAT_IEEE754_DOUBLE))
5387   _tme_ieee754_partial_double_pow,
5388 #else  /* !((TME_FLOAT_FORMAT_IEEE754_DOUBLE_BUILTIN == TME_FLOAT_FORMAT_IEEE754_DOUBLE)) */
5389   NULL,
5390 #endif /* !((TME_FLOAT_FORMAT_IEEE754_DOUBLE_BUILTIN == TME_FLOAT_FORMAT_IEEE754_DOUBLE)) */
5391 
5392   /* this does a partial compliance double-precision from_single: */
5393   _tme_ieee754_strict_double_from_single,
5394 
5395   /* this does a partial compliance double-precision from_extended80: */
5396   _tme_ieee754_strict_double_from_extended80,
5397 
5398   /* this does a partial compliance double-precision from_quad: */
5399   _tme_ieee754_strict_double_from_quad,
5400 
5401   /* this does a partial compliance double-precision from_int32: */
5402   _tme_ieee754_strict_double_from_int32,
5403 
5404   /* this does a partial compliance double-precision from_int64: */
5405 #if (defined(TME_HAVE_INT64_T))
5406   _tme_ieee754_strict_double_from_int64,
5407 #else  /* !(defined(TME_HAVE_INT64_T)) */
5408   NULL,
5409 #endif /* !(defined(TME_HAVE_INT64_T)) */
5410 
5411   /* this does a partial compliance double-precision to_int32: */
5412   _tme_ieee754_strict_double_to_int32,
5413 
5414   /* this does a partial compliance double-precision to_int64: */
5415 #if (defined(TME_HAVE_INT64_T))
5416   _tme_ieee754_strict_double_to_int64,
5417 #else  /* !(defined(TME_HAVE_INT64_T)) */
5418   NULL,
5419 #endif /* !(defined(TME_HAVE_INT64_T)) */
5420 
5421   /* this does a partial compliance extended80-precision add: */
5422 #if ((TME_FLOAT_FORMAT_IEEE754_EXTENDED80_BUILTIN == TME_FLOAT_FORMAT_IEEE754_EXTENDED80))
5423   _tme_ieee754_partial_extended80_add,
5424 #else  /* !((TME_FLOAT_FORMAT_IEEE754_EXTENDED80_BUILTIN == TME_FLOAT_FORMAT_IEEE754_EXTENDED80)) */
5425 #if (defined(TME_HAVE_INT64_T))
5426   _tme_ieee754_strict_extended80_add,
5427 #else  /* !(defined(TME_HAVE_INT64_T)) */
5428   NULL,
5429 #endif /* !(defined(TME_HAVE_INT64_T)) */
5430 #endif /* !((TME_FLOAT_FORMAT_IEEE754_EXTENDED80_BUILTIN == TME_FLOAT_FORMAT_IEEE754_EXTENDED80)) */
5431 
5432   /* this does a partial compliance extended80-precision sub: */
5433 #if ((TME_FLOAT_FORMAT_IEEE754_EXTENDED80_BUILTIN == TME_FLOAT_FORMAT_IEEE754_EXTENDED80))
5434   _tme_ieee754_partial_extended80_sub,
5435 #else  /* !((TME_FLOAT_FORMAT_IEEE754_EXTENDED80_BUILTIN == TME_FLOAT_FORMAT_IEEE754_EXTENDED80)) */
5436 #if (defined(TME_HAVE_INT64_T))
5437   _tme_ieee754_strict_extended80_sub,
5438 #else  /* !(defined(TME_HAVE_INT64_T)) */
5439   NULL,
5440 #endif /* !(defined(TME_HAVE_INT64_T)) */
5441 #endif /* !((TME_FLOAT_FORMAT_IEEE754_EXTENDED80_BUILTIN == TME_FLOAT_FORMAT_IEEE754_EXTENDED80)) */
5442 
5443   /* this does a partial compliance extended80-precision mul: */
5444 #if ((TME_FLOAT_FORMAT_IEEE754_EXTENDED80_BUILTIN == TME_FLOAT_FORMAT_IEEE754_EXTENDED80))
5445   _tme_ieee754_partial_extended80_mul,
5446 #else  /* !((TME_FLOAT_FORMAT_IEEE754_EXTENDED80_BUILTIN == TME_FLOAT_FORMAT_IEEE754_EXTENDED80)) */
5447 #if (defined(TME_HAVE_INT64_T))
5448   _tme_ieee754_strict_extended80_mul,
5449 #else  /* !(defined(TME_HAVE_INT64_T)) */
5450   NULL,
5451 #endif /* !(defined(TME_HAVE_INT64_T)) */
5452 #endif /* !((TME_FLOAT_FORMAT_IEEE754_EXTENDED80_BUILTIN == TME_FLOAT_FORMAT_IEEE754_EXTENDED80)) */
5453 
5454   /* this does a partial compliance extended80-precision div: */
5455 #if ((TME_FLOAT_FORMAT_IEEE754_EXTENDED80_BUILTIN == TME_FLOAT_FORMAT_IEEE754_EXTENDED80))
5456   _tme_ieee754_partial_extended80_div,
5457 #else  /* !((TME_FLOAT_FORMAT_IEEE754_EXTENDED80_BUILTIN == TME_FLOAT_FORMAT_IEEE754_EXTENDED80)) */
5458 #if (defined(TME_HAVE_INT64_T))
5459   _tme_ieee754_strict_extended80_div,
5460 #else  /* !(defined(TME_HAVE_INT64_T)) */
5461   NULL,
5462 #endif /* !(defined(TME_HAVE_INT64_T)) */
5463 #endif /* !((TME_FLOAT_FORMAT_IEEE754_EXTENDED80_BUILTIN == TME_FLOAT_FORMAT_IEEE754_EXTENDED80)) */
5464 
5465   /* this does a partial compliance extended80-precision rem: */
5466 #if (defined(TME_HAVE_INT64_T))
5467   _tme_ieee754_strict_extended80_rem,
5468 #else  /* !(defined(TME_HAVE_INT64_T)) */
5469   NULL,
5470 #endif /* !(defined(TME_HAVE_INT64_T)) */
5471 
5472   /* this does a partial compliance extended80-precision sqrt: */
5473 #if ((TME_FLOAT_FORMAT_IEEE754_EXTENDED80_BUILTIN == TME_FLOAT_FORMAT_IEEE754_EXTENDED80))
5474   _tme_ieee754_partial_extended80_sqrt,
5475 #else  /* !((TME_FLOAT_FORMAT_IEEE754_EXTENDED80_BUILTIN == TME_FLOAT_FORMAT_IEEE754_EXTENDED80)) */
5476 #if (defined(TME_HAVE_INT64_T))
5477   _tme_ieee754_strict_extended80_sqrt,
5478 #else  /* !(defined(TME_HAVE_INT64_T)) */
5479   NULL,
5480 #endif /* !(defined(TME_HAVE_INT64_T)) */
5481 #endif /* !((TME_FLOAT_FORMAT_IEEE754_EXTENDED80_BUILTIN == TME_FLOAT_FORMAT_IEEE754_EXTENDED80)) */
5482 
5483   /* this does a partial compliance extended80-precision abs: */
5484 #if ((TME_FLOAT_FORMAT_IEEE754_EXTENDED80_BUILTIN == TME_FLOAT_FORMAT_IEEE754_EXTENDED80))
5485   _tme_ieee754_partial_extended80_abs,
5486 #else  /* !((TME_FLOAT_FORMAT_IEEE754_EXTENDED80_BUILTIN == TME_FLOAT_FORMAT_IEEE754_EXTENDED80)) */
5487   NULL,
5488 #endif /* !((TME_FLOAT_FORMAT_IEEE754_EXTENDED80_BUILTIN == TME_FLOAT_FORMAT_IEEE754_EXTENDED80)) */
5489 
5490   /* this does a partial compliance extended80-precision neg: */
5491 #if ((TME_FLOAT_FORMAT_IEEE754_EXTENDED80_BUILTIN == TME_FLOAT_FORMAT_IEEE754_EXTENDED80))
5492   _tme_ieee754_partial_extended80_neg,
5493 #else  /* !((TME_FLOAT_FORMAT_IEEE754_EXTENDED80_BUILTIN == TME_FLOAT_FORMAT_IEEE754_EXTENDED80)) */
5494 #if (defined(TME_HAVE_INT64_T))
5495   _tme_ieee754_strict_extended80_neg,
5496 #else  /* !(defined(TME_HAVE_INT64_T)) */
5497   NULL,
5498 #endif /* !(defined(TME_HAVE_INT64_T)) */
5499 #endif /* !((TME_FLOAT_FORMAT_IEEE754_EXTENDED80_BUILTIN == TME_FLOAT_FORMAT_IEEE754_EXTENDED80)) */
5500 
5501   /* this does a partial compliance extended80-precision move: */
5502 #if ((TME_FLOAT_FORMAT_IEEE754_EXTENDED80_BUILTIN == TME_FLOAT_FORMAT_IEEE754_EXTENDED80))
5503   _tme_ieee754_partial_extended80_move,
5504 #else  /* !((TME_FLOAT_FORMAT_IEEE754_EXTENDED80_BUILTIN == TME_FLOAT_FORMAT_IEEE754_EXTENDED80)) */
5505 #if (defined(TME_HAVE_INT64_T))
5506   _tme_ieee754_strict_extended80_move,
5507 #else  /* !(defined(TME_HAVE_INT64_T)) */
5508   NULL,
5509 #endif /* !(defined(TME_HAVE_INT64_T)) */
5510 #endif /* !((TME_FLOAT_FORMAT_IEEE754_EXTENDED80_BUILTIN == TME_FLOAT_FORMAT_IEEE754_EXTENDED80)) */
5511 
5512   /* this does a partial compliance extended80-precision rint: */
5513 #if (defined(TME_HAVE_INT64_T))
5514   _tme_ieee754_strict_extended80_rint,
5515 #else  /* !(defined(TME_HAVE_INT64_T)) */
5516   NULL,
5517 #endif /* !(defined(TME_HAVE_INT64_T)) */
5518 
5519   /* this does a partial compliance extended80-precision cos: */
5520   NULL,
5521 
5522   /* this does a partial compliance extended80-precision acos: */
5523   NULL,
5524 
5525   /* this does a partial compliance extended80-precision cosh: */
5526   NULL,
5527 
5528   /* this does a partial compliance extended80-precision sin: */
5529   NULL,
5530 
5531   /* this does a partial compliance extended80-precision asin: */
5532   NULL,
5533 
5534   /* this does a partial compliance extended80-precision sinh: */
5535   NULL,
5536 
5537   /* this does a partial compliance extended80-precision tan: */
5538   NULL,
5539 
5540   /* this does a partial compliance extended80-precision atan: */
5541   NULL,
5542 
5543   /* this does a partial compliance extended80-precision tanh: */
5544   NULL,
5545 
5546   /* this does a partial compliance extended80-precision atanh: */
5547   NULL,
5548 
5549   /* this does a partial compliance extended80-precision exp: */
5550 #if ((TME_FLOAT_FORMAT_IEEE754_EXTENDED80_BUILTIN == TME_FLOAT_FORMAT_IEEE754_EXTENDED80))
5551   _tme_ieee754_partial_extended80_exp,
5552 #else  /* !((TME_FLOAT_FORMAT_IEEE754_EXTENDED80_BUILTIN == TME_FLOAT_FORMAT_IEEE754_EXTENDED80)) */
5553   NULL,
5554 #endif /* !((TME_FLOAT_FORMAT_IEEE754_EXTENDED80_BUILTIN == TME_FLOAT_FORMAT_IEEE754_EXTENDED80)) */
5555 
5556   /* this does a partial compliance extended80-precision expm1: */
5557   NULL,
5558 
5559   /* this does a partial compliance extended80-precision log10: */
5560 #if ((TME_FLOAT_FORMAT_IEEE754_EXTENDED80_BUILTIN == TME_FLOAT_FORMAT_IEEE754_EXTENDED80))
5561   _tme_ieee754_partial_extended80_log10,
5562 #else  /* !((TME_FLOAT_FORMAT_IEEE754_EXTENDED80_BUILTIN == TME_FLOAT_FORMAT_IEEE754_EXTENDED80)) */
5563   NULL,
5564 #endif /* !((TME_FLOAT_FORMAT_IEEE754_EXTENDED80_BUILTIN == TME_FLOAT_FORMAT_IEEE754_EXTENDED80)) */
5565 
5566   /* this does a partial compliance extended80-precision log: */
5567 #if ((TME_FLOAT_FORMAT_IEEE754_EXTENDED80_BUILTIN == TME_FLOAT_FORMAT_IEEE754_EXTENDED80))
5568   _tme_ieee754_partial_extended80_log,
5569 #else  /* !((TME_FLOAT_FORMAT_IEEE754_EXTENDED80_BUILTIN == TME_FLOAT_FORMAT_IEEE754_EXTENDED80)) */
5570   NULL,
5571 #endif /* !((TME_FLOAT_FORMAT_IEEE754_EXTENDED80_BUILTIN == TME_FLOAT_FORMAT_IEEE754_EXTENDED80)) */
5572 
5573   /* this does a partial compliance extended80-precision log1p: */
5574   NULL,
5575 
5576   /* this does a partial compliance extended80-precision getexp: */
5577   _tme_ieee754_strict_extended80_getexp,
5578 
5579   /* this does a partial compliance extended80-precision getman: */
5580   _tme_ieee754_strict_extended80_getman,
5581 
5582   /* this does a partial compliance extended80-precision scale: */
5583 #if ((TME_FLOAT_FORMAT_IEEE754_EXTENDED80_BUILTIN == TME_FLOAT_FORMAT_IEEE754_EXTENDED80))
5584   _tme_ieee754_partial_extended80_scale,
5585 #else  /* !((TME_FLOAT_FORMAT_IEEE754_EXTENDED80_BUILTIN == TME_FLOAT_FORMAT_IEEE754_EXTENDED80)) */
5586   NULL,
5587 #endif /* !((TME_FLOAT_FORMAT_IEEE754_EXTENDED80_BUILTIN == TME_FLOAT_FORMAT_IEEE754_EXTENDED80)) */
5588 
5589   /* this does a partial compliance extended80-precision pow: */
5590 #if ((TME_FLOAT_FORMAT_IEEE754_EXTENDED80_BUILTIN == TME_FLOAT_FORMAT_IEEE754_EXTENDED80))
5591   _tme_ieee754_partial_extended80_pow,
5592 #else  /* !((TME_FLOAT_FORMAT_IEEE754_EXTENDED80_BUILTIN == TME_FLOAT_FORMAT_IEEE754_EXTENDED80)) */
5593   NULL,
5594 #endif /* !((TME_FLOAT_FORMAT_IEEE754_EXTENDED80_BUILTIN == TME_FLOAT_FORMAT_IEEE754_EXTENDED80)) */
5595 
5596   /* this does a partial compliance extended80-precision from_single: */
5597 #if (defined(TME_HAVE_INT64_T))
5598   _tme_ieee754_strict_extended80_from_single,
5599 #else  /* !(defined(TME_HAVE_INT64_T)) */
5600   NULL,
5601 #endif /* !(defined(TME_HAVE_INT64_T)) */
5602 
5603   /* this does a partial compliance extended80-precision from_double: */
5604 #if (defined(TME_HAVE_INT64_T))
5605   _tme_ieee754_strict_extended80_from_double,
5606 #else  /* !(defined(TME_HAVE_INT64_T)) */
5607   NULL,
5608 #endif /* !(defined(TME_HAVE_INT64_T)) */
5609 
5610   /* this does a partial compliance extended80-precision from_quad: */
5611 #if (defined(TME_HAVE_INT64_T))
5612   _tme_ieee754_strict_extended80_from_quad,
5613 #else  /* !(defined(TME_HAVE_INT64_T)) */
5614   NULL,
5615 #endif /* !(defined(TME_HAVE_INT64_T)) */
5616 
5617   /* this does a partial compliance extended80-precision from_int32: */
5618 #if (defined(TME_HAVE_INT64_T))
5619   _tme_ieee754_strict_extended80_from_int32,
5620 #else  /* !(defined(TME_HAVE_INT64_T)) */
5621   NULL,
5622 #endif /* !(defined(TME_HAVE_INT64_T)) */
5623 
5624   /* this does a partial compliance extended80-precision from_int64: */
5625 #if (defined(TME_HAVE_INT64_T))
5626   _tme_ieee754_strict_extended80_from_int64,
5627 #else  /* !(defined(TME_HAVE_INT64_T)) */
5628   NULL,
5629 #endif /* !(defined(TME_HAVE_INT64_T)) */
5630 
5631   /* this does a partial compliance extended80-precision to_int32: */
5632   _tme_ieee754_strict_extended80_to_int32,
5633 
5634   /* this does a partial compliance extended80-precision to_int64: */
5635 #if (defined(TME_HAVE_INT64_T))
5636   _tme_ieee754_strict_extended80_to_int64,
5637 #else  /* !(defined(TME_HAVE_INT64_T)) */
5638   NULL,
5639 #endif /* !(defined(TME_HAVE_INT64_T)) */
5640 
5641   /* this does a partial compliance quad-precision add: */
5642 #if ((TME_FLOAT_FORMAT_IEEE754_QUAD_BUILTIN == TME_FLOAT_FORMAT_IEEE754_QUAD))
5643   _tme_ieee754_partial_quad_add,
5644 #else  /* !((TME_FLOAT_FORMAT_IEEE754_QUAD_BUILTIN == TME_FLOAT_FORMAT_IEEE754_QUAD)) */
5645 #if (defined(TME_HAVE_INT64_T))
5646   _tme_ieee754_strict_quad_add,
5647 #else  /* !(defined(TME_HAVE_INT64_T)) */
5648   NULL,
5649 #endif /* !(defined(TME_HAVE_INT64_T)) */
5650 #endif /* !((TME_FLOAT_FORMAT_IEEE754_QUAD_BUILTIN == TME_FLOAT_FORMAT_IEEE754_QUAD)) */
5651 
5652   /* this does a partial compliance quad-precision sub: */
5653 #if ((TME_FLOAT_FORMAT_IEEE754_QUAD_BUILTIN == TME_FLOAT_FORMAT_IEEE754_QUAD))
5654   _tme_ieee754_partial_quad_sub,
5655 #else  /* !((TME_FLOAT_FORMAT_IEEE754_QUAD_BUILTIN == TME_FLOAT_FORMAT_IEEE754_QUAD)) */
5656 #if (defined(TME_HAVE_INT64_T))
5657   _tme_ieee754_strict_quad_sub,
5658 #else  /* !(defined(TME_HAVE_INT64_T)) */
5659   NULL,
5660 #endif /* !(defined(TME_HAVE_INT64_T)) */
5661 #endif /* !((TME_FLOAT_FORMAT_IEEE754_QUAD_BUILTIN == TME_FLOAT_FORMAT_IEEE754_QUAD)) */
5662 
5663   /* this does a partial compliance quad-precision mul: */
5664 #if ((TME_FLOAT_FORMAT_IEEE754_QUAD_BUILTIN == TME_FLOAT_FORMAT_IEEE754_QUAD))
5665   _tme_ieee754_partial_quad_mul,
5666 #else  /* !((TME_FLOAT_FORMAT_IEEE754_QUAD_BUILTIN == TME_FLOAT_FORMAT_IEEE754_QUAD)) */
5667 #if (defined(TME_HAVE_INT64_T))
5668   _tme_ieee754_strict_quad_mul,
5669 #else  /* !(defined(TME_HAVE_INT64_T)) */
5670   NULL,
5671 #endif /* !(defined(TME_HAVE_INT64_T)) */
5672 #endif /* !((TME_FLOAT_FORMAT_IEEE754_QUAD_BUILTIN == TME_FLOAT_FORMAT_IEEE754_QUAD)) */
5673 
5674   /* this does a partial compliance quad-precision div: */
5675 #if ((TME_FLOAT_FORMAT_IEEE754_QUAD_BUILTIN == TME_FLOAT_FORMAT_IEEE754_QUAD))
5676   _tme_ieee754_partial_quad_div,
5677 #else  /* !((TME_FLOAT_FORMAT_IEEE754_QUAD_BUILTIN == TME_FLOAT_FORMAT_IEEE754_QUAD)) */
5678 #if (defined(TME_HAVE_INT64_T))
5679   _tme_ieee754_strict_quad_div,
5680 #else  /* !(defined(TME_HAVE_INT64_T)) */
5681   NULL,
5682 #endif /* !(defined(TME_HAVE_INT64_T)) */
5683 #endif /* !((TME_FLOAT_FORMAT_IEEE754_QUAD_BUILTIN == TME_FLOAT_FORMAT_IEEE754_QUAD)) */
5684 
5685   /* this does a partial compliance quad-precision rem: */
5686 #if (defined(TME_HAVE_INT64_T))
5687   _tme_ieee754_strict_quad_rem,
5688 #else  /* !(defined(TME_HAVE_INT64_T)) */
5689   NULL,
5690 #endif /* !(defined(TME_HAVE_INT64_T)) */
5691 
5692   /* this does a partial compliance quad-precision sqrt: */
5693 #if ((TME_FLOAT_FORMAT_IEEE754_QUAD_BUILTIN == TME_FLOAT_FORMAT_IEEE754_QUAD))
5694   _tme_ieee754_partial_quad_sqrt,
5695 #else  /* !((TME_FLOAT_FORMAT_IEEE754_QUAD_BUILTIN == TME_FLOAT_FORMAT_IEEE754_QUAD)) */
5696 #if (defined(TME_HAVE_INT64_T))
5697   _tme_ieee754_strict_quad_sqrt,
5698 #else  /* !(defined(TME_HAVE_INT64_T)) */
5699   NULL,
5700 #endif /* !(defined(TME_HAVE_INT64_T)) */
5701 #endif /* !((TME_FLOAT_FORMAT_IEEE754_QUAD_BUILTIN == TME_FLOAT_FORMAT_IEEE754_QUAD)) */
5702 
5703   /* this does a partial compliance quad-precision abs: */
5704 #if ((TME_FLOAT_FORMAT_IEEE754_QUAD_BUILTIN == TME_FLOAT_FORMAT_IEEE754_QUAD))
5705   _tme_ieee754_partial_quad_abs,
5706 #else  /* !((TME_FLOAT_FORMAT_IEEE754_QUAD_BUILTIN == TME_FLOAT_FORMAT_IEEE754_QUAD)) */
5707   NULL,
5708 #endif /* !((TME_FLOAT_FORMAT_IEEE754_QUAD_BUILTIN == TME_FLOAT_FORMAT_IEEE754_QUAD)) */
5709 
5710   /* this does a partial compliance quad-precision neg: */
5711 #if ((TME_FLOAT_FORMAT_IEEE754_QUAD_BUILTIN == TME_FLOAT_FORMAT_IEEE754_QUAD))
5712   _tme_ieee754_partial_quad_neg,
5713 #else  /* !((TME_FLOAT_FORMAT_IEEE754_QUAD_BUILTIN == TME_FLOAT_FORMAT_IEEE754_QUAD)) */
5714 #if (defined(TME_HAVE_INT64_T))
5715   _tme_ieee754_strict_quad_neg,
5716 #else  /* !(defined(TME_HAVE_INT64_T)) */
5717   NULL,
5718 #endif /* !(defined(TME_HAVE_INT64_T)) */
5719 #endif /* !((TME_FLOAT_FORMAT_IEEE754_QUAD_BUILTIN == TME_FLOAT_FORMAT_IEEE754_QUAD)) */
5720 
5721   /* this does a partial compliance quad-precision move: */
5722 #if ((TME_FLOAT_FORMAT_IEEE754_QUAD_BUILTIN == TME_FLOAT_FORMAT_IEEE754_QUAD))
5723   _tme_ieee754_partial_quad_move,
5724 #else  /* !((TME_FLOAT_FORMAT_IEEE754_QUAD_BUILTIN == TME_FLOAT_FORMAT_IEEE754_QUAD)) */
5725 #if (defined(TME_HAVE_INT64_T))
5726   _tme_ieee754_strict_quad_move,
5727 #else  /* !(defined(TME_HAVE_INT64_T)) */
5728   NULL,
5729 #endif /* !(defined(TME_HAVE_INT64_T)) */
5730 #endif /* !((TME_FLOAT_FORMAT_IEEE754_QUAD_BUILTIN == TME_FLOAT_FORMAT_IEEE754_QUAD)) */
5731 
5732   /* this does a partial compliance quad-precision rint: */
5733 #if (defined(TME_HAVE_INT64_T))
5734   _tme_ieee754_strict_quad_rint,
5735 #else  /* !(defined(TME_HAVE_INT64_T)) */
5736   NULL,
5737 #endif /* !(defined(TME_HAVE_INT64_T)) */
5738 
5739   /* this does a partial compliance quad-precision cos: */
5740   NULL,
5741 
5742   /* this does a partial compliance quad-precision acos: */
5743   NULL,
5744 
5745   /* this does a partial compliance quad-precision cosh: */
5746   NULL,
5747 
5748   /* this does a partial compliance quad-precision sin: */
5749   NULL,
5750 
5751   /* this does a partial compliance quad-precision asin: */
5752   NULL,
5753 
5754   /* this does a partial compliance quad-precision sinh: */
5755   NULL,
5756 
5757   /* this does a partial compliance quad-precision tan: */
5758   NULL,
5759 
5760   /* this does a partial compliance quad-precision atan: */
5761   NULL,
5762 
5763   /* this does a partial compliance quad-precision tanh: */
5764   NULL,
5765 
5766   /* this does a partial compliance quad-precision atanh: */
5767   NULL,
5768 
5769   /* this does a partial compliance quad-precision exp: */
5770 #if ((TME_FLOAT_FORMAT_IEEE754_QUAD_BUILTIN == TME_FLOAT_FORMAT_IEEE754_QUAD))
5771   _tme_ieee754_partial_quad_exp,
5772 #else  /* !((TME_FLOAT_FORMAT_IEEE754_QUAD_BUILTIN == TME_FLOAT_FORMAT_IEEE754_QUAD)) */
5773   NULL,
5774 #endif /* !((TME_FLOAT_FORMAT_IEEE754_QUAD_BUILTIN == TME_FLOAT_FORMAT_IEEE754_QUAD)) */
5775 
5776   /* this does a partial compliance quad-precision expm1: */
5777   NULL,
5778 
5779   /* this does a partial compliance quad-precision log10: */
5780 #if ((TME_FLOAT_FORMAT_IEEE754_QUAD_BUILTIN == TME_FLOAT_FORMAT_IEEE754_QUAD))
5781   _tme_ieee754_partial_quad_log10,
5782 #else  /* !((TME_FLOAT_FORMAT_IEEE754_QUAD_BUILTIN == TME_FLOAT_FORMAT_IEEE754_QUAD)) */
5783   NULL,
5784 #endif /* !((TME_FLOAT_FORMAT_IEEE754_QUAD_BUILTIN == TME_FLOAT_FORMAT_IEEE754_QUAD)) */
5785 
5786   /* this does a partial compliance quad-precision log: */
5787 #if ((TME_FLOAT_FORMAT_IEEE754_QUAD_BUILTIN == TME_FLOAT_FORMAT_IEEE754_QUAD))
5788   _tme_ieee754_partial_quad_log,
5789 #else  /* !((TME_FLOAT_FORMAT_IEEE754_QUAD_BUILTIN == TME_FLOAT_FORMAT_IEEE754_QUAD)) */
5790   NULL,
5791 #endif /* !((TME_FLOAT_FORMAT_IEEE754_QUAD_BUILTIN == TME_FLOAT_FORMAT_IEEE754_QUAD)) */
5792 
5793   /* this does a partial compliance quad-precision log1p: */
5794   NULL,
5795 
5796   /* this does a partial compliance quad-precision getexp: */
5797   _tme_ieee754_strict_quad_getexp,
5798 
5799   /* this does a partial compliance quad-precision getman: */
5800   _tme_ieee754_strict_quad_getman,
5801 
5802   /* this does a partial compliance quad-precision scale: */
5803 #if ((TME_FLOAT_FORMAT_IEEE754_QUAD_BUILTIN == TME_FLOAT_FORMAT_IEEE754_QUAD))
5804   _tme_ieee754_partial_quad_scale,
5805 #else  /* !((TME_FLOAT_FORMAT_IEEE754_QUAD_BUILTIN == TME_FLOAT_FORMAT_IEEE754_QUAD)) */
5806   NULL,
5807 #endif /* !((TME_FLOAT_FORMAT_IEEE754_QUAD_BUILTIN == TME_FLOAT_FORMAT_IEEE754_QUAD)) */
5808 
5809   /* this does a partial compliance quad-precision pow: */
5810 #if ((TME_FLOAT_FORMAT_IEEE754_QUAD_BUILTIN == TME_FLOAT_FORMAT_IEEE754_QUAD))
5811   _tme_ieee754_partial_quad_pow,
5812 #else  /* !((TME_FLOAT_FORMAT_IEEE754_QUAD_BUILTIN == TME_FLOAT_FORMAT_IEEE754_QUAD)) */
5813   NULL,
5814 #endif /* !((TME_FLOAT_FORMAT_IEEE754_QUAD_BUILTIN == TME_FLOAT_FORMAT_IEEE754_QUAD)) */
5815 
5816   /* this does a partial compliance quad-precision from_single: */
5817 #if (defined(TME_HAVE_INT64_T))
5818   _tme_ieee754_strict_quad_from_single,
5819 #else  /* !(defined(TME_HAVE_INT64_T)) */
5820   NULL,
5821 #endif /* !(defined(TME_HAVE_INT64_T)) */
5822 
5823   /* this does a partial compliance quad-precision from_double: */
5824 #if (defined(TME_HAVE_INT64_T))
5825   _tme_ieee754_strict_quad_from_double,
5826 #else  /* !(defined(TME_HAVE_INT64_T)) */
5827   NULL,
5828 #endif /* !(defined(TME_HAVE_INT64_T)) */
5829 
5830   /* this does a partial compliance quad-precision from_extended80: */
5831 #if (defined(TME_HAVE_INT64_T))
5832   _tme_ieee754_strict_quad_from_extended80,
5833 #else  /* !(defined(TME_HAVE_INT64_T)) */
5834   NULL,
5835 #endif /* !(defined(TME_HAVE_INT64_T)) */
5836 
5837   /* this does a partial compliance quad-precision from_int32: */
5838 #if (defined(TME_HAVE_INT64_T))
5839   _tme_ieee754_strict_quad_from_int32,
5840 #else  /* !(defined(TME_HAVE_INT64_T)) */
5841   NULL,
5842 #endif /* !(defined(TME_HAVE_INT64_T)) */
5843 
5844   /* this does a partial compliance quad-precision from_int64: */
5845 #if (defined(TME_HAVE_INT64_T))
5846   _tme_ieee754_strict_quad_from_int64,
5847 #else  /* !(defined(TME_HAVE_INT64_T)) */
5848   NULL,
5849 #endif /* !(defined(TME_HAVE_INT64_T)) */
5850 
5851   /* this does a partial compliance quad-precision to_int32: */
5852   _tme_ieee754_strict_quad_to_int32,
5853 
5854   /* this does a partial compliance quad-precision to_int64: */
5855 #if (defined(TME_HAVE_INT64_T))
5856   _tme_ieee754_strict_quad_to_int64,
5857 #else  /* !(defined(TME_HAVE_INT64_T)) */
5858   NULL,
5859 #endif /* !(defined(TME_HAVE_INT64_T)) */
5860 };
5861 
5862 /* this does a unknown compliance single-precision add: */
5863 static void
_tme_ieee754_unknown_single_add(struct tme_ieee754_ctl * ieee754_ctl,const struct tme_float * src0,const struct tme_float * src1,struct tme_float * dst)5864 _tme_ieee754_unknown_single_add(struct tme_ieee754_ctl *ieee754_ctl, const struct tme_float *src0, const struct tme_float *src1, struct tme_float *dst)
5865 {
5866   int exceptions;
5867 
5868   /* assume that this operation raises no exceptions: */
5869   exceptions = 0;
5870 
5871   /* the operation: */
5872   tme_ieee754_single_value_builtin_set(dst, TME_FLOAT_FORMAT_IEEE754_SINGLE_BUILTIN, tme_ieee754_single_value_builtin_get(src0) + tme_ieee754_single_value_builtin_get(src1));
5873   ieee754_ctl->tme_ieee754_ctl_lock_unlock = NULL;
5874 
5875   /* signal any exceptions: */
5876   if (exceptions != 0) {
5877     (*ieee754_ctl->tme_ieee754_ctl_exception)(ieee754_ctl, exceptions);
5878   }
5879 }
5880 
5881 /* this does a unknown compliance single-precision sub: */
5882 static void
_tme_ieee754_unknown_single_sub(struct tme_ieee754_ctl * ieee754_ctl,const struct tme_float * src0,const struct tme_float * src1,struct tme_float * dst)5883 _tme_ieee754_unknown_single_sub(struct tme_ieee754_ctl *ieee754_ctl, const struct tme_float *src0, const struct tme_float *src1, struct tme_float *dst)
5884 {
5885   int exceptions;
5886 
5887   /* assume that this operation raises no exceptions: */
5888   exceptions = 0;
5889 
5890   /* the operation: */
5891   tme_ieee754_single_value_builtin_set(dst, TME_FLOAT_FORMAT_IEEE754_SINGLE_BUILTIN, tme_ieee754_single_value_builtin_get(src0) - tme_ieee754_single_value_builtin_get(src1));
5892   ieee754_ctl->tme_ieee754_ctl_lock_unlock = NULL;
5893 
5894   /* signal any exceptions: */
5895   if (exceptions != 0) {
5896     (*ieee754_ctl->tme_ieee754_ctl_exception)(ieee754_ctl, exceptions);
5897   }
5898 }
5899 
5900 /* this does a unknown compliance single-precision mul: */
5901 static void
_tme_ieee754_unknown_single_mul(struct tme_ieee754_ctl * ieee754_ctl,const struct tme_float * src0,const struct tme_float * src1,struct tme_float * dst)5902 _tme_ieee754_unknown_single_mul(struct tme_ieee754_ctl *ieee754_ctl, const struct tme_float *src0, const struct tme_float *src1, struct tme_float *dst)
5903 {
5904   int exceptions;
5905 
5906   /* assume that this operation raises no exceptions: */
5907   exceptions = 0;
5908 
5909   /* the operation: */
5910   tme_ieee754_single_value_builtin_set(dst, TME_FLOAT_FORMAT_IEEE754_SINGLE_BUILTIN, tme_ieee754_single_value_builtin_get(src0) * tme_ieee754_single_value_builtin_get(src1));
5911   ieee754_ctl->tme_ieee754_ctl_lock_unlock = NULL;
5912 
5913   /* signal any exceptions: */
5914   if (exceptions != 0) {
5915     (*ieee754_ctl->tme_ieee754_ctl_exception)(ieee754_ctl, exceptions);
5916   }
5917 }
5918 
5919 /* this does a unknown compliance single-precision div: */
5920 static void
_tme_ieee754_unknown_single_div(struct tme_ieee754_ctl * ieee754_ctl,const struct tme_float * src0,const struct tme_float * src1,struct tme_float * dst)5921 _tme_ieee754_unknown_single_div(struct tme_ieee754_ctl *ieee754_ctl, const struct tme_float *src0, const struct tme_float *src1, struct tme_float *dst)
5922 {
5923   int exceptions;
5924 
5925   /* assume that this operation raises no exceptions: */
5926   exceptions = 0;
5927 
5928   /* the operation: */
5929   tme_ieee754_single_value_builtin_set(dst, TME_FLOAT_FORMAT_IEEE754_SINGLE_BUILTIN, tme_ieee754_single_value_builtin_get(src0) / tme_ieee754_single_value_builtin_get(src1));
5930   ieee754_ctl->tme_ieee754_ctl_lock_unlock = NULL;
5931 
5932   /* signal any exceptions: */
5933   if (exceptions != 0) {
5934     (*ieee754_ctl->tme_ieee754_ctl_exception)(ieee754_ctl, exceptions);
5935   }
5936 }
5937 
5938 /* this does a unknown compliance single-precision sqrt: */
5939 static void
_tme_ieee754_unknown_single_sqrt(struct tme_ieee754_ctl * ieee754_ctl,const struct tme_float * src0,struct tme_float * dst)5940 _tme_ieee754_unknown_single_sqrt(struct tme_ieee754_ctl *ieee754_ctl, const struct tme_float *src0, struct tme_float *dst)
5941 {
5942   int exceptions;
5943 
5944   /* assume that this operation raises no exceptions: */
5945   exceptions = 0;
5946 
5947   /* the operation: */
5948 #if (TME_FLOAT_FORMAT_IEEE754_SINGLE_BUILTIN == TME_FLOAT_FORMAT_FLOAT)
5949   tme_ieee754_single_value_builtin_set(dst, TME_FLOAT_FORMAT_FLOAT, sqrtf(tme_ieee754_single_value_builtin_get(src0)));
5950 #else  /* (TME_FLOAT_FORMAT_IEEE754_SINGLE_BUILTIN != TME_FLOAT_FORMAT_FLOAT) */
5951   tme_ieee754_single_value_builtin_set(dst, TME_FLOAT_FORMAT_DOUBLE, sqrt(tme_ieee754_single_value_builtin_get(src0)));
5952 #endif /* (TME_FLOAT_FORMAT_IEEE754_SINGLE_BUILTIN != TME_FLOAT_FORMAT_FLOAT) */
5953   ieee754_ctl->tme_ieee754_ctl_lock_unlock = NULL;
5954 
5955   /* signal any exceptions: */
5956   if (exceptions != 0) {
5957     (*ieee754_ctl->tme_ieee754_ctl_exception)(ieee754_ctl, exceptions);
5958   }
5959 }
5960 
5961 /* this does a unknown compliance single-precision abs: */
5962 static void
_tme_ieee754_unknown_single_abs(struct tme_ieee754_ctl * ieee754_ctl,const struct tme_float * src0,struct tme_float * dst)5963 _tme_ieee754_unknown_single_abs(struct tme_ieee754_ctl *ieee754_ctl, const struct tme_float *src0, struct tme_float *dst)
5964 {
5965   int exceptions;
5966 
5967   /* assume that this operation raises no exceptions: */
5968   exceptions = 0;
5969 
5970   /* the operation: */
5971 #if (TME_FLOAT_FORMAT_IEEE754_SINGLE_BUILTIN == TME_FLOAT_FORMAT_FLOAT)
5972   tme_ieee754_single_value_builtin_set(dst, TME_FLOAT_FORMAT_FLOAT, fabsf(tme_ieee754_single_value_builtin_get(src0)));
5973 #else  /* (TME_FLOAT_FORMAT_IEEE754_SINGLE_BUILTIN != TME_FLOAT_FORMAT_FLOAT) */
5974   tme_ieee754_single_value_builtin_set(dst, TME_FLOAT_FORMAT_DOUBLE, fabs(tme_ieee754_single_value_builtin_get(src0)));
5975 #endif /* (TME_FLOAT_FORMAT_IEEE754_SINGLE_BUILTIN != TME_FLOAT_FORMAT_FLOAT) */
5976   ieee754_ctl->tme_ieee754_ctl_lock_unlock = NULL;
5977 
5978   /* signal any exceptions: */
5979   if (exceptions != 0) {
5980     (*ieee754_ctl->tme_ieee754_ctl_exception)(ieee754_ctl, exceptions);
5981   }
5982 }
5983 
5984 /* this does a unknown compliance single-precision neg: */
5985 static void
_tme_ieee754_unknown_single_neg(struct tme_ieee754_ctl * ieee754_ctl,const struct tme_float * src0,struct tme_float * dst)5986 _tme_ieee754_unknown_single_neg(struct tme_ieee754_ctl *ieee754_ctl, const struct tme_float *src0, struct tme_float *dst)
5987 {
5988   int exceptions;
5989 
5990   /* assume that this operation raises no exceptions: */
5991   exceptions = 0;
5992 
5993   /* the operation: */
5994   tme_ieee754_single_value_builtin_set(dst, TME_FLOAT_FORMAT_IEEE754_SINGLE_BUILTIN, -1 * tme_ieee754_single_value_builtin_get(src0));
5995   ieee754_ctl->tme_ieee754_ctl_lock_unlock = NULL;
5996 
5997   /* signal any exceptions: */
5998   if (exceptions != 0) {
5999     (*ieee754_ctl->tme_ieee754_ctl_exception)(ieee754_ctl, exceptions);
6000   }
6001 }
6002 
6003 /* this does a unknown compliance single-precision move: */
6004 static void
_tme_ieee754_unknown_single_move(struct tme_ieee754_ctl * ieee754_ctl,const struct tme_float * src0,struct tme_float * dst)6005 _tme_ieee754_unknown_single_move(struct tme_ieee754_ctl *ieee754_ctl, const struct tme_float *src0, struct tme_float *dst)
6006 {
6007   int exceptions;
6008 
6009   /* assume that this operation raises no exceptions: */
6010   exceptions = 0;
6011 
6012   /* the operation: */
6013   *dst = *src0;
6014   ieee754_ctl->tme_ieee754_ctl_lock_unlock = NULL;
6015 
6016   /* signal any exceptions: */
6017   if (exceptions != 0) {
6018     (*ieee754_ctl->tme_ieee754_ctl_exception)(ieee754_ctl, exceptions);
6019   }
6020 }
6021 
6022 /* this does a unknown compliance single-precision exp: */
6023 static void
_tme_ieee754_unknown_single_exp(struct tme_ieee754_ctl * ieee754_ctl,const struct tme_float * src0,struct tme_float * dst)6024 _tme_ieee754_unknown_single_exp(struct tme_ieee754_ctl *ieee754_ctl, const struct tme_float *src0, struct tme_float *dst)
6025 {
6026   int exceptions;
6027 
6028   /* assume that this operation raises no exceptions: */
6029   exceptions = 0;
6030 
6031   /* the operation: */
6032 #if (TME_FLOAT_FORMAT_IEEE754_SINGLE_BUILTIN == TME_FLOAT_FORMAT_FLOAT)
6033   tme_ieee754_single_value_builtin_set(dst, TME_FLOAT_FORMAT_FLOAT, expf(tme_ieee754_single_value_builtin_get(src0)));
6034 #else  /* (TME_FLOAT_FORMAT_IEEE754_SINGLE_BUILTIN != TME_FLOAT_FORMAT_FLOAT) */
6035   tme_ieee754_single_value_builtin_set(dst, TME_FLOAT_FORMAT_DOUBLE, exp(tme_ieee754_single_value_builtin_get(src0)));
6036 #endif /* (TME_FLOAT_FORMAT_IEEE754_SINGLE_BUILTIN != TME_FLOAT_FORMAT_FLOAT) */
6037   ieee754_ctl->tme_ieee754_ctl_lock_unlock = NULL;
6038 
6039   /* signal any exceptions: */
6040   if (exceptions != 0) {
6041     (*ieee754_ctl->tme_ieee754_ctl_exception)(ieee754_ctl, exceptions);
6042   }
6043 }
6044 
6045 /* this does a unknown compliance single-precision log10: */
6046 static void
_tme_ieee754_unknown_single_log10(struct tme_ieee754_ctl * ieee754_ctl,const struct tme_float * src0,struct tme_float * dst)6047 _tme_ieee754_unknown_single_log10(struct tme_ieee754_ctl *ieee754_ctl, const struct tme_float *src0, struct tme_float *dst)
6048 {
6049   int exceptions;
6050 
6051   /* assume that this operation raises no exceptions: */
6052   exceptions = 0;
6053 
6054   /* the operation: */
6055 #if (TME_FLOAT_FORMAT_IEEE754_SINGLE_BUILTIN == TME_FLOAT_FORMAT_FLOAT)
6056   tme_ieee754_single_value_builtin_set(dst, TME_FLOAT_FORMAT_FLOAT, log10f(tme_ieee754_single_value_builtin_get(src0)));
6057 #else  /* (TME_FLOAT_FORMAT_IEEE754_SINGLE_BUILTIN != TME_FLOAT_FORMAT_FLOAT) */
6058   tme_ieee754_single_value_builtin_set(dst, TME_FLOAT_FORMAT_DOUBLE, log10(tme_ieee754_single_value_builtin_get(src0)));
6059 #endif /* (TME_FLOAT_FORMAT_IEEE754_SINGLE_BUILTIN != TME_FLOAT_FORMAT_FLOAT) */
6060   ieee754_ctl->tme_ieee754_ctl_lock_unlock = NULL;
6061 
6062   /* signal any exceptions: */
6063   if (exceptions != 0) {
6064     (*ieee754_ctl->tme_ieee754_ctl_exception)(ieee754_ctl, exceptions);
6065   }
6066 }
6067 
6068 /* this does a unknown compliance single-precision log: */
6069 static void
_tme_ieee754_unknown_single_log(struct tme_ieee754_ctl * ieee754_ctl,const struct tme_float * src0,struct tme_float * dst)6070 _tme_ieee754_unknown_single_log(struct tme_ieee754_ctl *ieee754_ctl, const struct tme_float *src0, struct tme_float *dst)
6071 {
6072   int exceptions;
6073 
6074   /* assume that this operation raises no exceptions: */
6075   exceptions = 0;
6076 
6077   /* the operation: */
6078 #if (TME_FLOAT_FORMAT_IEEE754_SINGLE_BUILTIN == TME_FLOAT_FORMAT_FLOAT)
6079   tme_ieee754_single_value_builtin_set(dst, TME_FLOAT_FORMAT_FLOAT, logf(tme_ieee754_single_value_builtin_get(src0)));
6080 #else  /* (TME_FLOAT_FORMAT_IEEE754_SINGLE_BUILTIN != TME_FLOAT_FORMAT_FLOAT) */
6081   tme_ieee754_single_value_builtin_set(dst, TME_FLOAT_FORMAT_DOUBLE, log(tme_ieee754_single_value_builtin_get(src0)));
6082 #endif /* (TME_FLOAT_FORMAT_IEEE754_SINGLE_BUILTIN != TME_FLOAT_FORMAT_FLOAT) */
6083   ieee754_ctl->tme_ieee754_ctl_lock_unlock = NULL;
6084 
6085   /* signal any exceptions: */
6086   if (exceptions != 0) {
6087     (*ieee754_ctl->tme_ieee754_ctl_exception)(ieee754_ctl, exceptions);
6088   }
6089 }
6090 
6091 /* this does a unknown compliance single-precision scale: */
6092 static void
_tme_ieee754_unknown_single_scale(struct tme_ieee754_ctl * ieee754_ctl,const struct tme_float * src0,const struct tme_float * src1,struct tme_float * dst)6093 _tme_ieee754_unknown_single_scale(struct tme_ieee754_ctl *ieee754_ctl, const struct tme_float *src0, const struct tme_float *src1, struct tme_float *dst)
6094 {
6095   int exceptions;
6096 
6097   /* assume that this operation raises no exceptions: */
6098   exceptions = 0;
6099 
6100   /* the operation: */
6101 #if (TME_FLOAT_FORMAT_IEEE754_SINGLE_BUILTIN == TME_FLOAT_FORMAT_FLOAT)
6102   tme_ieee754_single_value_builtin_set(dst, TME_FLOAT_FORMAT_FLOAT, scalbnf(tme_ieee754_single_value_builtin_get(src0), tme_ieee754_single_value_builtin_get(src1)));
6103 #else  /* (TME_FLOAT_FORMAT_IEEE754_SINGLE_BUILTIN != TME_FLOAT_FORMAT_FLOAT) */
6104   tme_ieee754_single_value_builtin_set(dst, TME_FLOAT_FORMAT_DOUBLE, scalbn(tme_ieee754_single_value_builtin_get(src0), tme_ieee754_single_value_builtin_get(src1)));
6105 #endif /* (TME_FLOAT_FORMAT_IEEE754_SINGLE_BUILTIN != TME_FLOAT_FORMAT_FLOAT) */
6106   ieee754_ctl->tme_ieee754_ctl_lock_unlock = NULL;
6107 
6108   /* signal any exceptions: */
6109   if (exceptions != 0) {
6110     (*ieee754_ctl->tme_ieee754_ctl_exception)(ieee754_ctl, exceptions);
6111   }
6112 }
6113 
6114 /* this does a unknown compliance single-precision pow: */
6115 static void
_tme_ieee754_unknown_single_pow(struct tme_ieee754_ctl * ieee754_ctl,const struct tme_float * src0,const struct tme_float * src1,struct tme_float * dst)6116 _tme_ieee754_unknown_single_pow(struct tme_ieee754_ctl *ieee754_ctl, const struct tme_float *src0, const struct tme_float *src1, struct tme_float *dst)
6117 {
6118   int exceptions;
6119 
6120   /* assume that this operation raises no exceptions: */
6121   exceptions = 0;
6122 
6123   /* the operation: */
6124 #if (TME_FLOAT_FORMAT_IEEE754_SINGLE_BUILTIN == TME_FLOAT_FORMAT_FLOAT)
6125   tme_ieee754_single_value_builtin_set(dst, TME_FLOAT_FORMAT_FLOAT, powf(tme_ieee754_single_value_builtin_get(src0), tme_ieee754_single_value_builtin_get(src1)));
6126 #else  /* (TME_FLOAT_FORMAT_IEEE754_SINGLE_BUILTIN != TME_FLOAT_FORMAT_FLOAT) */
6127   tme_ieee754_single_value_builtin_set(dst, TME_FLOAT_FORMAT_DOUBLE, pow(tme_ieee754_single_value_builtin_get(src0), tme_ieee754_single_value_builtin_get(src1)));
6128 #endif /* (TME_FLOAT_FORMAT_IEEE754_SINGLE_BUILTIN != TME_FLOAT_FORMAT_FLOAT) */
6129   ieee754_ctl->tme_ieee754_ctl_lock_unlock = NULL;
6130 
6131   /* signal any exceptions: */
6132   if (exceptions != 0) {
6133     (*ieee754_ctl->tme_ieee754_ctl_exception)(ieee754_ctl, exceptions);
6134   }
6135 }
6136 
6137 /* this does a unknown compliance double-precision add: */
6138 static void
_tme_ieee754_unknown_double_add(struct tme_ieee754_ctl * ieee754_ctl,const struct tme_float * src0,const struct tme_float * src1,struct tme_float * dst)6139 _tme_ieee754_unknown_double_add(struct tme_ieee754_ctl *ieee754_ctl, const struct tme_float *src0, const struct tme_float *src1, struct tme_float *dst)
6140 {
6141   int exceptions;
6142 
6143   /* assume that this operation raises no exceptions: */
6144   exceptions = 0;
6145 
6146   /* the operation: */
6147   tme_ieee754_double_value_builtin_set(dst, TME_FLOAT_FORMAT_IEEE754_DOUBLE_BUILTIN, tme_ieee754_double_value_builtin_get(src0) + tme_ieee754_double_value_builtin_get(src1));
6148   ieee754_ctl->tme_ieee754_ctl_lock_unlock = NULL;
6149 
6150   /* signal any exceptions: */
6151   if (exceptions != 0) {
6152     (*ieee754_ctl->tme_ieee754_ctl_exception)(ieee754_ctl, exceptions);
6153   }
6154 }
6155 
6156 /* this does a unknown compliance double-precision sub: */
6157 static void
_tme_ieee754_unknown_double_sub(struct tme_ieee754_ctl * ieee754_ctl,const struct tme_float * src0,const struct tme_float * src1,struct tme_float * dst)6158 _tme_ieee754_unknown_double_sub(struct tme_ieee754_ctl *ieee754_ctl, const struct tme_float *src0, const struct tme_float *src1, struct tme_float *dst)
6159 {
6160   int exceptions;
6161 
6162   /* assume that this operation raises no exceptions: */
6163   exceptions = 0;
6164 
6165   /* the operation: */
6166   tme_ieee754_double_value_builtin_set(dst, TME_FLOAT_FORMAT_IEEE754_DOUBLE_BUILTIN, tme_ieee754_double_value_builtin_get(src0) - tme_ieee754_double_value_builtin_get(src1));
6167   ieee754_ctl->tme_ieee754_ctl_lock_unlock = NULL;
6168 
6169   /* signal any exceptions: */
6170   if (exceptions != 0) {
6171     (*ieee754_ctl->tme_ieee754_ctl_exception)(ieee754_ctl, exceptions);
6172   }
6173 }
6174 
6175 /* this does a unknown compliance double-precision mul: */
6176 static void
_tme_ieee754_unknown_double_mul(struct tme_ieee754_ctl * ieee754_ctl,const struct tme_float * src0,const struct tme_float * src1,struct tme_float * dst)6177 _tme_ieee754_unknown_double_mul(struct tme_ieee754_ctl *ieee754_ctl, const struct tme_float *src0, const struct tme_float *src1, struct tme_float *dst)
6178 {
6179   int exceptions;
6180 
6181   /* assume that this operation raises no exceptions: */
6182   exceptions = 0;
6183 
6184   /* the operation: */
6185   tme_ieee754_double_value_builtin_set(dst, TME_FLOAT_FORMAT_IEEE754_DOUBLE_BUILTIN, tme_ieee754_double_value_builtin_get(src0) * tme_ieee754_double_value_builtin_get(src1));
6186   ieee754_ctl->tme_ieee754_ctl_lock_unlock = NULL;
6187 
6188   /* signal any exceptions: */
6189   if (exceptions != 0) {
6190     (*ieee754_ctl->tme_ieee754_ctl_exception)(ieee754_ctl, exceptions);
6191   }
6192 }
6193 
6194 /* this does a unknown compliance double-precision div: */
6195 static void
_tme_ieee754_unknown_double_div(struct tme_ieee754_ctl * ieee754_ctl,const struct tme_float * src0,const struct tme_float * src1,struct tme_float * dst)6196 _tme_ieee754_unknown_double_div(struct tme_ieee754_ctl *ieee754_ctl, const struct tme_float *src0, const struct tme_float *src1, struct tme_float *dst)
6197 {
6198   int exceptions;
6199 
6200   /* assume that this operation raises no exceptions: */
6201   exceptions = 0;
6202 
6203   /* the operation: */
6204   tme_ieee754_double_value_builtin_set(dst, TME_FLOAT_FORMAT_IEEE754_DOUBLE_BUILTIN, tme_ieee754_double_value_builtin_get(src0) / tme_ieee754_double_value_builtin_get(src1));
6205   ieee754_ctl->tme_ieee754_ctl_lock_unlock = NULL;
6206 
6207   /* signal any exceptions: */
6208   if (exceptions != 0) {
6209     (*ieee754_ctl->tme_ieee754_ctl_exception)(ieee754_ctl, exceptions);
6210   }
6211 }
6212 
6213 /* this does a unknown compliance double-precision sqrt: */
6214 static void
_tme_ieee754_unknown_double_sqrt(struct tme_ieee754_ctl * ieee754_ctl,const struct tme_float * src0,struct tme_float * dst)6215 _tme_ieee754_unknown_double_sqrt(struct tme_ieee754_ctl *ieee754_ctl, const struct tme_float *src0, struct tme_float *dst)
6216 {
6217   int exceptions;
6218 
6219   /* assume that this operation raises no exceptions: */
6220   exceptions = 0;
6221 
6222   /* the operation: */
6223 #if (TME_FLOAT_FORMAT_IEEE754_DOUBLE_BUILTIN == TME_FLOAT_FORMAT_FLOAT)
6224   tme_ieee754_double_value_builtin_set(dst, TME_FLOAT_FORMAT_FLOAT, sqrtf(tme_ieee754_double_value_builtin_get(src0)));
6225 #else  /* (TME_FLOAT_FORMAT_IEEE754_DOUBLE_BUILTIN != TME_FLOAT_FORMAT_FLOAT) */
6226   tme_ieee754_double_value_builtin_set(dst, TME_FLOAT_FORMAT_DOUBLE, sqrt(tme_ieee754_double_value_builtin_get(src0)));
6227 #endif /* (TME_FLOAT_FORMAT_IEEE754_DOUBLE_BUILTIN != TME_FLOAT_FORMAT_FLOAT) */
6228   ieee754_ctl->tme_ieee754_ctl_lock_unlock = NULL;
6229 
6230   /* signal any exceptions: */
6231   if (exceptions != 0) {
6232     (*ieee754_ctl->tme_ieee754_ctl_exception)(ieee754_ctl, exceptions);
6233   }
6234 }
6235 
6236 /* this does a unknown compliance double-precision abs: */
6237 static void
_tme_ieee754_unknown_double_abs(struct tme_ieee754_ctl * ieee754_ctl,const struct tme_float * src0,struct tme_float * dst)6238 _tme_ieee754_unknown_double_abs(struct tme_ieee754_ctl *ieee754_ctl, const struct tme_float *src0, struct tme_float *dst)
6239 {
6240   int exceptions;
6241 
6242   /* assume that this operation raises no exceptions: */
6243   exceptions = 0;
6244 
6245   /* the operation: */
6246 #if (TME_FLOAT_FORMAT_IEEE754_DOUBLE_BUILTIN == TME_FLOAT_FORMAT_FLOAT)
6247   tme_ieee754_double_value_builtin_set(dst, TME_FLOAT_FORMAT_FLOAT, fabsf(tme_ieee754_double_value_builtin_get(src0)));
6248 #else  /* (TME_FLOAT_FORMAT_IEEE754_DOUBLE_BUILTIN != TME_FLOAT_FORMAT_FLOAT) */
6249   tme_ieee754_double_value_builtin_set(dst, TME_FLOAT_FORMAT_DOUBLE, fabs(tme_ieee754_double_value_builtin_get(src0)));
6250 #endif /* (TME_FLOAT_FORMAT_IEEE754_DOUBLE_BUILTIN != TME_FLOAT_FORMAT_FLOAT) */
6251   ieee754_ctl->tme_ieee754_ctl_lock_unlock = NULL;
6252 
6253   /* signal any exceptions: */
6254   if (exceptions != 0) {
6255     (*ieee754_ctl->tme_ieee754_ctl_exception)(ieee754_ctl, exceptions);
6256   }
6257 }
6258 
6259 /* this does a unknown compliance double-precision neg: */
6260 static void
_tme_ieee754_unknown_double_neg(struct tme_ieee754_ctl * ieee754_ctl,const struct tme_float * src0,struct tme_float * dst)6261 _tme_ieee754_unknown_double_neg(struct tme_ieee754_ctl *ieee754_ctl, const struct tme_float *src0, struct tme_float *dst)
6262 {
6263   int exceptions;
6264 
6265   /* assume that this operation raises no exceptions: */
6266   exceptions = 0;
6267 
6268   /* the operation: */
6269   tme_ieee754_double_value_builtin_set(dst, TME_FLOAT_FORMAT_IEEE754_DOUBLE_BUILTIN, -1 * tme_ieee754_double_value_builtin_get(src0));
6270   ieee754_ctl->tme_ieee754_ctl_lock_unlock = NULL;
6271 
6272   /* signal any exceptions: */
6273   if (exceptions != 0) {
6274     (*ieee754_ctl->tme_ieee754_ctl_exception)(ieee754_ctl, exceptions);
6275   }
6276 }
6277 
6278 /* this does a unknown compliance double-precision move: */
6279 static void
_tme_ieee754_unknown_double_move(struct tme_ieee754_ctl * ieee754_ctl,const struct tme_float * src0,struct tme_float * dst)6280 _tme_ieee754_unknown_double_move(struct tme_ieee754_ctl *ieee754_ctl, const struct tme_float *src0, struct tme_float *dst)
6281 {
6282   int exceptions;
6283 
6284   /* assume that this operation raises no exceptions: */
6285   exceptions = 0;
6286 
6287   /* the operation: */
6288   *dst = *src0;
6289   ieee754_ctl->tme_ieee754_ctl_lock_unlock = NULL;
6290 
6291   /* signal any exceptions: */
6292   if (exceptions != 0) {
6293     (*ieee754_ctl->tme_ieee754_ctl_exception)(ieee754_ctl, exceptions);
6294   }
6295 }
6296 
6297 /* this does a unknown compliance double-precision exp: */
6298 static void
_tme_ieee754_unknown_double_exp(struct tme_ieee754_ctl * ieee754_ctl,const struct tme_float * src0,struct tme_float * dst)6299 _tme_ieee754_unknown_double_exp(struct tme_ieee754_ctl *ieee754_ctl, const struct tme_float *src0, struct tme_float *dst)
6300 {
6301   int exceptions;
6302 
6303   /* assume that this operation raises no exceptions: */
6304   exceptions = 0;
6305 
6306   /* the operation: */
6307 #if (TME_FLOAT_FORMAT_IEEE754_DOUBLE_BUILTIN == TME_FLOAT_FORMAT_FLOAT)
6308   tme_ieee754_double_value_builtin_set(dst, TME_FLOAT_FORMAT_FLOAT, expf(tme_ieee754_double_value_builtin_get(src0)));
6309 #else  /* (TME_FLOAT_FORMAT_IEEE754_DOUBLE_BUILTIN != TME_FLOAT_FORMAT_FLOAT) */
6310   tme_ieee754_double_value_builtin_set(dst, TME_FLOAT_FORMAT_DOUBLE, exp(tme_ieee754_double_value_builtin_get(src0)));
6311 #endif /* (TME_FLOAT_FORMAT_IEEE754_DOUBLE_BUILTIN != TME_FLOAT_FORMAT_FLOAT) */
6312   ieee754_ctl->tme_ieee754_ctl_lock_unlock = NULL;
6313 
6314   /* signal any exceptions: */
6315   if (exceptions != 0) {
6316     (*ieee754_ctl->tme_ieee754_ctl_exception)(ieee754_ctl, exceptions);
6317   }
6318 }
6319 
6320 /* this does a unknown compliance double-precision log10: */
6321 static void
_tme_ieee754_unknown_double_log10(struct tme_ieee754_ctl * ieee754_ctl,const struct tme_float * src0,struct tme_float * dst)6322 _tme_ieee754_unknown_double_log10(struct tme_ieee754_ctl *ieee754_ctl, const struct tme_float *src0, struct tme_float *dst)
6323 {
6324   int exceptions;
6325 
6326   /* assume that this operation raises no exceptions: */
6327   exceptions = 0;
6328 
6329   /* the operation: */
6330 #if (TME_FLOAT_FORMAT_IEEE754_DOUBLE_BUILTIN == TME_FLOAT_FORMAT_FLOAT)
6331   tme_ieee754_double_value_builtin_set(dst, TME_FLOAT_FORMAT_FLOAT, log10f(tme_ieee754_double_value_builtin_get(src0)));
6332 #else  /* (TME_FLOAT_FORMAT_IEEE754_DOUBLE_BUILTIN != TME_FLOAT_FORMAT_FLOAT) */
6333   tme_ieee754_double_value_builtin_set(dst, TME_FLOAT_FORMAT_DOUBLE, log10(tme_ieee754_double_value_builtin_get(src0)));
6334 #endif /* (TME_FLOAT_FORMAT_IEEE754_DOUBLE_BUILTIN != TME_FLOAT_FORMAT_FLOAT) */
6335   ieee754_ctl->tme_ieee754_ctl_lock_unlock = NULL;
6336 
6337   /* signal any exceptions: */
6338   if (exceptions != 0) {
6339     (*ieee754_ctl->tme_ieee754_ctl_exception)(ieee754_ctl, exceptions);
6340   }
6341 }
6342 
6343 /* this does a unknown compliance double-precision log: */
6344 static void
_tme_ieee754_unknown_double_log(struct tme_ieee754_ctl * ieee754_ctl,const struct tme_float * src0,struct tme_float * dst)6345 _tme_ieee754_unknown_double_log(struct tme_ieee754_ctl *ieee754_ctl, const struct tme_float *src0, struct tme_float *dst)
6346 {
6347   int exceptions;
6348 
6349   /* assume that this operation raises no exceptions: */
6350   exceptions = 0;
6351 
6352   /* the operation: */
6353 #if (TME_FLOAT_FORMAT_IEEE754_DOUBLE_BUILTIN == TME_FLOAT_FORMAT_FLOAT)
6354   tme_ieee754_double_value_builtin_set(dst, TME_FLOAT_FORMAT_FLOAT, logf(tme_ieee754_double_value_builtin_get(src0)));
6355 #else  /* (TME_FLOAT_FORMAT_IEEE754_DOUBLE_BUILTIN != TME_FLOAT_FORMAT_FLOAT) */
6356   tme_ieee754_double_value_builtin_set(dst, TME_FLOAT_FORMAT_DOUBLE, log(tme_ieee754_double_value_builtin_get(src0)));
6357 #endif /* (TME_FLOAT_FORMAT_IEEE754_DOUBLE_BUILTIN != TME_FLOAT_FORMAT_FLOAT) */
6358   ieee754_ctl->tme_ieee754_ctl_lock_unlock = NULL;
6359 
6360   /* signal any exceptions: */
6361   if (exceptions != 0) {
6362     (*ieee754_ctl->tme_ieee754_ctl_exception)(ieee754_ctl, exceptions);
6363   }
6364 }
6365 
6366 /* this does a unknown compliance double-precision scale: */
6367 static void
_tme_ieee754_unknown_double_scale(struct tme_ieee754_ctl * ieee754_ctl,const struct tme_float * src0,const struct tme_float * src1,struct tme_float * dst)6368 _tme_ieee754_unknown_double_scale(struct tme_ieee754_ctl *ieee754_ctl, const struct tme_float *src0, const struct tme_float *src1, struct tme_float *dst)
6369 {
6370   int exceptions;
6371 
6372   /* assume that this operation raises no exceptions: */
6373   exceptions = 0;
6374 
6375   /* the operation: */
6376 #if (TME_FLOAT_FORMAT_IEEE754_DOUBLE_BUILTIN == TME_FLOAT_FORMAT_FLOAT)
6377   tme_ieee754_double_value_builtin_set(dst, TME_FLOAT_FORMAT_FLOAT, scalbnf(tme_ieee754_double_value_builtin_get(src0), tme_ieee754_double_value_builtin_get(src1)));
6378 #else  /* (TME_FLOAT_FORMAT_IEEE754_DOUBLE_BUILTIN != TME_FLOAT_FORMAT_FLOAT) */
6379   tme_ieee754_double_value_builtin_set(dst, TME_FLOAT_FORMAT_DOUBLE, scalbn(tme_ieee754_double_value_builtin_get(src0), tme_ieee754_double_value_builtin_get(src1)));
6380 #endif /* (TME_FLOAT_FORMAT_IEEE754_DOUBLE_BUILTIN != TME_FLOAT_FORMAT_FLOAT) */
6381   ieee754_ctl->tme_ieee754_ctl_lock_unlock = NULL;
6382 
6383   /* signal any exceptions: */
6384   if (exceptions != 0) {
6385     (*ieee754_ctl->tme_ieee754_ctl_exception)(ieee754_ctl, exceptions);
6386   }
6387 }
6388 
6389 /* this does a unknown compliance double-precision pow: */
6390 static void
_tme_ieee754_unknown_double_pow(struct tme_ieee754_ctl * ieee754_ctl,const struct tme_float * src0,const struct tme_float * src1,struct tme_float * dst)6391 _tme_ieee754_unknown_double_pow(struct tme_ieee754_ctl *ieee754_ctl, const struct tme_float *src0, const struct tme_float *src1, struct tme_float *dst)
6392 {
6393   int exceptions;
6394 
6395   /* assume that this operation raises no exceptions: */
6396   exceptions = 0;
6397 
6398   /* the operation: */
6399 #if (TME_FLOAT_FORMAT_IEEE754_DOUBLE_BUILTIN == TME_FLOAT_FORMAT_FLOAT)
6400   tme_ieee754_double_value_builtin_set(dst, TME_FLOAT_FORMAT_FLOAT, powf(tme_ieee754_double_value_builtin_get(src0), tme_ieee754_double_value_builtin_get(src1)));
6401 #else  /* (TME_FLOAT_FORMAT_IEEE754_DOUBLE_BUILTIN != TME_FLOAT_FORMAT_FLOAT) */
6402   tme_ieee754_double_value_builtin_set(dst, TME_FLOAT_FORMAT_DOUBLE, pow(tme_ieee754_double_value_builtin_get(src0), tme_ieee754_double_value_builtin_get(src1)));
6403 #endif /* (TME_FLOAT_FORMAT_IEEE754_DOUBLE_BUILTIN != TME_FLOAT_FORMAT_FLOAT) */
6404   ieee754_ctl->tme_ieee754_ctl_lock_unlock = NULL;
6405 
6406   /* signal any exceptions: */
6407   if (exceptions != 0) {
6408     (*ieee754_ctl->tme_ieee754_ctl_exception)(ieee754_ctl, exceptions);
6409   }
6410 }
6411 
6412 /* this does a unknown compliance extended80-precision add: */
6413 static void
_tme_ieee754_unknown_extended80_add(struct tme_ieee754_ctl * ieee754_ctl,const struct tme_float * src0,const struct tme_float * src1,struct tme_float * dst)6414 _tme_ieee754_unknown_extended80_add(struct tme_ieee754_ctl *ieee754_ctl, const struct tme_float *src0, const struct tme_float *src1, struct tme_float *dst)
6415 {
6416   int exceptions;
6417 
6418   /* assume that this operation raises no exceptions: */
6419   exceptions = 0;
6420 
6421   /* the operation: */
6422   tme_ieee754_extended80_value_builtin_set(dst, TME_FLOAT_FORMAT_IEEE754_EXTENDED80_BUILTIN, tme_ieee754_extended80_value_builtin_get(src0) + tme_ieee754_extended80_value_builtin_get(src1));
6423   ieee754_ctl->tme_ieee754_ctl_lock_unlock = NULL;
6424 
6425   /* signal any exceptions: */
6426   if (exceptions != 0) {
6427     (*ieee754_ctl->tme_ieee754_ctl_exception)(ieee754_ctl, exceptions);
6428   }
6429 }
6430 
6431 /* this does a unknown compliance extended80-precision sub: */
6432 static void
_tme_ieee754_unknown_extended80_sub(struct tme_ieee754_ctl * ieee754_ctl,const struct tme_float * src0,const struct tme_float * src1,struct tme_float * dst)6433 _tme_ieee754_unknown_extended80_sub(struct tme_ieee754_ctl *ieee754_ctl, const struct tme_float *src0, const struct tme_float *src1, struct tme_float *dst)
6434 {
6435   int exceptions;
6436 
6437   /* assume that this operation raises no exceptions: */
6438   exceptions = 0;
6439 
6440   /* the operation: */
6441   tme_ieee754_extended80_value_builtin_set(dst, TME_FLOAT_FORMAT_IEEE754_EXTENDED80_BUILTIN, tme_ieee754_extended80_value_builtin_get(src0) - tme_ieee754_extended80_value_builtin_get(src1));
6442   ieee754_ctl->tme_ieee754_ctl_lock_unlock = NULL;
6443 
6444   /* signal any exceptions: */
6445   if (exceptions != 0) {
6446     (*ieee754_ctl->tme_ieee754_ctl_exception)(ieee754_ctl, exceptions);
6447   }
6448 }
6449 
6450 /* this does a unknown compliance extended80-precision mul: */
6451 static void
_tme_ieee754_unknown_extended80_mul(struct tme_ieee754_ctl * ieee754_ctl,const struct tme_float * src0,const struct tme_float * src1,struct tme_float * dst)6452 _tme_ieee754_unknown_extended80_mul(struct tme_ieee754_ctl *ieee754_ctl, const struct tme_float *src0, const struct tme_float *src1, struct tme_float *dst)
6453 {
6454   int exceptions;
6455 
6456   /* assume that this operation raises no exceptions: */
6457   exceptions = 0;
6458 
6459   /* the operation: */
6460   tme_ieee754_extended80_value_builtin_set(dst, TME_FLOAT_FORMAT_IEEE754_EXTENDED80_BUILTIN, tme_ieee754_extended80_value_builtin_get(src0) * tme_ieee754_extended80_value_builtin_get(src1));
6461   ieee754_ctl->tme_ieee754_ctl_lock_unlock = NULL;
6462 
6463   /* signal any exceptions: */
6464   if (exceptions != 0) {
6465     (*ieee754_ctl->tme_ieee754_ctl_exception)(ieee754_ctl, exceptions);
6466   }
6467 }
6468 
6469 /* this does a unknown compliance extended80-precision div: */
6470 static void
_tme_ieee754_unknown_extended80_div(struct tme_ieee754_ctl * ieee754_ctl,const struct tme_float * src0,const struct tme_float * src1,struct tme_float * dst)6471 _tme_ieee754_unknown_extended80_div(struct tme_ieee754_ctl *ieee754_ctl, const struct tme_float *src0, const struct tme_float *src1, struct tme_float *dst)
6472 {
6473   int exceptions;
6474 
6475   /* assume that this operation raises no exceptions: */
6476   exceptions = 0;
6477 
6478   /* the operation: */
6479   tme_ieee754_extended80_value_builtin_set(dst, TME_FLOAT_FORMAT_IEEE754_EXTENDED80_BUILTIN, tme_ieee754_extended80_value_builtin_get(src0) / tme_ieee754_extended80_value_builtin_get(src1));
6480   ieee754_ctl->tme_ieee754_ctl_lock_unlock = NULL;
6481 
6482   /* signal any exceptions: */
6483   if (exceptions != 0) {
6484     (*ieee754_ctl->tme_ieee754_ctl_exception)(ieee754_ctl, exceptions);
6485   }
6486 }
6487 
6488 /* this does a unknown compliance extended80-precision sqrt: */
6489 static void
_tme_ieee754_unknown_extended80_sqrt(struct tme_ieee754_ctl * ieee754_ctl,const struct tme_float * src0,struct tme_float * dst)6490 _tme_ieee754_unknown_extended80_sqrt(struct tme_ieee754_ctl *ieee754_ctl, const struct tme_float *src0, struct tme_float *dst)
6491 {
6492   int exceptions;
6493 
6494   /* assume that this operation raises no exceptions: */
6495   exceptions = 0;
6496 
6497   /* the operation: */
6498 #if (TME_FLOAT_FORMAT_IEEE754_EXTENDED80_BUILTIN == TME_FLOAT_FORMAT_FLOAT)
6499   tme_ieee754_extended80_value_builtin_set(dst, TME_FLOAT_FORMAT_FLOAT, sqrtf(tme_ieee754_extended80_value_builtin_get(src0)));
6500 #else  /* (TME_FLOAT_FORMAT_IEEE754_EXTENDED80_BUILTIN != TME_FLOAT_FORMAT_FLOAT) */
6501   tme_ieee754_extended80_value_builtin_set(dst, TME_FLOAT_FORMAT_DOUBLE, sqrt(tme_ieee754_extended80_value_builtin_get(src0)));
6502 #endif /* (TME_FLOAT_FORMAT_IEEE754_EXTENDED80_BUILTIN != TME_FLOAT_FORMAT_FLOAT) */
6503   ieee754_ctl->tme_ieee754_ctl_lock_unlock = NULL;
6504 
6505   /* signal any exceptions: */
6506   if (exceptions != 0) {
6507     (*ieee754_ctl->tme_ieee754_ctl_exception)(ieee754_ctl, exceptions);
6508   }
6509 }
6510 
6511 /* this does a unknown compliance extended80-precision abs: */
6512 static void
_tme_ieee754_unknown_extended80_abs(struct tme_ieee754_ctl * ieee754_ctl,const struct tme_float * src0,struct tme_float * dst)6513 _tme_ieee754_unknown_extended80_abs(struct tme_ieee754_ctl *ieee754_ctl, const struct tme_float *src0, struct tme_float *dst)
6514 {
6515   int exceptions;
6516 
6517   /* assume that this operation raises no exceptions: */
6518   exceptions = 0;
6519 
6520   /* the operation: */
6521 #if (TME_FLOAT_FORMAT_IEEE754_EXTENDED80_BUILTIN == TME_FLOAT_FORMAT_FLOAT)
6522   tme_ieee754_extended80_value_builtin_set(dst, TME_FLOAT_FORMAT_FLOAT, fabsf(tme_ieee754_extended80_value_builtin_get(src0)));
6523 #else  /* (TME_FLOAT_FORMAT_IEEE754_EXTENDED80_BUILTIN != TME_FLOAT_FORMAT_FLOAT) */
6524   tme_ieee754_extended80_value_builtin_set(dst, TME_FLOAT_FORMAT_DOUBLE, fabs(tme_ieee754_extended80_value_builtin_get(src0)));
6525 #endif /* (TME_FLOAT_FORMAT_IEEE754_EXTENDED80_BUILTIN != TME_FLOAT_FORMAT_FLOAT) */
6526   ieee754_ctl->tme_ieee754_ctl_lock_unlock = NULL;
6527 
6528   /* signal any exceptions: */
6529   if (exceptions != 0) {
6530     (*ieee754_ctl->tme_ieee754_ctl_exception)(ieee754_ctl, exceptions);
6531   }
6532 }
6533 
6534 /* this does a unknown compliance extended80-precision neg: */
6535 static void
_tme_ieee754_unknown_extended80_neg(struct tme_ieee754_ctl * ieee754_ctl,const struct tme_float * src0,struct tme_float * dst)6536 _tme_ieee754_unknown_extended80_neg(struct tme_ieee754_ctl *ieee754_ctl, const struct tme_float *src0, struct tme_float *dst)
6537 {
6538   int exceptions;
6539 
6540   /* assume that this operation raises no exceptions: */
6541   exceptions = 0;
6542 
6543   /* the operation: */
6544   tme_ieee754_extended80_value_builtin_set(dst, TME_FLOAT_FORMAT_IEEE754_EXTENDED80_BUILTIN, -1 * tme_ieee754_extended80_value_builtin_get(src0));
6545   ieee754_ctl->tme_ieee754_ctl_lock_unlock = NULL;
6546 
6547   /* signal any exceptions: */
6548   if (exceptions != 0) {
6549     (*ieee754_ctl->tme_ieee754_ctl_exception)(ieee754_ctl, exceptions);
6550   }
6551 }
6552 
6553 /* this does a unknown compliance extended80-precision move: */
6554 static void
_tme_ieee754_unknown_extended80_move(struct tme_ieee754_ctl * ieee754_ctl,const struct tme_float * src0,struct tme_float * dst)6555 _tme_ieee754_unknown_extended80_move(struct tme_ieee754_ctl *ieee754_ctl, const struct tme_float *src0, struct tme_float *dst)
6556 {
6557   int exceptions;
6558 
6559   /* assume that this operation raises no exceptions: */
6560   exceptions = 0;
6561 
6562   /* the operation: */
6563   *dst = *src0;
6564   ieee754_ctl->tme_ieee754_ctl_lock_unlock = NULL;
6565 
6566   /* signal any exceptions: */
6567   if (exceptions != 0) {
6568     (*ieee754_ctl->tme_ieee754_ctl_exception)(ieee754_ctl, exceptions);
6569   }
6570 }
6571 
6572 /* this does a unknown compliance extended80-precision exp: */
6573 static void
_tme_ieee754_unknown_extended80_exp(struct tme_ieee754_ctl * ieee754_ctl,const struct tme_float * src0,struct tme_float * dst)6574 _tme_ieee754_unknown_extended80_exp(struct tme_ieee754_ctl *ieee754_ctl, const struct tme_float *src0, struct tme_float *dst)
6575 {
6576   int exceptions;
6577 
6578   /* assume that this operation raises no exceptions: */
6579   exceptions = 0;
6580 
6581   /* the operation: */
6582 #if (TME_FLOAT_FORMAT_IEEE754_EXTENDED80_BUILTIN == TME_FLOAT_FORMAT_FLOAT)
6583   tme_ieee754_extended80_value_builtin_set(dst, TME_FLOAT_FORMAT_FLOAT, expf(tme_ieee754_extended80_value_builtin_get(src0)));
6584 #else  /* (TME_FLOAT_FORMAT_IEEE754_EXTENDED80_BUILTIN != TME_FLOAT_FORMAT_FLOAT) */
6585   tme_ieee754_extended80_value_builtin_set(dst, TME_FLOAT_FORMAT_DOUBLE, exp(tme_ieee754_extended80_value_builtin_get(src0)));
6586 #endif /* (TME_FLOAT_FORMAT_IEEE754_EXTENDED80_BUILTIN != TME_FLOAT_FORMAT_FLOAT) */
6587   ieee754_ctl->tme_ieee754_ctl_lock_unlock = NULL;
6588 
6589   /* signal any exceptions: */
6590   if (exceptions != 0) {
6591     (*ieee754_ctl->tme_ieee754_ctl_exception)(ieee754_ctl, exceptions);
6592   }
6593 }
6594 
6595 /* this does a unknown compliance extended80-precision log10: */
6596 static void
_tme_ieee754_unknown_extended80_log10(struct tme_ieee754_ctl * ieee754_ctl,const struct tme_float * src0,struct tme_float * dst)6597 _tme_ieee754_unknown_extended80_log10(struct tme_ieee754_ctl *ieee754_ctl, const struct tme_float *src0, struct tme_float *dst)
6598 {
6599   int exceptions;
6600 
6601   /* assume that this operation raises no exceptions: */
6602   exceptions = 0;
6603 
6604   /* the operation: */
6605 #if (TME_FLOAT_FORMAT_IEEE754_EXTENDED80_BUILTIN == TME_FLOAT_FORMAT_FLOAT)
6606   tme_ieee754_extended80_value_builtin_set(dst, TME_FLOAT_FORMAT_FLOAT, log10f(tme_ieee754_extended80_value_builtin_get(src0)));
6607 #else  /* (TME_FLOAT_FORMAT_IEEE754_EXTENDED80_BUILTIN != TME_FLOAT_FORMAT_FLOAT) */
6608   tme_ieee754_extended80_value_builtin_set(dst, TME_FLOAT_FORMAT_DOUBLE, log10(tme_ieee754_extended80_value_builtin_get(src0)));
6609 #endif /* (TME_FLOAT_FORMAT_IEEE754_EXTENDED80_BUILTIN != TME_FLOAT_FORMAT_FLOAT) */
6610   ieee754_ctl->tme_ieee754_ctl_lock_unlock = NULL;
6611 
6612   /* signal any exceptions: */
6613   if (exceptions != 0) {
6614     (*ieee754_ctl->tme_ieee754_ctl_exception)(ieee754_ctl, exceptions);
6615   }
6616 }
6617 
6618 /* this does a unknown compliance extended80-precision log: */
6619 static void
_tme_ieee754_unknown_extended80_log(struct tme_ieee754_ctl * ieee754_ctl,const struct tme_float * src0,struct tme_float * dst)6620 _tme_ieee754_unknown_extended80_log(struct tme_ieee754_ctl *ieee754_ctl, const struct tme_float *src0, struct tme_float *dst)
6621 {
6622   int exceptions;
6623 
6624   /* assume that this operation raises no exceptions: */
6625   exceptions = 0;
6626 
6627   /* the operation: */
6628 #if (TME_FLOAT_FORMAT_IEEE754_EXTENDED80_BUILTIN == TME_FLOAT_FORMAT_FLOAT)
6629   tme_ieee754_extended80_value_builtin_set(dst, TME_FLOAT_FORMAT_FLOAT, logf(tme_ieee754_extended80_value_builtin_get(src0)));
6630 #else  /* (TME_FLOAT_FORMAT_IEEE754_EXTENDED80_BUILTIN != TME_FLOAT_FORMAT_FLOAT) */
6631   tme_ieee754_extended80_value_builtin_set(dst, TME_FLOAT_FORMAT_DOUBLE, log(tme_ieee754_extended80_value_builtin_get(src0)));
6632 #endif /* (TME_FLOAT_FORMAT_IEEE754_EXTENDED80_BUILTIN != TME_FLOAT_FORMAT_FLOAT) */
6633   ieee754_ctl->tme_ieee754_ctl_lock_unlock = NULL;
6634 
6635   /* signal any exceptions: */
6636   if (exceptions != 0) {
6637     (*ieee754_ctl->tme_ieee754_ctl_exception)(ieee754_ctl, exceptions);
6638   }
6639 }
6640 
6641 /* this does a unknown compliance extended80-precision scale: */
6642 static void
_tme_ieee754_unknown_extended80_scale(struct tme_ieee754_ctl * ieee754_ctl,const struct tme_float * src0,const struct tme_float * src1,struct tme_float * dst)6643 _tme_ieee754_unknown_extended80_scale(struct tme_ieee754_ctl *ieee754_ctl, const struct tme_float *src0, const struct tme_float *src1, struct tme_float *dst)
6644 {
6645   int exceptions;
6646 
6647   /* assume that this operation raises no exceptions: */
6648   exceptions = 0;
6649 
6650   /* the operation: */
6651 #if (TME_FLOAT_FORMAT_IEEE754_EXTENDED80_BUILTIN == TME_FLOAT_FORMAT_FLOAT)
6652   tme_ieee754_extended80_value_builtin_set(dst, TME_FLOAT_FORMAT_FLOAT, scalbnf(tme_ieee754_extended80_value_builtin_get(src0), tme_ieee754_extended80_value_builtin_get(src1)));
6653 #else  /* (TME_FLOAT_FORMAT_IEEE754_EXTENDED80_BUILTIN != TME_FLOAT_FORMAT_FLOAT) */
6654   tme_ieee754_extended80_value_builtin_set(dst, TME_FLOAT_FORMAT_DOUBLE, scalbn(tme_ieee754_extended80_value_builtin_get(src0), tme_ieee754_extended80_value_builtin_get(src1)));
6655 #endif /* (TME_FLOAT_FORMAT_IEEE754_EXTENDED80_BUILTIN != TME_FLOAT_FORMAT_FLOAT) */
6656   ieee754_ctl->tme_ieee754_ctl_lock_unlock = NULL;
6657 
6658   /* signal any exceptions: */
6659   if (exceptions != 0) {
6660     (*ieee754_ctl->tme_ieee754_ctl_exception)(ieee754_ctl, exceptions);
6661   }
6662 }
6663 
6664 /* this does a unknown compliance extended80-precision pow: */
6665 static void
_tme_ieee754_unknown_extended80_pow(struct tme_ieee754_ctl * ieee754_ctl,const struct tme_float * src0,const struct tme_float * src1,struct tme_float * dst)6666 _tme_ieee754_unknown_extended80_pow(struct tme_ieee754_ctl *ieee754_ctl, const struct tme_float *src0, const struct tme_float *src1, struct tme_float *dst)
6667 {
6668   int exceptions;
6669 
6670   /* assume that this operation raises no exceptions: */
6671   exceptions = 0;
6672 
6673   /* the operation: */
6674 #if (TME_FLOAT_FORMAT_IEEE754_EXTENDED80_BUILTIN == TME_FLOAT_FORMAT_FLOAT)
6675   tme_ieee754_extended80_value_builtin_set(dst, TME_FLOAT_FORMAT_FLOAT, powf(tme_ieee754_extended80_value_builtin_get(src0), tme_ieee754_extended80_value_builtin_get(src1)));
6676 #else  /* (TME_FLOAT_FORMAT_IEEE754_EXTENDED80_BUILTIN != TME_FLOAT_FORMAT_FLOAT) */
6677   tme_ieee754_extended80_value_builtin_set(dst, TME_FLOAT_FORMAT_DOUBLE, pow(tme_ieee754_extended80_value_builtin_get(src0), tme_ieee754_extended80_value_builtin_get(src1)));
6678 #endif /* (TME_FLOAT_FORMAT_IEEE754_EXTENDED80_BUILTIN != TME_FLOAT_FORMAT_FLOAT) */
6679   ieee754_ctl->tme_ieee754_ctl_lock_unlock = NULL;
6680 
6681   /* signal any exceptions: */
6682   if (exceptions != 0) {
6683     (*ieee754_ctl->tme_ieee754_ctl_exception)(ieee754_ctl, exceptions);
6684   }
6685 }
6686 
6687 /* this does a unknown compliance quad-precision add: */
6688 static void
_tme_ieee754_unknown_quad_add(struct tme_ieee754_ctl * ieee754_ctl,const struct tme_float * src0,const struct tme_float * src1,struct tme_float * dst)6689 _tme_ieee754_unknown_quad_add(struct tme_ieee754_ctl *ieee754_ctl, const struct tme_float *src0, const struct tme_float *src1, struct tme_float *dst)
6690 {
6691   int exceptions;
6692 
6693   /* assume that this operation raises no exceptions: */
6694   exceptions = 0;
6695 
6696   /* the operation: */
6697   tme_ieee754_quad_value_builtin_set(dst, TME_FLOAT_FORMAT_IEEE754_QUAD_BUILTIN, tme_ieee754_quad_value_builtin_get(src0) + tme_ieee754_quad_value_builtin_get(src1));
6698   ieee754_ctl->tme_ieee754_ctl_lock_unlock = NULL;
6699 
6700   /* signal any exceptions: */
6701   if (exceptions != 0) {
6702     (*ieee754_ctl->tme_ieee754_ctl_exception)(ieee754_ctl, exceptions);
6703   }
6704 }
6705 
6706 /* this does a unknown compliance quad-precision sub: */
6707 static void
_tme_ieee754_unknown_quad_sub(struct tme_ieee754_ctl * ieee754_ctl,const struct tme_float * src0,const struct tme_float * src1,struct tme_float * dst)6708 _tme_ieee754_unknown_quad_sub(struct tme_ieee754_ctl *ieee754_ctl, const struct tme_float *src0, const struct tme_float *src1, struct tme_float *dst)
6709 {
6710   int exceptions;
6711 
6712   /* assume that this operation raises no exceptions: */
6713   exceptions = 0;
6714 
6715   /* the operation: */
6716   tme_ieee754_quad_value_builtin_set(dst, TME_FLOAT_FORMAT_IEEE754_QUAD_BUILTIN, tme_ieee754_quad_value_builtin_get(src0) - tme_ieee754_quad_value_builtin_get(src1));
6717   ieee754_ctl->tme_ieee754_ctl_lock_unlock = NULL;
6718 
6719   /* signal any exceptions: */
6720   if (exceptions != 0) {
6721     (*ieee754_ctl->tme_ieee754_ctl_exception)(ieee754_ctl, exceptions);
6722   }
6723 }
6724 
6725 /* this does a unknown compliance quad-precision mul: */
6726 static void
_tme_ieee754_unknown_quad_mul(struct tme_ieee754_ctl * ieee754_ctl,const struct tme_float * src0,const struct tme_float * src1,struct tme_float * dst)6727 _tme_ieee754_unknown_quad_mul(struct tme_ieee754_ctl *ieee754_ctl, const struct tme_float *src0, const struct tme_float *src1, struct tme_float *dst)
6728 {
6729   int exceptions;
6730 
6731   /* assume that this operation raises no exceptions: */
6732   exceptions = 0;
6733 
6734   /* the operation: */
6735   tme_ieee754_quad_value_builtin_set(dst, TME_FLOAT_FORMAT_IEEE754_QUAD_BUILTIN, tme_ieee754_quad_value_builtin_get(src0) * tme_ieee754_quad_value_builtin_get(src1));
6736   ieee754_ctl->tme_ieee754_ctl_lock_unlock = NULL;
6737 
6738   /* signal any exceptions: */
6739   if (exceptions != 0) {
6740     (*ieee754_ctl->tme_ieee754_ctl_exception)(ieee754_ctl, exceptions);
6741   }
6742 }
6743 
6744 /* this does a unknown compliance quad-precision div: */
6745 static void
_tme_ieee754_unknown_quad_div(struct tme_ieee754_ctl * ieee754_ctl,const struct tme_float * src0,const struct tme_float * src1,struct tme_float * dst)6746 _tme_ieee754_unknown_quad_div(struct tme_ieee754_ctl *ieee754_ctl, const struct tme_float *src0, const struct tme_float *src1, struct tme_float *dst)
6747 {
6748   int exceptions;
6749 
6750   /* assume that this operation raises no exceptions: */
6751   exceptions = 0;
6752 
6753   /* the operation: */
6754   tme_ieee754_quad_value_builtin_set(dst, TME_FLOAT_FORMAT_IEEE754_QUAD_BUILTIN, tme_ieee754_quad_value_builtin_get(src0) / tme_ieee754_quad_value_builtin_get(src1));
6755   ieee754_ctl->tme_ieee754_ctl_lock_unlock = NULL;
6756 
6757   /* signal any exceptions: */
6758   if (exceptions != 0) {
6759     (*ieee754_ctl->tme_ieee754_ctl_exception)(ieee754_ctl, exceptions);
6760   }
6761 }
6762 
6763 /* this does a unknown compliance quad-precision sqrt: */
6764 static void
_tme_ieee754_unknown_quad_sqrt(struct tme_ieee754_ctl * ieee754_ctl,const struct tme_float * src0,struct tme_float * dst)6765 _tme_ieee754_unknown_quad_sqrt(struct tme_ieee754_ctl *ieee754_ctl, const struct tme_float *src0, struct tme_float *dst)
6766 {
6767   int exceptions;
6768 
6769   /* assume that this operation raises no exceptions: */
6770   exceptions = 0;
6771 
6772   /* the operation: */
6773 #if (TME_FLOAT_FORMAT_IEEE754_QUAD_BUILTIN == TME_FLOAT_FORMAT_FLOAT)
6774   tme_ieee754_quad_value_builtin_set(dst, TME_FLOAT_FORMAT_FLOAT, sqrtf(tme_ieee754_quad_value_builtin_get(src0)));
6775 #else  /* (TME_FLOAT_FORMAT_IEEE754_QUAD_BUILTIN != TME_FLOAT_FORMAT_FLOAT) */
6776   tme_ieee754_quad_value_builtin_set(dst, TME_FLOAT_FORMAT_DOUBLE, sqrt(tme_ieee754_quad_value_builtin_get(src0)));
6777 #endif /* (TME_FLOAT_FORMAT_IEEE754_QUAD_BUILTIN != TME_FLOAT_FORMAT_FLOAT) */
6778   ieee754_ctl->tme_ieee754_ctl_lock_unlock = NULL;
6779 
6780   /* signal any exceptions: */
6781   if (exceptions != 0) {
6782     (*ieee754_ctl->tme_ieee754_ctl_exception)(ieee754_ctl, exceptions);
6783   }
6784 }
6785 
6786 /* this does a unknown compliance quad-precision abs: */
6787 static void
_tme_ieee754_unknown_quad_abs(struct tme_ieee754_ctl * ieee754_ctl,const struct tme_float * src0,struct tme_float * dst)6788 _tme_ieee754_unknown_quad_abs(struct tme_ieee754_ctl *ieee754_ctl, const struct tme_float *src0, struct tme_float *dst)
6789 {
6790   int exceptions;
6791 
6792   /* assume that this operation raises no exceptions: */
6793   exceptions = 0;
6794 
6795   /* the operation: */
6796 #if (TME_FLOAT_FORMAT_IEEE754_QUAD_BUILTIN == TME_FLOAT_FORMAT_FLOAT)
6797   tme_ieee754_quad_value_builtin_set(dst, TME_FLOAT_FORMAT_FLOAT, fabsf(tme_ieee754_quad_value_builtin_get(src0)));
6798 #else  /* (TME_FLOAT_FORMAT_IEEE754_QUAD_BUILTIN != TME_FLOAT_FORMAT_FLOAT) */
6799   tme_ieee754_quad_value_builtin_set(dst, TME_FLOAT_FORMAT_DOUBLE, fabs(tme_ieee754_quad_value_builtin_get(src0)));
6800 #endif /* (TME_FLOAT_FORMAT_IEEE754_QUAD_BUILTIN != TME_FLOAT_FORMAT_FLOAT) */
6801   ieee754_ctl->tme_ieee754_ctl_lock_unlock = NULL;
6802 
6803   /* signal any exceptions: */
6804   if (exceptions != 0) {
6805     (*ieee754_ctl->tme_ieee754_ctl_exception)(ieee754_ctl, exceptions);
6806   }
6807 }
6808 
6809 /* this does a unknown compliance quad-precision neg: */
6810 static void
_tme_ieee754_unknown_quad_neg(struct tme_ieee754_ctl * ieee754_ctl,const struct tme_float * src0,struct tme_float * dst)6811 _tme_ieee754_unknown_quad_neg(struct tme_ieee754_ctl *ieee754_ctl, const struct tme_float *src0, struct tme_float *dst)
6812 {
6813   int exceptions;
6814 
6815   /* assume that this operation raises no exceptions: */
6816   exceptions = 0;
6817 
6818   /* the operation: */
6819   tme_ieee754_quad_value_builtin_set(dst, TME_FLOAT_FORMAT_IEEE754_QUAD_BUILTIN, -1 * tme_ieee754_quad_value_builtin_get(src0));
6820   ieee754_ctl->tme_ieee754_ctl_lock_unlock = NULL;
6821 
6822   /* signal any exceptions: */
6823   if (exceptions != 0) {
6824     (*ieee754_ctl->tme_ieee754_ctl_exception)(ieee754_ctl, exceptions);
6825   }
6826 }
6827 
6828 /* this does a unknown compliance quad-precision move: */
6829 static void
_tme_ieee754_unknown_quad_move(struct tme_ieee754_ctl * ieee754_ctl,const struct tme_float * src0,struct tme_float * dst)6830 _tme_ieee754_unknown_quad_move(struct tme_ieee754_ctl *ieee754_ctl, const struct tme_float *src0, struct tme_float *dst)
6831 {
6832   int exceptions;
6833 
6834   /* assume that this operation raises no exceptions: */
6835   exceptions = 0;
6836 
6837   /* the operation: */
6838   *dst = *src0;
6839   ieee754_ctl->tme_ieee754_ctl_lock_unlock = NULL;
6840 
6841   /* signal any exceptions: */
6842   if (exceptions != 0) {
6843     (*ieee754_ctl->tme_ieee754_ctl_exception)(ieee754_ctl, exceptions);
6844   }
6845 }
6846 
6847 /* this does a unknown compliance quad-precision exp: */
6848 static void
_tme_ieee754_unknown_quad_exp(struct tme_ieee754_ctl * ieee754_ctl,const struct tme_float * src0,struct tme_float * dst)6849 _tme_ieee754_unknown_quad_exp(struct tme_ieee754_ctl *ieee754_ctl, const struct tme_float *src0, struct tme_float *dst)
6850 {
6851   int exceptions;
6852 
6853   /* assume that this operation raises no exceptions: */
6854   exceptions = 0;
6855 
6856   /* the operation: */
6857 #if (TME_FLOAT_FORMAT_IEEE754_QUAD_BUILTIN == TME_FLOAT_FORMAT_FLOAT)
6858   tme_ieee754_quad_value_builtin_set(dst, TME_FLOAT_FORMAT_FLOAT, expf(tme_ieee754_quad_value_builtin_get(src0)));
6859 #else  /* (TME_FLOAT_FORMAT_IEEE754_QUAD_BUILTIN != TME_FLOAT_FORMAT_FLOAT) */
6860   tme_ieee754_quad_value_builtin_set(dst, TME_FLOAT_FORMAT_DOUBLE, exp(tme_ieee754_quad_value_builtin_get(src0)));
6861 #endif /* (TME_FLOAT_FORMAT_IEEE754_QUAD_BUILTIN != TME_FLOAT_FORMAT_FLOAT) */
6862   ieee754_ctl->tme_ieee754_ctl_lock_unlock = NULL;
6863 
6864   /* signal any exceptions: */
6865   if (exceptions != 0) {
6866     (*ieee754_ctl->tme_ieee754_ctl_exception)(ieee754_ctl, exceptions);
6867   }
6868 }
6869 
6870 /* this does a unknown compliance quad-precision log10: */
6871 static void
_tme_ieee754_unknown_quad_log10(struct tme_ieee754_ctl * ieee754_ctl,const struct tme_float * src0,struct tme_float * dst)6872 _tme_ieee754_unknown_quad_log10(struct tme_ieee754_ctl *ieee754_ctl, const struct tme_float *src0, struct tme_float *dst)
6873 {
6874   int exceptions;
6875 
6876   /* assume that this operation raises no exceptions: */
6877   exceptions = 0;
6878 
6879   /* the operation: */
6880 #if (TME_FLOAT_FORMAT_IEEE754_QUAD_BUILTIN == TME_FLOAT_FORMAT_FLOAT)
6881   tme_ieee754_quad_value_builtin_set(dst, TME_FLOAT_FORMAT_FLOAT, log10f(tme_ieee754_quad_value_builtin_get(src0)));
6882 #else  /* (TME_FLOAT_FORMAT_IEEE754_QUAD_BUILTIN != TME_FLOAT_FORMAT_FLOAT) */
6883   tme_ieee754_quad_value_builtin_set(dst, TME_FLOAT_FORMAT_DOUBLE, log10(tme_ieee754_quad_value_builtin_get(src0)));
6884 #endif /* (TME_FLOAT_FORMAT_IEEE754_QUAD_BUILTIN != TME_FLOAT_FORMAT_FLOAT) */
6885   ieee754_ctl->tme_ieee754_ctl_lock_unlock = NULL;
6886 
6887   /* signal any exceptions: */
6888   if (exceptions != 0) {
6889     (*ieee754_ctl->tme_ieee754_ctl_exception)(ieee754_ctl, exceptions);
6890   }
6891 }
6892 
6893 /* this does a unknown compliance quad-precision log: */
6894 static void
_tme_ieee754_unknown_quad_log(struct tme_ieee754_ctl * ieee754_ctl,const struct tme_float * src0,struct tme_float * dst)6895 _tme_ieee754_unknown_quad_log(struct tme_ieee754_ctl *ieee754_ctl, const struct tme_float *src0, struct tme_float *dst)
6896 {
6897   int exceptions;
6898 
6899   /* assume that this operation raises no exceptions: */
6900   exceptions = 0;
6901 
6902   /* the operation: */
6903 #if (TME_FLOAT_FORMAT_IEEE754_QUAD_BUILTIN == TME_FLOAT_FORMAT_FLOAT)
6904   tme_ieee754_quad_value_builtin_set(dst, TME_FLOAT_FORMAT_FLOAT, logf(tme_ieee754_quad_value_builtin_get(src0)));
6905 #else  /* (TME_FLOAT_FORMAT_IEEE754_QUAD_BUILTIN != TME_FLOAT_FORMAT_FLOAT) */
6906   tme_ieee754_quad_value_builtin_set(dst, TME_FLOAT_FORMAT_DOUBLE, log(tme_ieee754_quad_value_builtin_get(src0)));
6907 #endif /* (TME_FLOAT_FORMAT_IEEE754_QUAD_BUILTIN != TME_FLOAT_FORMAT_FLOAT) */
6908   ieee754_ctl->tme_ieee754_ctl_lock_unlock = NULL;
6909 
6910   /* signal any exceptions: */
6911   if (exceptions != 0) {
6912     (*ieee754_ctl->tme_ieee754_ctl_exception)(ieee754_ctl, exceptions);
6913   }
6914 }
6915 
6916 /* this does a unknown compliance quad-precision scale: */
6917 static void
_tme_ieee754_unknown_quad_scale(struct tme_ieee754_ctl * ieee754_ctl,const struct tme_float * src0,const struct tme_float * src1,struct tme_float * dst)6918 _tme_ieee754_unknown_quad_scale(struct tme_ieee754_ctl *ieee754_ctl, const struct tme_float *src0, const struct tme_float *src1, struct tme_float *dst)
6919 {
6920   int exceptions;
6921 
6922   /* assume that this operation raises no exceptions: */
6923   exceptions = 0;
6924 
6925   /* the operation: */
6926 #if (TME_FLOAT_FORMAT_IEEE754_QUAD_BUILTIN == TME_FLOAT_FORMAT_FLOAT)
6927   tme_ieee754_quad_value_builtin_set(dst, TME_FLOAT_FORMAT_FLOAT, scalbnf(tme_ieee754_quad_value_builtin_get(src0), tme_ieee754_quad_value_builtin_get(src1)));
6928 #else  /* (TME_FLOAT_FORMAT_IEEE754_QUAD_BUILTIN != TME_FLOAT_FORMAT_FLOAT) */
6929   tme_ieee754_quad_value_builtin_set(dst, TME_FLOAT_FORMAT_DOUBLE, scalbn(tme_ieee754_quad_value_builtin_get(src0), tme_ieee754_quad_value_builtin_get(src1)));
6930 #endif /* (TME_FLOAT_FORMAT_IEEE754_QUAD_BUILTIN != TME_FLOAT_FORMAT_FLOAT) */
6931   ieee754_ctl->tme_ieee754_ctl_lock_unlock = NULL;
6932 
6933   /* signal any exceptions: */
6934   if (exceptions != 0) {
6935     (*ieee754_ctl->tme_ieee754_ctl_exception)(ieee754_ctl, exceptions);
6936   }
6937 }
6938 
6939 /* this does a unknown compliance quad-precision pow: */
6940 static void
_tme_ieee754_unknown_quad_pow(struct tme_ieee754_ctl * ieee754_ctl,const struct tme_float * src0,const struct tme_float * src1,struct tme_float * dst)6941 _tme_ieee754_unknown_quad_pow(struct tme_ieee754_ctl *ieee754_ctl, const struct tme_float *src0, const struct tme_float *src1, struct tme_float *dst)
6942 {
6943   int exceptions;
6944 
6945   /* assume that this operation raises no exceptions: */
6946   exceptions = 0;
6947 
6948   /* the operation: */
6949 #if (TME_FLOAT_FORMAT_IEEE754_QUAD_BUILTIN == TME_FLOAT_FORMAT_FLOAT)
6950   tme_ieee754_quad_value_builtin_set(dst, TME_FLOAT_FORMAT_FLOAT, powf(tme_ieee754_quad_value_builtin_get(src0), tme_ieee754_quad_value_builtin_get(src1)));
6951 #else  /* (TME_FLOAT_FORMAT_IEEE754_QUAD_BUILTIN != TME_FLOAT_FORMAT_FLOAT) */
6952   tme_ieee754_quad_value_builtin_set(dst, TME_FLOAT_FORMAT_DOUBLE, pow(tme_ieee754_quad_value_builtin_get(src0), tme_ieee754_quad_value_builtin_get(src1)));
6953 #endif /* (TME_FLOAT_FORMAT_IEEE754_QUAD_BUILTIN != TME_FLOAT_FORMAT_FLOAT) */
6954   ieee754_ctl->tme_ieee754_ctl_lock_unlock = NULL;
6955 
6956   /* signal any exceptions: */
6957   if (exceptions != 0) {
6958     (*ieee754_ctl->tme_ieee754_ctl_exception)(ieee754_ctl, exceptions);
6959   }
6960 }
6961 
6962 /* the unknown compliance operations: */
6963 _tme_const struct tme_ieee754_ops tme_ieee754_ops_unknown = {
6964 
6965   /* the version of this structure: */
6966   TME_X_VERSION(0, 0),
6967 
6968   /* this does a unknown compliance single-precision add: */
6969   _tme_ieee754_unknown_single_add,
6970 
6971   /* this does a unknown compliance single-precision sub: */
6972   _tme_ieee754_unknown_single_sub,
6973 
6974   /* this does a unknown compliance single-precision mul: */
6975   _tme_ieee754_unknown_single_mul,
6976 
6977   /* this does a unknown compliance single-precision div: */
6978   _tme_ieee754_unknown_single_div,
6979 
6980   /* this does a unknown compliance single-precision rem: */
6981   _tme_ieee754_strict_single_rem,
6982 
6983   /* this does a unknown compliance single-precision sqrt: */
6984   _tme_ieee754_unknown_single_sqrt,
6985 
6986   /* this does a unknown compliance single-precision abs: */
6987   _tme_ieee754_unknown_single_abs,
6988 
6989   /* this does a unknown compliance single-precision neg: */
6990   _tme_ieee754_unknown_single_neg,
6991 
6992   /* this does a unknown compliance single-precision move: */
6993   _tme_ieee754_unknown_single_move,
6994 
6995   /* this does a unknown compliance single-precision rint: */
6996   _tme_ieee754_strict_single_rint,
6997 
6998   /* this does a unknown compliance single-precision cos: */
6999   NULL,
7000 
7001   /* this does a unknown compliance single-precision acos: */
7002   NULL,
7003 
7004   /* this does a unknown compliance single-precision cosh: */
7005   NULL,
7006 
7007   /* this does a unknown compliance single-precision sin: */
7008   NULL,
7009 
7010   /* this does a unknown compliance single-precision asin: */
7011   NULL,
7012 
7013   /* this does a unknown compliance single-precision sinh: */
7014   NULL,
7015 
7016   /* this does a unknown compliance single-precision tan: */
7017   NULL,
7018 
7019   /* this does a unknown compliance single-precision atan: */
7020   NULL,
7021 
7022   /* this does a unknown compliance single-precision tanh: */
7023   NULL,
7024 
7025   /* this does a unknown compliance single-precision atanh: */
7026   NULL,
7027 
7028   /* this does a unknown compliance single-precision exp: */
7029   _tme_ieee754_unknown_single_exp,
7030 
7031   /* this does a unknown compliance single-precision expm1: */
7032   NULL,
7033 
7034   /* this does a unknown compliance single-precision log10: */
7035   _tme_ieee754_unknown_single_log10,
7036 
7037   /* this does a unknown compliance single-precision log: */
7038   _tme_ieee754_unknown_single_log,
7039 
7040   /* this does a unknown compliance single-precision log1p: */
7041   NULL,
7042 
7043   /* this does a unknown compliance single-precision getexp: */
7044   _tme_ieee754_strict_single_getexp,
7045 
7046   /* this does a unknown compliance single-precision getman: */
7047   _tme_ieee754_strict_single_getman,
7048 
7049   /* this does a unknown compliance single-precision scale: */
7050   _tme_ieee754_unknown_single_scale,
7051 
7052   /* this does a unknown compliance single-precision pow: */
7053   _tme_ieee754_unknown_single_pow,
7054 
7055   /* this does a unknown compliance single-precision from_double: */
7056   _tme_ieee754_strict_single_from_double,
7057 
7058   /* this does a unknown compliance single-precision from_extended80: */
7059   _tme_ieee754_strict_single_from_extended80,
7060 
7061   /* this does a unknown compliance single-precision from_quad: */
7062   _tme_ieee754_strict_single_from_quad,
7063 
7064   /* this does a unknown compliance single-precision from_int32: */
7065   _tme_ieee754_strict_single_from_int32,
7066 
7067   /* this does a unknown compliance single-precision from_int64: */
7068 #if (defined(TME_HAVE_INT64_T))
7069   _tme_ieee754_strict_single_from_int64,
7070 #else  /* !(defined(TME_HAVE_INT64_T)) */
7071   NULL,
7072 #endif /* !(defined(TME_HAVE_INT64_T)) */
7073 
7074   /* this does a unknown compliance single-precision to_int32: */
7075   _tme_ieee754_strict_single_to_int32,
7076 
7077   /* this does a unknown compliance single-precision to_int64: */
7078 #if (defined(TME_HAVE_INT64_T))
7079   _tme_ieee754_strict_single_to_int64,
7080 #else  /* !(defined(TME_HAVE_INT64_T)) */
7081   NULL,
7082 #endif /* !(defined(TME_HAVE_INT64_T)) */
7083 
7084   /* this does a unknown compliance double-precision add: */
7085   _tme_ieee754_unknown_double_add,
7086 
7087   /* this does a unknown compliance double-precision sub: */
7088   _tme_ieee754_unknown_double_sub,
7089 
7090   /* this does a unknown compliance double-precision mul: */
7091   _tme_ieee754_unknown_double_mul,
7092 
7093   /* this does a unknown compliance double-precision div: */
7094   _tme_ieee754_unknown_double_div,
7095 
7096   /* this does a unknown compliance double-precision rem: */
7097   _tme_ieee754_strict_double_rem,
7098 
7099   /* this does a unknown compliance double-precision sqrt: */
7100   _tme_ieee754_unknown_double_sqrt,
7101 
7102   /* this does a unknown compliance double-precision abs: */
7103   _tme_ieee754_unknown_double_abs,
7104 
7105   /* this does a unknown compliance double-precision neg: */
7106   _tme_ieee754_unknown_double_neg,
7107 
7108   /* this does a unknown compliance double-precision move: */
7109   _tme_ieee754_unknown_double_move,
7110 
7111   /* this does a unknown compliance double-precision rint: */
7112   _tme_ieee754_strict_double_rint,
7113 
7114   /* this does a unknown compliance double-precision cos: */
7115   NULL,
7116 
7117   /* this does a unknown compliance double-precision acos: */
7118   NULL,
7119 
7120   /* this does a unknown compliance double-precision cosh: */
7121   NULL,
7122 
7123   /* this does a unknown compliance double-precision sin: */
7124   NULL,
7125 
7126   /* this does a unknown compliance double-precision asin: */
7127   NULL,
7128 
7129   /* this does a unknown compliance double-precision sinh: */
7130   NULL,
7131 
7132   /* this does a unknown compliance double-precision tan: */
7133   NULL,
7134 
7135   /* this does a unknown compliance double-precision atan: */
7136   NULL,
7137 
7138   /* this does a unknown compliance double-precision tanh: */
7139   NULL,
7140 
7141   /* this does a unknown compliance double-precision atanh: */
7142   NULL,
7143 
7144   /* this does a unknown compliance double-precision exp: */
7145   _tme_ieee754_unknown_double_exp,
7146 
7147   /* this does a unknown compliance double-precision expm1: */
7148   NULL,
7149 
7150   /* this does a unknown compliance double-precision log10: */
7151   _tme_ieee754_unknown_double_log10,
7152 
7153   /* this does a unknown compliance double-precision log: */
7154   _tme_ieee754_unknown_double_log,
7155 
7156   /* this does a unknown compliance double-precision log1p: */
7157   NULL,
7158 
7159   /* this does a unknown compliance double-precision getexp: */
7160   _tme_ieee754_strict_double_getexp,
7161 
7162   /* this does a unknown compliance double-precision getman: */
7163   _tme_ieee754_strict_double_getman,
7164 
7165   /* this does a unknown compliance double-precision scale: */
7166   _tme_ieee754_unknown_double_scale,
7167 
7168   /* this does a unknown compliance double-precision pow: */
7169   _tme_ieee754_unknown_double_pow,
7170 
7171   /* this does a unknown compliance double-precision from_single: */
7172   _tme_ieee754_strict_double_from_single,
7173 
7174   /* this does a unknown compliance double-precision from_extended80: */
7175   _tme_ieee754_strict_double_from_extended80,
7176 
7177   /* this does a unknown compliance double-precision from_quad: */
7178   _tme_ieee754_strict_double_from_quad,
7179 
7180   /* this does a unknown compliance double-precision from_int32: */
7181   _tme_ieee754_strict_double_from_int32,
7182 
7183   /* this does a unknown compliance double-precision from_int64: */
7184 #if (defined(TME_HAVE_INT64_T))
7185   _tme_ieee754_strict_double_from_int64,
7186 #else  /* !(defined(TME_HAVE_INT64_T)) */
7187   NULL,
7188 #endif /* !(defined(TME_HAVE_INT64_T)) */
7189 
7190   /* this does a unknown compliance double-precision to_int32: */
7191   _tme_ieee754_strict_double_to_int32,
7192 
7193   /* this does a unknown compliance double-precision to_int64: */
7194 #if (defined(TME_HAVE_INT64_T))
7195   _tme_ieee754_strict_double_to_int64,
7196 #else  /* !(defined(TME_HAVE_INT64_T)) */
7197   NULL,
7198 #endif /* !(defined(TME_HAVE_INT64_T)) */
7199 
7200   /* this does a unknown compliance extended80-precision add: */
7201   _tme_ieee754_unknown_extended80_add,
7202 
7203   /* this does a unknown compliance extended80-precision sub: */
7204   _tme_ieee754_unknown_extended80_sub,
7205 
7206   /* this does a unknown compliance extended80-precision mul: */
7207   _tme_ieee754_unknown_extended80_mul,
7208 
7209   /* this does a unknown compliance extended80-precision div: */
7210   _tme_ieee754_unknown_extended80_div,
7211 
7212   /* this does a unknown compliance extended80-precision rem: */
7213 #if (defined(TME_HAVE_INT64_T))
7214   _tme_ieee754_strict_extended80_rem,
7215 #else  /* !(defined(TME_HAVE_INT64_T)) */
7216   NULL,
7217 #endif /* !(defined(TME_HAVE_INT64_T)) */
7218 
7219   /* this does a unknown compliance extended80-precision sqrt: */
7220   _tme_ieee754_unknown_extended80_sqrt,
7221 
7222   /* this does a unknown compliance extended80-precision abs: */
7223   _tme_ieee754_unknown_extended80_abs,
7224 
7225   /* this does a unknown compliance extended80-precision neg: */
7226   _tme_ieee754_unknown_extended80_neg,
7227 
7228   /* this does a unknown compliance extended80-precision move: */
7229   _tme_ieee754_unknown_extended80_move,
7230 
7231   /* this does a unknown compliance extended80-precision rint: */
7232 #if (defined(TME_HAVE_INT64_T))
7233   _tme_ieee754_strict_extended80_rint,
7234 #else  /* !(defined(TME_HAVE_INT64_T)) */
7235   NULL,
7236 #endif /* !(defined(TME_HAVE_INT64_T)) */
7237 
7238   /* this does a unknown compliance extended80-precision cos: */
7239   NULL,
7240 
7241   /* this does a unknown compliance extended80-precision acos: */
7242   NULL,
7243 
7244   /* this does a unknown compliance extended80-precision cosh: */
7245   NULL,
7246 
7247   /* this does a unknown compliance extended80-precision sin: */
7248   NULL,
7249 
7250   /* this does a unknown compliance extended80-precision asin: */
7251   NULL,
7252 
7253   /* this does a unknown compliance extended80-precision sinh: */
7254   NULL,
7255 
7256   /* this does a unknown compliance extended80-precision tan: */
7257   NULL,
7258 
7259   /* this does a unknown compliance extended80-precision atan: */
7260   NULL,
7261 
7262   /* this does a unknown compliance extended80-precision tanh: */
7263   NULL,
7264 
7265   /* this does a unknown compliance extended80-precision atanh: */
7266   NULL,
7267 
7268   /* this does a unknown compliance extended80-precision exp: */
7269   _tme_ieee754_unknown_extended80_exp,
7270 
7271   /* this does a unknown compliance extended80-precision expm1: */
7272   NULL,
7273 
7274   /* this does a unknown compliance extended80-precision log10: */
7275   _tme_ieee754_unknown_extended80_log10,
7276 
7277   /* this does a unknown compliance extended80-precision log: */
7278   _tme_ieee754_unknown_extended80_log,
7279 
7280   /* this does a unknown compliance extended80-precision log1p: */
7281   NULL,
7282 
7283   /* this does a unknown compliance extended80-precision getexp: */
7284   _tme_ieee754_strict_extended80_getexp,
7285 
7286   /* this does a unknown compliance extended80-precision getman: */
7287   _tme_ieee754_strict_extended80_getman,
7288 
7289   /* this does a unknown compliance extended80-precision scale: */
7290   _tme_ieee754_unknown_extended80_scale,
7291 
7292   /* this does a unknown compliance extended80-precision pow: */
7293   _tme_ieee754_unknown_extended80_pow,
7294 
7295   /* this does a unknown compliance extended80-precision from_single: */
7296 #if (defined(TME_HAVE_INT64_T))
7297   _tme_ieee754_strict_extended80_from_single,
7298 #else  /* !(defined(TME_HAVE_INT64_T)) */
7299   NULL,
7300 #endif /* !(defined(TME_HAVE_INT64_T)) */
7301 
7302   /* this does a unknown compliance extended80-precision from_double: */
7303 #if (defined(TME_HAVE_INT64_T))
7304   _tme_ieee754_strict_extended80_from_double,
7305 #else  /* !(defined(TME_HAVE_INT64_T)) */
7306   NULL,
7307 #endif /* !(defined(TME_HAVE_INT64_T)) */
7308 
7309   /* this does a unknown compliance extended80-precision from_quad: */
7310 #if (defined(TME_HAVE_INT64_T))
7311   _tme_ieee754_strict_extended80_from_quad,
7312 #else  /* !(defined(TME_HAVE_INT64_T)) */
7313   NULL,
7314 #endif /* !(defined(TME_HAVE_INT64_T)) */
7315 
7316   /* this does a unknown compliance extended80-precision from_int32: */
7317 #if (defined(TME_HAVE_INT64_T))
7318   _tme_ieee754_strict_extended80_from_int32,
7319 #else  /* !(defined(TME_HAVE_INT64_T)) */
7320   NULL,
7321 #endif /* !(defined(TME_HAVE_INT64_T)) */
7322 
7323   /* this does a unknown compliance extended80-precision from_int64: */
7324 #if (defined(TME_HAVE_INT64_T))
7325   _tme_ieee754_strict_extended80_from_int64,
7326 #else  /* !(defined(TME_HAVE_INT64_T)) */
7327   NULL,
7328 #endif /* !(defined(TME_HAVE_INT64_T)) */
7329 
7330   /* this does a unknown compliance extended80-precision to_int32: */
7331   _tme_ieee754_strict_extended80_to_int32,
7332 
7333   /* this does a unknown compliance extended80-precision to_int64: */
7334 #if (defined(TME_HAVE_INT64_T))
7335   _tme_ieee754_strict_extended80_to_int64,
7336 #else  /* !(defined(TME_HAVE_INT64_T)) */
7337   NULL,
7338 #endif /* !(defined(TME_HAVE_INT64_T)) */
7339 
7340   /* this does a unknown compliance quad-precision add: */
7341   _tme_ieee754_unknown_quad_add,
7342 
7343   /* this does a unknown compliance quad-precision sub: */
7344   _tme_ieee754_unknown_quad_sub,
7345 
7346   /* this does a unknown compliance quad-precision mul: */
7347   _tme_ieee754_unknown_quad_mul,
7348 
7349   /* this does a unknown compliance quad-precision div: */
7350   _tme_ieee754_unknown_quad_div,
7351 
7352   /* this does a unknown compliance quad-precision rem: */
7353 #if (defined(TME_HAVE_INT64_T))
7354   _tme_ieee754_strict_quad_rem,
7355 #else  /* !(defined(TME_HAVE_INT64_T)) */
7356   NULL,
7357 #endif /* !(defined(TME_HAVE_INT64_T)) */
7358 
7359   /* this does a unknown compliance quad-precision sqrt: */
7360   _tme_ieee754_unknown_quad_sqrt,
7361 
7362   /* this does a unknown compliance quad-precision abs: */
7363   _tme_ieee754_unknown_quad_abs,
7364 
7365   /* this does a unknown compliance quad-precision neg: */
7366   _tme_ieee754_unknown_quad_neg,
7367 
7368   /* this does a unknown compliance quad-precision move: */
7369   _tme_ieee754_unknown_quad_move,
7370 
7371   /* this does a unknown compliance quad-precision rint: */
7372 #if (defined(TME_HAVE_INT64_T))
7373   _tme_ieee754_strict_quad_rint,
7374 #else  /* !(defined(TME_HAVE_INT64_T)) */
7375   NULL,
7376 #endif /* !(defined(TME_HAVE_INT64_T)) */
7377 
7378   /* this does a unknown compliance quad-precision cos: */
7379   NULL,
7380 
7381   /* this does a unknown compliance quad-precision acos: */
7382   NULL,
7383 
7384   /* this does a unknown compliance quad-precision cosh: */
7385   NULL,
7386 
7387   /* this does a unknown compliance quad-precision sin: */
7388   NULL,
7389 
7390   /* this does a unknown compliance quad-precision asin: */
7391   NULL,
7392 
7393   /* this does a unknown compliance quad-precision sinh: */
7394   NULL,
7395 
7396   /* this does a unknown compliance quad-precision tan: */
7397   NULL,
7398 
7399   /* this does a unknown compliance quad-precision atan: */
7400   NULL,
7401 
7402   /* this does a unknown compliance quad-precision tanh: */
7403   NULL,
7404 
7405   /* this does a unknown compliance quad-precision atanh: */
7406   NULL,
7407 
7408   /* this does a unknown compliance quad-precision exp: */
7409   _tme_ieee754_unknown_quad_exp,
7410 
7411   /* this does a unknown compliance quad-precision expm1: */
7412   NULL,
7413 
7414   /* this does a unknown compliance quad-precision log10: */
7415   _tme_ieee754_unknown_quad_log10,
7416 
7417   /* this does a unknown compliance quad-precision log: */
7418   _tme_ieee754_unknown_quad_log,
7419 
7420   /* this does a unknown compliance quad-precision log1p: */
7421   NULL,
7422 
7423   /* this does a unknown compliance quad-precision getexp: */
7424   _tme_ieee754_strict_quad_getexp,
7425 
7426   /* this does a unknown compliance quad-precision getman: */
7427   _tme_ieee754_strict_quad_getman,
7428 
7429   /* this does a unknown compliance quad-precision scale: */
7430   _tme_ieee754_unknown_quad_scale,
7431 
7432   /* this does a unknown compliance quad-precision pow: */
7433   _tme_ieee754_unknown_quad_pow,
7434 
7435   /* this does a unknown compliance quad-precision from_single: */
7436 #if (defined(TME_HAVE_INT64_T))
7437   _tme_ieee754_strict_quad_from_single,
7438 #else  /* !(defined(TME_HAVE_INT64_T)) */
7439   NULL,
7440 #endif /* !(defined(TME_HAVE_INT64_T)) */
7441 
7442   /* this does a unknown compliance quad-precision from_double: */
7443 #if (defined(TME_HAVE_INT64_T))
7444   _tme_ieee754_strict_quad_from_double,
7445 #else  /* !(defined(TME_HAVE_INT64_T)) */
7446   NULL,
7447 #endif /* !(defined(TME_HAVE_INT64_T)) */
7448 
7449   /* this does a unknown compliance quad-precision from_extended80: */
7450 #if (defined(TME_HAVE_INT64_T))
7451   _tme_ieee754_strict_quad_from_extended80,
7452 #else  /* !(defined(TME_HAVE_INT64_T)) */
7453   NULL,
7454 #endif /* !(defined(TME_HAVE_INT64_T)) */
7455 
7456   /* this does a unknown compliance quad-precision from_int32: */
7457 #if (defined(TME_HAVE_INT64_T))
7458   _tme_ieee754_strict_quad_from_int32,
7459 #else  /* !(defined(TME_HAVE_INT64_T)) */
7460   NULL,
7461 #endif /* !(defined(TME_HAVE_INT64_T)) */
7462 
7463   /* this does a unknown compliance quad-precision from_int64: */
7464 #if (defined(TME_HAVE_INT64_T))
7465   _tme_ieee754_strict_quad_from_int64,
7466 #else  /* !(defined(TME_HAVE_INT64_T)) */
7467   NULL,
7468 #endif /* !(defined(TME_HAVE_INT64_T)) */
7469 
7470   /* this does a unknown compliance quad-precision to_int32: */
7471   _tme_ieee754_strict_quad_to_int32,
7472 
7473   /* this does a unknown compliance quad-precision to_int64: */
7474 #if (defined(TME_HAVE_INT64_T))
7475   _tme_ieee754_strict_quad_to_int64,
7476 #else  /* !(defined(TME_HAVE_INT64_T)) */
7477   NULL,
7478 #endif /* !(defined(TME_HAVE_INT64_T)) */
7479 };
7480 
7481 /* this looks up an operations structure: */
7482 const struct tme_ieee754_ops *
tme_ieee754_ops_lookup(const char * compliance)7483 tme_ieee754_ops_lookup(const char *compliance)
7484 {
7485 
7486   if (TME_ARG_IS(compliance, "strict")) {
7487     return (&tme_ieee754_ops_strict);
7488   }
7489   if (TME_ARG_IS(compliance, "partial")) {
7490     return (&tme_ieee754_ops_partial);
7491   }
7492   if (TME_ARG_IS(compliance, "unknown")) {
7493     return (&tme_ieee754_ops_unknown);
7494   }
7495   return (NULL);
7496 }
7497 
7498 /* this is a compliance options string: */
7499 const char * const tme_ieee754_compliance_options = "{ strict | partial | unknown }";
7500