aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.target/mips/msa-ds.c
blob: 37957a02bd87e25585bfb7327bae418ec207919c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
/* { dg-options "-mmsa -mfp64 -mhard-float" } */
/* { dg-skip-if "code quality test" { *-*-* } { "-O0" } { "" } } */

/* Check that delay slots for MSA branches are filled. */

typedef unsigned v4si __attribute__ ((vector_size (16)));

int __attribute__ ((cold)) foo (v4si v , int a, int b)
{
  int c = 0xf0f0f0f0;
  int f = __builtin_msa_bnz_w (v);

  if (f)
   return a + c;
  else
   return b + c;
}

int __attribute__ ((cold)) bar (v4si v , int a, int b)
{
  int c = 0xf0f0f0f0;
  int f = __builtin_msa_bz_w (v);

  if (f)
   return a + c;
  else
   return b + c;
}

/* We need to avoid over matching here as we could have other
   branches with unfilled slots.  So we verify that we do not have
   an MSA branch with a NOP in its delay slot.  We need to match
   both forms of the MSA branch that can occur in this test.  */
/* { dg-final { scan-assembler-not "foo:.*bn\?z.w\[^\\n\\r\]*\\n\\tnop" } } */
/* { dg-final { scan-assembler-not "bar:.*bn\?z.w\[^\\n\\r\]*\\n\\tnop" } } */