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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-old/] [gcc-4.2.2/] [gcc/] [testsuite/] [gcc.dg/] [vect/] [vect-reduc-pattern-2a.c] - Blame information for rev 149

Go to most recent revision | 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
signed short data_sh[N] =
8
  { 0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28 };
9
#define SUM 210
10
 
11
int
12
foo ()
13
{
14
  int i;
15
  signed int intsum = 0;
16
 
17
  /* widenning sum: sum shorts into int.  */
18
  for (i = 0; i < N; i++)
19
    {
20
      intsum += data_sh[i];
21
    }
22
 
23
  /* check results:  */
24
  if (intsum != SUM)
25
    abort ();
26
 
27
  return 0;
28
}
29
 
30
int
31
main (void)
32
{
33
  check_vect ();
34
  return foo ();
35
}
36
 
37
/* { dg-final { scan-tree-dump-times "vect_recog_widen_sum_pattern: detected" 1 "vect" } } */
38
/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target vect_widen_sum_hi_to_si } } } */
39
/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 0 "vect" { target { ! vect_widen_sum_hi_to_si } } } } */
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.