ReactOS 0.4.16-dev-257-g6aa11ac
libm_new.h
Go to the documentation of this file.
1
2/***********************************************************************************/
25/***********************************************************************************/
26
27#ifndef __LIBM_NEW_H__
28#define __LIBM_NEW_H__
29
30// Defines, protos, etc for *new* math funcs updated by AMD 11/2008
31// Old files will continue to include libm_util.h, libm.h, libm_inlines.h
32// until such time as these have all been refreshed w/ new versions.
33
34typedef float F32;
35typedef unsigned int U32;
36
37typedef double F64;
38typedef unsigned long long U64;
39
40union UT32_
41{
44};
45
46union UT64_
47{
50
51 F32 f32[2];
52 U32 u32[2];
53};
54
55typedef union UT32_ UT32;
56typedef union UT64_ UT64;
57
58#define SIGN_MASK_32 0x80000000
59#define MANTISSA_MASK_32 0x007fffff
60#define EXPONENT_MASK_32 0x7f800000
61#define QNAN_MASK_32 0x00400000
62
63#define INF_POS_32 0x7f800000
64#define INF_NEG_32 0xff800000
65#define QNAN_POS_32 0x7fc00000
66#define QNAN_NEG_32 0xffc00000
67#define IND_32 0xffc00000
68
69#define EXPONENT_FULL_32 0x7f800000
70#define SIGN_SET_32 0x80000000
71#define QNAN_SET_32 0x00400000
72
73#define INF_POS_64 0x7ff0000000000000
74#define INF_NEG_64 0xfff0000000000000
75
76#define MANTISSA_MASK_64 0x000fffffffffffff
77#define SIGN_MASK_64 0x8000000000000000
78#define IND_64 0xfff8000000000000
79#define QNAN_MASK_64 0x0008000000000000
80
81// constants for 'flags' argument of _handle_error and _handle_errorf
82#define AMD_F_INEXACT 0x00000010
83#define AMD_F_OVERFLOW 0x00000001
84#define AMD_F_UNDERFLOW 0x00000002
85#define AMD_F_DIVBYZERO 0x00000004
86#define AMD_F_INVALID 0x00000008
87
88// define the Microsoft specific error handling routine
89
90// Note to mainainers:
91// These prototypes may appear, at first glance, to differ from the versions
92// declared in libm_inlines.h and defined in libm_error.c. The third
93// parameter appears to have changed type from unsigned long to unsigned long
94// long. In fact they are the same because in both of the aforementioned
95// files, long has been #defined to __int64 in a most cowardly fashion. This
96// disgusts me. The buck stops here. - MAS
97
98double _handle_error(
99 char *fname,
100 int opcode,
101 unsigned long long value,
102 int type,
103 int flags,
104 int error,
105 double arg1,
106 double arg2,
107 int nargs
108 );
109float _handle_errorf(
110 char *fname,
111 int opcode,
112 unsigned long long value,
113 int type,
114 int flags,
115 int error,
116 float arg1,
117 float arg2,
118 int nargs
119 );
120
121#endif // __LIBM_NEW_H
122
ULONG32 u32
Definition: btrfs.h:14
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
GLuint GLuint GLuint GLuint arg1
Definition: glext.h:9513
GLuint GLuint GLuint GLuint GLuint GLuint GLuint arg2
Definition: glext.h:9514
GLbitfield flags
Definition: glext.h:7161
unsigned long long U64
Definition: libm_new.h:38
float _handle_errorf(char *fname, int opcode, unsigned long long value, int type, int flags, int error, float arg1, float arg2, int nargs)
Definition: _handle_error.c:56
float F32
Definition: libm_new.h:34
unsigned int U32
Definition: libm_new.h:35
double F64
Definition: libm_new.h:37
double _handle_error(char *fname, int opcode, unsigned long long value, int type, int flags, int error, double arg1, double arg2, int nargs)
Handles an error condition.
Definition: _handle_error.c:34
#define error(str)
Definition: mkdosfs.c:1605
Definition: libm_new.h:41
F32 f32
Definition: libm_new.h:42
U32 u32
Definition: libm_new.h:43
Definition: libm_new.h:47
F64 f64
Definition: libm_new.h:48
U64 u64
Definition: libm_new.h:49
F32 f32[2]
Definition: libm_new.h:51
Definition: pdh_main.c:94