ReactOS  0.4.14-dev-614-gbfd8a84
float.h File Reference

Go to the source code of this file.

Macros

#define _MINGW_FLOAT_H_
 
#define _MCW_EM   0x0008001F /* Error masks */
 
#define _MCW_IC   0x00040000 /* Infinity */
 
#define _MCW_RC   0x00000300 /* Rounding */
 
#define _MCW_PC   0x00030000 /* Precision */
 
#define _EM_INVALID   0x00000010
 
#define _EM_DENORMAL   0x00080000
 
#define _EM_ZERODIVIDE   0x00000008
 
#define _EM_OVERFLOW   0x00000004
 
#define _EM_UNDERFLOW   0x00000002
 
#define _EM_INEXACT   0x00000001
 
#define _IC_AFFINE   0x00040000
 
#define _IC_PROJECTIVE   0x00000000
 
#define _RC_CHOP   0x00000300
 
#define _RC_UP   0x00000200
 
#define _RC_DOWN   0x00000100
 
#define _RC_NEAR   0x00000000
 
#define _PC_24   0x00020000
 
#define _PC_53   0x00010000
 
#define _PC_64   0x00000000
 
#define __MINGW_FPCLASS_DEFINED   1
 
#define _FPCLASS_SNAN   0x0001 /* Signaling "Not a Number" */
 
#define _FPCLASS_QNAN   0x0002 /* Quiet "Not a Number" */
 
#define _FPCLASS_NINF   0x0004 /* Negative Infinity */
 
#define _FPCLASS_NN   0x0008 /* Negative Normal */
 
#define _FPCLASS_ND   0x0010 /* Negative Denormal */
 
#define _FPCLASS_NZ   0x0020 /* Negative Zero */
 
#define _FPCLASS_PZ   0x0040 /* Positive Zero */
 
#define _FPCLASS_PD   0x0080 /* Positive Denormal */
 
#define _FPCLASS_PN   0x0100 /* Positive Normal */
 
#define _FPCLASS_PINF   0x0200 /* Positive Infinity */
 
#define _SW_INEXACT   0x00000001 /* inexact (precision) */
 
#define _SW_UNDERFLOW   0x00000002 /* underflow */
 
#define _SW_OVERFLOW   0x00000004 /* overflow */
 
#define _SW_ZERODIVIDE   0x00000008 /* zero divide */
 
#define _SW_INVALID   0x00000010 /* invalid */
 
#define _SW_DENORMAL   0x00080000 /* denormal status bit */
 
#define _SW_UNEMULATED   0x00000040 /* unemulated instruction */
 
#define _SW_SQRTNEG   0x00000080 /* square root of a neg number */
 
#define _SW_STACKOVERFLOW   0x00000200 /* FP stack overflow */
 
#define _SW_STACKUNDERFLOW   0x00000400 /* FP stack underflow */
 
#define _FPE_INVALID   0x81
 
#define _FPE_DENORMAL   0x82
 
#define _FPE_ZERODIVIDE   0x83
 
#define _FPE_OVERFLOW   0x84
 
#define _FPE_UNDERFLOW   0x85
 
#define _FPE_INEXACT   0x86
 
#define _FPE_UNEMULATED   0x87
 
#define _FPE_SQRTNEG   0x88
 
#define _FPE_STACKOVERFLOW   0x8a
 
#define _FPE_STACKUNDERFLOW   0x8b
 
#define _FPE_EXPLICITGEN   0x8c /* raise( SIGFPE ); */
 
#define DBL_MAX_10_EXP   308
 
#define UINT64_MAX   0xffffffffffffffff
 
#define _CRTIMP
 
#define _clear87   _clearfp
 
#define _status87   _statusfp
 
#define _fpecode   (*(__fpecode()))
 

Functions

_CRTIMP unsigned int __cdecl _controlfp (unsigned int unNew, unsigned int unMask)
 
_CRTIMP unsigned int __cdecl _control87 (unsigned int unNew, unsigned int unMask)
 
_CRTIMP unsigned int __cdecl _clearfp (void)
 
_CRTIMP unsigned int __cdecl _statusfp (void)
 
