
20 Dec
2012
20 Dec
'12
11:38 a.m.
On 20/12/2012 11:05, Joel Falcou wrote:
* is it possible to define simd kernels for both packs and scalars e.g. to make use of branches in the scalar implementation used in preroll/postroll of unrolled loops?
All operations on pack are also defined on scalar so if you write a polymorphic template functor, it will work on both. There is a simple example of this in the paper.
While this works, if you do this you won't be able to use lazy branch evaluation in the scalar version. If you write c = if_else(a != 0, b/a, b); this is equivalent in scalar to c = (a != 0) ? b/a : b; except that in the case above you will always compute the division.