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-vpermilps-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 CTRL
8
#define CTRL 233
9
#endif
10
 
11
#define mask_v(pos) ((CTRL & (0x3 << (pos))) >> (pos))
12
 
13
void static
14
avx_test ()
15
{
16
    union256 u, s;
17
    union256i_q ctl;
18
    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)};
19
    float e[8];
20
 
21
    s.x = _mm256_set_ps (1, 2, 3, 4, 5, 6, 7, 8);
22
    ctl.x = _mm256_loadu_si256((__m256i*) m);
23
    u.x = _mm256_permutevar_ps(s.x, ctl.x);
24
 
25
    e[0] = s.a[0 + (m[0] & 0x03)];
26
    e[1] = s.a[0 + (m[1] & 0x03)];
27
    e[2] = s.a[0 + (m[2] & 0x03)];
28
    e[3] = s.a[0 + (m[3] & 0x03)];
29
    e[4] = s.a[4 + (m[4] & 0x03)];
30
    e[5] = s.a[4 + (m[5] & 0x03)];
31
    e[6] = s.a[4 + (m[6] & 0x03)];
32
    e[7] = s.a[4 + (m[7] & 0x03)];
33
 
34
    if (check_union256 (u, e))
35
      abort ();
36
}
37
 

powered by: WebSVN 2.1.0

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