void __cdecl _fpreset (void)
 
void __cdecl fpreset (void)
 
_CRTIMP int *__cdecl __fpecode (void)
 
_CRTIMP double __cdecl _chgsign (double)
 
_CRTIMP double __cdecl _copysign (double, double)
 
_CRTIMP double __cdecl _logb (double)
 
_CRTIMP double __cdecl _nextafter (double, double)
 
_CRTIMP double __cdecl _scalb (double, long)
 
_CRTIMP int __cdecl _finite (double)
 
_CRTIMP int __cdecl _fpclass (double)
 
_CRTIMP int __cdecl _isnan (double)
 

Macro Definition Documentation

◆ __MINGW_FPCLASS_DEFINED

#define __MINGW_FPCLASS_DEFINED   1

Definition at line 62 of file float.h.

◆ _clear87

#define _clear87   _clearfp

Definition at line 131 of file float.h.

◆ _CRTIMP

#define _CRTIMP

Definition at line 118 of file float.h.

◆ _EM_DENORMAL

#define _EM_DENORMAL   0x00080000

Definition at line 43 of file float.h.

◆ _EM_INEXACT

#define _EM_INEXACT   0x00000001

Definition at line 47 of file float.h.

◆ _EM_INVALID

#define _EM_INVALID   0x00000010

Definition at line 42 of file float.h.

◆ _EM_OVERFLOW

#define _EM_OVERFLOW   0x00000004

Definition at line 45 of file float.h.

◆ _EM_UNDERFLOW

#define _EM_UNDERFLOW   0x00000002

Definition at line 46 of file float.h.

◆ _EM_ZERODIVIDE

#define _EM_ZERODIVIDE   0x00000008

Definition at line 44 of file float.h.

◆ _FPCLASS_ND

#define _FPCLASS_ND   0x0010 /* Negative Denormal */

Definition at line 67 of file float.h.

◆ _FPCLASS_NINF

#define _FPCLASS_NINF   0x0004 /* Negative Infinity */

Definition at line 65 of file float.h.

◆ _FPCLASS_NN

#define _FPCLASS_NN   0x0008 /* Negative Normal */

Definition at line 66 of file float.h.

◆ _FPCLASS_NZ

#define _FPCLASS_NZ   0x0020 /* Negative Zero */

Definition at line 68 of file float.h.

◆ _FPCLASS_PD

#define _FPCLASS_PD   0x0080 /* Positive Denormal */

Definition at line 70 of file float.h.

◆ _FPCLASS_PINF

#define _FPCLASS_PINF   0x0200 /* Positive Infinity */

Definition at line 72 of file float.h.

◆ _FPCLASS_PN

#define _FPCLASS_PN   0x0100 /* Positive Normal */

Definition at line 71 of file float.h.

◆ _FPCLASS_PZ

#define _FPCLASS_PZ   0x0040 /* Positive Zero */

Definition at line 69 of file float.h.

◆ _FPCLASS_QNAN

#define _FPCLASS_QNAN   0x0002 /* Quiet "Not a Number" */

Definition at line 64 of file float.h.

◆ _FPCLASS_SNAN

#define _FPCLASS_SNAN   0x0001 /* Signaling "Not a Number" */

Definition at line 63 of file float.h.

◆ _FPE_DENORMAL

#define _FPE_DENORMAL   0x82

Definition at line 90 of file float.h.

◆ _FPE_EXPLICITGEN

#define _FPE_EXPLICITGEN   0x8c /* raise( SIGFPE ); */

Definition at line 99 of file float.h.

◆ _FPE_INEXACT

#define _FPE_INEXACT   0x86

Definition at line 94 of file float.h.

◆ _FPE_INVALID

#define _FPE_INVALID   0x81

Definition at line 89 of file float.h.

◆ _FPE_OVERFLOW

#define _FPE_OVERFLOW   0x84

Definition at line 92 of file float.h.

◆ _FPE_SQRTNEG

#define _FPE_SQRTNEG   0x88

Definition at line 96 of file float.h.

◆ _FPE_STACKOVERFLOW

