[DDK]
[reactos.git] / include / crt / fpieee.h
1 /**
2 * This file has no copyright assigned and is placed in the Public Domain.
3 * This file is part of the w64 mingw-runtime package.
4 * No warranty is given; refer to the file DISCLAIMER within this package.
5 */
6 #ifndef _INC_FPIEEE
7 #define _INC_FPIEEE
8
9 #include <crtdefs.h>
10
11 #pragma pack(push,_CRT_PACKING)
12
13 #ifdef __cplusplus
14 extern "C" {
15 #endif
16
17 typedef enum {
18 _FpCompareEqual,_FpCompareGreater,_FpCompareLess,_FpCompareUnordered
19 } _FPIEEE_COMPARE_RESULT;
20
21 typedef enum {
22 _FpFormatFp32,_FpFormatFp64,_FpFormatFp80,_FpFormatFp128,_FpFormatI16,_FpFormatI32,_FpFormatI64,_FpFormatU16,_FpFormatU32,_FpFormatU64,_FpFormatBcd80,_FpFormatCompare,_FpFormatString,
23 #if defined(__ia64__)
24 _FpFormatFp82
25 #endif
26 } _FPIEEE_FORMAT;
27
28 typedef enum {
29 _FpCodeUnspecified,_FpCodeAdd,_FpCodeSubtract,_FpCodeMultiply,_FpCodeDivide,_FpCodeSquareRoot,_FpCodeRemainder,_FpCodeCompare,_FpCodeConvert,_FpCodeRound,_FpCodeTruncate,_FpCodeFloor,_FpCodeCeil,_FpCodeAcos,_FpCodeAsin,_FpCodeAtan,_FpCodeAtan2,_FpCodeCabs,_FpCodeCos,_FpCodeCosh,_FpCodeExp,_FpCodeFabs,_FpCodeFmod,_FpCodeFrexp,_FpCodeHypot,_FpCodeLdexp,_FpCodeLog,_FpCodeLog10,_FpCodeModf,_FpCodePow,_FpCodeSin,_FpCodeSinh,_FpCodeTan,_FpCodeTanh,_FpCodeY0,_FpCodeY1,_FpCodeYn,_FpCodeLogb,_FpCodeNextafter,_FpCodeNegate,_FpCodeFmin,_FpCodeFmax,_FpCodeConvertTrunc,_XMMIAddps,_XMMIAddss,_XMMISubps,_XMMISubss,_XMMIMulps,_XMMIMulss,_XMMIDivps,_XMMIDivss,_XMMISqrtps,_XMMISqrtss,_XMMIMaxps,_XMMIMaxss,_XMMIMinps,_XMMIMinss,_XMMICmpps,_XMMICmpss,_XMMIComiss,_XMMIUComiss,_XMMICvtpi2ps,_XMMICvtsi2ss,_XMMICvtps2pi,_XMMICvtss2si,_XMMICvttps2pi,_XMMICvttss2si,_XMMIAddsubps,_XMMIHaddps,_XMMIHsubps,_XMMI2Addpd,_XMMI2Addsd,_XMMI2Subpd,_XMMI2Subsd,_XMMI2Mulpd,_XMMI2Mulsd,_XMMI2Divpd,_XMMI2Divsd,_XMMI2Sqrtpd,_XMMI2Sqrtsd,_XMMI2Maxpd,_XMMI2Maxsd,_XMMI2Minpd,_XMMI2Minsd,_XMMI2Cmppd,_XMMI2Cmpsd,_XMMI2Comisd,_XMMI2UComisd,_XMMI2Cvtpd2pi,_XMMI2Cvtsd2si,_XMMI2Cvttpd2pi,_XMMI2Cvttsd2si,_XMMI2Cvtps2pd,_XMMI2Cvtss2sd,_XMMI2Cvtpd2ps,_XMMI2Cvtsd2ss,_XMMI2Cvtdq2ps,_XMMI2Cvttps2dq,_XMMI2Cvtps2dq,_XMMI2Cvttpd2dq,_XMMI2Cvtpd2dq,_XMMI2Addsubpd,_XMMI2Haddpd,_XMMI2Hsubpd,
30 #if defined(__ia64__)
31 _FpCodeFma,_FpCodeFmaSingle,_FpCodeFmaDouble,_FpCodeFms,_FpCodeFmsSingle,_FpCodeFmsDouble,_FpCodeFnma,_FpCodeFnmaSingle,_FpCodeFnmaDouble,_FpCodeFamin,_FpCodeFamax
32 #endif
33 } _FP_OPERATION_CODE;
34
35 typedef enum {
36 _FpRoundNearest,_FpRoundMinusInfinity,_FpRoundPlusInfinity,_FpRoundChopped
37 } _FPIEEE_ROUNDING_MODE;
38
39 typedef enum {
40 _FpPrecisionFull,_FpPrecision53,_FpPrecision24,
41 #if defined(__ia64__)
42 _FpPrecision64,_FpPrecision113
43 #endif
44 } _FPIEEE_PRECISION;
45
46 typedef float _FP32;
47 typedef double _FP64;
48 typedef short _I16;
49 typedef int _I32;
50 typedef unsigned short _U16;
51 typedef unsigned int _U32;
52 __MINGW_EXTENSION typedef __int64 _Q64;
53
54 typedef struct
55 #if defined(__ia64__)
56 _CRT_ALIGN(16)
57 #endif
58 {
59 unsigned short W[5];
60 } _FP80;
61
62 typedef struct _CRT_ALIGN(16) {
63 unsigned long W[4];
64 } _FP128;
65
66 typedef struct _CRT_ALIGN(8) {
67 unsigned long W[2];
68 } _I64;
69
70 typedef struct _CRT_ALIGN(8) {
71 unsigned long W[2];
72 } _U64;
73
74 typedef struct
75 #if defined(__ia64__)
76 _CRT_ALIGN(16)
77 #endif
78 {
79 unsigned short W[5];
80 } _BCD80;
81
82 typedef struct _CRT_ALIGN(16) {
83 _Q64 W[2];
84 } _FPQ64;
85
86 typedef struct {
87 union {
88 _FP32 Fp32Value;
89 _FP64 Fp64Value;
90 _FP80 Fp80Value;
91 _FP128 Fp128Value;
92 _I16 I16Value;
93 _I32 I32Value;
94 _I64 I64Value;
95 _U16 U16Value;
96 _U32 U32Value;
97 _U64 U64Value;
98 _BCD80 Bcd80Value;
99 char *StringValue;
100 int CompareValue;
101 _Q64 Q64Value;
102 _FPQ64 Fpq64Value;
103 } Value;
104 unsigned int OperandValid : 1;
105 unsigned int Format : 4;
106 } _FPIEEE_VALUE;
107
108 typedef struct {
109 unsigned int Inexact : 1;
110 unsigned int Underflow : 1;
111 unsigned int Overflow : 1;
112 unsigned int ZeroDivide : 1;
113 unsigned int InvalidOperation : 1;
114 } _FPIEEE_EXCEPTION_FLAGS;
115
116 typedef struct {
117 unsigned int RoundingMode : 2;
118 unsigned int Precision : 3;
119 unsigned int Operation :12;
120 _FPIEEE_EXCEPTION_FLAGS Cause;
121 _FPIEEE_EXCEPTION_FLAGS Enable;
122 _FPIEEE_EXCEPTION_FLAGS Status;
123 _FPIEEE_VALUE Operand1;
124 _FPIEEE_VALUE Operand2;
125 _FPIEEE_VALUE Result;
126 #if defined(__ia64__)
127 _FPIEEE_VALUE Operand3;
128 #endif
129 } _FPIEEE_RECORD,*_PFPIEEE_RECORD;
130
131 struct _EXCEPTION_POINTERS;
132
133 _CRTIMP int __cdecl _fpieee_flt(unsigned long _ExceptionCode,struct _EXCEPTION_POINTERS *_PtExceptionPtr,int (__cdecl *_Handler)(_FPIEEE_RECORD *));
134
135 #ifdef __cplusplus
136 }
137 #endif
138
139 #pragma pack(pop)
140 #endif