(root)/
gcc-13.2.0/
gcc/
testsuite/
gcc.target/
i386/
pr93346.c
       1  /* PR target/93346 */
       2  /* { dg-do compile } */
       3  /* { dg-options "-O2 -mbmi2" } */
       4  /* { dg-final { scan-assembler-times "\tbzhi\t" 12 } } */
       5  
       6  unsigned int
       7  f1 (unsigned int x, unsigned int y)
       8  {
       9    return x & ((1 << y) - 1);
      10  } 
      11  
      12  unsigned int
      13  f2 (unsigned int x, unsigned int y)
      14  {
      15    return x & ((1U << y) - 1);
      16  } 
      17  
      18  int
      19  f3 (int x, unsigned int y)
      20  {
      21    return x & ((1 << y) - 1);
      22  } 
      23  
      24  unsigned long
      25  f4 (unsigned long x, unsigned int y)
      26  {
      27    return x & ((1L << y) - 1);
      28  } 
      29  
      30  unsigned long
      31  f5 (unsigned long x, unsigned int y)
      32  {
      33    return x & ((1UL << y) - 1);
      34  } 
      35  
      36  long
      37  f6 (long x, unsigned int y)
      38  {
      39    return x & ((1L << y) - 1);
      40  } 
      41  
      42  unsigned int
      43  f7 (unsigned int x, int y)
      44  {
      45    return x & ((1 << y) - 1);
      46  } 
      47  
      48  unsigned int
      49  f8 (unsigned int x, int y)
      50  {
      51    return x & ((1U << y) - 1);
      52  } 
      53  
      54  int
      55  f9 (int x, int y)
      56  {
      57    return x & ((1 << y) - 1);
      58  } 
      59  
      60  unsigned long
      61  f10 (unsigned long x, int y)
      62  {
      63    return x & ((1L << y) - 1);
      64  } 
      65  
      66  unsigned long
      67  f11 (unsigned long x, int y)
      68  {
      69    return x & ((1UL << y) - 1);
      70  } 
      71  
      72  long
      73  f12 (long x, int y)
      74  {
      75    return x & ((1L << y) - 1);
      76  }