#define _FPE_STACKOVERFLOW   0x8a

Definition at line 97 of file float.h.

◆ _FPE_STACKUNDERFLOW

#define _FPE_STACKUNDERFLOW   0x8b

Definition at line 98 of file float.h.

◆ _FPE_UNDERFLOW

#define _FPE_UNDERFLOW   0x85

Definition at line 93 of file float.h.

◆ _FPE_UNEMULATED

#define _FPE_UNEMULATED   0x87

Definition at line 95 of file float.h.

◆ _FPE_ZERODIVIDE

#define _FPE_ZERODIVIDE   0x83

Definition at line 91 of file float.h.

◆ _fpecode

#define _fpecode   (*(__fpecode()))

Definition at line 149 of file float.h.

◆ _IC_AFFINE

#define _IC_AFFINE   0x00040000

Definition at line 48 of file float.h.

◆ _IC_PROJECTIVE

#define _IC_PROJECTIVE   0x00000000

Definition at line 49 of file float.h.

◆ _MCW_EM

#define _MCW_EM   0x0008001F /* Error masks */

Definition at line 36 of file float.h.

◆ _MCW_IC

#define _MCW_IC   0x00040000 /* Infinity */

Definition at line 37 of file float.h.

◆ _MCW_PC

#define _MCW_PC   0x00030000 /* Precision */

Definition at line 39 of file float.h.

◆ _MCW_RC

#define _MCW_RC   0x00000300 /* Rounding */

Definition at line 38 of file float.h.

◆ _MINGW_FLOAT_H_

#define _MINGW_FLOAT_H_

Definition at line 22 of file float.h.

◆ _PC_24

#define _PC_24   0x00020000

Definition at line 54 of file float.h.

◆ _PC_53

#define _PC_53   0x00010000

Definition at line 55 of file float.h.

◆ _PC_64

#define _PC_64   0x00000000

Definition at line 56 of file float.h.

◆ _RC_CHOP

#define _RC_CHOP   0x00000300

Definition at line 50 of file float.h.

◆ _RC_DOWN

#define _RC_DOWN   0x00000100

Definition at line 52 of file float.h.

◆ _RC_NEAR

#define _RC_NEAR   0x00000000

Definition at line 53 of file float.h.

◆ _RC_UP

#define _RC_UP   0x00000200

Definition at line 51 of file float.h.

◆ _status87

#define _status87   _statusfp

Definition at line 132 of file float.h.

◆ _SW_DENORMAL

#define _SW_DENORMAL   0x00080000 /* denormal status bit */

Definition at line 81 of file float.h.

◆ _SW_INEXACT

#define _SW_INEXACT   0x00000001 /* inexact (precision) */

Definition at line 76 of file float.h.

◆ _SW_INVALID

#define _SW_INVALID   0x00000010 /* invalid */

Definition at line 80 of file float.h.

◆ _SW_OVERFLOW

#define _SW_OVERFLOW   0x00000004 /* overflow */

Definition at line 78 of file float.h.

◆ _SW_SQRTNEG

#define _SW_SQRTNEG   0x00000080 /* square root of a neg number */

Definition at line 84 of file float.h.

◆ _SW_STACKOVERFLOW

#define _SW_STACKOVERFLOW   0x00000200 /* FP stack overflow */

Definition at line 85 of file float.h.

◆ _SW_STACKUNDERFLOW

#define _SW_STACKUNDERFLOW   0x00000400 /* FP stack underflow */

Definition at line 86 of file float.h.

◆ _SW_UNDERFLOW

#define _SW_UNDERFLOW   0x00000002 /* underflow */

Definition at line 77 of file float.h.

◆ _SW_UNEMULATED

#define _SW_UNEMULATED   0x00000040 /* unemulated instruction */

Definition at line 83 of file float.h.

◆ _SW_ZERODIVIDE

#define _SW_ZERODIVIDE   0x00000008 /* zero divide */

Definition at line 79 of file float.h.

◆ DBL_MAX_10_EXP

#define DBL_MAX_10_EXP   308

Definition at line 102 of file float.h.

◆ UINT64_MAX

