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

Subversion Repositories openrisc

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

powered by: WebSVN 2.1.0

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