OpenCores
URL https://opencores.org/ocsvn/openrisc_me/openrisc_me/trunk

Subversion Repositories openrisc_me

[/] [openrisc/] [trunk/] [gnu-src/] [gcc-4.5.1/] [gcc/] [testsuite/] [g++.dg/] [other/] [i386-4.C] - Blame information for rev 301

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 301 jeremybenn
/* { dg-do compile { target i?86-*-* x86_64-*-* } } */
2
/* { dg-options "-O1 -msse2" } */
3
/* { dg-require-effective-target sse2 } */
4
 
5
#include 
6
 
7
void ConvertFloatSSE (void *inBuff, void *outBuff, int len)
8
{
9
  unsigned char *inByteBuffer = reinterpret_cast < unsigned char *>(inBuff);
10
  float *outFloatBuffer = reinterpret_cast < float *>(outBuff);
11
 
12
  for (int i = 0; i < len / 4; i++)
13
    {
14
      __m128i register1 =
15
        _mm_set_epi8 (*inByteBuffer, *(inByteBuffer + 1),
16
                      *(inByteBuffer + 2), 0,
17
                      *(inByteBuffer + 3), *(inByteBuffer + 4),
18
                      *(inByteBuffer + 5), 0,
19
                      *(inByteBuffer + 6), *(inByteBuffer + 7),
20
                      *(inByteBuffer + 8), 0,
21
                      *(inByteBuffer + 9), *(inByteBuffer + 10),
22
                      *(inByteBuffer + 11), 0);
23
      __m128i register2 = _mm_srai_epi32 (register1, 8);
24
      __m128 register3 = _mm_cvtepi32_ps (register2);
25
 
26
      _mm_store_ps (outFloatBuffer, register3);
27
      outFloatBuffer += 4;
28
      inByteBuffer += 12;
29
    }
30
}

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.