(root)/
gcc-13.2.0/
gcc/
testsuite/
gcc.target/
powerpc/
fold-vec-minmax-floatdouble.c
       1  /* Verify that overloaded built-ins for vec_max with float and
       2     double inputs for VSX produce the right results.  */
       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 float
      11  test1_min (vector float x, vector float y)
      12  {
      13    return vec_min (x, y);
      14  }
      15  
      16  vector double
      17  test2_min (vector double x, vector double y)
      18  {
      19    return vec_min (x, y);
      20  }
      21  
      22  vector float
      23  test1_max (vector float x, vector float y)
      24  {
      25    return vec_max (x, y);
      26  }
      27  
      28  vector double
      29  test2_max (vector double x, vector double y)
      30  {
      31    return vec_max (x, y);
      32  }
      33  
      34  /* { dg-final { scan-assembler-times "vminsp" 1 } } */
      35  /* { dg-final { scan-assembler-times "vmindp" 1 } } */
      36  /* { dg-final { scan-assembler-times "vmaxsp" 1 } } */
      37  /* { dg-final { scan-assembler-times "vmaxdp" 1 } } */