Safe Haskell | None |
---|---|
Language | GHC2021 |
System.CPUFeatures.RISCV.Constraint
Description
This module provides the constraint interface to detect CPU features.
You can mark your function with Has<FEATURE NAME> =>
to indicate that
it requires a specific CPU feature.
You can detect the availability and get the constraint Has<FEATURE NAME>
by pattern-matching on the variable query<FEATURE NAME>
.
Example:
-- This function requires the Vector extension someFunction :: HasV => ... case queryV of Just Dict -> {- In this branch, HasV is available -} someFunction Nothing -> {- In this branch, HasV is not available -} error "Vector extension not available"
Documentation
class Zihintntl ~ 'True => HasZihintntl Source #
Instances
Zihintntl ~ 'True => HasZihintntl Source # | |
Defined in System.CPUFeatures.RISCV.Constraint.Unsafe |
class Zvfhmin ~ 'True => HasZvfhmin Source #
Instances
Zvfhmin ~ 'True => HasZvfhmin Source # | |
Defined in System.CPUFeatures.RISCV.Constraint.Unsafe |
queryZvfhmin :: Maybe (Dict HasZvfhmin) Source #
class Zihintpause ~ 'True => HasZihintpause Source #
Instances
Zihintpause ~ 'True => HasZihintpause Source # | |
Defined in System.CPUFeatures.RISCV.Constraint.Unsafe |
class Zfbfmin ~ 'True => HasZfbfmin Source #
Instances
Zfbfmin ~ 'True => HasZfbfmin Source # | |
Defined in System.CPUFeatures.RISCV.Constraint.Unsafe |
queryZfbfmin :: Maybe (Dict HasZfbfmin) Source #
class Zvfbfmin ~ 'True => HasZvfbfmin Source #
Instances
Zvfbfmin ~ 'True => HasZvfbfmin Source # | |
Defined in System.CPUFeatures.RISCV.Constraint.Unsafe |
queryZvfbfmin :: Maybe (Dict HasZvfbfmin) Source #
class Zvfbfwma ~ 'True => HasZvfbfwma Source #
Instances
Zvfbfwma ~ 'True => HasZvfbfwma Source # | |
Defined in System.CPUFeatures.RISCV.Constraint.Unsafe |
queryZvfbfwma :: Maybe (Dict HasZvfbfwma) Source #