summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.target/arm/thumb2-mul-speed.c
blob: 03cccdb654bcfa15dbf8d0da950ca69ab4b1a786 (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
/* Do not use 16-bit multiply instructions in Thumb-2 mode when
   optimizing for speed.  */
/* { dg-options "-mthumb -O2" }  */
/* { dg-require-effective-target arm_thumb2_ok } */
/* { dg-final { scan-assembler-not "muls" } } */

int f(int i, int j) 
{
  return i * j;
}

int x;

void g(int i, int j)
{
  if (i * j < 0)
    x = 1;
}

int h(int i, int j)
{
  i = i * j;
  if (i < 0)
    x = 1;
  return i;
}