void DisplayFPStatusBits(char *tag)
{
	unsigned long status;

	status = _statusfp();
	if ((status != 0x00000000) && (status != 0x00000001))
	{
		if (tag != NULL)
			printf("%s ", tag);
		printf("FPU Status: %08.8X ( ", status);
		if (status & _SW_DENORMAL)
			printf("DENORMAL ");
		if (status & _SW_INVALID)
			printf("INVALID ");
		if (status & _SW_ZERODIVIDE)
			printf("DIV0 ");
		if (status & _SW_OVERFLOW)
			printf("OVERFLOW ");
		if (status & _SW_UNDERFLOW)
			printf("UNDERFLOW ");
		if (status & _SW_INEXACT)
			printf("INEXACT ");
		printf(")\n");
	}
}
Exemple #2
0
/*********************************************************************
 *		_clearfp (MSVCRT.@)
 */
unsigned int CDECL _clearfp(void)
{
  unsigned int retVal = _statusfp();
#if defined(__GNUC__)
  __asm__ __volatile__( "fnclex" );
#else
  __asm fnclex;
#endif
  return retVal;
}
Exemple #3
0
/*
 * @implemented
 */
unsigned int _clearfp (void)
{
  unsigned short __res = _statusfp();
#ifdef __GNUC__
__asm__ __volatile__ (
	"fclex \n\t"
	);
#else
#endif /*__GNUC__*/
  return __res;
}
Exemple #4
0
ulong
getFPstatus(void)
{
	ulong fsr = 0, fsr32 = _statusfp();
	if(fsr32&_SW_INEXACT) fsr |= INEX;
	if(fsr32&_SW_OVERFLOW) fsr |= OVFL;
	if(fsr32&_SW_UNDERFLOW) fsr |= UNFL;
	if(fsr32&_SW_ZERODIVIDE) fsr |= ZDIV;
	if(fsr32&_SW_INVALID) fsr |= INVAL;
	return fsr;
}
Exemple #5
0
inline bool is_inexact_fp_status() {
    return (_statusfp() & _EM_INEXACT) != 0;
}
Exemple #6
0
inline bool is_overflow_fp_status() {
    return (_statusfp() & _EM_OVERFLOW) != 0;
}
Exemple #7
0
	unsigned int fpe_test( unsigned int except )
	{
		return ( _statusfp() & except ) > 0;
	}
Exemple #8
0
bool FPEnvironmentImpl::isFlagImpl(FlagImpl flag)
{
    return (_statusfp() & flag) != 0;
}
Exemple #9
0
 int testFE()
 {
     return (ld_statusfpu() | _statusfp()) & 0x3F;
 }