Testcases for mips conditional move patterns.

* gcc.dg/mips-movcc-1.c: New test.
* gcc.dg/mips-movcc-2.c: New test.
* gcc.dg/mips-movcc-3.c: New test.

From-SVN: r86146
This commit is contained in:
James E Wilson 2004-08-17 21:19:49 +00:00 committed by Jim Wilson
parent 4ef47bd8e0
commit 67e9009398
4 changed files with 96 additions and 0 deletions

View File

@ -1,3 +1,9 @@
2004-08-17 James E Wilson <wilson@specifixinc.com>
* gcc.dg/mips-movcc-1.c: New test.
* gcc.dg/mips-movcc-2.c: New test.
* gcc.dg/mips-movcc-3.c: New test.
2004-08-17 Mark Mitchell <mark@codesourcery.com>
PR c++/15871

View File

@ -0,0 +1,23 @@
/* { dg-do compile { target "mips*-*-*" } } */
/* { dg-options "-O2 -mips4" } */
/* { dg-final { scan-assembler "movz" } } */
/* { dg-final { scan-assembler "movn" } } */
/* { dg-final { scan-assembler "movt" } } */
int
sub1 (int i, int j, int k)
{
return k ? i : j;
}
int
sub2 (int i, int j, long l)
{
return !l ? i : j;
}
int
sub3 (int i, int j, float f)
{
return f ? i : j;
}

View File

@ -0,0 +1,23 @@
/* { dg-do compile { target "mips*-*-*" } } */
/* { dg-options "-O2 -mips4" } */
/* { dg-final { scan-assembler "movz" } } */
/* { dg-final { scan-assembler "movn" } } */
/* { dg-final { scan-assembler "movf" } } */
long
sub4 (long i, long j, long k)
{
return k ? i : j;
}
long
sub5 (long i, long j, int k)
{
return !k ? i : j;
}
long
sub6 (long i, long j, float f)
{
return !f ? i : j;
}

View File

@ -0,0 +1,44 @@
/* { dg-do compile { target "mips*-*-*" } } */
/* { dg-options "-O2 -mips4" } */
/* { dg-final { scan-assembler "movz.s" } } */
/* { dg-final { scan-assembler "movn.s" } } */
/* { dg-final { scan-assembler "movt.s" } } */
/* { dg-final { scan-assembler "movz.d" } } */
/* { dg-final { scan-assembler "movn.d" } } */
/* { dg-final { scan-assembler "movf.d" } } */
float
sub7 (float f, float g, int i)
{
return i ? f : g;
}
float
sub8 (float f, float g, long l)
{
return !l ? f : g;
}
float
sub9 (float f, float g, float h)
{
return h ? f : g;
}
double
suba (double f, double g, int i)
{
return i ? f : g;
}
double
subb (double f, double g, long l)
{
return !l ? f : g;
}
double
subc (double f, double g, double h)
{
return !h ? f : g;
}