(root)/
gcc-13.2.0/
gcc/
testsuite/
gcc.target/
aarch64/
sve/
cond_cnot_2.c
       1  /* { dg-do compile } */
       2  /* { dg-options "-O2 -ftree-vectorize" } */
       3  
       4  #include <stdint.h>
       5  
       6  #define DEF_LOOP(TYPE)					\
       7    void __attribute__ ((noipa))				\
       8    test_##TYPE (TYPE *__restrict r, TYPE *__restrict a,	\
       9  	       TYPE *__restrict b, int n)		\
      10    {							\
      11      for (int i = 0; i < n; ++i)				\
      12        r[i] = a[i] == 0 ? !b[i] : a[i];			\
      13    }
      14  
      15  #define TEST_ALL(T) \
      16    T (int8_t) \
      17    T (uint8_t) \
      18    T (int16_t) \
      19    T (uint16_t) \
      20    T (int32_t) \
      21    T (uint32_t) \
      22    T (int64_t) \
      23    T (uint64_t)
      24  
      25  TEST_ALL (DEF_LOOP)
      26  
      27  /* { dg-final { scan-assembler-times {\tcnot\tz[0-9]+\.b, p[0-7]/m,} 2 } } */
      28  /* { dg-final { scan-assembler-times {\tcnot\tz[0-9]+\.h, p[0-7]/m,} 2 } } */
      29  /* { dg-final { scan-assembler-times {\tcnot\tz[0-9]+\.s, p[0-7]/m,} 2 } } */
      30  /* { dg-final { scan-assembler-times {\tcnot\tz[0-9]+\.d, p[0-7]/m,} 2 } } */
      31  
      32  /* { dg-final { scan-assembler-not {\tmov\tz} } } */
      33  /* { dg-final { scan-assembler-not {\tmovprfx\t} } } */
      34  /* Currently we canonicalize the ?: so that !b[i] is the "false" value.  */
      35  /* { dg-final { scan-assembler-not {\tsel\t} } } */