#define UINT64_MAX   0xffffffffffffffff

Definition at line 105 of file float.h.

Function Documentation

◆ __fpecode()

_CRTIMP int* __cdecl __fpecode ( void  )

Definition at line 16 of file fpecode.c.

17 {
18  return &msvcrt_get_thread_data()->fpecode;
19 }
thread_data_t * msvcrt_get_thread_data(void)
Definition: tls.c:31

◆ _chgsign()

_CRTIMP double __cdecl _chgsign ( double  )

Definition at line 18 of file chgsign.c.

19 {
20  union
21  {
22  double* __x;
23  double_s *x;
24  } u;
25  u.__x = &__x;
26 
27  if ( u.x->sign == 1 )
28  u.x->sign = 0;
29  else
30  u.x->sign = 1;
31 
32  return __x;
33 }
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble * u
Definition: glfuncs.h:240
Definition: ieee.h:10
GLint GLint GLint GLint GLint x
Definition: gl.h:1548

◆ _clearfp()

_CRTIMP unsigned int __cdecl _clearfp ( void  )

Definition at line 18 of file clearfp.c.

19 {
20  unsigned int retVal = _statusfp();
21 #if defined(__GNUC__)
22  __asm__ __volatile__( "fnclex" );
23 #else
24  __asm fnclex;
25 #endif
26  return retVal;
27 }
unsigned int _statusfp(void)
Definition: statfp.c:25
__asm__("\t.globl GetPhys\n" "GetPhys:\t\n" "mflr 0\n\t" "stwu 0,-16(1)\n\t" "mfmsr 5\n\t" "andi. 6,5,0xffef\n\t" "mtmsr 6\n\t" "isync\n\t" "sync\n\t" "lwz 3,0(3)\n\t" "mtmsr 5\n\t" "isync\n\t" "sync\n\t" "lwz 0,0(1)\n\t" "addi 1,1,16\n\t" "mtlr 0\n\t" "blr")

◆ _control87()

_CRTIMP unsigned int __cdecl _control87 ( unsigned int  unNew,
unsigned int  unMask 
)

Definition at line 43 of file cntrlfp.c.

