/* { dg-do compile { target { powerpc*-*-* && lp64 } } } */
|
/* { dg-do compile { target { powerpc*-*-* && lp64 } } } */
|
/* { dg-skip-if "" { powerpc*-*-darwin* } { "*" } { "" } } */
|
/* { dg-skip-if "" { powerpc*-*-darwin* } { "*" } { "" } } */
|
/* { dg-require-effective-target powerpc_altivec_ok } */
|
/* { dg-require-effective-target powerpc_altivec_ok } */
|
/* { dg-options "-O2 -ftree-vectorize -mcpu=power6 -maltivec" } */
|
/* { dg-options "-O2 -ftree-vectorize -mcpu=power6 -maltivec" } */
|
/* { dg-final { scan-assembler "vsel" } } */
|
/* { dg-final { scan-assembler "vsel" } } */
|
/* { dg-final { scan-assembler "vrfim" } } */
|
/* { dg-final { scan-assembler "vrfim" } } */
|
/* { dg-final { scan-assembler "vrfip" } } */
|
/* { dg-final { scan-assembler "vrfip" } } */
|
/* { dg-final { scan-assembler "vrfiz" } } */
|
/* { dg-final { scan-assembler "vrfiz" } } */
|
|
|
#ifndef SIZE
|
#ifndef SIZE
|
#define SIZE 1024
|
#define SIZE 1024
|
#endif
|
#endif
|
|
|
float a[SIZE] __attribute__((__aligned__(32)));
|
float a[SIZE] __attribute__((__aligned__(32)));
|
float b[SIZE] __attribute__((__aligned__(32)));
|
float b[SIZE] __attribute__((__aligned__(32)));
|
float c[SIZE] __attribute__((__aligned__(32)));
|
float c[SIZE] __attribute__((__aligned__(32)));
|
float d[SIZE] __attribute__((__aligned__(32)));
|
float d[SIZE] __attribute__((__aligned__(32)));
|
float e[SIZE] __attribute__((__aligned__(32)));
|
float e[SIZE] __attribute__((__aligned__(32)));
|
|
|
extern float floorf (float);
|
extern float floorf (float);
|
extern float ceilf (float);
|
extern float ceilf (float);
|
extern float truncf (float);
|
extern float truncf (float);
|
extern float copysignf (float, float);
|
extern float copysignf (float, float);
|
|
|
void
|
void
|
vector_floor (void)
|
vector_floor (void)
|
{
|
{
|
int i;
|
int i;
|
|
|
for (i = 0; i < SIZE; i++)
|
for (i = 0; i < SIZE; i++)
|
a[i] = floorf (b[i]);
|
a[i] = floorf (b[i]);
|
}
|
}
|
|
|
void
|
void
|
vector_ceil (void)
|
vector_ceil (void)
|
{
|
{
|
int i;
|
int i;
|
|
|
for (i = 0; i < SIZE; i++)
|
for (i = 0; i < SIZE; i++)
|
a[i] = ceilf (b[i]);
|
a[i] = ceilf (b[i]);
|
}
|
}
|
|
|
void
|
void
|
vector_trunc (void)
|
vector_trunc (void)
|
{
|
{
|
int i;
|
int i;
|
|
|
for (i = 0; i < SIZE; i++)
|
for (i = 0; i < SIZE; i++)
|
a[i] = truncf (b[i]);
|
a[i] = truncf (b[i]);
|
}
|
}
|
|
|
void
|
void
|
vector_copysign (void)
|
vector_copysign (void)
|
{
|
{
|
int i;
|
int i;
|
|
|
for (i = 0; i < SIZE; i++)
|
for (i = 0; i < SIZE; i++)
|
a[i] = copysignf (b[i], c[i]);
|
a[i] = copysignf (b[i], c[i]);
|
}
|
}
|
|
|