(root)/
gcc-13.2.0/
gcc/
testsuite/
gcc.target/
powerpc/
fold-vec-shift-left-fwrapv.c
       1  /* Verify that overloaded built-ins for vec_sl produce the right results.  */
       2  /* This test covers the shift left tests with the -fwrapv option. */
       3  
       4  /* { dg-do compile } */
       5  /* { dg-require-effective-target powerpc_altivec_ok } */
       6  /* { dg-options "-maltivec -O2 -fwrapv" } */
       7  
       8  #include <altivec.h>
       9  
      10  vector signed char
      11  testsl_signed_char (vector signed char x, vector unsigned char y)
      12  {
      13    return vec_sl (x, y);
      14  }
      15  
      16  vector unsigned char
      17  testsl_unsigned_char (vector unsigned char x, vector unsigned char y)
      18  {
      19    return vec_sl (x, y);
      20  }
      21  
      22  vector signed short
      23  testsl_signed_short (vector signed short x, vector unsigned short y)
      24  {
      25    return vec_sl (x, y);
      26  }
      27  
      28  vector unsigned short
      29  testsl_unsigned_short (vector unsigned short x, vector unsigned short y)
      30  {
      31    return vec_sl (x, y);
      32  }
      33  
      34  vector signed int
      35  testsl_signed_int (vector signed int x, vector unsigned int y)
      36  {
      37    return vec_sl (x, y);
      38  }
      39  
      40  vector unsigned int
      41  testsl_unsigned_int (vector unsigned int x, vector unsigned int y)
      42  {
      43    return vec_sl (x, y);
      44  }
      45  
      46  /* { dg-final { scan-assembler-times "vslb" 2 } } */
      47  /* { dg-final { scan-assembler-times "vslh" 2 } } */
      48  /* { dg-final { scan-assembler-times "vslw" 2 } } */