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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [gcc.target/] [i386/] [avx2-vpbroadcastd128-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-options "-mavx2 -O2" } */
3
/* { dg-require-effective-target avx2 } */
4
 
5
#include "avx2-check.h"
6
#include <string.h>
7
 
8
#define NUM 10
9
 
10
static void
11
init_pbroadcastd128 (int *src, int seed)
12
{
13
  int i, sign = 1;
14
 
15
  for (i = 0; i < 4; i++)
16
    {
17
      src[i] = (i + seed) * (i + seed) * sign;
18
      sign = -sign;
19
    }
20
}
21
 
22
static void
23
calc_pbroadcastd128 (int *src, int *dst)
24
{
25
  int i;
26
 
27
  for (i = 0; i < 4; i++)
28
    dst[i] = src[0];
29
}
30
 
31
static void
32
avx2_test (void)
33
{
34
  union128i_d src, dst;
35
  int dst_ref[4];
36
  int i;
37
 
38
  for (i = 0; i < NUM; i++)
39
    {
40
      init_pbroadcastd128 (src.a, i);
41
 
42
      dst.x = _mm_broadcastd_epi32 (src.x);
43
      calc_pbroadcastd128 (src.a, dst_ref);
44
 
45
      if (check_union128i_d (dst, dst_ref))
46
        abort ();
47
    }
48
}

powered by: WebSVN 2.1.0

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