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-u8.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
 
8
unsigned char X[N] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__)));
9
unsigned char Y[N] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__)));
10
unsigned short result[N];
11
 
12
/* char->short widening-mult */
13
__attribute__ ((noinline)) int
14
foo1(int len) {
15
  int i;
16
 
17
  for (i=0; i<len; i++) {
18
    result[i] = X[i] * Y[i];
19
  }
20
}
21
 
22
int main (void)
23
{
24
  int i;
25
 
26
  check_vect ();
27
 
28
  for (i=0; i<N; i++) {
29
    X[i] = i;
30
    Y[i] = 64-i;
31
    if (i%4 == 0)
32
      X[i] = 5;
33
  }
34
 
35
  foo1 (N);
36
 
37
  for (i=0; i<N; i++) {
38
    if (result[i] != X[i] * Y[i])
39
      abort ();
40
  }
41
 
42
  return 0;
43
}
44
 
45
/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target { vect_widen_mult_qi_to_hi || vect_unpack } } } } */
46
/* { dg-final { cleanup-tree-dump "vect" } } */
47
 

powered by: WebSVN 2.1.0

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