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.dg/] [vect/] [slp-perm-8.c] - Blame information for rev 298

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 N 200
8
 
9
void foo (unsigned char *__restrict__ pInput, unsigned char *__restrict__ pOutput)
10
{
11
  unsigned char i, a, b, c;
12
 
13
  for (i = 0; i < N / 3; i++)
14
    {
15
       a = *pInput++;
16
       b = *pInput++;
17
       c = *pInput++;
18
 
19
       *pOutput++ = a + b + c + 3;
20
       *pOutput++ = a + b + c + 12;
21
       *pOutput++ = a + b + c + 1;
22
    }
23
}
24
 
25
int main (int argc, const char* argv[])
26
{
27
  unsigned char input[N], output[N], i;
28
  unsigned char check_results[N];
29
 
30
  check_vect ();
31
 
32
  for (i = 0; i < N; i++)
33
    {
34
      input[i] = i;
35
      output[i] = 0;
36
      if (input[i] > 256)
37
        abort ();
38
    }
39
 
40
  for (i = 0; i < N / 3; i++)
41
    {
42
      check_results[3*i] = 9 * i + 6;
43
      check_results[3*i+1] = 9 * i + 15;
44
      check_results[3*i+2] = 9 * i + 4;
45
    }
46
 
47
  foo (input, output);
48
 
49
  for (i = 0; i < N - (N % 3); i++)
50
     if (output[i] != check_results[i])
51
       abort ();
52
 
53
  return 0;
54
}
55
 
56
/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 2 "vect" { target vect_perm } } } */
57
/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 1 "vect" { target vect_perm } } } */
58
/* { dg-final { cleanup-tree-dump "vect" } } */
59
 

powered by: WebSVN 2.1.0

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