package janestreet_cpuid

  1. Overview
  2. Docs
Legend:
Page
Library
Module
Module type
Parameter
Class
Class type
Source

Module CpuidSource

Sourcetype t =
  1. | Amd of Cpuid__.Amd_cpuid.t
  2. | Intel of Cpuid__.Intel_cpuid.t

It is currently an error to run this on a non AMD/Intel CPU.

For what it's worth, ARM is a pain to do this on, but at least then we'd know at compile time that we're going to be running on ARM and could be a bit more clever. *

Sourceval create : unit -> t Core.Or_error.t
Sourceval canonical_identifier : t -> string

If you use a flag on both platforms go ahead and add it here. It would be really nice to generate these based on the shared functionality but we really don't use enough CPU feature flags to make that worth it. *

Sourceval supports_sse3 : t -> bool

Does the processor support the SSE3 instruction set extensions.

Support starts with Celeron / Opteron. *

Sourceval supports_sse4_1 : t -> bool

Does the processor support the SSE4.1 instruction set extensions.

Note that this is different from the AMD flag SSE4A.

Support starts with Penryn / Jaguar. *

Sourceval supports_sse4_2 : t -> bool

Does the processor support the SSE4.2 instruction set extensions.

Note that this is different from the AMD flag SSE4A.

Support starts with Nehalem / Jaguar. *

Sourceval supports_avx : t -> bool

Does the processor support the AVX instruction set extensions.

Support starts with Sandy Bridge / Jaguar. *

Sourceval supports_avx2 : t -> bool

Does the processor support the AVX2 instruction set extensions.

Support starts with Haswell / Excavator. *

Sourceval supports_pclmulqdq : t -> bool

Does the processor support the PCLMULQDQ instruction.

Supports starts with Sandy Bridge / Jaguar. *

Sourceval supports_fma : t -> bool

Does the processor support the FMA3 instruction set extensions.

Support starts with Haswell / Piledriver. *

Sourcemodule Amd : sig ... end

Module gateway into AMD specific flags and functionality. *

Sourcemodule Intel : sig ... end

Module gateway into Intel specific flags and functionality. *