(root)/
gcc-13.2.0/
gcc/
testsuite/
gcc.target/
mips/
timode-1.c
       1  /* { dg-options "isa_rev<=5 -mgp64" } */
       2  /* { dg-skip-if "we deliberately use calls when optimizing for size" { *-*-* } { "-Os" } { "" } } */
       3  typedef int int128_t __attribute__((mode(TI)));
       4  typedef unsigned int uint128_t __attribute__((mode(TI)));
       5  
       6  #define UINT128_CONST(A, B) \
       7    (((uint128_t) (0x ## A ## ULL) << 64) | (0x ## B ## ULL))
       8  
       9  volatile uint128_t a = UINT128_CONST (1111111111111111, a222222222222222);
      10  volatile uint128_t b = UINT128_CONST (0000000000000005, 0000000000000003);
      11  volatile uint128_t c = UINT128_CONST (5dddddddddddddde, e666666666666666);
      12  volatile uint128_t d = UINT128_CONST (e612340000000000, 5000000000234500);
      13  volatile uint128_t e = UINT128_CONST (43f011dddddddddf, 366666666689ab66);
      14  volatile uint128_t f = UINT128_CONST (4210100000000000, 1000000000010100);
      15  volatile uint128_t g = UINT128_CONST (a5e225dddddddddf, 6666666666aaee66);
      16  volatile uint128_t h = UINT128_CONST (e7f235dddddddddf, 7666666666abef66);
      17  volatile uint128_t i = UINT128_CONST (5e225dddddddddf6, 666666666aaee660);
      18  volatile uint128_t j = UINT128_CONST (0a5e225ddddddddd, f6666666666aaee6);
      19  volatile uint128_t k = UINT128_CONST (fa5e225ddddddddd, f6666666666aaee6);
      20  
      21  volatile int amount = 4;
      22  
      23  volatile uint128_t result;
      24  
      25  int
      26  test1 (void)
      27  {
      28    result = a * b;
      29    if (result != c)
      30      return 1;
      31    return 0;
      32  }
      33  
      34  int
      35  test2 (void)
      36  {
      37    result = c + d;
      38    if (result != e)
      39      return 1;
      40    return 0;
      41  }
      42  
      43  int
      44  test3 (void)
      45  {
      46    result = e - d;
      47    if (result != c)
      48      return 1;
      49    return 0;
      50  }
      51  
      52  int
      53  test4 (void)
      54  {
      55    result = d & e;
      56    if (result != f)
      57      return 1;
      58    return 0;
      59  }
      60  
      61  int
      62  test5 (void)
      63  {
      64    result = d ^ e;
      65    if (result != g)
      66      return 1;
      67    return 0;
      68  }
      69  
      70  int
      71  test6 (void)
      72  {
      73    result = d | e;
      74    if (result != h)
      75      return 1;
      76    return 0;
      77  }
      78  
      79  int
      80  test7 (void)
      81  {
      82    result = g << amount;
      83    if (result != i)
      84      return 1;
      85    return 0;
      86  }
      87  
      88  int
      89  test8 (void)
      90  {
      91    result = g >> amount;
      92    if (result != j)
      93      return 1;
      94    return 0;
      95  }
      96  
      97  int
      98  test9 (void)
      99  {
     100    result = (int128_t) g >> amount;
     101    if (result != k)
     102      return 1;
     103    return 0;
     104  }
     105  
     106  /* { dg-final { scan-assembler-not "\tjal" } } */