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