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

Subversion Repositories openrisc

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

Go to most recent revision | 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 (float *s1, long long *s2, int scale, float *r)
10
{
11
  int i;
12
 
13
  for (i = 0; i < 2; ++i)
14
    r[i] = *(float *) (((unsigned char *) s1) + s2[i] * scale);
15
}
16
 
17
void static
18
avx2_test (void)
19
{
20
  int i;
21
  union128i_q idx;
22
  union128 res;
23
  float s1[2], res_ref[4] = { 0 };
24
 
25
  for (i = 0; i < 2; ++i)
26
    {
27
      /* Set some stuff */
28
      s1[i] = 2.718281828459045 * (i + 1) * (i + 2);
29
 
30
      /* About to gather in reverse order,
31
         divide by 2 to demonstrate scale */
32
      idx.a[i] = (8 - (i + 1) * 4) >> 1;
33
    }
34
 
35
  res.x = _mm_i64gather_ps (s1, idx.x, 2);
36
 
37
  compute_i64gatherps (s1, idx.a, 2, res_ref);
38
 
39
  if (check_union128 (res, res_ref) != 0)
40
    abort ();
41
}

powered by: WebSVN 2.1.0

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