llvm-extra-0.6.0.1: Utility functions for the llvm interface

Safe HaskellNone
LanguageHaskell98

LLVM.Extra.ScalarOrVector

Description

Support for unified handling of scalars and vectors.

Attention: The rounding and fraction functions only work for floating point values with maximum magnitude of maxBound :: Int32. This way we save expensive handling of possibly seldom cases.

Synopsis

Documentation

signedFraction :: Fraction a => Value a -> CodeGenFunction r (Value a) Source

The fraction has the same sign as the argument. This is not particular useful but fast on IEEE implementations.

addToPhase :: Fraction a => Value a -> Value a -> CodeGenFunction r (Value a) Source

increment (first operand) may be negative, phase must always be non-negative

incPhase :: Fraction a => Value a -> Value a -> CodeGenFunction r (Value a) Source

both increment and phase must be non-negative

type family Scalar vector :: * Source

Instances

type Scalar Bool = Bool 
type Scalar Double = Double 
type Scalar Float = Float 
type Scalar Int8 = Int8 
type Scalar Int16 = Int16 
type Scalar Int32 = Int32 
type Scalar Int64 = Int64 
type Scalar Word8 = Word8 
type Scalar Word16 = Word16 
type Scalar Word32 = Word32 
type Scalar Word64 = Word64 
type Scalar FP128 = FP128 
type Scalar (Vector n a) = a