f16spec.h File Reference

(r1785/r751)

Go to the source code of this file.

Functions

BOOL IsMathCoprocInstalled ()
 Gives a hint to those that need to know things about FPU performance.


Function Documentation

BOOL IsMathCoprocInstalled  ) 
 

Gives a hint to those that need to know things about FPU performance.

Author:
Andy_Pennell (Xara Group Ltd) <camelotdev@xara.com>
Date:
19/1/95
Returns:
TRUE if the hardware supports a real FPU, FALSE if emulated.

Errors: None.

Definition at line 213 of file f16spec.cpp.

00214 {
00215 #if defined(__WXMSW__)
00216     // the theoretically proper way to detect an FPU is to delve into the reigstry thus:
00217     // NT  entry lives at HKEY_LOCAL_MACHINE\HARDWARE\DESCRIPTION\System\FloatingPointProcessor\0
00218     // W95 entry lives at HKEY_LOCAL_MACHINE\Enum\Root\*PNP0C01\0000NDP (M7 liable to change)
00219     // W32s is only available by thunking to WinFlags() (ug).
00220     // Instead, we use a tiny bit of .asm, as suggested by Mr-Asm himself, Gavin
00221 
00222     WORD RegCR0;
00223     _asm
00224     {
00225         smsw    RegCR0                  // bit 2 of CR0 is the EM bit, set for emulation
00226     }
00227 
00228     return (RegCR0 & 4) ? FALSE : TRUE;
00229 #else
00230     return TRUE;
00231 #endif
00232 }


Generated on Sat Nov 10 03:49:08 2007 for Camelot by  doxygen 1.4.4