#include <iostream>
using namespace std;

int main()
{
	unsigned int cpeinfo;
	unsigned int cpsse3;
	unsigned int amdinfo;
	asm("mov $0x01, %%eax\ncpuid\n"
          : "=d" (cpeinfo), "=c" (cpsse3)
        );
	asm("mov $0x80000001, %%eax\ncpuid\n"
          : "=d" (amdinfo)
        );
	cout << "1 - Instruction set is supported by CPU\n";
	cout << "0 - Instruction set not supported\n"; 
	cout << "--------------------------------\n";
	cout << "MMX:  " << ((cpeinfo >> 23) & 0x1 ) << "\t"
             << "SSE:  " << ((cpeinfo >> 25) & 0x1 ) << "\t"
             << "SSE2: " << ((cpeinfo >> 26) & 0x1 ) << "\t"
             << "SSE3: " << ((cpsse3       ) & 0x1 ) << "\t" 
             << "SSSE3: " << ((cpsse3 >>  9) & 0x1 ) << "\t" 
             << "SSE4.1: " << ((cpsse3 >> 19) & 0x1 ) << "\t" 
             << "SSE4.2: " << ((cpsse3 >> 20) & 0x1 ) << "\t" 
             << "SSE4a: " << ((amdinfo >>  6) & 0x1 ) << "\t" 
             << endl;
}
