FIAS . Impressum . Privacy

foreach_bit

Matthias Kretz [please enable javascript to see the address]
Tue Aug 14 08:24:51 CEST 2012


Hi,

at least GCC nicely optimizes my solution, so I made it available in the 
master branch. (BTW, also Vc::Scalar failed with break: it resulted in an 
infinite loop.)

Feel free to switch to the master branch for your work for now. I'm working 
towards an 0.7 release with this branch (hopefully this month).

Regards,
  	Matthias

On Monday 13 August 2012 09:03:45 Matthias Kretz wrote:
> On Thursday 09 August 2012 20:32:27 Kulakov, Igor wrote:
> > Is this possible to break foreach_bit() like any other loop?
> > 
> > I mean something like:
> >  float_v a = ...;
> >  Vc_foreach_bit(int i, a < 0.f) {
> >  
> >    std::cout << a[i] << "\n";
> >    if (a[i] > 0) break;
> >  
> >  }
> 
> Good question. No, at least it's not guaranteed to work (it'll surely work
> with the Vc::Scalar :) ). I have an idea how it could be implemented, but
> I'll have to check how well the compilers optimize it.
> ,
> Feel free to open a ticket at code.compeng.uni-frankfurt.de .
> 
> Background: Vc_foreach_bit is implemented as two nested for loops. Thus a
> break statement will only break out of the inner loop. This is has the same
> effect as a continue statement then.
> 
> Regards,
>   	Matthias
-- 
Dipl.-Phys. Matthias Kretz
http://compeng.uni-frankfurt.de/?mkretz

SIMD easy and portable: http://compeng.uni-frankfurt.de/?vc



More information about the Vc mailing list
FIAS . Impressum . Privacy