Fixing float overflow during area-flow computation in &lf.

This commit is contained in:
Alan Mishchenko 2018-12-13 08:49:00 -08:00
parent 1f016988b2
commit f62eb635d1
1 changed files with 8 additions and 0 deletions

View File

@ -1158,7 +1158,11 @@ static inline void Lf_CutParams( Lf_Man_t * p, Lf_Cut_t * pCut, int Required, fl
if ( pCut->Flow >= (float)1e32 || pBest->Flow[Index] >= (float)1e32 )
pCut->Flow = (float)1e32;
else
{
pCut->Flow += pBest->Flow[Index];
if ( pCut->Flow > (float)1e32 )
pCut->Flow = (float)1e32;
}
}
Delay = pBest->Delay[Index];
}
@ -1172,7 +1176,11 @@ static inline void Lf_CutParams( Lf_Man_t * p, Lf_Cut_t * pCut, int Required, fl
if ( p->fUseEla )
pCut->Flow = Lf_CutAreaDerefed(p, pCut) / FlowRefs;
else
{
pCut->Flow = (pCut->Flow + Lf_CutArea(p, pCut)) / FlowRefs;
if ( pCut->Flow > (float)1e32 )
pCut->Flow = (float)1e32;
}
}
void Lf_ObjMergeOrder( Lf_Man_t * p, int iObj )