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

Subversion Repositories openrisc_me

[/] [openrisc/] [trunk/] [gnu-src/] [gcc-4.5.1/] [gcc/] [testsuite/] [gcc.dg/] [vect/] [vect-widen-mult-sum.c] - Blame information for rev 298

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
#define SUM 0 
8
 
9
/* Require widening-mult or data-unpacking (for the type promotion).  */
10
__attribute__ ((noinline)) int
11
main1 (short *in, int off, short scale, int n)
12
{
13
 int i;
14
 int sum = 0;
15
 
16
 for (i = 0; i < n; i++) {
17
   sum += ((int) in[i] * (int) in[i+off]) >> scale;
18
 }
19
 
20
 return sum;
21
}
22
 
23
int main (void)
24
{
25
  int i;
26
  int sum;
27
  short X[N];
28
 
29
  check_vect ();
30
 
31
  for (i=0; i<N; i++) {
32
    X[i] = 16-i;
33
    __asm__ volatile ("");
34
  }
35
 
36
  sum = main1 (X, 1, 16, N-1);
37
 
38
  if (sum != SUM)
39
    abort ();
40
 
41
  return 0;
42
}
43
 
44
 
45
/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target vect_widen_mult_hi_to_si } } } */
46
/* { dg-final { scan-tree-dump-times "vect_recog_widen_mult_pattern: detected" 1 "vect" } } */
47
/* { 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.