|
|
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:
1.1.1.2 ! root 12: #ifndef UAE_FPP_IEEE_BE_H
! 13: #define UAE_FPP_IEEE_BE_H
! 14:
! 15: #include "uae/types.h"
! 16:
! 17:
1.1 root 18: STATIC_INLINE double to_single (uae_u32 value)
19: {
20: union {
21: float f;
22: uae_u32 u;
23: } val;
24:
25: val.u = value;
26: return val.f;
27: }
28:
29: STATIC_INLINE uae_u32 from_single (double src)
30: {
31: union {
32: float f;
33: uae_u32 u;
34: } val;
35:
36: val.f = src;
37: return val.u;
38: }
39:
40: STATIC_INLINE double to_double(uae_u32 wrd1, uae_u32 wrd2)
41: {
42: union {
43: double d;
44: uae_u32 u[2];
45: } val;
46:
47: val.u[0] = wrd1;
48: val.u[1] = wrd2;
49: return val.d;
50: }
51:
52: STATIC_INLINE void from_double(double src, uae_u32 * wrd1, uae_u32 * wrd2)
53: {
54: union {
55: double d;
56: uae_u32 u[2];
57: } val;
58:
59: val.d = src;
60: *wrd1 = val.u[0];
61: *wrd2 = val.u[1];
62: }
63:
64: #define HAVE_from_double
65: #define HAVE_to_double
66: #define HAVE_from_single
67: #define HAVE_to_single
68:
69: /* Get the rest of the conversion functions defined. */
70: #include "fpp-unknown.h"
1.1.1.2 ! root 71:
! 72: #endif /* UAE_FPP_IEEE_BE_H */
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.