aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.target/powerpc/vec-cmp-sel.c
blob: f74a117ace4469da26d5c7edecd93c3cee55e2cd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
/* { dg-do compile { target powerpc64*-*-* } } */
/* { dg-require-effective-target powerpc_p8vector_ok } */
/* { dg-require-effective-target powerpc_vsx_ok } */
/* { dg-options "-maltivec -O2 -mvsx -mpower8-vector" } */
/* { dg-final { scan-assembler "vcmpgtsd" } } */
/* { dg-final { scan-assembler-not "xxlnor" } } */

/* Test code in simplify-rtx.c that converts
     (!c) != {0,...,0} ? a : b
   into
     c != {0,...,0} ? b : a  */

#include <altivec.h>

volatile vector signed long long x = { 25399, -12900 };
volatile vector signed long long y = { 12178, -9987 };

vector signed long long foo () {
  vector bool long long b = vec_cmpge (x, y);
  vector signed long long z = vec_sel (y, x, b);
  return z;
}