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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [gcc.dg/] [vect/] [vect-107.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_float } */
2
 
3
#include <stdarg.h>
4
#include "tree-vect.h"
5
 
6
#define N 16
7
 
8
float b[N] = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45};
9
float c[N] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15};
10
float d[N] = {0,2,4,6,8,10,12,14,16,18,20,22,24,26,28,30};
11
 
12
__attribute__ ((noinline)) int
13
main1 (void)
14
{
15
  int i;
16
  float a[N];
17
 
18
  /* Strided access. Vectorizable on platforms that support load of strided
19
     accesses (extract of even/odd vector elements).  */
20
  for (i = 0; i < N/2; i++)
21
    {
22
      a[i] = b[2*i+1] * c[2*i+1] - b[2*i] * c[2*i];
23
      d[i] = b[2*i] * c[2*i+1] + b[2*i+1] * c[2*i];
24
    }
25
 
26
  /* Check results.  */
27
  for (i = 0; i < N/2; i++)
28
    {
29
      if (a[i] != b[2*i+1] * c[2*i+1] - b[2*i] * c[2*i]
30
          || d[i] != b[2*i] * c[2*i+1] + b[2*i+1] * c[2*i])
31
        abort();
32
    }
33
 
34
  return 0;
35
}
36
 
37
int main (void)
38
{
39
  check_vect ();
40
  return main1 ();
41
}
42
 
43
/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target vect_strided2 } } } */
44
/* { dg-final { scan-tree-dump-times "vectorized 0 loops" 1 "vect" { xfail vect_strided2 } } } */
45
/* { dg-final { cleanup-tree-dump "vect" } } */

powered by: WebSVN 2.1.0

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