summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.target/s390/zvector/vec-test-mask-1.c
blob: 418d5b20f51b7c6cdc9fc783b13fe858bb0f785c (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
25
/* { dg-do compile { target { s390*-*-* } } } */
/* { dg-options "-O3 -mzarch -march=z13 -mzvector" } */

/* { dg-final { scan-assembler-times "vtm" 2 } } */
/* { dg-final { scan-assembler-times "ipm" 1 } } */

#include <vecintrin.h>

/* CC will be extracted into a GPR and returned.  */
int
foo (vector unsigned int a, vector unsigned b)
{
  return vec_test_mask (a, b);
}

extern void baz (void);

/* In that case the ipm/srl is supposed to optimized out by
   combine/s390_canonicalize_comparison.  */
int
bar (vector unsigned int a, vector unsigned b)
{
  if (vec_test_mask (a, b) == 2)
    baz ();
}