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