ReactOS Fundraising Campaign 2012
 
€ 4,410 / € 30,000

Information | Donate

Home | Info | Community | Development | myReactOS | Contact Us

  1. Home
  2. Community
  3. Development
  4. myReactOS
  5. Fundraiser 2012

  1. Main Page
  2. Alphabetical List
  3. Data Structures
  4. Directories
  5. File List
  6. Data Fields
  7. Globals
  8. Related Pages

ReactOS Development > Doxygen

statfp.c
Go to the documentation of this file.
00001 /*
00002  * COPYRIGHT:   See COPYING in the top level directory
00003  * PROJECT:     ReactOS system libraries
00004  * FILE:        lib/crt/??????
00005  * PURPOSE:     Unknown
00006  * PROGRAMER:   Unknown
00007  * UPDATE HISTORY:
00008  *              25/11/05: Added license header
00009  */
00010 
00011 #include <precomp.h>
00012 #include "float.h"
00013 
00014 //WTF IS HAPPENING WITH float.h !??!?!
00015 #define _SW_INVALID    0x00000010 /* invalid */
00016 #define _SW_ZERODIVIDE 0x00000008 /* zero divide */
00017 #define _SW_UNDERFLOW  0x00000002 /* underflow */
00018 #define _SW_OVERFLOW   0x00000004 /* overflow */
00019 #define _SW_INEXACT    0x00000001 /* inexact (precision) */
00020 #define _SW_DENORMAL    0x00080000 /* denormal status bit */
00021 
00022 /**********************************************************************
00023  *      _statusfp (MSVCRT.@)
00024  */
00025 unsigned int CDECL _statusfp(void)
00026 {
00027   unsigned int retVal = 0;
00028   unsigned int fpword;
00029 
00030 #ifdef _M_AMD64
00031     fpword = _mm_getcsr();
00032 #elif defined(__GNUC__)
00033   __asm__ __volatile__( "fstsw %0" : "=m" (fpword) : );
00034 #else // _MSC_VER
00035   __asm fstsw [fpword];
00036 #endif
00037   if (fpword & 0x1)  retVal |= _SW_INVALID;
00038   if (fpword & 0x2)  retVal |= _SW_DENORMAL;
00039   if (fpword & 0x4)  retVal |= _SW_ZERODIVIDE;
00040   if (fpword & 0x8)  retVal |= _SW_OVERFLOW;
00041   if (fpword & 0x10) retVal |= _SW_UNDERFLOW;
00042   if (fpword & 0x20) retVal |= _SW_INEXACT;
00043   return retVal;
00044 }

Generated on Sat May 26 2012 04:35:26 for ReactOS by doxygen 1.7.6.1

ReactOS is a registered trademark or a trademark of ReactOS Foundation in the United States and other countries.