loongson-muldiv-1.c: New test.

gcc/testsuite/
	* gcc.target/mips/loongson-muldiv-1.c: New test.
	* gcc.target/mips/loongson-muldiv-2.c: Likewise.

From-SVN: r141836
This commit is contained in:
Richard Sandiford 2008-11-13 22:49:37 +00:00 committed by Richard Sandiford
parent 1a0f175dd7
commit ffe6ff66ca
3 changed files with 37 additions and 0 deletions

View file

@ -1,3 +1,8 @@
2008-11-13 Richard Sandiford <rdsandiford@googlemail.com>
* gcc.target/mips/loongson-muldiv-1.c: New test.
* gcc.target/mips/loongson-muldiv-2.c: Likewise.
2008-11-13 Jakub Jelinek <jakub@redhat.com>
PR c++/27017

View file

@ -0,0 +1,16 @@
/* { dg-mips-options "-O2 -march=loongson2e" } */
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 } } */

View file

@ -0,0 +1,16 @@
/* { dg-mips-options "-O2 -march=loongson2e -mgp64" } */
typedef long long st;
typedef unsigned long long 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 "\tdmultu.g\t" 2 } } */
/* { dg-final { scan-assembler-times "\tddivu.g\t" 1 } } */
/* { dg-final { scan-assembler-times "\tdmodu.g\t" 1 } } */
/* { dg-final { scan-assembler-times "\tddiv.g\t" 1 } } */
/* { dg-final { scan-assembler-times "\tdmod.g\t" 1 } } */