00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #ifndef __PROCESSORSPECDETECTION_WIN_H__
00020 #define __PROCESSORSPECDETECTION_WIN_H__
00021
00022
00023 #ifndef PF_SSE3_INSTRUCTIONS_AVAILABLE
00024 #define PF_SSE3_INSTRUCTIONS_AVAILABLE 13
00025 #endif
00026
00027 namespace Implementation
00028 {
00029 class DetectInstructionsWin
00030 {
00031 public:
00032
00033 uint CheckSupportedInstruction()
00034 {
00035 uint instructionBitMask = 0U;
00036
00037 bool plat64bit = false;
00038 #if defined(CS_PLATFORM_WIN32) && (CS_PROCESSOR_SIZE == 64)
00039 plat64bit = true;
00040 #endif
00041
00042
00043 if(plat64bit || IsProcessorFeaturePresent(PF_MMX_INSTRUCTIONS_AVAILABLE) != 0)
00044 instructionBitMask |= MMX;
00045 if(plat64bit || IsProcessorFeaturePresent(PF_XMMI_INSTRUCTIONS_AVAILABLE) != 0)
00046 instructionBitMask |= SSE;
00047 if(plat64bit || IsProcessorFeaturePresent(PF_XMMI64_INSTRUCTIONS_AVAILABLE) != 0)
00048 instructionBitMask |= SSE2;
00049 if(IsProcessorFeaturePresent(PF_SSE3_INSTRUCTIONS_AVAILABLE) != 0)
00050 instructionBitMask |= SSE3;
00051
00052 return instructionBitMask;
00053 }
00054 };
00055 }
00056
00057 #endif // __PROCESSORSPECDETECTION_WIN_H__