| 1 |
/* { dg-options "-mmsa -mfp64 -mhard-float" } */ |
| 2 |
/* { dg-skip-if "code quality test" { *-*-* } { "-O0" } { "" } } */ |
| 3 |
|
| 4 |
/* Check that delay slots for MSA branches are filled. */ |
| 5 |
|
| 6 |
typedef unsigned v4si __attribute__ ((vector_size (16))); |
| 7 |
|
| 8 |
int __attribute__ ((cold)) foo (v4si v , int a, int b) |
| 9 |
{ |
| 10 |
int c = 0xf0f0f0f0; |
| 11 |
int f = __builtin_msa_bnz_w (v); |
| 12 |
|
| 13 |
if (f) |
| 14 |
return a + c; |
| 15 |
else |
| 16 |
return b + c; |
| 17 |
} |
| 18 |
|
| 19 |
int __attribute__ ((cold)) bar (v4si v , int a, int b) |
| 20 |
{ |
| 21 |
int c = 0xf0f0f0f0; |
| 22 |
int f = __builtin_msa_bz_w (v); |
| 23 |
|
| 24 |
if (f) |
| 25 |
return a + c; |
| 26 |
else |
| 27 |
return b + c; |
| 28 |
} |
| 29 |
|
| 30 |
/* We need to avoid over matching here as we could have other |
| 31 |
branches with unfilled slots. So we verify that we do not have |
| 32 |
an MSA branch with a NOP in its delay slot. We need to match |
| 33 |
both forms of the MSA branch that can occur in this test. */ |
| 34 |
/* { dg-final { scan-assembler-not "foo:.*bn\?z.w\[^\\n\\r\]*\\n\\tnop" } } */ |
| 35 |
/* { dg-final { scan-assembler-not "bar:.*bn\?z.w\[^\\n\\r\]*\\n\\tnop" } } */ |