-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | A small package to access the cpuid instruction directly. -- -- Similar to the cpuid package this package allows one to call the CPUID -- instruction from plain Haskell. In contrast to the cpuid package it is -- very minimalistic and provides no additional helper functions. On the -- other side it is possible to build this package on every platform. If -- the platform does not support the CPUID instruction, calling it from -- Haskell will just throw an exception. @package basic-cpuid @version 0.1.0.0 -- | This module gives access to the CPUID instruction on x86 based -- systems. The module will still build on other systems but will not -- provide any useful functionality instead. module System.Cpuid.Basic -- | Argument for the CPUID instruction. data CpuidArg CpuidArg :: !Word32 -> !Word32 -> CpuidArg -- | Value to query for. [caEAX] :: CpuidArg -> !Word32 -- | Additional value for queries. You can leave this at 0 most of the -- time. [caECX] :: CpuidArg -> !Word32 -- | Result of a call to the CPUID instruction. data CpuidResult CpuidResult :: !Word32 -> !Word32 -> !Word32 -> !Word32 -> CpuidResult -- | Value of EAX after the CPUID instruction. [crEAX] :: CpuidResult -> !Word32 -- | Value of EBX after the CPUID instruction. [crEBX] :: CpuidResult -> !Word32 -- | Value of ECX after the CPUID instruction. [crECX] :: CpuidResult -> !Word32 -- | Value of EDX after the CPUID instruction. [crEDX] :: CpuidResult -> !Word32 -- | True if the platform supports the CPUID instruction (that is, if this -- code runs on x86 or AMD64). cpuidSupported :: Bool -- | Call the CPUID instruction. If the instruction is not supported, throw -- an error. cpuid :: CpuidArg -> IO CpuidResult -- | A safe version of cpuid which never throws exceptions if a -- Just is returned. cpuidMaybe :: Maybe (CpuidArg -> IO CpuidResult) -- | Get the highest supported function parameter (EAX) for the CPUID -- instruction. Returns 0 if CPUID is unsupported. cpuidHighestFunctionParameter :: IO Word32 -- | Argument for the XGETBV instruction. type XGetBVArg = Word32 -- | Result of a call to the XGETBV instruction. data XGetBVResult XGetBVResult :: !Word32 -> !Word32 -> XGetBVResult [xgEAX] :: XGetBVResult -> !Word32 [xgEDX] :: XGetBVResult -> !Word32 -- | Returns true if the platform supports the XGETBV instruction (that is, -- if the code runs on x86 or AMD64) AND the processor (or operating -- system) support it (that is, the OSXSAVE bit is set) xgetbvSupport :: IO Bool -- | Call the XGETBV instruction. If the instruction is not supported, -- throw an error. You also have to check for support of the instruction -- by the operating system and the processor first (use -- xgetbvSupport). xgetbv :: XGetBVArg -> IO XGetBVResult -- | A safe version of xgetbv which never throws exceptions if a -- Just is returned. xgetbvMaybe :: IO (Maybe (XGetBVArg -> IO XGetBVResult)) -- | Check whether the processor indicated support for SSE2. Note that this -- does not mean the OS will save the XMM upon context switches. supportsSSE2 :: IO Bool -- | Check whether OS and CPU support the AVX2 instruction set. supportsAVX2 :: IO Bool -- | Check whether OS and CPU support the AVX512f instruction set. supportsAVX512f :: IO Bool instance GHC.Classes.Eq System.Cpuid.Basic.XGetBVResult instance GHC.Show.Show System.Cpuid.Basic.XGetBVResult instance GHC.Classes.Eq System.Cpuid.Basic.CpuidResult instance GHC.Show.Show System.Cpuid.Basic.CpuidResult instance GHC.Classes.Eq System.Cpuid.Basic.CpuidArg instance GHC.Show.Show System.Cpuid.Basic.CpuidArg