diff options
author | Mathias Soeken <mathias.soeken@gmail.com> | 2016-12-07 10:08:44 +0100 |
---|---|---|
committer | Mathias Soeken <mathias.soeken@gmail.com> | 2016-12-07 10:08:44 +0100 |
commit | 5af44731bff0061c724912cf76e86dddbb4f2c7a (patch) | |
tree | 77ddddb7a79d6424210a7a6b8e8f9649d845d9ba /src/misc | |
parent | f9b7e929045f348ef6ccff9024de3be0c35c2eec (diff) | |
parent | 77ef610919b09ed0f8cb0df50e48a7f9c4b9c553 (diff) | |
download | abc-5af44731bff0061c724912cf76e86dddbb4f2c7a.tar.gz abc-5af44731bff0061c724912cf76e86dddbb4f2c7a.tar.bz2 abc-5af44731bff0061c724912cf76e86dddbb4f2c7a.zip |
Merged alanmi/abc into default
Diffstat (limited to 'src/misc')
-rw-r--r-- | src/misc/util/utilTruth.h | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/src/misc/util/utilTruth.h b/src/misc/util/utilTruth.h index cb567096..b8a34da7 100644 --- a/src/misc/util/utilTruth.h +++ b/src/misc/util/utilTruth.h @@ -266,6 +266,28 @@ static inline void Abc_TtAnd( word * pOut, word * pIn1, word * pIn2, int nWords, for ( w = 0; w < nWords; w++ ) pOut[w] = pIn1[w] & pIn2[w]; } +static inline void Abc_TtAndCompl( word * pOut, word * pIn1, int fCompl1, word * pIn2, int fCompl2, int nWords ) +{ + int w; + if ( fCompl1 ) + { + if ( fCompl2 ) + for ( w = 0; w < nWords; w++ ) + pOut[w] = ~pIn1[w] & ~pIn2[w]; + else + for ( w = 0; w < nWords; w++ ) + pOut[w] = ~pIn1[w] & pIn2[w]; + } + else + { + if ( fCompl2 ) + for ( w = 0; w < nWords; w++ ) + pOut[w] = pIn1[w] & ~pIn2[w]; + else + for ( w = 0; w < nWords; w++ ) + pOut[w] = pIn1[w] & pIn2[w]; + } +} static inline void Abc_TtAndSharp( word * pOut, word * pIn1, word * pIn2, int nWords, int fCompl ) { int w; @@ -288,6 +310,12 @@ static inline void Abc_TtOr( word * pOut, word * pIn1, word * pIn2, int nWords ) for ( w = 0; w < nWords; w++ ) pOut[w] = pIn1[w] | pIn2[w]; } +static inline void Abc_TtOrXor( word * pOut, word * pIn1, word * pIn2, int nWords ) +{ + int w; + for ( w = 0; w < nWords; w++ ) + pOut[w] |= pIn1[w] ^ pIn2[w]; +} static inline void Abc_TtXor( word * pOut, word * pIn1, word * pIn2, int nWords, int fCompl ) { int w; @@ -1603,6 +1631,14 @@ static inline int Abc_TtFindFirstBit( word * pIn, int nVars ) return 64*w + Abc_Tt6FirstBit(pIn[w]); return -1; } +static inline int Abc_TtFindFirstDiffBit( word * pIn1, word * pIn2, int nVars ) +{ + int w, nWords = Abc_TtWordNum(nVars); + for ( w = 0; w < nWords; w++ ) + if ( pIn1[w] ^ pIn2[w] ) + return 64*w + Abc_Tt6FirstBit(pIn1[w] ^ pIn2[w]); + return -1; +} static inline int Abc_TtFindFirstZero( word * pIn, int nVars ) { int w, nWords = Abc_TtWordNum(nVars); |