| 1 |
/* { dg-do compile } */ |
| 2 |
/* { dg-require-effective-target valgrind } */ |
| 3 |
/* { dg-additional-files "sparseset.supp" } */ |
| 4 |
/* { dg-options "-wrapper valgrind,-q,--exit-on-first-error=yes,--error-exitcode=1,--suppressions=${srcdir}/sparseset.supp" } */ |
| 5 |
|
| 6 |
typedef signed int int32_t; |
| 7 |
typedef signed long int int64_t; |
| 8 |
|
| 9 |
int64_t dual_reg_insn(int64_t x) { |
| 10 |
int64_t res; |
| 11 |
int64_t zero = 0; |
| 12 |
asm ("some_custom_insn %0,%1,%2" : "=R" (res) : "R" (x), "R" (zero)); |
| 13 |
return res; |
| 14 |
} |
| 15 |
|
| 16 |
int32_t single_reg_insn(int32_t x) { |
| 17 |
int32_t res; |
| 18 |
int32_t zero = 0; |
| 19 |
asm ("some_custom_insn %0,%1,%2" : "=r" (res) : "r" (x), "r" (zero)); |
| 20 |
return res; |
| 21 |
} |
| 22 |
|
| 23 |
int32_t single_reg_insn_explicit_zero(int32_t x) { |
| 24 |
int32_t res; |
| 25 |
asm ("some_custom_insn %0,%1,%2" : "=r" (res) : "r" (x), "r" (0)); |
| 26 |
return res; |
| 27 |
} |
| 28 |
|
| 29 |
int64_t dual_reg_insn2(int64_t x) { |
| 30 |
int64_t res; |
| 31 |
int64_t zero = 0; |
| 32 |
asm ("some_custom_insn %0,%1,%2" : "=R" (res) : "R" (x), "R" (zero)); |
| 33 |
return res; |
| 34 |
/* This function is IDENTICAL to dual_reg_insn, |
| 35 |
* but for some obscure reason (alignment?) |
| 36 |
* it decides to use sX registers instead of aX to store zero, |
| 37 |
* resulting in a much larger code since it needs to use the stack. |
| 38 |
* THIS ONLY HAPPENS SOMETIMES! |
| 39 |
*/ |
| 40 |
} |
| 41 |
|
| 42 |
int64_t dual_reg_insn_explicit_zero(int64_t x) { |
| 43 |
int64_t res; |
| 44 |
asm ("some_custom_insn %0,%1,%2" : "=R" (res) : "R" (x), "R" (0LL)); |
| 45 |
return res; |
| 46 |
} |