OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-stable/] [gcc-4.5.1/] [gcc/] [testsuite/] [gcc.dg/] [tree-ssa/] [recip-4.c] - Diff between revs 298 and 816

Go to most recent revision | Only display areas with differences | Details | Blame | View Log

Rev 298 Rev 816
/* { dg-do compile } */
/* { dg-do compile } */
/* { dg-options "-O1 -fno-trapping-math -funsafe-math-optimizations -fdump-tree-recip" } */
/* { dg-options "-O1 -fno-trapping-math -funsafe-math-optimizations -fdump-tree-recip" } */
 
 
/* based on the test case in pr23109 */
/* based on the test case in pr23109 */
 
 
double F[2] = { 0., 0. }, e = 0.;
double F[2] = { 0., 0. }, e = 0.;
 
 
/* Nope, we cannot prove the optimization is worthwhile in this case.  */
/* Nope, we cannot prove the optimization is worthwhile in this case.  */
void f ()
void f ()
{
{
        int i;
        int i;
        double E, W, P, d;
        double E, W, P, d;
 
 
        W = 1.;
        W = 1.;
        d = 2.*e;
        d = 2.*e;
        E = 1. - d;
        E = 1. - d;
 
 
        if( d > 0.01 )
        if( d > 0.01 )
        {
        {
                P = ( W < E ) ? (W - E)/d : (E - W)/d;
                P = ( W < E ) ? (W - E)/d : (E - W)/d;
                F[i] += P;
                F[i] += P;
        }
        }
}
}
 
 
/* We also cannot prove the optimization is worthwhile in this case.  */
/* We also cannot prove the optimization is worthwhile in this case.  */
float g ()
float g ()
{
{
        int i;
        int i;
        double E, W, P, d;
        double E, W, P, d;
 
 
        W = 1.;
        W = 1.;
        d = 2.*e;
        d = 2.*e;
        E = 1. - d;
        E = 1. - d;
 
 
        if( d > 0.01 )
        if( d > 0.01 )
        {
        {
                P = ( W < E ) ? (W - E)/d : (E - W)/d;
                P = ( W < E ) ? (W - E)/d : (E - W)/d;
                F[i] += P;
                F[i] += P;
        }
        }
 
 
        return 1.0 / d;
        return 1.0 / d;
}
}
 
 
/* { dg-final { scan-tree-dump-not "reciptmp" "recip" } } */
/* { dg-final { scan-tree-dump-not "reciptmp" "recip" } } */
/* { dg-final { cleanup-tree-dump "recip" } } */
/* { dg-final { cleanup-tree-dump "recip" } } */
 
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.