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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [gcc.target/] [powerpc/] [pr48258-2.c] - Blame information for rev 691

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 691 jeremybenn
/* { dg-do compile } */
2
/* { dg-skip-if "" { powerpc*-*-darwin* } { "*" } { "" } } */
3
/* { dg-require-effective-target powerpc_vsx_ok } */
4
/* { dg-options "-O3 -mcpu=power7 -mabi=altivec -ffast-math -fno-unroll-loops" } */
5
/* { dg-final { scan-assembler-times "xvadddp" 1 } } */
6
/* { dg-final { scan-assembler-times "xvmindp" 1 } } */
7
/* { dg-final { scan-assembler-times "xvmaxdp" 1 } } */
8
/* { dg-final { scan-assembler-times "xsadddp" 1 } } */
9
/* { dg-final { scan-assembler-times "xsmindp" 1 } } */
10
/* { dg-final { scan-assembler-times "xsmaxdp" 1 } } */
11
/* { dg-final { scan-assembler-not "xxsldwi" } } */
12
/* { dg-final { scan-assembler-not "stvx" } } */
13
/* { dg-final { scan-assembler-not "stxvd2x" } } */
14
/* { dg-final { scan-assembler-not "stxvw4x" } } */
15
 
16
#include <stddef.h>
17
 
18
#ifndef SIZE
19
#define SIZE 1024
20
#endif
21
 
22
double values[SIZE] __attribute__((__aligned__(32)));
23
 
24
double
25
vector_sum (void)
26
{
27
  size_t i;
28
  double sum = 0.0;
29
 
30
  for (i = 0; i < SIZE; i++)
31
    sum += values[i];
32
 
33
  return sum;
34
}
35
 
36
double
37
vector_min (void)
38
{
39
  size_t i;
40
  double min = values[0];
41
 
42
  for (i = 0; i < SIZE; i++)
43
    min = __builtin_fmin (min, values[i]);
44
 
45
  return min;
46
}
47
 
48
double
49
vector_max (void)
50
{
51
  size_t i;
52
  double max = values[0];
53
 
54
  for (i = 0; i < SIZE; i++)
55
    max = __builtin_fmax (max, values[i]);
56
 
57
  return max;
58
}

powered by: WebSVN 2.1.0

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