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

Subversion Repositories openrisc_me

[/] [openrisc/] [trunk/] [gnu-src/] [gcc-4.5.1/] [gcc/] [testsuite/] [gcc.target/] [i386/] [avx-vmaskmovps-256-2.c] - Blame information for rev 318

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 318 jeremybenn
/* { dg-do run } */
2
/* { dg-require-effective-target avx } */
3
/* { dg-options "-O2 -mavx" } */
4
 
5
#include "avx-check.h"
6
 
7
#ifndef MASK
8
#define MASK 214
9
#endif
10
 
11
#define mask_v(pos) (((MASK & (0x1 << (pos))) >> (pos)) << 31)
12
 
13
void static
14
avx_test (void)
15
{
16
  int i;
17
  int m[8] = {mask_v(0), mask_v(1), mask_v(2), mask_v(3), mask_v(4), mask_v(5), mask_v(6), mask_v(7)};
18
  float s[8] = {1,2,3,4,5,6,7,8};
19
  union256 src, mask;
20
  float e [8] = {0.0};
21
  float d [8] = {0.0};
22
 
23
  src.x = _mm256_loadu_ps (s);
24
  mask.x = _mm256_loadu_ps ((float *)m);
25
  _mm256_maskstore_ps (d, mask.x, src.x);
26
 
27
  for (i = 0 ; i < 8; i++)
28
    e[i] = m[i] ? s[i] : 0;
29
 
30
  if (checkVf (d, e, 8))
31
    abort ();
32
}

powered by: WebSVN 2.1.0

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