openMSX
Functions | Variables
HostCPU Namespace Reference

Information about the host CPU's capabilities, which are determined at run time. More...

Functions

void setFeatures (unsigned features)
void init ()
 This function should be called before the hasXXX() functions, (if not the hasXXX() function returns false).
bool hasMMX ()
 Does this CPU support the MMX instructions?
bool hasSSE ()
 Does this CPU support the SSE instructions?
bool hasSSE2 ()
 Does this CPU support the SSE2 instructions?
void forceDisableSSE2 ()
 Force openMSX to not use any SSE2 instructions, if available.
void forceDisableSSE ()
 Force openMSX to not use any SSE (or MMX extensions), if available.
void forceDisableMMX ()
 Force openMSX to not use any MMX instructions, if available.

Variables

bool mmxFlag = false
bool sseFlag = false
bool sse2Flag = false

Detailed Description

Information about the host CPU's capabilities, which are determined at run time.

Query capabilities like this:

  #if ASM_X86
    if (HostCPU::hasMMX()) { ...inline MMX asm... }
  #endif

This makes sure instructions for a different CPU family are never fed to the assembler, which may not be able to handle them.

Function Documentation

void HostCPU::forceDisableMMX ( )
inline

Force openMSX to not use any MMX instructions, if available.

Definition at line 51 of file HostCPU.hh.

References forceDisableSSE(), and mmxFlag.

Referenced by openmsx::NoMMXOption::parseOption().

void HostCPU::forceDisableSSE ( )
inline

Force openMSX to not use any SSE (or MMX extensions), if available.

Definition at line 47 of file HostCPU.hh.

References forceDisableSSE2(), and sseFlag.

Referenced by forceDisableMMX(), and openmsx::NoSSEOption::parseOption().

void HostCPU::forceDisableSSE2 ( )
inline

Force openMSX to not use any SSE2 instructions, if available.

Definition at line 43 of file HostCPU.hh.

References sse2Flag.

Referenced by forceDisableSSE(), and openmsx::NoSSE2Option::parseOption().

bool HostCPU::hasMMX ( )
inline

Does this CPU support the MMX instructions?

Definition at line 30 of file HostCPU.hh.

References mmxFlag.

Referenced by init().

bool HostCPU::hasSSE ( )
inline

Does this CPU support the SSE instructions?

Definition at line 34 of file HostCPU.hh.

References sseFlag.

Referenced by init(), and openmsx::Blur_1on3< Pixel >::operator()().

bool HostCPU::hasSSE2 ( )
inline

Does this CPU support the SSE2 instructions?

Definition at line 38 of file HostCPU.hh.

References sse2Flag.

Referenced by init().

void HostCPU::init ( )

This function should be called before the hasXXX() functions, (if not the hasXXX() function returns false).

This function MUST be called before the forceXXX() functions.

Definition at line 27 of file HostCPU.cc.

References hasMMX(), hasSSE(), hasSSE2(), mmxFlag, PRT_DEBUG, setFeatures(), sse2Flag, and sseFlag.

void HostCPU::setFeatures ( unsigned  features)

Definition at line 16 of file HostCPU.cc.

References mmxFlag, sse2Flag, and sseFlag.

Referenced by init().

Variable Documentation

bool HostCPU::mmxFlag = false

Definition at line 11 of file HostCPU.cc.

Referenced by forceDisableMMX(), hasMMX(), init(), and setFeatures().

bool HostCPU::sse2Flag = false

Definition at line 13 of file HostCPU.cc.

Referenced by forceDisableSSE2(), hasSSE2(), init(), and setFeatures().

bool HostCPU::sseFlag = false

Definition at line 12 of file HostCPU.cc.

Referenced by forceDisableSSE(), hasSSE(), init(), and setFeatures().