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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [gcc.target/] [i386/] [avx2-i64gatherd-4.c] - Blame information for rev 691

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 691 jeremybenn
/* { dg-do run } */
2
/* { dg-require-effective-target avx2 } */
3
/* { dg-options "-O2 -mavx2" } */
4
 
5
#include <string.h>
6
#include "avx2-check.h"
7
 
8
static void
9
compute_i64gatherps (int *src,
10
                     int *s1, long long *s2, int *mask, int scale, int *r)
11
{
12
  int i;
13
 
14
  for (i = 0; i < 2; ++i)
15
    if ((mask[i] >> 31) & 1)
16
      r[i] = *(int *) (((unsigned char *) s1) + s2[i] * scale);
17
    else
18
      r[i] = src[i];
19
}
20
 
21
void static
22
avx2_test (void)
23
{
24
  int i;
25
  union128i_q idx;
26
  union128i_d res, src, mask;
27
  int s1[2], res_ref[4] = { 0 };
28
 
29
  for (i = 0; i < 2; ++i)
30
    {
31
      /* Set some stuff */
32
      s1[i] = 1973 * (i + 1) * (i + 2);
33
 
34
      /* Set src as something different from s1 */
35
      src.a[i] = -s1[i];
36
 
37
      /* Mask out evens */
38
      mask.a[i] = i % 2 ? 0 : -1;
39
 
40
      /* About to gather in reverse order,
41
         divide by 2 to demonstrate scale */
42
      idx.a[i] = (8 - (i + 1) * 4) >> 1;
43
    }
44
 
45
  res.x = _mm_mask_i64gather_epi32 (src.x, s1, idx.x, mask.x, 2);
46
 
47
  compute_i64gatherps (src.a, s1, idx.a, mask.a, 2, res_ref);
48
 
49
  if (check_union128i_d (res, res_ref) != 0)
50
    abort ();
51
}

powered by: WebSVN 2.1.0

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