CheckAVX

Share your advanced PureBasic knowledge/code with the community.
User avatar
oryaaaaa
Addict
Addict
Posts: 825
Joined: Mon Jan 12, 2004 11:40 pm
Location: Okazaki, JAPAN

CheckAVX

Post by oryaaaaa »

Code: Select all

Procedure.b CheckAVX()
  Protected avx.l
  
  !MOV Eax, 1
  !CPUID
  !AND Ecx, 018000000h
  !CMP Ecx, 018000000h
  !JNE not_support
  !MOV Ecx, 0
  !xgetbv
  !AND Eax, 06h
  !MOV [p.v_avx], Eax
  If avx = 6
    ProcedureReturn #True 
  EndIf
  !not_support: 
  ProcedureReturn #False
EndProcedure