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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [gcc.dg/] [vect/] [slp-widen-mult-half.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 "tree-vect.h"
4
#include <stdlib.h>
5
 
6
#define N 32
7
#define COEF 32470
8
#define COEF2 324700
9
 
10
unsigned char in[N];
11
int out[N];
12
int out2[N];
13
 
14
__attribute__ ((noinline)) void
15
foo ()
16
{
17
  int i;
18
 
19
  for (i = 0; i < N/2; i++)
20
    {
21
      out[2*i] = in[2*i] * COEF;
22
      out2[2*i] = in[2*i] + COEF2;
23
      out[2*i+1] = in[2*i+1] * COEF;
24
      out2[2*i+1] = in[2*i+1] + COEF2;
25
    }
26
}
27
 
28
int main (void)
29
{
30
  int i;
31
 
32
  for (i = 0; i < N; i++)
33
    {
34
      in[i] = i;
35
      __asm__ volatile ("");
36
    }
37
 
38
  foo ();
39
 
40
  for (i = 0; i < N; i++)
41
    if (out[i] != in[i] * COEF || out2[i] != in[i] + COEF2)
42
      abort ();
43
 
44
  return 0;
45
}
46
 
47
/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target vect_widen_mult_hi_to_si } } } */
48
/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 2 "vect" { target vect_widen_mult_hi_to_si } } } */
49
/* { dg-final { scan-tree-dump-times "vect_recog_widen_mult_pattern: detected" 2 "vect" { target vect_widen_mult_hi_to_si_pattern } } } */
50
/* { dg-final { scan-tree-dump-times "pattern recognized" 2 "vect" { target vect_widen_mult_hi_to_si_pattern } } } */
51
/* { dg-final { cleanup-tree-dump "vect" } } */
52
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.