Timo's code modified to be compiled with standard PellesC configuration:
#include <stdio.h>
#include <stdlib.h>
#include <intrin.h>
//" AuthcAMDenti" -> "AuthenticAMD"
char *CheckVendor(void)
{
static char s[17];
_cpuid((int *)s, 0);
*(int *)s = *(int *)(s + 4);
*(int *)(s + 4) = *(int *)(s + 12);
*(s + 12) = 0;
return s;
}
char *CheckBrand(void)
{
static char s[50];
_cpuid((int *)s, 0x80000000);
if (*(unsigned int *)s >= 0x80000004)
{
_cpuid((int *)s, 0x80000002);
_cpuid((int *)(s + 16), 0x80000003);
_cpuid((int *)(s + 32), 0x80000004);
}
return s;
}
int CheckAVX(void)
{
int r[4]; // EAX, EBX, ECX and EDX
_cpuid(r, 1);
return (r[2] & 0x10000000) ? 1 : 0;
}
int main(void)
{
printf("%s\n", CheckVendor());
printf("%s\n", CheckBrand());
printf("AVX support: %s\n", CheckAVX()? "Yes" : "No");
exit(0);
}
Project attached.