(root)/
gcc-13.2.0/
gcc/
testsuite/
gcc.target/
i386/
pr78103-2.c
       1  /* PR target/78103 */
       2  /* { dg-do compile } */
       3  /* { dg-options "-O2 -mno-lzcnt" } */
       4  /* { dg-final { scan-assembler-not {\mmovl\M} } } */
       5  /* { dg-final { scan-assembler-not {\mxor[lq]\M} } } */
       6  /* { dg-final { scan-assembler-not {\msubl\M} } } */
       7  /* { dg-final { scan-assembler {\m(leal|addl|incl)\M} } } */
       8  
       9  unsigned int
      10  foo (unsigned int x)
      11  {
      12    return __CHAR_BIT__ * sizeof (unsigned int) - __builtin_clz (x);
      13  }
      14  
      15  unsigned int
      16  bar (unsigned int x)
      17  {
      18    return __CHAR_BIT__ * sizeof (unsigned int) - 1 - __builtin_clz (x);
      19  }
      20  
      21  #ifdef __x86_64__
      22  unsigned int
      23  baz (unsigned long long x)
      24  {
      25    return __CHAR_BIT__ * sizeof (unsigned long long) - __builtin_clzll (x);
      26  }
      27  
      28  unsigned int
      29  qux (unsigned long long x)
      30  {
      31    return __CHAR_BIT__ * sizeof (unsigned long long) - 1 - __builtin_clzll (x);
      32  }
      33  #endif