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

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

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

  *sum = dotp;
  return sqr;
}

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