summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.target/arm/wmul-1.c
blob: 426c9393f206b0f1249f43c0697b3aa2bba7f38a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
/* { dg-do compile } */
/* { dg-require-effective-target arm_dsp } */
/* { dg-options "-O2" } */

int mac(const short *a, const short *b, int sqr, int *sum)
{
  int i;
  int dotp = *sum;

  for (i = 0; i < 150; i++) {
    dotp += b[i] * a[i];
    sqr += b[i] * b[i];
  }

  *sum = dotp;
  return sqr;
}

/* { dg-final { scan-assembler-times "smlabb" 2 } } */