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-vperm2f128-256-3.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 IMM8
8
#  define IMM8 100
9
#endif
10
 
11
void static
12
avx_test ()
13
{
14
    union256i_q source1, source2, u;
15
    long long  s1[4]={1, 2, 3, 4};
16
    long long  s2[4]={5, 6, 7, 8};
17
    long long   e[4];
18
 
19
    source1.x = _mm256_loadu_si256((__m256i*)s1);
20
    source2.x = _mm256_loadu_si256((__m256i*)s2);
21
    u.x = _mm256_permute2f128_si256(source1.x, source2.x, IMM8);
22
 
23
    if(IMM8 & 8) e[0] = e[1] = 0;
24
    else{
25
        e[0] = (IMM8 & 2 ? s2 : s1)[(IMM8 & 1) * 2];
26
        e[1] = (IMM8 & 2 ? s2 : s1)[(IMM8 & 1) * 2 + 1];
27
    }
28
    if(IMM8 & 128) e[3] = e[3] = 0;
29
    else{
30
        unsigned m = (IMM8 >> 4) & 3;
31
        e[2] = (m & 2 ? s2 : s1)[(m & 1) * 2];
32
        e[3] = (m & 2 ? s2 : s1)[(m & 1) * 2 + 1];
33
    }
34
 
35
   if (check_union256i_q (u, e))
36
     abort ();
37
}

powered by: WebSVN 2.1.0

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