From 8654192586079916c614dc3a4c62a1cdfd459fee Mon Sep 17 00:00:00 2001 From: Alan Mishchenko Date: Sat, 28 Mar 2020 18:45:48 -0700 Subject: Various changes. --- src/misc/extra/extraUtilMisc.c | 10 +++++----- src/misc/util/utilTruth.h | 10 ++++++++++ 2 files changed, 15 insertions(+), 5 deletions(-) (limited to 'src/misc') diff --git a/src/misc/extra/extraUtilMisc.c b/src/misc/extra/extraUtilMisc.c index 5757e0ae..c38369cd 100644 --- a/src/misc/extra/extraUtilMisc.c +++ b/src/misc/extra/extraUtilMisc.c @@ -2653,8 +2653,7 @@ void Extra_BitMatrixTransposeP( Vec_Wrd_t * vSimsIn, int nWordsIn, Vec_Wrd_t * v { word * pM[64]; int i, y, x; assert( Vec_WrdSize(vSimsIn) == Vec_WrdSize(vSimsOut) ); - assert( Vec_WrdSize(vSimsIn) / nWordsIn == 64 * nWordsOut ); - assert( Vec_WrdSize(vSimsOut) / nWordsOut == 64 * nWordsIn ); + assert( Vec_WrdSize(vSimsIn) == 64 * nWordsIn * nWordsOut ); for ( x = 0; x < nWordsOut; x++ ) for ( y = 0; y < nWordsIn; y++ ) { @@ -2669,14 +2668,15 @@ void Extra_BitMatrixTransposeP( Vec_Wrd_t * vSimsIn, int nWordsIn, Vec_Wrd_t * v void Extra_BitMatrixTransposePP( Vec_Ptr_t * vSimsIn, int nWordsIn, Vec_Wrd_t * vSimsOut, int nWordsOut ) { word * pM[64]; int i, y, x; - assert( Vec_WrdSize(vSimsOut) / nWordsOut == 64 * nWordsIn ); + assert( Vec_PtrSize(vSimsIn) == 64 * nWordsOut ); + assert( Vec_WrdSize(vSimsOut) == 64 * nWordsOut * nWordsIn ); for ( x = 0; x < nWordsOut; x++ ) for ( y = 0; y < nWordsIn; y++ ) { for ( i = 0; i < 64; i++ ) { - pM[i] = Vec_WrdEntryP( vSimsOut, (64*y+i)*nWordsOut + x ); - pM[i][0] = ((word *)Vec_PtrEntry( vSimsIn, 64*x+i ))[y]; + pM[i] = Vec_WrdEntryP( vSimsOut, (64*y+63-i)*nWordsOut + x ); + pM[i][0] = ((word *)Vec_PtrEntry( vSimsIn, 64*x+63-i ))[y]; } Extra_Transpose64p( pM ); } diff --git a/src/misc/util/utilTruth.h b/src/misc/util/utilTruth.h index 18bae556..e0ee1720 100644 --- a/src/misc/util/utilTruth.h +++ b/src/misc/util/utilTruth.h @@ -326,6 +326,16 @@ static inline void Abc_TtXor( word * pOut, word * pIn1, word * pIn2, int nWords, for ( w = 0; w < nWords; w++ ) pOut[w] = pIn1[w] ^ pIn2[w]; } +static inline void Abc_TtXorMask( word * pOut, word * pIn1, word * pIn2, word * pMask, int nWords, int fCompl ) +{ + int w; + if ( fCompl ) + for ( w = 0; w < nWords; w++ ) + pOut[w] = (pIn1[w] ^ pIn2[w]) & ~pMask[w]; + else + for ( w = 0; w < nWords; w++ ) + pOut[w] = (pIn1[w] ^ pIn2[w]) & pMask[w]; +} static inline void Abc_TtMux( word * pOut, word * pCtrl, word * pIn1, word * pIn0, int nWords ) { int w; -- cgit v1.2.3