OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [gcc.target/] [i386/] [avx2-vpackusdw-2.c] - Blame information for rev 749

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 691 jeremybenn
/* { dg-do run } */
2
/* { dg-options "-mavx2 -O2" } */
3
/* { dg-require-effective-target avx2 } */
4
 
5
#include "avx2-check.h"
6
 
7
static unsigned short
8
int_to_ushort (int iVal)
9
{
10
  unsigned short sVal;
11
 
12
  if (iVal < 0)
13
    sVal = 0;
14
  else if (iVal > 65536)
15
    sVal = 65535;
16
  else
17
    sVal = iVal;
18
 
19
  return sVal;
20
}
21
 
22
void static
23
avx2_test (void)
24
{
25
  union256i_d s1, s2;
26
  union256i_w u;
27
  unsigned short e[16];
28
  int i;
29
 
30
  s1.x = _mm256_set_epi32 (1, 2, 3, 4, -65000, 20, 30, 90);
31
 
32
  s2.x = _mm256_set_epi32 (88, 44, 33, 22, 11, 98, 76, 120000);
33
 
34
  u.x = _mm256_packus_epi32 (s1.x, s2.x);
35
 
36
  for (i = 0; i < 4; i++)
37
    {
38
      e[i] = int_to_ushort (s1.a[i]);
39
      e[i + 4] = int_to_ushort (s2.a[i]);
40
      e[i + 8] = int_to_ushort (s1.a[i + 4]);
41
      e[i + 12] = int_to_ushort (s2.a[i + 4]);
42
    }
43
 
44
  if (check_union256i_w (u, e))
45
    abort ();
46
}

powered by: WebSVN 2.1.0

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