summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.target/mips/loongson3a-muldiv-1.c
blob: cc15b83ab9340b0a6b9f7fa755083f13a7eefae1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
/* { dg-options "-O2 -march=loongson3a" } */

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 "\tgsmultu\t" 2 } } */
/* { dg-final { scan-assembler-times "\tgsdivu\t" 1 } } */
/* { dg-final { scan-assembler-times "\tgsmodu\t" 1 } } */
/* { dg-final { scan-assembler-times "\tgsdiv\t" 1 } } */
/* { dg-final { scan-assembler-times "\tgsmod\t" 1 } } */