|
||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||
|
Announcements
Chapters
Services
Feature Zones
|
IntroductionI have been learning and writing SSE2 intrinsic instructions but I did not find an article on CodeProject that has sample code for me to identify the presence of SIMD instructions on processor, hence I wrote a simple class to do it. I hope that people who need this information can save some time using this class, without having to roll out their own class. The HasSIMD ClassHere is the class declaration. I guess there is no need for sample code. It is simple to use. class HasSIMD
{
public:
// Intel SIMD
bool HasMMX()
bool HasSSE()
bool HasSSE2()
bool HasSSE3()
bool HasSSSE3()
bool HasSSE41()
bool HasSSE42()
// AMD SIMD
bool HasMMXplus()
bool Has3Dnow()
bool Has3DnowExt()
};
Important Notes on Symmetric Multiprocessor(SMP) SystemBeware of SMP systems, the processors used should be identical, hence the word, "symmetric". Or else, the class may detect that one of the processors supports this SIMD. When it runs this SIMD instruction on another non-identical processor which doesn't supports this SIMD, your program may crash. References
History
|
|||||||||||||||||||||||||||||||||||||||||||||||