From: Uros Bizjak Date: Mon, 21 Apr 2008 18:41:04 +0000 (+0200) Subject: re PR target/26445 (SSE byte-by-byte load instruction fails to compile) X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=f7546fa716b5617bd46712f6b042b1f40c31fe68;p=gcc.git re PR target/26445 (SSE byte-by-byte load instruction fails to compile) PR target/26445 * g++.dg/other/i386-4.C: New test. From-SVN: r134522 --- diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 64416f4068f..5cbca72b0f8 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2008-04-21 Uros Bizjak + + PR target/26445 + * g++.dg/other/i386-4.C: New test. + 2008-04-21 Jason Merrill PR c++/35325 @@ -18,7 +23,7 @@ 2008-04-20 Jerry DeLisle PR fortran/35991 - gfortran.dg/zero-sized_4.f90: New test. + * gfortran.dg/zero-sized_4.f90: New test. 2008-04-20 Jerry DeLisle diff --git a/gcc/testsuite/g++.dg/other/i386-4.C b/gcc/testsuite/g++.dg/other/i386-4.C new file mode 100644 index 00000000000..3e0d94e952c --- /dev/null +++ b/gcc/testsuite/g++.dg/other/i386-4.C @@ -0,0 +1,29 @@ +/* { dg-do compile { target i?86-*-* x86_64-*-* } } */ +/* { dg-options "-O1 -msse2" } */ + +#include + +void ConvertFloatSSE (void *inBuff, void *outBuff, int len) +{ + unsigned char *inByteBuffer = reinterpret_cast < unsigned char *>(inBuff); + float *outFloatBuffer = reinterpret_cast < float *>(outBuff); + + for (int i = 0; i < len / 4; i++) + { + __m128i register1 = + _mm_set_epi8 (*inByteBuffer, *(inByteBuffer + 1), + *(inByteBuffer + 2), 0, + *(inByteBuffer + 3), *(inByteBuffer + 4), + *(inByteBuffer + 5), 0, + *(inByteBuffer + 6), *(inByteBuffer + 7), + *(inByteBuffer + 8), 0, + *(inByteBuffer + 9), *(inByteBuffer + 10), + *(inByteBuffer + 11), 0); + __m128i register2 = _mm_srai_epi32 (register1, 8); + __m128 register3 = _mm_cvtepi32_ps (register2); + + _mm_store_ps (outFloatBuffer, register3); + outFloatBuffer += 4; + inByteBuffer += 12; + } +}