1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
|
#include <stdio.h>
#include <math.h>
#include <stdint.h>
#include <windows.h>
#include <ntstatus.h>
#include <winternl.h>
int __mingw_sprintf(char* buffer, const char* format, ...)
{
va_list args;
int ret;
va_start(args, format);
ret = vsprintf(buffer, format, args);
va_end(args);
return ret;
}
int __isnanf(float x)
{
union { float x; unsigned int i; } u = { x };
return (u.i & 0x7fffffff) > 0x7f800000;
}
int __isnan(double x)
{
union { double x; unsigned __int64 i; } u = { x };
return (u.i & ~0ull >> 1) > 0x7ffull << 52;
}
double math_error(int type, const char *name, double arg1, double arg2, double retval)
{
return retval;
}
int __fpclassify(double x)
{
union {double f; uint64_t i;} u = {x};
int e = u.i>>52 & 0x7ff;
if (!e) return u.i<<1 ? FP_SUBNORMAL : FP_ZERO;
if (e==0x7ff) return u.i<<12 ? FP_NAN : FP_INFINITE;
return FP_NORMAL;
}
int __fpclassifyf(float x)
{
union {float f; uint32_t i;} u = {x};
int e = u.i>>23 & 0xff;
if (!e) return u.i<<1 ? FP_SUBNORMAL : FP_ZERO;
if (e==0xff) return u.i<<9 ? FP_NAN : FP_INFINITE;
return FP_NORMAL;
}
int fegetround (void)
{
return 0;
}
int fesetround (int __rounding_direction)
{
return 0;
}
div_t __cdecl div(int num, int denom)
{
div_t ret;
ret.quot = num / denom;
ret.rem = num % denom;
return ret;
}
ldiv_t __cdecl ldiv(long num, long denom)
{
ldiv_t ret;
ret.quot = num / denom;
ret.rem = num % denom;
return ret;
}
void _assert (const char *_Message, const char *_File, unsigned _Line)
{
// NYI
}
|