diff options
author | Alan Mishchenko <alanmi@berkeley.edu> | 2012-10-31 01:22:16 -0700 |
---|---|---|
committer | Alan Mishchenko <alanmi@berkeley.edu> | 2012-10-31 01:22:16 -0700 |
commit | d8e84ce6662ecf1706dfada3724e6b1e93e51918 (patch) | |
tree | a354f8c769f34ee78f0dd1383db11e61fcdfbee5 /src/misc/util | |
parent | 6f3425150b2b4c0fc2e86036da6cc543973162a0 (diff) | |
download | abc-d8e84ce6662ecf1706dfada3724e6b1e93e51918.tar.gz abc-d8e84ce6662ecf1706dfada3724e6b1e93e51918.tar.bz2 abc-d8e84ce6662ecf1706dfada3724e6b1e93e51918.zip |
Improvements to the truth table computations.
Diffstat (limited to 'src/misc/util')
-rw-r--r-- | src/misc/util/utilTruth.h | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/misc/util/utilTruth.h b/src/misc/util/utilTruth.h index 7909ab86..4c4ced4c 100644 --- a/src/misc/util/utilTruth.h +++ b/src/misc/util/utilTruth.h @@ -1004,6 +1004,8 @@ static inline int Abc_TtCountOnesSlow( word t ) } static inline int Abc_TtCountOnes( word x ) { + if ( x == 0 ) + return 0; x = x - ((x >> 1) & 0x5555555555555555); x = (x & 0x3333333333333333) + ((x >> 2) & 0x3333333333333333); x = (x + (x >> 4)) & 0x0F0F0F0F0F0F0F0F; @@ -1118,8 +1120,8 @@ static inline unsigned Abc_TtSemiCanonicize( word * pTruth, int nVars, char * pC uCanonPhase |= (1 << nVars); } // normalize phase -// Abc_TtCountOnesInCofs( pTruth, nVars, pStore ); - Abc_TtCountOnesInCofsFast( pTruth, nVars, pStore ); + Abc_TtCountOnesInCofs( pTruth, nVars, pStore ); +// Abc_TtCountOnesInCofsFast( pTruth, nVars, pStore ); // Abc_TtCountOnesInCofsFast( pTruth, nVars, pStore2 ); // for ( i = 0; i < nVars; i++ ) |