diff options
author | Alan Mishchenko <alanmi@berkeley.edu> | 2020-03-25 12:17:12 -0700 |
---|---|---|
committer | Alan Mishchenko <alanmi@berkeley.edu> | 2020-03-25 12:17:12 -0700 |
commit | a277d450bf7c624392d41739788f115f1d655556 (patch) | |
tree | d24c5a50f62bbc12e0d93b1e78d5be9dfe65c80e /src/misc | |
parent | c7bc6b63298f532270b6c696a6f36545429dfb52 (diff) | |
download | abc-a277d450bf7c624392d41739788f115f1d655556.tar.gz abc-a277d450bf7c624392d41739788f115f1d655556.tar.bz2 abc-a277d450bf7c624392d41739788f115f1d655556.zip |
Experiments with simulation-based engines.
Diffstat (limited to 'src/misc')
-rw-r--r-- | src/misc/util/utilTruth.h | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/misc/util/utilTruth.h b/src/misc/util/utilTruth.h index 3716e9dd..18bae556 100644 --- a/src/misc/util/utilTruth.h +++ b/src/misc/util/utilTruth.h @@ -1835,6 +1835,23 @@ static inline int Abc_TtCountOnesVecMask( word * x, word * pMask, int nWords, in Count += Abc_TtCountOnes( pMask[w] & x[w] ); return Count; } +static inline int Abc_TtCountOnesVecMask2( word * x0, word * x1, int fComp0, int fComp1, word * pMask, int nWords ) +{ + int w, Count = 0; + if ( !fComp0 && !fComp1 ) + for ( w = 0; w < nWords; w++ ) + Count += Abc_TtCountOnes( pMask[w] & x0[w] & x1[w] ); + else if ( fComp0 && !fComp1 ) + for ( w = 0; w < nWords; w++ ) + Count += Abc_TtCountOnes( pMask[w] & ~x0[w] & x1[w] ); + else if ( !fComp0 && fComp1 ) + for ( w = 0; w < nWords; w++ ) + Count += Abc_TtCountOnes( pMask[w] & x0[w] & ~x1[w] ); + else + for ( w = 0; w < nWords; w++ ) + Count += Abc_TtCountOnes( pMask[w] & ~x0[w] & ~x1[w] ); + return Count; +} static inline int Abc_TtCountOnesVecXor( word * x, word * y, int nWords ) { int w, Count = 0; |