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/] [pr43430-1.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 "tree-vect.h"
5
 
6
#define N 16
7
 
8
typedef int myint;
9
myint data_ch1[N + 1] =
10
  { 0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30 };
11
myint data_ch2[N + 1] =
12
  { 0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30 };
13
#define SUM 480
14
 
15
__attribute__ ((noinline)) int
16
foo (myint * s1, myint * s2, int stride)
17
{
18
  int score = 0;
19
  int x;
20
  for (x = 0; x < N; x++)
21
    score += ((s1[x] - s1[x + stride] + s2[x + stride]) >= 0 ?
22
              s1[x] + s2[x + stride] :
23
              s2[x + stride]);
24
 
25
  if (score != SUM)
26
    abort ();
27
 
28
  return 0;
29
}
30
 
31
int
32
main (void)
33
{
34
  check_vect ();
35
  return foo (data_ch1, data_ch2, 1);
36
}
37
 
38
/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
39
/* { dg-final { cleanup-tree-dump "vect" } } */

powered by: WebSVN 2.1.0

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