44 {
45  unsigned short fpword = 0;
46  unsigned int flags = 0;
47 
48  TRACE("(%08x, %08x): Called\n", newval, mask);
49 
50  /* Get fp control word */
51 #ifdef _M_AMD64
52  fpword = __getfpcw87();
53 #elif defined(__GNUC__)
54  __asm__ __volatile__( "fstcw %0" : "=m" (fpword) : );
55 #else
56  __asm fstcw [fpword];
57 #endif
58 
59  TRACE("Control word before : %08x\n", fpword);
60 
61  /* Convert into mask constants */
62  if (fpword & 0x1) flags |= _EM_INVALID;
63  if (fpword & 0x2) flags |= _EM_DENORMAL;
64  if (fpword & 0x4) flags |= _EM_ZERODIVIDE;
65  if (fpword & 0x8) flags |= _EM_OVERFLOW;
66  if (fpword & 0x10) flags |= _EM_UNDERFLOW;
67  if (fpword & 0x20) flags |= _EM_INEXACT;
68  switch(fpword & 0xC00) {
69  case 0xC00: flags |= _RC_UP|_RC_DOWN; break;
70  case 0x800: flags |= _RC_UP; break;
71  case 0x400: flags |= _RC_DOWN; break;
72  }
73  switch(fpword & 0x300) {
74  case 0x0: flags |= _PC_24; break;
75  case 0x200: flags |= _PC_53; break;
76  case 0x300: flags |= _PC_64; break;
77  }
78  if (fpword & 0x1000) flags |= _IC_AFFINE;
79 
80  /* Mask with parameters */
81  flags = (flags & ~mask) | (newval & mask);
82 
83  /* Convert (masked) value back to fp word */
84  fpword = 0;
85  if (flags & _EM_INVALID) fpword |= 0x1;
86  if (flags & _EM_DENORMAL) fpword |= 0x2;
87  if (flags & _EM_ZERODIVIDE) fpword |= 0x4;
88  if (flags & _EM_OVERFLOW) fpword |= 0x8;
89  if (flags & _EM_UNDERFLOW) fpword |= 0x10;
90  if (flags & _EM_INEXACT) fpword |= 0x20;
91  switch(flags & (_RC_UP | _RC_DOWN)) {
92  case _RC_UP|_RC_DOWN: fpword |= 0xC00; break;
93  case _RC_UP: fpword |= 0x800; break;
94  case _RC_DOWN: fpword |= 0x400; break;
95  }
96  switch (flags & (_PC_24 | _PC_53)) {
97  case _PC_64: fpword |= 0x300; break;
98  case _PC_53: fpword |= 0x200; break;
99  case _PC_24: fpword |= 0x0; break;
100  }
101  if (flags & _IC_AFFINE) fpword |= 0x1000;
102 
103  TRACE("Control word after : %08x\n", fpword);
104 
105  /* Put fp control word */
106 #ifdef _M_AMD64
107  __setfpcw87(fpword);
108 #elif defined(__GNUC__)
109  __asm__ __volatile__( "fldcw %0" : : "m" (fpword) );
110 #else
111  __asm fldcw [fpword];
112 #endif
113 
114  return flags;
115 }
#define _PC_24
Definition: float.h:59
#define _EM_DENORMAL
Definition: float.h:48
#define _PC_53
Definition: float.h:60
_In_ CLIPOBJ _In_ BRUSHOBJ _In_ LONG x1
Definition: winddi.h:3706
#define _EM_INVALID
Definition: float.h:47
#define _EM_ZERODIVIDE
Definition: float.h:49
GLenum GLint GLuint mask
Definition: glext.h:6028
__asm__("\t.globl GetPhys\n" "GetPhys:\t\n" "mflr 0\n\t" "stwu 0,-16(1)\n\t" "mfmsr 5\n\t" "andi. 6,5,0xffef\n\t" "mtmsr 6\n\t" "isync\n\t" "sync\n\t" "lwz 3,0(3)\n\t" "mtmsr 5\n\t" "isync\n\t" "sync\n\t" "lwz 0,0(1)\n\t" "addi 1,1,16\n\t" "mtlr 0\n\t" "blr")
#define _RC_UP
Definition: float.h:56
#define TRACE(s)
Definition: solgame.cpp:4
#define _IC_AFFINE
Definition: float.h:53
GLbitfield flags
Definition: glext.h:7161
#define _EM_INEXACT
Definition: float.h:52
#define _PC_64
Definition: float.h:61
#define _EM_OVERFLOW
Definition: float.h:50
_In_ CLIPOBJ _In_ BRUSHOBJ _In_ LONG _In_ LONG _In_ LONG x2
Definition: winddi.h:3706
#define _RC_DOWN
Definition: float.h:57
#define _EM_UNDERFLOW
Definition: float.h:51

Referenced by _controlfp().

◆ _controlfp()

_CRTIMP unsigned int __cdecl _controlfp ( unsigned int  unNew,
unsigned int  unMask 
)

Definition at line 35 of file cntrlfp.c.

36 {
37  return _control87( newval, mask & ~_EM_DENORMAL );
38 }
#define _EM_DENORMAL
Definition: float.h:48
GLenum GLint GLuint mask
Definition: glext.h:6028
unsigned int CDECL _control87(unsigned int newval, unsigned int mask)
Definition: cntrlfp.c:43

Referenced by _controlfp_s().

◆ _copysign()

_CRTIMP double __cdecl _copysign ( double  ,
double   
)

Definition at line 17 of file copysign.c.

18 {
19  union
20  {
21  double* __d;
22  double_s* d;
23  } d;
24  union
25  {
26  double* __s;
27  double_s* s;
28  } s;
29  d.__d = &__d;
30  s.__s = &__s;
31 
32  d.d->sign = s.s->sign;
33 
34  return __d;
35 }
Definition: ieee.h:10
#define d
Definition: ke_i.h:81
GLdouble s
Definition: gl.h:2039

◆ _finite()

_CRTIMP int __cdecl _finite ( double  )

Definition at line 43 of file isnan.c.

