Boost logo

Boost :

Subject: Re: [boost] [XInt] Some after thoughts about SIMD
From: Mathias Gaunard (mathias.gaunard_at_[hidden])
Date: 2011-03-12 05:54:12


On 11/03/2011 22:05, Matt Calabrese wrote:

> Even if a given compiler can't do such further optimizations for you, I
> wouldn't consider it the end of the road for expression templates. Not that
> I would necessarily suggest the following solution for all situations, but
> you could always attach a type-tag to a reused variable when forming an
> expression, for instance:
>
> some_type a, b, c;
>
> some_tagger< a_tag> a_( a );
>
> c = a_ * b + a_;
>
> Since a_ here has a unique tag "a_tag" associated with it, the hypothetical
> DSEL can be made to treat the two instances of a_ as the same variable and
> would therefore know to use specific instructions in such a case. Again, I'm
> not proposing that this is a great solution as it requires some effort on
> the part of the user, but by type-tagging objects that appear multiple times
> in a single expression you can do the kinds of things that you are talking
> about.

In practice, such tagging on SIMD registers is not necessary.
On bigger quantities, such as a vector, a matrix, or something like
that, you can afford to simply do a runtime test if no such tagging is
present.


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk