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-pextrw.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
 
17
#define msk0   0
18
#define msk1   1
19
#define msk2   2
20
#define msk3   3
21
#define msk4   4
22
#define msk5   5
23
#define msk6   6
24
#define msk7   7
25
 
26
static void
27
TEST (void)
28
{
29
  union
30
    {
31
      __m128i x;
32
      int i[4];
33
      short s[8];
34
    } val1;
35
  int res[8], masks[8];
36
  int i;
37
 
38
  val1.i[0] = 0x04030201;
39
  val1.i[1] = 0x08070605;
40
  val1.i[2] = 0x0C0B0A09;
41
  val1.i[3] = 0x100F0E0D;
42
 
43
  res[0] = _mm_extract_epi16 (val1.x, msk0);
44
  res[1] = _mm_extract_epi16 (val1.x, msk1);
45
  res[2] = _mm_extract_epi16 (val1.x, msk2);
46
  res[3] = _mm_extract_epi16 (val1.x, msk3);
47
  res[4] = _mm_extract_epi16 (val1.x, msk4);
48
  res[5] = _mm_extract_epi16 (val1.x, msk5);
49
  res[6] = _mm_extract_epi16 (val1.x, msk6);
50
  res[7] = _mm_extract_epi16 (val1.x, msk7);
51
 
52
  masks[0] = msk0;
53
  masks[1] = msk1;
54
  masks[2] = msk2;
55
  masks[3] = msk3;
56
  masks[4] = msk4;
57
  masks[5] = msk5;
58
  masks[6] = msk6;
59
  masks[7] = msk7;
60
 
61
  for (i = 0; i < 8; i++)
62
    if (res[i] != val1.s [masks[i]])
63
      abort ();
64
}

powered by: WebSVN 2.1.0

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