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

Subversion Repositories openrisc

[/] [openrisc/] [tags/] [gnu-src/] [gcc-4.5.1/] [gcc-4.5.1-or32-1.0rc1/] [gcc/] [testsuite/] [gcc.dg/] [vect/] [vect-reduc-dot-s8c.c] - Blame information for rev 338

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 64
7
 
8
#define DOT3 43680
9
 
10
signed char X[N] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__)));
11
signed char Y[N] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__)));
12
 
13
/* char->int->int dot product.
14
   Not detected as a dot-product pattern.  */
15
__attribute__ ((noinline)) int
16
foo3(int len) {
17
  int i;
18
  int result = 0;
19
 
20
  for (i=0; i<len; i++) {
21
    result += (X[i] * Y[i]);
22
  }
23
  return result;
24
}
25
 
26
int main (void)
27
{
28
  int i, dot3;
29
 
30
  check_vect ();
31
 
32
  for (i=0; i<N; i++) {
33
    X[i] = i;
34
    Y[i] = 64-i;
35
    __asm__ volatile ("");
36
  }
37
 
38
  dot3 = foo3 (N);
39
  if (dot3 != DOT3)
40
    abort ();
41
 
42
  return 0;
43
}
44
 
45
/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target vect_unpack } } } */
46
/* { 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.