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.target/] [i386/] [opt-1.c] - Blame information for rev 318

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 318 jeremybenn
/* Test the attribute((optimize)) really works.  Do this test by checking
2
   whether we vectorize a simple loop.  */
3
/* { dg-do compile } */
4
/* { dg-options "-O1 -msse2 -mfpmath=sse -march=k8" } */
5
/* { dg-require-effective-target sse2 } */
6
/* { dg-final { scan-assembler "prefetcht0" } } */
7
/* { dg-final { scan-assembler "addps" } } */
8
/* { dg-final { scan-assembler "subss" } } */
9
 
10
#define SIZE 10240
11
float a[SIZE] __attribute__((__aligned__(32)));
12
float b[SIZE] __attribute__((__aligned__(32)));
13
float c[SIZE] __attribute__((__aligned__(32)));
14
 
15
/* This should vectorize.  */
16
void opt3 (void) __attribute__((__optimize__(3,"unroll-all-loops,-fprefetch-loop-arrays")));
17
 
18
void
19
opt3 (void)
20
{
21
  int i;
22
 
23
  for (i = 0; i < SIZE; i++)
24
    a[i] = b[i] + c[i];
25
}
26
 
27
/* This should not vectorize.  */
28
void
29
not_opt3 (void)
30
{
31
  int i;
32
 
33
  for (i = 0; i < SIZE; i++)
34
    a[i] = b[i] - c[i];
35
}
36
 

powered by: WebSVN 2.1.0

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