Changeset 396


Ignore:
Timestamp:
May 10, 2010, 9:27:16 AM (9 years ago)
Author:
cameron
Message:

Additional documentation.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/lib/x86_CPU_detect.h

    r395 r396  
    22 
    33    Copyright (C) 2010, Robert D. Cameron
    4     Licensed to the public under Academic Free License version 3.0.
     4    Licensed under Academic Free License version 3.0.
    55
    6 This file defines the following functions which perform
    7 runtime tests to see if particular SIMD or other acceleration
    8 features are supported on x86 and x86-64 architectures.
    9 The functions return 0 if a feature is not supported, a nonzero value,
    10 otherwise.
     6    You may freely #include this file in software that is public
     7    domain or licensed under any open source or other license.
    118
    12 CPU_has_MMX()
    13 CPU_has_SSE()
    14 CPU_has_SSE2()
    15 CPU_has_SSE3()
    16 CPU_has_SSSE3()
    17 CPU_has_SSE41()
    18 CPU_has_SSE42()
    19 CPU_has_AVX()
    20 CPU_has_POPCOUNT()
     9    This file defines the following functions which perform
     10    runtime tests to see if particular SIMD or other acceleration
     11    features are supported on x86 and x86-64 architectures.
     12    The functions return 0 if a feature is not supported, a nonzero value,
     13    otherwise.
    2114
    22 The CPUID instruction is used to determine these features,
    23 taking advantage of the appropriate __cpuid compiler intrinsic
    24 available with GCC and MSVC compilers.
     15    CPU_has_MMX()
     16    CPU_has_SSE()
     17    CPU_has_SSE2()
     18    CPU_has_SSE3()
     19    CPU_has_SSSE3()
     20    CPU_has_SSE41()
     21    CPU_has_SSE42()
     22    CPU_has_AVX()
     23    CPU_has_POPCOUNT()
    2524
     25    The CPUID instruction is used to determine these features,
     26    taking advantage of the appropriate __cpuid compiler intrinsic
     27    available with GCC and MSVC compilers.
     28
     29    Principal objective:  Dynamic detection of SIMD processor
     30    capabilities is required when software is to be compiled
     31    to produce a binary that is compatible with a range of
     32    processors, including:
     33     (a) some processors with no SIMD capabilities,
     34     (b) some processors with a particular restricted subset
     35         of SIMD capabilities (e.g., SSE but not SSE2), and
     36     (c) some processors with the full set of desired SIMD
     37         capabilities.
     38
     39    Compilation note:  The detection code must run successfully on
     40    processors having no SIMD capabilities.  Therefore, this module must
     41    be compiled without any compiler flags such as -msse2 or the like.
    2642*/
    2743
Note: See TracChangeset for help on using the changeset viewer.