OpenCores
URL https://opencores.org/ocsvn/openrisc_2011-10-31/openrisc_2011-10-31/trunk

Subversion Repositories openrisc_2011-10-31

[/] [openrisc/] [trunk/] [gnu-src/] [gcc-4.2.2/] [gcc/] [testsuite/] [gcc.dg/] [vect/] [vect-reduc-3.c] - Blame information for rev 154

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 149 jeremybenn
/* { dg-require-effective-target vect_int } */
2
 
3
#include <stdarg.h>
4
#include "tree-vect.h"
5
 
6
#define N 16
7
 
8
/* Test vectorization of reduction of unsigned-int in the presence
9
   of unknown-loop-bound.  */
10
 
11
int main1 (int n, int res)
12
{
13
  int i;
14
  unsigned int ub[N] = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45};
15
  unsigned int uc[N] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15};
16
  unsigned int udiff;
17
 
18
  udiff = 0;
19
  for (i = 0; i < n; i++) {
20
    udiff += (ub[i] - uc[i]);
21
  }
22
 
23
  /* check results:  */
24
  if (udiff != res)
25
    abort ();
26
 
27
  return 0;
28
}
29
 
30
int main (void)
31
{
32
  check_vect ();
33
 
34
  main1 (N, 240);
35
  main1 (N-1, 210);
36
  return 0;
37
}
38
 
39
/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { xfail vect_no_int_add } } } */
40
/* { 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.