aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.target/powerpc/fold-vec-neg-floatdouble.c
blob: ead6050bfa82071ddf6f661f7dc1ae970bce16d2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
/* Verify that overloaded built-ins for vec_neg with float and
   double inputs for VSX produce the right code.  */

/* { dg-do compile } */
/* { dg-options "-O2 -mdejagnu-cpu=power8 -mvsx" } */
/* { dg-require-effective-target powerpc_vsx } */


#include <altivec.h>

vector float
test1 (vector float x)
{
  return vec_neg (x);
}

vector double
test2 (vector double x)
{
  return vec_neg (x);
}

/* { dg-final { scan-assembler-times "xvnegsp" 1 } } */
/* { dg-final { scan-assembler-times "xvnegdp" 1 } } */