aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/gcc.target/mips/loongson-muldiv-1.c
blob: 2efc3ef3f32fb07c5fe6a911e07fa46f8cc01ceb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
/* { dg-options "isa=loongson" } */

typedef int st;
typedef unsigned int ut;

NOMIPS16 st smul (st x, st y) { return x * y; }
NOMIPS16 st sdiv (st x, st y) { return x / y + x % y; }

NOMIPS16 ut umul (ut x, ut y) { return x * y; }
NOMIPS16 ut udiv (ut x, ut y) { return x / y + x % y; }

/* { dg-final { scan-assembler-times "\tmultu.g\t" 2 } } */
/* { dg-final { scan-assembler-times "\tdivu.g\t" 1 } } */
/* { dg-final { scan-assembler-times "\tmodu.g\t" 1 } } */
/* { dg-final { scan-assembler-times "\tdiv.g\t" 1 } } */
/* { dg-final { scan-assembler-times "\tmod.g\t" 1 } } */