[PATCH] Fix bug in xmmintrin.h

Akira Hatanaka ahatanak at gmail.com
Thu May 22 17:54:36 PDT 2014


Thanks, committed r209489.


On Thu, May 22, 2014 at 5:32 PM, Eric Christopher <echristo at gmail.com>wrote:

> LGTM. Thanks!
>
> -eric
>
> On Thu, May 22, 2014 at 4:50 PM, Akira Hatanaka <ahatanak at gmail.com>
> wrote:
> > The attached patch changes the last step of _mm_cvtps_pi16, which is a
> > function that converts four single precision floating point values into
> four
> > signed 16-bit integers, to use _mm_packs_pi32 instead of _mm_packs_pi16.
> >
> > <rdar://problem/16873717>
> >
> > The following program miscompiles without the fix:
> >
> > #include <xmmintrin.h>
> >
> > #include <stdio.h>
> >
> >
> > int main(int argc, char **argv)
> >
> > {
> >
> >   __m128 test2 = _mm_setr_ps(10.0f, 100.0f, 200.0f, 300.0f);
> >
> >   __m64 result = _mm_cvtps_pi16(test2);
> >
> >
> >   // wrong value: 0x007f007f0064000a
> >
> >   // proper value: 0x012c00c80064000a
> >
> >   printf("%llx\n", result);
> >
> >
> >   return 0;
> >
> > }
> >
> >
> >
> >
> > _______________________________________________
> > cfe-commits mailing list
> > cfe-commits at cs.uiuc.edu
> > http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
> >
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20140522/bfbb661d/attachment.html>


More information about the cfe-commits mailing list