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-pextrb.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
#include <smmintrin.h>
15
 
16
#define msk0   0
17
#define msk1   1
18
#define msk2   2
19
#define msk3   3
20
#define msk4   4
21
#define msk5   5
22
#define msk6   6
23
#define msk7   7
24
#define msk8   8
25
#define msk9   9
26
#define msk10 10
27
#define msk11 11
28
#define msk12 12
29
#define msk13 13
30
#define msk14 14
31
#define msk15 15
32
 
33
static void
34
TEST (void)
35
{
36
  union
37
    {
38
      __m128i x;
39
      int i[4];
40
      char c[16];
41
    } val1;
42
  int res[16], masks[16];
43
  int i;
44
 
45
  val1.i[0] = 0x04030201;
46
  val1.i[1] = 0x08070605;
47
  val1.i[2] = 0x0C0B0A09;
48
  val1.i[3] = 0x100F0E0D;
49
 
50
  res[0] = _mm_extract_epi8 (val1.x, msk0);
51
  res[1] = _mm_extract_epi8 (val1.x, msk1);
52
  res[2] = _mm_extract_epi8 (val1.x, msk2);
53
  res[3] = _mm_extract_epi8 (val1.x, msk3);
54
  res[4] = _mm_extract_epi8 (val1.x, msk4);
55
  res[5] = _mm_extract_epi8 (val1.x, msk5);
56
  res[6] = _mm_extract_epi8 (val1.x, msk6);
57
  res[7] = _mm_extract_epi8 (val1.x, msk7);
58
  res[8] = _mm_extract_epi8 (val1.x, msk8);
59
  res[9] = _mm_extract_epi8 (val1.x, msk9);
60
  res[10] = _mm_extract_epi8 (val1.x, msk10);
61
  res[11] = _mm_extract_epi8 (val1.x, msk11);
62
  res[12] = _mm_extract_epi8 (val1.x, msk12);
63
  res[13] = _mm_extract_epi8 (val1.x, msk13);
64
  res[14] = _mm_extract_epi8 (val1.x, msk14);
65
  res[15] = _mm_extract_epi8 (val1.x, msk15);
66
 
67
  masks[0] = msk0;
68
  masks[1] = msk1;
69
  masks[2] = msk2;
70
  masks[3] = msk3;
71
  masks[4] = msk4;
72
  masks[5] = msk5;
73
  masks[6] = msk6;
74
  masks[7] = msk7;
75
  masks[8] = msk8;
76
  masks[9] = msk9;
77
  masks[10] = msk10;
78
  masks[11] = msk11;
79
  masks[12] = msk12;
80
  masks[13] = msk13;
81
  masks[14] = msk14;
82
  masks[15] = msk15;
83
 
84
  for (i = 0; i < 16; i++)
85
    if (res[i] != val1.c [masks[i]])
86
      abort ();
87
}

powered by: WebSVN 2.1.0

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