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-6.c] - Blame information for rev 816

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 149 jeremybenn
/* { dg-require-effective-target vect_float } */
2
 
3
#include <stdarg.h>
4
#include "tree-vect.h"
5
 
6
#define N 16
7
#define DIFF 242
8
 
9
int main1 (float x, float max_result)
10
{
11
  int i;
12
  float b[N] = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45};
13
  float c[N] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15};
14
  float diff = 2;
15
  float max = x;
16
  float min = 10;
17
 
18
  for (i = 0; i < N; i++) {
19
    diff += (b[i] - c[i]);
20
  }
21
 
22
  for (i = 0; i < N; i++) {
23
    max = max < c[i] ? c[i] : max;
24
  }
25
 
26
  for (i = 0; i < N; i++) {
27
    min = min > c[i] ? c[i] : min;
28
  }
29
 
30
  /* check results:  */
31
  if (diff != DIFF)
32
    abort ();
33
  if (max != max_result)
34
    abort ();
35
  if (min != 0)
36
    abort ();
37
 
38
  return 0;
39
}
40
 
41
int main (void)
42
{
43
  check_vect ();
44
 
45
  main1 (100 ,100);
46
  main1 (0, 15);
47
  return 0;
48
}
49
 
50
/* need -ffast-math to vectorizer these loops.  */
51
/* { dg-final { scan-tree-dump-times "vectorized 0 loops" 1 "vect" } } */
52
/* { 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.