1  /* { dg-do compile } */
       2  /* { dg-skip-if "" { powerpc*-*-darwin* } } */
       3  /* Check for VSX here, even though we don't use VSX to eliminate SPE, PAIRED
       4     and other ppc floating point varients.  However, we need to also eliminate
       5     Darwin, since it doesn't like -mcpu=power6.  */
       6  /* { dg-require-effective-target powerpc_vsx_ok } */
       7  /* { dg-options "-O2 -ffast-math -mdejagnu-cpu=power6 -mno-vsx -mno-altivec" } */
       8  /* { dg-final { scan-assembler-times "fsqrt" 3 } } */
       9  /* { dg-final { scan-assembler-times "fmul" 1 } } */
      10  /* { dg-final { scan-assembler-times "bl?\[\\. \]+pow" 1 } } */
      11  /* { dg-final { scan-assembler-times "bl?\[\\. \]+sqrt" 1 } } */
      12  
      13  double
      14  do_pow_0_75_default (double a)
      15  {
      16    return __builtin_pow (a, 0.75);	/* should generate 2 fsqrts */
      17  }
      18  
      19  double
      20  do_pow_0_5_default (double a)
      21  {
      22    return __builtin_pow (a, 0.5);	/* should generate fsqrt */
      23  }
      24  
      25  #pragma GCC target "no-powerpc-gpopt,no-powerpc-gfxopt"
      26  
      27  double
      28  do_pow_0_75_nosqrt (double a)
      29  {
      30    return __builtin_pow (a, 0.75);	/* should call pow */
      31  }
      32  
      33  double
      34  do_pow_0_5_nosqrt (double a)
      35  {
      36    return __builtin_pow (a, 0.5);	/* should call sqrt */
      37  }
      38  
      39  #pragma GCC reset_options