(root)/
gcc-13.2.0/
gcc/
testsuite/
gcc.target/
arm/
neon-compare-5.c
       1  /* { dg-do compile } */
       2  /* { dg-require-effective-target arm_neon_ok } */
       3  /* { dg-options "-O1 -ftree-vectorize -funsafe-math-optimizations" }  */
       4  /* { dg-add-options arm_neon } */
       5  
       6  #define uneq(a, b) (!__builtin_islessgreater (a, b))
       7  /* RTL's LTGT is a signaling comparison.  */
       8  #define ltgt(a, b) (a < b || b < a)
       9  
      10  int x[16];
      11  float a[16];
      12  float b[16];
      13  
      14  #define COMPARE(NAME) \
      15    void \
      16    cmp_##NAME##_reg (void) \
      17    { \
      18      for (int i = 0; i < 16; ++i) \
      19        x[i] = NAME (a[i], b[i]) ? 2 : 0; \
      20    } \
      21    \
      22    void \
      23    cmp_##NAME##_zero (void) \
      24    { \
      25      for (int i = 0; i < 16; ++i) \
      26        x[i] = NAME (a[i], 0) ? 2 : 0; \
      27    }
      28  
      29  typedef int int_vec __attribute__((vector_size(16)));
      30  typedef float vec __attribute__((vector_size(16)));
      31  
      32  COMPARE (uneq)
      33  COMPARE (ltgt)
      34  
      35  /* { dg-final { scan-assembler-times {\tvcgt.f32\tq[0-9]+, q[0-9]+, q[0-9]+\n} 4 } } */
      36  /* { dg-final { scan-assembler-times {\tvcgt.f32\tq[0-9]+, q[0-9]+, #0\n} 2 } } */
      37  /* { dg-final { scan-assembler-times {\tvclt.f32\tq[0-9]+, q[0-9]+, #0\n} 2 } } */