summaryrefslogtreecommitdiffstats
path: root/src/misc/util/utilTruth.h
diff options
context:
space:
mode:
authorAlan Mishchenko <alanmi@berkeley.edu>2016-11-26 14:28:12 -0800
committerAlan Mishchenko <alanmi@berkeley.edu>2016-11-26 14:28:12 -0800
commit6b55bf0205f414ca711d92baea115a808fff3dc9 (patch)
tree0a5e1a5c89caf0db42ee0610ef19e8bbb7e784fe /src/misc/util/utilTruth.h
parent64bdbe1a74fcf6343e06caa0dc4f6dae0e621e76 (diff)
downloadabc-6b55bf0205f414ca711d92baea115a808fff3dc9.tar.gz
abc-6b55bf0205f414ca711d92baea115a808fff3dc9.tar.bz2
abc-6b55bf0205f414ca711d92baea115a808fff3dc9.zip
New SAT-based optimization package.
Diffstat (limited to 'src/misc/util/utilTruth.h')
-rw-r--r--src/misc/util/utilTruth.h28
1 files changed, 28 insertions, 0 deletions
diff --git a/src/misc/util/utilTruth.h b/src/misc/util/utilTruth.h
index 5a4ef545..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;