44 {
45  union
46  {
47  double* __x;
48  double_s* x;
49  } x;
50 
51  x.__x = &__x;
52 
53  return ((x.x->exponent & 0x7ff) != 0x7ff);
54 }
Definition: ieee.h:10
GLint GLint GLint GLint GLint x
Definition: gl.h:1548

◆ _fpclass()

_CRTIMP int __cdecl _fpclass ( double  )

Definition at line 17 of file fpclass.c.

18 {
19  union
20  {
21  double* __d;
22  double_s* d;
23  } d;
24  d.__d = &__d;
25 
26 
27  /* With 0x7ff, it can only be infinity or NaN */
28  if (d.d->exponent == 0x7ff)
29  {
30  if (d.d->mantissah == 0 && d.d->mantissal == 0)
31  {
32  return (d.d->sign == 0) ? _FPCLASS_PINF : _FPCLASS_NINF;
33  }
34  /* Windows will never return Signaling NaN */
35  else
36  {
37  return _FPCLASS_QNAN;
38  }
39  }
40 
41  /* With 0, it can only be zero or denormalized number */
42  if (d.d->exponent == 0)
43  {
44  if (d.d->mantissah == 0 && d.d->mantissal == 0)
45  {
46  return (d.d->sign == 0) ? _FPCLASS_PZ : _FPCLASS_NZ;
47  }
48  else
49  {
50  return (d.d->sign == 0) ? _FPCLASS_PD : _FPCLASS_ND;
51  }
52  }
53  /* Only remain normalized numbers */
54  else
55  {
56  return (d.d->sign == 0) ? _FPCLASS_PN : _FPCLASS_NN;
57  }
58 }
#define _FPCLASS_PN
Definition: float.h:76
#define _FPCLASS_NZ
Definition: float.h:73
#define _FPCLASS_PINF
Definition: float.h:77
#define _FPCLASS_NN
Definition: float.h:71
Definition: ieee.h:10
#define _FPCLASS_PZ
Definition: float.h:74
#define _FPCLASS_PD
Definition: float.h:75
#define d
Definition: ke_i.h:81
#define _FPCLASS_ND
Definition: float.h:72
#define _FPCLASS_NINF
Definition: float.h:70
#define _FPCLASS_QNAN
Definition: float.h:69

◆ _fpreset()

void __cdecl _fpreset ( void  )

Definition at line 13 of file fpreset.c.

14 {
15  const unsigned short x86_cw = 0x27f;
16 #ifdef _MSC_VER
17  __asm { fninit }
18  __asm { fldcw [x86_cw] }
19 #else
20  __asm__ __volatile__( "fninit; fldcw %0" : : "m" (x86_cw) );
21 #endif
23  {
24  const unsigned long sse2_cw = 0x1f80;
25 #ifdef _MSC_VER
26  __asm { ldmxcsr [sse2_cw] }
27 #else
28  __asm__ __volatile__( "ldmxcsr %0" : : "m" (sse2_cw) );
29 #endif
30  }
31 }
__asm__("\t.globl GetPhys\n" "GetPhys:\t\n" "mflr 0\n\t" "stwu 0,-16(1)\n\t" "mfmsr 5\n\t" "andi. 6,5,0xffef\n\t" "mtmsr 6\n\t" "isync\n\t" "sync\n\t" "lwz 3,0(3)\n\t" "mtmsr 5\n\t" "isync\n\t" "sync\n\t" "lwz 0,0(1)\n\t" "addi 1,1,16\n\t" "mtlr 0\n\t" "blr")
BOOL WINAPI IsProcessorFeaturePresent(IN DWORD ProcessorFeature)
Definition: sysinfo.c:168
#define PF_XMMI64_INSTRUCTIONS_AVAILABLE

◆ _isnan()

_CRTIMP int __cdecl _isnan ( double  )

Definition at line 29 of file isnan.c.

30 {
31  union
32  {
33  double* __x;
34  double_s* x;
35  } x;
36  x.__x = &__x;
37  return ( x.x->exponent == 0x7ff && ( x.x->mantissah != 0 || x.x->mantissal != 0 ));
38 }
Definition: ieee.h:10
GLint GLint GLint GLint GLint x
Definition: gl.h:1548

