How do I check for SSSE3 support?

Jun 20, 2011 at 7:49am
Hello everyone,

I have a program which uses some SSE-instructions (mostly SSE2, but some SSSE3, too) and therefore I need to check whether or not these are supported. I read at

www.intel.com/Assets/PDF/appnote/241618.pdf

that I need to check the value of some flags in the registers ecx and edx to find this out (shown in tables 5-4 and 5-5), but how do I do this in C++?
Or if that can't be done in C++, is there another way?

Regards
Squall83
Jun 20, 2011 at 10:46am
I know that the PCSX2 project has a library they use in their emulator to detect CPU capabilities :
http://pcsx2.net/downloads.php?p=misc
Jun 20, 2011 at 1:44pm
closed account (1yR4jE8b)
Which compiler are you using? If you are using GCC, there will be preprocessor macros defined if the target CPU has support for that instructions set. This way, you can use conditional compilation to check for support at compile time and generate appropriate code.
Last edited on Jun 20, 2011 at 1:44pm
Jun 20, 2011 at 3:34pm
@bartoli:
Thanks, but for some reason I now found something which is a lot easier:
http://rodrigosavage.blogspot.com/

@darkestfright:
I need to check it at runtime, not compile time, so my code knows what it is allowed to do when it is run on a different system. I am using Visual Studio 2008.
Topic archived. No new replies allowed.