| 1 |
/* { dg-do compile } */ |
| 2 |
/* { dg-skip-if "MUL64 is ARC600 extension." { { ! { clmcpu } } || *-linux-* } } */ |
| 3 |
/* { dg-options "-O2 -mmul64 -mbig-endian -mcpu=arc600" } */ |
| 4 |
|
| 5 |
/* Check if mlo/mhi registers are correctly layout when we compile for |
| 6 |
a big-endian CPU. */ |
| 7 |
|
| 8 |
#include <stdint.h> |
| 9 |
|
| 10 |
uint32_t foo (uint32_t x) |
| 11 |
{ |
| 12 |
return x % 1000; |
| 13 |
} |
| 14 |
|
| 15 |
int32_t bar (int32_t x) |
| 16 |
{ |
| 17 |
return x % 1000; |
| 18 |
} |
| 19 |
|
| 20 |
/* { dg-final { scan-assembler-times "\\s+mul64\\s+" 3 } } */ |
| 21 |
/* { dg-final { scan-assembler-times "\\s+mulu64\\s+" 1 } } */ |
| 22 |
/* { dg-final { scan-assembler-times "r\[0-9\]+,mhi" 2 } } */ |
| 23 |
/* { dg-final { scan-assembler-times "r\[0-9\]+,mlo" 2 } } */ |