1 /* { dg-do compile { target { powerpc64le-*-* } } } */ 2 /* { dg-options "-mdejagnu-cpu=power9 -O2" } */ 3 /* { dg-require-effective-target powerpc_p9vector_ok } */ 4 5 #include <altivec.h> 6 7 vector float foo_r(float a)8foo_r (float a) 9 { 10 return (vector float) { a, a, a, a }; /* xscvdpspn/xxspltw */ 11 } 12 13 vector float foo_r2(float a)14foo_r2 (float a) 15 { 16 return vec_splats (a); /* xscvdpspn/xxspltw */ 17 } 18 19 vector float foo_g(float * a)20foo_g (float *a) 21 { 22 float f = *a; 23 24 __asm__ (" # %0" : "+r" (f)); 25 return (vector float) { f, f, f, f }; /* mtvsrws */ 26 } 27 28 vector float foo_p(float * a)29foo_p (float *a) 30 { 31 return (vector float) { *a, *a, *a, *a }; /* lxvwsx */ 32 } 33 34 /* { dg-final { scan-assembler-times "xscvdpspn" 2 } } */ 35 /* { dg-final { scan-assembler-times "xxspltw" 2 } } */ 36 /* { dg-final { scan-assembler-times "mtvsrws" 1 } } */ 37 /* { dg-final { scan-assembler-times "lxvwsx" 1 } } */ 38