blob: efbe7e1a229526fbc5a3038896045d18441d2153 (
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
|
/* { dg-do compile } */
/* { dg-options "-mdejagnu-cpu=power9 -O2" } */
/* { dg-require-effective-target powerpc_p9vector_ok } */
#include <altivec.h>
vector float
foo_r (float a)
{
return (vector float) { a, a, a, a }; /* xscvdpspn/xxspltw */
}
vector float
foo_r2 (float a)
{
return vec_splats (a); /* xscvdpspn/xxspltw */
}
vector float
foo_g (float *a)
{
float f = *a;
__asm__ (" # %0" : "+r" (f));
return (vector float) { f, f, f, f }; /* mtvsrws */
}
vector float
foo_p (float *a)
{
return (vector float) { *a, *a, *a, *a }; /* lxvwsx */
}
/* { dg-final { scan-assembler-times "xscvdpspn" 2 } } */
/* { dg-final { scan-assembler-times "xxspltw" 2 } } */
/* { dg-final { scan-assembler-times "mtvsrws" 1 } } */
/* { dg-final { scan-assembler-times "lxvwsx" 1 } } */
|