|
|
1.1 root 1: /*
2: * UAE - The Un*x Amiga Emulator
3: *
4: * MC68881 emulation
5: * Support functions for IEEE compatible host CPUs.
6: * These functions use a GCC extension (type punning through unions) and
7: * should only be compiled with compilers that support this.
8: *
9: * Copyright 1999 Sam Jordan
10: */
11:
12: STATIC_INLINE double to_single (uae_u32 value)
13: {
14: union {
15: float f;
16: uae_u32 u;
17: } val;
18:
19: val.u = value;
20: return val.f;
21: }
22:
23: STATIC_INLINE uae_u32 from_single (double src)
24: {
25: union {
26: float f;
27: uae_u32 u;
28: } val;
29:
30: val.f = src;
31: return val.u;
32: }
33:
34: STATIC_INLINE double to_double(uae_u32 wrd1, uae_u32 wrd2)
35: {
36: union {
37: double d;
38: uae_u32 u[2];
39: } val;
40:
41: val.u[0] = wrd1;
42: val.u[1] = wrd2;
43: return val.d;
44: }
45:
46: STATIC_INLINE void from_double(double src, uae_u32 * wrd1, uae_u32 * wrd2)
47: {
48: union {
49: double d;
50: uae_u32 u[2];
51: } val;
52:
53: val.d = src;
54: *wrd1 = val.u[0];
55: *wrd2 = val.u[1];
56: }
57:
58: #define HAVE_from_double
59: #define HAVE_to_double
60: #define HAVE_from_single
61: #define HAVE_to_single
62:
63: /* Get the rest of the conversion functions defined. */
64: #include "fpp-unknown.h"
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.