i have a task: Check exist on my platform commands AVX, SSE (SSE1-SSE4.2), FPU. My assembler code do not work, and i can not unterstand why. I think so the thing in not correct description output modifiers.
unsigned int AVX;
unsigned int SSE1;
unsigned int SSE2;
unsigned int SSE3;
unsigned int SSSE3;
unsigned int SSE41;
unsigned int SSE42;
unsigned int FPU;
__asm__(
"cpuid\n\t"
"movl %%edx, %[AVX]\n\t"
"and $(1<<28), %[AVX]\n\t"
"movl %%edx, %[SSE1]\n\t"
"and $(1<<25), %[SSE1]\n\t"
"movl %%edx, %[SSE2]\n\t"
"and $(1<<26), %[SSE2]\n\t"
"movl %%ecx, %[SSE3]\n\t"
"and $(1<<9), %[SSE3]\n\t"
"movl %%ecx, %[SSSE3]\n\t"
"and $(1<<9), %[SSSE3]\n\t"
"movl %%edx, %[SSE41]\n\t"
"and $(1<<19), %[SSE41]\n\t"
"movl %%ecx, %[SSE42]\n\t"
"and $(1<<20), %[SSE42]\n\t"
"movl %%edx, %[FPU]\n\t"
"and $(1<<0), %[FPU]\n\t"
: [AVX] "=&r"(AVX), [SSE1]"=&r"(SSE1),
[SSE2]"=&r"(SSE2), [SSE3]"=&r"(SSE3),
[SSSE3]"=&r"(SSSE3), [SSE41]"=&r"(SSE41),
[SSE42]"=&r"(SSE42), [FPU]"=&r"(FPU)
: "a"(1)
: "cc"
);
cout << "AVX:" << (bool)AVX << endl;
cout << "SSE1:" << (bool)SSE1 << endl;
cout << "SSE2:" << (bool)SSE2 << endl;
cout << "SSE3:" << (bool)SSE3 << endl;
cout << "SSSE3:" << (bool)SSSE3 << endl;
cout << "SSE41:" << (bool)SSE41 << endl;
cout << "SSE42:" << (bool)SSE42 << endl;
cout << "FPU:" << (bool)FPU << endl;
error: 'asm' operand has impossible constraints