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-pinsrq.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 lp64 } */
3
/* { dg-require-effective-target sse4 } */
4
/* { dg-options "-O2 -msse4.1" } */
5
 
6
#ifndef CHECK_H
7
#define CHECK_H "sse4_1-check.h"
8
#endif
9
 
10
#ifndef TEST
11
#define TEST sse4_1_test
12
#endif
13
 
14
#include CHECK_H
15
 
16
#include <smmintrin.h>
17
#include <string.h>
18
 
19
#define msk0 0x00
20
#define msk1 0x01
21
 
22
static void
23
__attribute__((noinline))
24
TEST (void)
25
{
26
  union
27
    {
28
      __m128i x;
29
      unsigned long long ll[2];
30
    } res [4], val, tmp;
31
  int masks[4];
32
  static unsigned long long ins[2] =
33
    { 0xAABBAABBAABBAABBLL, 0xCCDDCCDDCCDDCCDDLL };
34
  int i;
35
 
36
  val.ll[0] = 0x0807060504030201LL;
37
  val.ll[1] = 0x100F0E0D0C0B0A09LL;
38
 
39
  /* Check pinsrq imm8, r64, xmm.  */
40
  res[0].x = _mm_insert_epi64 (val.x, ins[0], msk0);
41
  res[1].x = _mm_insert_epi64 (val.x, ins[0], msk1);
42
 
43
  masks[0] = msk0;
44
  masks[1] = msk1;
45
 
46
  for (i = 0; i < 2; i++)
47
    {
48
      tmp.x = val.x;
49
      tmp.ll[masks[i]] = ins[0];
50
      if (memcmp (&tmp, &res[i], sizeof (tmp)))
51
        abort ();
52
    }
53
 
54
  /* Check pinsrq imm8, m64, xmm.  */
55
  for (i = 0; i < 2; i++)
56
    {
57
      res[i].x = _mm_insert_epi64 (val.x, ins[i], msk0);
58
      masks[i] = msk0;
59
    }
60
 
61
  for (i = 0; i < 2; i++)
62
    {
63
      tmp.x = val.x;
64
      tmp.ll[masks[i]] = ins[i];
65
      if (memcmp (&tmp, &res[i], sizeof (tmp)))
66
        abort ();
67
    }
68
}

powered by: WebSVN 2.1.0

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