foreach_bit
Kulakov, Igor
[please enable javascript to see the address]
Wed Aug 15 00:01:07 CEST 2012
Hi Matthias,
one more thing, which disturbs me for a long time:
why Vc doesn't provide standard functions fabs(float ) (it has abs(float ) instead) and sign(float )?
As for me will be more convenient to have for both float_v and float all functions with same names.
Regards,
Igor
On Aug 14, 2012, at 2:24 AM, Matthias Kretz wrote:
> 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
>
> _______________________________________________
> Vc mailing list
>[please enable javascript to see the address]
> https://compeng.uni-frankfurt.de/mailman/listinfo/vc
More information about the Vc
mailing list