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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [g++.dg/] [other/] [i386-4.C] - Blame information for rev 774

Go to most recent revision | Details | Compare with Previous | View Log

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

powered by: WebSVN 2.1.0

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