blob: 71a989082e67fe4866d39d50aca48486ad6da0d4 (
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
|
/* Verify that overloaded built-ins for vec_splat with float and
double inputs for VSX produce the right code. */
/* { dg-do compile } */
/* { dg-options "-mvsx -O1" } */
/* { dg-require-effective-target powerpc_vsx } */
#include <altivec.h>
vector float
test1f (float x)
{
return vec_splats (x);
}
vector double
test1d (double x)
{
return vec_splats (x);
}
// double test generates the permute instruction.
/* { dg-final { scan-assembler-times "xxpermdi" 1 } } */
// float test generates a convert (double to single non-signalling) followed by a splat.
/* { dg-final { scan-assembler-times {\mxscvdpspn?\M} 1 } } */
/* { dg-final { scan-assembler-times {\mvspltw\M|\mxxspltw\M} 1 } } */
|