◆ _logb()

Definition at line 24 of file logb.c.

25 {
26  register double __val;
27 #ifdef __GNUC__
28  register double __junk;
29  __asm __volatile__
30  ("fxtract\n\t"
31  : "=t" (__junk), "=u" (__val) : "0" (__x));
32 #else
33 #pragma message ("REVIEW ME")
34  __asm fld [__x];
35  __asm fxtract;
36  __asm fstp st(0);
37  __asm fstp [__val];
38 #endif /*__GNUC__*/
39  return __val;
40 }
_STLP_INLINE_LOOP _InputIter const _Tp & __val
Definition: _algobase.h:656

◆ _nextafter()

_CRTIMP double __cdecl _nextafter ( double  ,
double   
)

Definition at line 16 of file nafter.c.

17 {
18  WARN("This function is not implemented correctly\n");
19  if ( x == y)
20  return x;
21 
22  if ( _isnan(x) || _isnan(y) )
23  return x;
24 
25  return x;
26 }
_Check_return_ __MINGW_NOTHROW _CRTIMP int __cdecl _isnan(_In_ double)
#define WARN(fmt,...)
Definition: debug.h:111
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
GLint GLint GLint GLint GLint GLint y
Definition: gl.h:1548

◆ _scalb()

_CRTIMP double __cdecl _scalb ( double  ,
long   
)

Definition at line 14 of file scalb.c.

15 {
16  return ldexp(x, exp);
17 }
_Check_return_ _CRTIMP double __cdecl ldexp(_In_ double x, _In_ int y)
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
DWORD exp
Definition: msg.c:16038

◆ _statusfp()

_CRTIMP unsigned int __cdecl _statusfp ( void  )

Definition at line 25 of file statfp.c.

26 {
27  unsigned int retVal = 0;
28  unsigned short fpword;
29 
30 #ifdef _M_AMD64
31  fpword = _mm_getcsr();
32 #elif defined(__GNUC__)
33  __asm__ __volatile__( "fstsw %0" : "=m" (fpword) : );
34 #else // _MSC_VER
35  __asm fstsw [fpword];
36 #endif
37  if (fpword & 0x1) retVal |= _SW_INVALID;
38  if (fpword & 0x2) retVal |= _SW_DENORMAL;
39  if (fpword & 0x4) retVal |= _SW_ZERODIVIDE;
40  if (fpword & 0x8) retVal |= _SW_OVERFLOW;
41  if (fpword & 0x10) retVal |= _SW_UNDERFLOW;
42  if (fpword & 0x20) retVal |= _SW_INEXACT;
43  return retVal;
44 }
#define _SW_ZERODIVIDE
Definition: statfp.c:16
_In_ CLIPOBJ _In_ BRUSHOBJ _In_ LONG x1
Definition: winddi.h:3706
#define _SW_INEXACT
Definition: statfp.c:19
__asm__("\t.globl GetPhys\n" "GetPhys:\t\n" "mflr 0\n\t" "stwu 0,-16(1)\n\t" "mfmsr 5\n\t" "andi. 6,5,0xffef\n\t" "mtmsr 6\n\t" "isync\n\t" "sync\n\t" "lwz 3,0(3)\n\t" "mtmsr 5\n\t" "isync\n\t" "sync\n\t" "lwz 0,0(1)\n\t" "addi 1,1,16\n\t" "mtlr 0\n\t" "blr")
#define _SW_DENORMAL
Definition: statfp.c:20
__INTRIN_INLINE unsigned int _mm_getcsr(void)
Definition: xmmintrin.h:55
#define _SW_UNDERFLOW
Definition: statfp.c:17
#define _SW_INVALID
Definition: statfp.c:15
#define _SW_OVERFLOW
Definition: statfp.c:18
_In_ CLIPOBJ _In_ BRUSHOBJ _In_ LONG _In_ LONG _In_ LONG x2
Definition: winddi.h:3706

◆ fpreset()

void __cdecl fpreset ( void  )