aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.target/powerpc/fold-vec-abs-short-fwrapv.c
blob: 705bbe974291e4640d42a7d47aeb4d062e670913 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
/* Verify that overloaded built-ins for vec_abs with short
   inputs produce the right results.  */

/* { dg-do compile } */
/* { dg-require-effective-target powerpc_altivec_ok } */
/* { dg-options "-maltivec -O2 -fwrapv" } */

#include <altivec.h>

vector signed short
test3 (vector signed short x)
{
  return vec_abs (x);
}

/* { dg-final { scan-assembler-times "vspltisw|xxspltib|vxor" 1 } } */
/* { dg-final { scan-assembler-times "vsubuhm" 1 } } */
/* { dg-final { scan-assembler-times "vmaxsh" 1 } } */