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

Subversion Repositories openrisc

[/] [openrisc/] [tags/] [gnu-src/] [gcc-4.5.1/] [gcc-4.5.1-or32-1.0rc1/] [gcc/] [testsuite/] [gcc.dg/] [vect/] [vect-multitypes-7.c] - Blame information for rev 298

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 short X[N] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__)));
13
signed short 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
  short prod;
21
 
22
  for (i=0; i<len; i++) {
23
    result1 += (X[i] * Y[i]);
24
    CX[i] = 5;
25
  }
26
 
27
  if (result1 != DOT1)
28
    abort ();
29
}
30
 
31
 
32
int main (void)
33
{
34
  int i, dot1, dot2;
35
 
36
  check_vect ();
37
 
38
  for (i=0; i<N; i++) {
39
    X[i] = i;
40
    Y[i] = 64-i;
41
    CX[i] = i;
42
    __asm__ volatile ("");
43
  }
44
 
45
  foo1 (N);
46
 
47
  return 0;
48
}
49
 
50
/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target vect_sdot_hi } } } */
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.