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-pinsrd.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
#include <string.h>
17
 
18
#define msk0 0x00
19
#define msk1 0x01
20
#define msk2 0x02
21
#define msk3 0x03
22
 
23
static void
24
TEST (void)
25
{
26
  union
27
    {
28
      __m128i x;
29
      unsigned int i[4];
30
    } res [4], val, tmp;
31
  static unsigned int ins[4] = { 3, 4, 5, 6 };
32
  int masks[4];
33
  int i;
34
 
35
  val.i[0] = 55;
36
  val.i[1] = 55;
37
  val.i[2] = 55;
38
  val.i[3] = 55;
39
 
40
  /* Check pinsrd imm8, r32, xmm.  */
41
  res[0].x = _mm_insert_epi32 (val.x, ins[0], msk0);
42
  res[1].x = _mm_insert_epi32 (val.x, ins[0], msk1);
43
  res[2].x = _mm_insert_epi32 (val.x, ins[0], msk2);
44
  res[3].x = _mm_insert_epi32 (val.x, ins[0], msk3);
45
 
46
  masks[0] = msk0;
47
  masks[1] = msk1;
48
  masks[2] = msk2;
49
  masks[3] = msk3;
50
 
51
  for (i = 0; i < 4; i++)
52
    {
53
      tmp.x = val.x;
54
      tmp.i[masks[i]] = ins[0];
55
      if (memcmp (&tmp, &res[i], sizeof (tmp)))
56
        abort ();
57
    }
58
 
59
  /* Check pinsrd imm8, m32, xmm.  */
60
  for (i = 0; i < 4; i++)
61
    {
62
      res[i].x = _mm_insert_epi32 (val.x, ins[i], msk0);
63
      masks[i] = msk0;
64
    }
65
 
66
  for (i = 0; i < 4; i++)
67
    {
68
      tmp.x = val.x;
69
      tmp.i[masks[i]] = ins[i];
70
      if (memcmp (&tmp, &res[i], sizeof (tmp)))
71
        abort ();
72
    }
73
}

powered by: WebSVN 2.1.0

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