| 1 |
/* { dg-do compile { target { ! riscv_abi_e } } } */ |
| 2 |
/* { dg-require-effective-target rv64 } */ |
| 3 |
/* We aggressively skip as we really just need to test the basic synthesis |
| 4 |
which shouldn't vary based on the optimization level. -O1 seems to work |
| 5 |
and eliminates the usual sources of extraneous dead code that would throw |
| 6 |
off the counts. */ |
| 7 |
/* { dg-skip-if "" { *-*-* } { "-O0" "-Og" "-O2" "-O3" "-Os" "-Oz" "-flto" } } */ |
| 8 |
/* { dg-options "-march=rv64gcb" } */ |
| 9 |
|
| 10 |
/* Rather than test for a specific synthesis of all these constants or |
| 11 |
having thousands of tests each testing one variant, we just test the |
| 12 |
total number of instructions. |
| 13 |
|
| 14 |
This isn't expected to change much and any change is worthy of a look. */ |
| 15 |
/* { dg-final { scan-assembler-times "\\t(add|addi|bseti|li|ret|sh1add|sh2add|sh3add|slli|srli|xori)" 72 } } */ |
| 16 |
|
| 17 |
unsigned long foo_0xc0000000000077ff(void) { return 0xc0000000000077ffUL; } |
| 18 |
unsigned long foo_0xc00000000000b7ff(void) { return 0xc00000000000b7ffUL; } |
| 19 |
unsigned long foo_0xc0000000000137ff(void) { return 0xc0000000000137ffUL; } |
| 20 |
unsigned long foo_0xc0000000000237ff(void) { return 0xc0000000000237ffUL; } |
| 21 |
unsigned long foo_0xc0000000000437ff(void) { return 0xc0000000000437ffUL; } |
| 22 |
unsigned long foo_0xc0000000000837ff(void) { return 0xc0000000000837ffUL; } |
| 23 |
unsigned long foo_0xc0000000001037ff(void) { return 0xc0000000001037ffUL; } |
| 24 |
unsigned long foo_0xc0000000002037ff(void) { return 0xc0000000002037ffUL; } |
| 25 |
unsigned long foo_0xc0000000004037ff(void) { return 0xc0000000004037ffUL; } |
| 26 |
unsigned long foo_0xc0000000008037ff(void) { return 0xc0000000008037ffUL; } |
| 27 |
unsigned long foo_0xc0000000010037ff(void) { return 0xc0000000010037ffUL; } |
| 28 |
unsigned long foo_0xc0000000020037ff(void) { return 0xc0000000020037ffUL; } |
| 29 |
unsigned long foo_0xc0000000040037ff(void) { return 0xc0000000040037ffUL; } |
| 30 |
unsigned long foo_0xc0000000080037ff(void) { return 0xc0000000080037ffUL; } |
| 31 |
unsigned long foo_0xc0000000100037ff(void) { return 0xc0000000100037ffUL; } |
| 32 |
unsigned long foo_0xe0000000000037ff(void) { return 0xe0000000000037ffUL; } |
| 33 |
unsigned long foo_0xc00000000000d7ff(void) { return 0xc00000000000d7ffUL; } |
| 34 |
unsigned long foo_0xc0000000000157ff(void) { return 0xc0000000000157ffUL; } |