(root)/
gcc-13.2.0/
gcc/
testsuite/
gcc.target/
nvptx/
umul-hi64.c
       1  /* { dg-do compile } */
       2  /* { dg-options "-O2 -Wno-long-long" } */
       3  
       4  typedef unsigned int __attribute ((mode(TI))) uti_t;
       5  typedef int __attribute ((mode(TI))) ti_t;
       6  
       7  unsigned long test1(unsigned long x, unsigned long y)
       8  {
       9    return ((uti_t)x * (uti_t)y) >> 64;
      10  }
      11  
      12  unsigned long test2(unsigned long x)
      13  {
      14    return ((uti_t)x * 19065) >> 64;
      15  }
      16  
      17  unsigned long test3(unsigned long x, unsigned long y)
      18  {
      19    return (ti_t)((uti_t)x * (uti_t)y) >> 64;
      20  }
      21  
      22  unsigned long test4(unsigned long x)
      23  {
      24    return (ti_t)((uti_t)x * 19065) >> 64;
      25  }
      26  
      27  uti_t test5(unsigned long x, unsigned long y)
      28  {
      29    return ((uti_t)x * (uti_t)y) >> 64;
      30  }
      31  
      32  uti_t test6(unsigned long x)
      33  {
      34    return ((uti_t)x * 19065) >> 64;
      35  }
      36  
      37  ti_t test7(unsigned long x, unsigned long y)
      38  {
      39    return (ti_t)((uti_t)x * (uti_t)y) >> 64;
      40  }
      41  
      42  ti_t test8(unsigned long x)
      43  {
      44    return (ti_t)((uti_t)x * 19065) >> 64;
      45  }
      46  
      47  /* { dg-final { scan-assembler-times "mul.hi.u64" 8 } } */