1  /* Verify that overloaded built-ins for vec_splat with long long
       2     inputs produce the right code.  */
       3  
       4  /* { dg-do compile } */
       5  /* { dg-require-effective-target powerpc_vsx_ok } */
       6  /* { dg-options "-mvsx -O2" } */
       7  
       8  #include <altivec.h>
       9  
      10  vector bool long long testb_00 (vector bool long long x) { return vec_splat (x, 0b00000); }
      11  vector bool long long testb_01 (vector bool long long x) { return vec_splat (x, 0b00001); }
      12  
      13  vector signed long long tests_00 (vector signed long long x) { return vec_splat (x, 0b00000); }
      14  vector signed long long tests_01 (vector signed long long x) { return vec_splat (x, 0b00001); }
      15  
      16  vector unsigned long long testu_00 (vector unsigned long long x) { return vec_splat (x, 0b00000); }
      17  vector unsigned long long testu_01 (vector unsigned long long x) { return vec_splat (x, 0b00001); }
      18  
      19  /* Similar test as above, but the source vector is a known constant. */
      20  vector bool long long test_bll () { const vector bool long long y = {12, 23}; return vec_splat (y, 0b00001); }
      21  vector signed long long test_sll () { const vector signed long long y = {34, 45}; return vec_splat (y, 0b00001); }
      22  
      23  /* Assorted load instructions for the initialization with known constants. */
      24  /* { dg-final { scan-assembler-times {\mlvx\M|\mlxvd2x\M|\mlxv\M|\mplxv\M|\mxxspltib\M} 2 } } */
      25  
      26  /* xxpermdi for vec_splat of long long vectors.
      27   At the time of this writing, the number of xxpermdi instructions
      28   generated will vary depending on the target processor (p5/p6/p7/p8/...)
      29   and whether or not folding is enabled.
      30   So, ensure we have at least one hit.  */
      31  /* { dg-final { scan-assembler "xxpermdi" } } */