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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-stable/] [gcc-4.5.1/] [gcc/] [testsuite/] [gcc.target/] [powerpc/] [altivec-32.c] - Blame information for rev 826

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 322 jeremybenn
/* { dg-do compile { target { powerpc*-*-* && lp64 } } } */
2
/* { dg-skip-if "" { powerpc*-*-darwin* } { "*" } { "" } } */
3
/* { dg-require-effective-target powerpc_altivec_ok } */
4
/* { dg-options "-O2 -ftree-vectorize -mcpu=power6 -maltivec" } */
5
/* { dg-final { scan-assembler "vsel" } } */
6
/* { dg-final { scan-assembler "vrfim" } } */
7
/* { dg-final { scan-assembler "vrfip" } } */
8
/* { dg-final { scan-assembler "vrfiz" } } */
9
 
10
#ifndef SIZE
11
#define SIZE 1024
12
#endif
13
 
14
float a[SIZE] __attribute__((__aligned__(32)));
15
float b[SIZE] __attribute__((__aligned__(32)));
16
float c[SIZE] __attribute__((__aligned__(32)));
17
float d[SIZE] __attribute__((__aligned__(32)));
18
float e[SIZE] __attribute__((__aligned__(32)));
19
 
20
extern float floorf (float);
21
extern float ceilf (float);
22
extern float truncf (float);
23
extern float copysignf (float, float);
24
 
25
void
26
vector_floor (void)
27
{
28
  int i;
29
 
30
  for (i = 0; i < SIZE; i++)
31
    a[i] = floorf (b[i]);
32
}
33
 
34
void
35
vector_ceil (void)
36
{
37
  int i;
38
 
39
  for (i = 0; i < SIZE; i++)
40
    a[i] = ceilf (b[i]);
41
}
42
 
43
void
44
vector_trunc (void)
45
{
46
  int i;
47
 
48
  for (i = 0; i < SIZE; i++)
49
    a[i] = truncf (b[i]);
50
}
51
 
52
void
53
vector_copysign (void)
54
{
55
  int i;
56
 
57
  for (i = 0; i < SIZE; i++)
58
    a[i] = copysignf (b[i], c[i]);
59
}

powered by: WebSVN 2.1.0

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