FIAS . Impressum . Privacy

Potential bug in double_m operator==

Matthias Kretz [please enable javascript to see the address]
Thu Jun 12 13:19:42 CEST 2014


Hello Georgios,

thanks for the report and investigation. I can confirm the bug and I just 
wrote a new unit test for it.
With what you just added, it was clear to me that I must have gotten something 
wrong with the use of the testps instruction (which was added with SSE4). I'll 
see whether I can use testps at all, right now I don't see an obvious fix 
other than going back to what the SSE code does.

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
> 
> Cheers,
> Georgios
> 
> 
>[please enable javascript to see the address]>
> 
> wrote:
> > Hi Matthias,
> > 
> > Have a look at the snippet below, it's producing strange output:
> > #include <Vc/Vc>
> > 
> > using namespace Vc;
> > int main() {
> > 
> >    double_m a(Vc::One);
> >    double_m b(Vc::Zero);
> >    std::cout << a << std::endl;
> >    std::cout << b << std::endl;
> >    std::cout << (a == b) << std::endl;
> > 
> > }
> > 
> > The output I get is:
> > m[1111]
> > m[0000]
> > 1
> > 
> > Clearly, the two masks are not equal so the last line should be 0.. Could
> > you confirm if this is a bug?
> > 
> > Tested
> > with a1d8b9fc31060d870386613cc72319546c850b87,
> > f692ec56aa28204f2166571c5c30ec6cdcfaaecd, both producing identical
> > output.
> > 
> > Thanks,
> > Georgios

-- 
─────────────────────────────────────────────────────────────
 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