CPUID on Intel I5 3210-m

Programming, for all ages and all languages.
Post Reply
Bipman
Member
Member
Posts: 40
Joined: Wed Mar 15, 2017 9:22 am

CPUID on Intel I5 3210-m

Post 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
User avatar
Geri
Member
Member
Posts: 442
Joined: Sun Jul 14, 2013 6:01 pm

Re: CPUID on Intel I5 3210-m

Post by Geri »

code seems wrong

0x018000000 to binary is 0b11000000000000000000000000000

avx is the 28th bit
27th bit has nothing to do with it
Operating system for SUBLEQ cpu architecture:
http://users.atw.hu/gerigeri/DawnOS/download.html
Post Reply