CPUID
[Utilities]


Data Structures

struct  ssp_cpuid

CPUID Operations

enum  ssp_cpu_feature {
  SSP_REF, SSP_SSE, SSP_SSE2, SSP_SSE3,
  SSP_SSSE3, SSP_SSE4a, SSP_SSE4_1, SSP_SSE4_2,
  SSP_SSE5, SSP_SSE_COUNT
}
ssp_cpuid ssp_get_cpuid ()
int ssp_is_supported (ssp_cpu_feature index)

Enumeration Type Documentation

enum ssp_cpu_feature

Enumerator:
SSP_REF 
SSP_SSE 
SSP_SSE2 
SSP_SSE3 
SSP_SSSE3 
SSP_SSE4a 
SSP_SSE4_1 
SSP_SSE4_2 
SSP_SSE5 
SSP_SSE_COUNT 

Definition at line 18 of file SSEPlus_CPUID.h.

00019 {
00020     SSP_REF,
00021     SSP_SSE,
00022     SSP_SSE2,
00023     SSP_SSE3,
00024     SSP_SSSE3,
00025     SSP_SSE4a,
00026     SSP_SSE4_1,
00027     SSP_SSE4_2,
00028     SSP_SSE5,
00029     SSP_SSE_COUNT
00030 }ssp_cpu_feature;


Function Documentation

ssp_cpuid ssp_get_cpuid (  ) 

Definition at line 38 of file SSEPlus_CPUID.h.

00039 {
00040     unsigned maxInfoType;
00041     ssp_cpuid cpu;
00042     int data[4], i;
00043 
00044     for( i=0; i<SSP_SSE_COUNT; ++i )
00045     {
00046         cpu.feature[i] = 0;
00047     }
00048 
00049     __cpuid( data, 0 );  
00050     maxInfoType = data[0] + 0x80000000;
00051 
00052     __cpuid( data, 1 );      
00053 
00054     cpu.feature[SSP_SSE   ] = (data[3] & 0x1000000) || 0;  // EDX: bit 25
00055     cpu.feature[SSP_SSE2  ] = (data[3] & 0x2000000) || 0;  // EDX: bit 26
00056     cpu.feature[SSP_SSE3  ] = (data[2] & 0x1      ) || 0;  // ECX: bit 0
00057     cpu.feature[SSP_SSSE3 ] = (data[2] & 0x100    ) || 0;  // ECX: bit 9
00058     cpu.feature[SSP_SSE4_1] = (data[2] & 0x40000  ) || 0;  // ECX: bit 19
00059     cpu.feature[SSP_SSE4_2] = (data[2] & 0x80000  ) || 0;  // ECX: bit 20     
00060 
00061     if( maxInfoType >= 0x80000001 )
00062     {
00063         __cpuid( data, 0x80000001 );        
00064         
00065         cpu.feature[ SSP_SSE4a ] = (data[2] & 0x40  ) || 0;  // ECX: bit 6
00066         cpu.feature[ SSP_SSE5  ] = (data[2] & 0x800 ) || 0;  // ECX: bit 11    
00067     }
00068    
00069     return cpu;    
00070 }

int ssp_is_supported ( ssp_cpu_feature  index  ) 

Definition at line 72 of file SSEPlus_CPUID.h.

00073 {
00074     ssp_cpuid cpu = ssp_get_cpuid();
00075     return cpu.feature[ index ];
00076 }


Generated on Wed May 21 13:44:15 2008 for "SSEPlus" by  doxygen 1.5.4