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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [gcc.target/] [i386/] [avx2-vpmaskloadd-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 "avx2-check.h"
6
 
7
#ifndef MASK
8
#define MASK 134
9
#endif
10
 
11
#define mask_v(pos) (((MASK & (0x1 << (pos))) >> (pos)) << 31)
12
 
13
void static
14
avx2_test (void)
15
{
16
  int i;
17
  int m[4] = { mask_v (0), mask_v (1), mask_v (2), mask_v (3) };
18
  int s[4] = { 1, 2, 3, 4 };
19
  union128i_d u, mask;
20
  int e[4] = { 0 };
21
 
22
  mask.x = _mm_loadu_si128 ((__m128i *) m);
23
  u.x = _mm_maskload_epi32 (s, mask.x);
24
 
25
  for (i = 0; i < 4; i++)
26
    e[i] = m[i] ? s[i] : 0;
27
 
28
  if (check_union128i_d (u, e))
29
    abort ();
30
}

powered by: WebSVN 2.1.0

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