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-u16.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 short X[N] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__)));
9
unsigned short Y[N] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__)));
10
unsigned int result[N];
11
 
12
/* short->int widening-mult */
13
__attribute__ ((noinline)) int
14
foo1(int len) {
15
  int i;
16
 
17
  /* Not vectorized because X[i] and Y[i] are casted to 'int'
18
     so the widening multiplication pattern is not recognized.  */
19
  for (i=0; i<len; i++) {
20
    result[i] = (unsigned int)(X[i] * Y[i]);
21
  }
22
}
23
 
24
int main (void)
25
{
26
  int i;
27
 
28
  check_vect ();
29
 
30
  for (i=0; i<N; i++) {
31
    X[i] = i;
32
    Y[i] = 64-i;
33
    __asm__ volatile ("");
34
  }
35
 
36
  foo1 (N);
37
 
38
  for (i=0; i<N; i++) {
39
    if (result[i] != X[i] * Y[i])
40
      abort ();
41
  }
42
 
43
  return 0;
44
}
45
 
46
/*The induction loop is vectorized  */
47
/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 2 "vect" { xfail *-*-* } } } */
48
/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target vect_pack_trunc } } } */
49
/* { dg-final { cleanup-tree-dump "vect" } } */
50
 

powered by: WebSVN 2.1.0

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