FIAS . Impressum . Privacy

Potential bug in double_m operator==

Matthias Kretz [please enable javascript to see the address]
Thu Jun 12 14:01:01 CEST 2014


Hi,

I tried to reproduce the problem with SSE4 but couldn't reproduce the problem. 
This is in line with the implementation of SSE::Mask::operator== which didn't 
use the testps intrinsic.

BTW, did you notice that Mask(false) == Mask(true) does not fail?
That's because _mm_testc_ps checks whether left & ~right is all 0. If left == 
right then you'll get a & ~a == 0. But if left == 0 already then left & 
whatever == 0 (or right == 1 then whatever & 0 == 0).

Anyway I'll use movemask(left) == movemask(right) to implement operator== for 
AVX::Mask. This'll fix the problem.

Cheers,
  Matthias

On Thursday 12 June 2014 12:15:28 Georgios Bitzes wrote:
> There's one more piece of information to add: The bug seems to be present
> in SSE4.1/4.2, AVX, AVX2 but not SSE2 or SSE3. Tested both with gcc and
> icc, so the bug is likely in Vc, not the compilers.
> 
> With -msse, -msse2, -msse3, -mssse3
> m[11]
> m[00]
> 0
> 
> -msse4.1, -msse4.2
> m[11]
> m[00]
> 1
> 
> -mavx, -mavx2
> m[1111]
> m[0000]
> 1
-- 
─────────────────────────────────────────────────────────────
 Dipl.-Phys. Matthias Kretz

 Web:   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