synthesizer-llvm-0.9: Efficient signal processing using runtime compilation

Safe HaskellNone

Synthesizer.LLVM.Frame.StereoInterleaved

Description

Represent a vector of Stereo values in two vectors that store the values in an interleaved way. That is:

 vector0[0] = left[0]
 vector0[1] = right[0]
 vector0[2] = left[1]
 vector0[3] = right[1]
 vector1[0] = left[2]
 vector1[1] = right[2]
 vector1[2] = left[3]
 vector1[3] = right[3]

This representation is not very useful for computation, but necessary as intermediate representation for interfacing with memory. SSE/SSE2 have the instructions UNPACK(L|H)P(S|D) that interleave efficiently.

Documentation

data T n a Source

Instances

(Positive n, IsPrimitive a, Storable a) => Storable (T n a) 
(Positive n, VectorValue n a, ~ * (VectorValueOf n a) (Value (Vector n a)), IsPrimitive a, IsConst a, Vector a) => C (T n a) 
(Positive n, IsPrimitive a, IsConst a) => Value (T n a) 

data Value n a Source

Constructors

Value (Value (Vector n a)) (Value (Vector n a)) 

Instances

(Positive n, IsPrimitive a, IsSized a, Positive (:*: n (SizeOf a))) => C (Value n a) 
(Positive n, IsPrimitive a, IsArithmetic a) => Additive (Value n a)

This instance allows to run arrange on interleaved stereo vectors.

(Positive n, IsPrimitive a) => Phi (Value n a) 
(Positive n, IsPrimitive a) => Undefined (Value n a) 
(Positive n, IsPrimitive a) => Zero (Value n a) 
Positive n => Sized (Value n a) 
(Positive n, IsPrimitive a) => C (Value n a)

The implementation of insert may need to perform arithmetics at run-time and is thus a bit inefficient.

(Positive n, IsPrimitive a, IsFirstClass a) => Read (Value n a)

The implementation of extract may need to perform arithmetics at run-time and is thus a bit inefficient.

MakeArguments (Value n a) 

interleave :: (IsPrimitive a, Positive n) => T (Value n a) -> CodeGenFunction r (Value n a)Source

deinterleave :: (IsPrimitive a, Positive n) => Value n a -> CodeGenFunction r (T (Value n a))Source

fromMono :: (IsPrimitive a, Positive n) => Value n a -> CodeGenFunction r (Value n a)Source

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

extractAll :: (IsPrimitive a, Positive n) => Value n a -> CodeGenFunction r [T (Value a)]Source

zero :: (Positive n, C a) => T n aSource

amplify :: (Positive n, IsPrimitive a, IsArithmetic a, IsConst a) => a -> Value n a -> CodeGenFunction r (Value n a)Source

envelope :: (Positive n, IsPrimitive a, IsArithmetic a, IsConst a) => Value n a -> Value n a -> CodeGenFunction r (Value n a)Source