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

Safe HaskellNone

LLVM.Extra.Multi.Vector

Synopsis

Documentation

newtype T n a Source

Constructors

Cons (Repr (Value n) a) 

Instances

Positive n => C (T n) 
(Positive n, C a) => Phi (T n a) 
(Positive n, C a) => Zero (T n a) 
(Positive n, C a) => Undefined (T n a) 
(Positive n, Transcendental a) => Transcendental (T n a) 
(Positive n, Algebraic a) => Algebraic (T n a) 
(Positive n, Logic a) => Logic (T n a) 
(Positive n, FloatingComparison a) => FloatingComparison (T n a) 
(Positive n, Comparison a) => Comparison (T n a) 
(Positive n, Fraction a) => Fraction (T n a) 
(Positive n, Real a) => Real (T n a) 
(Positive n, RationalConstant a) => RationalConstant (T n a) 
(Positive n, Field a) => Field (T n a) 
(Positive n, IntegerConstant a) => IntegerConstant (T n a) 
(Positive n, PseudoModule a) => PseudoModule (T n a) 
(Positive n, PseudoRing a) => PseudoRing (T n a) 
(Positive n, Additive a) => Additive (T n a) 
C n a => C (T n a) 

consPrim :: Repr (Value n) a ~ Value n a => Value (Vector n a) -> T n aSource

deconsPrim :: Repr (Value n) a ~ Value n a => T n a -> Value (Vector n a)Source

class C a => C a whereSource

Methods

cons :: Positive n => Vector n a -> T n aSource

undef :: Positive n => T n aSource

zero :: Positive n => T n aSource

phis :: Positive n => BasicBlock -> T n a -> CodeGenFunction r (T n a)Source

addPhis :: Positive n => BasicBlock -> T n a -> T n a -> CodeGenFunction r ()Source

shuffle :: (Positive n, Positive m) => ConstValue (Vector m Word32) -> T n a -> T n a -> CodeGenFunction r (T m a)Source

extract :: Positive n => Value Word32 -> T n a -> CodeGenFunction r (T a)Source

insert :: Positive n => Value Word32 -> T a -> T n a -> CodeGenFunction r (T n a)Source

Instances

C Bool 
C Double 
C Float 
C Int8 
C Int16 
C Int32 
C Int64 
C Word8 
C Word16 
C Word32 
C Word64 
C Bool8 
(C a, C b) => C (a, b) 
(C a, C b, C c) => C (a, b, c) 

type Value n = Compose Value (Vector n)Source

map :: (Positive n, C a, C b) => (T a -> CodeGenFunction r (T b)) -> T n a -> CodeGenFunction r (T n b)Source

zip :: T n a -> T n b -> T n (a, b)Source

zip3 :: T n a -> T n b -> T n c -> T n (a, b, c)Source

unzip :: T n (a, b) -> (T n a, T n b)Source

unzip3 :: T n (a, b, c) -> (T n a, T n b, T n c)Source

replicate :: (Positive n, C a) => T a -> CodeGenFunction r (T n a)Source

iterate :: (Positive n, C a) => (T a -> CodeGenFunction r (T a)) -> T a -> CodeGenFunction r (T n a)Source

take :: (Positive n, Positive m, C a) => T n a -> CodeGenFunction r (T m a)Source

takeRev :: (Positive n, Positive m, C a) => T n a -> CodeGenFunction r (T m a)Source

lift1 :: (Repr (Value n) a -> Repr (Value n) b) -> T n a -> T n bSource

modify :: (Positive n, C a) => Value Word32 -> (T a -> CodeGenFunction r (T a)) -> T n a -> CodeGenFunction r (T n a)Source

assemble :: (Positive n, C a) => [T a] -> CodeGenFunction r (T n a)Source

dissect :: (Positive n, C a) => T n a -> CodeGenFunction r [T a]Source

dissectList :: (Positive n, C a) => T n a -> [CodeGenFunction r (T a)]Source

reverse :: (Positive n, C a) => T n a -> CodeGenFunction r (T n a)Source

rotateUp :: (Positive n, C a) => T n a -> CodeGenFunction r (T n a)Source

Rotate one element towards the higher elements.

I don't want to call it rotateLeft or rotateRight, because there is no prefered layout for the vector elements. In Intel's instruction manual vector elements are indexed like the bits, that is from right to left. However, when working with Haskell list and enumeration syntax, the start index is left.

