1  /* Verify that overloaded built-ins for vec_splat with float and
       2     double inputs for VSX produce the right code.  */
       3  
       4  /* { dg-do compile } */
       5  /* { dg-require-effective-target powerpc_vsx_ok } */
       6  /* { dg-options "-mvsx -O1" } */
       7  
       8  #include <altivec.h>
       9  
      10  vector float
      11  test1f (float x)
      12  {
      13    return vec_splats (x);
      14  }
      15  
      16  vector double
      17  test1d (double x)
      18  {
      19    return vec_splats (x);
      20  }
      21  
      22  // double test generates the permute instruction.
      23  /* { dg-final { scan-assembler-times "xxpermdi" 1 } } */
      24  
      25  // float test generates a convert (double to single non-signalling) followed by a splat.
      26  /* { dg-final { scan-assembler-times {\mxscvdpspn?\M} 1 } } */
      27  /* { dg-final { scan-assembler-times {\mvspltw\M|\mxxspltw\M} 1 } } */