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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [gcc.dg/] [vect/] [vect-reduc-2char.c] - Blame information for rev 801

Go to most recent revision | Details | Compare with Previous | View Log

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