OSDev.org
https://forum.osdev.org/

CPUID on Intel I5 3210-m
https://forum.osdev.org/viewtopic.php?f=13&t=31895
Page 1 of 1

Author:  Bipman [ Wed May 10, 2017 11:11 am ]
Post subject:  CPUID on Intel I5 3210-m

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:
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

Author:  Geri [ Wed May 10, 2017 11:22 am ]
Post subject:  Re: CPUID on Intel I5 3210-m

code seems wrong

0x018000000 to binary is 0b11000000000000000000000000000

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

Page 1 of 1 All times are UTC - 6 hours
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/