1  /* { dg-do compile { target { powerpc*-*-* && lp64 } } } */
       2  /* { dg-skip-if "" { powerpc*-*-darwin* } } */
       3  /* { dg-require-effective-target powerpc_p8vector_ok } */
       4  /* { dg-options "-O2 -mdejagnu-cpu=power8" } */
       5  
       6  #include <altivec.h>
       7  
       8  double
       9  add_double_n (vector double *p, double x, long n)
      10  {
      11    return vec_extract (*p, n) + x;
      12  }
      13  
      14  long
      15  add_long_n (vector long *p, long x, long n)
      16  {
      17    return vec_extract (*p, n) + x;
      18  }
      19  
      20  /* { dg-final { scan-assembler-not "lxvd2x"   } } */
      21  /* { dg-final { scan-assembler-not "lxvw4x"   } } */
      22  /* { dg-final { scan-assembler-not "lxvx"     } } */
      23  /* { dg-final { scan-assembler-not "lxv"      } } */
      24  
      25  /* With recent enhancements to the code generator, it is considered
      26   * legal to implement vec_extract with lvx and xxpermdi.  Previous
      27   * versions of this test forbid both instructions.  */