ReactOS 0.4.15-dev-7906-g1b85a5f
libm_new.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.


union  UT32_
union  UT64_


#define SIGN_MASK_32   0x80000000
#define MANTISSA_MASK_32   0x007fffff
#define EXPONENT_MASK_32   0x7f800000
#define QNAN_MASK_32   0x00400000
#define INF_POS_32   0x7f800000
#define INF_NEG_32   0xff800000
#define QNAN_POS_32   0x7fc00000
#define QNAN_NEG_32   0xffc00000
#define IND_32   0xffc00000
#define EXPONENT_FULL_32   0x7f800000
#define SIGN_SET_32   0x80000000
#define QNAN_SET_32   0x00400000
#define INF_POS_64   0x7ff0000000000000
#define INF_NEG_64   0xfff0000000000000
#define MANTISSA_MASK_64   0x000fffffffffffff
#define SIGN_MASK_64   0x8000000000000000
#define IND_64   0xfff8000000000000
#define QNAN_MASK_64   0x0008000000000000
#define AMD_F_INEXACT   0x00000010
#define AMD_F_OVERFLOW   0x00000001
#define AMD_F_UNDERFLOW   0x00000002
#define AMD_F_DIVBYZERO   0x00000004
#define AMD_F_INVALID   0x00000008


typedef float F32
typedef unsigned int U32
typedef double F64
typedef unsigned long long U64
typedef union UT32_ UT32
typedef union UT64_ UT64


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.
float _handle_errorf (char *fname, int opcode, unsigned long long value, int type, int flags, int error, float arg1, float arg2, int nargs)

Macro Definition Documentation


#define AMD_F_DIVBYZERO   0x00000004

Definition at line 85 of file libm_new.h.


#define AMD_F_INEXACT   0x00000010

Definition at line 82 of file libm_new.h.


#define AMD_F_INVALID   0x00000008

Definition at line 86 of file libm_new.h.


#define AMD_F_OVERFLOW   0x00000001

Definition at line 83 of file libm_new.h.


#define AMD_F_UNDERFLOW   0x00000002

Definition at line 84 of file libm_new.h.


#define EXPONENT_FULL_32   0x7f800000

Definition at line 69 of file libm_new.h.


#define EXPONENT_MASK_32   0x7f800000

Definition at line 60 of file libm_new.h.

◆ IND_32

#define IND_32   0xffc00000

Definition at line 67 of file libm_new.h.

◆ IND_64

#define IND_64   0xfff8000000000000

Definition at line 78 of file libm_new.h.

◆ INF_NEG_32

#define INF_NEG_32   0xff800000

Definition at line 64 of file libm_new.h.

◆ INF_NEG_64

#define INF_NEG_64   0xfff0000000000000

Definition at line 74 of file libm_new.h.

◆ INF_POS_32

#define INF_POS_32   0x7f800000

Definition at line 63 of file libm_new.h.

◆ INF_POS_64

#define INF_POS_64   0x7ff0000000000000

Definition at line 73 of file libm_new.h.


#define MANTISSA_MASK_32   0x007fffff

Definition at line 59 of file libm_new.h.


#define MANTISSA_MASK_64   0x000fffffffffffff

Definition at line 76 of file libm_new.h.


#define QNAN_MASK_32   0x00400000

Definition at line 61 of file libm_new.h.


#define QNAN_MASK_64   0x0008000000000000

Definition at line 79 of file libm_new.h.


#define QNAN_NEG_32   0xffc00000

Definition at line 66 of file libm_new.h.


#define QNAN_POS_32   0x7fc00000

Definition at line 65 of file libm_new.h.


#define QNAN_SET_32   0x00400000

Definition at line 71 of file libm_new.h.


#define SIGN_MASK_32   0x80000000

Definition at line 58 of file libm_new.h.


#define SIGN_MASK_64   0x8000000000000000

Definition at line 77 of file libm_new.h.


#define SIGN_SET_32   0x80000000

Definition at line 70 of file libm_new.h.

Typedef Documentation

◆ F32

typedef float F32

MIT License

Copyright (c) 2002-2019 Advanced Micro Devices, Inc. Permission is hereby granted, free of charge, to any person obtaining a copy of this Software and associated documentaon files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Definition at line 34 of file libm_new.h.

◆ F64

typedef double F64

Definition at line 37 of file libm_new.h.

◆ U32

typedef unsigned int U32

Definition at line 35 of file libm_new.h.

◆ U64

typedef unsigned long long U64

Definition at line 38 of file libm_new.h.

◆ UT32

typedef union UT32_ UT32

Definition at line 55 of file libm_new.h.

◆ UT64

typedef union UT64_ UT64

Definition at line 56 of file libm_new.h.

Function Documentation

◆ _handle_error()

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.

fname- The name of the function that caused the error.
opcode- Opcode of the function that cause the error (see OP_* consants in fpieee.h).
value- The value to be returned, encoded as uint64_t.
type- The type of error (see _DOMAIN, ... in math.h)
flags- Exception flags (see AMD_F_* constants).
error- Specifies the CRT error code (EDOM, ...).
arg1- First parameter to the function that cause the error.
arg2- Second parameter to the function that cause the error.
nargs- Number of parameters to the function that cause the error.
The value to be returned.

Definition at line 34 of file _handle_error.c.

45 float retval = *(double*)&value;
47 _invoke_matherr(type, fname, arg1, arg2, retval);
49 return retval;
int __cdecl _invoke_matherr(int type, char *name, double arg1, double arg2, double retval)
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
Definition: pdh_main.c:94

Referenced by _exp2(), _exp_special(), _hypot(), _log_special_common(), _logb(), _pow_special(), _sincos_special(), acos(), asin(), atan(), atan2(), ceil(), cosh(), floor(), remainder(), sinh(), sqrt(), tan(), and tanh().

◆ _handle_errorf()

float _handle_errorf ( char fname,
int  opcode,
unsigned long long  value,
int  type,
int  flags,
int  error,
float  arg1,
float  arg2,
int  nargs 

Definition at line 56 of file _handle_error.c.

67 float retval = *(float*)&value;
69 _invoke_matherr(type, fname, arg1, arg2, retval);
71 return retval;

Referenced by _expf_special(), _hypotf(), _logbf(), _logf_special_common(), _powf_special(), _sincosf_special(), acosf(), asinf(), atan2f(), atanf(), ceilf(), coshf(), floorf(), remainderf(), sinhf(), sqrtf(), tanf(), and tanhf().