Namespaces | Classes | Functions

mozilla Namespace Reference

The public interface of this header consists of a set of macros and functions for Intel CPU features. More...

Namespaces

namespace  sse_private
namespace  storage

Classes

struct  AutoSwap_PRUint16
struct  AutoSwap_PRInt16
struct  AutoSwap_PRUint32
struct  AutoSwap_PRUint64
class  AutoRestore
 Save the current value of a variable and restore it when the object goes out of scope. More...
class  BlockingResourceBase
 BlockingResourceBase Base class of resources that might block clients trying to acquire them. More...
class  CondVar
 CondVar Vanilla condition variable. More...
class  CallStack
class  DeadlockDetector
 DeadlockDetector. More...
class  Monitor
 Monitor Java-like monitor. More...
class  MonitorAutoEnter
 MonitorAutoEnter Enters the Monitor when it enters scope, and exits it when it leaves scope. More...
class  Mutex
 Mutex When possible, use MutexAutoLock/MutexAutoUnlock to lock/unlock this mutex within a scope, instead of calling Lock/Unlock directly. More...
class  MutexAutoLock
 MutexAutoLock Acquires the Mutex when it enters scope, and releases it when it leaves scope. More...
class  MutexAutoUnlock
 MutexAutoUnlock Releases the Mutex when it enters scope, and re-acquires it when it leaves scope. More...
class  PluginLibrary
class  PluginPRLibrary
class  TimeDuration
 Instances of this class represent the length of an interval of time. More...
class  TimeStamp
 Instances of this class represent moments in time, or a special "null" moment. More...

Functions

bool supports_mmx ()
bool supports_sse ()
bool supports_sse2 ()
bool supports_sse3 ()
bool supports_ssse3 ()
bool supports_sse4a ()
bool supports_sse4_1 ()
bool supports_sse4_2 ()
bool use_mmx ()
bool use_sse ()
bool use_sse2 ()
bool use_sse3 ()
bool use_ssse3 ()
bool use_sse4a ()
bool use_sse4_1 ()
bool use_sse4_2 ()

Detailed Description

The public interface of this header consists of a set of macros and functions for Intel CPU features.

Note: This file is included by Variant.h.

This class is used by the storage module whenever an nsIVariant needs to be returned.

CODE USING ASSEMBLY ===================

For each feature handled here, this header defines a single function that can be used to test whether to use code written in *assembly*: mozilla::supports_mmx mozilla::supports_sse mozilla::supports_sse2 mozilla::supports_sse3 mozilla::supports_ssse3 mozilla::supports_sse4a mozilla::supports_sse4_1 mozilla::supports_sse4_2 Note that the dynamic detection depends on cpuid intrinsics only available in gcc 4.3 or later and MSVC 8.0 (Visual C++ 2005) or later, so the dynamic detection returns false in older compilers. (This could be fixed by replacing the code with inline assembly.)

CODE USING INTRINSICS =====================

The remainder of the functions and macros that are the API from this header relate to code written using CPU intrinsics.

In each macro-function pair, the function may not be available if the macro is undefined. They should be used in the following pattern:

if (mozilla::use_abc()) { ifdef MOZILLA_COMPILE_WITH_ABC // abc-specific code here endif } else { // generic code here }

In addition, on some platforms, the headers that contain the intrinsics for many of these features won't compile unless we define a particular macro first (to pretend that we gave gcc an appropriate -march option). Therefore, code using this header should NOT include the headers for intrinsics directly, but should instead request the header by defining the header macro given below *before* including this file (which, in practice, means before including *any* header files).

The dynamic detection depends on cpuid intrinsics only available in gcc 4.3 or later and MSVC 8.0 (Visual C++ 2005) or later, so the dynamic detection returns false in older compilers. However, it could be extended to avoid this restriction; see the code in mozilla/jpeg/jdapimin.c for some hints.

Macro: MOZILLA_COMPILE_WITH_MMX Function: mozilla::use_mmx Header Macro: MOZILLA_SSE_INCLUDE_HEADER_FOR_MMX Header: <mmintrin.h>

Macro: MOZILLA_COMPILE_WITH_SSE Function: mozilla::use_sse Header Macro: MOZILLA_SSE_INCLUDE_HEADER_FOR_SSE Header: <xmmintrin.h>

Macro: MOZILLA_COMPILE_WITH_SSE2 Function: mozilla::use_sse2 Header Macro: MOZILLA_SSE_INCLUDE_HEADER_FOR_SSE2 Header: <emmintrin.h>

Macro: MOZILLA_COMPILE_WITH_SSE3 Function: mozilla::use_sse3 Header Macro: MOZILLA_SSE_INCLUDE_HEADER_FOR_SSE3 Header: <pmmintrin.h>

Macro: MOZILLA_COMPILE_WITH_SSSE3 Function: mozilla::use_ssse3 Header Macro: MOZILLA_SSE_INCLUDE_HEADER_FOR_SSSE3 Header: <tmmintrin.h>

Macro: MOZILLA_COMPILE_WITH_SSE4A Function: mozilla::use_sse4a Header Macro: MOZILLA_SSE_INCLUDE_HEADER_FOR_SSE4A Header: <ammintrin.h>

Macro: MOZILLA_COMPILE_WITH_SSE4_1 Function: mozilla::use_sse4_1 Header Macro: MOZILLA_SSE_INCLUDE_HEADER_FOR_SSE4_1 Header: <smmintrin.h>

Macro: MOZILLA_COMPILE_WITH_SSE4_2 Function: mozilla::use_sse4_2 Header Macro: MOZILLA_SSE_INCLUDE_HEADER_FOR_SSE4_2 Header: <nmmintrin.h>

We provide traits for the basic sqlite types to make use easier. The following types map to the indicated sqlite type: PRInt64 -> INTEGER (use IntegerVariant) double -> FLOAT (use FloatVariant) nsString -> TEXT (use TextVariant) nsCString -> TEXT (use UTF8TextVariant) PRUint8[] -> BLOB (use BlobVariant) nsnull -> NULL (use NullVariant)


Function Documentation

bool mozilla::supports_mmx (  )  [inline]
bool mozilla::supports_sse (  )  [inline]
bool mozilla::supports_sse2 (  )  [inline]
bool mozilla::supports_sse3 (  )  [inline]
bool mozilla::supports_sse4_1 (  )  [inline]
bool mozilla::supports_sse4_2 (  )  [inline]
bool mozilla::supports_sse4a (  )  [inline]
bool mozilla::supports_ssse3 (  )  [inline]
bool mozilla::use_mmx (  )  [inline]
bool mozilla::use_sse (  )  [inline]
bool mozilla::use_sse2 (  )  [inline]
bool mozilla::use_sse3 (  )  [inline]
bool mozilla::use_sse4_1 (  )  [inline]
bool mozilla::use_sse4_2 (  )  [inline]
bool mozilla::use_sse4a (  )  [inline]
bool mozilla::use_ssse3 (  )  [inline]