1  /* Verify that overloaded built-ins for vec_mule,vec_mulo with short
       2     inputs produce the right results.  */
       3  
       4  /* { dg-do compile } */
       5  /* { dg-require-effective-target powerpc_altivec_ok } */
       6  /* { dg-options "-maltivec -O2" } */
       7  
       8  #include <altivec.h>
       9  
      10  vector signed int
      11  test_even (vector signed short x, vector signed short y)
      12  {
      13    return vec_mule (x, y);
      14  }
      15  
      16  vector unsigned int
      17  test_uns_even (vector unsigned short x, vector unsigned short y)
      18  {
      19    return vec_mule (x, y);
      20  }
      21  
      22  vector signed int
      23  test_odd (vector signed short x, vector signed short y)
      24  {
      25    return vec_mulo (x, y);
      26  }
      27  
      28  vector unsigned int
      29  test_uns_odd (vector unsigned short x, vector unsigned short y)
      30  {
      31    return vec_mulo (x, y);
      32  }
      33  
      34  /* { dg-final { scan-assembler-times "vmuleuh" 1 } } */
      35  /* { dg-final { scan-assembler-times "vmulesh" 1 } } */
      36  /* { dg-final { scan-assembler-times "vmulouh" 1 } } */
      37  /* { dg-final { scan-assembler-times "vmulosh" 1 } } */