(root)/
gcc-13.2.0/
gcc/
testsuite/
gcc.target/
aarch64/
imm_choice_comparison.c
       1  /* { dg-do compile } */
       2  /* { dg-options "-O2" } */
       3  
       4  /* Go from four moves to two.  */
       5  
       6  int
       7  foo (long long x)
       8  {
       9    return x <= 0x1999999999999998;
      10  }
      11  
      12  int
      13  GT (unsigned int x)
      14  {
      15    return x > 0xfefffffe;
      16  }
      17  
      18  int
      19  LE (unsigned int x)
      20  {
      21    return x <= 0xfefffffe;
      22  }
      23  
      24  int
      25  GE (long long x)
      26  {
      27    return x >= 0xff000000;
      28  }
      29  
      30  int
      31  LT (int x)
      32  {
      33    return x < 0xff000000;
      34  }
      35  
      36  /* Optimize the immediate in conditionals.  */
      37  
      38  int
      39  check (int x, int y)
      40  {
      41    if (x > y && GT (x))
      42      return 100;
      43  
      44    return x;
      45  }
      46  
      47  int
      48  tern (int x)
      49  {
      50    return x >= 0xff000000 ? 5 : -3;
      51  }
      52  
      53  /* baz produces one movk instruction.  */
      54  /* { dg-final { scan-assembler-times "movk" 1 } } */