summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.target/mips/mips-sched-madd.c
blob: c0f9d332a5944053693e7f3da910c1e4631dffa6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
/* Test for case where another independent multiply insn may interfere
   with a macc chain.  */
/* { dg-do compile } */
/* { dg-options "-Os -march=24kf" } */

NOMIPS16 int foo (int a, int b, int c, int d, int e, int f, int g)
{
  int temp;
  int acc;

  acc = a * b;
  temp = a * c;
  acc = d * e + acc;
  acc = f * g + acc;
  return acc > temp ? acc : temp;
}

/* { dg-final { scan-assembler "\tmult\t" } } */
/* { dg-final { scan-assembler "\tmadd\t" } } */