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

Subversion Repositories openrisc

[/] [openrisc/] [tags/] [gnu-src/] [gcc-4.5.1/] [gcc-4.5.1-or32-1.0rc1/] [gcc/] [testsuite/] [gcc.dg/] [vect/] [slp-perm-2.c] - Blame information for rev 338

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 298 jeremybenn
/* { dg-require-effective-target vect_int } */
2
 
3
#include <stdarg.h>
4
#include <stdio.h>
5
#include "tree-vect.h"
6
 
7
#define M00 100
8
#define M10 216
9
#define M01 1322
10
#define M11 13
11
#define M02 74
12
#define M12 191
13
 
14
#define N 16
15
 
16
void foo (unsigned int *__restrict__ pInput, unsigned int *__restrict__ pOutput)
17
{
18
  unsigned int i, a, b;
19
 
20
  for (i = 0; i < N / 2; i++)
21
    {
22
       a = *pInput++;
23
       b = *pInput++;
24
 
25
       *pOutput++ = M00 * a + M01 * b;
26
       *pOutput++ = M10 * a + M11 * b;
27
    }
28
}
29
 
30
int main (int argc, const char* argv[])
31
{
32
  unsigned int input[N], output[N], i;
33
  unsigned int check_results[N] = {1322, 13, 4166, 471, 7010, 929, 9854, 1387, 12698, 1845, 15542, 2303, 18386, 2761, 21230, 3219};
34
 
35
  check_vect ();
36
 
37
  for (i = 0; i < N; i++)
38
    {
39
      input[i] = i%256;
40
      if (input[i] > 200)
41
        abort();
42
      output[i] = 0;
43
    }
44
 
45
  foo (input, output);
46
 
47
  for (i = 0; i < N; i++)
48
    if (output[i] != check_results[i])
49
      abort ();
50
 
51
  return 0;
52
}
53
 
54
/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect"  { target vect_perm } } } */
55
/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 1 "vect" { target vect_perm } } } */
56
/* { dg-final { cleanup-tree-dump "vect" } } */
57
 

powered by: WebSVN 2.1.0

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