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/] [gcc.target/] [i386/] [sse4_1-insertps-2.c] - Blame information for rev 318

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 318 jeremybenn
/* { dg-do run } */
2
/* { dg-require-effective-target sse4 } */
3
/* { dg-options "-O2 -msse4.1" } */
4
 
5
#ifndef CHECK_H
6
#define CHECK_H "sse4_1-check.h"
7
#endif
8
 
9
#ifndef TEST
10
#define TEST sse4_1_test
11
#endif
12
 
13
#include CHECK_H
14
 
15
#include <smmintrin.h>
16
static void
17
TEST (void)
18
{
19
  union
20
    {
21
      __m128 x;
22
      float f[4];
23
    } vals[4], val;
24
  int i, j;
25
 
26
  val.f[0]= 1.;
27
  val.f[1]= 2.;
28
  val.f[2]= 3.;
29
  val.f[3]= 4.;
30
 
31
  vals[0].x = _MM_PICK_OUT_PS (val.x, 0);
32
  vals[1].x = _MM_PICK_OUT_PS (val.x, 1);
33
  vals[2].x = _MM_PICK_OUT_PS (val.x, 2);
34
  vals[3].x = _MM_PICK_OUT_PS (val.x, 3);
35
 
36
  for (i = 0; i < 4; i++)
37
    for (j = 0; j < 4; j++)
38
      if ((j != 0 && vals[i].f[j] != 0)
39
          || (j == 0 && vals[i].f[j] != val.f[i]))
40
        abort ();
41
 
42
  if (_MM_MK_INSERTPS_NDX(0, 0, 0x1) != 0x01
43
      || _MM_MK_INSERTPS_NDX(0, 1, 0x2) != 0x12
44
      || _MM_MK_INSERTPS_NDX(0, 2, 0x3) != 0x23
45
      || _MM_MK_INSERTPS_NDX(0, 3, 0x4) != 0x34
46
      || _MM_MK_INSERTPS_NDX(1, 0, 0x5) != 0x45
47
      || _MM_MK_INSERTPS_NDX(1, 1, 0x6) != 0x56
48
      || _MM_MK_INSERTPS_NDX(2, 2, 0x7) != 0xA7
49
      || _MM_MK_INSERTPS_NDX(3, 3, 0x8) != 0xF8)
50
    abort ();
51
}

powered by: WebSVN 2.1.0

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