synthesizer-llvm-0.8.1.2: 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

data Value n a Source

Constructors

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

Instances

(Positive n, FirstClass a, ~ * (Stored a) am, IsPrimitive a, IsSized a, Positive (:*: n (SizeOf a)), IsPrimitive am, IsSized am, Positive (:*: n (SizeOf am))) => 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) => Undefined (Value n a) 
(Positive n, IsPrimitive a) => Zero (Value n a) 
(Positive n, IsPrimitive a) => Phi (Value n a) 
Positive n => Sized (Value n a) 
(Positive n, IsPrimitive a, IsFirstClass 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) 

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