1  /* Verify that overloaded built-ins for vec_extract() with float
       2     inputs produce the right code with a P7 (BE) target.  */
       3  
       4  /* { dg-do compile } */
       5  /* { dg-require-effective-target powerpc_vsx_ok } */
       6  /* { dg-options "-mdejagnu-cpu=power7 -O2 " } */
       7  
       8  // targeting P7 (BE), 2 tests.
       9  // P7 constants: xscvspdp
      10  // P7 variables: li, addi, stxvd2x, rldic, addi, lfsx
      11  
      12  /* { dg-final { scan-assembler-times {\mxscvspdp\M} 1 } } */
      13  /* { dg-final { scan-assembler-times {\mli\M} 1 } } */
      14  /* -m32 as an add in place of an addi. */
      15  /* { dg-final { scan-assembler-times {\maddi\M|\madd\M} 2 { target lp64 } } } */
      16  /* { dg-final { scan-assembler-times {\maddi\M|\madd\M} 3 { target ilp32 } } } */
      17  /* { dg-final { scan-assembler-times {\mstxvd2x\M|\mstvx\M|\mstxv\M} 1 } } */
      18  /* -m32 uses rlwinm in place of rldic */
      19  /* { dg-final { scan-assembler-times {\mrldic\M|\mrlwinm\M} 1 } } */
      20  /* -m32 has lfs in place of lfsx */
      21  /* { dg-final { scan-assembler-times {\mlfsx\M|\mlfs\M} 1 } } */
      22  
      23  #include <altivec.h>
      24  
      25  float
      26  testf_var (vector float vf2, signed int si)
      27  {
      28    return vec_extract (vf2, si);
      29  }
      30  
      31  float
      32  testf_cst (vector float vf2)
      33  {
      34    return vec_extract (vf2, 12);
      35  }
      36