rotateDown :: (Positive n, C a) => T n a -> CodeGenFunction r (T n a)Source

shiftUp :: (Positive n, C a) => T a -> T n a -> CodeGenFunction r (T a, T n a)Source

shiftDown :: (Positive n, C a) => T a -> T n a -> CodeGenFunction r (T a, T n a)Source

shiftUpMultiZero :: (Positive n, C a) => Int -> T n a -> CodeGenFunction r (T n a)Source

shiftDownMultiZero :: (Positive n, C a) => Int -> T n a -> CodeGenFunction r (T n a)Source

shiftUpMultiUndef :: (Positive n, C a) => Int -> T n a -> CodeGenFunction r (T n a)Source

shiftDownMultiUndef :: (Positive n, C a) => Int -> T n a -> CodeGenFunction r (T n a)Source

undefPrimitive :: (Positive n, IsPrimitive al, Repr (Value n) a ~ Value n al) => T n aSource

shufflePrimitive :: (Positive n, Positive m, IsPrimitive al, Repr Value a ~ Value al, Repr (Value n) a ~ Value n al, Repr (Value m) a ~ Value m al) => ConstValue (Vector m Word32) -> T n a -> T n a -> CodeGenFunction r (T m a)Source

extractPrimitive :: (Positive n, IsPrimitive al, Repr Value a ~ Value al, Repr (Value n) a ~ Value n al) => Value Word32 -> T n a -> CodeGenFunction r (T a)Source

insertPrimitive :: (Positive n, IsPrimitive al, Repr Value a ~ Value al, Repr (Value n) a ~ Value n al) => Value Word32 -> T a -> T n a -> CodeGenFunction r (T n a)Source

insertTraversable :: (Positive n, C a, Traversable f, Applicative f) => Value Word32 -> f (T a) -> f (T n a) -> CodeGenFunction r (f (T n a))Source

extractTraversable :: (Positive n, C a, Traversable f) => Value Word32 -> f (T n a) -> CodeGenFunction r (f (T a))Source

class (PseudoRing a, Additive a) => PseudoRing a whereSource

Methods

mul :: Positive n => T n a -> T n a -> CodeGenFunction r (T n a)Source

class (Field a, PseudoRing a) => Field a whereSource

Methods

fdiv :: Positive n => T n a -> T n a -> CodeGenFunction r (T n a)Source

Instances

class (PseudoModule v, PseudoRing (Scalar v), Additive v) => PseudoModule v whereSource

Methods

scale :: Positive n => T n (Scalar v) -> T n v -> CodeGenFunction r (T n v)Source

class (Real a, Additive a) => Real a whereSource

Methods

min :: Positive n => T n a -> T n a -> CodeGenFunction r (T n a)Source

max :: Positive n => T n a -> T n a -> CodeGenFunction r (T n a)Source

abs :: Positive n => T n a -> CodeGenFunction r (T n a)Source

signum :: Positive n => T n a -> CodeGenFunction r (T n a)Source

Instances

class (Fraction a, Real a) => Fraction a whereSource

Methods

truncate :: Positive n => T n a -> CodeGenFunction r (T n a)Source

fraction :: Positive n => T n a -> CodeGenFunction r (T n a)Source

class (Algebraic a, Field a) => Algebraic a whereSource

Methods

sqrt :: Positive n => T n a -> CodeGenFunction r (T n a)Source

class (Transcendental a, Algebraic a) => Transcendental a whereSource

Methods

pi :: Positive n => CodeGenFunction r (T n a)Source

sin, log, exp, cos :: Positive n => T n a -> CodeGenFunction r (T n a)Source

pow :: Positive n => T n a -> T n a -> CodeGenFunction r (T n a)Source

class C a => Select a whereSource

Methods

select :: Positive n => T n Bool -> T n a -> T n a -> CodeGenFunction r (T n a)Source

class (Logic a, C a) => Logic a whereSource

Methods

and :: Positive n => T n a -> T n a -> CodeGenFunction r (T n a)Source

or :: Positive n => T n a -> T n a -> CodeGenFunction r (T n a)Source

xor :: Positive n => T n a -> T n a -> CodeGenFunction r (T n a)Source

inv :: Positive n => T n a -> CodeGenFunction r (T n a)Source