sdr-0.1.0.12: A software defined radio library

Safe HaskellSafe
LanguageHaskell2010

SDR.CPUID

Contents

Description

This module is for detecting which SIMD instruction sets your CPU supports. In particular, it can detect SSE4.2, AVX and AVX2.

Synopsis

Raw CPUID

cpuid Source #

Arguments

:: Word32

Operation (EAX)

-> IO (Word32, Word32, Word32, Word32)

Result (EAX, EBX, ECX, EDX)

Execute the CPUID instruction

cpuidExtended Source #

Arguments

:: Word32

Operation (EAX)

-> Word32

ECX

-> IO (Word32, Word32, Word32, Word32)

Result (EAX, EBX, ECX, EDX)

Execute the CPUID instruction setting ECX as well

High level CPU capabilities

data CPUInfo Source #

Information about the features supported by your CPU

Constructors

CPUInfo 

Features

hasSSE42 :: CPUInfo -> Bool Source #

Check if the CPU supports SSE4.2

hasAVX :: CPUInfo -> Bool Source #

Check if the CPU supports AVX

hasAVX2 :: CPUInfo -> Bool Source #

Check if the CPU supports AVX2

Convenience functions

featureSelect Source #

Arguments

:: CPUInfo

The CPU features

-> a

Default implementation

-> [(CPUInfo -> Bool, a)]

List of (feature, implementation) pairs

-> a

The selected implementation

Convenience function for selecting a function based on the features that the CPU supports