fpieee.h 4.6 KB

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