Page 1 of 1

CPUID on Intel I5 3210-m

Posted: Wed May 10, 2017 11:11 am
by Bipman
Hi all

I'm trying to find out if my CPU supports AVX which according to the INTEL Identification program it does but if I run the following INTEL code to check it says it doesn't :-

Code: Select all

xor eax, eax
	cpuid
	cmp eax, 1 ; does CPUID support eax = 1?
	jb not_supported
	mov eax, 1
	cpuid
	and ecx, 018000000h ;check 27 bit (OS uses XSAVE/XRSTOR)
	cmp ecx, 018000000h ; and 28 (AVX supported by CPU)
	jne not_supported
	xor ecx, ecx ; XFEATURE_ENABLED_MASK/XCR0 register number = 0
	xgetbv ; XFEATURE_ENABLED_MASK register is in edx:eax
	and eax, 110b
	cmp eax, 110b ; check the AVX registers restore at context switch
	jne not_supported
	mov eax, 1
	jmp $
	not_supported:
	xor eax, eax
	jmp $
It fails at the bit 27,28 check above, any ideas?

Bipman

Re: CPUID on Intel I5 3210-m

Posted: Wed May 10, 2017 11:22 am
by Geri
code seems wrong

0x018000000 to binary is 0b11000000000000000000000000000

avx is the 28th bit
27th bit has nothing to do with it