blob: 25cf376f8376d05bce54335741cac9e4ffdea9c0 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
|
/* { dg-do compile { target { powerpc*-*-* && lp64 } } } */
/* { dg-skip-if "" { powerpc*-*-darwin* } { "*" } { "" } } */
/* { dg-require-effective-target powerpc_vsx_ok } */
/* { dg-options "-O2 -ftree-vectorize -mcpu=power7" } */
/* { dg-final { scan-assembler "xvadddp" } } */
/* { dg-final { scan-assembler "xvsubdp" } } */
/* { dg-final { scan-assembler "xvmuldp" } } */
/* { dg-final { scan-assembler "xvdivdp" } } */
/* { dg-final { scan-assembler "xvmadd" } } */
/* { dg-final { scan-assembler "xvmsub" } } */
__vector double a, b, c, d;
void
vector_add (void)
{
a = b + c;
}
void
vector_subtract (void)
{
a = b - c;
}
void
vector_multiply (void)
{
a = b * c;
}
void
vector_multiply_add (void)
{
a = (b * c) + d;
}
void
vector_multiply_subtract (void)
{
a = (b * c) - d;
}
void
vector_divide (void)
{
a = b / c;
}
|