summaryrefslogtreecommitdiffstats
path: root/src/misc/extra/extra.h
diff options
context:
space:
mode:
authorAlan Mishchenko <alanmi@berkeley.edu>2007-04-06 08:01:00 -0700
committerAlan Mishchenko <alanmi@berkeley.edu>2007-04-06 08:01:00 -0700
commit00dc0f3daab81e3a30b7fae3ec4f2c191fce114c (patch)
tree0db78ea60c485e8bc52886031edc9ab2a9dce2f6 /src/misc/extra/extra.h
parent028138a76eb74eee80f1d9592f43bdbe0d4c3d6c (diff)
downloadabc-00dc0f3daab81e3a30b7fae3ec4f2c191fce114c.tar.gz
abc-00dc0f3daab81e3a30b7fae3ec4f2c191fce114c.tar.bz2
abc-00dc0f3daab81e3a30b7fae3ec4f2c191fce114c.zip
Version abc70406
Diffstat (limited to 'src/misc/extra/extra.h')
-rw-r--r--src/misc/extra/extra.h24
1 files changed, 24 insertions, 0 deletions
diff --git a/src/misc/extra/extra.h b/src/misc/extra/extra.h
index 06ba309d..5a98348a 100644
--- a/src/misc/extra/extra.h
+++ b/src/misc/extra/extra.h
@@ -530,6 +530,30 @@ static inline void Extra_TruthNand( unsigned * pOut, unsigned * pIn0, unsigned *
for ( w = Extra_TruthWordNum(nVars)-1; w >= 0; w-- )
pOut[w] = ~(pIn0[w] & pIn1[w]);
}
+static inline void Extra_TruthAndPhase( unsigned * pOut, unsigned * pIn0, unsigned * pIn1, int nVars, int fCompl0, int fCompl1 )
+{
+ int w;
+ if ( fCompl0 && fCompl1 )
+ {
+ for ( w = Extra_TruthWordNum(nVars)-1; w >= 0; w-- )
+ pOut[w] = ~(pIn0[w] | pIn1[w]);
+ }
+ else if ( fCompl0 && !fCompl1 )
+ {
+ for ( w = Extra_TruthWordNum(nVars)-1; w >= 0; w-- )
+ pOut[w] = ~pIn0[w] & pIn1[w];
+ }
+ else if ( !fCompl0 && fCompl1 )
+ {
+ for ( w = Extra_TruthWordNum(nVars)-1; w >= 0; w-- )
+ pOut[w] = pIn0[w] & ~pIn1[w];
+ }
+ else // if ( !fCompl0 && !fCompl1 )
+ {
+ for ( w = Extra_TruthWordNum(nVars)-1; w >= 0; w-- )
+ pOut[w] = pIn0[w] & pIn1[w];
+ }
+}
extern unsigned ** Extra_TruthElementary( int nVars );
extern void Extra_TruthSwapAdjacentVars( unsigned * pOut, unsigned * pIn, int nVars, int Start );