OpenCores
URL https://opencores.org/ocsvn/openrisc_2011-10-31/openrisc_2011-10-31/trunk

Subversion Repositories openrisc_2011-10-31

[/] [openrisc/] [trunk/] [gnu-src/] [gcc-4.5.1/] [gcc/] [testsuite/] [gcc.dg/] [vect/] [vect-multitypes-15.c] - Blame information for rev 307

Go to most recent revision | 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
#include <stdio.h>
6
 
7
#define N 64
8
 
9
#define DOT1 43680
10
#define DOT2 -20832
11
 
12
signed char X[N] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__)));
13
signed char Y[N] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__)));
14
unsigned char CX[N] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__)));
15
 
16
__attribute__ ((noinline)) void
17
foo1(int len) {
18
  int i;
19
  int result1 = 0;
20
 
21
  for (i=0; i<len; i++) {
22
    result1 += (X[i] * Y[i]);
23
    CX[i] = 5;
24
  }
25
 
26
  if (result1 != DOT1)
27
    abort ();
28
}
29
 
30
 
31
int main (void)
32
{
33
  int i, dot1, dot2;
34
 
35
  check_vect ();
36
 
37
  for (i=0; i<N; i++) {
38
    X[i] = i;
39
    Y[i] = 64-i;
40
    CX[i] = i;
41
    __asm__ volatile ("");
42
  }
43
 
44
  foo1 (N);
45
 
46
  return 0;
47
}
48
 
49
/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target { vect_sdot_hi  || vect_unpack } } } } */
50
/* { dg-final { cleanup-tree-dump "vect" } } */
51
 

powered by: WebSVN 2.1.0

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